@p4code/cli 0.8.37 → 0.9.1

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 (287) hide show
  1. package/dist/bin.mjs +1 -1
  2. package/dist/{binCli-mInzhqSL.mjs → binCli-B8_9WRM7.mjs} +2563 -2301
  3. package/dist/client/.vite/manifest.json +2008 -2048
  4. package/dist/client/assets/{2NI2N5EU-DVsZziQ3.js → 2NI2N5EU-Cc9Gs6p1.js} +2 -2
  5. package/dist/client/assets/{4UO7MD6I-Cs3yBe-m.js → 4UO7MD6I--tXEX5R9.js} +2 -2
  6. package/dist/client/assets/{5B3SVYGG-CxW0L1iX.js → 5B3SVYGG-CPRAqyzZ.js} +2 -2
  7. package/dist/client/assets/{5GK6JWQ2-Cb25PEnx.js → 5GK6JWQ2-OC2-LRPx.js} +2 -2
  8. package/dist/client/assets/{5N7A7DKN-udLyT643.js → 5N7A7DKN-BUa1-OZ6.js} +2 -2
  9. package/dist/client/assets/{5OC2THR4-DqD-reis.js → 5OC2THR4-DKcwc3u1.js} +2 -2
  10. package/dist/client/assets/{5S6HY5KT-Cy7mIKKq.js → 5S6HY5KT-Dqth6iG8.js} +2 -2
  11. package/dist/client/assets/{6IMQ5BUJ-Qu9PVsT7.js → 6IMQ5BUJ-DmEcg0r1.js} +2 -2
  12. package/dist/client/assets/{6OLKWJ4F-BYzZS9mf.js → 6OLKWJ4F-W-G6qP3r.js} +2 -2
  13. package/dist/client/assets/{74OO7NKP-h3ga2-vb.js → 74OO7NKP-u02yiNi7.js} +2 -2
  14. package/dist/client/assets/{75O6YZUN-ByAK3P56.js → 75O6YZUN-xx4y2KbP.js} +2 -2
  15. package/dist/client/assets/{77XECAW3-D_lZqaZv.js → 77XECAW3-SIARa2Fi.js} +2 -2
  16. package/dist/client/assets/{ABYRPUBD-BPWfXZyu.js → ABYRPUBD-B_0r9NT4.js} +2 -2
  17. package/dist/client/assets/AlertDialogRoot-D5eL1YFA.js +2 -0
  18. package/dist/client/assets/{AnimatedHeight-D0-6CAPr.js → AnimatedHeight-BZhIfVtA.js} +2 -2
  19. package/dist/client/assets/AuthSurfaceShell-DPlJfFlL.js +2 -0
  20. package/dist/client/assets/{BB2UYUI2-CGgafKC2.js → BB2UYUI2-CujjjZN9.js} +2 -2
  21. package/dist/client/assets/{BUM34MOA-Cn4iaSBT.js → BUM34MOA-NuuTH6rj.js} +2 -2
  22. package/dist/client/assets/{CEQABKGZ-CmBEfzh3.js → CEQABKGZ-DDaGayTm.js} +2 -2
  23. package/dist/client/assets/{CXAC5362-xibpmz3Y.js → CXAC5362-CB6ETtV8.js} +2 -2
  24. package/dist/client/assets/{ChatGptUsageButton-DU3PVHJW.js → ChatGptUsageButton-DqJ-vZMe.js} +2 -2
  25. package/dist/client/assets/{ChatMarkdown-D-cNSjFn.js → ChatMarkdown-C94Vrzqf.js} +7 -7
  26. package/dist/client/assets/{CheckboxIndicator-CZCy38xt.js → CheckboxIndicator-DZ8vBLEv.js} +2 -2
  27. package/dist/client/assets/{ClippedText-D_rM_XDj.js → ClippedText-Dswe5Mb4.js} +2 -2
  28. package/dist/client/assets/CodexSetupSection.logic-DOe05Yxb.js +2 -0
  29. package/dist/client/assets/{ComboboxClear-tOmMpuVi.js → ComboboxClear-By718biy.js} +2 -2
  30. package/dist/client/assets/{ComboboxGroupLabel-CgZZIHwV.js → ComboboxGroupLabel-DjWIIS5_.js} +2 -2
  31. package/dist/client/assets/{CommandBlock-6rjypfVF.js → CommandBlock-BUY_4yYG.js} +2 -2
  32. package/dist/client/assets/{ComposerPromptEditor-Dxfhec2W.js → ComposerPromptEditor-BXlsIVOQ.js} +10 -10
  33. package/dist/client/assets/{CompositeRoot-Bsb8efI6.js → CompositeRoot-BFPe8O0M.js} +2 -2
  34. package/dist/client/assets/{ConnectionDiagnosisDetails-Q0M5gCCf.js → ConnectionDiagnosisDetails-DoemNrMF.js} +2 -2
  35. package/dist/client/assets/{ConnectionStatusDot-DAuD0jkU.js → ConnectionStatusDot-wmgCjAfF.js} +2 -2
  36. package/dist/client/assets/{DRLTVNUE-BVseXOzv.js → DRLTVNUE-D0oW6kzx.js} +2 -2
  37. package/dist/client/assets/{DYY6UVD2-Bz33D3dq.js → DYY6UVD2-DBOhEG0-.js} +2 -2
  38. package/dist/client/assets/{DevicePanel-CsSQr7vQ.js → DevicePanel-B5VTFku5.js} +2 -2
  39. package/dist/client/assets/DeviceSetup-C7hesHao.js +2 -0
  40. package/dist/client/assets/{DialogTitle-bcvBtKP-.js → DialogTitle-DNp9zThp.js} +2 -2
  41. package/dist/client/assets/{DiffCommentAnnotation-bhzNqujM.js → DiffCommentAnnotation-DDYXWdY5.js} +2 -2
  42. package/dist/client/assets/{DiffFileTree-BySeJqhq.js → DiffFileTree-SBs4YWHB.js} +2 -2
  43. package/dist/client/assets/{DiffPanel-CCFas4eA.js → DiffPanel-Cd7uZSwI.js} +2 -2
  44. package/dist/client/assets/{DiffWorkerPoolProvider-CkkqWbz-.js → DiffWorkerPoolProvider-elvn0oLt.js} +3 -3
  45. package/dist/client/assets/{EmbeddedDesign-iuThcPT3.js → EmbeddedDesign-BDMR5UJo.js} +2 -2
  46. package/dist/client/assets/{EnvironmentMachineIcon-iUmoTUYt.js → EnvironmentMachineIcon-DBWK6C8T.js} +2 -2
  47. package/dist/client/assets/{ExpandableText-ByCx68yv.js → ExpandableText-B9cfY7p2.js} +2 -2
  48. package/dist/client/assets/{FNOVOB4O-DK3iet1g.js → FNOVOB4O-C55ATzH6.js} +2 -2
  49. package/dist/client/assets/{FieldControl-DtsEariK.js → FieldControl-BOrs67_f.js} +2 -2
  50. package/dist/client/assets/{FileDiff-Bu2BSqBV.js → FileDiff-DpQM5r9o.js} +2 -2
  51. package/dist/client/assets/{FilePreviewPanel-8cI8gciT.js → FilePreviewPanel-DWeewVws.js} +10 -10
  52. package/dist/client/assets/{FoldedSettingsSection-RYq8GTvV.js → FoldedSettingsSection-KMTLX6MR.js} +2 -2
  53. package/dist/client/assets/{FormContext-CIK8MKa2.js → FormContext-DcLeIpxJ.js} +2 -2
  54. package/dist/client/assets/{HDGCDEEZ-B_J1N6RY.js → HDGCDEEZ-BhXkP8CI.js} +2 -2
  55. package/dist/client/assets/{HSJLKHB7-B2SbZQUf.js → HSJLKHB7-ad9jby8d.js} +2 -2
  56. package/dist/client/assets/{Icons-xsXA_L6w.js → Icons-B1qw9fnR.js} +2 -2
  57. package/dist/client/assets/Input-DQflEYBs.js +2 -0
  58. package/dist/client/assets/JZOYTAAL-CifPXszn.js +1 -0
  59. package/dist/client/assets/{K3MD6TGW-VU68yYxr.js → K3MD6TGW-CG-BXshu.js} +2 -2
  60. package/dist/client/assets/{K7RP3OMA-zaD_NBVC.js → K7RP3OMA-Dvs72E71.js} +2 -2
  61. package/dist/client/assets/{KeybindingsSettings.logic-BJe27xmi.js → KeybindingsSettings.logic-BA5WG7V2.js} +2 -2
  62. package/dist/client/assets/{LHDIQX7Q-DCLqoRGy.js → LHDIQX7Q-DBbVLdBb.js} +2 -2
  63. package/dist/client/assets/{LUXOKEGN-CmxZpSzC.js → LUXOKEGN-B8HcSY56.js} +2 -2
  64. package/dist/client/assets/{MathTypeset-Hhqwg4PF.js → MathTypeset-D0cDlCZy.js} +2 -2
  65. package/dist/client/assets/{N3JZAHOW-Cev8Cn9M.js → N3JZAHOW-BXwh9_vP.js} +2 -2
  66. package/dist/client/assets/{NUIALGQ3-CV92Kt25.js → NUIALGQ3-ClxnUm8B.js} +2 -2
  67. package/dist/client/assets/{NoProjectsHero-CMqIlSNl.js → NoProjectsHero-Bn4v5ofT.js} +2 -2
  68. package/dist/client/assets/{O65XPQGZ-bGyTGMsB.js → O65XPQGZ-BEEpAP2l.js} +2 -2
  69. package/dist/client/assets/{O7XIQ6OM-DVdEfB1N.js → O7XIQ6OM-CkSDwviv.js} +2 -2
  70. package/dist/client/assets/{OFQON5FD-Ca_CNS26.js → OFQON5FD-4EbpxjZS.js} +2 -2
  71. package/dist/client/assets/{P4ConnectAccountPages-Buss2oTL.js → P4ConnectAccountPages-DgxvyIGG.js} +2 -2
  72. package/dist/client/assets/{P4ConnectSidebarSignIn-D1n4y6Gq.js → P4ConnectSidebarSignIn-Bn9hP_6_.js} +2 -2
  73. package/dist/client/assets/{PJQHF43J-B__IdKwP.js → PJQHF43J-D_j27v4O.js} +2 -2
  74. package/dist/client/assets/{PanelLayoutControls-EIunk_2Q.js → PanelLayoutControls-BHEJEPDp.js} +7 -7
  75. package/dist/client/assets/{PierreEntryIcon-GQImyog1.js → PierreEntryIcon-BCv2OXDn.js} +2 -2
  76. package/dist/client/assets/{PopoverHandle-Cj5egwXv.js → PopoverHandle-CqjlXffy.js} +2 -2
  77. package/dist/client/assets/PreviewPanel-D3CQGyTY.js +2 -0
  78. package/dist/client/assets/{ProjectDefaultsSettings-DX2Kf-tx.js → ProjectDefaultsSettings-CqigWqDQ.js} +2 -2
  79. package/dist/client/assets/{ProjectFavicon-OMOnEzVu.js → ProjectFavicon-BzkwZEKX.js} +3 -3
  80. package/dist/client/assets/{ProjectIconPickerDialog-Q4GkqwDs.js → ProjectIconPickerDialog-Bl7a1F6c.js} +2 -2
  81. package/dist/client/assets/{ProjectMonogram-Br5sgd24.js → ProjectMonogram-Ba70a8_s.js} +2 -2
  82. package/dist/client/assets/{ProviderAuthTerminal-Q584HoOn.js → ProviderAuthTerminal-BxyDTl04.js} +2 -2
  83. package/dist/client/assets/{ProviderModelPicker-JNM9nJs_.js → ProviderModelPicker-BjWN45iR.js} +2 -2
  84. package/dist/client/assets/{ProviderSettingsForm-CdiKhrJE.js → ProviderSettingsForm-9qRf6JzH.js} +2 -2
  85. package/dist/client/assets/{PullRequestCodeTab-Co76Qf6Z.js → PullRequestCodeTab-2fq1MIQq.js} +3 -3
  86. package/dist/client/assets/{RHNBAITX-Oryl0UiR.js → RHNBAITX-DaSH9fj2.js} +2 -2
  87. package/dist/client/assets/{ReadOnlySourcePreview-aUjexBVb.js → ReadOnlySourcePreview-CUL87R5C.js} +2 -2
  88. package/dist/client/assets/{RenderErrorBoundary-Oe5BzG3n.js → RenderErrorBoundary-CEX4aXRH.js} +2 -2
  89. package/dist/client/assets/{SLD4V6NK-DbsINoTD.js → SLD4V6NK-BPOaMXu1.js} +2 -2
  90. package/dist/client/assets/ScheduledTasksSettings-BEw_vC1N.js +4 -0
  91. package/dist/client/assets/{ScopedSwitch-D8-FelRH.js → ScopedSwitch-DPPAQKgb.js} +2 -2
  92. package/dist/client/assets/{ScrollAreaCorner-nnFi-Ecx.js → ScrollAreaCorner-DF4GCx0d.js} +2 -2
  93. package/dist/client/assets/{SecretInput-CqAhFuNO.js → SecretInput-Dg6ZsU9p.js} +2 -2
  94. package/dist/client/assets/{SelectScrollUpArrow-BQJrvk31.js → SelectScrollUpArrow-DeRXucOo.js} +2 -2
  95. package/dist/client/assets/{SettingsPanels-CNgY_ZPe.js → SettingsPanels-wkOx3NMK.js} +8 -8
  96. package/dist/client/assets/{SettingsPanels.logic-Dr_NyHjE.js → SettingsPanels.logic-BwMoKlP_.js} +2 -2
  97. package/dist/client/assets/{SettingsScopeNotice-BFxCBOnl.js → SettingsScopeNotice-5BIXPKKZ.js} +2 -2
  98. package/dist/client/assets/SidebarStageBackdrop-Cc8Os5aB.js +2 -0
  99. package/dist/client/assets/{T3PCR2KE-2R1FY5zG.js → T3PCR2KE-DF_ihTb_.js} +2 -2
  100. package/dist/client/assets/{TKWO2OVW-BjhIZzCe.js → TKWO2OVW-BpYa7JbN.js} +2 -2
  101. package/dist/client/assets/{TSHNXIZL-B_cvoUct.js → TSHNXIZL-icuUBQJZ.js} +2 -2
  102. package/dist/client/assets/ThemeEditorPanel-K5Z_cKr_.js +5 -0
  103. package/dist/client/assets/{ThreadTerminalDrawer-DHoyxd6-.js → ThreadTerminalDrawer-BEzEKbGr.js} +4 -4
  104. package/dist/client/assets/TooltipViewport-DJXNIjFt.js +2 -0
  105. package/dist/client/assets/{UQJE5E4I-2r98lr05.js → UQJE5E4I-jTtBmXGD.js} +2 -2
  106. package/dist/client/assets/{USNYFO5S-CvTI5t_o.js → USNYFO5S-COMhBWxE.js} +2 -2
  107. package/dist/client/assets/{Virtualizer-BgcEI5KE.js → Virtualizer-3W_tqqHL.js} +2 -2
  108. package/dist/client/assets/{WEVWDWVA-U7ygIdf3.js → WEVWDWVA-DoGSbgZU.js} +2 -2
  109. package/dist/client/assets/{WorkspaceBreadcrumb-_zND61qF.js → WorkspaceBreadcrumb-Dr-p0Dtn.js} +2 -2
  110. package/dist/client/assets/{WorkspacePageContainer-LYv_7Qc0.js → WorkspacePageContainer-MDWEFwmu.js} +2 -2
  111. package/dist/client/assets/{WorkspacePageHeader-B_0ute56.js → WorkspacePageHeader-CNcKDaqG.js} +2 -2
  112. package/dist/client/assets/{X5RFHQXM-D4S0_b0W.js → X5RFHQXM-pFbOarC5.js} +2 -2
  113. package/dist/client/assets/{X62E3GBT-CrIC4h9P.js → X62E3GBT-CSXB08Iw.js} +2 -2
  114. package/dist/client/assets/{XBNEOJTC-D2_RQZjM.js → XBNEOJTC-CvXlFTiB.js} +2 -2
  115. package/dist/client/assets/{YHV2MVVZ-BmAcJLBt.js → YHV2MVVZ-BxyA2-Iu.js} +2 -2
  116. package/dist/client/assets/{YURCZMG2-RCCTu3bv.js → YURCZMG2-WkhL6rVs.js} +2 -2
  117. package/dist/client/assets/{YVG2LODB-Cvp0Ei-1.js → YVG2LODB-BlCOW5Bm.js} +2 -2
  118. package/dist/client/assets/_chat-B72aqP_1.js +45 -0
  119. package/dist/client/assets/{_chat.design-DX1VqYkX.js → _chat.design-BzS-6FDR.js} +2 -2
  120. package/dist/client/assets/{_chat.index-Dzh3d42S.js → _chat.index-DyO0DElX.js} +2 -2
  121. package/dist/client/assets/{_chat.new-BHRvXFPr.js → _chat.new-Dy39C0PE.js} +3 -3
  122. package/dist/client/assets/_chat.pull-requests-Bzb1CyG6.js +2 -0
  123. package/dist/client/assets/{alert-BN-r9V4f.js → alert-DpVw79VA.js} +2 -2
  124. package/dist/client/assets/{assetUrls-B6vsSVWR.js → assetUrls-DSeSTRY1.js} +2 -2
  125. package/dist/client/assets/{assets-CID0y4Uv.js → assets-B_r3wLhD.js} +2 -2
  126. package/dist/client/assets/{browserHistoryStore-CK4YsfkQ.js → browserHistoryStore-BG8TrOnZ.js} +2 -2
  127. package/dist/client/assets/{browserLinkTarget-BJ30b4-s.js → browserLinkTarget-jRu1-WRM.js} +2 -2
  128. package/dist/client/assets/{checkbox-BJhN1L_L.js → checkbox-4yBjrqWQ.js} +2 -2
  129. package/dist/client/assets/{color-picker-D2LwMwlZ.js → color-picker-B6JEgpDa.js} +2 -2
  130. package/dist/client/assets/{combobox-Cw2-7qyI.js → combobox-CKWbcPIR.js} +2 -2
  131. package/dist/client/assets/{command-BIELTYJu.js → command-D8XZec1r.js} +2 -2
  132. package/dist/client/assets/{connect-D4llmZsa.js → connect-a25FIa26.js} +2 -2
  133. package/dist/client/assets/{connect-agent-BlR0FAbF.js → connect-agent-C1UODlly.js} +2 -2
  134. package/dist/client/assets/{design-Cdl1XCBU.js → design-C7HRMO73.js} +2 -2
  135. package/dist/client/assets/{device-Bc5H3PTz.js → device-BNK9g-io.js} +2 -2
  136. package/dist/client/assets/{dialog-BRtKKGzk.js → dialog-_vbB7RKH.js} +2 -2
  137. package/dist/client/assets/{diffRendering-DtBTalAD.js → diffRendering-UEl_19xa.js} +2 -2
  138. package/dist/client/assets/{dist-oE_MNxpZ.js → dist-ATiHSdUa.js} +3 -3
  139. package/dist/client/assets/{draft-input-vviXwx5Q.js → draft-input-C-u_3cDw.js} +2 -2
  140. package/dist/client/assets/{duoViewer-kcp00m8a.js → duoViewer-C7BduYuF.js} +2 -2
  141. package/dist/client/assets/{dynamic-C8_ODyue.js → dynamic-CFqi-4NG.js} +2 -2
  142. package/dist/client/assets/{embeddedScripts-skldQmE1.js → embeddedScripts-BNfDELW_.js} +2 -2
  143. package/dist/client/assets/{empty-rC3eYvxq.js → empty-BlKDGTzb.js} +2 -2
  144. package/dist/client/assets/{entities-B8Vupv5g.js → entities-pafv-XUM.js} +2 -2
  145. package/dist/client/assets/{fileLinks-BoyzENAX.js → fileLinks-pJLWwULO.js} +2 -2
  146. package/dist/client/assets/{fileTreeExpansion-DndrZZAD.js → fileTreeExpansion-CXgwpUPc.js} +2 -2
  147. package/dist/client/assets/{getDiffFileInput-C1QBFdFu.js → getDiffFileInput-eTK8du_O.js} +2 -2
  148. package/dist/client/assets/{guideRunStore-BgFFILxA.js → guideRunStore-83fw4RPw.js} +2 -2
  149. package/dist/client/assets/{htmlRender-ddkOIEbT.js → htmlRender-C3rZ0xgC.js} +2 -2
  150. package/dist/client/assets/{index-BwdieRvq.js → index-C0oEvzQc.js} +3 -3
  151. package/dist/client/assets/{input-BYd74ook.js → input-DXGWoa4O.js} +2 -2
  152. package/dist/client/assets/{input-group-DMFlSk_7.js → input-group-De0xZXfc.js} +2 -2
  153. package/dist/client/assets/{kbd-rp5mX21h.js → kbd-WWNLIkTn.js} +2 -2
  154. package/dist/client/assets/{keybindings-B_kRk5Fi.js → keybindings-DAHl8jIl.js} +2 -2
  155. package/dist/client/assets/{lazy-CeaQ3-Fj.js → lazy-B292152Q.js} +4 -4
  156. package/dist/client/assets/{lazyRouteComponent-COYyJY2H.js → lazyRouteComponent-BU0ER5FO.js} +2 -2
  157. package/dist/client/assets/{link-CsXnX9WM.js → link-C3TbL1do.js} +2 -2
  158. package/dist/client/assets/{linkedPrompt-B5iI7U8H.js → linkedPrompt-BOQDb8-o.js} +2 -2
  159. package/dist/client/assets/main-Cywp3EWc.js +37 -0
  160. package/dist/client/assets/main-DjrB0l0D.css +2 -0
  161. package/dist/client/assets/{mediaReference-ZW7gfO5X.js → mediaReference-onv8z3Oz.js} +2 -2
  162. package/dist/client/assets/{mediaSource-DsT6G6Wm.js → mediaSource-BhEv5iyl.js} +2 -2
  163. package/dist/client/assets/{number-field-CEA6qXbs.js → number-field-qEfih146.js} +2 -2
  164. package/dist/client/assets/{observeResize-DSyLC8QK.js → observeResize-DzSkewug.js} +2 -2
  165. package/dist/client/assets/{onboarding-BPkAEHBV.js → onboarding-y217_KQL.js} +2 -2
  166. package/dist/client/assets/{openFileInPreview-CGM83ICx.js → openFileInPreview-DeuqxJFn.js} +2 -2
  167. package/dist/client/assets/{p4ProjectFile-CwpteA7b.js → p4ProjectFile-BuzidL5M.js} +2 -2
  168. package/dist/client/assets/{pair-D9v8gc0o.js → pair-BjRq2ZHP.js} +2 -2
  169. package/dist/client/assets/{pendingSendStore-BuEVrrEM.js → pendingSendStore-BFVsboDn.js} +2 -2
  170. package/dist/client/assets/{phoneViewer-CNE0SVmy.js → phoneViewer-DYOR2qAi.js} +2 -2
  171. package/dist/client/assets/{pierre-icons-ChDlOt-h.js → pierre-icons-BDVVO9cA.js} +2 -2
  172. package/dist/client/assets/{popover-BjUpdrKu.js → popover-CogH2zM4.js} +2 -2
  173. package/dist/client/assets/{preview-3EscFepc.js → preview-BoTHkmVi.js} +2 -2
  174. package/dist/client/assets/{preview-DHLYKEKb.js → preview-O1ZL8Awg.js} +2 -2
  175. package/dist/client/assets/{previewMiniPlayerStore-DHjQeV1U.js → previewMiniPlayerStore-C5z1mN8S.js} +2 -2
  176. package/dist/client/assets/{primary-NcsmRI6j.js → primary-DiwDV4KJ.js} +2 -2
  177. package/dist/client/assets/{primaryCloudLinkState-DkXIVBHW.js → primaryCloudLinkState-BgmcA0C5.js} +2 -2
  178. package/dist/client/assets/{projectFilesQueryState-0jxJ50Qq.js → projectFilesQueryState-C_yH-05-.js} +2 -2
  179. package/dist/client/assets/{projectScriptEditor-CMGXoIEJ.js → projectScriptEditor-Cu65VaAw.js} +2 -2
  180. package/dist/client/assets/{providerSkills-4hnESoi_.js → providerSkills-CgtkB3rc.js} +2 -2
  181. package/dist/client/assets/{pullRequestDetail.logic-sbOM8yDW.js → pullRequestDetail.logic-FUlKz34F.js} +2 -2
  182. package/dist/client/assets/{pullRequestIcons-B7Om_B_D.js → pullRequestIcons-DPbMXqGp.js} +2 -2
  183. package/dist/client/assets/{pullRequestReviewStore-CIL8WfOG.js → pullRequestReviewStore-BAxwf6rl.js} +2 -2
  184. package/dist/client/assets/{pullRequests-CMTRCOu7.js → pullRequests-C8-SkuQU.js} +2 -2
  185. package/dist/client/assets/{queries-hhl_J8u9.js → queries-BZGM6AjA.js} +2 -2
  186. package/dist/client/assets/{query-CfGzD8v6.js → query-B3Zo1YOE.js} +2 -2
  187. package/dist/client/assets/{radio-group-up2QNXjf.js → radio-group-l1Zl-3hQ.js} +2 -2
  188. package/dist/client/assets/{renderScheduler-Dgqqs-EX.js → renderScheduler-CGMZZETC.js} +2 -2
  189. package/dist/client/assets/{rightPanelStore-CGF0-d-1.js → rightPanelStore-Cv1U3yrU.js} +2 -2
  190. package/dist/client/assets/{runtime-Ca_Z-vg5.js → runtime-BBIAfWJY.js} +3 -3
  191. package/dist/client/assets/{runtime-OeWFs5Hf.js → runtime-CABaKt1A.js} +3 -3
  192. package/dist/client/assets/{runtimeModeConfig-BTG9FTYe.js → runtimeModeConfig-BQ0QCQhj.js} +2 -2
  193. package/dist/client/assets/{scheduledTasksSettings.logic-BeuOnCov.js → scheduledTasksSettings.logic-DFlgKyt2.js} +2 -2
  194. package/dist/client/assets/{scroll-area-BNQKEZbp.js → scroll-area-CQNIjQ8U.js} +2 -2
  195. package/dist/client/assets/{select-D_zHR42Y.js → select-Cbpdz6n3.js} +2 -2
  196. package/dist/client/assets/{selfImproveFindings-CAZ0j1GD.js → selfImproveFindings-CT79AgdK.js} +2 -2
  197. package/dist/client/assets/{server-6nKYyc8r.js → server-mIR8e8Vz.js} +2 -2
  198. package/dist/client/assets/{session-BxUdP61p.js → session-BlCBDyVn.js} +2 -2
  199. package/dist/client/assets/{session-logic-Dr1plzXe.js → session-logic-CwBN7BBv.js} +3 -3
  200. package/dist/client/assets/{settings-DE_hSu0q.js → settings-fTPmNkCr.js} +2 -2
  201. package/dist/client/assets/{settings.appearance-C--uy4It.js → settings.appearance-D96WohbH.js} +2 -2
  202. package/dist/client/assets/settings.archived-CnXEwX0Z.js +2 -0
  203. package/dist/client/assets/{settings.computer-use-DhnqPqMm.js → settings.computer-use-DZTx8sD-.js} +2 -2
  204. package/dist/client/assets/settings.connections-Rl7zwQ75.js +2 -0
  205. package/dist/client/assets/settings.data-controls-DuyfuMcN.js +2 -0
  206. package/dist/client/assets/{settings.decisions-CU-6rIpn.js → settings.decisions-eRAu1hqY.js} +2 -2
  207. package/dist/client/assets/{settings.designs-DHYhhG4k.js → settings.designs-C0RxEgfD.js} +2 -2
  208. package/dist/client/assets/{settings.diagnostics-csgW1_E8.js → settings.diagnostics-BDo1Ma1e.js} +2 -2
  209. package/dist/client/assets/{settings.general-CeBkrL9-.js → settings.general-CpbG8_Ml.js} +2 -2
  210. package/dist/client/assets/{settings.integrations-DqSYBosl.js → settings.integrations-CujbsXfc.js} +2 -2
  211. package/dist/client/assets/{settings.keybindings-C7D1i238.js → settings.keybindings-CQ5xk9v3.js} +2 -2
  212. package/dist/client/assets/{settings.open-source-licenses-6oFDgAt7.js → settings.open-source-licenses-DIBdHSDB.js} +2 -2
  213. package/dist/client/assets/{settings.plugins-DfM65Xio.js → settings.plugins-BbsrwhRq.js} +4 -4
  214. package/dist/client/assets/settings.projects-BeNHSNe9.js +4 -0
  215. package/dist/client/assets/settings.providers-DQT6izvS.js +3 -0
  216. package/dist/client/assets/{settings.scheduled-tasks-Csi8wfij.js → settings.scheduled-tasks-vKCtN-OC.js} +2 -2
  217. package/dist/client/assets/settings.snap-shot-DgPUS-Zo.js +2 -0
  218. package/dist/client/assets/settings.source-control-B87geXn3.js +2 -0
  219. package/dist/client/assets/{settings.storage-DTcg-0aj.js → settings.storage-BYfdzwhk.js} +2 -2
  220. package/dist/client/assets/{settingsLayout-4ySvFdXb.js → settingsLayout-vgYGia0Q.js} +3 -3
  221. package/dist/client/assets/{sidebar-CHDwV4Ca.js → sidebar-BhJqncti.js} +2 -2
  222. package/dist/client/assets/{sidebarProjectGrouping-BcOVY8p-.js → sidebarProjectGrouping-DaMfJpqc.js} +2 -2
  223. package/dist/client/assets/{skeleton-BcLPbojY.js → skeleton-CFtayHTe.js} +2 -2
  224. package/dist/client/assets/{sourceControl-CPrl7cyO.js → sourceControl-CcPqr0UX.js} +2 -2
  225. package/dist/client/assets/{sourceControlClients-oNOd36Cq.js → sourceControlClients-DtjbXUDt.js} +2 -2
  226. package/dist/client/assets/{spinner-_ourbdVb.js → spinner-BZh9P0sD.js} +2 -2
  227. package/dist/client/assets/{terminal-links-DuZi4b83.js → terminal-links-CFKe0iu0.js} +2 -2
  228. package/dist/client/assets/{terminalSessions-D0vbdqqx.js → terminalSessions-0YYscaVr.js} +2 -2
  229. package/dist/client/assets/{textarea-DlXXDHPJ.js → textarea-hXQFbdrS.js} +2 -2
  230. package/dist/client/assets/themePalette-MbAn2gqj.js +5 -0
  231. package/dist/client/assets/{toast-DXWclCrr.js → toast-D26NINYU.js} +2 -2
  232. package/dist/client/assets/{toggle-Dofc34s2.js → toggle-B03MQDgB.js} +2 -2
  233. package/dist/client/assets/{toggle-group-CYKsfBbD.js → toggle-group-yF5GZ53o.js} +2 -2
  234. package/dist/client/assets/{tooltip-CY3W5y-f.js → tooltip-ChmjT8Ns.js} +2 -2
  235. package/dist/client/assets/uiStateStore-CKKy2mq4.js +2 -0
  236. package/dist/client/assets/{usage-DQcgd75_.js → usage-BDFFNkIV.js} +2 -2
  237. package/dist/client/assets/{usageAccess-CCSxXl9X.js → usageAccess-kgUHYKOw.js} +2 -2
  238. package/dist/client/assets/{usageFormat-ByjmRjTe.js → usageFormat-D5Mz5ugL.js} +2 -2
  239. package/dist/client/assets/{usageShortcuts-DOWm0Vo9.js → usageShortcuts-mAekk3eG.js} +2 -2
  240. package/dist/client/assets/{use-atom-command-vqjL7n-x.js → use-atom-command-C4y634Qy.js} +2 -2
  241. package/dist/client/assets/{useAriaLabelledBy-B7FNFpmO.js → useAriaLabelledBy-DjNn9irU.js} +2 -2
  242. package/dist/client/assets/useHandleNewThread-C7ynA68A.js +2 -0
  243. package/dist/client/assets/{useLocation-B_XV0lDx.js → useLocation-Cwv1HZ3K.js} +2 -2
  244. package/dist/client/assets/{useNavigate-BWqAWfiZ.js → useNavigate-Cdrlv-yJ.js} +2 -2
  245. package/dist/client/assets/{useNavigateBack-C52nbvbb.js → useNavigateBack-CwjQ4iuL.js} +2 -2
  246. package/dist/client/assets/{useP4ConnectAuthPrompt-DKhdNYj8.js → useP4ConnectAuthPrompt-5uCMQUT1.js} +2 -2
  247. package/dist/client/assets/{useParams-ekGanxxb.js → useParams-C5D_t-0u.js} +2 -2
  248. package/dist/client/assets/{usePermissionStatus-CWV_yoZe.js → usePermissionStatus-CKmeNk61.js} +2 -2
  249. package/dist/client/assets/{usePullRequestActions-DxtkLQ5D.js → usePullRequestActions-cmzmOrJ-.js} +2 -2
  250. package/dist/client/assets/{useRegisterFieldControl-BAJIcFiO.js → useRegisterFieldControl-DUs9w2Me.js} +2 -2
  251. package/dist/client/assets/{useScopedModelAvailability-815e0x20.js → useScopedModelAvailability-kczZtr1M.js} +2 -2
  252. package/dist/client/assets/useSettings-CHt2_4He.js +3 -0
  253. package/dist/client/assets/utils-CBe1bHL7.js +37 -0
  254. package/dist/client/assets/{vcsRefInvalidation-CW_MIqdt.js → vcsRefInvalidation-CytQodoP.js} +2 -2
  255. package/dist/client/assets/{welcome-k7S47hyM.js → welcome-pbssrwWd.js} +2 -2
  256. package/dist/client/index.html +1 -1
  257. package/dist/{renderer-Ay-1ojn7.mjs → renderer-BBWgEvuE.mjs} +2 -2
  258. package/dist/{runtime-bP6MSuMS.mjs → runtime-DNjlpJkJ.mjs} +286 -242
  259. package/package.json +1 -1
  260. package/dist/client/assets/AlertDialogRoot-BSP6M0Mu.js +0 -2
  261. package/dist/client/assets/AuthSurfaceShell-30QvY1bI.js +0 -2
  262. package/dist/client/assets/CodexSetupSection.logic-g6_GE4bw.js +0 -2
  263. package/dist/client/assets/DeviceSetup-Cl7L9wsi.js +0 -2
  264. package/dist/client/assets/Input-D3Qi4jCN.js +0 -2
  265. package/dist/client/assets/JZOYTAAL-BlxFvoz4.js +0 -1
  266. package/dist/client/assets/PreviewPanel-BkFeksTl.js +0 -2
  267. package/dist/client/assets/ScheduledTasksSettings-1uXNtcPA.js +0 -4
  268. package/dist/client/assets/ThemeEditorPanel-B7MiqZ90.js +0 -5
  269. package/dist/client/assets/TooltipViewport-ThbbZQDo.js +0 -2
  270. package/dist/client/assets/_chat-CwO3_WVM.js +0 -45
  271. package/dist/client/assets/_chat.pull-requests-BZilN1TK.js +0 -2
  272. package/dist/client/assets/composer-logic-P-jVPXi4.js +0 -6
  273. package/dist/client/assets/composerDraftUploads-S66xDlS0.js +0 -2
  274. package/dist/client/assets/main-DdVSHl80.css +0 -2
  275. package/dist/client/assets/main-VfCRP294.js +0 -29
  276. package/dist/client/assets/settings.archived-D-55XnxQ.js +0 -2
  277. package/dist/client/assets/settings.connections-BPVLazeK.js +0 -2
  278. package/dist/client/assets/settings.data-controls-CIzGvqCI.js +0 -2
  279. package/dist/client/assets/settings.projects-CeoZzdMW.js +0 -4
  280. package/dist/client/assets/settings.providers-BBgppyE3.js +0 -3
  281. package/dist/client/assets/settings.snap-shot-BdVdSIJy.js +0 -2
  282. package/dist/client/assets/settings.source-control-Bme3qg7j.js +0 -2
  283. package/dist/client/assets/themePalette-VIM7Gehx.js +0 -5
  284. package/dist/client/assets/uiStateStore-CdkBStdp.js +0 -6
  285. package/dist/client/assets/useHandleNewThread-BYNZXzR_.js +0 -2
  286. package/dist/client/assets/useSettings-gPlpTIWi.js +0 -3
  287. package/dist/client/assets/utils-DhUt689t.js +0 -37
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProviderAuthTerminal-Q584HoOn.js","assets/react-DH3P2YXY.js","assets/jsx-runtime-BnjsACtP.js","assets/useSettings-gPlpTIWi.js","assets/utils-DhUt689t.js","assets/activity-BT9zGwI4.js","assets/createLucideIcon-BRvysHna.js","assets/Icon-BiSXef-P.js","assets/alarm-clock-DLm_0oDD.js","assets/app-window-CBNJqZPl.js","assets/archive-D_14z4Xm.js","assets/arrow-down-up-Tu6B2hri.js","assets/arrow-down-Bo_WAMYh.js","assets/arrow-left-Ba8eq_9S.js","assets/arrow-right-left-DyJucsB1.js","assets/arrow-right-Bg4mlTrk.js","assets/arrow-up-down-AigUcA_4.js","assets/arrow-up-left-C6F8l2kC.js","assets/arrow-up-right-BNXlwlzJ.js","assets/arrow-up-D4kutFpL.js","assets/battery-DdftvRcq.js","assets/bell-4pS2DvJU.js","assets/blocks-N48yRCu0.js","assets/book-open-m1zikk07.js","assets/bookmark-DCumPe18.js","assets/bot-C71zefL3.js","assets/box-N7KHNXgQ.js","assets/bug-_77C5nd4.js","assets/calendar-arrow-down-tK2df2Gr.js","assets/calendar-arrow-up-DoqzmS-b.js","assets/calendar-clock-D24iG-gJ.js","assets/calendar-CuDpKI2e.js","assets/camera-CRxcom4Z.js","assets/chart-no-axes-column-CWRXr09M.js","assets/check-Cs_SSACZ.js","assets/chevron-down-Do9qqNbR.js","assets/chevron-left-D56AngEd.js","assets/chevron-right-CcbZ6PxZ.js","assets/chevron-up-CZEzk9UW.js","assets/chevrons-left-right-ellipsis-BuDdURW0.js","assets/chevrons-up-down-CMYBD15h.js","assets/chromium-IRgsGkxl.js","assets/circle-alert-Rh3WFq8P.js","assets/circle-arrow-up-CBkBThPI.js","assets/circle-check-Davl0yih.js","assets/circle-dashed-Divqvc3s.js","assets/circle-dot-DDXvyPkX.js","assets/circle-slash-BHppGVB2.js","assets/circle-x-DCG47j33.js","assets/circle-BXaepj2J.js","assets/clock-3-BjqRuWmx.js","assets/clock-BZce7MqL.js","assets/cloud-download-Cw2Qyeof.js","assets/cloud-upload-Bbq2IGQX.js","assets/cloud-Cnpuf424.js","assets/code-xml-C7_RVxwx.js","assets/code-C8ZFD3fi.js","assets/columns-2-R7e6oP5f.js","assets/copy-C6t_ZU58.js","assets/corner-left-up-CIgtHeD1.js","assets/corner-up-right-BWhPHx5s.js","assets/cpu-4YV41FL_.js","assets/database-0EoDfSWv.js","assets/download-CfEwtjBn.js","assets/earth-B0lYBmT1.js","assets/ellipsis-vertical-BM1Lc1f1.js","assets/ellipsis-CSD7gEuG.js","assets/external-link-Df6uBnqH.js","assets/eye-off-D5GkPp8X.js","assets/eye-DlWBkL1d.js","assets/file-braces-DycW5IfR.js","assets/file-code-corner-Bph0gpk_.js","assets/file-diff-uE_kfwjO.js","assets/file-search-BxZuGCW_.js","assets/file-spreadsheet-BDzNPY8g.js","assets/file-text-Bn72KOhu.js","assets/file-DHjVYhLT.js","assets/files-DsO7Sg8V.js","assets/film-Bbn0ceXE.js","assets/flask-conical-Cg6idKdH.js","assets/folder-closed-D6kbWc3q.js","assets/folder-cog-CBSQaLA2.js","assets/folder-git-2-n1sLmp_t.js","assets/folder-git-DCVI-R4l.js","assets/folder-open-Bu-nFCGY.js","assets/folder-plus-wg03g0vP.js","assets/folder-tree-FUExeKOH.js","assets/folder-Cieksypr.js","assets/gauge-Cgf0xSWC.js","assets/git-branch-plus-GXmZfN57.js","assets/git-branch-BWQfoO37.js","assets/git-commit-horizontal-BI_Z5Kib.js","assets/git-fork-CK2oK4JM.js","assets/git-merge-CH86CpaI.js","assets/git-pull-request-arrow-BYmuTHnq.js","assets/git-pull-request-closed-EzDnMgeA.js","assets/git-pull-request-draft-DbMmZ9EC.js","assets/globe-DHq8q48U.js","assets/grip-vertical-sTbvrVma.js","assets/hammer-BnFrycrq.js","assets/hard-drive-CnhXqMSu.js","assets/hat-glasses-C1sL_lJD.js","assets/history-BOloOry4.js","assets/house-LvUaI36y.js","assets/image-DFl_i29V.js","assets/inbox-Bfua4pqw.js","assets/info-Bwtivk15.js","assets/keyboard-C94dd8zf.js","assets/laptop-BJfWDOqH.js","assets/layers-BczY2xKh.js","assets/lightbulb-AbDNyk1F.js","assets/link-2-J9n7Ukgt.js","assets/link-iM9yOrD5.js","assets/list-checks--PgwqWme.js","assets/list-filter-C7uwdO5w.js","assets/list-ordered-JmJCtT6d.js","assets/list-todo-BOZtqLIw.js","assets/list-BNel2JmV.js","assets/loader-circle-DOPuwGUy.js","assets/lock-open-qdfB-3sG.js","assets/lock-CNeMaiIX.js","assets/log-in-DuxSLs9h.js","assets/mail-DrFNo5rr.js","assets/maximize-2-C4jSdiqI.js","assets/maximize-BKkQJR3r.js","assets/memory-stick-yVhfpVno.js","assets/message-circle-question-mark-qR5q6Xbi.js","assets/message-circle-qu3riBnu.js","assets/message-square-dashed-BDjE-epL.js","assets/message-square-off-BF3vA0b4.js","assets/message-square-text-CfjrqiSr.js","assets/message-square-warning-6MHWBWO6.js","assets/message-square-B2NO3ViY.js","assets/messages-square-BDA1tcVi.js","assets/minimize-2-D1qaBNiP.js","assets/minus-DVH2v7vL.js","assets/monitor-DYdSXGUQ.js","assets/moon-z0kk2bkY.js","assets/mouse-pointer-2-BzC5PGDm.js","assets/mouse-pointer-click-_zj1O0gg.js","assets/octagon-alert-BQp6gUkE.js","assets/package-plus-DaYcLmCH.js","assets/package-BDRaz7Ff.js","assets/paintbrush-Cd3ye7YJ.js","assets/palette-DWDYvvRF.js","assets/panel-bottom-DX8HINCH.js","assets/panel-left-aKsqIRJO.js","assets/panel-right-XrDzcWDK.js","assets/paperclip-BAtVoM2Q.js","assets/panels-top-left-ug17nD5b.js","assets/pen-line-BtsHFcuV.js","assets/pencil-ruler-u4ck96IX.js","assets/pencil-CS36_8K6.js","assets/picture-in-picture-2-CTTZM7s_.js","assets/pilcrow-B0pICPe4.js","assets/pin-B28emPdt.js","assets/play-utur7gJ1.js","assets/plug-2-BbsYUlrD.js","assets/plus-BFikiw2m.js","assets/plug-Cz_1a3P7.js","assets/power-lnBvrj1p.js","assets/presentation-DuhP07nk.js","assets/puzzle-_xVT2Tkf.js","assets/qr-code-8OyojaA-.js","assets/quote-CY1r_9f2.js","assets/radio-tower-CQ9UBgC-.js","assets/redo-2-CMJUpQN9.js","assets/refresh-cw-Bb4DfPZ_.js","assets/rotate-ccw-DIk8O74I.js","assets/rotate-cw-BCqL9vBU.js","assets/route-DDK4p_jp.js","assets/rows-3-KtFgL-bn.js","assets/scale-BWqluNv-.js","assets/search-2NYXmfL3.js","assets/send-Usbx4MSt.js","assets/server-C5VT7--0.js","assets/settings-2-CG9Vl9Oj.js","assets/settings-CSrjOUO8.js","assets/shield-check-BhnliHga.js","assets/shield-question-mark-DJzZ_XtG.js","assets/shield-Bo3bXsl5.js","assets/sliders-horizontal-CbQdxecl.js","assets/smartphone-DLXjLUvY.js","assets/smile-plus-B6sk7n9M.js","assets/sparkles-D72pVUsJ.js","assets/square-arrow-out-up-right-D4Y8_c2a.js","assets/square-pen-B9IATJSK.js","assets/square-split-horizontal-BEBi5lgX.js","assets/square-split-vertical-BvRRvh2L.js","assets/square-terminal-MebNo2O3.js","assets/square-ChD_5l-9.js","assets/star-BFGG9hcF.js","assets/sun-CV31Z7e1.js","assets/tag-DAyj5h5G.js","assets/target-DRkzkaHT.js","assets/terminal-Dbk8nKIT.js","assets/text-align-start-BlQ02nAY.js","assets/text-search-CmNwvT1W.js","assets/text-wrap-Y7SHIazH.js","assets/ticket-B3TOD4z9.js","assets/trash-2-vrfXuXSc.js","assets/trending-down-0HJRpRPf.js","assets/trending-up-B0AABrFJ.js","assets/triangle-alert-DcIYyjDc.js","assets/type-CcxvYAFU.js","assets/undo-2-CbzuoKHe.js","assets/unlink-2-Cu9CVRNc.js","assets/unplug-D0qX6EAT.js","assets/upload-_7gAV2BZ.js","assets/user-check-vIX5oc4W.js","assets/user-lock-Bz0imDJs.js","assets/user-plus-6mh3DQc1.js","assets/user-round-x-Dyi0-TdA.js","assets/user-round-CdU_AaX_.js","assets/users-CfjzCdxE.js","assets/wifi-off-DzVPlURa.js","assets/workflow-DbsdAT4Y.js","assets/wrench-Bjp_8iLx.js","assets/x-CJgPyqpa.js","assets/zap-C_GfNMdZ.js","assets/runtime-OeWFs5Hf.js","assets/runtime-Ca_Z-vg5.js","assets/toast-DXWclCrr.js","assets/TooltipViewport-ThbbZQDo.js","assets/spinner-_ourbdVb.js","assets/useParams-ekGanxxb.js","assets/server-6nKYyc8r.js","assets/session-BxUdP61p.js","assets/use-atom-command-vqjL7n-x.js","assets/themePalette-VIM7Gehx.js","assets/ThreadTerminalDrawer-DHoyxd6-.js","assets/rightPanelStore-CGF0-d-1.js","assets/fileLinks-BoyzENAX.js","assets/toastHelpers-DxXYm50b.js","assets/tooltip-CY3W5y-f.js","assets/env-wK1YYxA8.js","assets/observeResize-DSyLC8QK.js","assets/browserHistoryStore-CK4YsfkQ.js","assets/entities-B8Vupv5g.js","assets/preview-DHLYKEKb.js","assets/keybindings-B_kRk5Fi.js","assets/preview-3EscFepc.js","assets/browserLinkTarget-BJ30b4-s.js","assets/popover-BjUpdrKu.js","assets/PopoverHandle-Cj5egwXv.js","assets/terminal-links-DuZi4b83.js","assets/terminalSessions-D0vbdqqx.js","assets/query-CfGzD8v6.js","assets/terminalLabels-BgLOlb2G.js","assets/main-VfCRP294.js","assets/index-BwdieRvq.js","assets/vcsRefInvalidation-CW_MIqdt.js","assets/number-field-CEA6qXbs.js","assets/useRegisterFieldControl-BAJIcFiO.js","assets/FormContext-CIK8MKa2.js","assets/CSPContext-DGVCKkcb.js","assets/select-D_zHR42Y.js","assets/SelectScrollUpArrow-BQJrvk31.js","assets/link-CsXnX9WM.js","assets/redirect-D3L17tzd.js","assets/lazyRouteComponent-COYyJY2H.js","assets/useNavigate-BWqAWfiZ.js","assets/useLocation-B_XV0lDx.js","assets/queries-hhl_J8u9.js","assets/diffRendering-DtBTalAD.js","assets/session-logic-Dr1plzXe.js","assets/htmlRender-ddkOIEbT.js","assets/mediaSource-DsT6G6Wm.js","assets/mediaReference-ZW7gfO5X.js","assets/usageFormat-ByjmRjTe.js","assets/timestampFormat-wac2e_Jz.js","assets/skeleton-BcLPbojY.js","assets/useAriaLabelledBy-B7FNFpmO.js","assets/toggle-Dofc34s2.js","assets/toggle-group-CYKsfBbD.js","assets/CompositeRoot-Bsb8efI6.js","assets/input-BYd74ook.js","assets/Input-D3Qi4jCN.js","assets/FieldControl-DtsEariK.js","assets/scroll-area-BNQKEZbp.js","assets/ScrollAreaCorner-nnFi-Ecx.js","assets/dist-oE_MNxpZ.js","assets/DialogTitle-bcvBtKP-.js","assets/dialog-BRtKKGzk.js","assets/sidebar-CHDwV4Ca.js","assets/useResizeDrag-Dc7crya0.js","assets/AnimatedHeight-D0-6CAPr.js","assets/assets-CID0y4Uv.js","assets/sourceControl-CPrl7cyO.js","assets/assetUrls-B6vsSVWR.js","assets/openFileInPreview-CGM83ICx.js","assets/Icons-xsXA_L6w.js","assets/PierreEntryIcon-GQImyog1.js","assets/pierre-icons-ChDlOt-h.js","assets/RenderErrorBoundary-Oe5BzG3n.js","assets/sourceControlClients-oNOd36Cq.js","assets/pullRequestIcons-B7Om_B_D.js","assets/pullRequests-CMTRCOu7.js","assets/threadSort-Bd2rijEy.js","assets/ProjectFavicon-OMOnEzVu.js","assets/ProjectMonogram-Br5sgd24.js","assets/projectFilesQueryState-0jxJ50Qq.js","assets/checkbox-BJhN1L_L.js","assets/CheckboxIndicator-CZCy38xt.js","assets/FieldItemContext-BsKb7ObC.js","assets/AlertDialogRoot-BSP6M0Mu.js","assets/uiStateStore-CdkBStdp.js","assets/composer-logic-P-jVPXi4.js","assets/composerTrigger-BGi0iyhl.js","assets/useHandleNewThread-BYNZXzR_.js","assets/p4ProjectFile-CwpteA7b.js","assets/composerDraftUploads-S66xDlS0.js","assets/guideRunStore-BgFFILxA.js","assets/pullRequestDetail.logic-sbOM8yDW.js","assets/pullRequestReviewStore-CIL8WfOG.js","assets/sidebarProjectGrouping-BcOVY8p-.js","assets/EnvironmentMachineIcon-iUmoTUYt.js","assets/alert-BN-r9V4f.js","assets/semver-CFbvOQKc.js","assets/ChatGptUsageButton-DU3PVHJW.js","assets/kbd-rp5mX21h.js","assets/settingsLayout-4ySvFdXb.js","assets/WorkspacePageContainer-LYv_7Qc0.js","assets/KeybindingsSettings.logic-BJe27xmi.js","assets/usageShortcuts-DOWm0Vo9.js","assets/primaryCloudLinkState-DkXIVBHW.js","assets/command-BIELTYJu.js","assets/ComboboxClear-tOmMpuVi.js","assets/ComboboxGroupLabel-CgZZIHwV.js","assets/ConnectionStatusDot-DAuD0jkU.js","assets/standalone-page-3TM7ZX16.js","assets/primary-NcsmRI6j.js","assets/onboarding-BPkAEHBV.js","assets/scheduledTasksSettings.logic-BeuOnCov.js","assets/main-DdVSHl80.css"])))=>i.map(i=>d[i]);
2
- import{a as e,t}from"./react-DH3P2YXY.js";import{t as n}from"./index-BwdieRvq.js";import{n as r,t as i}from"./jsx-runtime-BnjsACtP.js";import{$_ as a,$d as o,Dl as s,Dm as c,F_ as l,Ft as u,HT as d,Hs as f,Hu as p,I_ as m,J_ as h,Jn as g,Js as _,Lm as v,M_ as y,Md as b,N_ as x,PT as S,P_ as C,Ps as w,Rt as T,Uh as E,Vp as D,Wh as O,Ws as k,X_ as A,Xf as ee,Yp as j,Yt as M,dd as te,dr as N,f_ as P,id as F,if as I,kd as L,kh as R,ld as z,lm as B,of as ne,qT as re,q_ as ie,rh as V,t as ae,td as oe,ts as H,uh as U,yT as se}from"./utils-DhUt689t.js";import{R as ce,W as le,_t as W}from"./runtime-OeWFs5Hf.js";import{T as G,w as ue}from"./entities-B8Vupv5g.js";import{Dt as de,_ as K}from"./runtime-Ca_Z-vg5.js";import{M as fe,N as pe,l as me}from"./TooltipViewport-ThbbZQDo.js";import{a as he,i as ge,n as _e,r as ve,t as ye}from"./number-field-CEA6qXbs.js";import{a as q,c as be,o as xe,s as J,t as Y}from"./select-D_zHR42Y.js";import{t as Se}from"./spinner-_ourbdVb.js";import{i as Ce,m as we,p as Te}from"./toast-DXWclCrr.js";import{E as Ee,I as De,O as Oe,_ as ke,b as Ae,f as je,m as Me,q as Ne,y as Pe,z as Fe}from"./useSettings-gPlpTIWi.js";import{f as X,t as Ie}from"./server-6nKYyc8r.js";import{a as Le,i as Re,n as ze}from"./session-BxUdP61p.js";import{n as Be}from"./query-CfGzD8v6.js";import{t as Z}from"./use-atom-command-vqjL7n-x.js";import{t as Ve}from"./toastHelpers-DxXYm50b.js";import{u as He}from"./timestampFormat-wac2e_Jz.js";import{a as Ue,n as We,t as Ge}from"./tooltip-CY3W5y-f.js";import{i as Ke,n as qe,r as Je}from"./radio-group-up2QNXjf.js";import{n as Ye,t as Xe}from"./toggle-group-CYKsfBbD.js";import{t as Ze}from"./input-BYd74ook.js";import{t as Qe}from"./scroll-area-BNQKEZbp.js";import{a as $e,c as et,i as tt,o as nt,r as rt,s as it,t as at}from"./dialog-BRtKKGzk.js";import{a as ot,i as st,n as ct,o as lt,r as ut,t as dt}from"./empty-rC3eYvxq.js";import{i as ft,n as pt,o as mt,t as ht}from"./popover-BjUpdrKu.js";import{n as gt,r as _t,t as vt}from"./input-group-DMFlSk_7.js";import{i as yt,n as bt,r as xt,t as St}from"./color-picker-D2LwMwlZ.js";import{n as Ct}from"./EnvironmentMachineIcon-iUmoTUYt.js";import{r as wt,t as Tt}from"./alert-BN-r9V4f.js";import{i as Et,n as Dt}from"./ChatGptUsageButton-DU3PVHJW.js";import{V as Ot,W as kt,a as At,f as jt,i as Mt,r as Nt,s as Pt,t as Ft,u as It}from"./settingsLayout-4ySvFdXb.js";import{n as Lt,r as Rt,t as zt}from"./ConnectionStatusDot-DAuD0jkU.js";import{Ar as Bt,Bn as Vt,Fr as Ht,Hn as Ut,Ir as Wt,Lr as Gt,Mr as Kt,Nr as qt,Oa as Jt,Pr as Yt,Rr as Xt,Un as Zt,Vn as Qt,Wn as $t,da as en,fa as tn,fr as nn,ir as rn,jr as an,ma as on,pa as sn,r as cn,ua as ln,va as un,vi as dn,yr as fn,zn as pn}from"./main-VfCRP294.js";import{t as mn}from"./draft-input-vviXwx5Q.js";import{i as hn,l as gn,r as _n,t as vn}from"./SettingsPanels.logic-Dr_NyHjE.js";import{t as yn}from"./FoldedSettingsSection-RYq8GTvV.js";import{t as bn}from"./ExpandableText-ByCx68yv.js";import{t as xn}from"./SecretInput-CqAhFuNO.js";import{a as Sn,c as Cn,i as wn,n as Tn,o as En,p as Dn,r as On,s as kn,t as An}from"./CodexSetupSection.logic-g6_GE4bw.js";import{n as jn,t as Mn}from"./ProviderSettingsForm-CdiKhrJE.js";var Nn=r(),Q=e(t(),1),$=e(i(),1),Pn=`#2563eb`;function Fn(e){let t=(0,Nn.c)(29),{onCommit:n}=e,r;t[0]===e.value?r=t[1]:(r=()=>xt(e.value),t[0]=e.value,t[1]=r);let[i,a]=(0,Q.useState)(r),o;t[2]!==i.h||t[3]!==i.s||t[4]!==i.v?(o=yt(i.h,i.s,i.v),t[2]=i.h,t[3]=i.s,t[4]=i.v,t[5]=o):o=t[5];let s=o,[c,l]=(0,Q.useState)(null),u;t[6]===n?u=t[7]:(u=e=>{a(e),n(yt(e.h,e.s,e.v))},t[6]=n,t[7]=u);let d=u,f;t[8]!==d||t[9]!==i?(f=(0,$.jsx)(bt,{label:`Accent color`,value:i,onChange:d,variant:`edge`}),t[8]=d,t[9]=i,t[10]=f):f=t[10];let p;t[11]!==d||t[12]!==i?(p=e=>d({...i,h:e}),t[11]=d,t[12]=i,t[13]=p):p=t[13];let m;t[14]!==i.h||t[15]!==p?(m=(0,$.jsx)(St,{label:`Accent color hue`,value:i.h,onChange:p}),t[14]=i.h,t[15]=p,t[16]=m):m=t[16];let h=c??s,g;t[17]===e?g=t[18]:(g=t=>{let n=t.currentTarget.value;l(n),/^#[\da-f]{6}$/i.test(n)&&(a(xt(n)),e.onCommit(n))},t[17]=e,t[18]=g);let _;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>l(null),t[19]=_):_=t[19];let v;t[20]!==h||t[21]!==g?(v=(0,$.jsx)(Ze,{nativeInput:!0,size:`compact`,value:h,onChange:g,onBlur:_,font:`mono`,"aria-label":`Custom hex accent color`,spellCheck:!1}),t[20]=h,t[21]=g,t[22]=v):v=t[22];let y;t[23]!==m||t[24]!==v?(y=(0,$.jsxs)(`div`,{className:`grid gap-3 p-3`,children:[m,v]}),t[23]=m,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==y||t[27]!==f?(b=(0,$.jsxs)(`div`,{className:`w-56 bg-popover`,children:[f,y]}),t[26]=y,t[27]=f,t[28]=b):b=t[28],b}function In(e){let t=(0,Nn.c)(22),n;t[0]===e.value?n=t[1]:(n=M(e.value),t[0]=e.value,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i=r?{backgroundColor:r}:void 0,t[2]=r,t[3]=i);let a=`${r?`Change`:`Add`} accent color for ${e.displayName}`,o;t[4]===r?o=t[5]:(o=r?(0,$.jsx)(`span`,{className:`sr-only`,children:`Change accent color`}):(0,$.jsx)(j,{"aria-hidden":!0}),t[4]=r,t[5]=o);let s;t[6]!==i||t[7]!==a||t[8]!==o?(s=(0,$.jsx)(mt,{render:(0,$.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost-muted`,style:i,"aria-label":a,children:o})}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9];let c=r??Pn,l;t[10]!==e.onCommit||t[11]!==c?(l=(0,$.jsx)(Fn,{value:c,onCommit:e.onCommit}),t[10]=e.onCommit,t[11]=c,t[12]=l):l=t[12];let u;t[13]!==r||t[14]!==e.onClear?(u=r?(0,$.jsx)(`div`,{className:`border-t border-border/60 p-1`,children:(0,$.jsx)(pt,{render:(0,$.jsxs)(N,{type:`button`,size:`compact`,variant:`ghost-muted`,className:`w-full justify-start`,onClick:e.onClear,children:[(0,$.jsx)(V,{className:`size-3.5`,"aria-hidden":!0}),`Clear color`]})})}):null,t[13]=r,t[14]=e.onClear,t[15]=u):u=t[15];let d;t[16]!==l||t[17]!==u?(d=(0,$.jsxs)(ft,{side:`bottom`,align:`start`,sideOffset:6,padding:`none`,children:[l,u]}),t[16]=l,t[17]=u,t[18]=d):d=t[18];let f;return t[19]!==s||t[20]!==d?(f=(0,$.jsxs)(ht,{children:[s,d]}),t[19]=s,t[20]=d,t[21]=f):f=t[21],f}function Ln(e){let t=(0,Nn.c)(28),{commitDelayMs:n,description:r,displayName:i,layout:a,onCommit:o,value:s}=e,c=n===void 0?0:n,l=a===void 0?`stacked`:a,u;t[0]===s?u=t[1]:(u=()=>s??``,t[0]=s,t[1]=u);let[d,f]=(0,Q.useState)(u),p=(0,Q.useRef)(null),m=(0,Q.useRef)(null),h=(0,Q.useRef)(o),g,_;t[2]===o?(g=t[3],_=t[4]):(g=()=>{h.current=o},_=[o],t[2]=o,t[3]=g,t[4]=_),(0,Q.useEffect)(g,_);let v,y;t[5]===s?(v=t[6],y=t[7]):(v=()=>{m.current===null&&f(s??``)},y=[s],t[5]=s,t[6]=v,t[7]=y),(0,Q.useEffect)(v,y);let b,x;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>()=>{p.current!==null&&clearTimeout(p.current);let e=m.current;e!==null&&h.current(e)},x=[],t[8]=b,t[9]=x):(b=t[8],x=t[9]),(0,Q.useEffect)(b,x);let S;t[10]!==c||t[11]!==o?(S=e=>{let t=M(e)??``;if(f(t),c<=0){m.current=null,p.current!==null&&(clearTimeout(p.current),p.current=null),o(t);return}m.current=t,p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{p.current=null;let e=m.current;m.current=null,e!==null&&h.current(e)},c)},t[10]=c,t[11]=o,t[12]=S):S=t[12];let C=S,w;t[13]===d?w=t[14]:(w=M(d),t[13]=d,t[14]=w);let T=w,E;t[15]===C?E=t[16]:(E=()=>C(``),t[15]=C,t[16]=E);let D;t[17]!==C||t[18]!==i||t[19]!==T||t[20]!==E?(D=(0,$.jsx)(In,{displayName:i,value:T,onCommit:C,onClear:E}),t[17]=C,t[18]=i,t[19]=T,t[20]=E,t[21]=D):D=t[21];let O=D;if(l===`inline`)return O;let k;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Accent color`}),t[22]=k):k=t[22];let A;t[23]===r?A=t[24]:(A=r?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r}):null,t[23]=r,t[24]=A);let ee;return t[25]!==O||t[26]!==A?(ee=(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[k,O,A]}),t[25]=O,t[26]=A,t[27]=ee):ee=t[27],ee}var Rn=1,zn=1,Bn=[`Provider`,`Identity`,`Config`],Vn=[`Provider`,`Identity`,`Sign in`],Hn=[`Provider`,`Identity`],Un={label:``,accentColor:``,instanceIdOverride:null};function Wn(e,t){return e[t]??Un}function Gn(e,t,n){return{...e,[t]:{...Wn(e,t),...n}}}function Kn(e,t,n){let r=e(t);if(!r||!n.has(r))return r;for(let e=2;;e+=1){let t=`_${e}`,i=`${r.slice(0,64-t.length)}${t}`;if(!n.has(i))return i}}function qn(e,t){return Object.values(e).some(e=>{if(e.driver!==`acpRegistry`||!e.config||typeof e.config!=`object`)return!1;let n=e.config;return n.source!==`local`&&n.agentId===t})}function Jn(e,t,n,r){let i=Math.max(0,n-1),a=Math.max(0,Math.min(i,t)),o=r.identityStep??Rn,s=r.prerequisite;return s?.error&&e<=s.step&&a>s.step?{kind:`blocked`,step:Math.min(s.step,i),error:s.error}:e<=o&&a>o&&r.instanceIdError!==null?{kind:`blocked`,step:Math.min(o,i),error:r.instanceIdError}:{kind:`navigate`,step:a}}function Yn(e,t,n){return Jn(e,t,Vn.length,{instanceIdError:n.instanceIdError,identityStep:zn,prerequisite:{step:0,error:n.selectionError}})}function Xn(e){let t=(0,Nn.c)(15),{currentStep:n,summaries:r,instanceIdError:i,steps:a,identityStep:o,prerequisite:s,onNavigation:c,disabled:l}=e,u=a===void 0?Bn:a,d=l!==void 0&&l,f;t[0]===d?f=t[1]:(f=()=>d,t[0]=d,t[1]=f);let p;t[2]!==n||t[3]!==o||t[4]!==i||t[5]!==c||t[6]!==s||t[7]!==u.length?(p=e=>c(Jn(n,e,u.length,{instanceIdError:i,...o===void 0?{}:{identityStep:o},...s===void 0?{}:{prerequisite:s}})),t[2]=n,t[3]=o,t[4]=i,t[5]=c,t[6]=s,t[7]=u.length,t[8]=p):p=t[8];let m;return t[9]!==n||t[10]!==u||t[11]!==r||t[12]!==f||t[13]!==p?(m=(0,$.jsx)(on,{steps:u,currentStep:n,summaries:r,isStepDisabled:f,onStepChange:p}),t[9]=n,t[10]=u,t[11]=r,t[12]=f,t[13]=p,t[14]=m):m=t[14],m}function Zn(e){return e instanceof Error&&e.message.trim()?e.message:`The ACP could not be prepared.`}function Qn(e,t){return{...e,id:t.agentId,version:t.version,distribution:t.distribution}}function $n(e){let t=(0,Nn.c)(48),{environmentId:n,providerInstances:r,onPrepared:i,onManualConfiguration:a,onLocalConfiguration:o,onLoadingChange:s,onPreparingChange:c}=e,[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(``),p=Re(n,A),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),v=(0,Q.useRef)(0),b=(0,Q.useRef)(null),x;t[0]!==n||t[1]!==d?(x=X.searchAcpRegistry({environmentId:n,input:{query:d}}),t[0]=n,t[1]=d,t[2]=x):x=t[2];let S=Be(x),C;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(C={reportFailure:!1},t[3]=C):C=t[3];let w=Z(X.prepareAcpRegistryAgent,C),T,E;t[4]===c?(T=t[5],E=t[6]):(T=()=>()=>{v.current+=1,b.current!==null&&clearTimeout(b.current),c?.(!1)},E=[c],t[4]=c,t[5]=T,t[6]=E),(0,Q.useEffect)(T,E);let D;t[7]!==S||t[8]!==d?(D=e=>{b.current!==null&&clearTimeout(b.current);let t=e.trim();u(t),_(null),t===d?S.refresh():f(t)},t[7]=S,t[8]=d,t[9]=D):D=t[9];let O=D,k;t[10]!==l||t[11]!==O?(k=e=>{e.preventDefault(),O(l)},t[10]=l,t[11]=O,t[12]=k):k=t[12];let ee=k,j=async e=>{if(!ze(n,`providers:manage`))return;let t=v.current+=1;_(null),h(e.id),c?.(!0);let r=await w({environmentId:n,input:{agentId:e.id}});if(v.current===t){if(h(null),c?.(!1),r._tag===`Success`){i(Qn(e,r.value));return}ce(r)||_(Zn(le(r)))}},M=S.data?.agents??null,te=S.isPending&&M===null,P=S.isPending&&M!==null,F=M?.length??0,I,L;t[13]!==s||t[14]!==S.isPending?(I=()=>(s?.(S.isPending),()=>s?.(!1)),L=[s,S.isPending],t[13]=s,t[14]=S.isPending,t[15]=I,t[16]=L):(I=t[15],L=t[16]),(0,Q.useLayoutEffect)(I,L);let R;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(`h3`,{className:`sr-only`,id:`acp-registry-search-heading`,children:`Choose an agent`}),t[17]=R):R=t[17];let z;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(gt,{children:(0,$.jsx)(B,{})}),t[18]=z):z=t[18];let re=m!==null,ie;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(ie=e=>{let t=e.currentTarget.value;u(t),_(null),b.current!==null&&clearTimeout(b.current),b.current=setTimeout(()=>{b.current=null,f(t.trim())},300)},t[19]=ie):ie=t[19];let V;t[20]!==l||t[21]!==re?(V=(0,$.jsxs)(vt,{className:`min-w-40 flex-1`,children:[z,(0,$.jsx)(_t,{"aria-label":`Search ACP Registry`,disabled:re,onChange:ie,placeholder:`Search agents…`,size:`sm`,type:`search`,value:l})]}),t[20]=l,t[21]=re,t[22]=V):V=t[22];let ae=m!==null,oe;t[23]!==a||t[24]!==ae?(oe=(0,$.jsx)(N,{disabled:ae,onClick:a,size:`sm`,type:`button`,variant:`ghost-muted`,children:`Enter manually`}),t[23]=a,t[24]=ae,t[25]=oe):oe=t[25];let H;t[26]!==o||t[27]!==m?(H=o?(0,$.jsx)(N,{disabled:m!==null,onClick:o,size:`sm`,type:`button`,variant:`outline`,children:`Local ACP command`}):null,t[26]=o,t[27]=m,t[28]=H):H=t[28];let U;t[29]!==ee||t[30]!==V||t[31]!==oe||t[32]!==H?(U=(0,$.jsxs)(`form`,{className:`flex flex-wrap items-center gap-2`,onSubmit:ee,children:[V,oe,H]}),t[29]=ee,t[30]=V,t[31]=oe,t[32]=H,t[33]=U):U=t[33];let se=te?`Searching the ACP Registry.`:P?`Refreshing ACP Registry results.`:M?`${F} compatible ${F===1?`agent`:`agents`} found.`:``,W;t[34]===se?W=t[35]:(W=(0,$.jsx)(`div`,{className:`sr-only`,role:`status`,children:se}),t[34]=se,t[35]=W);let G;t[36]!==g||t[37]!==S.error?(G=S.error||g?(0,$.jsx)(Tt,{variant:`error`,role:`status`,"aria-live":`polite`,children:(0,$.jsx)(wt,{children:g??S.error})}):null,t[36]=g,t[37]=S.error,t[38]=G):G=t[38];let ue;t[39]===te?ue=t[40]:(ue=te?(0,$.jsx)(`div`,{className:`flex min-h-20 items-center justify-center text-sm text-muted-foreground`,children:`Searching the registry...`}):null,t[39]=te,t[40]=ue);let de=M?M.length===0?(0,$.jsxs)(`div`,{className:`flex min-h-28 flex-col items-center justify-center rounded-2xl border border-dashed px-4 text-center`,children:[(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:`No compatible agents found`}),(0,$.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Try a broader search.`})]}):(0,$.jsx)(Qe,{scrollFade:!0,className:`max-h-64`,children:(0,$.jsx)(`div`,{className:`pr-2.5`,children:M.map(e=>{let t=qn(r,e.id),n=m===e.id,i=e.distribution===`binary`?`Downloading`:`Preparing`;return(0,$.jsx)(`article`,{className:`min-w-0 py-2.5`,children:(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,$.jsx)(Dt,{driverKind:y.make(`acpRegistry`),displayName:e.name,acpRegistryAgentId:e.id,acpRegistryIconUrl:e.icon??void 0,iconClassName:`size-6 rounded-md text-muted-foreground`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:(0,$.jsx)(`h4`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name})}),e.description?(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description}):null]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[e.website||e.repository?(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`About ${e.name}`,render:(0,$.jsx)(`a`,{href:e.website||e.repository||void 0,target:`_blank`,rel:`noreferrer`}),children:(0,$.jsx)(ne,{})})}),(0,$.jsxs)(We,{children:[`About `,e.name]})]}):null,(0,$.jsx)(N,{"aria-label":`${t?`Already added`:n?i:`Add`} ${e.name}`,disabled:!p||t||m!==null,onClick:()=>void j(e),size:`xs`,variant:n?`secondary`:`outline`,children:t?`Added`:n?i:`Add`})]})]})},e.id)})})}):null,K;return t[41]!==R||t[42]!==U||t[43]!==W||t[44]!==G||t[45]!==ue||t[46]!==de?(K=(0,$.jsxs)(`section`,{className:`grid gap-3`,"aria-labelledby":`acp-registry-search-heading`,children:[R,U,W,G,ue,de]}),t[41]=R,t[42]=U,t[43]=W,t[44]=G,t[45]=ue,t[46]=de,t[47]=K):K=t[47],K}var er=(0,Q.lazy)(()=>n(()=>import(`./ProviderAuthTerminal-Q584HoOn.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334])));function tr({environmentId:e,environmentLabel:t,instanceId:n,provider:r,readOnly:i}){let a={environmentId:e,input:{instanceId:n}},s=Be(X.providerAuthState(a)),c={reportFailure:!1,reportDefect:!1},l=Z(X.startProviderAuth,c),u=Z(X.respondProviderAuth,c),d=Z(X.completeProviderAuth,c),f=Z(X.cancelProviderAuth,c),p=Z(X.logoutProviderAuth,c),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)({id:``,values:{}}),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(!1),S=(0,Q.useRef)(!1),C=(0,Q.useRef)([]),w=(0,Q.useRef)(!1),T=s.data,E=T?.interaction,D=T?.phase===`starting`||T?.phase===`waiting`||T?.phase===`verifying`,O=r.auth.status===`authenticated`||r.auth.status===`unknown`&&T?.phase===`succeeded`,k=r.driver===`acpRegistry`&&!D&&!O&&!s.error&&T?.methods===void 0,A=!D&&!O&&(r.setup?.canAuthenticate===!1||r.driver===`acpRegistry`&&T?.methods?.length===0),ee=D?T?.phase===`starting`?`Starting sign-in…`:T?.phase===`verifying`?`Checking your account…`:E?.type===`terminal`?`Complete sign-in in the terminal below.`:E?.type===`credentials`?`Enter your credentials below.`:`Finish signing in in your browser.`:O?`Signed in.`:k?`Discovering sign-in methods…`:A?`No in-app sign-in advertised. Follow the provider's docs to finish setup.`:`Sign in on ${t}.`,j=T?.phase===`failed`?T.message:null,M=i||b||s.error!==null||k,te=`${T?.flowId??``}:${E?.id??``}`,P=g.id===te?g.values:{},F=E?.type===`browser`||E?.type===`deviceCode`?E.url:T?.authorizationUrl;async function I(e){if(S.current)return!1;S.current=!0,x(!0),y(null);let t=!1;try{let n=await e();if(n._tag===`Success`)t=!0;else if(!ce(n)){let e=le(n);y(e instanceof Error?e.message:`Provider sign-in failed. Try again.`)}}catch{y(`Provider sign-in failed. Try again.`)}return S.current=!1,x(!1),t}async function L(t){return!T?.flowId||!E?!1:I(()=>u({environmentId:e,input:{instanceId:n,flowId:T.flowId,interactionId:E.id,response:t}}))}async function R(){if(!F||i)return;let e=E?.type===`browser`&&E.requiresConsent,t=e&&!window.desktopBridge?window.open(``,`_blank`):null;t&&(t.opener=null);try{if(e&&!await L({type:`browser`,action:`accept`})){t?.close();return}t?t.location.href=F:await Ne().shell.openExternal(F),y(null)}catch{t?.close(),y(`Could not open the sign-in page. Copy the link and open it in your browser.`)}}function z(e,t){_({id:te,values:{...P,[e]:t}})}return(0,$.jsx)(At,{title:`Account`,description:O&&!D&&r.auth.email?.trim()?(0,$.jsxs)(`span`,{children:[`Signed in as`,` `,(0,$.jsx)(nn,{value:r.auth.email,ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`max-w-full truncate`},r.auth.email)]}):(0,$.jsx)(`span`,{role:`status`,children:ee}),status:j?(0,$.jsx)(`p`,{role:`status`,className:`[overflow-wrap:anywhere]`,children:j}):void 0,control:(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[!D&&(T?.methods?.length??0)>1?(0,$.jsxs)(Y,{value:T?.methods?.some(e=>e.id===m)?m:``,disabled:M,onValueChange:e=>h(e??``),children:[(0,$.jsx)(J,{size:`sm`,"aria-label":`Sign-in method`,className:`w-44`,children:(0,$.jsx)(be,{children:T?.methods?.find(e=>e.id===m)?.name??`Provider default`})}),(0,$.jsxs)(xe,{children:[(0,$.jsx)(q,{value:``,children:`Provider default`}),T?.methods?.map(e=>(0,$.jsx)(q,{value:e.id,children:e.name},e.id))]})]}):null,F?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(N,{size:`sm`,variant:`outline`,disabled:M,onClick:()=>void R(),children:`Open browser`}),(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{"aria-label":`Copy sign-in link`,size:`icon-sm`,variant:`ghost-muted`,disabled:M,onClick:()=>{let e=we(F,`Provider sign-in link`);(async()=>{await e,E?.type===`browser`&&E.requiresConsent&&await L({type:`browser`,action:`accept`})})().catch(()=>y(`Could not copy the sign-in link.`))},children:(0,$.jsx)(o,{})})}),(0,$.jsx)(We,{children:`Copy sign-in link`})]})]}):null,(0,$.jsxs)($.Fragment,{children:[A&&r.setup?.documentationUrl?(0,$.jsx)(N,{size:`sm`,variant:`outline`,render:(0,$.jsx)(`a`,{href:r.setup.documentationUrl,target:`_blank`,rel:`noreferrer`}),children:`Open docs`}):D&&T?.flowId?(0,$.jsx)(N,{size:`sm`,variant:`ghost-muted`,"aria-label":`Cancel sign-in`,disabled:M,onClick:()=>void I(()=>f({environmentId:e,input:{instanceId:n,flowId:T.flowId}})),children:`Cancel`}):!D&&!A&&r.setup?.canAuthenticate!==!1?(0,$.jsx)(N,{size:`sm`,variant:`outline`,disabled:M||!r.enabled||!r.installed||!T,onClick:()=>void I(()=>l({environmentId:e,input:{instanceId:n,...m&&T?.methods?.some(e=>e.id===m)?{methodId:m}:{}}})),children:O?`Change account`:T?.phase===`failed`||T?.phase===`cancelled`?`Retry sign-in`:`Sign in`}):null,!D&&O&&(r.auth.canLogout??r.setup?.canAuthenticate)?(0,$.jsx)(N,{size:`sm`,variant:`ghost`,disabled:M||!T,onClick:()=>{Ne().dialogs.confirm(`Sign out of ${r.displayName??r.driver} on ${t}? This stops running threads that share this sign-in. Thread history is kept.`).then(e=>{e&&I(()=>p(a))})},children:`Sign out`}):null]})]}),children:E?.type===`terminal`||E?.type===`credentials`||E?.type===`deviceCode`||F&&(E?.type===`browser`?E.acceptsCallback:!E)||v||s.error?(0,$.jsxs)($.Fragment,{children:[E?.type===`deviceCode`?(0,$.jsxs)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:[`Enter code`,` `,(0,$.jsx)(`code`,{className:`select-all font-mono text-foreground`,children:E.userCode}),` `,`in your browser.`]}):null,E?.type===`terminal`?(0,$.jsx)(`div`,{className:`py-2`,children:(0,$.jsx)(Q.Suspense,{fallback:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Loading sign-in terminal…`}),children:(0,$.jsx)(er,{output:E.output,outputOffset:E.outputOffset,onResponse:t=>{if(!i&&T?.flowId){for(let e=0;e<Math.max(1,t.data.length);e+=4096)C.current.push({instanceId:n,flowId:T.flowId,interactionId:E.id,response:{...t,data:t.data.slice(e,e+4096)}});w.current||(w.current=!0,(async()=>{for(;C.current.length>0;){let t=C.current.shift(),n=await u({environmentId:e,input:t});if(n._tag!==`Success`){C.current=[],ce(n)||y(`The provider sign-in terminal is no longer available.`);break}}})().catch(()=>{C.current=[],y(`Could not send input to the provider sign-in terminal.`)}).finally(()=>{w.current=!1}))}}},`${T?.flowId}:${E.id}`)})}):null,E?.type===`credentials`?(0,$.jsxs)(`form`,{className:`grid gap-2 py-2 text-sm leading-normal`,onSubmit:e=>{e.preventDefault(),L({type:`credentials`,values:P}).then(e=>{e&&_({id:``,values:{}})})},children:[E.fields.map(e=>(0,$.jsxs)(`label`,{className:`grid gap-1`,children:[e.label,(0,$.jsx)(Ze,{size:`sm`,type:e.secret?`password`:`text`,autoComplete:`off`,value:P[e.name]??``,disabled:M,maxLength:16384,onChange:t=>z(e.name,t.target.value)})]},e.name)),(0,$.jsx)(N,{type:`submit`,size:`sm`,variant:`outline`,className:`w-fit`,disabled:M,children:`Connect`})]}):null,F&&(E?.type===`browser`?E.acceptsCallback:!E)?(0,$.jsxs)(`form`,{className:`grid gap-2 py-2 text-sm leading-normal`,onSubmit:t=>{t.preventDefault(),T?.flowId&&P.callback?.trim()&&I(()=>d({environmentId:e,input:{instanceId:n,flowId:T.flowId,callbackUrl:P.callback}})).then(e=>{e&&_({id:``,values:{}})})},children:[(0,$.jsxs)(`label`,{className:`grid gap-1`,children:[`If the final localhost page does not load, paste its full URL here.`,(0,$.jsx)(Ze,{size:`sm`,id:`provider-callback-${n}`,type:`url`,autoComplete:`off`,value:P.callback??``,disabled:M,maxLength:16384,onChange:e=>z(`callback`,e.target.value)})]}),(0,$.jsx)(N,{type:`submit`,size:`sm`,variant:`outline`,className:`w-fit`,disabled:M||!P.callback?.trim(),children:`Continue`})]}):null,v||s.error?(0,$.jsx)(`p`,{role:`alert`,className:`py-2 text-xs text-destructive`,children:v??s.error}):null]}):null})}function nr(e){let t=(0,Nn.c)(26),{environmentId:n,environmentLabel:r,instanceId:i,onFinish:a}=e,o=H(X.providersValueAtom(n))??Ie,s;if(t[0]!==i||t[1]!==o){let e;t[3]===i?e=t[4]:(e=e=>e.instanceId===i,t[3]=i,t[4]=e),s=o.find(e),t[0]=i,t[1]=o,t[2]=s}else s=t[2];let c=s,l;t[5]!==n||t[6]!==i?(l=X.providerAuthState({environmentId:n,input:{instanceId:i}}),t[5]=n,t[6]=i,t[7]=l):l=t[7];let u=Be(l),d=u.data,f=d?.phase===`starting`||d?.phase===`waiting`||d?.phase===`verifying`,p=c?.auth.status===`authenticated`||c?.auth.status===`unknown`&&d?.phase===`succeeded`,m=!p&&!u.error&&d?.methods===void 0,h=(d?.methods?.length??0)>0,g;t[8]!==d?.message||t[9]!==h||t[10]!==n||t[11]!==r||t[12]!==i||t[13]!==m||t[14]!==c||t[15]!==u.error||t[16]!==p?(g=(0,$.jsx)(tn,{className:`min-h-72`,children:(0,$.jsx)(kt,{variant:`plain`,children:c&&(h||p)?(0,$.jsx)(tr,{environmentId:n,environmentLabel:r,instanceId:i,provider:{...c,setup:{...c.setup,canInstall:c.setup?.canInstall??!1,canAuthenticate:h}},readOnly:!1}):(0,$.jsx)(At,{title:`Account`,description:m?`Discovering sign-in methods…`:u.error??d?.message??`No in-app sign-in advertised. Follow the provider's docs to finish setup.`,control:m?(0,$.jsx)(N,{disabled:!0,size:`sm`,variant:`outline`,children:`Sign in`}):c?.setup?.documentationUrl?(0,$.jsx)(N,{size:`sm`,variant:`outline`,render:(0,$.jsx)(`a`,{href:c.setup.documentationUrl,target:`_blank`,rel:`noreferrer`}),children:`Open docs`}):void 0})})}),t[8]=d?.message,t[9]=h,t[10]=n,t[11]=r,t[12]=i,t[13]=m,t[14]=c,t[15]=u.error,t[16]=p,t[17]=g):g=t[17];let _=p?`default`:`outline`,v=p?`Done`:`Skip for now`,y;t[18]!==f||t[19]!==a||t[20]!==_||t[21]!==v?(y=(0,$.jsx)(ln,{children:(0,$.jsx)(N,{size:`sm`,variant:_,disabled:f,onClick:a,children:v})}),t[18]=f,t[19]=a,t[20]=_,t[21]=v,t[22]=y):y=t[22];let b;return t[23]!==g||t[24]!==y?(b=(0,$.jsxs)($.Fragment,{children:[g,y]}),t[23]=g,t[24]=y,t[25]=b):b=t[25],b}var rr=[{id:`low`,label:`Low`},{id:`medium`,label:`Medium`,isDefault:!0},{id:`high`,label:`High`},{id:`xhigh`,label:`Extra High`}],ir={[y.make(`codex`)]:[{id:`reasoningEffort`,label:`Reasoning`,type:`select`,choices:rr},{id:`serviceTier`,label:`Speed`,type:`select`,choices:[{id:`default`,label:`Standard`,isDefault:!0},{id:`fast`,label:`Fast`}]}],[y.make(`claudeAgent`)]:[{id:`effort`,label:`Reasoning`,type:`select`,choices:[{id:`low`,label:`Low`},{id:`medium`,label:`Medium`},{id:`high`,label:`High`,isDefault:!0},{id:`xhigh`,label:`Extra High`},{id:`max`,label:`Max`}]},{id:`fastMode`,label:`Fast Mode`,type:`boolean`},{id:`thinking`,label:`Thinking`,type:`boolean`}],[y.make(`cursor`)]:[{id:`reasoning`,label:`Reasoning`,type:`select`,choices:rr},{id:`fastMode`,label:`Fast Mode`,type:`boolean`},{id:`thinking`,label:`Thinking`,type:`boolean`}],[y.make(`grok`)]:[{id:`reasoningEffort`,label:`Reasoning`,type:`select`,choices:rr}],[y.make(`pi`)]:[{id:`thinking`,label:`Thinking`,type:`select`,choices:[{id:`off`,label:`Off`},{id:`minimal`,label:`Minimal`},{id:`low`,label:`Low`},{id:`medium`,label:`Medium`,isDefault:!0},{id:`high`,label:`High`},{id:`xhigh`,label:`Extra High`},{id:`max`,label:`Max`}]}],[y.make(`opencode`)]:[{id:`variant`,label:`Reasoning`,type:`select`,choices:rr},{id:`agent`,label:`Agent`,type:`select`,choices:[{id:`build`,label:`Build`,isDefault:!0},{id:`plan`,label:`Plan`}]}]},ar=0;function or(){return ar+=1,`k${ar}`}function sr(e){return{key:or(),id:e.id,label:e.label,isDefault:!!e.isDefault}}function cr(e){return{key:or(),type:e.type,id:e.id,label:e.label,choices:(e.choices??[]).map(sr)}}function lr(){return{key:or(),type:`select`,id:``,label:``,choices:[]}}function ur(){return{key:or(),id:``,label:``,isDefault:!1}}function dr(e){let t=new Set(e.type===`select`?e.promptInjectedValues??[]:[]),n=e.type===`select`?e.options.filter(e=>!t.has(e.id)):[],r=n.find(t=>t.id===e.currentValue)??n.find(e=>e.isDefault);return{key:or(),type:e.type,id:e.id,label:e.label,...e.description===void 0?{}:{description:e.description},...e.type===`boolean`&&e.currentValue!==void 0?{currentBooleanValue:e.currentValue}:{},choices:n.map(e=>({key:or(),id:e.id,label:e.label,...e.description===void 0?{}:{description:e.description},isDefault:e===r}))}}function fr(e){return{slug:e.slug,name:e.name===e.slug?``:e.name,descriptors:(e.capabilities?.optionDescriptors??[]).map(dr)}}function pr(e,t){return(e?.optionDescriptors??[]).filter(e=>t!==`claudeAgent`||e.id!==`contextWindow`).map(dr)}function mr(e){let t=new Set;for(let[n,r]of e.descriptors.entries()){let e=`Option ${n+1}`,i=r.id.trim();if(!i)return`${e} needs an id.`;if(t.has(i))return`${e}: id "${i}" is used twice.`;if(t.add(i),!r.label.trim())return`${e} needs a label.`;if(r.type!==`select`)continue;if(r.choices.length===0)return`${e} needs at least one choice.`;let a=new Set;for(let t of r.choices){let n=t.id.trim();if(!n)return`${e} has a choice without a value.`;if(a.has(n))return`${e}: choice "${n}" is used twice.`;a.add(n)}}return null}function hr(e){let t=e.descriptors.map(e=>{let t=e.id.trim(),n=e.label.trim();if(e.type===`boolean`)return{id:t,label:n,type:`boolean`,...e.description===void 0?{}:{description:e.description},...e.currentBooleanValue===void 0?{}:{currentValue:e.currentBooleanValue}};let r=e.choices.map(e=>({id:e.id.trim(),label:e.label.trim()||e.id.trim(),...e.description===void 0?{}:{description:e.description},...e.isDefault?{isDefault:!0}:{}})),i=r.find(e=>e.isDefault)?.id;return{id:t,label:n,type:`select`,...e.description===void 0?{}:{description:e.description},options:r,...i?{currentValue:i}:{}}}),n=e.name.trim();return{slug:e.slug,name:n||e.slug,capabilities:t.length>0?w({optionDescriptors:t}):null}}var gr=`__custom__`,_r=`__none__`;function vr(e){let t=(0,Nn.c)(79),{instanceId:n,driverKind:r,entry:i,builtInModels:a,onSave:o,onCancel:s}=e,c;t[0]===i?c=t[1]:(c=()=>fr(i),t[0]=i,t[1]=c);let[l,u]=(0,Q.useState)(c),[d,f]=(0,Q.useState)(null),p;t[2]===r?p=t[3]:(p=r?ir[r]??[]:[],t[2]=r,t[3]=p);let m=p,h;t[4]===a?h=t[5]:(h=a.filter(xr),t[4]=a,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=e=>`provider-instance-${n}-custom-model-${e}`,t[6]=n,t[7]=_);let v=_,y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(e,t)=>{f(null),u(n=>({...n,descriptors:n.descriptors.map(n=>n.key===e?{...n,...t}:n)}))},t[8]=y):y=t[8];let b=y,x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=(e,t,n)=>{f(null),u(r=>({...r,descriptors:r.descriptors.map(r=>r.key===e?{...r,choices:r.choices.map(e=>e.key===t?{...e,...n}:n.isDefault?{...e,isDefault:!1}:e)}:r)}))},t[9]=x):x=t[9];let S=x,C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{f(null),u(t=>({...t,descriptors:t.descriptors.filter(t=>t.key!==e)}))},t[10]=C):C=t[10];let w=C,T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{f(null),u(t=>({...t,descriptors:[...t.descriptors,e]}))},t[11]=T):T=t[11];let E=T,D;t[12]===m?D=t[13]:(D=(e,t)=>{if(t===null)return;if(t===gr){b(e.key,{id:``});return}let n=m.find(e=>e.id===t);n&&b(e.key,{id:n.id,label:n.label,type:n.type,choices:(n.choices??[]).map(sr),currentBooleanValue:void 0,description:void 0})},t[12]=m,t[13]=D);let O=D,k;t[14]!==r||t[15]!==g?(k=e=>{if(e===null||e===_r)return;let t=g.find(t=>t.slug===e);t&&(f(null),u(e=>({...e,descriptors:pr(t.capabilities,r)})))},t[14]=r,t[15]=g,t[16]=k):k=t[16];let A=k,ee;t[17]!==l||t[18]!==o?(ee=()=>{let e=mr(l);if(e){f(e);return}o(hr(l))},t[17]=l,t[18]=o,t[19]=ee):ee=t[19];let M=ee,te;t[20]===m?te=t[21]:(te=e=>m.some(t=>t.id===e.id)?e.id:gr,t[20]=m,t[21]=te);let P=te,F;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(F=(e,t)=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Ze,{size:`compact`,value:t.id,onChange:n=>S(e.key,t.key,{id:n.target.value}),placeholder:`value`,font:`mono`,className:`w-28`,spellCheck:!1,"aria-label":`Choice value`}),(0,$.jsx)(Ze,{size:`compact`,value:t.label,onChange:n=>S(e.key,t.key,{label:n.target.value}),placeholder:`Label`,className:`min-w-0 flex-1`,"aria-label":`Choice label`}),(0,$.jsxs)(`label`,{className:`flex shrink-0 items-center gap-1.5 text-2xs text-muted-foreground`,children:[(0,$.jsx)(un,{size:`sm`,checked:t.isDefault,onCheckedChange:n=>S(e.key,t.key,{isDefault:n}),"aria-label":`Default choice`}),`Default`]}),(0,$.jsx)(N,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Remove choice`,onClick:()=>b(e.key,{choices:e.choices.filter(e=>e.key!==t.key)}),children:(0,$.jsx)(V,{className:`size-3`})})]},t.key),t[22]=F):F=t[22];let I=F,L;t[23]!==O||t[24]!==P||t[25]!==m?(L=(e,t)=>(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border border-border/60 bg-background/40 p-2.5`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`w-14 shrink-0 text-2xs text-muted-foreground`,children:[`Option `,t+1]}),m.length>0?(0,$.jsxs)(Y,{value:P(e),onValueChange:t=>O(e,t),children:[(0,$.jsx)(J,{size:`compact`,className:`w-40`,"aria-label":`Option id`,children:(0,$.jsx)(be,{children:P(e)===gr?`Custom…`:e.id})}),(0,$.jsxs)(xe,{align:`start`,alignItemWithTrigger:!1,children:[m.map(br),(0,$.jsx)(q,{value:gr,children:`Custom…`})]})]}):null,P(e)===gr?(0,$.jsx)(Ze,{size:`compact`,value:e.id,onChange:t=>b(e.key,{id:t.target.value}),placeholder:`optionId`,font:`mono`,className:`w-36`,spellCheck:!1,"aria-label":`Option id`}):null,(0,$.jsx)(Ze,{size:`compact`,value:e.label,onChange:t=>b(e.key,{label:t.target.value}),placeholder:`Label`,className:`min-w-0 flex-1`,"aria-label":`Option label`}),(0,$.jsxs)(Y,{value:e.type,onValueChange:t=>b(e.key,{type:t===`boolean`?`boolean`:`select`}),children:[(0,$.jsx)(J,{size:`compact`,className:`w-24`,"aria-label":`Option type`,children:(0,$.jsx)(be,{children:e.type===`boolean`?`Toggle`:`Choices`})}),(0,$.jsxs)(xe,{align:`end`,alignItemWithTrigger:!1,children:[(0,$.jsx)(q,{value:`select`,children:`Choices`}),(0,$.jsx)(q,{value:`boolean`,children:`Toggle`})]})]}),(0,$.jsx)(N,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Remove option ${t+1}`,onClick:()=>w(e.key),children:(0,$.jsx)(V,{className:`size-3`})})]}),e.type===`select`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5 pl-16`,children:[e.choices.map(t=>I(e,t)),(0,$.jsxs)(N,{type:`button`,size:`xs`,variant:`ghost-muted`,className:`-ml-2 self-start`,onClick:()=>b(e.key,{choices:[...e.choices,ur()]}),children:[(0,$.jsx)(j,{className:`size-3`}),`Add choice`]})]}):null]},e.key),t[23]=O,t[24]=P,t[25]=m,t[26]=L):L=t[26];let R=L,z;t[27]===s?z=t[28]:(z=e=>{e.key===`Escape`&&(e.preventDefault(),s())},t[27]=s,t[28]=z);let B=v(`name`),ne;t[29]===B?ne=t[30]:(ne=(0,$.jsx)(`label`,{htmlFor:B,className:`text-xs text-muted-foreground`,children:`Display name`}),t[29]=B,t[30]=ne);let re=v(`name`),ie;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ie=e=>u(t=>({...t,name:e.target.value})),t[31]=ie):ie=t[31];let oe;t[32]!==l.name||t[33]!==l.slug||t[34]!==re?(oe=(0,$.jsx)(Ze,{id:re,size:`sm`,autoFocus:!0,value:l.name,onChange:ie,placeholder:l.slug,className:`sm:w-72`,spellCheck:!1}),t[32]=l.name,t[33]=l.slug,t[34]=re,t[35]=oe):oe=t[35];let H;t[36]!==ne||t[37]!==oe?(H=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[ne,oe]}),t[36]=ne,t[37]=oe,t[38]=H):H=t[38];let U;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Options shown in the composer`}),t[39]=U):U=t[39];let se;t[40]!==A||t[41]!==g?(se=g.length>0?(0,$.jsxs)(Y,{value:_r,onValueChange:A,children:[(0,$.jsx)(J,{size:`compact`,className:`w-44`,"aria-label":`Copy options from a built-in model`,children:(0,$.jsx)(be,{children:`Copy from…`})}),(0,$.jsx)(xe,{align:`end`,alignItemWithTrigger:!1,children:g.map(yr)})]}):null,t[40]=A,t[41]=g,t[42]=se):se=t[42];let ce;t[43]===se?ce=t[44]:(ce=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[U,se]}),t[43]=se,t[44]=ce);let le;t[45]===l.descriptors.length?le=t[46]:(le=l.descriptors.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:`No custom options. The composer uses the provider's default options.`}):null,t[45]=l.descriptors.length,t[46]=le);let W;t[47]!==l.descriptors||t[48]!==R?(W=l.descriptors.map(R),t[47]=l.descriptors,t[48]=R,t[49]=W):W=t[49];let G;if(t[50]!==l.descriptors||t[51]!==m){let e;t[53]===l.descriptors?e=t[54]:(e=e=>!l.descriptors.some(t=>t.id===e.id),t[53]=l.descriptors,t[54]=e);let n;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(n=e=>(0,$.jsxs)(N,{type:`button`,size:`xs`,variant:`ghost-muted`,className:ae(`-ml-2 first:ml-0`),onClick:()=>E(cr(e)),children:[(0,$.jsx)(j,{className:`size-3`}),e.label]},e.id),t[55]=n):n=t[55],G=m.filter(e).map(n),t[50]=l.descriptors,t[51]=m,t[52]=G}else G=t[52];let ue;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,$.jsxs)(N,{type:`button`,size:`xs`,variant:`ghost-muted`,onClick:()=>E(lr()),children:[(0,$.jsx)(j,{className:`size-3`}),`Custom option`]}),t[56]=ue):ue=t[56];let de;t[57]===G?de=t[58]:(de=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[G,ue]}),t[57]=G,t[58]=de);let K;t[59]!==ce||t[60]!==le||t[61]!==W||t[62]!==de?(K=(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[ce,le,W,de]}),t[59]=ce,t[60]=le,t[61]=W,t[62]=de,t[63]=K):K=t[63];let fe;t[64]===d?fe=t[65]:(fe=d?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:d}):null,t[64]=d,t[65]=fe);let pe;t[66]===M?pe=t[67]:(pe=(0,$.jsx)(N,{size:`sm`,variant:`outline`,onClick:M,children:`Save`}),t[66]=M,t[67]=pe);let me;t[68]===s?me=t[69]:(me=(0,$.jsx)(N,{size:`sm`,variant:`ghost`,onClick:s,children:`Cancel`}),t[68]=s,t[69]=me);let he;t[70]!==pe||t[71]!==me?(he=(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[pe,me]}),t[70]=pe,t[71]=me,t[72]=he):he=t[72];let ge;return t[73]!==z||t[74]!==H||t[75]!==K||t[76]!==fe||t[77]!==he?(ge=(0,$.jsxs)(`div`,{className:`mx-2 mt-1 mb-2 flex flex-col gap-3 rounded-md border border-border bg-muted/20 p-3`,onKeyDown:z,children:[H,K,fe,he]}),t[73]=z,t[74]=H,t[75]=K,t[76]=fe,t[77]=he,t[78]=ge):ge=t[78],ge}function yr(e){return(0,$.jsx)(q,{value:e.slug,children:e.name},e.slug)}function br(e){return(0,$.jsx)(q,{value:e.id,children:(0,$.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,$.jsx)(`code`,{className:`font-mono text-xs`,children:e.id}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:e.label})]})},e.id)}function xr(e){return(e.capabilities?.optionDescriptors?.length??0)>0}var Sr={[y.make(`codex`)]:`gpt-6.7-codex-ultra-preview`,[y.make(`claudeAgent`)]:`claude-sonnet-5`,[y.make(`cursor`)]:`claude-sonnet-4-6`,[y.make(`opencode`)]:`openai/gpt-5`,[y.make(`pi`)]:`anthropic/claude-sonnet-5`},Cr=8;function wr(e){let t=e.capabilities?.optionDescriptors??[],n=[];return t.some(e=>e.id===`fastMode`||e.id===`serviceTier`&&e.type===`select`&&e.options.some(e=>e.id===`fast`||e.label===`Fast`))&&n.push(`Fast mode`),t.some(e=>e.id===`thinking`)&&n.push(`Thinking`),t.some(e=>e.type===`select`&&(e.id===`reasoningEffort`||e.id===`effort`||e.id===`reasoning`||e.id===`variant`))&&n.push(`Reasoning`),n}function Tr(e,t){let n=T(e,{favoriteModels:t.favoriteModels,groupFavorites:!0,modelOrder:t.modelOrder}),r=e=>!e.isCustom&&t.hiddenModels.has(e.slug);return[...n.filter(e=>t.favoriteModels.has(e.slug)),...n.filter(e=>!t.favoriteModels.has(e.slug)&&!r(e)),...n.filter(e=>!t.favoriteModels.has(e.slug)&&r(e))]}function Er(e,t){let n=e.filter(e=>!e.isCustom).map(e=>e.slug),r=new Set(n);return n.every(e=>t.includes(e))?t.filter(e=>!r.has(e)):[...new Set([...t,...n])]}var Dr={anthropic:`Anthropic`,deepseek:`DeepSeek`,"github-copilot":`GitHub Copilot`,google:`Google`,groq:`Groq`,lmstudio:`LM Studio`,mistral:`Mistral`,ollama:`Ollama`,openai:`OpenAI`,opencode:`OpenCode`,openrouter:`OpenRouter`,xai:`xAI`},Or=e=>{let t=e.indexOf(`/`);return t>0?e.slice(0,t):``};function kr(e){let t=new Map;for(let n of e){let e=Or(n.slug),r=t.get(e);r?r.push(n):t.set(e,[n])}if(t.size<2)return null;let n=e=>e===``?`Other`:Dr[e]??e.charAt(0).toUpperCase()+e.slice(1);return[...t].map(([e,t])=>({key:e,label:n(e),models:t})).toSorted((e,t)=>e.key===``?1:t.key===``?-1:e.label.localeCompare(t.label))}function Ar(e){let t=(0,Nn.c)(157),{instanceId:n,driverKind:r,models:i,customModels:a,canManageCustomModels:o,canWritePreferences:s,hiddenModels:l,favoriteModels:u,modelOrder:d,onChange:p,onHiddenModelsChange:m,onFavoriteModelsChange:h,onToggleFavorite:g,onModelOrderChange:_}=e,v=s===void 0||s,[y,x]=(0,Q.useState)(``),[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(``),[E,O]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(null),ee=(0,Q.useRef)(null),M=(0,Q.useRef)(null),P;t[0]===l?P=t[1]:(P=new Set(l),t[0]=l,t[1]=P);let I=P,L;t[2]===u?L=t[3]:(L=new Set(u),t[2]=u,t[3]=L);let R=L,z;t[4]!==R||t[5]!==I||t[6]!==d||t[7]!==i?(z=Tr(i,{favoriteModels:R,hiddenModels:I,modelOrder:d}),t[4]=R,t[5]=I,t[6]=d,t[7]=i,t[8]=z):z=t[8];let B=z,ne;if(t[9]!==B||t[10]!==R){let e;t[12]===R?e=t[13]:(e=e=>R.has(e.slug),t[12]=R,t[13]=e),ne=B.filter(e),t[9]=B,t[10]=R,t[11]=ne}else ne=t[11];let re=ne.length,ie;if(t[14]!==B||t[15]!==I){let e;t[17]===I?e=t[18]:(e=e=>!e.isCustom&&I.has(e.slug),t[17]=I,t[18]=e),ie=B.filter(e),t[14]=B,t[15]=I,t[16]=ie}else ie=t[16];let oe=ie.length,H;t[19]===i?H=t[20]:(H=i.filter(zr),t[19]=i,t[20]=H);let U=H,se;t[21]!==U||t[22]!==I?(se=U.length>0&&U.every(e=>I.has(e.slug)),t[21]=U,t[22]=I,t[23]=se):se=t[23];let ce=se,le=i.length>Cr,W=w.trim().toLowerCase(),G=le&&W.length>0,ue=G?B.filter(e=>e.name.toLowerCase().includes(W)||e.slug.toLowerCase().includes(W)):B,de;t[24]!==B||t[25]!==r?(de=r===`opencode`?kr(B):null,t[24]=B,t[25]=r,t[26]=de):de=t[26];let K=de,[fe,pe]=(0,Q.useState)(Rr),me;t[27]!==fe||t[28]!==G?(me=(e,t)=>G||(fe.get(e)??t<=25),t[27]=fe,t[28]=G,t[29]=me):me=t[29];let he=me,ge;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(e,t)=>pe(n=>new Map(n).set(e,t)),t[30]=ge):ge=t[30];let _e=ge,ve;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>{let e=M.current;if(e===null)return;let t=ee.current?.querySelector(`[data-model-slug="${CSS.escape(e)}"]`);t&&(M.current=null,t.scrollIntoView({block:`nearest`}))},t[31]=ve):ve=t[31];let ye;t[32]===B?ye=t[33]:(ye=[B],t[32]=B,t[33]=ye),(0,Q.useEffect)(ve,ye);let q;t[34]!==o||t[35]!==a||t[36]!==r||t[37]!==y||t[38]!==i||t[39]!==p||t[40]!==K||t[41]!==_e?(q=()=>{if(!o||r===`antigravity`)return;let e=f(y);if(!e){O(`Enter a model slug.`);return}if(i.some(t=>!t.isCustom&&t.slug===e)){O(`That model is already built in.`);return}if(e.length>256){O(`Model slugs must be 256 characters or less.`);return}if(a.some(t=>t.slug===e)){O(`That custom model is already saved.`);return}M.current=e,T(``),K!==null&&_e(Or(e),!0),p([...a,{slug:e,name:e,capabilities:null}]),x(``),O(null),C(!1)},t[34]=o,t[35]=a,t[36]=r,t[37]=y,t[38]=i,t[39]=p,t[40]=K,t[41]=_e,t[42]=q):q=t[42];let be=q,xe;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(xe=()=>{x(``),O(null),C(!1)},t[43]=xe):xe=t[43];let J=xe,Y;t[44]!==o||t[45]!==a||t[46]!==k||t[47]!==u||t[48]!==d||t[49]!==p||t[50]!==h||t[51]!==_?(Y=e=>{o&&(k===e&&A(null),p(a.filter(t=>t.slug!==e)),_(d.filter(t=>t!==e)),h(u.filter(t=>t!==e)),O(null))},t[44]=o,t[45]=a,t[46]=k,t[47]=u,t[48]=d,t[49]=p,t[50]=h,t[51]=_,t[52]=Y):Y=t[52];let Se=Y,Ce;t[53]!==o||t[54]!==a||t[55]!==p?(Ce=e=>{o&&(p(a.map(t=>t.slug===e.slug?e:t)),A(null))},t[53]=o,t[54]=a,t[55]=p,t[56]=Ce):Ce=t[56];let we=Ce,Te;t[57]!==v||t[58]!==I||t[59]!==l||t[60]!==m?(Te=(e,t)=>{v&&t!==I.has(e)&&m(t?[...l,e]:l.filter(t=>t!==e),[e])},t[57]=v,t[58]=I,t[59]=l,t[60]=m,t[61]=Te):Te=t[61];let Ee=Te,De;t[62]!==v||t[63]!==g?(De=e=>{v&&g(e)},t[62]=v,t[63]=g,t[64]=De):De=t[64];let Oe=De,ke;t[65]!==R||t[66]!==I?(ke=e=>R.has(e.slug)?`favorite`:!e.isCustom&&I.has(e.slug)?`hidden`:`visible`,t[65]=R,t[66]=I,t[67]=ke):ke=t[67];let Ae=ke,je;t[68]!==B||t[69]!==Ae||t[70]!==K?(je=(e,t)=>{let n=K?.find(t=>t.key===Or(e))?.models??B,r=n.findIndex(t=>t.slug===e),i=r<0?void 0:n[r+t];return i!==void 0&&Ae(i)===Ae(n[r])?i:void 0},t[68]=B,t[69]=Ae,t[70]=K,t[71]=je):je=t[71];let Me=je,Ne;t[72]!==v||t[73]!==B||t[74]!==Me||t[75]!==_?(Ne=(e,t)=>{if(!v)return;let n=Me(e,t);if(n===void 0)return;let r=B.map(Lr),i=r.indexOf(e),a=r.indexOf(n.slug),[o,s]=[n.slug,e];r[i]=o,r[a]=s,_(r)},t[72]=v,t[73]=B,t[74]=Me,t[75]=_,t[76]=Ne):Ne=t[76];let Pe=Ne,Fe;t[77]!==v||t[78]!==Oe?(Fe=(e,t)=>(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{size:`icon-micro`,variant:`ghost-muted`,disabled:!v,onClick:()=>Oe(e.slug),"aria-label":`${t?`Remove`:`Add`} ${e.name} ${t?`from`:`to`} favorites`}),children:(0,$.jsx)(c,{className:ae(`size-3`,t&&`fill-current text-warning`)})}),(0,$.jsx)(We,{side:`top`,children:t?`Remove from favorites`:`Add to favorites`})]}),t[77]=v,t[78]=Oe,t[79]=Fe):Fe=t[79];let X=Fe,Ie;t[80]!==o||t[81]!==v||t[82]!==Pe||t[83]!==Se||t[84]!==G?(Ie=(e,t)=>(0,$.jsxs)(`span`,{className:`flex shrink-0 items-center justify-end gap-0.5`,children:[!t.isHidden&&!G?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{size:`icon-micro`,variant:`ghost-muted`,disabled:!v||!t.canMoveUp,onClick:()=>Pe(e.slug,-1),"aria-label":`Move ${e.name} up`}),children:(0,$.jsx)(te,{className:`size-3`})}),(0,$.jsx)(We,{side:`top`,children:`Move up`})]}),(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{size:`icon-micro`,variant:`ghost-muted`,disabled:!v||!t.canMoveDown,onClick:()=>Pe(e.slug,1),"aria-label":`Move ${e.name} down`}),children:(0,$.jsx)(F,{className:`size-3`})}),(0,$.jsx)(We,{side:`top`,children:`Move down`})]})]}):null,e.isCustom?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{size:`icon-micro`,variant:`ghost-muted`,disabled:!o,"aria-label":`Edit ${e.slug}`,onClick:()=>{o&&A(t=>t===e.slug?null:e.slug)}}),children:(0,$.jsx)(D,{className:`size-3`})}),(0,$.jsx)(We,{side:`top`,children:`Edit name and options`})]}),(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{size:`icon-micro`,variant:`ghost-muted`,disabled:!o,"aria-label":`Remove ${e.slug}`,onClick:()=>Se(e.slug)}),children:(0,$.jsx)(V,{className:`size-3`})}),(0,$.jsx)(We,{side:`top`,children:`Remove custom model`})]})]}):null]}),t[80]=o,t[81]=v,t[82]=Pe,t[83]=Se,t[84]=G,t[85]=Ie):Ie=t[85];let Le=Ie,Re=Ir,ze;t[86]!==v||t[87]!==Ee?(ze=(e,t)=>(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(`span`,{className:`flex shrink-0 items-center`}),children:(0,$.jsx)(un,{size:`sm`,checked:!t,disabled:!v||e.isCustom,onCheckedChange:t=>Ee(e.slug,!t),"aria-label":`Show ${e.name} in the model picker`})}),(0,$.jsx)(We,{side:`top`,children:Re(e,t)})]}),t[86]=v,t[87]=Ee,t[88]=ze):ze=t[88];let Be=ze,Z;t[89]!==Ae||t[90]!==I||t[91]!==n||t[92]!==G||t[93]!==Me||t[94]!==Be||t[95]!==Le||t[96]!==X?(Z=e=>{let t=wr(e),r=Ae(e),i=!e.isCustom&&I.has(e.slug),a=r===`favorite`,o=!G&&Me(e.slug,-1)!==void 0,s=!G&&Me(e.slug,1)!==void 0,c=ae(`text-xs`,i?`text-muted-foreground`:`text-foreground/90`);return(0,$.jsxs)(`div`,{"data-model-slug":e.slug,className:ae(`grid h-7 grid-cols-[1.5rem_minmax(0,1fr)_auto_minmax(5.5rem,auto)_auto] items-center gap-2 rounded-md px-2 transition-colors hover:bg-muted/30`,i&&`opacity-50`),children:[X(e,a),(0,$.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,$.jsx)(`span`,{className:ae(c,`truncate`),children:e.name}),e.name===e.slug?null:(0,$.jsx)(`code`,{className:`truncate font-mono text-2xs text-muted-foreground/70`,children:e.slug}),e.isCustom?(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground/70`,children:`custom`}):null]}),(0,$.jsx)(`span`,{className:`text-2xs text-muted-foreground/70`,children:t.length>0?(0,$.jsx)(`span`,{className:`hidden sm:inline`,children:t.join(` · `)}):null}),Le(e,{isHidden:i,canMoveUp:o,canMoveDown:s}),Be(e,i)]},`${n}:${e.slug}`)},t[89]=Ae,t[90]=I,t[91]=n,t[92]=G,t[93]=Me,t[94]=Be,t[95]=Le,t[96]=X,t[97]=Z):Z=t[97];let Ve=Z,He=Fr,Ke=new Set(ue.map(Pr)),qe;t[98]!==U||t[99]!==o||t[100]!==a||t[101]!==r||t[102]!==k||t[103]!==R||t[104]!==He||t[105]!==Ae||t[106]!==we||t[107]!==n||t[108]!==Ve?(qe=e=>{let t=e.some(e=>R.has(e.slug));return e.map((i,s)=>{let c=Ae(i),l=e[s-1],u=l===void 0||Ae(l)!==c,d=o&&i.isCustom&&k===i.slug?a.find(e=>e.slug===i.slug):void 0;return(0,$.jsxs)(`div`,{children:[u&&t&&c===`favorite`?He(`Favorites`,s===0):null,u&&t&&c===`visible`?He(`All`,s===0):null,u&&c===`hidden`?He(`Hidden from picker`,s===0):null,Ve(i),d?(0,$.jsx)(vr,{instanceId:n,driverKind:r,entry:d,builtInModels:U,onSave:we,onCancel:()=>A(null)},`${n}:${i.slug}:editor`):null]},`${n}:${i.slug}:group`)})},t[98]=U,t[99]=o,t[100]=a,t[101]=r,t[102]=k,t[103]=R,t[104]=He,t[105]=Ae,t[106]=we,t[107]=n,t[108]=Ve,t[109]=qe):qe=t[109];let Je=qe,Ye;t[110]!==w||t[111]!==le?(Ye=le?(0,$.jsx)(Ze,{value:w,onChange:e=>T(e.target.value),placeholder:`Filter models`,size:`sm`,className:`w-56 max-w-full`,spellCheck:!1,"aria-label":`Filter models`}):null,t[110]=w,t[111]=le,t[112]=Ye):Ye=t[112];let Xe;t[113]!==ce||t[114]!==U||t[115]!==l||t[116]!==i||t[117]!==m?(Xe=U.length>0?(0,$.jsx)(N,{type:`button`,size:`xs`,variant:`ghost-muted`,onClick:()=>m(Er(i,l),U.map(Nr)),children:ce?`Enable all`:`Disable all`}):null,t[113]=ce,t[114]=U,t[115]=l,t[116]=i,t[117]=m,t[118]=Xe):Xe=t[118];let Qe=i.length===1?``:`s`,$e=re>0?` · ${re} favorite${re===1?``:`s`}`:``,et=oe>0?` · ${oe} hidden`:``,tt;t[119]!==i.length||t[120]!==Qe||t[121]!==$e||t[122]!==et?(tt=(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[i.length,` model`,Qe,$e,et]}),t[119]=i.length,t[120]=Qe,t[121]=$e,t[122]=et,t[123]=tt):tt=t[123];let nt;t[124]!==Xe||t[125]!==tt?(nt=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[Xe,tt]}),t[124]=Xe,t[125]=tt,t[126]=nt):nt=t[126];let rt;t[127]!==r||t[128]!==S?(rt=r!==`antigravity`&&!S?(0,$.jsxs)(N,{type:`button`,size:`xs`,variant:`ghost-muted`,className:`ml-auto`,onClick:()=>C(!0),children:[(0,$.jsx)(j,{className:`size-3`}),`Add custom model`]}):null,t[127]=r,t[128]=S,t[129]=rt):rt=t[129];let it;t[130]!==Ye||t[131]!==nt||t[132]!==rt?(it=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[Ye,nt,rt]}),t[130]=Ye,t[131]=nt,t[132]=rt,t[133]=it):it=t[133];let at;t[134]!==G||t[135]!==ue.length?(at=ue.length===0?(0,$.jsx)(`p`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:G?`No models match.`:`No models reported for this provider yet.`}):null,t[134]=G,t[135]=ue.length,t[136]=at):at=t[136];let ot=K===null?Je(ue):K.map(e=>{let t=G?e.models.filter(e=>Ke.has(e.slug)):e.models;if(t.length===0)return null;let r=e.models.filter(Mr).map(jr),i=e.models.filter(e=>e.isCustom||!I.has(e.slug)).length,a=he(e.key,e.models.length);return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5`,children:[(0,$.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-1.5 text-left text-xs font-medium`,"aria-expanded":a,disabled:G,onClick:()=>_e(e.key,!a),children:[(0,$.jsx)(b,{className:ae(`size-3.5 shrink-0 text-muted-foreground transition-transform`,a&&`rotate-90`)}),(0,$.jsx)(`span`,{className:`truncate`,children:e.label}),(0,$.jsxs)(`span`,{className:`shrink-0 text-2xs font-normal text-muted-foreground`,children:[i,` of `,e.models.length,` shown`]})]}),r.length>0?(0,$.jsx)(un,{size:`sm`,checked:r.some(e=>!I.has(e)),disabled:!v,onCheckedChange:()=>m(Er(e.models,l),r),"aria-label":`Show ${e.label} models in the model picker`}):null]}),a?(0,$.jsx)(`div`,{className:`pb-2`,children:Je(t)}):null]},`${n}:provider:${e.key}`)}),st;t[137]!==at||t[138]!==ot?(st=(0,$.jsxs)(`div`,{ref:ee,className:`mt-2 -mx-2 max-h-64 overflow-y-auto lg:max-h-[min(32rem,60vh)] lg:min-h-0 lg:flex-1`,children:[at,ot]}),t[137]=at,t[138]=ot,t[139]=st):st=t[139];let ct;t[140]!==o||t[141]!==J||t[142]!==r||t[143]!==E||t[144]!==be||t[145]!==y||t[146]!==n||t[147]!==S?(ct=r===`antigravity`||!o?null:S?(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(Ze,{id:`provider-instance-${n}-custom-model`,size:`sm`,autoFocus:!0,value:y,onChange:e=>{x(e.target.value),E&&O(null)},onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),J();return}e.key===`Enter`&&(e.preventDefault(),be())},placeholder:r?Sr[r]:`model-slug`,spellCheck:!1}),(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,$.jsx)(N,{size:`sm`,variant:`outline`,onClick:be,children:`Add`}),(0,$.jsx)(N,{size:`sm`,variant:`ghost`,onClick:J,children:`Cancel`})]})]}):null,t[140]=o,t[141]=J,t[142]=r,t[143]=E,t[144]=be,t[145]=y,t[146]=n,t[147]=S,t[148]=ct):ct=t[148];let lt;t[149]!==r||t[150]!==E?(lt=r!==`antigravity`&&E?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:E}):null,t[149]=r,t[150]=E,t[151]=lt):lt=t[151];let ut;return t[152]!==it||t[153]!==st||t[154]!==ct||t[155]!==lt?(ut=(0,$.jsxs)(`div`,{className:`lg:flex lg:h-full lg:min-h-0 lg:flex-col`,children:[it,st,ct,lt]}),t[152]=it,t[153]=st,t[154]=ct,t[155]=lt,t[156]=ut):ut=t[156],ut}function jr(e){return e.slug}function Mr(e){return!e.isCustom}function Nr(e){return e.slug}function Pr(e){return e.slug}function Fr(e,t){return(0,$.jsx)(`div`,{className:ae(`px-2 pb-1.5 text-2xs text-muted-foreground`,t?`pt-1`:`pt-5`),children:e})}function Ir(e,t){return e.isCustom?`Custom models are always shown in the picker`:t?`Hidden from picker`:`Shown in picker`}function Lr(e){return e.slug}function Rr(){return new Map}function zr(e){return!e.isCustom}function Br(e,t){if(t._tag!==`Failure`||ce(t))return;let n=le(t);Ce.add({type:`error`,title:e,description:n instanceof Error?n.message:`The ACP operation failed.`})}function Vr(e){let t=Re(e.environmentId,ie),n=Re(e.environmentId,h),[r,i]=(0,Q.useState)(e.projects[0]?.id??null),[a,o]=(0,Q.useState)([]),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)([]),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)({}),E=Z(X.listAcpRegistrySessions,{reportFailure:!1}),D=Z(X.importAcpRegistrySession,{reportFailure:!1}),O=Z(X.deleteAcpRegistrySession,{reportFailure:!1}),k=Z(X.listAcpRegistryProviders,{reportFailure:!1}),A=Z(X.setAcpRegistryProvider,{reportFailure:!1}),ee=Z(X.disableAcpRegistryProvider,{reportFailure:!1}),j=Z(X.logoutAcpRegistry,{reportFailure:!1}),M=e.provider.nativeSessions?.canList===!0,te=e.provider.nativeSessions?.canLoad===!0||e.provider.nativeSessions?.canResume===!0,P=e.provider.auth.canLogout===!0&&!e.provider.setup?.canAuthenticate,F=e.provider.nativeSessions?.canDelete===!0,I=e.provider.configurableProviders===!0,L=l||d!==null||p!==null||b||S!==null;if(!M&&!P&&!I)return null;let R=async t=>{if(r===null||l)return;u(!0);let n=await E({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,...t===void 0?{}:{cursor:t}}});if(u(!1),n._tag===`Success`){o(e=>t===void 0?n.value.sessions:[...e,...n.value.sessions]),c(n.value.nextCursor);return}Br(`Could not list ACP sessions`,n)},z=async t=>{if(!ze(e.environmentId,`orchestration:operate`)||r===null||d!==null)return;f(t.sessionId);let n=await D({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,sessionId:t.sessionId,title:t.title,updatedAt:t.updatedAt}});if(f(null),n._tag===`Success`){o(e=>e.map(e=>e.sessionId===t.sessionId?{...e,importedThreadId:n.value.threadId}:e)),Ce.add({type:`success`,title:n.value.imported?`ACP session imported`:`ACP session already imported`});return}Br(`Could not import ACP session`,n)},B=async t=>{if(r===null||p!==null||t.importedThreadId!==null||!await Ne().dialogs.confirm(`Permanently delete native ACP session "${t.title??t.sessionId}"?`,{variant:`destructive`})||!ze(e.environmentId,`orchestration:operate`))return;m(t.sessionId);let n=await O({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,sessionId:t.sessionId}});if(m(null),n._tag===`Success`){o(e=>e.filter(e=>e.sessionId!==t.sessionId)),Ce.add({type:`success`,title:`ACP session deleted`});return}Br(`Could not delete ACP session`,n)},ne=async()=>{if(r===null||b)return;x(!0);let t=await k({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r}});if(x(!1),t._tag===`Success`){y(t.value.providers),T(Object.fromEntries(t.value.providers.map(e=>[e.providerId,{apiType:e.current?.apiType??e.supported[0]??``,baseUrl:e.current?.baseUrl??``,headers:``}])));return}Br(`Could not list ACP providers`,t)},re=async t=>{if(!ze(e.environmentId,`providers:manage`)||r===null||S!==null)return;let n=w[t.providerId];if(n===void 0||n.apiType.length===0||n.baseUrl.length===0)return;let i;if(n.headers.trim().length>0)try{let e=JSON.parse(n.headers);if(typeof e!=`object`||!e||Array.isArray(e)||!Object.values(e).every(e=>typeof e==`string`))throw Error(`Headers must be a JSON object with string values.`);i=e}catch(e){Ce.add({type:`error`,title:`Invalid provider headers`,description:e instanceof Error?e.message:`Headers must be valid JSON.`});return}C(t.providerId);let a=await A({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,providerId:t.providerId,apiType:n.apiType,baseUrl:n.baseUrl,...i===void 0?{}:{headers:i}}});if(C(null),a._tag===`Success`){Ce.add({type:`success`,title:`ACP provider configured`}),await ne();return}Br(`Could not configure ACP provider`,a)},V=async t=>{if(r===null||S!==null||t.required||!await Ne().dialogs.confirm(`Disable ACP provider "${t.providerId}"?`,{variant:`destructive`})||!ze(e.environmentId,`providers:manage`))return;C(t.providerId);let n=await ee({environmentId:e.environmentId,input:{instanceId:e.instanceId,projectId:r,providerId:t.providerId}});if(C(null),n._tag===`Success`){Ce.add({type:`success`,title:`ACP provider disabled`}),await ne();return}Br(`Could not disable ACP provider`,n)},ae=async()=>{if(g||!ze(e.environmentId,`providers:manage`))return;_(!0);let t=await j({environmentId:e.environmentId,input:{instanceId:e.instanceId}});if(_(!1),t._tag===`Success`){o([]),c(null),Ce.add({type:`success`,title:`Logged out of ACP agent`});return}Br(`Could not log out of ACP agent`,t)};return(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsx)(At,{title:`Native sessions`,description:`Resume agent-owned conversations as P4 threads.`,status:M&&e.projects.length===0?`Add a project before importing sessions.`:void 0,control:(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[P?(0,$.jsx)(N,{type:`button`,size:`sm`,variant:`outline`,disabled:e.readOnly||g,onClick:()=>void ae(),children:g?`Logging out`:`Log out`}):null,M&&e.projects.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Y,{value:r??``,disabled:!n||L,onValueChange:e=>{e!==null&&(i(e),o([]),c(null),y([]),T({}))},children:[(0,$.jsx)(J,{"aria-label":`Project for ACP sessions`,className:`w-40`,size:`sm`,children:(0,$.jsx)(be,{children:e.projects.find(e=>e.id===r)?.title})}),(0,$.jsx)(xe,{children:e.projects.map(e=>(0,$.jsx)(q,{value:e.id,children:e.title},e.id))})]}),(0,$.jsx)(N,{type:`button`,size:`sm`,variant:`outline`,disabled:!n||l||r===null,onClick:()=>void R(),children:l?`Loading`:a.length===0?`List sessions`:`Refresh`})]}):null]}),children:M&&(a.length>0||s!==null)?(0,$.jsxs)($.Fragment,{children:[a.length>0?(0,$.jsx)(`div`,{className:`divide-y divide-border/60 border-y border-border/60`,children:a.map(e=>(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-xs text-foreground`,children:e.title??e.sessionId}),(0,$.jsx)(`code`,{className:`block truncate text-3xs text-muted-foreground`,children:e.sessionId})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,$.jsx)(N,{type:`button`,size:`xs`,variant:`ghost-muted`,disabled:!t||!te||e.importedThreadId!==null||d!==null,onClick:()=>void z(e),children:e.importedThreadId===null?d===e.sessionId?`Importing`:`Import`:`Imported`}),F?(0,$.jsx)(N,{type:`button`,size:`xs`,variant:`ghost-muted`,disabled:!t||e.importedThreadId!==null||p!==null,onClick:()=>void B(e),children:p===e.sessionId?`Deleting`:`Delete`}):null]})]},e.sessionId))}):null,s===null?null:(0,$.jsx)(N,{type:`button`,size:`xs`,variant:`ghost-muted`,className:`w-fit`,disabled:!n||l,onClick:()=>void R(s),children:l?`Loading`:`Load more`})]}):null}),I?(0,$.jsxs)(`div`,{className:`grid gap-3 border-t border-border/60 px-3 py-3 sm:px-4`,children:[(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Agent providers`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Configure non-secret routing. Headers are write-only.`})]}),(0,$.jsx)(N,{type:`button`,size:`xs`,variant:`outline`,disabled:!n||b||r===null,onClick:()=>void ne(),children:b?`Loading`:v.length===0?`List providers`:`Refresh`})]}),!M&&e.projects.length>1?(0,$.jsxs)(Y,{value:r??``,disabled:!n||L,onValueChange:e=>{e!==null&&(i(e),y([]),T({}))},children:[(0,$.jsx)(J,{"aria-label":`Project for ACP providers`,className:`min-w-48`,size:`xs`,children:(0,$.jsx)(be,{children:e.projects.find(e=>e.id===r)?.title})}),(0,$.jsx)(xe,{children:e.projects.map(e=>(0,$.jsx)(q,{value:e.id,children:e.title},e.id))})]}):null,v.length>0?(0,$.jsx)(`div`,{className:`divide-y divide-border/60 border-y border-border/60`,children:v.map(t=>{let n=w[t.providerId]??{apiType:t.current?.apiType??t.supported[0]??``,baseUrl:t.current?.baseUrl??``,headers:``},r=e=>T(r=>({...r,[t.providerId]:{...n,...e}}));return(0,$.jsxs)(`div`,{className:`grid gap-2 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-xs font-medium text-foreground`,children:t.providerId}),(0,$.jsxs)(`p`,{className:`text-3xs text-muted-foreground`,children:[t.current===null?`Disabled`:`Configured`,t.required?` · Required`:``]})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(N,{type:`button`,size:`xs`,variant:`outline`,disabled:e.readOnly||S!==null||n.apiType.length===0||n.baseUrl.length===0,onClick:()=>void re(t),children:S===t.providerId?`Saving`:`Save`}),!t.required&&t.current!==null?(0,$.jsx)(N,{type:`button`,size:`xs`,variant:`ghost-muted`,disabled:e.readOnly||S!==null,onClick:()=>void V(t),children:`Disable`}):null]})]}),(0,$.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[9rem_minmax(0,1fr)]`,children:[(0,$.jsxs)(Y,{value:n.apiType,disabled:e.readOnly||S!==null,onValueChange:e=>{e!==null&&r({apiType:e})},children:[(0,$.jsx)(J,{"aria-label":`${t.providerId} protocol`,size:`sm`,children:(0,$.jsx)(be,{children:n.apiType})}),(0,$.jsx)(xe,{children:t.supported.map(e=>(0,$.jsx)(q,{value:e,children:e},e))})]}),(0,$.jsx)(Ze,{size:`sm`,type:`url`,"aria-label":`${t.providerId} base URL`,placeholder:`https://api.example.com`,value:n.baseUrl,disabled:e.readOnly||S!==null,onValueChange:e=>r({baseUrl:e})})]}),(0,$.jsx)(Ze,{size:`sm`,type:`password`,"aria-label":`${t.providerId} write-only headers JSON`,placeholder:`Write-only headers JSON, e.g. {"Authorization":"Bearer …"}`,value:n.headers,disabled:e.readOnly||S!==null,onValueChange:e=>r({headers:e})})]},t.providerId)})}):null]}):null]})}var Hr=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function Ur(e){let t=(0,Nn.c)(7),{detail:n,children:r}=e;if(!n)return r;let i;t[0]===r?i=t[1]:(i=(0,$.jsx)(Ue,{render:r}),t[0]=r,t[1]=i);let a;t[2]===n?a=t[3]:(a=(0,$.jsx)(We,{side:`top`,children:n}),t[2]=n,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,$.jsxs)(Ge,{children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}var Wr=0,Gr=()=>`provider-env-${Wr++}`;function Kr(e,t){return{id:`${t}:${e.name}`,name:e.name,value:e.value,sensitive:e.sensitive,...e.valueRedacted===void 0?{}:{valueRedacted:e.valueRedacted}}}function qr(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&e.name===r.name&&e.value===r.value&&e.sensitive===r.sensitive&&e.valueRedacted===r.valueRedacted})}function Jr(e){return typeof e!=`object`||!e?[]:k(e.customModels)}function Yr(e,t){if(typeof e!=`object`||!e)return null;let n=e[t];return typeof n==`string`&&n.trim().length>0?n.trim():null}function Xr(e,t,n){let r=typeof e==`object`&&e?{...e}:{};return r[t]=n,r}function Zr(e){let t=new Map(S(e.liveModels??[],e=>e.isCustom?re([e.slug,e]):d)),n=e.liveModels?.filter(e=>!e.isCustom)??[],r=new Set(n.map(e=>e.slug)),i=e.customModels.flatMap(e=>r.has(e.slug)?[]:[{slug:e.slug,name:e.name,isCustom:!0,capabilities:e.capabilities??t.get(e.slug)?.capabilities??null}]);return[...n,...i]}function Qr(e){let t=(0,Nn.c)(4),n;t[0]===e.email?n=t[1]:(n=e.email?.trim(),t[0]=e.email,t[1]=n);let r=n;if(!r)return null;let i;return t[2]===r?i=t[3]:(i=(0,$.jsx)(nn,{value:r,ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`,className:`max-w-full truncate`}),t[2]=r,t[3]=i),i}function $r(e,t){return e?.find(e=>e.name===t)}function ei(e,t){return(e??[]).filter(e=>!t.has(e.name))}function ti(e,t,n){let r=n.trim(),i=[],a=!1;for(let n of e??[]){if(n.name!==t.name){i.push(n);continue}a=!0,r.length>0&&i.push({name:n.name,value:r,sensitive:t.sensitive??!0})}return!a&&r.length>0&&i.push({name:t.name,value:r,sensitive:t.sensitive??!0}),i}function ni(e){let t=(0,Nn.c)(16),n=`${e.idPrefix}-environment-${e.field.name}`,r=e.variable?.valueRedacted?``:e.variable?.value??``,i;t[0]!==n||t[1]!==e.field.label?(i=(0,$.jsx)(`label`,{htmlFor:n,children:e.field.label}),t[0]=n,t[1]=e.field.label,t[2]=i):i=t[2];let a;t[3]!==n||t[4]!==e||t[5]!==r?(a=e.field.sensitive===!1?(0,$.jsx)(mn,{id:n,size:`sm`,className:`min-w-0 flex-1`,autoComplete:`off`,value:r,onCommit:t=>e.onCommit(e.field,t),placeholder:e.field.placeholder,spellCheck:!1}):(0,$.jsx)(xn,{id:n,size:`sm`,className:`min-w-0 flex-1`,value:r,onCommit:t=>e.onCommit(e.field,t),placeholder:e.field.placeholder,configured:e.variable?.valueRedacted===!0,spellCheck:!1}),t[3]=n,t[4]=e,t[5]=r,t[6]=a):a=t[6];let o;t[7]===e?o=t[8]:(o=e.variable?(0,$.jsx)(N,{type:`button`,size:`icon-sm`,variant:`ghost-destructive`,onClick:()=>e.onRemove(e.field),"aria-label":`Clear ${e.field.label}`,children:(0,$.jsx)(V,{className:`size-3.5`})}):null,t[7]=e,t[8]=o);let s;t[9]!==a||t[10]!==o?(s=(0,$.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-2 @min-[32rem]/settings-row:w-56`,children:[a,o]}),t[9]=a,t[10]=o,t[11]=s):s=t[11];let c;return t[12]!==e.field.description||t[13]!==i||t[14]!==s?(c=(0,$.jsx)(At,{title:i,description:e.field.description,control:s}),t[12]=e.field.description,t[13]=i,t[14]=s,t[15]=c):c=t[15],c}function ri(e){let t=(0,Nn.c)(13),n;t[0]===e.environment?n=t[1]:(n=()=>e.environment.map(Kr),t[0]=e.environment,t[1]=n);let[r,i]=(0,Q.useState)(n),a=(0,Q.useRef)(e.environment),o=(0,Q.useRef)(void 0),s,c;t[2]===e.environment?(s=t[3],c=t[4]):(s=()=>{let t=a.current,n=o.current;a.current=e.environment,o.current=void 0,!(t===e.environment||qr(t,e.environment)||n!==void 0&&qr(n,e.environment))&&i(e.environment.map(Kr))},c=[e.environment],t[2]=e.environment,t[3]=s,t[4]=c),(0,Q.useEffect)(s,c);let l;if(t[5]!==e||t[6]!==r){let n=t=>{let n=[];for(let e of t){let t=e.name.trim();if(!Hr.test(t)){if(t.length>0||e.value.length>0||e.sensitive!==!0||e.valueRedacted!==void 0)return;continue}let{id:r,...i}=e;n.push({...i,name:t})}o.current=n,e.onChange(n)},a=(e,t)=>{let a=r.map(n=>n.id===e?{...n,...t,...t.value===void 0?{}:{valueRedacted:!1}}:n);i(a),n(a)},s=e=>{let t=r.filter(t=>t.id!==e);i(t),n(t)},c;t[8]===r?c=t[9]:(c=()=>i([...r,{id:Gr(),name:``,value:``,sensitive:!0}]),t[8]=r,t[9]=c);let u=c,d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(j,{className:`size-3`}),t[10]=d):d=t[10];let f;t[11]===u?f=t[12]:(f=(0,$.jsxs)(N,{type:`button`,size:`sm`,variant:`outline`,onClick:u,children:[d,`Add variable`]}),t[11]=u,t[12]=f),l=(0,$.jsx)(At,{title:`Variables`,description:`API keys, base URLs, and other per-instance CLI settings.`,control:f,children:r.length>0?(0,$.jsxs)(`div`,{className:`mt-3 min-w-0 space-y-2 pb-2`,children:[r.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(mn,{size:`sm`,font:`mono`,className:`w-full min-w-0 sm:w-44 sm:shrink-0`,value:e.name,onCommit:t=>a(e.id,{name:t.trim()}),placeholder:`VARIABLE_NAME`,spellCheck:!1,"aria-label":`Environment variable name ${t+1}`}),(0,$.jsx)(`span`,{className:`hidden text-xs text-muted-foreground sm:inline`,"aria-hidden":!0,children:`=`}),e.sensitive?(0,$.jsx)(xn,{size:`sm`,font:`mono`,className:`min-w-0 flex-1`,value:e.valueRedacted?``:e.value,onCommit:t=>a(e.id,{value:t}),placeholder:`value`,configured:e.valueRedacted===!0,spellCheck:!1,"aria-label":`Environment variable value ${t+1}`}):(0,$.jsx)(mn,{size:`sm`,font:`mono`,className:`min-w-0 flex-1`,value:e.valueRedacted?``:e.value,onCommit:t=>a(e.id,{value:t}),autoComplete:`off`,placeholder:`value`,spellCheck:!1,"aria-label":`Environment variable value ${t+1}`}),(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{type:`button`,size:`icon-micro`,variant:`ghost-muted`,onClick:()=>{let t=!e.sensitive;a(e.id,{sensitive:t,...t&&e.valueRedacted===void 0?{}:{valueRedacted:t?e.valueRedacted:!1}})},"aria-pressed":e.sensitive,"aria-label":`Mark environment variable ${e.name||t+1} as sensitive`,children:(0,$.jsx)(me,{className:`size-3`,icon:e.sensitive?fe:pe})})}),(0,$.jsx)(We,{side:`top`,children:e.sensitive?`Sensitive, stored separately`:`Plain text`})]}),(0,$.jsx)(N,{type:`button`,size:`icon-micro`,variant:`ghost-destructive`,onClick:()=>s(e.id),"aria-label":`Remove environment variable ${e.name||t+1}`,children:(0,$.jsx)(V,{className:`size-3`})})]},e.id)),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Sensitive values are stored separately and never returned to the app.`})]}):null}),t[5]=e,t[6]=r,t[7]=l}else l=t[7];return l}function ii(e){let t=(0,Nn.c)(26),{projectEnabled:n,deviceEnabled:r}=e,i,a,o,s,c,l,u,d,f;if(t[0]!==r||t[1]!==n){let e=[{key:`project`,label:`Project`,enabled:n,effective:!0},{key:`device`,label:`Device`,enabled:r,effective:!1}];a=ht,t[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(mt,{render:(0,$.jsx)(N,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Overridden for this project. Show where this value comes from`})}),children:(0,$.jsx)(ee,{className:`size-3 text-primary`})}),(0,$.jsx)(We,{side:`top`,children:`Overridden for this project`})]}),t[11]=f):f=t[11],i=ft,l=`end`,u=`md`,d=`none`,o=`list`,s=`px-3 py-2.5 text-sm`,c=e.map(ai),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10];let p;t[12]!==o||t[13]!==s||t[14]!==c?(p=(0,$.jsx)(`ol`,{role:o,className:s,children:c}),t[12]=o,t[13]=s,t[14]=c,t[15]=p):p=t[15];let m;t[16]!==i||t[17]!==l||t[18]!==u||t[19]!==d||t[20]!==p?(m=(0,$.jsx)(i,{align:l,width:u,padding:d,children:p}),t[16]=i,t[17]=l,t[18]=u,t[19]=d,t[20]=p,t[21]=m):m=t[21];let h;return t[22]!==a||t[23]!==f||t[24]!==m?(h=(0,$.jsxs)(a,{children:[f,m]}),t[22]=a,t[23]=f,t[24]=m,t[25]=h):h=t[25],h}function ai(e){return(0,$.jsxs)(`li`,{className:ae(`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 rounded-md px-2 py-1`,e.effective&&`bg-foreground/[0.06]`),children:[(0,$.jsx)(`span`,{className:ae(`min-w-0 truncate`,e.effective?`font-medium text-foreground`:`text-muted-foreground`),children:e.label}),(0,$.jsxs)(`span`,{className:ae(`flex items-center gap-1.5`,e.effective?`text-foreground`:`text-muted-foreground`),children:[e.enabled?`On`:`Off`,e.effective?(0,$.jsx)(L,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-primary`}):(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 shrink-0`})]})]},e.key)}var oi=[];function si(e){let t=(0,Nn.c)(245),{instanceId:n,instance:r,driverOption:i,liveProvider:a,mode:s,selected:c,onSelect:u,readOnly:d,canWriteSettings:f,onUpdate:p,onDelete:m,headerAction:h,setup:y,runtime:b,hiddenModels:x,favoriteModels:S,modelOrder:C,onHiddenModelsChange:w,onFavoriteModelsChange:T,onToggleFavorite:E,onModelOrderChange:D,onRunUpdate:k,onInstallRecommended:A,isUpdating:ee,onAcceptUrlAuth:j,environmentId:te,acpProjects:P,projectOverride:F}=e,L=c!==void 0&&c,R=d!==void 0&&d,B=f===void 0||f,re=ee!==void 0&&ee,ie=P===void 0?oi:P,V=F?.effectiveEnabled??O(r),H=V?a?.compatibilityAdvisory:void 0,U=V?a?.status??`warning`:`disabled`,se=Sn[U],ce=V?En(a&&{...a,enabled:!0}):{headline:`Disabled`,detail:null},le;t[0]===a?.auth.email?le=t[1]:(le=a?.auth.email?.trim(),t[0]=a?.auth.email,t[1]=le);let W=le,G=V&&a?.auth.status===`authenticated`,ue=V&&a?.auth.status===`authenticated`?a.auth.label??a.auth.type??null:null,de=a?.version,K;t[2]===de?K=t[3]:(K=Cn(de),t[2]=de,t[3]=K);let fe=K,pe=kn(a?.versionAdvisory,a?.compatibilityAdvisory,V),me=pe?.updateCommand??null,he=a?.updateState,ge=re?(he?.status===`queued`||he?.status===`running`?he.message:null)??`Starting update`:null,_e=!re&&(he?.status===`failed`||he?.status===`unchanged`)?he.message:null,ve=H!==void 0&&H.status!==`supported`&&H.status!==`unknown`,ye=ve?oe:z,q=R?void 0:pe?.targetVersion?A:k,be=a?.auth.action,xe;t[4]!==i?.label||t[5]!==r.displayName||t[6]!==r.driver?(xe=r.displayName?.trim()||i?.label||String(r.driver),t[4]=i?.label,t[5]=r.displayName,t[6]=r.driver,t[7]=xe):xe=t[7];let J=xe,Y;t[8]===r.accentColor?Y=t[9]:(Y=M(r.accentColor),t[8]=r.accentColor,t[9]=Y);let Ce=Y,we;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(we={onCopy:di,onError:ui},t[10]=we):we=t[10];let{copyToClipboard:Ee}=Te(we),De=l(r.driver)?r.driver:null,Oe,ke;t[11]!==r.config||t[12]!==r.driver||t[13]!==a?.models?(Oe=r.driver===`antigravity`?[]:Jr(r.config),ke=Zr({liveModels:a?.models,customModels:Oe}),t[11]=r.config,t[12]=r.driver,t[13]=a?.models,t[14]=Oe,t[15]=ke):(Oe=t[14],ke=t[15]);let Ae=ke,je;t[16]!==r||t[17]!==p?(je=e=>{let t=e.trim(),{displayName:n,...i}=r;p(t.length>0?{...i,displayName:t}:i)},t[16]=r,t[17]=p,t[18]=je):je=t[18];let Me=je,Ne;t[19]!==r||t[20]!==p||t[21]!==F?(Ne=e=>{if(F){F.onChange(e);return}p({...r,enabled:e})},t[19]=r,t[20]=p,t[21]=F,t[22]=Ne):Ne=t[22];let Pe=Ne,Fe;t[23]!==r||t[24]!==p?(Fe=e=>{let t=M(e),{accentColor:n,...i}=r;p(t?{...i,accentColor:t}:i)},t[23]=r,t[24]=p,t[25]=Fe):Fe=t[25];let X=Fe,Ie;t[26]!==r||t[27]!==p?(Ie=e=>{let{config:t,...n}=r;p(e===void 0?n:{...n,config:e})},t[26]=r,t[27]=p,t[28]=Ie):Ie=t[28];let Le=Ie,Re;t[29]!==r||t[30]!==p?(Re=e=>{let t=Xr(r.config,`customModels`,e.map(_)),{config:n,...i}=r;p({...i,config:t})},t[29]=r,t[30]=p,t[31]=Re):Re=t[31];let ze=Re,Be;t[32]!==r||t[33]!==p?(Be=e=>{let t=e.filter(li),{environment:n,...i}=r;p(t.length>0?{...i,environment:t}:i)},t[32]=r,t[33]=p,t[34]=Be):Be=t[34];let Z=Be,Ve,He,Ke;t[35]!==i?.environmentFields||t[36]!==r.environment?(He=i?.environmentFields??[],Ve=new Set(He.map(ci)),Ke=ei(r.environment,Ve),t[35]=i?.environmentFields,t[36]=r.environment,t[37]=Ve,t[38]=He,t[39]=Ke):(Ve=t[37],He=t[38],Ke=t[39]);let qe=Ke,Je;t[40]!==Ve||t[41]!==r.environment||t[42]!==Z?(Je=e=>{let t=(r.environment??[]).filter(e=>Ve.has(e.name));Z([...t,...e])},t[40]=Ve,t[41]=r.environment,t[42]=Z,t[43]=Je):Je=t[43];let Ye=Je,Xe;t[44]!==r.environment||t[45]!==Z?(Xe=(e,t)=>{Z(ti(r.environment,e,t))},t[44]=r.environment,t[45]=Z,t[46]=Xe):Xe=t[46];let Ze=Xe,Qe;t[47]!==r.environment||t[48]!==Z?(Qe=e=>{Z(ei(r.environment,new Set([e.name])))},t[47]=r.environment,t[48]=Z,t[49]=Qe):Qe=t[49];let $e=Qe,et=De??r.driver,tt;t[50]===r.config?tt=t[51]:(tt=Yr(r.config,`source`)===`local`?void 0:Yr(r.config,`agentId`)??void 0,t[50]=r.config,t[51]=tt);let nt;t[52]===r.config?nt=t[53]:(nt=Yr(r.config,`source`)===`local`?void 0:Yr(r.config,`registryIconUrl`)??void 0,t[52]=r.config,t[53]=nt);let rt=!!Ce,it;t[54]!==Ce||t[55]!==J||t[56]!==et||t[57]!==tt||t[58]!==nt||t[59]!==rt?(it=(0,$.jsx)(Dt,{driverKind:et,displayName:J,accentColor:Ce,acpRegistryAgentId:tt,acpRegistryIconUrl:nt,showBadge:rt,className:`size-5`,iconClassName:`size-4 text-foreground/80`,badgeClassName:`right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 px-0.5 text-5xs`}),t[54]=Ce,t[55]=J,t[56]=et,t[57]=tt,t[58]=nt,t[59]=rt,t[60]=it):it=t[60];let at=it,ot;t[61]===h?ot=t[62]:(ot=h?(0,$.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:h}):null,t[61]=h,t[62]=ot);let st=ot,ct;t[63]===fe?ct=t[64]:(ct=fe?(0,$.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:fe}):null,t[63]=fe,t[64]=ct);let lt=ct,ut;t[65]!==U||t[66]!==se?(ut=U===`warning`||U===`error`?(0,$.jsx)(`span`,{className:ae(`size-1.5 shrink-0 rounded-full`,se.dot),"aria-hidden":!0}):null,t[65]=U,t[66]=se,t[67]=ut):ut=t[67];let dt=ut,pt=U===`warning`||U===`error`,gt=ve&&pt?ce.detail:null,_t=ve?H?.status===`broken`?`Incompatible`:H?.status===`unsupported`?`Unsupported`:`Limited support`:ce.detail,vt=G&&W?(0,$.jsxs)($.Fragment,{children:[pt?dt:null,(0,$.jsx)(`span`,{children:`Authenticated as`}),(0,$.jsx)(Qr,{email:W}),ue?(0,$.jsxs)(`span`,{children:[`· `,ue]}):null,_t?(0,$.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`· `,_t]}):null]}):(0,$.jsxs)($.Fragment,{children:[dt,(0,$.jsx)(`span`,{children:ce.headline}),_t?(0,$.jsxs)(`span`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[`· `,_t]}):null]}),yt=pe?(0,$.jsxs)(ht,{children:[(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(mt,{render:(0,$.jsx)(N,{type:`button`,size:s===`list`?`icon-micro`:`icon-xs`,variant:`ghost-muted`,className:s===`list`?`pointer-events-auto relative shrink-0`:void 0,"aria-label":`${ge?`Updating`:pe.title} — view details`,children:ge?(0,$.jsx)(Se,{tone:`muted`,...s===`list`?{size:`sm`}:{}}):(0,$.jsx)(ye,{className:ae(s===`list`&&`size-3.5`,ve&&`text-warning`)})})})}),(0,$.jsx)(We,{side:`top`,children:ge?`Updating`:pe.title})]}),(0,$.jsx)(ft,{side:`bottom`,align:`end`,width:`md`,"aria-label":pe.title,children:(0,$.jsxs)(`div`,{className:`grid min-w-0 gap-3`,children:[(0,$.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,$.jsx)(`p`,{className:`text-sm font-semibold leading-tight text-foreground`,children:pe.title}),(0,$.jsx)(`p`,{className:ae(`text-xs leading-snug`,pe.emphasis===`strong`?`text-warning`:`text-muted-foreground`),children:pe.detail})]}),q?(0,$.jsxs)(N,{type:`button`,size:`xs`,variant:`outline`,className:`w-full`,disabled:re,onClick:q,children:[re?(0,$.jsx)(Se,{}):(0,$.jsx)(I,{}),re?`Updating`:pe.targetVersion?`Install ${Cn(pe.targetVersion)}`:`Update now`]}):null,ge||_e?(0,$.jsx)(`p`,{"aria-live":`polite`,className:ae(`text-xs leading-snug [overflow-wrap:anywhere]`,_e?`text-warning`:`text-muted-foreground`),children:ge??_e}):null,q&&me?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-3xs font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`}),`or, update manually using`,(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`})]}):null,me?(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-muted/40 py-0.5 pr-0.5 pl-2`,children:[(0,$.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-2xs text-foreground`,children:me}),(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{type:`button`,size:`icon-xs`,variant:`ghost-muted`,className:`shrink-0`,onClick:()=>Ee(me,{providerName:J}),"aria-label":`Copy update command`,children:(0,$.jsx)(o,{className:`size-3`})})}),(0,$.jsx)(We,{side:`top`,children:`Copy command`})]})]}):null]})})]}):null;if(s===`list`){let e=L?`bg-muted/45`:`hover:bg-muted/25`,n;t[68]===e?n=t[69]:(n=ae(`group flex min-h-18 items-center gap-3 px-3 py-3 transition-colors sm:px-4`,e),t[68]=e,t[69]=n);let i=!V&&!L&&`opacity-60 group-hover:opacity-100`,a;t[70]===i?a=t[71]:(a=ae(`pointer-events-none relative flex min-w-0 flex-1 items-start gap-3 rounded-md text-left transition-opacity`,i),t[70]=i,t[71]=a);let o=`Select ${J}`,s;t[72]!==u||t[73]!==L||t[74]!==o?(s=(0,$.jsx)(`button`,{type:`button`,className:`pointer-events-auto absolute inset-0 cursor-pointer rounded-md outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:u,"aria-label":o,"aria-pressed":L}),t[72]=u,t[73]=L,t[74]=o,t[75]=s):s=t[75];let c;t[76]===J?c=t[77]:(c=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:J}),t[76]=J,t[77]=c);let l;t[78]===fe?l=t[79]:(l=fe?(0,$.jsx)(`code`,{className:`max-w-24 shrink-0 truncate text-xs text-muted-foreground`,children:fe}):null,t[78]=fe,t[79]=l);let d;t[80]!==c||t[81]!==l||t[82]!==yt?(d=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[c,l,yt]}),t[80]=c,t[81]=l,t[82]=yt,t[83]=d):d=t[83];let f;t[84]!==dt||t[85]!==ge?(f=dt&&!ge?(0,$.jsx)(`span`,{className:`flex h-[1.45em] shrink-0 items-center`,children:dt}):null,t[84]=dt,t[85]=ge,t[86]=f):f=t[86];let p=gt?0:void 0,m;t[87]!==_t||t[88]!==pt||t[89]!==ce||t[90]!==ge?(m=ge?`Updating · ${ge}`:(0,$.jsxs)($.Fragment,{children:[ce.headline,pt&&_t?` · ${_t}`:null]}),t[87]=_t,t[88]=pt,t[89]=ce,t[90]=ge,t[91]=m):m=t[91];let h;t[92]!==p||t[93]!==m?(h=(0,$.jsx)(`span`,{tabIndex:p,"aria-live":`polite`,className:`pointer-events-auto line-clamp-2 [overflow-wrap:anywhere]`,children:m}),t[92]=p,t[93]=m,t[94]=h):h=t[94];let g;t[95]!==gt||t[96]!==h?(g=(0,$.jsx)(Ur,{detail:gt,children:h}),t[95]=gt,t[96]=h,t[97]=g):g=t[97];let _;t[98]!==f||t[99]!==g?(_=(0,$.jsxs)(`span`,{className:`mt-0.5 flex items-start gap-1.5 text-xs leading-normal text-muted-foreground/80`,children:[f,g]}),t[98]=f,t[99]=g,t[100]=_):_=t[100];let v;t[101]!==d||t[102]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[d,_]}),t[101]=d,t[102]=_,t[103]=v):v=t[103];let y;t[104]!==a||t[105]!==s||t[106]!==v||t[107]!==at?(y=(0,$.jsxs)(`div`,{className:a,children:[s,at,v]}),t[104]=a,t[105]=s,t[106]=v,t[107]=at,t[108]=y):y=t[108];let b;t[109]!==B||t[110]!==J||t[111]!==r||t[112]!==F||t[113]!==R?(b=F?.value===void 0?null:(0,$.jsxs)(`span`,{className:`flex items-center`,children:[(0,$.jsx)(ii,{projectEnabled:F.value,deviceEnabled:O(r)}),(0,$.jsx)(Nt,{label:`${J} enablement`,tooltip:`Reset to the device setting`,disabled:R||!B,onClick:F.onReset})]}),t[109]=B,t[110]=J,t[111]=r,t[112]=F,t[113]=R,t[114]=b):b=t[114];let x=R||F!==void 0&&!B,S;t[115]===Pe?S=t[116]:(S=e=>Pe(!!e),t[115]=Pe,t[116]=S);let C=`Enable ${J}`,w;t[117]!==V||t[118]!==x||t[119]!==S||t[120]!==C?(w=(0,$.jsx)(un,{checked:V,disabled:x,onCheckedChange:S,"aria-label":C}),t[117]=V,t[118]=x,t[119]=S,t[120]=C,t[121]=w):w=t[121];let T;t[122]!==b||t[123]!==w?(T=(0,$.jsxs)(`span`,{className:`flex h-5 shrink-0 items-center gap-1`,children:[b,w]}),t[122]=b,t[123]=w,t[124]=T):T=t[124];let E;return t[125]!==n||t[126]!==y||t[127]!==T?(E=(0,$.jsxs)(`div`,{"data-slot":`settings-row`,className:n,children:[y,T]}),t[125]=n,t[126]=y,t[127]=T,t[128]=E):E=t[128],E}let bt;t[129]===i?bt=t[130]:(bt=i?.badgeLabel?(0,$.jsx)(g,{variant:`warning`,size:`sm`,className:`shrink-0`,children:i.badgeLabel}):null,t[129]=i,t[130]=bt);let xt=R||void 0,St=R&&`opacity-50`,Ct;t[131]===St?Ct=t[132]:(Ct=ae(`inline-flex items-center gap-1`,St),t[131]=St,t[132]=Ct);let wt;t[133]!==n||t[134]!==m||t[135]!==R?(wt=m?(0,$.jsx)(N,{type:`button`,size:`icon-xs`,variant:`ghost-destructive`,disabled:R,onClick:m,"aria-label":`Delete instance ${n}`,children:(0,$.jsx)(v,{})}):null,t[133]=n,t[134]=m,t[135]=R,t[136]=wt):wt=t[136];let Tt;t[137]!==R||t[138]!==xt||t[139]!==Ct||t[140]!==wt||t[141]!==st?(Tt=(0,$.jsxs)(`span`,{inert:R,"aria-disabled":xt,className:Ct,children:[st,wt]}),t[137]=R,t[138]=xt,t[139]=Ct,t[140]=wt,t[141]=st,t[142]=Tt):Tt=t[142];let Et;t[143]!==bt||t[144]!==Tt||t[145]!==yt||t[146]!==lt?(Et=(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[bt,lt,yt,Tt]}),t[143]=bt,t[144]=Tt,t[145]=yt,t[146]=lt,t[147]=Et):Et=t[147];let Ot=Et,kt;t[148]!==i||t[149]!==r.config||t[150]!==r.driver||t[151]!==n||t[152]!==Le?(kt=i?(0,$.jsx)(Mn,{definition:i,value:r.config,idPrefix:`provider-instance-${n}`,variant:`settings`,onChange:Le}):(0,$.jsx)(At,{title:`Driver`,description:(0,$.jsxs)(`span`,{children:[`This instance uses `,(0,$.jsx)(`code`,{className:`text-foreground`,children:String(r.driver)}),`, which is not available in this build. Its configuration is preserved.`]})}),t[148]=i,t[149]=r.config,t[150]=r.driver,t[151]=n,t[152]=Le,t[153]=kt):kt=t[153];let jt=kt,Mt=gt?0:void 0,Ft;t[154]!==vt||t[155]!==Mt?(Ft=(0,$.jsx)(`div`,{tabIndex:Mt,className:`flex min-w-0 flex-wrap items-baseline gap-x-1.5`,children:vt}),t[154]=vt,t[155]=Mt,t[156]=Ft):Ft=t[156];let It;t[157]!==gt||t[158]!==Ft?(It=(0,$.jsx)(Ur,{detail:gt,children:Ft}),t[157]=gt,t[158]=Ft,t[159]=It):It=t[159];let Lt;t[160]!==j||t[161]!==R||t[162]!==be?(Lt=be&&j?(0,$.jsxs)(`div`,{className:`grid max-w-xl gap-1.5 pt-1 text-xs`,children:[(0,$.jsx)(`p`,{children:be.message}),(0,$.jsx)(`code`,{className:`break-all text-2xs`,children:be.url}),(0,$.jsxs)(N,{render:(0,$.jsx)(`a`,{href:be.url,target:`_blank`,rel:`noopener noreferrer`,onClick:()=>j(be)}),size:`xs`,variant:`outline`,className:`w-fit`,disabled:R,children:[(0,$.jsx)(ne,{}),`Continue authentication`]})]}):null,t[160]=j,t[161]=R,t[162]=be,t[163]=Lt):Lt=t[163];let Rt;t[164]!==It||t[165]!==Lt?(Rt=(0,$.jsxs)($.Fragment,{children:[It,Lt]}),t[164]=It,t[165]=Lt,t[166]=Rt):Rt=t[166];let zt=R||void 0,Bt=R&&`opacity-50 select-none`,Vt;t[167]===Bt?Vt=t[168]:(Vt=ae(`flex w-full min-w-0 items-center justify-end gap-2 @min-[32rem]/settings-row:w-auto`,Bt),t[167]=Bt,t[168]=Vt);let Ht;t[169]!==Ce||t[170]!==J||t[171]!==X?(Ht=(0,$.jsx)(Ln,{layout:`inline`,displayName:J,value:Ce,onCommit:X,commitDelayMs:120}),t[169]=Ce,t[170]=J,t[171]=X,t[172]=Ht):Ht=t[172];let Ut=`provider-instance-${n}-display-name`,Wt=r.displayName??``,Gt=i?.label??`Instance label`,Kt;t[173]!==Ut||t[174]!==Wt||t[175]!==Gt||t[176]!==Me?(Kt=(0,$.jsx)(mn,{id:Ut,size:`sm`,className:`min-w-0 flex-1 @min-[32rem]/settings-row:w-56`,value:Wt,onCommit:Me,placeholder:Gt,spellCheck:!1}),t[173]=Ut,t[174]=Wt,t[175]=Gt,t[176]=Me,t[177]=Kt):Kt=t[177];let qt;t[178]!==R||t[179]!==zt||t[180]!==Vt||t[181]!==Ht||t[182]!==Kt?(qt=(0,$.jsxs)(`div`,{inert:R,"aria-disabled":zt,className:Vt,children:[Ht,Kt]}),t[178]=R,t[179]=zt,t[180]=Vt,t[181]=Ht,t[182]=Kt,t[183]=qt):qt=t[183];let Jt;t[184]!==Rt||t[185]!==qt?(Jt=(0,$.jsx)(At,{title:`Display name`,status:Rt,control:qt}),t[184]=Rt,t[185]=qt,t[186]=Jt):Jt=t[186];let Yt;t[187]!==J||t[188]!==Ot||t[189]!==Jt||t[190]!==at?(Yt=(0,$.jsx)(Pt,{title:J,icon:at,headerAction:Ot,children:Jt}),t[187]=J,t[188]=Ot,t[189]=Jt,t[190]=at,t[191]=Yt):Yt=t[191];let Xt;t[192]!==He||t[193]!==r.environment||t[194]!==n||t[195]!==R||t[196]!==$e||t[197]!==y||t[198]!==Ze?(Xt=y||He.length>0?(0,$.jsxs)(Pt,{title:`Setup`,children:[y,(0,$.jsx)(`div`,{inert:R,"aria-disabled":R||void 0,className:R?`opacity-50 select-none`:void 0,children:He.length>0?(0,$.jsx)($.Fragment,{children:He.map(e=>(0,$.jsx)(ni,{field:e,variable:$r(r.environment,e.name),idPrefix:`provider-instance-${n}`,onCommit:Ze,onRemove:$e},e.name))}):null})]}):null,t[192]=He,t[193]=r.environment,t[194]=n,t[195]=R,t[196]=$e,t[197]=y,t[198]=Ze,t[199]=Xt):Xt=t[199];let Zt;t[200]!==i||t[201]!==r.config||t[202]!==r.driver||t[203]!==n||t[204]!==R||t[205]!==b||t[206]!==jt?(Zt=r.driver===`codex`&&An(r.config)===`managed`?(0,$.jsx)(`div`,{inert:R,"aria-disabled":R||void 0,className:R?`opacity-50 select-none`:void 0,children:(0,$.jsx)(yn,{id:`provider-instance-${n}-runtime`,title:`Runtime`,headerPlacement:`outside`,children:b??jt},n)}):!i||jn(i).length>0?(0,$.jsx)(Pt,{title:`Runtime`,inert:R,"aria-disabled":R||void 0,className:R?`opacity-50 select-none`:void 0,children:jt}):null,t[200]=i,t[201]=r.config,t[202]=r.driver,t[203]=n,t[204]=R,t[205]=b,t[206]=jt,t[207]=Zt):Zt=t[207];let Qt=R||void 0,$t=R?`opacity-50 select-none`:void 0,en;t[208]!==qe||t[209]!==Ye?(en=(0,$.jsx)(ri,{environment:qe,onChange:Ye}),t[208]=qe,t[209]=Ye,t[210]=en):en=t[210];let tn;t[211]!==R||t[212]!==Qt||t[213]!==$t||t[214]!==en?(tn=(0,$.jsx)(Pt,{title:`Environment`,inert:R,"aria-disabled":Qt,className:$t,children:en}),t[211]=R,t[212]=Qt,t[213]=$t,t[214]=en,t[215]=tn):tn=t[215];let nn;t[216]!==ie||t[217]!==te||t[218]!==n||t[219]!==a||t[220]!==R?(nn=te!==void 0&&a?.driver===`acpRegistry`?(0,$.jsx)(Vr,{environmentId:te,instanceId:n,provider:a,projects:ie,readOnly:R}):null,t[216]=ie,t[217]=te,t[218]=n,t[219]=a,t[220]=R,t[221]=nn):nn=t[221];let rn;t[222]!==B||t[223]!==Oe||t[224]!==De||t[225]!==i||t[226]!==S||t[227]!==x||t[228]!==n||t[229]!==C||t[230]!==Ae||t[231]!==T||t[232]!==w||t[233]!==D||t[234]!==E||t[235]!==R||t[236]!==ze?(rn=i===void 0?null:(0,$.jsx)(Pt,{title:`Models`,children:(0,$.jsxs)(`div`,{className:`px-3 py-3 sm:px-4`,children:[(0,$.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Model preferences and custom models are saved on the selected environment and shared across connected devices.`}),(0,$.jsx)(Ar,{canManageCustomModels:!R,canWritePreferences:B,instanceId:n,driverKind:De,models:Ae,customModels:Oe,hiddenModels:x,favoriteModels:S,modelOrder:C,onChange:ze,onHiddenModelsChange:w,onFavoriteModelsChange:T,onToggleFavorite:E,onModelOrderChange:D})]})}),t[222]=B,t[223]=Oe,t[224]=De,t[225]=i,t[226]=S,t[227]=x,t[228]=n,t[229]=C,t[230]=Ae,t[231]=T,t[232]=w,t[233]=D,t[234]=E,t[235]=R,t[236]=ze,t[237]=rn):rn=t[237];let an;return t[238]!==Yt||t[239]!==Xt||t[240]!==Zt||t[241]!==tn||t[242]!==nn||t[243]!==rn?(an=(0,$.jsxs)($.Fragment,{children:[Yt,Xt,Zt,tn,nn,rn]}),t[238]=Yt,t[239]=Xt,t[240]=Zt,t[241]=tn,t[242]=nn,t[243]=rn,t[244]=an):an=t[244],an}function ci(e){return e.name}function li(e){return e.name.trim().length>0}function ui(e,t){let{providerName:n}=t;Ce.add(Ve({type:`error`,title:`Could not copy ${n} update command`,description:e.message}))}function di(e){let{providerName:t}=e;Ce.add({type:`success`,title:`${t} update command copied`,description:`Run it in a terminal when you are ready to update.`})}function fi(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).slice(0,48)}function pi(e,t){let n=fi(t);return n?`${e}_${n}`:``}var mi=/^[a-zA-Z][a-zA-Z0-9_-]*$/,hi=y.make(`codex`),gi=y.make(`acpRegistry`),_i=Et.definitions[0],vi={};function yi(e,t){return e.length===0?`Instance ID is required.`:e.length>64?`Instance ID must be 64 characters or fewer.`:mi.test(e)?t.has(e)?`An instance named '${e}' already exists.`:null:`Instance ID must start with a letter and use only letters, digits, '-', or '_'.`}function bi(e){let t=(0,Nn.c)(130),{open:n,environmentId:r,environmentLabel:i,onOpenChange:a,onCreated:o}=e,s=je(r),c=Me(r),l=Re(r,A),[u,d]=(0,Q.useState)(0),[f,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(hi),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_={},t[0]=_):_=t[0];let[v,b]=(0,Q.useState)(_),[S,C]=(0,Q.useState)(null),w;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(w=[],t[1]=w):w=t[1];let[T,E]=(0,Q.useState)(w),[D,O]=(0,Q.useState)(!1),[k,ee]=(0,Q.useState)(!1),[j,te]=(0,Q.useState)(!1),P;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(P={},t[2]=P):P=t[2];let[F,I]=(0,Q.useState)(P),[L,R]=(0,Q.useState)(!1),[z,B]=(0,Q.useState)(!1),[ne,re]=(0,Q.useState)(null),ie;t[3]===s.providerInstances?ie=t[4]:(ie=new Set([`codex`,`claudeAgent`,...Object.keys(s.providerInstances??{})]),t[3]=s.providerInstances,t[4]=ie);let V=ie,oe;t[5]===h?oe=t[6]:(oe=Et.get(h)??_i,t[5]=h,t[6]=oe);let H=oe,U=h===gi,se;t[7]===H.label?se=t[8]:(se={label:H.label,accentColor:``,instanceIdOverride:null},t[7]=H.label,t[8]=se);let ce=se,{label:W,accentColor:G,instanceIdOverride:ue}=v[h]??ce,de;t[9]!==h||t[10]!==H.label||t[11]!==V||t[12]!==ue||t[13]!==U||t[14]!==W?(de=ue??Kn(e=>!e.trim()||e===H.label?U?`${h}_custom`:h:pi(h,e),W,V),t[9]=h,t[10]=H.label,t[11]=V,t[12]=ue,t[13]=U,t[14]=W,t[15]=de):de=t[15];let K=de,fe;t[16]===H?fe=t[17]:(fe=jn(H),t[16]=H,t[17]=fe);let pe=fe,me;t[18]!==V||t[19]!==K?(me=yi(K,V),t[18]=V,t[19]=K,t[20]=me):me=t[20];let he=me,ge=L&&he!==null,_e;t[21]!==H.label||t[22]!==W?(_e=W.trim()||`${H.label} Workspace`,t[21]=H.label,t[22]=W,t[23]=_e):_e=t[23];let ve=_e,ye=F[h]??vi,q=U&&D&&ye.source===`local`,be=typeof ye.commandPath==`string`?ye.commandPath.trim():``,xe;t[24]===ye.agentId?xe=t[25]:(xe=typeof ye.agentId==`string`?ye.agentId.trim():``,t[24]=ye.agentId,t[25]=xe);let J=xe,Y=q?be.length>0?null:`Executable is required.`:S!==null||D&&J.length>0?null:`Select an ACP or configure one manually.`,Se;t[26]!==H.label||t[27]!==U||t[28]!==q||t[29]!==J||t[30]!==ve||t[31]!==S?.name?(Se=U?[q?`Local ACP command`:S?.name??(J||null),ve,null]:[H.label,ve,null],t[26]=H.label,t[27]=U,t[28]=q,t[29]=J,t[30]=ve,t[31]=S?.name,t[32]=Se):Se=t[32];let we=Se,Te;t[33]===h?Te=t[34]:(Te=e=>{I(t=>{let n={...t};return e===void 0||Object.keys(e).length===0?delete n[h]:n[h]=e,n})},t[33]=h,t[34]=Te);let Ee=Te,De;t[35]!==ce||t[36]!==h?(De=e=>{b(t=>({...t,[h]:{...t[h]??ce,...e}}))},t[35]=ce,t[36]=h,t[37]=De):De=t[37];let Oe=De,ke,Ae,Ne,Pe,Fe,X;if(t[38]!==G||t[39]!==Y||t[40]!==F||t[41]!==ne||t[42]!==h||t[43]!==H.label||t[44]!==r||t[45]!==V||t[46]!==K||t[47]!==he||t[48]!==U||t[49]!==q||t[50]!==j||t[51]!==z||t[52]!==W||t[53]!==T||t[54]!==o||t[55]!==a||t[56]!==c||t[57]!==u){ke=e=>{if(!(z||j||ne)){if(e.kind===`blocked`&&R(!0),U&&!q&&e.kind===`navigate`&&e.step===2){Fe();return}d(e.step)}},X=e=>{ke(U?q?Jn(u,e,Hn.length,{instanceIdError:he,prerequisite:{step:0,error:Y}}):Yn(u,e,{instanceIdError:he,selectionError:Y}):Jn(u,e,Bn.length,{instanceIdError:he}))};let e;t[64]===V?e=t[65]:(e=e=>{g(gi);let t=e.name,n=p(e.icon),r=Kn(Oi,t,V);C(e),O(!1),b(e=>Gn(e,gi,{label:t,instanceIdOverride:r})),I(t=>({...t,[gi]:{agentId:e.id,distribution:`auto`,...n?{registryIconUrl:n}:{}}})),R(!1),d(1)},t[64]=V,t[65]=e),Ae=e;let n;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{g(gi),C(null),O(!0),I(Di),b(Ei),R(!1)},t[66]=n):n=t[66],Pe=n;let i;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{g(gi),C(null),O(!0),I(Ti),b(wi),E([]),R(!1)},t[67]=i):i=t[67],Ne=i,Fe=async()=>{if(!ze(r,`providers:manage`)||z||ne||(R(!0),he!==null||U&&Y!==null))return;let e=h===`codex`?{...F[h],setupMode:`existing`}:F[h]??{},t=Object.keys(e).length>0,n=M(G),i={driver:h,enabled:!0,...W.trim().length>0?{displayName:W.trim()}:{},...n?{accentColor:n}:{},...t?{config:e}:{},...q&&T.length>0?{environment:T}:{}},s=x.make(K);B(!0);let l=await c({operation:`create`,instanceId:s,instance:i});if(l._tag===`Failure`){let e=le(l);B(!1),Ce.add({type:`error`,title:`Could not add provider instance`,description:e instanceof Error?e.message:`The settings update failed.`});return}if(o?.(s),U&&!q){re(s),B(!1),d(2);return}Ce.add({type:`success`,title:`Provider instance added`,description:`${H.label} instance '${K}' was added.`}),a(!1)},t[38]=G,t[39]=Y,t[40]=F,t[41]=ne,t[42]=h,t[43]=H.label,t[44]=r,t[45]=V,t[46]=K,t[47]=he,t[48]=U,t[49]=q,t[50]=j,t[51]=z,t[52]=W,t[53]=T,t[54]=o,t[55]=a,t[56]=c,t[57]=u,t[58]=ke,t[59]=Ae,t[60]=Ne,t[61]=Pe,t[62]=Fe,t[63]=X}else ke=t[58],Ae=t[59],Ne=t[60],Pe=t[61],Fe=t[62],X=t[63];if(f){let e;t[68]===a?e=t[69]:(e=()=>a(!1),t[68]=a,t[69]=e);let n;return t[70]!==r||t[71]!==e?(n=(0,$.jsx)(Tn,{environmentId:r,onClose:e}),t[70]=r,t[71]=e,t[72]=n):n=t[72],n}let Ie;t[73]===i?Ie=t[74]:(Ie=(0,$.jsxs)($.Fragment,{children:[`Add an account or configure a provider on `,i,`.`]}),t[73]=i,t[74]=Ie);let Le;t[75]!==Y||t[76]!==ke||t[77]!==ne||t[78]!==he||t[79]!==U||t[80]!==q||t[81]!==j||t[82]!==z||t[83]!==u||t[84]!==we?(Le=U?(0,$.jsx)(Xn,{currentStep:u,summaries:we,instanceIdError:he,steps:q?Hn:Vn,disabled:z||j||ne!==null,identityStep:1,prerequisite:{step:0,error:Y},onNavigation:ke}):(0,$.jsx)(Xn,{currentStep:u,summaries:we,instanceIdError:he,disabled:z||j,onNavigation:ke}),t[75]=Y,t[76]=ke,t[77]=ne,t[78]=he,t[79]=U,t[80]=q,t[81]=j,t[82]=z,t[83]=u,t[84]=we,t[85]=Le):Le=t[85];let Be;t[86]!==Ie||t[87]!==Le?(Be=(0,$.jsx)(en,{title:`Add provider`,description:Ie,children:Le}),t[86]=Ie,t[87]=Le,t[88]=Be):Be=t[88];let Z;t[89]!==G||t[90]!==Y||t[91]!==l||t[92]!==ye||t[93]!==ne||t[94]!==h||t[95]!==H||t[96]!==pe||t[97]!==r||t[98]!==i||t[99]!==Ae||t[100]!==Ne||t[101]!==Pe||t[102]!==Fe||t[103]!==L||t[104]!==K||t[105]!==he||t[106]!==U||t[107]!==q||t[108]!==D||t[109]!==j||t[110]!==k||t[111]!==z||t[112]!==W||t[113]!==T||t[114]!==X||t[115]!==a||t[116]!==S||t[117]!==Ee||t[118]!==Oe||t[119]!==s.providerInstances||t[120]!==ge||t[121]!==u?(Z=ne?(0,$.jsx)(nr,{environmentId:r,environmentLabel:i,instanceId:ne,onFinish:()=>a(!1)}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(tn,{className:ae(U&&u===1&&`min-h-72`),holdHeight:u===0&&!D&&k,children:[(0,$.jsxs)(`div`,{className:ae(`grid gap-2`,u!==0&&`hidden`),children:[(0,$.jsx)(`div`,{id:`add-instance-driver-label`,className:`text-sm font-medium text-foreground`,children:`Provider`}),(0,$.jsx)(qe,{disabled:j,value:h,onValueChange:e=>{g(y.make(e)),O(!1),R(!1)},"aria-labelledby":`add-instance-driver-label`,className:`grid grid-cols-1 sm:grid-cols-2`,children:Et.definitions.filter(Ci).map(Si)})]}),u===0?(0,$.jsxs)(`div`,{className:`space-y-4 pt-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground`,children:[(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex-1 border-t border-border/70`}),(0,$.jsx)(`span`,{children:`Or choose from ACP Registry`}),(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex-1 border-t border-border/70`})]}),U&&D?(0,$.jsxs)(`div`,{className:`grid gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:q?`Local ACP command`:`Enter manually`}),(0,$.jsx)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:q?`Run an installed ACP executable on ${i}.`:`Enter an official registry ID and any local executable or auth override.`})]}),(0,$.jsx)(N,{onClick:()=>{O(!1),R(!1)},size:`xs`,variant:`ghost`,children:`Search registry`})]}),(0,$.jsxs)(kt,{variant:`plain`,children:[(0,$.jsx)(Mn,{definition:H,value:ye,idPrefix:`add-provider-acpRegistry-manual`,variant:`settings`,onChange:Ee}),q?(0,$.jsx)(ri,{environment:T,onChange:E}):null]}),U&&L&&Y?(0,$.jsx)(`p`,{className:`text-2xs text-destructive`,children:Y}):null]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)($n,{environmentId:r,providerInstances:s.providerInstances,onPrepared:Ae,onManualConfiguration:Pe,onLocalConfiguration:Ne,onLoadingChange:ee,onPreparingChange:te}),U&&L&&Y?(0,$.jsx)(`p`,{className:`mt-2 text-2xs text-destructive`,children:Y}):null]})]}):null,U&&u===1&&S?(0,$.jsxs)(`div`,{className:`mb-4 flex items-start justify-between gap-3 border-b border-border/70 pb-3`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate text-sm font-medium text-foreground`,children:S.name}),(0,$.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[`v`,S.version,` · `,S.distribution]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 gap-2 text-2xs`,children:[S.website?(0,$.jsx)(`a`,{"aria-label":`Open documentation for ${S.name} (${S.id})`,className:`text-muted-foreground hover:text-foreground`,href:S.website,rel:`noreferrer`,target:`_blank`,children:`Docs`}):null,S.repository?(0,$.jsx)(`a`,{"aria-label":`Open source for ${S.name} (${S.id})`,className:`text-muted-foreground hover:text-foreground`,href:S.repository,rel:`noreferrer`,target:`_blank`,children:`Source`}):null]})]}):null,(0,$.jsxs)(kt,{variant:`plain`,className:ae(u!==1&&`hidden`),children:[(0,$.jsx)(At,{title:(0,$.jsx)(`label`,{htmlFor:`add-provider-label`,children:`Label`}),description:(0,$.jsx)(`span`,{id:`add-provider-label-description`,children:`Shown in the provider list.`}),control:(0,$.jsx)(Ze,{id:`add-provider-label`,"aria-describedby":`add-provider-label-description`,size:`sm`,className:`w-full @min-[32rem]/settings-row:w-56`,placeholder:`e.g. Work`,value:W,onChange:e=>Oe({label:e.target.value})})}),(0,$.jsx)(At,{title:(0,$.jsx)(`label`,{htmlFor:`add-provider-instance-id`,children:`Instance ID`}),description:(0,$.jsx)(`span`,{id:`add-provider-instance-id-description`,children:`Letters, digits, '-', or '_'.`}),status:ge?(0,$.jsx)(`span`,{id:`add-provider-instance-id-error`,role:`alert`,className:`text-destructive`,children:he}):void 0,control:(0,$.jsx)(Ze,{id:`add-provider-instance-id`,"aria-describedby":ge?`add-provider-instance-id-description add-provider-instance-id-error`:`add-provider-instance-id-description`,size:`sm`,className:`w-full @min-[32rem]/settings-row:w-56`,placeholder:`${h}_work`,value:K,onChange:e=>{Oe({instanceIdOverride:e.target.value})},"aria-invalid":ge})}),(0,$.jsx)(At,{title:`Accent color`,description:`Optional marker shown in the picker.`,control:(0,$.jsx)(Ln,{displayName:W||H.label,value:G||void 0,onCommit:e=>Oe({accentColor:e}),layout:`inline`})})]}),!U&&pe.length>0?(0,$.jsx)(kt,{variant:`plain`,className:ae(u!==2&&`hidden`),children:(0,$.jsx)(Mn,{definition:H,value:ye,idPrefix:`add-provider-${h}`,variant:`settings`,onChange:Ee})}):!U&&u===2?(0,$.jsx)(`div`,{className:`grid gap-2`,children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This driver has no required configuration. You can add the instance now.`})}):null]}),(0,$.jsxs)(ln,{children:[(0,$.jsx)(N,{variant:u===0?`ghost-muted`:`outline`,size:`sm`,disabled:z||j,onClick:()=>{if(u===0){a(!1);return}d(xi)},children:u===0?`Cancel`:`Back`}),u===0&&h===`codex`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(N,{variant:`outline`,size:`sm`,onClick:()=>X(1),children:`Configure manually`}),(0,$.jsx)(Dn,{size:`sm`,onClick:()=>m(!0)})]}):u<(U?1:2)?(0,$.jsx)(N,{size:`sm`,disabled:j,onClick:()=>X(u+1),children:`Next`}):(0,$.jsx)(N,{size:`sm`,disabled:z||!l,onClick:()=>void Fe(),children:z?`Adding...`:U&&!q?`Continue to sign-in`:`Add instance`})]})]}),t[89]=G,t[90]=Y,t[91]=l,t[92]=ye,t[93]=ne,t[94]=h,t[95]=H,t[96]=pe,t[97]=r,t[98]=i,t[99]=Ae,t[100]=Ne,t[101]=Pe,t[102]=Fe,t[103]=L,t[104]=K,t[105]=he,t[106]=U,t[107]=q,t[108]=D,t[109]=j,t[110]=k,t[111]=z,t[112]=W,t[113]=T,t[114]=X,t[115]=a,t[116]=S,t[117]=Ee,t[118]=Oe,t[119]=s.providerInstances,t[120]=ge,t[121]=u,t[122]=Z):Z=t[122];let Ve;t[123]!==Be||t[124]!==Z?(Ve=(0,$.jsxs)(sn,{size:`wide`,children:[Be,Z]}),t[123]=Be,t[124]=Z,t[125]=Ve):Ve=t[125];let He;return t[126]!==a||t[127]!==n||t[128]!==Ve?(He=(0,$.jsx)(at,{open:n,onOpenChange:a,children:Ve}),t[126]=a,t[127]=n,t[128]=Ve,t[129]=He):He=t[129],He}function xi(e){return Math.max(0,e-1)}function Si(e){return(0,$.jsxs)(Ke,{value:e.driverKind,className:`relative flex cursor-pointer items-center gap-3 rounded-lg bg-card px-3 py-3 text-left text-muted-foreground outline-none ring-1 ring-black/5 hover:bg-muted focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring data-checked:bg-primary/8 data-checked:text-foreground data-checked:ring-2 data-checked:ring-inset data-checked:ring-primary data-checked:hover:bg-primary/8 dark:bg-white/3 dark:ring-white/5 dark:hover:bg-white/5 dark:data-checked:bg-primary/15 dark:data-checked:ring-primary dark:data-checked:hover:bg-primary/15`,children:[(0,$.jsx)(Dt,{driverKind:e.driverKind,displayName:e.label,iconClassName:`size-4`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(Je,{className:`grid size-5 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground`,"aria-hidden":!0,children:(0,$.jsx)(L,{className:`size-3.5 shrink-0`})}),e.badgeLabel?(0,$.jsx)(g,{variant:`warning`,size:`sm`,children:e.badgeLabel}):null]},e.driverKind)}function Ci(e){return e.driverKind!==gi}function wi(e){return Gn(e,gi,{label:`Local ACP`,instanceIdOverride:null})}function Ti(e){return{...e,[gi]:{source:`local`,commandArgs:[]}}}function Ei(e){return Gn(e,gi,{label:``,instanceIdOverride:null})}function Di(e){let t={...e};return delete t[gi],t}function Oi(e){return pi(gi,e)}function ki(e){let t=e;try{t=new URL(e).host}catch{}let n=t.toLowerCase().replace(/[^a-z0-9.-]+/g,`-`).replace(/^-+|-+$/g,``);return m.make(`cliproxy-${n||`hub`}`)}function Ai(e){let t=(0,Nn.c)(53),{open:n,onOpenChange:r,environmentId:i,environmentLabel:a}=e,o=Ae(i),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(``),p;t[0]===l?p=t[1]:(p=l.trim(),t[0]=l,t[1]=p);let m=p,h;t[2]!==d||t[3]!==m.length?(h=m.length>0&&d.trim().length>0,t[2]=d,t[3]=m.length,t[4]=h):h=t[4];let g=h,_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{c(``),u(``),f(``)},t[5]=_):_=t[5];let v=_,y;t[6]!==g||t[7]!==s||t[8]!==d||t[9]!==r||t[10]!==m||t[11]!==o?(y=()=>{if(!g)return;let e=ki(m);o({usageLimitSources:{[e]:{kind:`cliproxy`,...s.trim()?{label:s.trim()}:{},url:m,managementKey:d.trim(),enabled:!0}}}),v(),r(!1)},t[6]=g,t[7]=s,t[8]=d,t[9]=r,t[10]=m,t[11]=o,t[12]=y):y=t[12];let b=y,x;t[13]===r?x=t[14]:(x=e=>{e||v(),r(e)},t[13]=r,t[14]=x);let S;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(et,{children:`Add a CLIProxyAPI hub`}),t[15]=S):S=t[15];let C;t[16]===a?C=t[17]:(C=(0,$.jsxs)($e,{children:[S,(0,$.jsxs)(rt,{children:[`Show the quota of every account the hub pools, next to the providers on`,` `,a,`. The key stays on that server.`]})]}),t[16]=a,t[17]=C);let w;t[18]===b?w=t[19]:(w=e=>{e.preventDefault(),b()},t[18]=b,t[19]=w);let T;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(dn,{htmlFor:`usage-source-url`,children:`Hub URL`}),t[20]=T):T=t[20];let E;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>u(e.target.value),t[21]=E):E=t[21];let D;t[22]===l?D=t[23]:(D=(0,$.jsxs)(`div`,{className:`grid gap-1.5`,children:[T,(0,$.jsx)(Ze,{id:`usage-source-url`,placeholder:`https://hub.example.ts.net:8318`,value:l,onChange:E,autoFocus:!0})]}),t[22]=l,t[23]=D);let O;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(dn,{htmlFor:`usage-source-key`,children:`Management key`}),t[24]=O):O=t[24];let k;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>f(e.target.value),t[25]=k):k=t[25];let A;t[26]===d?A=t[27]:(A=(0,$.jsxs)(`div`,{className:`grid gap-1.5`,children:[O,(0,$.jsx)(xn,{id:`usage-source-key`,value:d,onChange:k})]}),t[26]=d,t[27]=A);let ee;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(dn,{htmlFor:`usage-source-label`,children:`Label (optional)`}),t[28]=ee):ee=t[28];let j;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>c(e.target.value),t[29]=j):j=t[29];let M;t[30]===s?M=t[31]:(M=(0,$.jsxs)(`div`,{className:`grid gap-1.5`,children:[ee,(0,$.jsx)(Ze,{id:`usage-source-label`,placeholder:`Defaults to the hub's host name`,value:s,onChange:j})]}),t[30]=s,t[31]=M);let te;t[32]!==D||t[33]!==A||t[34]!==M||t[35]!==w?(te=(0,$.jsx)(nt,{children:(0,$.jsxs)(`form`,{className:`grid gap-4`,onSubmit:w,children:[D,A,M]})}),t[32]=D,t[33]=A,t[34]=M,t[35]=w,t[36]=te):te=t[36];let P;t[37]===r?P=t[38]:(P=(0,$.jsx)(N,{variant:`outline`,onClick:()=>{v(),r(!1)},children:`Cancel`}),t[37]=r,t[38]=P);let F=!g,I;t[39]!==b||t[40]!==F?(I=(0,$.jsx)(N,{onClick:b,disabled:F,children:`Add hub`}),t[39]=b,t[40]=F,t[41]=I):I=t[41];let L;t[42]!==P||t[43]!==I?(L=(0,$.jsxs)(tt,{variant:`bare`,children:[P,I]}),t[42]=P,t[43]=I,t[44]=L):L=t[44];let R;t[45]!==te||t[46]!==L||t[47]!==C?(R=(0,$.jsxs)(it,{className:`max-w-md`,children:[C,te,L]}),t[45]=te,t[46]=L,t[47]=C,t[48]=R):R=t[48];let z;return t[49]!==n||t[50]!==R||t[51]!==x?(z=(0,$.jsx)(at,{open:n,onOpenChange:x,children:R}),t[49]=n,t[50]=R,t[51]=x,t[52]=z):z=t[52],z}function ji({environmentId:e,environmentLabel:t,sources:n,cursorKeychainUsageEnabled:r,readOnly:i}){let a=Ae(e),o=Z(X.updateSettings,{label:`update Cursor account usage`}),s=Z(X.refreshProviders,{reportFailure:!1}),c=H(X.configValueAtom(e))?.environment.platform,[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(!1),p=Object.entries(n),m=async t=>{f(!0);try{(await o({environmentId:e,input:{patch:{cursorKeychainUsageEnabled:t}}}))._tag===`Success`&&await s({environmentId:e,input:{}})}finally{f(!1)}};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Pt,{...rn(`usage-providers`),headerAction:i?null:(0,$.jsxs)(N,{size:`xs`,variant:`outline`,onClick:()=>u(!0),children:[(0,$.jsx)(j,{className:`size-3`,"aria-hidden":!0}),`Add hub`]}),children:[c?.os===`darwin`?(0,$.jsx)(At,{id:`cursor-keychain-usage`,title:`Cursor account usage`,description:`Read your existing Cursor CLI login from macOS Keychain to show account history and monthly limits. macOS may ask you to allow access.`,control:(0,$.jsx)(un,{"aria-label":`Cursor account usage`,checked:r,disabled:i||d,onCheckedChange:e=>void m(e)})}):null,p.length===0?(0,$.jsx)(At,{title:`No hubs configured.`}):p.map(([e,t])=>{let n=t.label?.trim()||t.url;return(0,$.jsx)(At,{title:n,description:(0,$.jsxs)(`span`,{className:`break-all`,children:[`CLI Proxy`,t.enabled?``:` · Disabled`,n===t.url?``:` · ${t.url}`]}),control:i?null:(0,$.jsx)(Mi,{label:n,onConfirm:()=>a({usageLimitSources:{[e]:null}})})},e)})]}),l&&!i?(0,$.jsx)(Ai,{open:!0,onOpenChange:u,environmentId:e,environmentLabel:t}):null]})}function Mi(e){let t=(0,Nn.c)(15),{label:n,onConfirm:r}=e,[i,a]=(0,Q.useState)(!1),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(N,{size:`xs`,variant:`ghost`,onClick:()=>a(!0),children:`Remove`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,$.jsxs)(Wt,{children:[`Remove `,n,`?`]}),t[1]=n,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Kt,{children:`The hub's management key is deleted from this server. Its accounts leave the Limits view; the hub itself is untouched. Add it again with the URL and key to bring them back.`}),t[3]=c):c=t[3];let l;t[4]===s?l=t[5]:(l=(0,$.jsxs)(Yt,{children:[s,c]}),t[4]=s,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(an,{render:(0,$.jsx)(N,{variant:`outline`}),children:`Cancel`}),t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=(0,$.jsxs)(qt,{children:[u,(0,$.jsx)(N,{variant:`destructive`,onClick:()=>{a(!1),r()},children:`Remove hub`})]}),t[7]=r,t[8]=d);let f;t[9]!==l||t[10]!==d?(f=(0,$.jsxs)(Ht,{children:[l,d]}),t[9]=l,t[10]=d,t[11]=f):f=t[11];let p;return t[12]!==i||t[13]!==f?(p=(0,$.jsxs)($.Fragment,{children:[o,(0,$.jsx)(Bt,{open:i,onOpenChange:a,children:f})]}),t[12]=i,t[13]=f,t[14]=p):p=t[14],p}function Ni(e){let t=typeof e==`object`&&e&&`authMethod`in e?e.authMethod:void 0;return U.find(e=>e.value===t)?.value??`oauth-personal`}function Pi(e){let t=(0,Nn.c)(21),n;t[0]===e.environmentLabel?n=t[1]:(n=(0,$.jsx)(`span`,{className:`text-muted-foreground [overflow-wrap:anywhere]`,children:e.environmentLabel}),t[0]=e.environmentLabel,t[1]=n);let r;t[2]!==e.enabled||t[3]!==e.onEnable||t[4]!==e.readOnly?(r=!e.enabled&&!e.readOnly?(0,$.jsx)(N,{size:`sm`,variant:`outline`,onClick:e.onEnable,children:`Enable Antigravity`}):null,t[2]=e.enabled,t[3]=e.onEnable,t[4]=e.readOnly,t[5]=r):r=t[5];let i;t[6]!==n||t[7]!==r?(i=(0,$.jsx)(At,{className:`@max-lg/setup:[&>div:first-child]:flex @max-lg/setup:[&>div:first-child]:items-stretch @max-lg/setup:[&>div:first-child]:gap-3`,title:`Environment`,description:`Device that runs this provider.`,control:(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:items-end`,children:[n,r]})}),t[6]=n,t[7]=r,t[8]=i):i=t[8];let a;t[9]!==e.authMethod||t[10]!==e.binaryPath||t[11]!==e.enabled||t[12]!==e.environmentId||t[13]!==e.environmentLabel||t[14]!==e.instanceId||t[15]!==e.provider||t[16]!==e.readOnly?(a=e.readOnly?(0,$.jsx)(At,{title:`Setup unavailable`,description:`Provider setup is read-only.`}):e.provider?.setup===void 0?(0,$.jsx)(At,{title:`Update required`,description:`Update this environment to manage Antigravity.`}):(0,$.jsx)(Fi,{environmentId:e.environmentId,environmentLabel:e.environmentLabel,instanceId:e.instanceId,provider:e.provider,binaryPath:e.binaryPath,authMethod:e.authMethod??`oauth-personal`,enabled:e.enabled},`${e.environmentId}:${e.instanceId}`),t[9]=e.authMethod,t[10]=e.binaryPath,t[11]=e.enabled,t[12]=e.environmentId,t[13]=e.environmentLabel,t[14]=e.instanceId,t[15]=e.provider,t[16]=e.readOnly,t[17]=a):a=t[17];let o;return t[18]!==i||t[19]!==a?(o=(0,$.jsxs)(`section`,{"aria-label":`Antigravity setup`,className:`@container/setup divide-y divide-border/50 text-xs`,children:[i,a]}),t[18]=i,t[19]=a,t[20]=o):o=t[20],o}function Fi({environmentId:e,environmentLabel:t,instanceId:n,provider:r,enabled:i,binaryPath:a}){let o={environmentId:e,input:{instanceId:n}},s=Be(X.providerAuthState(o)),c=Be(X.providerInstallState(o)),l=s.data,u=c.data,d={reportFailure:!1,reportDefect:!1},f=Z(X.startProviderInstall,d),p=Z(X.cancelProviderInstall,d),m=Z(X.removeProviderInstallation,d),[h,g]=(0,Q.useState)(null),_=(0,Q.useRef)(!1),[y,b]=(0,Q.useState)(null),x=l?.phase===`starting`||l?.phase===`waiting`||l?.phase===`verifying`,S=u?.phase===`downloading`||u?.phase===`extracting`||u?.phase===`verifying`,C=!!a?.trim(),w=r.installed||!C&&u?.installedVersion!=null,T=s.error??c.error,E=h!==null||T!==null,D=u?.phase===`downloading`?`Downloading ${(u.downloadedBytes/1e6).toFixed(1)} MB${u.totalBytes===null?``:` of ${(u.totalBytes/1e6).toFixed(1)} MB`}.`:u?.phase===`extracting`?`Extracting Antigravity.`:u?.phase===`verifying`?`Checking the downloaded runtime.`:w?`Installed.`:C?i?`The configured Antigravity runtime is unavailable.`:`The configured Antigravity runtime has not been checked.`:u?.totalBytes?`${Math.ceil(u.totalBytes/1e6)} MB download.`:`Not installed.`;async function O(e,t){if(_.current)return!1;_.current=!0,g(e),b(null);try{let e=await t();if(e._tag===`Failure`){if(!ce(e)){let t=le(e);b(t instanceof Error?t.message:`Provider setup failed.`)}return!1}return!0}catch{return b(`Provider setup failed. Try again.`),!1}finally{_.current=!1,g(null)}}async function k(){await Ne().dialogs.confirm(`Remove the downloaded Antigravity runtime from ${t}? Google sign-in and thread history are kept.`)&&await O(`Removing runtime`,()=>m(o))}return(0,$.jsxs)(`div`,{className:`divide-y divide-border/50`,children:[(0,$.jsx)(At,{title:`Runtime`,className:`@max-lg/setup:[&>div:first-child]:flex @max-lg/setup:[&>div:first-child]:items-stretch @max-lg/setup:[&>div:first-child]:gap-3`,description:`Install and manage Antigravity.`,status:(0,$.jsxs)(`div`,{className:`space-y-2`,children:[C?(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`Uses the custom binary path below. Installation keeps that path.`}):null,!w&&!r.setup?.canInstall?(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:`Automatic installation unavailable. Set a binary path or use another environment.`}):null]}),control:(0,$.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2 @min-[32rem]/settings-row:w-56 @min-[32rem]/settings-row:text-right`,children:[(0,$.jsx)(`p`,{role:`status`,className:`min-h-4 text-muted-foreground tabular-nums`,children:D}),(0,$.jsx)(`div`,{className:`h-1`,children:u?.phase===`downloading`&&u.totalBytes!==null&&u.totalBytes>0?(0,$.jsx)(`progress`,{"aria-label":`Antigravity download`,className:`block h-1 w-full accent-foreground`,value:u.downloadedBytes,max:u.totalBytes}):null}),!S&&u?.message&&u.message!==D?(0,$.jsx)(`p`,{className:`text-muted-foreground [overflow-wrap:anywhere]`,children:u.message}):null,(0,$.jsxs)(`div`,{className:`grid min-h-7 grid-cols-[1.75rem_minmax(0,1fr)] gap-2`,children:[(0,$.jsx)(`div`,{className:`col-start-2 row-start-1 grid`,children:S&&u.operationId?(0,$.jsx)(N,{size:`sm`,variant:`outline`,disabled:E,onClick:()=>{let t=u.operationId;t&&O(`Cancelling installation`,()=>p({environmentId:e,input:{instanceId:n,operationId:t}}))},children:`Cancel installation`}):!S&&r.setup?.canInstall?(0,$.jsx)(N,{size:`sm`,variant:`outline`,disabled:E||u===null||x,onClick:()=>void O(`Starting installation`,()=>f(o)),children:u?.installedVersion?u.version&&u.version!==u.installedVersion?`Update Antigravity`:`Reinstall Antigravity`:u?.phase===`failed`||u?.phase===`cancelled`?`Retry installation`:w?`Install managed runtime`:`Install Antigravity`}):null}),u?.canRemove&&!S?(0,$.jsx)(N,{size:`icon-sm`,variant:`ghost`,className:`col-start-1 row-start-1`,"aria-label":`Remove downloaded runtime`,disabled:E||x,onClick:()=>void k(),children:(0,$.jsx)(v,{className:`size-3.5`})}):null]})]})}),(0,$.jsx)(tr,{environmentId:e,environmentLabel:t,instanceId:n,provider:r,readOnly:!1}),(0,$.jsx)(`p`,{className:`sr-only`,role:`status`,children:h?`${h}.`:null}),y||T?(0,$.jsxs)(`div`,{className:`grid gap-2 px-3 py-3 sm:px-4`,children:[(0,$.jsx)(`p`,{role:`alert`,className:`text-destructive [overflow-wrap:anywhere]`,children:y??T}),T?(0,$.jsx)(N,{size:`sm`,variant:`outline`,className:`w-fit`,onClick:()=>{s.refresh(),c.refresh()},children:`Retry setup status`}):null]}):null]})}function Ii(e,t){let n=new Set(e),r=new Set(t.map(e=>e.trim()).filter(Boolean));return[...new Set([...n,...r])].filter(e=>n.has(e)!==r.has(e)).map(e=>({model:e,selected:r.has(e)}))}function Li(e,t){if(typeof e!=`object`||!e)return null;let n=e[t];return typeof n==`string`&&n.trim().length>0?n.trim():null}var Ri=Et.definitions.map(e=>({provider:e.driverKind,hasDefaultInstance:e.hasDefaultInstance!==!1}));function zi(e){return typeof e!=`object`||!e||!(`binaryPath`in e)?``:typeof e.binaryPath==`string`?e.binaryPath.trim():``}function Bi(e){let t=(0,Nn.c)(6),{lastCheckedAt:n}=e;It();let r;t[0]===n?r=t[1]:(r=He(n),t[0]=n,t[1]=r);let i=r;if(i.status===`missing`)return null;if(i.status===`invalid`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{children:`Checked unavailable`}),t[2]=e):e=t[2],e}let a;return t[3]!==i.suffix||t[4]!==i.value?(a=(0,$.jsx)(`span`,{children:i.suffix?(0,$.jsxs)($.Fragment,{children:[`Checked `,(0,$.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,$.jsxs)($.Fragment,{children:[`Checked `,i.value]})}),t[3]=i.suffix,t[4]=i.value,t[5]=a):a=t[5],a}function Vi(e){return e.entry.target._tag===`PrimaryConnectionTarget`?`Primary device`:e.relayManaged?`P4 Connect`:e.entry.target._tag===`SshConnectionTarget`?`SSH`:K(e.entry.target)?`Local device`:e.displayUrl??`Remote device`}var Hi=`@min-[48rem]/providers:h-[min(44rem,calc(100dvh-11rem))] @min-[48rem]/providers:min-h-[32rem]`;function Ui(e){let t=(0,Nn.c)(22),{deviceTabs:n,icon:r,title:i,description:a,children:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=rn(`providers`),t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=n?(0,$.jsx)(`div`,{className:`flex min-h-11 min-w-0 items-center px-3 sm:px-4`,children:n}):null,t[1]=n,t[2]=c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=ae(Hi,`scrollbar-gutter-both flex overflow-x-hidden overflow-y-auto`),t[3]=l):l=t[3];let u;t[4]===r?u=t[5]:(u=(0,$.jsx)(ot,{variant:`icon`,children:r}),t[4]=r,t[5]=u);let d;t[6]===i?d=t[7]:(d=(0,$.jsx)(lt,{children:i}),t[6]=i,t[7]=d);let f;t[8]===a?f=t[9]:(f=(0,$.jsx)(ut,{children:a}),t[8]=a,t[9]=f);let p;t[10]!==d||t[11]!==f?(p=(0,$.jsxs)(st,{children:[d,f]}),t[10]=d,t[11]=f,t[12]=p):p=t[12];let m;t[13]===o?m=t[14]:(m=o?(0,$.jsx)(ct,{className:`max-w-xl`,children:o}):null,t[13]=o,t[14]=m);let h;t[15]!==u||t[16]!==p||t[17]!==m?(h=(0,$.jsx)(kt,{divided:!1,className:l,children:(0,$.jsxs)(dt,{children:[u,p,m]})}),t[15]=u,t[16]=p,t[17]=m,t[18]=h):h=t[18];let g;return t[19]!==c||t[20]!==h?(g=(0,$.jsxs)(Pt,{...s,variant:`plain`,children:[c,h]}),t[19]=c,t[20]=h,t[21]=g):g=t[21],g}function Wi(e){let t=(0,Nn.c)(18),{environment:n,access:r,deviceTabs:i}=e,a=r.kind===`loading`,o=a?`Loading provider settings`:r.kind===`error`?`Could not connect to this device`:`Provider settings are unavailable`,c;t[0]!==r.reason||t[1]!==n.connection||t[2]!==n.label||t[3]!==a?(c=a?r.reason===`permissions`?`Checking what this session is allowed to change.`:`Waiting for ${n.label}'s configuration.`:de(n.connection),t[0]=r.reason,t[1]=n.connection,t[2]=n.label,t[3]=a,t[4]=c):c=t[4];let l=c,u=a?null:n.connection.error,d;t[5]===n.serverConfig?d=t[6]:(d=s(n.serverConfig),t[5]=n.serverConfig,t[6]=d);let f;t[7]===d?f=t[8]:(f=(0,$.jsx)(Ct,{kind:d}),t[7]=d,t[8]=f);let p;t[9]!==n.environmentId||t[10]!==u?(p=u?(0,$.jsx)(bn,{text:u,className:`w-full text-left font-mono text-xs leading-relaxed text-muted-foreground`},n.environmentId):null,t[9]=n.environmentId,t[10]=u,t[11]=p):p=t[11];let m;return t[12]!==l||t[13]!==i||t[14]!==f||t[15]!==p||t[16]!==o?(m=(0,$.jsx)(Ui,{deviceTabs:i,icon:f,title:o,description:l,children:p}),t[12]=l,t[13]=i,t[14]=f,t[15]=p,t[16]=o,t[17]=m):m=t[17],m}function Gi(e){let t=(0,Nn.c)(3),n=`${e.environmentId??``}:${e.instanceId??``}`,r;return t[0]!==n||t[1]!==e?(r=(0,$.jsx)(Mt,{className:`@container/providers gap-8`,children:(0,$.jsx)(Ki,{...e},n)}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r}function Ki(e){let t=(0,Nn.c)(59),{environments:n,isReady:r}=Ee(),i=Oe(),a=jt(),o;t[0]!==n||t[1]!==i||t[2]!==e.environmentIds?(o=pn(n,i,e.environmentIds),t[0]=n,t[1]=i,t[2]=e.environmentIds,t[3]=o):o=t[3];let c=o,[l,u]=(0,Q.useState)(e.environmentId??i),d;t[4]!==c||t[5]!==l||t[6]!==e.environmentId?(d=e.environmentId!==void 0&&l===e.environmentId&&!c.some(t=>t.environmentId===e.environmentId),t[4]=c,t[5]=l,t[6]=e.environmentId,t[7]=d):d=t[7];let f=d,p;t[8]!==c||t[9]!==i||t[10]!==l||t[11]!==e.environmentId||t[12]!==e.scoped||t[13]!==f?(p=e.scoped||f?e.environmentId:$t(c,l,i),t[8]=c,t[9]=i,t[10]=l,t[11]=e.environmentId,t[12]=e.scoped,t[13]=f,t[14]=p):p=t[14];let m=p,h,g;t[15]!==m||t[16]!==c?(h=c.find(e=>e.environmentId===m)??null,g=h!==null&&Ut({connectionPhase:h.connection.phase,hasServerConfig:h.serverConfig!==null}),t[15]=m,t[16]=c,t[17]=h,t[18]=g):(h=t[17],g=t[18]);let _=g,v;t[19]===c?v=t[20]:(v=c.find(Yi)?.environmentId,t[19]=c,t[20]=v);let y=v,b;t[21]===c?b=t[22]:(b=c.find(Ji)?.environmentId,t[21]=c,t[22]=b);let x=b,S;t[23]!==a||t[24]!==x||t[25]!==y||t[26]!==h?.serverConfig?.environment||t[27]!==_||t[28]!==e.scoped?(S=()=>{if(!e.scoped&&a===rn(`cursor-keychain-usage`).id&&(!_||h?.serverConfig?.environment.platform.os!==`darwin`)&&x!==void 0){u(x);return}!e.scoped&&(a===rn(`provider-health-check-interval`).id||a===rn(`usage-providers`).id)&&!_&&y!==void 0&&u(y)},t[23]=a,t[24]=x,t[25]=y,t[26]=h?.serverConfig?.environment,t[27]=_,t[28]=e.scoped,t[29]=S):S=t[29];let C;t[30]!==a||t[31]!==x||t[32]!==y||t[33]!==h||t[34]!==_||t[35]!==e.scoped?(C=[a,x,y,h,_,e.scoped],t[30]=a,t[31]=x,t[32]=y,t[33]=h,t[34]=_,t[35]=e.scoped,t[36]=C):C=t[36],(0,Q.useEffect)(S,C);let w=c.length===1&&c[0]?.entry.target._tag===`PrimaryConnectionTarget`,T;t[37]!==m||t[38]!==w||t[39]!==c||t[40]!==e.scoped?(T=!e.scoped&&!w&&c.length>0?(0,$.jsx)(Qe,{radius:`none`,hideScrollbars:!0,scrollFade:!0,className:`h-11 min-w-0 flex-1`,children:(0,$.jsx)(Ye,{"aria-label":`Devices`,variant:`segmented`,className:`my-2`,value:m?[m]:[],onValueChange:e=>{let t=c.find(t=>t.environmentId===e[0]);t&&u(t.environmentId)},children:c.map(qi)})}):null,t[37]=m,t[38]=w,t[39]=c,t[40]=e.scoped,t[41]=T):T=t[41];let E=T,D;t[42]!==E||t[43]!==f?(D=f?(0,$.jsx)(Ui,{deviceTabs:E,icon:(0,$.jsx)(Ct,{kind:s(null)}),title:`Device unavailable`,description:`Reconnect this device to set up its provider, or select another device.`}):null,t[42]=E,t[43]=f,t[44]=D):D=t[44];let O;t[45]!==r||t[46]!==c.length||t[47]!==f?(O=c.length===0&&!f?(0,$.jsx)(Ui,{icon:(0,$.jsx)(Ct,{kind:s(null)}),title:r?`No connected devices`:`Loading devices`,description:r?`Connect an execution environment before configuring providers.`:`Reading connected execution environments.`}):null,t[45]=r,t[46]=c.length,t[47]=f,t[48]=O):O=t[48];let k;t[49]!==E||t[50]!==h||t[51]!==e.environmentId||t[52]!==e.instanceId||t[53]!==e.projectIds?(k=h?(0,$.jsx)(Xi,{environment:h,deviceTabs:E,targetInstanceId:e.environmentId===void 0||h.environmentId===e.environmentId?e.instanceId:void 0,projectIds:e.projectIds??[]},h.environmentId):null,t[49]=E,t[50]=h,t[51]=e.environmentId,t[52]=e.instanceId,t[53]=e.projectIds,t[54]=k):k=t[54];let A;return t[55]!==O||t[56]!==k||t[57]!==D?(A=(0,$.jsxs)($.Fragment,{children:[D,O,k]}),t[55]=O,t[56]=k,t[57]=D,t[58]=A):A=t[58],A}function qi(e){let t=s(e.serverConfig),n=Vi(e),r=de(e.connection);return(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsxs)(Xe,{value:e.environmentId,children:[(0,$.jsx)(Ct,{kind:t,className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`max-w-40 truncate`,children:e.label}),e.connection.phase===`connected`?null:(0,$.jsx)(zt,{dotClassName:Lt(e.connection.phase),pingClassName:Rt(e.connection.phase)}),(0,$.jsxs)(`span`,{className:`sr-only`,children:[n,`, `,r]})]})}),(0,$.jsxs)(We,{side:`top`,children:[n,` · `,r]})]},e.environmentId)}function Ji(e){return e.serverConfig?.environment.platform.os===`darwin`&&Ut({connectionPhase:e.connection.phase,hasServerConfig:!0})}function Yi(e){return Ut({connectionPhase:e.connection.phase,hasServerConfig:e.serverConfig!==null})}function Xi(e){let t=(0,Nn.c)(5),{environment:n,deviceTabs:r,targetInstanceId:i,projectIds:a}=e,o;return t[0]!==r||t[1]!==n||t[2]!==a||t[3]!==i?(o=(0,$.jsx)(Zi,{environment:n,deviceTabs:r,targetInstanceId:i,projectIds:a}),t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o):o=t[4],o}function Zi(e){let t=(0,Nn.c)(10),{environment:n,deviceTabs:r,targetInstanceId:i,projectIds:a}=e,o=Le(n.environmentId),s;t[0]!==o.data||t[1]!==o.hasError||t[2]!==o.isPending?(s=Zt({session:o.data,isPending:o.isPending,hasError:o.hasError}),t[0]=o.data,t[1]=o.hasError,t[2]=o.isPending,t[3]=s):s=t[3];let c=s,l;return t[4]!==r||t[5]!==n||t[6]!==c||t[7]!==a||t[8]!==i?(l=(0,$.jsx)(Qi,{environment:n,operateAccess:c,deviceTabs:r,targetInstanceId:i,projectIds:a}),t[4]=r,t[5]=n,t[6]=c,t[7]=a,t[8]=i,t[9]=l):l=t[9],l}function Qi(e){let t=(0,Nn.c)(15),{environment:n,operateAccess:r,deviceTabs:i,targetInstanceId:a,projectIds:o}=e,s=n.serverConfig!==null,c;t[0]!==n.connection.phase||t[1]!==r||t[2]!==s?(c=Qt({connectionPhase:n.connection.phase,hasServerConfig:s,operateAccess:r}),t[0]=n.connection.phase,t[1]=r,t[2]=s,t[3]=c):c=t[3];let l=c;if(l.kind!==`editable`&&l.kind!==`read-only`){let e;return t[4]!==l||t[5]!==i||t[6]!==n?(e=(0,$.jsx)(Wi,{environment:n,access:l,deviceTabs:i}),t[4]=l,t[5]=i,t[6]=n,t[7]=e):e=t[7],e}let u=l.kind===`read-only`,d;return t[8]!==i||t[9]!==n.environmentId||t[10]!==n.label||t[11]!==o||t[12]!==u||t[13]!==a?(d=(0,$.jsx)($i,{environmentId:n.environmentId,environmentLabel:n.label,readOnly:u,deviceTabs:i,targetInstanceId:a,projectIds:o}),t[8]=i,t[9]=n.environmentId,t[10]=n.label,t[11]=o,t[12]=u,t[13]=a,t[14]=d):d=t[14],d}function $i(e){let t=(0,Nn.c)(179),{environmentId:n,environmentLabel:r,readOnly:i,deviceTabs:o,targetInstanceId:s,projectIds:c}=e,l=i!==void 0&&i,f;t[0]===c?f=t[1]:(f=c===void 0?[]:c,t[0]=c,t[1]=f);let p=f,m=je(n),g=Re(n,a),_=Re(n,h),v=Ae(n),b=Pe(n),x=ke(n),w=Me(n),T=H(X.providersValueAtom(n))??Ie,D=ue(),k;if(t[2]!==n||t[3]!==D){let e;t[5]===n?e=t[6]:(e=e=>e.environmentId===n,t[5]=n,t[6]=e),k=D.filter(e),t[2]=n,t[3]=D,t[4]=k}else k=t[4];let A=k,ee=G().get(n)?.environment.capabilities.projectProviderInstanceOverrides===!0,M;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(M={reportFailure:!1},t[7]=M):M=t[7];let te=Z(X.refreshProviders,M),F;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(F={reportFailure:!1},t[8]=F):F=t[8];let I=Z(X.updateProvider,F),L;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(L={reportFailure:!1},t[9]=L):L=t[9];let z=Z(X.uninstallAcpRegistryManagedBinary,L),B;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(B={reportFailure:!1},t[10]=B):B=t[10];let ne=Z(X.acceptAcpRegistryUrlAuth,B),[ie,V]=(0,Q.useState)(!1),[oe,U]=(0,Q.useState)(!1),[de,K]=(0,Q.useState)(s??null),[fe,pe]=(0,Q.useState)(sa),me=(0,Q.useRef)(!1),q;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(q=new Set,t[11]=q):q=t[11];let be=(0,Q.useRef)(q),xe;t[12]!==ne||t[13]!==n?(xe=(e,t)=>{ne({environmentId:n,input:{instanceId:e,elicitationId:t.elicitationId}}).then(oa)},t[12]=ne,t[13]=n,t[14]=xe):xe=t[14];let J=xe,Y;t[15]===T?Y=t[16]:(Y=new Map(T.filter(Gt).map(aa)),t[15]=T,t[16]=Y);let Se=Y,we,Te,Ee,Oe,Ne,Le,Be,He,Ke,qe,Je,Ye,Xe,Ze,$e,et;if(t[17]!==J||t[18]!==_||t[19]!==g||t[20]!==o||t[21]!==n||t[22]!==r||t[23]!==ie||t[24]!==w||t[25]!==p||t[26]!==A||t[27]!==Se||t[28]!==l||t[29]!==te||t[30]!==de||t[31]!==T||t[32]!==m||t[33]!==ee||t[34]!==s||t[35]!==x||t[36]!==z||t[37]!==b||t[38]!==I||t[39]!==v||t[40]!==fe){let e;t[57]===T?e=t[58]:(e=e=>e.provider!==`cursor`||T.some(ia),t[57]=T,t[58]=e);let i=Ri.filter(e),a;t[59]!==T||t[60]!==m?(a=u(m,T),t[59]=T,t[60]=m,t[61]=a):a=t[61];let c=a.instanceId,f;if(t[62]!==m){Ne=Fe(m);let e=De(Ne.profile).providerHealthRefreshInterval;Oe=hn(Ne.providerHealthRefreshInterval),f=hn(e),t[62]=m,t[63]=Oe,t[64]=Ne,t[65]=f}else Oe=t[63],Ne=t[64],f=t[65];Ee=f;let h;t[66]===T?h=t[67]:(h=T.length>0?T.reduce(ra,T[0].checkedAt):null,t[66]=T,t[67]=h);let D=h,k;t[68]!==n||t[69]!==te?(k=()=>{!me.current&&ze(n,`orchestration:read`)&&(me.current=!0,V(!0),(async()=>{let e=await te({environmentId:n,input:{refreshModels:!0}});me.current=!1,V(!1),e._tag===`Failure`&&!ce(e)&&console.warn(`Failed to refresh providers`,{operation:`refresh-providers`,environmentId:n,...W(le(e))})})())},t[68]=n,t[69]=te,t[70]=k):k=t[70];let M=k,F;t[71]!==n||t[72]!==I?(F=async(e,t)=>{if(!ze(n,`providers:manage`)||be.current.has(e.instanceId))return;be.current.add(e.instanceId),pe(t=>new Set(t).add(e.instanceId));let r=await I({environmentId:n,input:{provider:e.driver,instanceId:e.instanceId,...t?{targetVersion:t}:{}}});if(r._tag===`Failure`&&!ce(r)){let t=le(r);Ce.add(Ve({type:`error`,title:`Could not update ${P[e.driver]??e.driver}`,description:t instanceof Error?t.message:`The provider update command could not be started.`}))}be.current.delete(e.instanceId),pe(t=>{if(!t.has(e.instanceId))return t;let n=new Set(t);return n.delete(e.instanceId),n})},t[71]=n,t[72]=I,t[73]=F):F=t[73];let L=F,B=new Map;for(let[e,t]of Object.entries(m.providerInstances??{})){let n=t.driver,r=B.get(n)??[];r.push([e,t]),B.set(n,r)}let ne=new Set(i.map(na)),oe=[],H=new Set(i.map(ta));for(let e of i){let t=e.provider,n=C(t),r=m.providerInstances?.[n],i=r??{driver:t},a=r!==void 0;(e.hasDefaultInstance||r!==void 0)&&(t===`codex`||t===`claudeAgent`||a||O(i)||n===s)&&oe.push({instanceId:n,instance:i,driver:t,isDefault:!0,isDirty:a});for(let[t,r]of B.get(e.provider)??[])t!==n&&oe.push({instanceId:t,instance:r,driver:r.driver,isDefault:!1})}for(let[e,t]of B)if(!H.has(e))for(let[e,n]of t)oe.push({instanceId:e,instance:n,driver:n.driver,isDefault:ne.has(String(e))});let se=s!==void 0&&de===s&&!oe.some(e=>e.instanceId===s),G=oe.find(e=>e.instanceId===de)??(se?null:oe[0]??null),ue;t[74]!==w||t[75]!==m?(ue=async(e,t,n)=>{let{providerInstances:r,...i}=_n({settings:m,instanceId:e.instanceId,instance:t,textGenerationModelSelection:n?.textGenerationModelSelection}),a=await w({operation:`upsert`,instanceId:e.instanceId,instance:t},i);if(a._tag===`Failure`&&!ce(a)){let e=le(a);Ce.add({type:`error`,title:`Could not update provider instance`,description:e instanceof Error?e.message:`The settings update failed.`})}},t[74]=w,t[75]=m,t[76]=ue):ue=t[76];let he=ue,ge;t[77]!==n||t[78]!==w||t[79]!==z?(ge=async e=>{let t=await w({operation:`remove`,instanceId:e.instanceId});if(t._tag===`Failure`){let e=le(t);Ce.add({type:`error`,title:`Could not delete provider instance`,description:e instanceof Error?e.message:`The settings update failed.`});return}if(e.driver!==y.make(`acpRegistry`)||Li(e.instance.config,`source`)===`local`)return;let r=Li(e.instance.config,`agentId`);if(r===null)return;let i=await z({environmentId:n,input:{agentId:r}});if(i._tag===`Failure`&&!ce(i)){let e=le(i);Ce.add({type:`warning`,title:`Provider deleted, but managed files remain`,description:e instanceof Error?e.message:`Managed binary cleanup failed.`})}},t[77]=n,t[78]=w,t[79]=z,t[80]=ge):ge=t[80];let _e=ge,ve;t[81]===w?ve=t[82]:(ve=async e=>{let t=await w({operation:`remove`,instanceId:C(e)});if(t._tag===`Failure`&&!ce(t)){let e=le(t);Ce.add({type:`error`,title:`Could not reset provider instance`,description:e instanceof Error?e.message:`The settings update failed.`})}},t[81]=w,t[82]=ve);let ye=ve,q=(e,t)=>{let i=Et.get(e.driver),a=T.find(t=>t.instanceId===e.instanceId),o=Se.get(e.instanceId),s=fe.has(e.instanceId)||a!==void 0&&Xt(a),u=o!==void 0,f=o!==void 0&&!s,h=m.providerModelPreferences?.[e.instanceId]??{hiddenModels:[],modelOrder:[]},_=S(m.favorites??[],t=>t.provider===e.instanceId?re(t.model):d),y=i?.label??String(e.driver),C=p[0],w=t=>{v({projectSettingsOverrides:Vt(m,p,e.instanceId,t)})},D=C===void 0||!ee?void 0:{value:m.projectSettingsOverrides[C]?.providerInstances?.[e.instanceId]?.enabled,effectiveEnabled:E(m,C,e.instanceId),onChange:e=>w(e),onReset:()=>w(void 0)};return(0,$.jsx)(si,{environmentId:n,acpProjects:A,projectOverride:D,onAcceptUrlAuth:l?void 0:t=>J(e.instanceId,t),instanceId:e.instanceId,instance:e.instance,driverOption:i,liveProvider:a,mode:t,selected:t===`list`&&G?.instanceId===e.instanceId,onSelect:t===`list`?()=>K(e.instanceId):void 0,readOnly:l,runtime:t===`editor`&&e.driver===`codex`&&An(e.instance.config)===`managed`?(0,$.jsx)(On,{environmentId:n,instanceId:e.instanceId,provider:a}):void 0,canWriteSettings:g,setup:t===`editor`&&e.driver===`antigravity`?(0,$.jsx)(Pi,{environmentId:n,environmentLabel:r,instanceId:e.instanceId,provider:a,binaryPath:zi(e.instance.config),authMethod:Ni(e.instance.config),enabled:O(e.instance),readOnly:l,onEnable:()=>he(e,{...e.instance,enabled:!0})}):t===`editor`&&e.driver===`codex`&&An(e.instance.config)===`managed`?(0,$.jsx)(wn,{environmentId:n,instanceId:e.instanceId,provider:a,mode:An(e.instance.config),enabled:O(e.instance),readOnly:l,onModeChange:t=>he(e,{...e.instance,enabled:!0,config:{...e.instance.config!==null&&typeof e.instance.config==`object`?e.instance.config:{},enabled:!0,setupMode:t}})}):t===`editor`&&!l&&a&&(a.setup?.canAuthenticate||a.driver===`acpRegistry`&&a.installed)?(0,$.jsx)(tr,{environmentId:n,environmentLabel:r,instanceId:e.instanceId,provider:a,readOnly:l},`${n}:${e.instanceId}`):t===`editor`&&!l&&e.driver===`cursor`&&a?.setup?.canAuthenticate===!1?(0,$.jsx)(At,{title:`Cursor account`,description:`Using CURSOR_API_KEY. Remove it from this provider's environment to use browser sign-in.`}):null,onUpdate:t=>{let r=O(e.instance),i=t.enabled===!1&&r&&c===e.instanceId&&ze(n,`settings:write`);he(e,t,i?{textGenerationModelSelection:R.textGenerationModelSelection}:void 0)},onDelete:t===`editor`&&!e.isDefault?()=>_e(e):void 0,headerAction:t===`editor`&&e.isDefault&&e.isDirty?(0,$.jsx)(Nt,{label:`${y} provider settings`,onClick:()=>ye(e.driver)}):null,hiddenModels:h.hiddenModels,favoriteModels:_,modelOrder:h.modelOrder,onHiddenModelsChange:(t,n)=>{let r=new Set(t),i=n??Ii(h.hiddenModels,t).map(ea);b({setModelsHidden:i.map(t=>({provider:e.instanceId,model:t,hidden:r.has(t)}))})},onToggleFavorite:t=>{x(e.instanceId,t)},onFavoriteModelsChange:t=>{b({setModelFavorites:Ii(_,t).map(t=>{let{model:n,selected:r}=t;return{provider:e.instanceId,model:n,favorite:r}})})},onModelOrderChange:t=>{b({setProviderModelOrder:{provider:e.instanceId,modelOrder:t}})},onInstallRecommended:!l&&a?.compatibilityAdvisory?.message&&a.compatibilityAdvisory.recommendedVersion&&a.versionAdvisory?.canInstallVersion?()=>{L(a,a.compatibilityAdvisory?.recommendedVersion??void 0)}:void 0,onRunUpdate:!l&&u&&o?()=>{f&&L(o)}:void 0,isUpdating:s},e.instanceId)};Te=Pt,t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Je=rn(`providers`),t[83]=Je):Je=t[83],Ye=`plain`,t[84]===l?Xe=t[85]:(Xe=l?null:(0,$.jsxs)(Ge,{children:[(0,$.jsx)(Ue,{render:(0,$.jsx)(N,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>U(!0),"aria-label":`Add provider`,children:(0,$.jsx)(j,{})})}),(0,$.jsx)(We,{side:`top`,children:`Add provider`})]}),t[84]=l,t[85]=Xe);let xe;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,$.jsx)(fn,{}),t[86]=xe):xe=t[86];let Y=ie||!_,ke;t[87]===M?ke=t[88]:(ke=()=>void M(),t[87]=M,t[88]=ke);let Ae;t[89]===ie?Ae=t[90]:(Ae=(0,$.jsx)(Jt,{refreshing:ie}),t[89]=ie,t[90]=Ae);let je;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,$.jsx)(`span`,{className:`sr-only`,children:`Refresh provider status`}),t[91]=je):je=t[91];let Me;t[92]!==ie||t[93]!==D?(Me=ie?`Refreshing providers`:(0,$.jsx)(Bi,{lastCheckedAt:D}),t[92]=ie,t[93]=D,t[94]=Me):Me=t[94];let Pe;t[95]===Me?Pe=t[96]:(Pe=(0,$.jsx)(`span`,{className:`hidden min-w-0 truncate sm:inline`,children:Me}),t[95]=Me,t[96]=Pe);let X;t[97]!==ie||t[98]!==Y||t[99]!==ke||t[100]!==Ae||t[101]!==Pe?(X=(0,$.jsx)(Ue,{render:(0,$.jsxs)(N,{size:`xs`,variant:`ghost-muted`,disabled:Y,"aria-busy":ie,onClick:ke,children:[Ae,je,Pe]})}),t[97]=ie,t[98]=Y,t[99]=ke,t[100]=Ae,t[101]=Pe,t[102]=X):X=t[102];let Ie;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=(0,$.jsx)(We,{side:`top`,children:`Refresh provider status`}),t[103]=Ie):Ie=t[103],t[104]===X?Ze=t[105]:(Ze=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[xe,(0,$.jsxs)(Ge,{children:[X,Ie]})]}),t[104]=X,t[105]=Ze),t[106]===o?$e=t[107]:($e=o?(0,$.jsx)(`div`,{className:`flex min-h-11 min-w-0 items-center gap-2 px-3 sm:px-4`,children:o}):null,t[106]=o,t[107]=$e),t[108]!==r||t[109]!==l?(et=l?(0,$.jsx)(kt,{divided:!1,className:`overflow-hidden`,children:(0,$.jsx)(At,{title:`Limited permissions`,description:`This session can view ${r}'s providers but can't change their settings.`})}):null,t[108]=r,t[109]=l,t[110]=et):et=t[110],we=kt,He=!1,t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=ae(Hi,`overflow-hidden @min-[48rem]/providers:grid @min-[48rem]/providers:grid-cols-[17rem_minmax(0,1fr)]`),t[111]=Ke):Ke=t[111];let Re;t[112]===l?Re=t[113]:(Re=l?null:(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full cursor-pointer items-center gap-3 px-3 py-3 text-left text-sm text-muted-foreground transition-colors outline-none hover:bg-muted/25 hover:text-foreground focus-visible:bg-muted/25 focus-visible:text-foreground sm:px-4`,onClick:()=>U(!0),children:[(0,$.jsx)(j,{className:`size-4 shrink-0`}),`Add provider`]}),t[112]=l,t[113]=Re);let Z=(0,$.jsxs)(`div`,{className:`divide-y divide-border/50`,children:[oe.map(e=>q(e,`list`)),Re]});t[114]===Z?qe=t[115]:(qe=(0,$.jsx)(`div`,{className:`border-b border-border/60 bg-muted/10 @min-[48rem]/providers:flex @min-[48rem]/providers:min-h-0 @min-[48rem]/providers:flex-col @min-[48rem]/providers:border-r @min-[48rem]/providers:border-b-0`,children:(0,$.jsx)(Qe,{scrollFade:!0,chainVerticalScroll:!0,className:`@min-[48rem]/providers:min-h-0 @min-[48rem]/providers:flex-1`,children:Z})}),t[114]=Z,t[115]=qe),Le=`min-w-0 @min-[48rem]/providers:min-h-0`,Be=G?(0,$.jsx)(Qe,{scrollFade:!0,chainVerticalScroll:!0,className:`@min-[48rem]/providers:h-full`,children:(0,$.jsx)(`div`,{className:`space-y-6 p-4`,children:q(G,`editor`)})}):(0,$.jsx)(`div`,{className:`p-6 text-sm text-muted-foreground`,children:se?`This provider instance is no longer available on this device.`:`No providers configured.`}),t[17]=J,t[18]=_,t[19]=g,t[20]=o,t[21]=n,t[22]=r,t[23]=ie,t[24]=w,t[25]=p,t[26]=A,t[27]=Se,t[28]=l,t[29]=te,t[30]=de,t[31]=T,t[32]=m,t[33]=ee,t[34]=s,t[35]=x,t[36]=z,t[37]=b,t[38]=I,t[39]=v,t[40]=fe,t[41]=we,t[42]=Te,t[43]=Ee,t[44]=Oe,t[45]=Ne,t[46]=Le,t[47]=Be,t[48]=He,t[49]=Ke,t[50]=qe,t[51]=Je,t[52]=Ye,t[53]=Xe,t[54]=Ze,t[55]=$e,t[56]=et}else we=t[41],Te=t[42],Ee=t[43],Oe=t[44],Ne=t[45],Le=t[46],Be=t[47],He=t[48],Ke=t[49],qe=t[50],Je=t[51],Ye=t[52],Xe=t[53],Ze=t[54],$e=t[55],et=t[56];let tt;t[116]!==Le||t[117]!==Be?(tt=(0,$.jsx)(`div`,{className:Le,children:Be}),t[116]=Le,t[117]=Be,t[118]=tt):tt=t[118];let nt;t[119]!==we||t[120]!==He||t[121]!==Ke||t[122]!==qe||t[123]!==tt?(nt=(0,$.jsxs)(we,{divided:He,className:Ke,children:[qe,tt]}),t[119]=we,t[120]=He,t[121]=Ke,t[122]=qe,t[123]=tt,t[124]=nt):nt=t[124];let rt;t[125]!==Te||t[126]!==Je||t[127]!==Ye||t[128]!==Xe||t[129]!==Ze||t[130]!==$e||t[131]!==et||t[132]!==nt?(rt=(0,$.jsxs)(Te,{...Je,variant:Ye,titleAction:Xe,headerAction:Ze,children:[$e,et,nt]}),t[125]=Te,t[126]=Je,t[127]=Ye,t[128]=Xe,t[129]=Ze,t[130]=$e,t[131]=et,t[132]=nt,t[133]=rt):rt=t[133];let it;t[134]!==n||t[135]!==r||t[136]!==l||t[137]!==m.cursorKeychainUsageEnabled||t[138]!==m.usageLimitSources?(it=(0,$.jsx)(ji,{environmentId:n,environmentLabel:r,sources:m.usageLimitSources,cursorKeychainUsageEnabled:m.cursorKeychainUsageEnabled,readOnly:l},n),t[134]=n,t[135]=r,t[136]=l,t[137]=m.cursorKeychainUsageEnabled,t[138]=m.usageLimitSources,t[139]=it):it=t[139];let at;t[140]===Symbol.for(`react.memo_cache_sentinel`)?(at=rn(`provider-health-check-interval`),t[140]=at):at=t[140];let ot=at.id,st;t[141]===Symbol.for(`react.memo_cache_sentinel`)?(st=rn(`provider-health-check-interval`),t[141]=st):st=t[141];let ct;t[142]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[st.title,(0,$.jsx)(Ft,{children:`This interval is configured here, then the shared Background activity policy decides whether provider probes may run when the timer fires. Custom intervals appear as Advanced in General settings.`})]}),t[142]=ct):ct=t[142];let lt;t[143]!==g||t[144]!==Ee||t[145]!==Oe||t[146]!==Ne||t[147]!==m.backgroundActivity||t[148]!==v?(lt=Oe===Ee?null:(0,$.jsx)(`span`,{inert:!g,className:g?void 0:`opacity-50`,children:(0,$.jsx)(Nt,{label:`provider health check interval`,onClick:()=>v(vn(m.backgroundActivity,Ne,{providerHealthRefreshInterval:void 0}))})}),t[143]=g,t[144]=Ee,t[145]=Oe,t[146]=Ne,t[147]=m.backgroundActivity,t[148]=v,t[149]=lt):lt=t[149];let ut=!g,dt=!g||void 0,ft=!g&&`opacity-50 select-none`,pt;t[150]===ft?pt=t[151]:(pt=ae(`flex shrink-0 items-center gap-2`,ft),t[150]=ft,t[151]=pt);let mt;t[152]!==Ne||t[153]!==m.backgroundActivity||t[154]!==v?(mt=e=>v(vn(m.backgroundActivity,Ne,{providerHealthRefreshInterval:se(gn(e))})),t[152]=Ne,t[153]=m.backgroundActivity,t[154]=v,t[155]=mt):mt=t[155];let ht;t[156]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,$.jsxs)(ve,{children:[(0,$.jsx)(_e,{"aria-label":`Decrease provider health check interval`}),(0,$.jsx)(he,{"aria-label":`Provider health check interval in seconds`}),(0,$.jsx)(ge,{"aria-label":`Increase provider health check interval`})]}),t[156]=ht):ht=t[156];let gt;t[157]!==Oe||t[158]!==mt?(gt=(0,$.jsx)(ye,{value:Oe,min:0,step:30,size:`sm`,className:`w-32`,onValueChange:mt,children:ht}),t[157]=Oe,t[158]=mt,t[159]=gt):gt=t[159];let _t;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),t[160]=_t):_t=t[160];let vt;t[161]!==ut||t[162]!==dt||t[163]!==pt||t[164]!==gt?(vt=(0,$.jsxs)(`div`,{inert:ut,"aria-disabled":dt,className:pt,children:[gt,_t]}),t[161]=ut,t[162]=dt,t[163]=pt,t[164]=gt,t[165]=vt):vt=t[165];let yt;t[166]!==lt||t[167]!==vt?(yt=(0,$.jsx)(Pt,{title:`Advanced`,children:(0,$.jsx)(At,{id:ot,title:ct,description:`Refresh provider status, versions, and models in the background. Set to 0 to disable.`,resetAction:lt,control:vt})}),t[166]=lt,t[167]=vt,t[168]=yt):yt=t[168];let bt;t[169]!==n||t[170]!==r||t[171]!==oe||t[172]!==l?(bt=oe&&!l?(0,$.jsx)(bi,{open:!0,environmentId:n,environmentLabel:r,onOpenChange:U,onCreated:K}):null,t[169]=n,t[170]=r,t[171]=oe,t[172]=l,t[173]=bt):bt=t[173];let xt;return t[174]!==rt||t[175]!==it||t[176]!==yt||t[177]!==bt?(xt=(0,$.jsxs)($.Fragment,{children:[rt,it,yt,bt]}),t[174]=rt,t[175]=it,t[176]=yt,t[177]=bt,t[178]=xt):xt=t[178],xt}function ea(e){return e.model}function ta(e){return e.provider}function na(e){return String(C(e.provider))}function ra(e,t){return t.checkedAt>e?t.checkedAt:e}function ia(e){return e.instanceId===C(y.make(`cursor`))}function aa(e){return[e.instanceId,e]}function oa(e){if(e._tag===`Success`&&!e.value.accepted){Ce.add({type:`warning`,title:`Authentication request expired`,description:`Refresh the provider and start the authentication flow again.`});return}if(e._tag===`Failure`&&!ce(e)){let t=le(e);Ce.add({type:`error`,title:`Could not continue authentication`,description:t instanceof Error?t.message:`The authentication request expired.`})}}function sa(){return new Set}function ca(){let e=(0,Nn.c)(12),t=cn.useSearch(),{environment:n,scope:r}=Ot();if(!n){let t=r.kind===`environment`?`Reconnect ${r.label} to set up its providers.`:`Connect an environment to set up its providers.`,n;return e[0]===t?n=e[1]:(n=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:t}),e[0]=t,e[1]=n),n}let i;e[2]===t.instanceId?i=e[3]:(i=t.instanceId?{instanceId:t.instanceId}:{},e[2]=t.instanceId,e[3]=i);let a;e[4]!==n.environmentId||e[5]!==r.kind||e[6]!==r.members?(a=r.kind===`project`||r.kind===`checkout`?r.members.filter(e=>e.environmentId===n.environmentId).map(la):[],e[4]=n.environmentId,e[5]=r.kind,e[6]=r.members,e[7]=a):a=e[7];let o;return e[8]!==n.environmentId||e[9]!==i||e[10]!==a?(o=(0,$.jsx)(Gi,{environmentId:n.environmentId,...i,projectIds:a,scoped:!0}),e[8]=n.environmentId,e[9]=i,e[10]=a,e[11]=o):o=e[11],o}function la(e){return e.id}export{ca as component};
3
- //# sourceMappingURL=settings.providers-BBgppyE3.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{$n as i,Fh as a,Jh as o,Kp as s,Nc as c,Rc as l,Yn as u,dr as d,nr as f,qh as p,r as m,rr as h,tr as g,ts as _,ur as v}from"./utils-DhUt689t.js";import{n as y}from"./select-D_zHR42Y.js";import{i as b,p as x}from"./toast-DXWclCrr.js";import{K as S,s as C,v as w}from"./useSettings-gPlpTIWi.js";import{s as T}from"./server-6nKYyc8r.js";import{f as E,l as D}from"./diffRendering-DtBTalAD.js";import{t as O}from"./FileDiff-Bu2BSqBV.js";import{r as k,t as A}from"./dialog-BRtKKGzk.js";import{i as j,r as M,v as N}from"./keybindings-B_kRk5Fi.js";import{b as P,y as F}from"./Icons-xsXA_L6w.js";import{n as I,t as L}from"./kbd-rp5mX21h.js";import{a as R,c as z,i as B,s as V}from"./settingsLayout-4ySvFdXb.js";import{a as ee,d as H,l as U}from"./KeybindingsSettings.logic-BJe27xmi.js";import{Ht as te,Pt as ne,da as re,fa as ie,h as ae,ir as W,m as oe,ma as G,p as se,pa as ce,ua as K,va as q}from"./main-VfCRP294.js";import{n as le,r as J,t as ue}from"./usePermissionStatus-CWV_yoZe.js";var Y=e(t(),1),de=n(),fe={return:`enter`,page_up:`pageup`,page_down:`pagedown`,left:`arrowleft`,right:`arrowright`,up:`arrowup`,down:`arrowdown`,plus:`+`,minus:`-`};function pe(e){let t=e.trim().replace(/^Press\s+/i,``);if(!t)return null;let n=t.match(/^((?:<[^<>]+>)+)([^<>]+)$/),r=(n?n[1].replace(/<([^<>]+)>/g,`$1+`)+n[2]:t).replace(/\b(super|win|primary)\b/gi,e=>e.toLowerCase()===`primary`?`ctrl`:`meta`);if(r!==`+`&&r.endsWith(`+`)&&!r.endsWith(`++`))return null;let i=l(r);if(!i)return null;let a=fe[i.key]??i.key;return a!==` `&&!/^[^\s<>]$/u.test(a)&&!/^(?:f(?:[1-9]|1\d|2[0-4])|enter|tab|escape|backspace|delete|insert|home|end|pageup|pagedown|arrow(?:left|right|up|down)|pause|printscreen)$/i.test(a)?null:{...i,key:a}}function me(e,t=navigator.platform){return a(e)?p(o(e),c(t)):j(e,t)}function he(e,t){return e===`shift`?`⇧`:c(t)?e===`meta`?`⌘`:e===`control`?`⌃`:`⌥`:e===`meta`?m(t)?`⊞`:`Super`:e===`control`?`Ctrl`:`Alt`}function ge(e,t=navigator.platform){if(a(e)){let n=he(o(e),t);return[n,n]}let n=c(t);return[...[[e.ctrlKey||e.modKey&&!n,`control`],[e.altKey,`alt`],[e.shiftKey,`shift`],[e.metaKey||e.modKey&&n,`meta`]].filter(([e])=>e).map(([,e])=>he(e,t)),M(e.key)]}function _e(e,t,n=navigator.platform){return a(e)||a(t)?a(e)&&a(t)&&o(e)===o(t):N(e,n)===N(t,n)}function ve(e,t,n=navigator.platform){if(a(e))return null;let r=N(e,n);return t.find(e=>N(e.shortcut,n)===r)?.command??null}function ye(e){if(e.mode===`portal`)switch(e.linuxDesktop??X(e)){case`gnome`:return`GNOME`;case`kde`:return`KDE Plasma`;case`niri`:return`Niri`;case`hyprland`:return`Hyprland`;default:return}}function X(e){return e.mode===`portal`?e.linuxBackend===`niri`?`niri`:e.linuxBackend===`kde`?`kde`:e.linuxBackend===`hyprland`?`hyprland`:e.linuxBackend===`screenshot-portal`?`portal`:e.linuxBackend===`picker`&&e.gnomeExtension?.status===`unsupported`?`picker`:e.linuxBackend===`gnome-extension`||e.gnomeExtension?`gnome`:`picker`:`direct`}function Z(e){return e.mode===`unavailable`||e.message?!1:X(e)===`gnome`?e.gnomeExtension?.status===`enabled`&&e.linuxBackend===`gnome-extension`:X(e)===`kde`?e.kdeHelper?.status===`ready`:X(e)!==`hyprland`||e.hyprlandHelper?.status===`ready`}function be(e,t){let n=e.macPermissions;return!n||n.screenRecording&&(!t||n.accessibility)}function xe(e){let t=X(e),n=t===`gnome`;return e.message||n&&e.gnomeExtension?.status===`error`||t===`kde`&&e.kdeHelper?.status===`error`||t===`hyprland`&&e.hyprlandHelper?.status===`error`?`Still unable to check access. See Advanced for help.`:X(e)===`picker`?`Ready. You'll choose a window each time.`:n&&e.gnomeExtension?.status===`restart-required`?`Still waiting for you to sign out and back in.`:Z(e)?`Ready. Continue to choose your shortcut.`:`Not ready yet. Finish the step above.`}function Se(e,t){return t||!Z(e)?!1:e.linuxBackend===`hyprland`?!!e.shortcutActionRegistered:e.linuxBackend===`niri`?!!e.shortcutBinding:e.shortcutRegistered||!!e.shortcutPending}function Ce(e,t=`resume`){return Z(e)?t===`resume`?e.mode===`direct`&&!e.shortcutRegistered||X(e)===`picker`?`access`:`shortcut`:t:`access`}function we(e,t){return!e&&!t}function Te(e,t){return e?e.mode===`unavailable`?e.message??`Not supported on this platform.`:t?Ee(e,t):`Turn this on to set up snapshots.`:`Checking snapshots…`}function Ee(e,t){return e.message?`Capture needs attention`:e.linuxBackend===`hyprland`&&e.hyprlandHelper?.status!==`ready`?e.hyprlandHelper?.status===`error`?`Check capture access in setup`:`Install the capture helper to continue`:X(e)===`gnome`&&e.gnomeExtension?.status!==`enabled`?`Set up active-window snapshots`:X(e)===`kde`&&e.kdeHelper?.status!==`ready`?e.kdeHelper?.status===`error`?`Check capture access in setup`:`Install the capture helper to continue`:X(e)===`picker`?`Manual capture only — you'll choose a window each time`:t?e.shortcutPending?e.linuxBackend===`hyprland`?`Connecting your shortcut…`:`Waiting for shortcut permission`:e.shortcutVerified?`Ready to capture`:e.linuxBackend===`niri`&&e.shortcutBinding||e.linuxBackend===`hyprland`&&e.shortcutActionRegistered?`Use your shortcut from another app`:e.shortcutRegistered?e.shortcutLabel?`Ready to capture`:`Shortcut saved`:`Finish shortcut setup`:`Enable capture to continue`}function De(e){return e?e.linuxBackend===`hyprland`?e.shortcutMessage:e.shortcutPending?`Approve the shortcut permission prompt to continue.`:e.shortcutRegistered?e.mode===`portal`?null:`Shortcut saved.`:e.shortcutMessage:null}function Oe(e){if(!e)return`Continue setup`;if(Z(e))return`Manage capture`;let t=ye(e);return t?`Set up ${t} capture`:`Continue setup`}function ke(e,t){return e?.windows?!0:e?.macPermissions!==void 0&&Z(e)&&be(e,t)&&e.shortcutRegistered}function Ae(e){if(!(e?.mode!==`portal`||e.linuxFeedbackAvailable))return e.linuxBackend===`hyprland`?e.hyprlandHelper?.status===`ready`?`Capture effects aren't available on this desktop.`:`Install or update the capture helper to enable effects.`:e.linuxBackend===`niri`?`Capture effects aren't available on Niri.`:e.linuxBackend===`kde`?e.kdeHelper?.status===`ready`?`Capture effects aren't available on this desktop.`:`Install or update the capture helper to enable effects.`:e.linuxBackend===`gnome-extension`?`Update the GNOME extension, then sign out and back in to enable effects.`:X(e)===`gnome`?`Finish extension setup to enable effects.`:`Capture effects aren't available on this desktop.`}function je(e){return e?.mode===`portal`&&X(e)===`picker`?`Automatic capture isn't available here. Choose a window instead.`:`Capture a window and attach it to your current draft.`}function Me(e){if(e?.mode===`portal`&&(e.linuxBackend===`picker`||e.linuxBackend===`screenshot-portal`))return`This desktop only provides a screenshot.`}function Ne(e){if(!e)return typeof window<`u`&&window.desktopBridge?`Update the desktop app to use snapshots.`:`Only available in the desktop app.`}function Pe(e){return e===`off`?{snapShotPlaySound:!1}:{snapShotPlaySound:!0,snapShotSound:e}}function Fe(){let e=null;return{tryBegin(){return e?null:(e=Symbol(),e)},clear(){e=null},owns(t){return e===t}}}var Q=e(r(),1);function Ie(e){let t=(0,de.c)(7),{shortcut:n,platform:r}=e,i=r===void 0?navigator.platform:r,a,o;if(t[0]!==i||t[1]!==n){let e=new Map;a=I,o=ge(n,i).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),(0,Q.jsx)(L,{"aria-hidden":!0,children:t},`${t}-${n}`)}),t[0]=i,t[1]=n,t[2]=a,t[3]=o}else a=t[2],o=t[3];let s;return t[4]!==a||t[5]!==o?(s=(0,Q.jsx)(a,{children:o}),t[4]=a,t[5]=o,t[6]=s):s=t[6],s}var Le={Shift:`shift`,Meta:`meta`,OS:`meta`,Control:`control`,Alt:`alt`,AltGraph:`alt`},Re={shift:[`ShiftLeft`,`ShiftRight`],meta:[`MetaLeft`,`MetaRight`],control:[`ControlLeft`,`ControlRight`],alt:[`AltLeft`,`AltRight`]};function ze(e){let t=(0,de.c)(43),{shortcut:n,shortcutLabel:r,disabled:i,allowModifierPairs:o,onRecord:s,onStart:c,onError:u}=e,f=i!==void 0&&i,p=o===void 0||o,m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=te(),t[0]=m):m=t[0];let h=m,g;t[1]!==n||t[2]!==r?(g=r?pe(r):n,t[1]=n,t[2]=r,t[3]=g):g=t[3];let _=g,[v,y]=(0,Y.useState)(!1),[b]=(0,Y.useState)(Fe),x;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=new Set,t[4]=x):x=t[4];let S=(0,Y.useRef)(x),C;t[5]===b?C=t[6]:(C=()=>{b.clear(),S.current.clear(),y(!1),h?.setSnapShotShortcutSuppressed(!1).catch(Ve)},t[5]=b,t[6]=C);let w=C,T;t[7]!==f||t[8]!==u||t[9]!==c||t[10]!==b?(T=async()=>{if(!h||f)return;let e=b.tryBegin();if(e){S.current.clear(),c?.();try{await h.setSnapShotShortcutSuppressed(!0),b.owns(e)&&y(!0)}catch(t){let n=t;if(!b.owns(e))return;b.clear(),u(n instanceof Error?n.message:`Could not start shortcut recording.`)}}},t[7]=f,t[8]=u,t[9]=c,t[10]=b,t[11]=T):T=t[11];let E=T,D,O;t[12]===b?(D=t[13],O=t[14]):(D=()=>()=>{b.clear(),h?.setSnapShotShortcutSuppressed(!1).catch(Be)},O=[h,b],t[12]=b,t[13]=D,t[14]=O),(0,Y.useEffect)(D,O);let k;t[15]!==p||t[16]!==u||t[17]!==s||t[18]!==v||t[19]!==w?(k=e=>{if(!v||e.key===`Tab`||e.repeat)return;if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){w();return}let t=Le[e.key];if(t){let n=S.current;n.add(e.code);let[r,i]=Re[t];if(n.has(r)&&n.has(i)){if(!p){u(`Add a letter, number, or function key to your shortcut.`);return}w(),s(t===`shift`?{kind:`both-shift-keys`}:{kind:`modifier-pair`,modifier:t})}return}if(!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey)return;let n=U(e,navigator.platform);if(!n)return;let r=l(n);r&&(w(),s(r))},t[15]=p,t[16]=u,t[17]=s,t[18]=v,t[19]=w,t[20]=k):k=t[20];let A=k,j=v?`secondary`:`outline`,M;t[21]===_?M=t[22]:(M=_?`Record snapshot shortcut, currently ${me(_)}`:`Change snapshot shortcut`,t[21]=_,t[22]=M);let N;t[23]===E?N=t[24]:(N=()=>void E(),t[23]=E,t[24]=N);let P;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>S.current.delete(e.code),t[25]=P):P=t[25];let F;t[26]!==p||t[27]!==_||t[28]!==v?(F=v?`Press shortcut…`:_?!p&&a(_)?`Choose shortcut`:(0,Q.jsx)(Ie,{shortcut:_}):`Change shortcut`,t[26]=p,t[27]=_,t[28]=v,t[29]=F):F=t[29];let I;t[30]!==f||t[31]!==A||t[32]!==v||t[33]!==w||t[34]!==j||t[35]!==M||t[36]!==N||t[37]!==F?(I=(0,Q.jsx)(d,{type:`button`,size:`xs`,variant:j,disabled:f,"aria-label":M,"aria-pressed":v,"data-keybinding-capture":``,onClick:N,onKeyDown:A,onKeyUp:P,onBlur:w,children:F}),t[30]=f,t[31]=A,t[32]=v,t[33]=w,t[34]=j,t[35]=M,t[36]=N,t[37]=F,t[38]=I):I=t[38];let L;return t[39]!==v||t[40]!==w||t[41]!==I?(L={recording:v,stopRecording:w,input:I},t[39]=v,t[40]=w,t[41]=I,t[42]=L):L=t[42],L}function Be(){}function Ve(){}var He=l(`Ctrl+Shift+2`);function Ue({state:e,disabled:t=!1,onBusyChange:n,onSaved:r,onComplete:i}){let o=te(),{resolvedTheme:s}=S(),{copyToClipboard:c,isCopied:u}=x(),[f,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(null),[C,w]=(0,Y.useState)(null),[T,k]=(0,Y.useState)(!1),A=t||v!==null,j=!!(o?.previewSnapShotConfig&&o.applySnapShotConfig),M=f!==null&&f.before!==f.after,N=e.linuxBackend===`niri`,P=N?`Niri`:`Hyprland`,F=(C??f?.shortcut)?.trim(),I=ze({shortcut:F?l(F.replace(/super/gi,`meta`))??He:He,disabled:A,allowModifierPairs:!1,onStart:()=>_(null),onError:e=>_({message:e}),onRecord:e=>{a(e)||(w(H({...e,ctrlKey:e.ctrlKey||e.modKey,modKey:!1})),p(null),_(null))}}),L=A||I.recording,R=(0,Y.useMemo)(()=>f&&M?E({name:f.path,contents:f.before},{name:f.path,contents:f.after}):null,[f,M]),z=e=>{y(e),n?.(!0),_(null)},B=()=>{y(null),n?.(!1)},V=async(e=T,t=`install`)=>{if(!L&&o?.previewSnapShotConfig){z(`reading`),p(null),h(null),k(e);try{p(await o.previewSnapShotConfig({operation:t,chooseFile:e,...C?.trim()?{shortcut:C.trim()}:{}}))}catch(e){_({message:`Couldn't prepare the changes. Check Advanced for help.`,...e instanceof Error?{detail:e.message}:{}})}finally{B()}}},ee=async()=>{if(!L&&f&&o?.applySnapShotConfig){z(`writing`);try{let e=await o.applySnapShotConfig(f.id);h(e),await r?.(),!e.warning&&f.operation===`install`&&i&&(b.add({type:`success`,title:`Shortcut saved`,description:`Use ${f.shortcut} from another app.`}),await i())}catch(e){_({message:`Couldn't save your shortcut. Review the changes and try again.`,...e instanceof Error?{detail:e.message}:{}}),p(null)}finally{B()}}};return(0,Q.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[m?null:(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{children:`Shortcut`}),I.input]}),I.recording?(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:`Press your shortcut. Esc cancels.`}):null,m?(0,Q.jsx)(`p`,{role:`status`,children:m.warning?`Saved, but the shortcut needs attention. Check Advanced for help.`:f?.operation===`remove`?`Shortcut removed.`:`Use ${f?.shortcut} from another app to capture a window.`}):f?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:M?f.operation===`remove`?`Review the change below to remove your shortcut.`:`Review the change below, then save your shortcut.`:f.operation===`remove`?`There's no capture shortcut to remove.`:`This shortcut is already set up.`}),R?(0,Q.jsx)(`div`,{className:`max-h-80 overflow-auto rounded-lg border text-xs`,"aria-label":`Shortcut changes`,children:(0,Q.jsx)(O,{fileDiff:R,options:{diffStyle:`unified`,theme:D(s),overflow:`wrap`}})}):null,M?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Only these changes will be saved. We'll keep a backup.`}):null,(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[M||f.operation===`install`?(0,Q.jsx)(d,{disabled:L||f.operation===`install`&&e.shortcutActionRegistered===!1,"aria-busy":v===`writing`,onClick:()=>void ee(),children:v===`writing`?`Saving…`:M?f.operation===`install`?`Save shortcut`:`Remove shortcut`:`Done`}):null,(0,Q.jsx)(d,{variant:`ghost`,disabled:L,onClick:()=>p(null),children:`Cancel`})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:`Allow P4 Code to read your desktop settings. You'll review any changes here before saving.`}),(0,Q.jsx)(d,{disabled:L||!j,"aria-busy":v===`reading`,onClick:()=>void V(),children:v===`reading`?`Preparing changes…`:`Review changes`}),j?null:(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Update P4 Code to finish setting up your shortcut.`})]}),g?(0,Q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:g.message}):null,e.shortcutActionRegistered===!1&&e.shortcutMessage?(0,Q.jsx)(`p`,{role:`status`,className:`text-muted-foreground`,children:e.shortcutPending?`Connecting to your desktop…`:`Restart P4 Code to finish connecting your shortcut.`}):null,(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced`}),(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[g?.detail||m?.warning?(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`font-medium text-foreground`,children:`Troubleshooting`}),(0,Q.jsx)(`p`,{className:`break-words`,children:g?.detail??m?.warning})]}):null,(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(`p`,{className:`font-medium text-foreground`,children:`Settings file`}),(0,Q.jsx)(`p`,{className:`break-all font-mono`,children:f?.path??e.shortcutConfigPath??(N?`~/.config/niri/config.kdl`:`~/.config/hypr/hyprland.conf`)}),N?(0,Q.jsx)(`p`,{children:`P4 Code also reads any files included by this file.`}):null,f&&f.resolvedPath!==f.path?(0,Q.jsxs)(`p`,{className:`break-all`,children:[`Linked to `,f.resolvedPath,`. The link will be kept.`]}):null]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(d,{size:`sm`,variant:`outline`,disabled:L||!j,onClick:()=>void V(!0),children:`Choose a different file…`}),(0,Q.jsx)(d,{size:`sm`,variant:`ghost`,disabled:L||!j,onClick:()=>void V(T,`remove`),children:`Remove shortcut…`}),m?(0,Q.jsx)(d,{size:`sm`,variant:`outline`,disabled:L||!j,onClick:()=>void V(),children:`Review changes`}):null]}),(0,Q.jsxs)(`p`,{children:[`Use your desktop's shortcut settings file.`,` `,N?`A custom --config or NIRI_CONFIG can change its location.`:`On Omarchy, use your own bindings file, not its defaults.`]}),m?.backupPath?(0,Q.jsxs)(`p`,{className:`break-all`,children:[`Backup: `,m.backupPath]}):null,(0,Q.jsx)(`p`,{className:`font-medium text-foreground`,children:`Manual setup`}),(0,Q.jsxs)(`p`,{children:[N?`Paste this inside binds { … } in your Niri config, then save.`:`Add this binding to your Hyprland config, then save.`,` `,`Change the keys if needed.`]}),(0,Q.jsx)(`pre`,{className:`max-h-40 overflow-auto whitespace-pre-wrap break-all rounded-xl bg-muted/50 p-3`,children:e.shortcutBinding}),(0,Q.jsx)(d,{size:`sm`,variant:`outline`,disabled:L||!e.shortcutBinding,onClick:()=>{e.shortcutBinding&&c(e.shortcutBinding)},children:u?`Copied`:`Copy shortcut`}),(0,Q.jsxs)(`p`,{children:[`Turn capture off in P4 Code to stop it. Remove the shortcut from `,P,` to free up the keys.`]}),e.shortcutActionRegistered===!1?(0,Q.jsx)(`p`,{role:`status`,children:e.shortcutMessage}):null,i?(0,Q.jsx)(d,{size:`sm`,variant:`outline`,disabled:L||e.shortcutActionRegistered===!1,onClick:()=>void i(),children:`I've added the shortcut`}):null]})]})]})}var We=[{id:`access`,label:`Access`},{id:`shortcut`,label:`Shortcut`}],Ge={"not-installed":{title:`Install the extension`,description:`The P4 Code GNOME extension lets you capture other windows and bring them into your draft. Sign out once after installing.`},"restart-required":{title:`Extension installed`,description:`Save your work, then sign out and back in. Your setup will be waiting here.`},"update-required":{title:`Update the extension`,description:`Install the update, then sign out and back in.`},"extensions-disabled":{title:`Allow GNOME extensions`,description:`Open GNOME Extensions and turn on extensions, then check again.`},disabled:{title:`Enable the extension`,description:`Enable P4 Code SnapShots to start capturing windows.`},enabled:{title:`Capture is ready`,description:`Next, choose your shortcut.`},unsupported:{title:`Automatic capture isn't available`,description:`Use Take snapshot from the command palette to choose a window.`},error:{title:`Couldn't set up the extension`,description:`Check P4 Code SnapShots in GNOME Extensions, then try again.`}};function Ke({state:e,initialStep:t,wasEnabled:n,includeAccessibility:r,busy:i,error:o,shortcutInput:s,shortcutStatus:c,shortcutChanged:l,canSaveShortcut:u,onSaveShortcut:f,onEnable:p,onAction:m,onRefresh:h,onClose:g,onLeaveStep:_}){let[v,y]=(0,Y.useState)(()=>Ce(e,t)),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(!1),[w,T]=(0,Y.useState)(!1),E=i||b||w,D=X(e),O=D===`niri`||D===`hyprland`,j=ye(e),M=e.gnomeExtension,N=D===`hyprland`?e.hyprlandHelper:e.kdeHelper,I=D===`kde`||D===`hyprland`,L=D===`hyprland`?`install-hyprland-helper`:`install-kde-helper`,R=D===`hyprland`?`remove-hyprland-helper`:`remove-kde-helper`,z=Z(e),B=ue(async()=>{let e=await h();if(!e?.macPermissions)throw Error(`Permission status unavailable`);return e.macPermissions},e.macPermissions??{screenRecording:!1,accessibility:!1},!!e.macPermissions&&v===`access`&&!E),V=e.macPermissions?B.status:void 0,ee=!V||B.isReady(r?[`screenRecording`,`accessibility`]:[`screenRecording`]),H=Se(e,l),U=M?.status===`not-installed`||M?.status===`update-required`,te=M?.status===`disabled`,ne=e=>{_(),C(!1),y(e)},ae=async()=>{if(!E){x(!0),C(!1);try{C(await h()!==void 0)}finally{x(!1)}}},W=e.message&&!V?{title:`Let's try that again`,description:`Couldn't check snapshots. Try again to continue.`}:D===`gnome`&&M?M.status===`enabled`&&!z?{title:`Check capture access`,description:`The extension isn't ready yet. Try again in a moment.`}:Ge[M.status]:I?N?.status===`ready`?{title:`Capture is ready`,description:`Next, choose your shortcut.`}:N?.status===`error`?{title:`Let's fix capture access`,description:`Try reinstalling the capture helper, then check again.`}:{title:N?.status===`update-required`?`Update the capture helper`:`Allow snapshots`,description:`P4 Code's capture helper lets you capture other apps and return to your draft. It's included with P4 Code.`}:D===`niri`?{title:`Capture is ready`,description:`Next, choose your shortcut.`}:D===`picker`?{title:`Choose a window each time`,description:`Your desktop doesn't support automatic capture. You'll choose the window to capture instead.`}:{title:`Allow snapshots`,description:D===`portal`?`Your desktop may ask for permission when you first capture.`:V?ee?`Test a snapshot of the current window. If macOS asks to bypass its window picker, choose Allow. The test image is discarded.`:`Allow each permission, then continue.`:`Allow access when prompted to start capturing windows.`},oe=v===`access`?W.title:`Choose your shortcut`,se=v===`access`?W.description:O?`Click the shortcut, then press the keys you want.`:e.mode===`portal`?`Choose your keys, then approve the permission prompt if asked.`:`Use both Shift keys, or record a different shortcut.`,q=We.findIndex(({id:e})=>e===v),de=[...new Set([o,...v===`access`?[e.message,D===`gnome`&&(M?.status===`error`||M?.status===`unsupported`)?M.message:null,I&&N?.status===`error`?N.message:null]:[]].filter(e=>e!==null))];return(0,Q.jsx)(A,{open:!0,onOpenChange:e=>{!e&&!E&&g(!1)},children:(0,Q.jsxs)(ce,{showCloseButton:!E,children:[(0,Q.jsx)(re,{title:j?`Set up snapshots for ${j}`:`Set up snapshots`,children:(0,Q.jsx)(G,{steps:We.map(e=>e.label),currentStep:q,isStepDisabled:e=>E||e>q,onStepChange:e=>{let t=We[e];t&&t.id!==v&&ne(t.id)}})}),(0,Q.jsx)(ie,{children:(0,Q.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,"aria-live":`polite`,children:[(0,Q.jsx)(`h3`,{className:`flex items-center gap-2 font-medium`,children:oe}),(0,Q.jsx)(k,{children:se})]}),v===`access`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{role:`status`,"aria-atomic":`true`,className:S&&!E&&!o?`text-xs text-muted-foreground`:`sr-only`,children:S&&!E&&!o?xe(e):null}),V?(0,Q.jsx)(le,{busy:E,permissions:[{id:`screenRecording`,icon:(0,Q.jsx)(P,{className:`size-8 shrink-0 drop-shadow-sm`}),title:`Screen Recording`,description:`Capture the window you're using.`,granted:V.screenRecording,onAllow:()=>void m(`allow-screen-recording`)},{id:`accessibility`,icon:(0,Q.jsx)(F,{className:`size-8 shrink-0 drop-shadow-sm`}),title:`Accessibility`,description:r?`Include text and controls from the captured app.`:`Optional. Include text and controls from the captured app.`,granted:V.accessibility,onAllow:()=>void m(`allow-accessibility`)}]}):null,B.error&&V?(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:B.error}):null,I&&N?.status===`error`?(0,Q.jsx)(d,{size:`xs`,variant:`outline`,disabled:E,onClick:()=>void m(L),children:`Reinstall helper`}):null]}):O?(0,Q.jsx)(Ue,{state:e,disabled:i||b||!z,onBusyChange:T,onSaved:h,onComplete:()=>g(!0)}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[s,c?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,role:`status`,children:c}):null,!l&&!e.shortcutRegistered&&!e.shortcutPending&&e.shortcutCanRetry!==!1&&!a(e.shortcut)?(0,Q.jsx)(d,{variant:`ghost`,size:`sm`,disabled:E,onClick:()=>void m(`retry-shortcut`),children:e.mode===`portal`?`Shortcut permissions`:`Try again`}):null]}),v===`shortcut`&&!z?(0,Q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:`Capture needs attention. Go back to check access.`}):null,o?(0,Q.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:`Couldn't finish this step. Try again or check Advanced for help.`}):null,de.length>0||v===`access`&&(D===`gnome`||I)?(0,Q.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced`}),(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[de.map(e=>(0,Q.jsx)(`p`,{className:`break-words`,children:e},e)),v===`access`&&(D===`gnome`||I)?(0,Q.jsx)(`p`,{children:`Included with P4 Code. No download needed.`}):null,v===`access`&&D===`gnome`&&M?.status===`enabled`?(0,Q.jsx)(d,{size:`xs`,variant:`ghost`,disabled:E,onClick:()=>void m(`disable-extension`),children:`Disable extension`}):null,v===`access`&&I&&N?.status!==`not-installed`?(0,Q.jsx)(d,{size:`xs`,variant:`ghost`,disabled:E,onClick:()=>void m(R),children:`Remove capture helper`}):null]})]}):null]})}),(0,Q.jsxs)(K,{children:[v===`access`?null:(0,Q.jsx)(d,{variant:`ghost`,disabled:E,onClick:()=>ne(`access`),children:`Back`}),(0,Q.jsx)(d,{variant:`ghost`,disabled:E,onClick:()=>void g(!1),children:n?`Close`:`Finish later`}),v===`access`?I&&!z&&N?.status!==`ready`?(0,Q.jsx)(d,{disabled:E,"aria-busy":E,onClick:()=>void(N?.status===`error`?ae():m(L)),children:b?`Checking…`:E?`Installing…`:N?.status===`error`?`Check again`:N?.status===`update-required`?`Update helper`:`Install helper`}):D===`gnome`&&!z&&M?.status!==`enabled`?(0,Q.jsx)(d,{disabled:E,"aria-busy":b,onClick:()=>void(U?m(`install-extension`):te?m(`enable-extension`):ae()),children:b?`Checking…`:E?U?`Installing…`:te?`Enabling…`:`Working…`:U?M?.status===`update-required`?`Update extension`:`Install extension`:te?`Enable extension`:`Check again`}):(0,Q.jsx)(J,{ready:ee,busy:E,onClick:async()=>{await p()&&ne(`shortcut`)},children:E?`Working…`:V?`Test capture and continue`:D===`direct`?`Allow capture`:!z&&!V?`Try again`:`Continue`}):O?null:(0,Q.jsx)(d,{disabled:E||!z||(l?!u:!H),onClick:async()=>{(!l||await f())&&await g(!0)},children:E?`Saving…`:l?`Save and finish`:`Done`})]})]})})}var qe=`grid grid-cols-[1fr_auto]`;function $(e,t){return{title:e,message:t instanceof Error?t.message:`Try again.`}}function Je(){let e=C(),t=w(),n=_(T),r=te(),[o,c]=(0,Y.useState)(null),[l,p]=(0,Y.useState)(!1),[m,x]=(0,Y.useState)(null),[S,E]=(0,Y.useState)(null),[D,O]=(0,Y.useState)(e.snapShotShortcut),[k,A]=(0,Y.useState)({status:`idle`,availability:null}),j=(0,Y.useRef)(0),M=(0,Y.useRef)(0),N=Ne(!!r),P=!!r&&o!==null&&o.mode!==`unavailable`,F=Ae(o),I=e.snapShotShortcut,L=o?.linuxBackend===`niri`||o?.linuxBackend===`hyprland`,H=!L&&!_e(D,I),U=H?D:o?.shortcut??I,re=H?ve(D,n):null,ie=H&&re===null&&k.availability?.available===!0,G=e.snapShotPlaySound?e.snapShotSound:`off`,ce=G===`off`?`Off`:G===`soft-pop`?`Whoosh (Default)`:`Click`,K=(0,Y.useCallback)(async()=>{let e=++M.current;try{if(r){let t=await r.getSnapShotState();return e===M.current&&c(t),t}}catch(t){e===M.current&&x($(`Couldn't check capture setup`,t))}},[r]),le=(0,Y.useCallback)(async e=>{if(r?.setupSnapShot&&!l){p(!0),x(null);try{o?.macPermissions&&S&&(e===`allow-screen-recording`||e===`allow-accessibility`)&&ae(S.wasEnabled),await r.setupSnapShot(e),await K()}catch(t){x($(e===`retry-shortcut`?`Couldn't open shortcut permissions`:`Couldn't complete capture setup`,t))}finally{p(!1)}}},[r,K,l,o,S]);(0,Y.useEffect)(()=>{m&&!S&&(b.add({type:`error`,title:m.title,description:m.message}),x(null))},[m,S]),(0,Y.useEffect)(()=>{let e=!1;return K().then(t=>{let n=oe();!e&&t?.macPermissions&&n&&E({initialStep:`access`,wasEnabled:n.wasEnabled})}),window.addEventListener(`focus`,K),()=>{e=!0,window.removeEventListener(`focus`,K)}},[K]),(0,Y.useEffect)(()=>r?.onSnapShotEvent(e=>{e.type===`shortcut-changed`&&K()}),[r,K]),(0,Y.useEffect)(()=>{j.current++,O(I),A({status:`idle`,availability:null})},[I]);let J=(0,Y.useCallback)(async e=>{x(null);try{return await t(e),await K()}catch(e){x($(`Couldn't save capture settings`,e))}},[K,t]),ue=(0,Y.useCallback)(async t=>{try{t&&e.snapShotEnabled&&await r?.requestSnapShotPermissions(!0),await J({snapShotIncludeAccessibility:t})}catch(e){x($(`Couldn't allow app text capture`,e))}},[r,J,e.snapShotEnabled]),de=(0,Y.useCallback)(async e=>{let t=++j.current;if(O(e),!ve(e,n)&&r){A({status:`checking`,availability:null});try{let n=await r.checkSnapShotShortcut(e);t===j.current&&A({status:`checked`,availability:n})}catch(e){if(t!==j.current)return;A({status:`checked`,availability:{available:!1,message:e instanceof Error?e.message:`Could not check this shortcut.`}})}}},[r,n]),{recording:fe,stopRecording:pe,input:me}=ze({shortcut:U,shortcutLabel:H?void 0:o?.shortcutLabel,disabled:l,allowModifierPairs:o?.mode!==`portal`,onRecord:e=>void de(e),onStart:()=>{j.current++,A({status:`idle`,availability:null})},onError:e=>A({status:`checked`,availability:{available:!1,message:e}})}),he=fe?`Press your shortcut. Esc cancels.`:re?`P4 Code already uses this for "${ee(re)}".`:k.status===`checking`?`Checking shortcut…`:k.availability?k.availability.available?`Ready to save.`:k.availability.message:o?.mode===`portal`&&!o.shortcutLabel&&a(U)?`Try a shortcut such as Ctrl+Shift+2.`:De(o),ge=async(t=`resume`)=>{if(o&&!l){pe(),j.current++,O(I),A({status:`idle`,availability:null}),x(null),p(!0);try{let n=await K();if(!n)return;if(n.macPermissions&&(t=`access`),!e.snapShotEnabled&&Ce(n,t)!==`access`&&(n=await J({snapShotEnabled:!0}),!n)){E({initialStep:`access`,wasEnabled:!1});return}E({initialStep:Ce(n,t),wasEnabled:e.snapShotEnabled})}finally{p(!1)}}},ye=async()=>{if(l)return!1;p(!0),x(null);try{if(o?.macPermissions){if(ae(S?.wasEnabled??e.snapShotEnabled),!r?.setupSnapShot)throw Error(`Restart P4 Code to finish capture setup.`);await r.setupSnapShot(`test-mac-capture`)}o?.mode===`direct`&&await r?.requestSnapShotPermissions(e.snapShotIncludeAccessibility);let t=e.snapShotEnabled&&!o?.message?await K():await J({snapShotEnabled:!0});return t!==void 0&&Z(t)}catch(e){return x($(`Couldn't verify capture access`,e)),!1}finally{p(!1)}},X=async t=>{if(S&&!l){p(!0);try{if(e.snapShotEnabled&&we(S.wasEnabled,t)&&!await J({snapShotEnabled:!1}))return;pe(),x(null),se(),E(null)}catch(e){x($(`Couldn't close capture setup`,e))}finally{p(!1)}}},be=async()=>{if(!ie||l)return!1;p(!0);try{let e=await J({snapShotShortcut:D});return!!(e?.shortcutRegistered||e?.shortcutPending)}finally{p(!1)}};return(0,Q.jsxs)(B,{children:[(0,Q.jsx)(V,{id:`snap-shot`,title:`SnapShots`,children:(0,Q.jsxs)(z,{message:N,children:[(0,Q.jsx)(R,{...W(`snap-shot-enabled`),description:je(o),status:r?l&&!S?`Updating capture settings…`:Te(o,e.snapShotEnabled):void 0,control:(0,Q.jsxs)(Q.Fragment,{children:[e.snapShotEnabled&&!ke(o,e.snapShotIncludeAccessibility)?(0,Q.jsx)(d,{size:`xs`,variant:`outline`,disabled:l,onClick:()=>void ge(),children:Oe(o)}):null,(0,Q.jsx)(q,{checked:e.snapShotEnabled||!!S,disabled:!P||l,"aria-label":`Enable snapshots`,onCheckedChange:e=>{e?o?.windows?J({snapShotEnabled:!0}):ge():J({snapShotEnabled:!1})}})]})}),e.snapShotEnabled&&P?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(R,{...W(`snap-shot-accessibility`),description:`Include text and controls when the app makes them available.`,status:Me(o),control:(0,Q.jsx)(q,{checked:!Me(o)&&e.snapShotIncludeAccessibility,disabled:!P||!!Me(o),"aria-label":`Include app text in snapshots`,onCheckedChange:e=>void ue(e)})}),(0,Q.jsx)(R,{...W(`snap-shot-shortcut`),description:o?.linuxBackend===`picker`?`Choose a window to capture from any app.`:`Capture the window you're using without switching apps.`,status:L?void 0:he,control:L?(0,Q.jsx)(d,{size:`xs`,variant:`outline`,disabled:l,onClick:()=>void ge(`shortcut`),children:`Change shortcut`}):(0,Q.jsxs)(Q.Fragment,{children:[me,H?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(d,{size:`xs`,disabled:!ie||l,onClick:()=>void be(),children:l?`Saving…`:`Save`}),(0,Q.jsx)(d,{size:`xs`,variant:`ghost`,disabled:l,onClick:()=>{pe(),j.current++,O(I),A({status:`idle`,availability:null})},children:`Cancel`})]}):o?.mode===`portal`&&o.shortcutCanRetry!==!1&&!a(I)?(0,Q.jsx)(d,{size:`xs`,variant:`ghost`,disabled:l||o.shortcutPending,onClick:()=>void le(`retry-shortcut`),children:`Shortcut permissions`}):null]})}),(0,Q.jsx)(R,{...W(`snap-shot-sound`),description:`Choose the sound played when capture starts.`,control:(0,Q.jsxs)(u,{children:[(0,Q.jsx)(v,{"aria-label":`Snapshot sound: `+ce,render:(0,Q.jsx)(y,{size:`sm`}),className:`w-auto min-w-0`,disabled:!P,children:G===`off`?`Off`:G===`soft-pop`?(0,Q.jsxs)(Q.Fragment,{children:[`Whoosh `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`(Default)`})]}):`Click`}),(0,Q.jsx)(g,{align:`end`,children:(0,Q.jsxs)(f,{onValueChange:e=>void J(Pe(e)),value:G,children:[(0,Q.jsx)(h,{closeOnClick:!0,value:`off`,children:`Off`}),(0,Q.jsxs)(`div`,{className:qe,children:[(0,Q.jsxs)(h,{closeOnClick:!0,value:`soft-pop`,children:[`Whoosh `,(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`(Default)`})]}),(0,Q.jsx)(i,{"aria-label":`Play Whoosh`,closeOnClick:!1,onClick:()=>ne(`soft-pop`),children:(0,Q.jsx)(s,{})})]}),(0,Q.jsxs)(`div`,{className:qe,children:[(0,Q.jsx)(h,{closeOnClick:!0,value:`camera-shutter`,children:`Click`}),(0,Q.jsx)(i,{"aria-label":`Play Click`,closeOnClick:!1,onClick:()=>ne(`camera-shutter`),children:(0,Q.jsx)(s,{})})]})]})})]})}),(0,Q.jsx)(R,{...W(`snap-shot-flash`),description:`Show a gentle cue on the captured window.`,status:F,control:(0,Q.jsx)(q,{checked:!F&&e.snapShotFlash,disabled:!P||!!F,"aria-label":`Flash captured window`,onCheckedChange:e=>void J({snapShotFlash:e})})}),(0,Q.jsx)(R,{...W(`snap-shot-animations`),description:`Animate captured windows into your draft.`,status:F,control:(0,Q.jsx)(q,{checked:!F&&e.snapShotAnimations,disabled:!P||!!F,"aria-label":`Animate snapshots`,onCheckedChange:e=>void J({snapShotAnimations:e})})})]}):null]})}),S&&o?(0,Q.jsx)(Ke,{state:o,initialStep:S.initialStep,wasEnabled:S.wasEnabled,includeAccessibility:e.snapShotIncludeAccessibility,busy:l,error:m?.message??null,shortcutInput:me,shortcutStatus:he,shortcutChanged:H,canSaveShortcut:ie,onSaveShortcut:be,onEnable:ye,onAction:le,onRefresh:K,onClose:X,onLeaveStep:pe}):null]})}function Ye(){let e=(0,de.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(Je,{}),e[0]=t):t=e[0],t}export{Ye as component};
2
- //# sourceMappingURL=settings.snap-shot-BdVdSIJy.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,t}from"./react-DH3P2YXY.js";import{n,t as r}from"./jsx-runtime-BnjsACtP.js";import{Ad as i,Fs as a,Ft as o,Ht as s,It as c,Jn as l,Jt as u,Nt as d,Oh as f,Vt as p,cf as m,dr as h,fr as g,kh as _,mh as v,of as y,rn as b,sf as x,t as S,tE as C,xT as w,yT as T}from"./utils-DhUt689t.js";import{a as E,i as D,n as O,r as k,t as A}from"./number-field-CEA6qXbs.js";import{a as j,c as M,o as N,s as P,t as F}from"./select-D_zHR42Y.js";import{t as ee}from"./useNavigate-BWqAWfiZ.js";import{i as te}from"./toast-DXWclCrr.js";import{F as ne,I as re,N as ie,P as ae,f as oe,z as se}from"./useSettings-gPlpTIWi.js";import{f as ce,t as le}from"./server-6nKYyc8r.js";import{n as ue}from"./query-CfGzD8v6.js";import{t as de}from"./use-atom-command-vqjL7n-x.js";import{a as fe,n as pe,t as me}from"./tooltip-CY3W5y-f.js";import{t as I}from"./skeleton-BcLPbojY.js";import{t as he}from"./textarea-DlXXDHPJ.js";import{t as ge}from"./input-BYd74ook.js";import{a as _e,i as ve,n as L,o as ye,r as be,t as xe}from"./empty-rC3eYvxq.js";import{t as R}from"./sourceControl-CPrl7cyO.js";import{g as Se,m as Ce}from"./Icons-xsXA_L6w.js";import{n as we,t as Te}from"./sourceControlClients-oNOd36Cq.js";import{n as z}from"./pullRequestIcons-B7Om_B_D.js";import{F as Ee,I as De,R as Oe,V as ke,a as B,f as V,i as Ae,n as je,o as H,r as Me,s as Ne,t as Pe}from"./settingsLayout-4ySvFdXb.js";import{Oa as Fe,ar as U,fr as Ie,ga as Le,ha as Re,ir as W,pr as ze,un as Be,va as Ve,vi as He}from"./main-VfCRP294.js";import{t as Ue}from"./ProviderModelPicker-JNM9nJs_.js";import{t as We}from"./useScopedModelAvailability-815e0x20.js";import{t as Ge}from"./ProjectDefaultsSettings-DX2Kf-tx.js";import{t as Ke}from"./SecretInput-CqAhFuNO.js";import{t as qe}from"./ProviderSettingsForm-CdiKhrJE.js";var G=n(),K=e(t(),1),q=e(r(),1);function Je({environmentId:e,definition:t,onSaved:n}){let r=oe(e,e=>e.sourceControlHosts[t.kind]),i=de(ce.updateSettings,{label:`save ${t.label} settings`}),[a,o]=(0,K.useState)(!1),s={settingsSchema:t.settings},c=Object.values(r??{}).some(e=>e!==``),l=async r=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{[t.kind]:r}}}}))._tag===`Success`&&n()}finally{o(!1)}};return(0,q.jsxs)(`fieldset`,{disabled:a,className:`contents`,children:[(0,q.jsx)(qe,{definition:s,value:r??{},idPrefix:`source-control-${t.kind}-${e}`,variant:`settings`,onChange:e=>{let t=e??{},n=Object.fromEntries(Object.entries(t).filter(([e,t])=>r?.[e]!==t)),i=Object.keys(r??{}).filter(e=>!(e in t));l({...n,...Object.fromEntries(i.map(e=>[e,``]))})}}),c?(0,q.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,q.jsx)(h,{size:`xs`,variant:`outline`,onClick:()=>void l(Object.fromEntries(Object.keys(r??{}).map(e=>[e,``]))),children:`Remove`})}):null]})}function Ye(e){return[...new Set(e.map(e=>e.host))].map(t=>{let n=e.filter(e=>e.host===t),r=n.filter(e=>e.environmentVariable===void 0),i=r.filter(e=>e.authenticated);return{host:t,activeAccount:(i.find(e=>e.active)??i[0])?.account??null,selectable:i.map(e=>e.account),broken:r.filter(e=>!e.authenticated),environmentVariable:n.find(e=>e.environmentVariable)?.environmentVariable??null}})}function Xe(e,t,n){let r=e[t],i=n.enabled??r?.enabled??!0,a=n.account===void 0?r?.account:n.account??void 0,{[t]:o,...s}=e;return i&&a===void 0?s:{...s,[t]:{enabled:i,...a===void 0?{}:{account:a}}}}var J=`active gh account`;function Y(e){let t=(0,G.c)(4),n;return t[0]!==e.account||t[1]!==e.label||t[2]!==e.revealed?(n=e.revealed?(0,q.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:e.account}):(0,q.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:[(0,q.jsx)(`span`,{className:`select-none blur-xs`,"aria-hidden":!0,children:ze(e.account)}),(0,q.jsx)(`span`,{className:`sr-only`,children:e.label??`Hidden account`})]}),t[0]=e.account,t[1]=e.label,t[2]=e.revealed,t[3]=n):n=t[3],n}function Ze({environmentId:e,auth:t,onSaved:n}){let r=oe(e,Te).hosts,i=de(ce.updateSettings,{label:`save GitHub account settings`}),[a,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(!1),l=Ye(t.accounts??[]),u=async(t,a)=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{github:{hosts:Xe(r,t,a)}}}}}))._tag===`Success`&&n()}finally{o(!1)}};return l.length===0?(0,q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Sign in with `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh auth login`}),` on the server host, then rescan to choose accounts here.`]}):(0,q.jsxs)(`div`,{className:`grid gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login each GitHub host uses, or turn a host off.`]}),(0,q.jsx)(h,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>c(e=>!e),"aria-label":s?`Hide GitHub accounts`:`Reveal GitHub accounts`,"aria-pressed":s,children:s?(0,q.jsx)(m,{}):(0,q.jsx)(x,{})})]}),l.map(e=>{let t=r[e.host],n=t?.enabled??!0,i=t?.account!==void 0&&!e.selectable.includes(t.account),o=t?.account!==void 0&&!i?t.account:J;return(0,q.jsxs)(`div`,{className:`grid gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,q.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.host}),e.selectable.length===1&&e.selectable[0]!==void 0?(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,q.jsx)(`span`,{children:`Signed in as`}),(0,q.jsx)(Y,{revealed:s,account:e.selectable[0]})]}):null]}),(0,q.jsx)(Ve,{checked:n,disabled:a,"aria-label":`Use GitHub on ${e.host}`,onCheckedChange:t=>void u(e.host,{enabled:t})})]}),e.selectable.length>1?(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Account`}),(0,q.jsx)(`div`,{className:`w-64 max-w-full`,children:(0,q.jsxs)(F,{value:o,disabled:a||!n,onValueChange:t=>{typeof t==`string`&&u(e.host,{account:t===J?null:t})},children:[(0,q.jsx)(P,{size:`sm`,"aria-label":`GitHub account for ${e.host}`,children:(0,q.jsx)(M,{children:t=>t===J?(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,q.jsxs)(q.Fragment,{children:[`(`,(0,q.jsx)(Y,{revealed:s,account:e.activeAccount}),`)`]}):null]}):(0,q.jsx)(Y,{revealed:s,account:t})})}),(0,q.jsxs)(N,{align:`end`,alignItemWithTrigger:!1,children:[(0,q.jsx)(j,{value:J,children:(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,q.jsxs)(q.Fragment,{children:[`(`,(0,q.jsx)(Y,{revealed:s,account:e.activeAccount}),`)`]}):null]})}),e.selectable.map((e,t)=>(0,q.jsx)(j,{value:e,children:(0,q.jsx)(Y,{revealed:s,account:e,label:`Account ${t+1}`})},e))]})]})})]}):null,i?(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`p`,{className:`text-xs text-warning`,children:`The chosen login is no longer signed in, so the active gh login is used.`}),(0,q.jsx)(h,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void u(e.host,{account:null}),children:`Use active login`})]}):null,e.broken.map(e=>(0,q.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground/70`,children:[(0,q.jsx)(Y,{revealed:s,account:e.account}),(0,q.jsxs)(`span`,{children:[`can't be used: `,e.error??`gh reports this login as invalid.`]})]},e.account)),e.environmentVariable?(0,q.jsxs)(`p`,{className:`text-xs text-warning`,children:[e.environmentVariable,` is set on the server, so it overrides the account chosen here until it is unset.`]}):null]},e.host)})]})}var X=`github.com`;function Qe(e){return`https://${e}/settings/personal-access-tokens/new`}function $e({environmentId:e,onSaved:t}){let{tokens:n}=oe(e,Te),r=de(ce.updateSettings,{label:`save GitHub token`}),[i,a]=(0,K.useState)(X),[o,s]=(0,K.useState)(``),[c,l]=(0,K.useState)(!1),u=i.trim().toLowerCase(),d=(n[u]??``).length>0,f=Object.entries(n).filter(([,e])=>e.length>0).map(([e])=>e),p=async(i,a)=>{l(!0);try{(await r({environmentId:e,input:{patch:{sourceControlHosts:{github:{tokens:{...n,[i]:a}}}}}}))._tag===`Success`&&(s(``),t())}finally{l(!1)}};return(0,q.jsx)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),u&&o.trim()&&p(u,o.trim())},children:(0,q.jsxs)(`fieldset`,{disabled:c,className:`contents`,children:[(0,q.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`A token saved here is used before`,` `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`GH_TOKEN`}),` and the`,` `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`gh`}),` login, so GitHub works without the GitHub CLI. Give it read and write access to pull requests and contents.`,` `,(0,q.jsxs)(g,{render:(0,q.jsx)(`a`,{href:Qe(u||X),target:`_blank`,rel:`noreferrer noopener`}),children:[`Create a token`,(0,q.jsx)(y,{"aria-hidden":!0,className:`size-3`})]})]}),(0,q.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[12rem_1fr]`,children:[(0,q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,q.jsx)(He,{htmlFor:`github-token-host-${e}`,children:`Host`}),(0,q.jsx)(ge,{id:`github-token-host-${e}`,autoComplete:`off`,size:`sm`,placeholder:X,value:i,onChange:e=>a(e.target.value)})]}),(0,q.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,q.jsx)(He,{htmlFor:`github-token-${e}`,children:`Token`}),(0,q.jsx)(Ke,{id:`github-token-${e}`,size:`sm`,configured:d,value:o,onChange:e=>s(e.target.value)})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:f.length===0?`No token saved; the server uses GH_TOKEN or the gh login.`:`Saved for ${f.join(`, `)}.`}),(0,q.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[d?(0,q.jsx)(h,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void p(u,``),children:`Remove`}):null,(0,q.jsx)(h,{type:`submit`,size:`xs`,disabled:!u||!o.trim()||c,children:`Save`})]})]})]})})}var et={static:`Static prefix`,semantic:`Semantic prefix`,custom:`Custom instructions`};function tt(){let e=(0,G.c)(40),t=Ee(),{targets:n}=ke(),r;e[0]===n?r=e[1]:(r=n.map(it).join(`,`),e[0]=n,e[1]=r);let i=r,a=(0,K.useRef)(!1),o=(0,K.useRef)(!1),s=Oe(),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`branchNamingMode`],e[2]=c):c=e[2];let l=De(c),u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=[`branchNamePrefix`],e[3]=u):u=e[3];let d=De(u),p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=[`branchNameInstructions`],e[4]=p):p=e[4];let m=De(p),h,g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=[`branchNamingMode`],g=W(`worktree-branch-naming`),e[5]=h,e[6]=g):(h=e[5],g=e[6]);let _=!l&&t.branchNamingMode===`semantic`?`The model chooses a prefix that describes the work, such as feat/add-search, fix/login-timeout, or refactor/auth.`:void 0,y;e[7]!==l||e[8]!==t.branchNamingMode||e[9]!==s?(y=t.branchNamingMode!==f.branchNamingMode||l?(0,q.jsx)(Me,{label:`branch naming`,onClick:()=>s({branchNamingMode:f.branchNamingMode})}):null,e[7]=l,e[8]=t.branchNamingMode,e[9]=s,e[10]=y):y=e[10];let b=l?null:t.branchNamingMode,x;e[11]===s?x=e[12]:(x=e=>{v.literals.includes(e)&&s({branchNamingMode:e})},e[11]=s,e[12]=x);let S;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsx)(P,{size:`sm`,"aria-label":`Worktree branch naming`,children:(0,q.jsx)(M,{children:rt})}),e[13]=S):S=e[13];let C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,q.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:v.literals.map(nt)}),e[14]=C):C=e[14];let w;e[15]!==b||e[16]!==x?(w=(0,q.jsxs)(F,{value:b,onValueChange:x,children:[S,C]}),e[15]=b,e[16]=x,e[17]=w):w=e[17];let T;e[18]!==w||e[19]!==_||e[20]!==y?(T=(0,q.jsx)(B,{serverScoped:!0,settingKeys:h,...g,description:`Choose how new worktree branches are named from your first message.`,status:_,resetAction:y,control:w}),e[18]=w,e[19]=_,e[20]=y,e[21]=T):T=e[21];let E;e[22]!==l||e[23]!==d||e[24]!==i||e[25]!==t.branchNamePrefix||e[26]!==t.branchNamingMode||e[27]!==s?(E=!l&&t.branchNamingMode===`static`?(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`branchNamePrefix`],title:`Branch prefix`,description:`For example, p4 or p4/ produces p4/add-search. Leave empty for no prefix.`,resetAction:d||t.branchNamePrefix!==f.branchNamePrefix?(0,q.jsx)(Me,{label:`branch prefix`,onClick:()=>s({branchNamePrefix:f.branchNamePrefix})}):null,control:(0,q.jsx)(ge,{"aria-label":`Branch prefix`,autoCapitalize:`none`,spellCheck:!1,onChange:()=>{a.current=!0},placeholder:d?`Mixed`:`No prefix`,defaultValue:d?``:t.branchNamePrefix,onBlur:e=>{let n=e.target.value.trim();a.current&&(d||n!==t.branchNamePrefix)&&s({branchNamePrefix:n}),a.current=!1}},`${i}:${d}:${t.branchNamePrefix}`)}):null,e[22]=l,e[23]=d,e[24]=i,e[25]=t.branchNamePrefix,e[26]=t.branchNamingMode,e[27]=s,e[28]=E):E=e[28];let D;e[29]!==m||e[30]!==l||e[31]!==i||e[32]!==t.branchNameInstructions||e[33]!==t.branchNamingMode||e[34]!==s?(D=!l&&t.branchNamingMode===`custom`?(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`branchNameInstructions`],title:`Branch naming instructions`,description:`Appended to the naming prompt. The model returns the complete branch name; no prefix or suffix is added.`,resetAction:m||t.branchNameInstructions!==``?(0,q.jsx)(Me,{label:`branch naming instructions`,onClick:()=>s({branchNameInstructions:``})}):null,children:(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,q.jsx)(he,{"aria-label":`Branch naming instructions`,onChange:()=>{o.current=!0},rows:4,defaultValue:m?``:t.branchNameInstructions,placeholder:m?`Mixed. Enter instructions to apply to all selected targets.`:`Use julius/ followed by the issue ID and a short description.`,onBlur:e=>{let n=e.target.value.trim();o.current&&(m||n!==t.branchNameInstructions)&&s({branchNameInstructions:n}),o.current=!1}},`${i}:${m}:${t.branchNameInstructions}`)})}):null,e[29]=m,e[30]=l,e[31]=i,e[32]=t.branchNameInstructions,e[33]=t.branchNamingMode,e[34]=s,e[35]=D):D=e[35];let O;return e[36]!==T||e[37]!==E||e[38]!==D?(O=(0,q.jsxs)(q.Fragment,{children:[T,E,D]}),e[36]=T,e[37]=E,e[38]=D,e[39]=O):O=e[39],O}function nt(e){return(0,q.jsx)(j,{value:e,children:et[e]},e)}function rt(e){return e===null?`Mixed`:et[e]}function it(e){return`${e.environmentId}:${e.projectId}`}var at={repo_conventions:{label:`Repository conventions`,description:`In each project, matches recent change descriptions and change request titles.`},conventional_commits:{label:`Conventional Commits`,description:`Use Conventional Commit prefixes and keep change request text concise.`},custom:{label:`Custom instructions`,description:`Use your instructions for change descriptions and change requests in every project.`}};function ot(){let e=(0,G.c)(80),t=Ee(),n=Oe(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`reviewGuidesEnabled`],e[0]=r):r=e[0];let i=De(r),l=ee(),{environment:f,connectedEnvironments:m,targets:g,target:v}=ke(),y=f?.environmentId??null,x=m.length>0,S=f?.serverConfig?.providers??le,C;e[1]===g?C=e[2]:(C=e=>{let t=g[0];return t!==void 0&&g.some(n=>n.settings.sourceControlWritingStyle[e]!==t.settings.sourceControlWritingStyle[e])},e[1]=g,e[2]=C);let w=C,T;e[3]===w?T=e[4]:(T=w(`mode`),e[3]=w,e[4]=T);let E=T,D;e[5]===w?D=e[6]:(D=w(`customInstructions`),e[5]=w,e[6]=D);let O=D,k;e[7]===w?k=e[8]:(k=w(`followChangeRequestTemplates`),e[7]=w,e[8]=k);let A=k,j=E||O,ne;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(ne=[`sourceControlWriterModelSelection`],e[9]=ne):ne=e[9];let re=De(ne),oe;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(oe=[`reviewGuideModelSelection`],e[10]=oe):oe=e[10];let se=De(oe),ce;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(ce=[`reviewGuideInstructions`],e[11]=ce):ce=e[11];let ue=De(ce),de=(0,K.useRef)(!1),fe;e[12]===g?fe=e[13]:(fe=g.map(ft).join(`,`),e[12]=g,e[13]=fe);let pe=fe,me=(0,K.useRef)(null),[I,ge]=(0,K.useState)(!1),[_e,ve]=(0,K.useState)(null),L=t.sourceControlWritingStyle,ye=_.sourceControlWritingStyle,be=j||L.mode!==ye.mode||L.customInstructions!==ye.customInstructions,xe=S.filter(dt),R=u(p(s(xe),t,v?.projectId??null)),Se=new Set(R.filter(ut).map(lt)),Ce=xe.filter(e=>Se.has(e.instanceId)),we=o(t,Ce),Te=t.sourceControlWriterModelSelection!==null,z=o({...t,textGenerationModelSelection:ae(t,Ce,v?.projectId??null)},Ce),V=R.some(e=>e.instanceId===we.instanceId&&e.enabled&&e.isAvailable),Ae=d(t,Ce,z.instanceId,z.model),H=We(t,R),Pe=R.find(e=>e.instanceId===z.instanceId),Fe=t.reviewGuideModelSelection!==null,U=o({...t,textGenerationModelSelection:ie(t,xe,v?.projectId??null)},xe),Ie=d(t,xe,U.instanceId,U.model),Le=R.find(e=>e.instanceId===U.instanceId),Re=Ne,ze;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,q.jsx)(tt,{}),e[14]=ze):ze=e[14];let Be;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(Be=[`sourceControlWritingStyle`],e[15]=Be):Be=e[15];let He;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(He=W(`source-control-writing-style`),e[16]=He):He=e[16];let Ge=at[L.mode],Ke;e[17]!==be||e[18]!==n?(Ke=be?(0,q.jsx)(Me,{label:`source control writing style`,onClick:()=>n({sourceControlWritingStyle:{mode:ye.mode,customInstructions:ye.customInstructions}})}):null,e[17]=be,e[18]=n,e[19]=Ke):Ke=e[19];let qe=E?null:L.mode,Je;e[20]===n?Je=e[21]:(Je=e=>{let t=me.current?.value.trim();n({sourceControlWritingStyle:{mode:e,...t===void 0?{}:{customInstructions:t}}})},e[20]=n,e[21]=Je);let Ye;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=(0,q.jsx)(P,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Source control writing style`,children:(0,q.jsx)(M,{children:ct})}),e[22]=Ye):Ye=e[22];let Xe;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=Object.keys(at),e[23]=Xe):Xe=e[23];let J;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,q.jsx)(N,{align:`end`,alignItemWithTrigger:!1,children:Xe.map(st)}),e[24]=J):J=e[24];let Y;e[25]!==qe||e[26]!==Je?(Y=(0,q.jsxs)(F,{value:qe,onValueChange:Je,children:[Ye,J]}),e[25]=qe,e[26]=Je,e[27]=Y):Y=e[27];let Ze;e[28]!==_e||e[29]!==I||e[30]!==L.customInstructions||e[31]!==L.mode||e[32]!==n||e[33]!==j?(Ze=j?(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl space-y-2 pb-3.5`,children:I?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(he,{value:_e??``,onChange:e=>ve(e.target.value),rows:4,"aria-label":`Custom source control instructions for all selected environments`,placeholder:`Write the instructions each selected environment should use.`}),(0,q.jsx)(h,{size:`sm`,variant:`outline`,disabled:_e===null,onClick:()=>{_e!==null&&(n({sourceControlWritingStyle:{mode:`custom`,customInstructions:_e.trim()}}),ge(!1))},children:`Apply instructions to all`})]}):(0,q.jsx)(h,{size:`sm`,variant:`outline`,onClick:()=>{ve(null),ge(!0)},children:`Write custom instructions for all`})}):L.mode===`custom`?(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,q.jsx)(he,{ref:me,defaultValue:L.customInstructions,onBlur:e=>{let t=e.target.value.trim();t!==L.customInstructions&&n({sourceControlWritingStyle:{customInstructions:t}})},rows:4,placeholder:`Keep titles concise. Use short bullet points in descriptions.`,"aria-label":`Custom source control writing instructions`},L.customInstructions)}):null,e[28]=_e,e[29]=I,e[30]=L.customInstructions,e[31]=L.mode,e[32]=n,e[33]=j,e[34]=Ze):Ze=e[34];let X;e[35]!==Ge.description||e[36]!==Ke||e[37]!==Y||e[38]!==Ze||e[39]!==j?(X=(0,q.jsx)(B,{serverScoped:!0,settingKeys:Be,mixed:j,...He,description:Ge.description,resetAction:Ke,control:Y,children:Ze}),e[35]=Ge.description,e[36]=Ke,e[37]=Y,e[38]=Ze,e[39]=j,e[40]=X):X=e[40];let Qe;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=[`sourceControlWritingStyle`],e[41]=Qe):Qe=e[41];let $e;e[42]===Symbol.for(`react.memo_cache_sentinel`)?($e=W(`follow-change-request-templates`),e[42]=$e):$e=e[42];let et;e[43]!==L.followChangeRequestTemplates||e[44]!==A||e[45]!==n?(et=A||L.followChangeRequestTemplates!==ye.followChangeRequestTemplates?(0,q.jsx)(Me,{label:`change request templates`,onClick:()=>n({sourceControlWritingStyle:{followChangeRequestTemplates:ye.followChangeRequestTemplates}})}):null,e[43]=L.followChangeRequestTemplates,e[44]=A,e[45]=n,e[46]=et):et=e[46];let nt=!A&&L.followChangeRequestTemplates,rt;e[47]===n?rt=e[48]:(rt=e=>n({sourceControlWritingStyle:{followChangeRequestTemplates:!!e}}),e[47]=n,e[48]=rt);let it;e[49]!==nt||e[50]!==rt||e[51]!==A?(it=(0,q.jsx)(Ve,{mixed:A,checked:nt,onCheckedChange:rt,"aria-label":`Follow change request templates`}),e[49]=nt,e[50]=rt,e[51]=A,e[52]=it):it=e[52];let ot;e[53]!==et||e[54]!==it||e[55]!==A?(ot=(0,q.jsx)(B,{serverScoped:!0,settingKeys:Qe,mixed:A,...$e,description:`Use the repository's template for change request descriptions when available.`,resetAction:et,control:it}),e[53]=et,e[54]=it,e[55]=A,e[56]=ot):ot=e[56];let pt,mt;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(pt=[`sourceControlWriterModelSelection`],mt=W(`source-control-writer-model`),e[57]=pt,e[58]=mt):(pt=e[57],mt=e[58]);let ht=x?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[Te&&!V?(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No text generation providers available.`}):null,Te&&V?(0,q.jsx)(Ue,{environmentId:y,activeInstanceId:z.instanceId,model:z.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:Ae,triggerClassName:je,triggerAriaLabel:`Source control writer model`,...re?{triggerLabel:`Mixed`}:{},...y?{onOpenProviderSetup:e=>{l({to:`/settings/providers`,search:{environmentId:y,instanceId:e}})}}:{},getModelDisabledReason:H,onInstanceModelChange:(e,t)=>{let r=H(e,t);if(r){te.add({type:`error`,title:`Source control writer model not saved`,description:r});return}n({sourceControlWriterModelSelection:a(e,t)})}}):null,Te&&V&&!re&&Pe?(0,q.jsx)(b,{provider:Pe.driverKind,models:Pe.models,model:z.model,modelOptions:z.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||c(z.options),triggerClassName:je,onModelOptionsChange:e=>n({sourceControlWriterModelSelection:a(z.instanceId,z.model,e)})}):null,(0,q.jsx)(Ve,{checked:Te,disabled:!Te&&!V,onCheckedChange:e=>n({sourceControlWriterModelSelection:e?a(we.instanceId,we.model,we.options):null}),"aria-label":`Use a separate source control writer model`})]}):(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its source control writer model.`}),gt;e[59]===ht?gt=e[60]:(gt=(0,q.jsx)(B,{serverScoped:!0,settingKeys:pt,...mt,description:`Model for source control text and branch or bookmark names. Off uses the environment's text generation model.`,control:ht}),e[59]=ht,e[60]=gt);let _t;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(_t=[`reviewGuidesEnabled`],e[61]=_t):_t=e[61];let vt;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(vt=W(`review-guides`),e[62]=vt):vt=e[62];let yt=!i&&t.reviewGuidesEnabled,Z;e[63]===n?Z=e[64]:(Z=e=>n({reviewGuidesEnabled:!!e}),e[63]=n,e[64]=Z);let Q;e[65]!==i||e[66]!==yt||e[67]!==Z?(Q=(0,q.jsx)(Ve,{mixed:i,checked:yt,onCheckedChange:Z,"aria-label":`Review guides`}),e[65]=i,e[66]=yt,e[67]=Z,e[68]=Q):Q=e[68];let $;e[69]!==i||e[70]!==Q?($=(0,q.jsx)(B,{serverScoped:!0,settingKeys:_t,mixed:i,...vt,description:`Adds a Guide tab to pull requests: an agent writes a tour of the change, stop by stop, with the calls a maintainer should make.`,control:Q}),e[69]=i,e[70]=Q,e[71]=$):$=e[71];let bt=t.reviewGuidesEnabled||i?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`reviewGuideModelSelection`],...W(`review-guide-model`),description:`Model that reads a pull request to write its review guide. It reads the change itself over many steps, so a stronger model helps. Off uses the source control writer model.`,control:x?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(Fe||se)&&V?(0,q.jsx)(Ue,{environmentId:y,activeInstanceId:U.instanceId,model:U.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:Ie,triggerClassName:je,triggerAriaLabel:`Review guide model`,...se?{triggerLabel:`Mixed`}:{},getModelDisabledReason:H,onInstanceModelChange:(e,t)=>{let r=H(e,t);if(r){te.add({type:`error`,title:`Review guide model not saved`,description:r});return}n({reviewGuideModelSelection:a(e,t)})}}):null,Fe&&V&&!se&&Le?(0,q.jsx)(b,{provider:Le.driverKind,models:Le.models,model:U.model,modelOptions:U.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||c(U.options),triggerClassName:je,onModelOptionsChange:e=>n({reviewGuideModelSelection:a(U.instanceId,U.model,e)})}):null,(0,q.jsx)(Ve,{mixed:se,checked:!se&&Fe,disabled:!Fe&&!V,onCheckedChange:e=>{if(!e){n({reviewGuideModelSelection:null});return}let t=H(z.instanceId,z.model);if(t){te.add({type:`error`,title:`Review guide model not saved`,description:t});return}n({reviewGuideModelSelection:a(z.instanceId,z.model,z.options)})},"aria-label":`Use a separate review guide model`})]}):(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its review guide model.`})}),(0,q.jsx)(B,{serverScoped:!0,settingKeys:[`reviewGuideInstructions`],...W(`review-guide-instructions`),description:`Your preferences for review guides: what to show first, dwell on, or skip. The guide's format and coverage stay the same.`,resetAction:ue||t.reviewGuideInstructions!==``?(0,q.jsx)(Me,{label:`review guide instructions`,onClick:()=>n({reviewGuideInstructions:``})}):null,children:(0,q.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,q.jsx)(he,{"aria-label":`Review guide instructions`,onChange:()=>{de.current=!0},rows:4,defaultValue:ue?``:t.reviewGuideInstructions,placeholder:ue?`Mixed. Enter instructions to apply to all selected targets.`:`Show service interfaces before implementations. Skip test files unless they change behavior. Keep summaries to two sentences.`,onBlur:e=>{let r=e.target.value.trim();de.current&&(ue||r!==t.reviewGuideInstructions)&&n({reviewGuideInstructions:r}),de.current=!1}},`${pe}:${ue}:${t.reviewGuideInstructions}`)})})]}):null,xt;return e[72]!==Re||e[73]!==ze||e[74]!==X||e[75]!==ot||e[76]!==gt||e[77]!==$||e[78]!==bt?(xt=(0,q.jsxs)(Re,{id:`source-control-text-generation`,title:`Text generation`,children:[ze,X,ot,gt,$,bt]}),e[72]=Re,e[73]=ze,e[74]=X,e[75]=ot,e[76]=gt,e[77]=$,e[78]=bt,e[79]=xt):xt=e[79],xt}function st(e){return(0,q.jsx)(j,{hideIndicator:!0,value:e,children:at[e].label},e)}function ct(e){return e===null?`Mixed`:at[e].label}function lt(e){return e.instanceId}function ut(e){return e.enabled&&e.isAvailable}function dt(e){return e.supportsTextGeneration!==!1}function ft(e){return`${e.environmentId}:${e.projectId}`}var pt={versionControlSystems:[],sourceControlProviders:[]},mt={git:Ce,jj:Se},ht=[`primary`,`secondary`],gt=5;function _t(e){return Math.round(w(e)/1e3)}function vt(e){return e===null||!Number.isFinite(e)?0:Math.max(0,Math.round(e))}function yt(e,t){let n={...e.overrides,...t};for(let[e,t]of Object.entries(n))t===void 0&&delete n[e];return{backgroundActivity:{schemaVersion:1,profile:`custom`,baseProfile:ne(e),overrides:n}}}function Z(e){return C(e)}function Q(e){return`auth`in e}function $(e){return!Q(e)&&!e.implemented}function bt(e){return e.status===`authenticated`?{label:`Authenticated`,badge:null}:e.status===`unauthenticated`?{label:`Not authenticated`,badge:`warning`}:{label:`Status unknown`,badge:null}}function xt(e){let t=(0,G.c)(2),n;return t[0]===e.account?n=t[1]:(n=(0,q.jsx)(Ie,{value:e.account,ariaLabel:`Toggle source control account visibility`,revealTooltip:`Click to reveal account`,hideTooltip:`Click to hide account`}),t[0]=e.account,t[1]=n),n}function St(e){return $(e)?`bg-muted-foreground/35`:e.status!==`available`||Q(e)&&e.auth.status!==`authenticated`?`bg-warning`:`bg-success`}function Ct(e){let t=(0,G.c)(13),{item:n}=e,r,i,a,o;if(t[0]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=St(n),s=Q(n)?we.find(n.kind):void 0,c=Q(n)?s&&Be(s):mt[n.kind];if(!c){o=(0,q.jsx)(`span`,{className:S(`size-2 shrink-0 rounded-full`,e),"aria-hidden":!0});break bb0}i=`relative inline-flex size-5 shrink-0 items-center justify-center`,t[5]===c?a=t[6]:(a=(0,q.jsx)(c,{className:`size-4.5 text-foreground/80`,"aria-hidden":!0}),t[5]=c,t[6]=a),r=S(`pointer-events-none absolute -left-0.5 -top-0.5 size-2 rounded-full ring-2 ring-background`,e)}t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];if(o!==Symbol.for(`react.early_return_sentinel`))return o;let s;t[7]===r?s=t[8]:(s=(0,q.jsx)(`span`,{className:r,"aria-hidden":!0}),t[7]=r,t[8]=s);let c;return t[9]!==i||t[10]!==a||t[11]!==s?(c=(0,q.jsxs)(`span`,{className:i,children:[a,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function wt({item:e,auth:t,authAccount:n}){if($(e))return(0,q.jsxs)(`span`,{children:[`Support for `,e.label,` is coming soon.`]});if(e.status!==`available`)return(0,q.jsxs)(`span`,{children:[`Not available on this server: `,e.installHint]});if(t){if(t.status===`authenticated`){let e=Z(t.detail);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{children:`Authenticated`}),n?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{"aria-hidden":!0,children:`as`}),(0,q.jsx)(xt,{account:n})]}):null,e?(0,q.jsxs)(`span`,{children:[`· `,e]}):null]})}if(!e.executable&&t.status===`unauthenticated`)return(0,q.jsxs)(`span`,{children:[`Available. `,e.installHint]});if(t.status===`unauthenticated`&&t.accounts?.some(e=>e.authenticated))return(0,q.jsx)(`span`,{children:Z(t.detail)??`Every ${e.label} host is turned off.`});if(t.status===`unauthenticated`)return(0,q.jsxs)(`span`,{children:[e.label,` is not authenticated on this server. Sign in or configure credentials using the `,(0,q.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:e.executable}),` tool on the server host to enable change request features.`]});let r=Z(t.detail);return(0,q.jsxs)(`span`,{children:[`Could not verify `,e.label,`. `,r??e.installHint]})}return(0,q.jsx)(`span`,{children:`Available`})}function Tt(e){let t=(0,G.c)(57),{item:n,children:r}=e,a;t[0]===n.version?a=t[1]:(a=Z(n.version),t[0]=n.version,t[1]=a);let o=a,s=Q(n)?n.status===`available`&&n.auth.status===`authenticated`:n.status===`available`&&n.implemented,c=Q(n)?n.auth:null,u;t[2]===c?u=t[3]:(u=c?bt(c):null,t[2]=c,t[3]=u);let d=u,f=c?Z(c.account):null,[p,m]=(0,K.useState)(!1),g=r!==void 0,_=V(),v;t[4]!==n.kind||t[5]!==_||t[6]!==m?(v=()=>{(n.kind===`git`&&_===W(`git-fetch-interval`).id||_===U(n.kind)||n.kind===`github`&&_===W(`github-accounts`).id)&&m(!0)},t[4]=n.kind,t[5]=_,t[6]=m,t[7]=v):v=t[7];let y;t[8]!==n.kind||t[9]!==_?(y=[n.kind,_],t[8]=n.kind,t[9]=_,t[10]=y):y=t[10],(0,K.useEffect)(v,y);let b;t[11]===n?b=t[12]:(b=S(`first:rounded-t-xl last:rounded-b-xl transition-colors hover:bg-muted/20`,$(n)&&`opacity-80`),t[11]=n,t[12]=b);let x;t[13]===n?x=t[14]:(x=(0,q.jsx)(Ct,{item:n}),t[13]=n,t[14]=x);let C;t[15]===n.label?C=t[16]:(C=(0,q.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n.label}),t[15]=n.label,t[16]=C);let w;t[17]===o?w=t[18]:(w=o?(0,q.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:o}):null,t[17]=o,t[18]=w);let T;t[19]===n?T=t[20]:(T=$(n)?(0,q.jsx)(l,{variant:`warning`,size:`sm`,children:`Coming Soon`}):null,t[19]=n,t[20]=T);let E;t[21]===d?E=t[22]:(E=d?.badge?(0,q.jsx)(l,{variant:d.badge,size:`sm`,children:d.label}):null,t[21]=d,t[22]=E);let D;t[23]!==C||t[24]!==w||t[25]!==T||t[26]!==E||t[27]!==x?(D=(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[x,C,w,T,E]}),t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=x,t[28]=D):D=t[28];let O=wt({item:n,auth:c,authAccount:f}),k;t[29]===O?k=t[30]:(k=(0,q.jsx)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1 text-xs leading-normal text-muted-foreground/80`,children:O}),t[29]=O,t[30]=k);let A;t[31]!==D||t[32]!==k?(A=(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[D,k]}),t[31]=D,t[32]=k,t[33]=A):A=t[33];let j;t[34]!==g||t[35]!==p||t[36]!==n.label||t[37]!==m?(j=g?(0,q.jsx)(h,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>m(Et),"aria-expanded":p,"aria-label":`Toggle ${n.label} details`,children:(0,q.jsx)(i,{className:S(`size-3.5 transition-transform`,p&&`rotate-180`)})}):null,t[34]=g,t[35]=p,t[36]=n.label,t[37]=m,t[38]=j):j=t[38];let M;t[39]!==s||t[40]!==n?(M=$(n)?null:(0,q.jsx)(Ve,{checked:s,disabled:!0,"aria-label":`${n.label} availability`}),t[39]=s,t[40]=n,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,q.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[j,M]}),t[42]=j,t[43]=M,t[44]=N):N=t[44];let P;t[45]!==A||t[46]!==N?(P=(0,q.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[A,N]})}),t[45]=A,t[46]=N,t[47]=P):P=t[47];let F;t[48]!==r||t[49]!==g||t[50]!==p||t[51]!==m?(F=g?(0,q.jsx)(Re,{open:p,onOpenChange:m,children:(0,q.jsx)(Le,{children:(0,q.jsx)(`div`,{className:`px-3 pb-4 pt-1 sm:px-4`,children:r})})}):null,t[48]=r,t[49]=g,t[50]=p,t[51]=m,t[52]=F):F=t[52];let ee;return t[53]!==P||t[54]!==F||t[55]!==b?(ee=(0,q.jsxs)(`div`,{className:b,children:[P,F]}),t[53]=P,t[54]=F,t[55]=b,t[56]=ee):ee=t[56],ee}function Et(e){return!e}function Dt(){let e=(0,G.c)(33),t=Ee(),n=Oe(),r;e[0]===t?r=e[1]:(r=_t(se(t).automaticGitFetchInterval),e[0]=t,e[1]=r);let i=r,a;e[2]===t.backgroundActivity?a=e[3]:(a=_t(re(ne(t.backgroundActivity)).automaticGitFetchInterval),e[2]=t.backgroundActivity,e[3]=a);let o=i!==a,s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=W(`git-fetch-interval`),e[4]=s):s=e[4];let c=s,l=c.id,u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:c.title}),d=(0,q.jsx)(Pe,{children:`This interval is configured for Git only. The shared Background activity policy still decides whether Git refreshes may run when the timer fires. Custom intervals appear as Advanced in General settings.`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f=o?`opacity-100`:`pointer-events-none opacity-0`,p;e[7]===f?p=e[8]:(p=S(`inline-flex size-5 shrink-0 items-center justify-center transition-opacity`,f),e[7]=f,e[8]=p);let m=!o,h;e[9]!==o||e[10]!==t.backgroundActivity||e[11]!==n?(h=o?(0,q.jsx)(Me,{label:`fetch interval`,onClick:()=>n(yt(t.backgroundActivity,{automaticGitFetchInterval:void 0}))}):null,e[9]=o,e[10]=t.backgroundActivity,e[11]=n,e[12]=h):h=e[12];let g;e[13]!==p||e[14]!==m||e[15]!==h?(g=(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[u,d,(0,q.jsx)(`span`,{className:p,"aria-hidden":m,children:h})]}),e[13]=p,e[14]=m,e[15]=h,e[16]=g):g=e[16];let _;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,q.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:`Refresh remote branches in the background. Set to 0 to avoid automatic Git prompts.`}),e[17]=_):_=e[17];let v;e[18]===g?v=e[19]:(v=(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[g,_]}),e[18]=g,e[19]=v);let y;e[20]!==t.backgroundActivity||e[21]!==n?(y=e=>n(yt(t.backgroundActivity,{automaticGitFetchInterval:T(vt(e))})),e[20]=t.backgroundActivity,e[21]=n,e[22]=y):y=e[22];let b;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,q.jsxs)(k,{children:[(0,q.jsx)(O,{"aria-label":`Decrease fetch interval`}),(0,q.jsx)(E,{"aria-label":`Automatic Git fetch interval in seconds`}),(0,q.jsx)(D,{"aria-label":`Increase fetch interval`})]}),e[23]=b):b=e[23];let x;e[24]!==i||e[25]!==y?(x=(0,q.jsx)(A,{value:i,min:0,step:gt,size:`sm`,className:`w-32`,onValueChange:y,children:b}),e[24]=i,e[25]=y,e[26]=x):x=e[26];let C;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),e[27]=C):C=e[27];let w;e[28]===x?w=e[29]:(w=(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[x,C]}),e[28]=x,e[29]=w);let j;return e[30]!==v||e[31]!==w?(j=(0,q.jsx)(H,{id:l,className:`grid gap-3`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[v,w]})}),e[30]=v,e[31]=w,e[32]=j):j=e[32],j}function Ot(e){let t=(0,G.c)(4),{title:n,headerAction:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=ht.map(kt),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,q.jsx)(Ne,{title:n,headerAction:r,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function kt(e){return(0,q.jsx)(`div`,{className:`first:rounded-t-xl last:rounded-b-xl px-3 py-3 sm:px-4`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsxs)(`span`,{className:`relative inline-flex size-5 shrink-0 items-center justify-center`,children:[(0,q.jsx)(I,{className:`size-4.5`}),(0,q.jsx)(I,{shape:`pill`,className:`pointer-events-none absolute -left-0.5 -top-0.5 size-2`,"aria-hidden":!0})]}),(0,q.jsx)(I,{shape:`pill`,className:`h-4 w-28`}),(0,q.jsx)(I,{shape:`pill`,className:`h-5 w-14`})]}),(0,q.jsx)(I,{shape:`pill`,className:`h-3 w-full max-w-xs`})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,q.jsx)(I,{className:`size-7`}),(0,q.jsx)(I,{shape:`pill`,className:`h-5 w-9`})]})]})},e)}function At(e){let t=(0,G.c)(18),{error:n,isPending:r,onScan:i}=e,a=n!==null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=W(`source-control`),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(_e,{variant:`icon`,children:(0,q.jsx)(z.pullRequest,{})}),t[1]=s):s=t[1];let c=a?`Could not scan the server environment`:`Nothing detected yet`,l;t[2]===c?l=t[3]:(l=(0,q.jsx)(ye,{children:c}),t[2]=c,t[3]=l);let u=a?n:`Install Git on the server, add optional hosting integrations or credentials your workspace needs, then rescan.`,d;t[4]===u?d=t[5]:(d=(0,q.jsx)(be,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==l||t[7]!==d?(f=(0,q.jsxs)(ve,{children:[l,d]}),t[6]=l,t[7]=d,t[8]=f):f=t[8];let p;t[9]===r?p=t[10]:(p=(0,q.jsx)(Fe,{size:`sm`,refreshing:r}),t[9]=r,t[10]=p);let m;t[11]!==r||t[12]!==i||t[13]!==p?(m=(0,q.jsx)(L,{children:(0,q.jsxs)(h,{size:`sm`,variant:`outline`,onClick:i,disabled:r,children:[p,`Scan`]})}),t[11]=r,t[12]=i,t[13]=p,t[14]=m):m=t[14];let g;return t[15]!==f||t[16]!==m?(g=(0,q.jsx)(Ne,{id:o.id,title:`Server environment`,children:(0,q.jsxs)(xe,{children:[s,f,m]})}),t[15]=f,t[16]=m,t[17]=g):g=t[17],g}function jt(){let e=(0,G.c)(33),{scope:t,environment:n,connectedEnvironments:r}=ke(),i=n?.connection.phase===`connected`?n.environmentId:null,a=t.environmentIds.length!==1&&r.length>1&&n?` · ${n.label}`:``,o;e[0]===i?o=e[1]:(o=i===null?null:R.discovery({environmentId:i,input:{}}),e[0]=i,e[1]=o);let s=ue(o),c=s.data??pt,l=c.versionControlSystems.length>0,u=l||c.sourceControlProviders.length>0,d=s.isPending&&s.data===null,f;e[2]===s?f=e[3]:(f=()=>{s.refresh()},e[2]=s,e[3]=f);let p=f,m;e[4]!==i||e[5]!==p?(m=e=>{let t=we.find(e);if(t?.settings&&i!==null)return(0,q.jsx)(H,{id:U(e),children:(0,q.jsx)(Je,{environmentId:i,definition:{...t,settings:t.settings},onSaved:p},i)})},e[4]=i,e[5]=p,e[6]=m):m=e[6];let g=m,_;e[7]===s.isPending?_=e[8]:(_=(0,q.jsx)(Fe,{refreshing:s.isPending}),e[7]=s.isPending,e[8]=_);let v;e[9]!==s.isPending||e[10]!==p||e[11]!==_?(v=(0,q.jsx)(fe,{render:(0,q.jsx)(h,{size:`icon-xs`,variant:`ghost-muted`,onClick:p,disabled:s.isPending,"aria-label":`Rescan server environment`,children:_})}),e[9]=s.isPending,e[10]=p,e[11]=_,e[12]=v):v=e[12];let y;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,q.jsx)(pe,{side:`top`,children:`Rescan Git and hosting integrations`}),e[13]=y):y=e[13];let b;e[14]===v?b=e[15]:(b=(0,q.jsxs)(me,{children:[v,y]}),e[14]=v,e[15]=b);let x=b,S;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,q.jsx)(Ge,{category:`source-control`}),e[16]=S):S=e[16];let C;e[17]!==s.error||e[18]!==s.isPending||e[19]!==i||e[20]!==a||e[21]!==p||e[22]!==u||e[23]!==l||e[24]!==g||e[25]!==d||e[26]!==c.sourceControlProviders||e[27]!==c.versionControlSystems||e[28]!==x?(C=i===null?(0,q.jsx)(Ne,{id:W(`source-control`).id,title:`Server environment`,children:(0,q.jsx)(`p`,{className:`px-4 py-3 text-sm text-muted-foreground`,children:`Connect an environment to inspect its version control tools and hosting integrations.`})}):d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Ot,{title:`Version Control${a}`,headerAction:x}),(0,q.jsx)(Ot,{title:`Source Control Providers`})]}):u?(0,q.jsxs)(q.Fragment,{children:[l?(0,q.jsx)(Ne,{id:W(`source-control`).id,title:`Version Control${a}`,headerAction:x,children:c.versionControlSystems.map(Mt)}):null,c.sourceControlProviders.length>0?(0,q.jsx)(Ne,{id:l?void 0:W(`source-control`).id,title:l?`Source Control Providers`:`Source Control Providers${a}`,headerAction:l?null:x,children:c.sourceControlProviders.map(e=>(0,q.jsx)(Tt,{item:e,children:e.kind===`github`?(0,q.jsx)(H,{id:W(`github-accounts`).id,children:(0,q.jsxs)(`div`,{className:`grid gap-6`,children:[(0,q.jsx)($e,{environmentId:i,onSaved:p},`token-${i}`),e.status===`available`?(0,q.jsx)(Ze,{environmentId:i,auth:e.auth,onSaved:p},i):null]})}):g(e.kind)},`provider:${e.kind}`))}):null]}):(0,q.jsx)(At,{error:s.error,isPending:s.isPending,onScan:p}),e[17]=s.error,e[18]=s.isPending,e[19]=i,e[20]=a,e[21]=p,e[22]=u,e[23]=l,e[24]=g,e[25]=d,e[26]=c.sourceControlProviders,e[27]=c.versionControlSystems,e[28]=x,e[29]=C):C=e[29];let w;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,q.jsx)(ot,{}),e[30]=w):w=e[30];let T;return e[31]===C?T=e[32]:(T=(0,q.jsxs)(Ae,{children:[S,C,w]}),e[31]=C,e[32]=T),T}function Mt(e){return(0,q.jsx)(Tt,{item:e,children:e.kind===`git`?(0,q.jsx)(Dt,{}):void 0},`vcs:${e.kind}`)}var Nt=jt;export{Nt as component};
2
- //# sourceMappingURL=settings.source-control-Bme3qg7j.js.map