@p4code/cli 0.8.0 → 0.8.2

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 (425) hide show
  1. package/dist/{AcpMcpStdioBridge-CfALMbjp.mjs → AcpMcpStdioBridge-DBONIB-w.mjs} +120 -19
  2. package/dist/AcpMcpStdioBridge-D_JnxPWS.mjs +4 -0
  3. package/dist/{Effect-zfMCY1g4.mjs → Effect-BahT0mOQ.mjs} +2 -2
  4. package/dist/bin.mjs +2 -2
  5. package/dist/{binCli-C3s3kGWK.mjs → binCli-C1tFongj.mjs} +7162 -5814
  6. package/dist/claude-history-worker.mjs +1 -1
  7. package/dist/{claudeHistoryWorker-CMjiofbZ.mjs → claudeHistoryWorker-v_0uyLGp.mjs} +2 -2
  8. package/dist/client/.vite/manifest.json +2154 -2122
  9. package/dist/client/assets/{AnimatedHeight-BwS0L5jd.js → AnimatedHeight-PJxVEp27.js} +2 -2
  10. package/dist/client/assets/{AuthSurfaceShell-B5dTwcVl.js → AuthSurfaceShell-BrPHaco9.js} +2 -2
  11. package/dist/client/assets/{CSPContext-B1m61J9R.js → CSPContext-C7uwFl6f.js} +2 -2
  12. package/dist/client/assets/ChatGptUsageButton-7IZqWaQq.js +2 -0
  13. package/dist/client/assets/ChatMarkdown-D3ITm4U-.js +65 -0
  14. package/dist/client/assets/CodexSetupSection.logic-DyTuN6tg.js +2 -0
  15. package/dist/client/assets/{ComboboxClear-CSnbXRcJ.js → ComboboxClear-BXGqqvsR.js} +2 -2
  16. package/dist/client/assets/{CommandBlock-DcgLBXYD.js → CommandBlock-JrUX9e8E.js} +2 -2
  17. package/dist/client/assets/{ComposerPromptEditor-oniaSNnQ.js → ComposerPromptEditor-Ba1dvqDN.js} +56 -56
  18. package/dist/client/assets/{CompositeRoot-ykxKqF8U.js → CompositeRoot-CW06ANMY.js} +2 -2
  19. package/dist/client/assets/{ConnectionStatusDot-BvfbN2Tp.js → ConnectionStatusDot-Cjh57o6i.js} +2 -2
  20. package/dist/client/assets/DevicePanel-zG3feCFw.js +2 -0
  21. package/dist/client/assets/{DeviceSetup-kaQqI-00.js → DeviceSetup-DccRVnjb.js} +2 -2
  22. package/dist/client/assets/{DialogTitle-Cwi7QOum.js → DialogTitle-7tvQYVxE.js} +2 -2
  23. package/dist/client/assets/{DiffCommentAnnotation-CnCPh4ot.js → DiffCommentAnnotation-DDBZcMFv.js} +3 -3
  24. package/dist/client/assets/DiffFileTree-BhSPT6m_.js +2 -0
  25. package/dist/client/assets/DiffPanel-D7QMWq_A.js +2 -0
  26. package/dist/client/assets/{DiffWorkerPoolProvider-C8TyWhmO.js → DiffWorkerPoolProvider-RcplgHGv.js} +3 -3
  27. package/dist/client/assets/{EnvironmentMachineIcon-CBS8TSmT.js → EnvironmentMachineIcon-DMZGa766.js} +2 -2
  28. package/dist/client/assets/{ExpandableText-CWbIeyDn.js → ExpandableText-DfY-qqRW.js} +3 -3
  29. package/dist/client/assets/{FieldControl-CWR3fEt0.js → FieldControl-C9UnFGZn.js} +2 -2
  30. package/dist/client/assets/{FileDiff-BiIVs0i-.js → FileDiff-BXlBWSxx.js} +2 -2
  31. package/dist/client/assets/{FilePreviewPanel-CXgaN8cb.js → FilePreviewPanel-CSKeM-xZ.js} +5 -5
  32. package/dist/client/assets/{FoldedSettingsSection-BimbnaOl.js → FoldedSettingsSection-BJm8ZaTy.js} +2 -2
  33. package/dist/client/assets/{FormContext-DyOeI4sU.js → FormContext-haYZgWIK.js} +2 -2
  34. package/dist/client/assets/{Icons-BlUgSxml.js → Icons-C12feMOO.js} +2 -2
  35. package/dist/client/assets/{KeybindingsSettings.logic-Dfld_XQx.js → KeybindingsSettings.logic-DhXMdk5O.js} +2 -2
  36. package/dist/client/assets/{NoProjectsHero-ZE4gAFj0.js → NoProjectsHero-CDoSxJVV.js} +2 -2
  37. package/dist/client/assets/{PanelLayoutControls-x5a58Pdn.js → PanelLayoutControls-CCKUTh1H.js} +10 -10
  38. package/dist/client/assets/{PierreEntryIcon-DeBbijxO.js → PierreEntryIcon-7x50Pz_C.js} +2 -2
  39. package/dist/client/assets/{PreviewPanel-2vuw0skj.js → PreviewPanel-BEWZuH6o.js} +2 -2
  40. package/dist/client/assets/ProjectDefaultsSettings-BRRQlvgR.js +2 -0
  41. package/dist/client/assets/{ProjectFavicon-BhJj4G_1.js → ProjectFavicon-ExMHrN16.js} +3 -3
  42. package/dist/client/assets/ProjectIconPickerDialog-DXSyEGg8.js +2 -0
  43. package/dist/client/assets/{ProjectMonogram-BgobvHld.js → ProjectMonogram-um8sYqIi.js} +2 -2
  44. package/dist/client/assets/{ProviderAuthTerminal-CJSJcjB9.js → ProviderAuthTerminal-Tw3kH5vc.js} +2 -2
  45. package/dist/client/assets/ProviderModelPicker-CpgHpUCG.js +2 -0
  46. package/dist/client/assets/{ProviderSettingsForm-Dh_vspcE.js → ProviderSettingsForm-CaNO8FYK.js} +2 -2
  47. package/dist/client/assets/{PullRequestCodeTab-Do36z71f.js → PullRequestCodeTab-DwqL4aAJ.js} +3 -3
  48. package/dist/client/assets/{ReadOnlySourcePreview-BfLIaC5x.js → ReadOnlySourcePreview-Cw6lfMjA.js} +2 -2
  49. package/dist/client/assets/{RedactedSensitiveText-D5aX1wQs.js → RedactedSensitiveText-citJBx4E.js} +2 -2
  50. package/dist/client/assets/{RenderErrorBoundary-DTEG6arv.js → RenderErrorBoundary-D21mPr47.js} +2 -2
  51. package/dist/client/assets/ScheduledTasksSettings-BXOG7dPV.js +4 -0
  52. package/dist/client/assets/ScopedSwitch-2MBm4Srn.js +2 -0
  53. package/dist/client/assets/{SettingsPanels-Betza2Al.js → SettingsPanels-DjzXV7Dm.js} +7 -7
  54. package/dist/client/assets/{SettingsPanels.logic-Dn2Jcxyy.js → SettingsPanels.logic-DpdMN_lX.js} +2 -2
  55. package/dist/client/assets/{SettingsScopeNotice-CAaNSKvu.js → SettingsScopeNotice-CdNfxmW3.js} +2 -2
  56. package/dist/client/assets/{T3ConnectAccountPages-DEqOE3hy.js → T3ConnectAccountPages-C6qHq26m.js} +2 -2
  57. package/dist/client/assets/{T3ConnectSidebarSignIn-C4jpzdPh.js → T3ConnectSidebarSignIn-DewmE1PI.js} +2 -2
  58. package/dist/client/assets/ThemeEditorPanel-aEsLfkYx.js +5 -0
  59. package/dist/client/assets/{ThreadTerminalDrawer-Z7ArIuq0.js → ThreadTerminalDrawer-C1NDkTSs.js} +4 -4
  60. package/dist/client/assets/{UsageLimits-7-_nKQT_.js → UsageLimits-BUS51Bjr.js} +2 -2
  61. package/dist/client/assets/{Virtualizer-EvXC5PAR.js → Virtualizer-B2BG0GB9.js} +2 -2
  62. package/dist/client/assets/WorkspaceBreadcrumb-DX3xH6tC.js +2 -0
  63. package/dist/client/assets/WorkspacePageContainer-BFo6qTGJ.js +2 -0
  64. package/dist/client/assets/{WorkspacePageHeader-DB9Z9OtR.js → WorkspacePageHeader-BCZXPSxj.js} +2 -2
  65. package/dist/client/assets/_chat-B3j3XTUJ.js +58 -0
  66. package/dist/client/assets/{_chat.index-CTfxLY4F.js → _chat.index-7o1_qjfU.js} +2 -2
  67. package/dist/client/assets/{_chat.new-B_FNmP8f.js → _chat.new-W2E0MZ4y.js} +3 -3
  68. package/dist/client/assets/_chat.pull-requests-DnQ-MKRG.js +2 -0
  69. package/dist/client/assets/{abnfDiagram-VCTEODGH-Du15a8Yu.js → abnfDiagram-VCTEODGH-DJY5x2uS.js} +2 -2
  70. package/dist/client/assets/{alert-DUQHh6vz.js → alert-yllEf0yh.js} +2 -2
  71. package/dist/client/assets/app-window-D2LBv8RE.js +2 -0
  72. package/dist/client/assets/architecture-7GRP2DOG-nO5xG-8k.js +1 -0
  73. package/dist/client/assets/{architectureDiagram-5GKGNRK7-DhXH9Bsf.js → architectureDiagram-5GKGNRK7-6YiKazHv.js} +2 -2
  74. package/dist/client/assets/arrow-left-yEW5WFYj.js +1 -0
  75. package/dist/client/assets/arrow-right-BzVZfSb7.js +1 -0
  76. package/dist/client/assets/arrow-up-down-DjL7trCL.js +1 -0
  77. package/dist/client/assets/assets-BxSVuao2.js +2 -0
  78. package/dist/client/assets/bell-ue7A6JFg.js +1 -0
  79. package/dist/client/assets/{blockDiagram-I7D4REHJ-CZ4PIO64.js → blockDiagram-I7D4REHJ-D_EURhbV.js} +2 -2
  80. package/dist/client/assets/blocks-De0WwZYY.js +1 -0
  81. package/dist/client/assets/bot-_T9E-nkd.js +1 -0
  82. package/dist/client/assets/brain-CQYem3Oz.js +2 -0
  83. package/dist/client/assets/{browserHistoryStore-D6A_83JY.js → browserHistoryStore-B-t3Vc_Z.js} +2 -2
  84. package/dist/client/assets/{browserLinkTarget-BuFHp5RQ.js → browserLinkTarget-CiQS1wUg.js} +2 -2
  85. package/dist/client/assets/{c4Diagram-7LVT6UL2-tMXW_Jy8.js → c4Diagram-7LVT6UL2-CmfPrrIj.js} +2 -2
  86. package/dist/client/assets/calendar-clock-DXFNSdXM.js +1 -0
  87. package/dist/client/assets/channel-BE0ymtNV.js +2 -0
  88. package/dist/client/assets/chart-no-axes-column-Dx_cyfN9.js +1 -0
  89. package/dist/client/assets/checkbox-CIeee0-J.js +2 -0
  90. package/dist/client/assets/chromium-BusoCgri.js +2 -0
  91. package/dist/client/assets/{chunk-4HAMMTFA-gISFFADw.js → chunk-4HAMMTFA-BdvKUuii.js} +2 -2
  92. package/dist/client/assets/{chunk-75Z2AOVW-iWd1WVXJ.js → chunk-75Z2AOVW-DXz8BlJz.js} +2 -2
  93. package/dist/client/assets/{chunk-DU6HZSFF-hD69jU_T.js → chunk-DU6HZSFF-ebFBoLTT.js} +2 -2
  94. package/dist/client/assets/{chunk-F27PBJKO-DnDFIjHp.js → chunk-F27PBJKO-B1MlVcaX.js} +2 -2
  95. package/dist/client/assets/{chunk-GMAD6QVW-Chr0sR5B.js → chunk-GMAD6QVW-CEXqem_-.js} +2 -2
  96. package/dist/client/assets/{chunk-GVQU2GXP-D84Xc6Vy.js → chunk-GVQU2GXP-wsgr7T0u.js} +2 -2
  97. package/dist/client/assets/{chunk-IMKFNOWR-DOdemMNR.js → chunk-IMKFNOWR-Daxc_3WP.js} +2 -2
  98. package/dist/client/assets/{chunk-L3NEJ4N5-CILnb7VE.js → chunk-L3NEJ4N5-C4NnipZ0.js} +2 -2
  99. package/dist/client/assets/{chunk-OSK3NFVY-Bxpu9Oo4.js → chunk-OSK3NFVY-DDd2Ay5_.js} +2 -2
  100. package/dist/client/assets/{chunk-P2QGCYS3-75l6wJUu.js → chunk-P2QGCYS3-I9iEYMEJ.js} +2 -2
  101. package/dist/client/assets/{chunk-POPQ4Y6H-jYZ1RdM0.js → chunk-POPQ4Y6H-Cgwl0wkZ.js} +2 -2
  102. package/dist/client/assets/{chunk-PWAF6VOD-DtONZJrC.js → chunk-PWAF6VOD-kBB0Jquc.js} +2 -2
  103. package/dist/client/assets/{chunk-SHT3W25Y-NY6-WqgC.js → chunk-SHT3W25Y-gtUoMWd0.js} +2 -2
  104. package/dist/client/assets/{chunk-SVP7TREG-CGG6Z85U.js → chunk-SVP7TREG-CbL5vJ0z.js} +2 -2
  105. package/dist/client/assets/{chunk-TICWLB2K-DzB7PtXF.js → chunk-TICWLB2K-CMgrptzc.js} +2 -2
  106. package/dist/client/assets/classDiagram-ZZMXUADV-YRduSbl9.js +2 -0
  107. package/dist/client/assets/classDiagram-v2-VYDZK3BY-YRduSbl9.js +2 -0
  108. package/dist/client/assets/{collapsible-CLujF6F7.js → collapsible-C3qenpEI.js} +2 -2
  109. package/dist/client/assets/{color-picker-BG3Rpy98.js → color-picker-Cj2frYnP.js} +2 -2
  110. package/dist/client/assets/{combobox-Cx4FP7Bk.js → combobox-DixSlhgy.js} +2 -2
  111. package/dist/client/assets/{command-CVKxjYiJ.js → command-B45LRbFT.js} +2 -2
  112. package/dist/client/assets/{connect-DeTNO4tO.js → connect-CYM5DIkv.js} +2 -2
  113. package/dist/client/assets/{connect-agent-CTLxG7lp.js → connect-agent-nn3QLMb4.js} +2 -2
  114. package/dist/client/assets/corner-left-up-DohBMTTI.js +1 -0
  115. package/dist/client/assets/{cynefin-OW5HDTMX-C3y7gjYM.js → cynefin-OW5HDTMX-CmLjrFzm.js} +1 -1
  116. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-DEFegOUv.js → cynefinDiagram-5FMLGOSQ-xQBevUIj.js} +2 -2
  117. package/dist/client/assets/{dagre-GXQ25YYZ-C3YHw-ZL.js → dagre-GXQ25YYZ-Ck8BwJaT.js} +2 -2
  118. package/dist/client/assets/device-BRhRKysY.js +2 -0
  119. package/dist/client/assets/{diagram-S7CK7UJ4-B04fDyJ1.js → diagram-S7CK7UJ4-Bl0e661x.js} +2 -2
  120. package/dist/client/assets/{diagram-UQ7AKVKN-DJ5yQdqn.js → diagram-UQ7AKVKN-TO9a3uQI.js} +2 -2
  121. package/dist/client/assets/{diagram-VSXAHHWV-DwQn4LJH.js → diagram-VSXAHHWV-BZ7xQ8wz.js} +2 -2
  122. package/dist/client/assets/{diagram-VX7I27RA-BFeEJB2L.js → diagram-VX7I27RA-C4cA30qa.js} +2 -2
  123. package/dist/client/assets/{diagram-Z3DM3KII-DjNPPgna.js → diagram-Z3DM3KII-Hl3MmqeP.js} +2 -2
  124. package/dist/client/assets/{dialog-BBidAZq_.js → dialog-DhJeevKt.js} +2 -2
  125. package/dist/client/assets/{diffRendering-BcgWZBc6.js → diffRendering-QVeYVRDU.js} +2 -2
  126. package/dist/client/assets/{discovery-list-BOhsy2yk.js → discovery-list-VoilmsP7.js} +2 -2
  127. package/dist/client/assets/{dist-D-bAcBTo.js → dist-CxgL3edJ.js} +3 -3
  128. package/dist/client/assets/download-B587khDU.js +1 -0
  129. package/dist/client/assets/{draft-input-Dk-JXf0v.js → draft-input-BrEXLyuj.js} +2 -2
  130. package/dist/client/assets/{duoViewer-DELDCd_3.js → duoViewer-D-_bD3-L.js} +2 -2
  131. package/dist/client/assets/dynamic-R3OtJZHK.js +3 -0
  132. package/dist/client/assets/earth-26IFbzWm.js +1 -0
  133. package/dist/client/assets/{ebnfDiagram-PWID7BFC-R_zFp3Q4.js → ebnfDiagram-PWID7BFC-Bo_ALmgV.js} +2 -2
  134. package/dist/client/assets/ellipsis-BScTTB_n.js +1 -0
  135. package/dist/client/assets/{embeddedScripts-S6heIv6s.js → embeddedScripts-DKKE5k7D.js} +2 -2
  136. package/dist/client/assets/{empty-B3wHlMsI.js → empty-uoiaKPHo.js} +2 -2
  137. package/dist/client/assets/entities-DNKDCsf2.js +2 -0
  138. package/dist/client/assets/{erDiagram-RLTQ6QDP-DgSVOlTI.js → erDiagram-RLTQ6QDP-B38FLl2U.js} +2 -2
  139. package/dist/client/assets/eventmodeling-NTZA5JFV-6XFarcvj.js +1 -0
  140. package/dist/client/assets/eye-DTlv8Vet.js +1 -0
  141. package/dist/client/assets/file-search-gFHOfI6S.js +1 -0
  142. package/dist/client/assets/{fileLinks-M_i1pQMr.js → fileLinks-VfyxNu8P.js} +2 -2
  143. package/dist/client/assets/{fileTreeExpansion-BoH-LpwD.js → fileTreeExpansion-BfMZMaRV.js} +2 -2
  144. package/dist/client/assets/flowDiagram-HODETNUW-DQXavjl4.js +1 -0
  145. package/dist/client/assets/fold-vertical-BNQMJ6gu.js +1 -0
  146. package/dist/client/assets/folder-git-2-6ON-nxul.js +1 -0
  147. package/dist/client/assets/folder-open-Rja0vZjv.js +1 -0
  148. package/dist/client/assets/folder-plus-CfJ5c8wa.js +1 -0
  149. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CsDp8eOV.js → ganttDiagram-EL5Y4UJY-Cj0Kstgh.js} +2 -2
  150. package/dist/client/assets/{getDiffFileInput-y6l8uCrc.js → getDiffFileInput-XUe1xsym.js} +2 -2
  151. package/dist/client/assets/git-branch-BuWXMpmq.js +1 -0
  152. package/dist/client/assets/{gitGraph-4MIJSDKK-ByZ8Ddcu.js → gitGraph-4MIJSDKK-C84uaaYZ.js} +1 -1
  153. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-QkPoZOxP.js → gitGraphDiagram-WWUBYQGX-CvyimLfZ.js} +2 -2
  154. package/dist/client/assets/grip-vertical-qjSy6wXX.js +1 -0
  155. package/dist/client/assets/{guideRunStore-Ca6LGvkb.js → guideRunStore-DwmmS8D0.js} +2 -2
  156. package/dist/client/assets/hard-drive-DAxFba08.js +1 -0
  157. package/dist/client/assets/history-CrY611k2.js +1 -0
  158. package/dist/client/assets/house-CKS51Vx8.js +1 -0
  159. package/dist/client/assets/{htmlRender-Bs_dTcPz.js → htmlRender-DRfZ8nFp.js} +2 -2
  160. package/dist/client/assets/index-G0rP4C-v.js +3 -0
  161. package/dist/client/assets/{info-A6RAGUB7-DWgAQmsU.js → info-A6RAGUB7-AXJa674d.js} +1 -1
  162. package/dist/client/assets/{infoDiagram-27XIBGKW-DqBsTg-0.js → infoDiagram-27XIBGKW-CgaIIar7.js} +2 -2
  163. package/dist/client/assets/{input-group-13zF6rZl.js → input-group-DIOgVvbV.js} +2 -2
  164. package/dist/client/assets/{input-BOT1WFGI.js → input-u5qjnfMr.js} +2 -2
  165. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DhvmZSIn.js → ishikawaDiagram-5VMMS53U-DSDzMD_t.js} +2 -2
  166. package/dist/client/assets/{journeyDiagram-3NMN7TZE-sBAsW8ZW.js → journeyDiagram-3NMN7TZE-Be6o5a7O.js} +2 -2
  167. package/dist/client/assets/{kanban-definition-UXKFOSKX-7pB8050L.js → kanban-definition-UXKFOSKX-Fpr0ne16.js} +2 -2
  168. package/dist/client/assets/kbd-D4mDfHPa.js +2 -0
  169. package/dist/client/assets/{keybindings-B4uuYLfE.js → keybindings-CzL-fWkh.js} +2 -2
  170. package/dist/client/assets/keyboard-Y7zJXIRo.js +1 -0
  171. package/dist/client/assets/{lazyRouteComponent-C2UuNVTE.js → lazyRouteComponent-dLOOuQ-r.js} +2 -2
  172. package/dist/client/assets/{line-CYcVbD9r.js → line-BXhbrPh0.js} +2 -2
  173. package/dist/client/assets/link-CbhoiCa8.js +1 -0
  174. package/dist/client/assets/{link-DnyZixWB.js → link-YLDgrmSN.js} +2 -2
  175. package/dist/client/assets/{linkedPrompt-Cjzkkr18.js → linkedPrompt-E32o3H76.js} +2 -2
  176. package/dist/client/assets/list-Cq4wtMwR.js +1 -0
  177. package/dist/client/assets/main-D9nJEeym.css +2 -0
  178. package/dist/client/assets/main-D9z9rMK1.js +27 -0
  179. package/dist/client/assets/{mediaReference-DCRMHOD7.js → mediaReference-C-grVzJf.js} +2 -2
  180. package/dist/client/assets/{mediaSource-C-YyAgza.js → mediaSource-CxVHZYDj.js} +2 -2
  181. package/dist/client/assets/{mermaid-parser.core-CUhkd3Km.js → mermaid-parser.core-BFPy42Wg.js} +4 -4
  182. package/dist/client/assets/{mermaid.core-7L34oYGP.js → mermaid.core-zK2u82e-.js} +5 -5
  183. package/dist/client/assets/message-circle-question-mark-BwzHSg4C.js +1 -0
  184. package/dist/client/assets/message-square-DcSgYDZ6.js +1 -0
  185. package/dist/client/assets/message-square-dashed-Cu56tC0F.js +1 -0
  186. package/dist/client/assets/{mindmap-definition-YA3MSWOX-CpfzOIsM.js → mindmap-definition-YA3MSWOX-RzkTvFrT.js} +2 -2
  187. package/dist/client/assets/mouse-pointer-2-DxhF1Woc.js +1 -0
  188. package/dist/client/assets/number-field-BLz8W5SU.js +2 -0
  189. package/dist/client/assets/{observeResize-CK9qVTLF.js → observeResize-WQaFQjbx.js} +2 -2
  190. package/dist/client/assets/{onboarding-DWVdcMTo.js → onboarding-DNafmm6s.js} +2 -2
  191. package/dist/client/assets/{openFileInPreview-DsWLDsnf.js → openFileInPreview-l6IXWIxV.js} +2 -2
  192. package/dist/client/assets/{p4ProjectFile-DVeZFEli.js → p4ProjectFile-BzCYJ8I-.js} +2 -2
  193. package/dist/client/assets/{packet-AYTQ26CC-TJIgXg7Z.js → packet-AYTQ26CC-rDYSbNWh.js} +1 -1
  194. package/dist/client/assets/{pair-Ds7MhGzA.js → pair-nG9A6oxp.js} +2 -2
  195. package/dist/client/assets/palette-B79srcx1.js +1 -0
  196. package/dist/client/assets/panel-left-Bp59PK2R.js +1 -0
  197. package/dist/client/assets/{panel-tab-close-button-CeVf2Cp1.js → panel-tab-close-button-B2GW1bDy.js} +2 -2
  198. package/dist/client/assets/panels-top-left-CC3HCiIs.js +1 -0
  199. package/dist/client/assets/{pegDiagram-XKGWAZYB-BWjyJv0r.js → pegDiagram-XKGWAZYB-8wodyYDi.js} +2 -2
  200. package/dist/client/assets/{phoneViewer-4yzlTfRU.js → phoneViewer-Bei8FsYJ.js} +2 -2
  201. package/dist/client/assets/{pie-WAS4IAKB-DI1xrBNC.js → pie-WAS4IAKB-Ce0_zpeP.js} +1 -1
  202. package/dist/client/assets/{pieDiagram-E7YTZNPT-D5BJ4dMD.js → pieDiagram-E7YTZNPT-C3QJYWCY.js} +2 -2
  203. package/dist/client/assets/{pierre-icons-C4_Is1e6.js → pierre-icons-CsjmRq9p.js} +2 -2
  204. package/dist/client/assets/popover-6BYEGLLK.js +2 -0
  205. package/dist/client/assets/{preview-BXSjnvc2.js → preview-BpTu6A2K.js} +2 -2
  206. package/dist/client/assets/{preview-ChiUlq6M.js → preview-DFDpDpup.js} +2 -2
  207. package/dist/client/assets/{previewMiniPlayerStore-BWBB4WZZ.js → previewMiniPlayerStore-BfMwexwO.js} +2 -2
  208. package/dist/client/assets/primary-Cc8Am8Ju.js +2 -0
  209. package/dist/client/assets/primaryCloudLinkState-N7pLty-_.js +2 -0
  210. package/dist/client/assets/{projectFilesQueryState-DLmHVuBp.js → projectFilesQueryState-CrGsc81w.js} +2 -2
  211. package/dist/client/assets/projectScriptEditor-RR3KkKhh.js +2 -0
  212. package/dist/client/assets/{pullRequestDetail.logic-CiIqeGLs.js → pullRequestDetail.logic-CE7fVOsp.js} +4 -4
  213. package/dist/client/assets/{pullRequestReviewStore-Ckm9o--D.js → pullRequestReviewStore-BHEIYvsP.js} +2 -2
  214. package/dist/client/assets/pullRequests-KhjrMCa0.js +2 -0
  215. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-USH3mFeD.js → quadrantDiagram-AXDQQJYC-Cqx4Dcqi.js} +2 -2
  216. package/dist/client/assets/queries-Cn1FJB1_.js +2 -0
  217. package/dist/client/assets/{query-DG-FU00d.js → query-CK8MOmXr.js} +2 -2
  218. package/dist/client/assets/{radar-RG4KPBEZ-BgwqseQY.js → radar-RG4KPBEZ-DsccxBWq.js} +1 -1
  219. package/dist/client/assets/radio-group-CM6Ra-QS.js +2 -0
  220. package/dist/client/assets/{railroad-74A4TZTK-lU1hozFq.js → railroad-74A4TZTK-B-UN2mSQ.js} +1 -1
  221. package/dist/client/assets/railroad-abnf-HS5TGJTU-CIxA0Vp4.js +1 -0
  222. package/dist/client/assets/railroad-ebnf-LZEXJU2U-Czs81Kdn.js +1 -0
  223. package/dist/client/assets/railroad-peg-WCYAUIDC-B7O8OPsa.js +1 -0
  224. package/dist/client/assets/{railroadDiagram-O6MQD6OU-BX2DBjFX.js → railroadDiagram-O6MQD6OU-B_PdDy5r.js} +2 -2
  225. package/dist/client/assets/{renderScheduler-e5LS9_r8.js → renderScheduler-D1ml_j--.js} +2 -2
  226. package/dist/client/assets/{requirementDiagram-BXWQKSXE-Bp2BwkCA.js → requirementDiagram-BXWQKSXE-CKZ6HpQu.js} +2 -2
  227. package/dist/client/assets/{rightPanelStore-Dnc28mSJ.js → rightPanelStore-6LLb3GY0.js} +2 -2
  228. package/dist/client/assets/rotate-ccw-dcahmZQ2.js +1 -0
  229. package/dist/client/assets/rotate-cw-CIep6yNT.js +1 -0
  230. package/dist/client/assets/runtime-BVgeNXTV.js +2 -0
  231. package/dist/client/assets/runtime-CCr9UADV.js +6 -0
  232. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BklNNjEB.js → sankeyDiagram-P5KCCOFB-BLF-VPcj.js} +2 -2
  233. package/dist/client/assets/scheduledTasksSettings.logic-ozIaTRfT.js +3 -0
  234. package/dist/client/assets/{scroll-area-Cj3OF_L_.js → scroll-area-CsrtHuL8.js} +2 -2
  235. package/dist/client/assets/{select-BDMo6Fqt.js → select-BiARKKgd.js} +2 -2
  236. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-ufTHSg4p.js → sequenceDiagram-WJ2MYXX4-BpJGkNAx.js} +2 -2
  237. package/dist/client/assets/{server-DNo9AqHW.js → server-B26doYv6.js} +2 -2
  238. package/dist/client/assets/session-CQXL-cTI.js +2 -0
  239. package/dist/client/assets/session-logic-C0mrkZ0j.js +13 -0
  240. package/dist/client/assets/settings-2-C2dIdVBr.js +1 -0
  241. package/dist/client/assets/{settings-DxGY3RT5.js → settings-B5Dj0jhP.js} +2 -2
  242. package/dist/client/assets/settings-DiBtchmK.js +1 -0
  243. package/dist/client/assets/settings.appearance-Di8HZa2Q.js +2 -0
  244. package/dist/client/assets/settings.archived-By34XjbG.js +2 -0
  245. package/dist/client/assets/settings.computer-use-DuW-mXPO.js +2 -0
  246. package/dist/client/assets/settings.connections-BJuKrJhl.js +2 -0
  247. package/dist/client/assets/settings.decisions-BO8hfyYm.js +2 -0
  248. package/dist/client/assets/{settings.diagnostics-ByUhN_HC.js → settings.diagnostics-DSw1QN-I.js} +2 -2
  249. package/dist/client/assets/settings.general-RyWWgxqp.js +2 -0
  250. package/dist/client/assets/settings.integrations--N8SMmw7.js +2 -0
  251. package/dist/client/assets/{settings.keybindings-CITYXalz.js → settings.keybindings-BeQmUtKv.js} +2 -2
  252. package/dist/client/assets/{settings.open-source-licenses-CTznEYnQ.js → settings.open-source-licenses-BmgFSigO.js} +2 -2
  253. package/dist/client/assets/settings.projects--jLA2A5b.js +4 -0
  254. package/dist/client/assets/settings.providers-Cvt1-bmr.js +3 -0
  255. package/dist/client/assets/settings.scheduled-tasks-D5IG4nj_.js +2 -0
  256. package/dist/client/assets/settings.snap-shot-CUZNOX9M.js +2 -0
  257. package/dist/client/assets/{settings.source-control-BlHoYUC0.js → settings.source-control-R63Z9kEM.js} +2 -2
  258. package/dist/client/assets/{settings.storage-C4lRhJsq.js → settings.storage-J1kthey9.js} +2 -2
  259. package/dist/client/assets/settingsLayout-BzyY4qHt.js +3 -0
  260. package/dist/client/assets/shield-question-mark-l31p7uuJ.js +1 -0
  261. package/dist/client/assets/{sidebar-Bulbb3cX.js → sidebar-Dj0htG-5.js} +2 -2
  262. package/dist/client/assets/{sidebarProjectGrouping-DEvzxecx.js → sidebarProjectGrouping-DxzT7QCQ.js} +2 -2
  263. package/dist/client/assets/{skeleton-BFPHmDcq.js → skeleton-CtSxs1y1.js} +2 -2
  264. package/dist/client/assets/{sortable.esm-CHiRbsvI.js → sortable.esm-n8ce5zjO.js} +2 -2
  265. package/dist/client/assets/{sourceControl-DfhPxa0l.js → sourceControl-C3RSledt.js} +2 -2
  266. package/dist/client/assets/{spinner-rP6J82Of.js → spinner-BXr4m38K.js} +2 -2
  267. package/dist/client/assets/square-pen-CxvvUOOt.js +1 -0
  268. package/dist/client/assets/{standalone-page-BkHTM3MP.js → standalone-page-DSQDdNcR.js} +2 -2
  269. package/dist/client/assets/{stateDiagram-D77RDMKH-UnviM1_a.js → stateDiagram-D77RDMKH-DFGb4Fx3.js} +2 -2
  270. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-BFcRJjAO.js +2 -0
  271. package/dist/client/assets/{swimlanes-42K2YHIH-CpD6LDbC.js → swimlanes-42K2YHIH-D0z9osG6.js} +2 -2
  272. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-B7z2b1Qv.js +9 -0
  273. package/dist/client/assets/{terminalSessions-C9u_KQdo.js → terminalSessions-3aynRXX1.js} +2 -2
  274. package/dist/client/assets/text-search-DsadxNJw.js +1 -0
  275. package/dist/client/assets/{textarea-D7qN_9_U.js → textarea-DZLyhzuZ.js} +2 -2
  276. package/dist/client/assets/{themePalette-au2ZXbqB.js → themePalette-BZeqG2Hu.js} +3 -3
  277. package/dist/client/assets/threadSort-BvhI6zOp.js +2 -0
  278. package/dist/client/assets/{timeline-definition-24CTP7MA-CNy-4Mtq.js → timeline-definition-24CTP7MA-oHM5IS4i.js} +2 -2
  279. package/dist/client/assets/toast-Bm36EaG6.js +2 -0
  280. package/dist/client/assets/{toggle-4i71sOFB.js → toggle-BzIEPTf7.js} +2 -2
  281. package/dist/client/assets/{toggle-group-BtpeJU3C.js → toggle-group-_C7nJPTT.js} +2 -2
  282. package/dist/client/assets/tooltip-Df-4YKs5.js +2 -0
  283. package/dist/client/assets/{treeView-Q6P3EWNA-fz73DkUg.js → treeView-Q6P3EWNA-ONHv8oqx.js} +1 -1
  284. package/dist/client/assets/{treemap-WGGIJYW6-CHp0lk61.js → treemap-WGGIJYW6-Go2hwkyn.js} +1 -1
  285. package/dist/client/assets/unfold-vertical--twzQtvn.js +1 -0
  286. package/dist/client/assets/{usage-BoYlRHNx.js → usage-B26GT0RK.js} +2 -2
  287. package/dist/client/assets/{usageAccess-BmfDNhp2.js → usageAccess-BNLOTFbF.js} +2 -2
  288. package/dist/client/assets/{usageFormat-DdjdHqj5.js → usageFormat-DKCO_wk0.js} +2 -2
  289. package/dist/client/assets/{usageShortcuts-RpypNfqZ.js → usageShortcuts-DxLRXv0W.js} +2 -2
  290. package/dist/client/assets/{use-atom-command-Bc7LgQy1.js → use-atom-command-CiEeUGsC.js} +2 -2
  291. package/dist/client/assets/{useAriaLabelledBy-B_3SmrJo.js → useAriaLabelledBy-CJjXf8Fd.js} +2 -2
  292. package/dist/client/assets/useHandleNewThread-DTz3ztCG.js +2 -0
  293. package/dist/client/assets/{useLocation-DaTcl6iI.js → useLocation-9axGTsrg.js} +2 -2
  294. package/dist/client/assets/useNavigate-BK_XZ1It.js +2 -0
  295. package/dist/client/assets/{useNavigateBack-C43_t49N.js → useNavigateBack-AIHPN0Oo.js} +2 -2
  296. package/dist/client/assets/{useParams-s9hrFQQQ.js → useParams-CCV3vN4E.js} +2 -2
  297. package/dist/client/assets/{usePermissionStatus-CCpQkKk1.js → usePermissionStatus-BnBF7CdE.js} +2 -2
  298. package/dist/client/assets/usePullRequestActions-aKrHzIiJ.js +3 -0
  299. package/dist/client/assets/{useRegisterFieldControl-BVraoamc.js → useRegisterFieldControl-Daf1iBkI.js} +2 -2
  300. package/dist/client/assets/useScopedModelAvailability-IKTxpeQL.js +2 -0
  301. package/dist/client/assets/useSettings-CckatJFa.js +3 -0
  302. package/dist/client/assets/{useT3ConnectAuthPrompt-D3ARnr92.js → useT3ConnectAuthPrompt-CK8il-7e.js} +2 -2
  303. package/dist/client/assets/utils-DmS758az.js +37 -0
  304. package/dist/client/assets/vcsRefInvalidation-lkYjTxah.js +2 -0
  305. package/dist/client/assets/{vennDiagram-4TSXK5OY-BBpGz6rf.js → vennDiagram-4TSXK5OY-BwVRZPOj.js} +2 -2
  306. package/dist/client/assets/{wardley-WFR3VGLG-M4Al1qCV.js → wardley-WFR3VGLG-CYl4h3U-.js} +1 -1
  307. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-V-_mOkU8.js → wardleyDiagram-VM6X3IG4-yHMYVGhg.js} +2 -2
  308. package/dist/client/assets/{welcome-Bok5fRqT.js → welcome-CGBWwWzE.js} +2 -2
  309. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CZOR99Bj.js → xychartDiagram-S5SC5T6Z-Td7MQ_xN.js} +2 -2
  310. package/dist/client/index.html +1 -1
  311. package/package.json +1 -1
  312. package/dist/AcpMcpStdioBridge-Ch5bMyss.mjs +0 -4
  313. package/dist/client/assets/ChatGptUsageButton-GxPReM3u.js +0 -2
  314. package/dist/client/assets/ChatMarkdown-DOdrk8tK.js +0 -65
  315. package/dist/client/assets/CodexSetupSection.logic-BpefaM8S.js +0 -2
  316. package/dist/client/assets/DevicePanel-wE6eEt9P.js +0 -2
  317. package/dist/client/assets/DiffFileTree-D3P47wbG.js +0 -2
  318. package/dist/client/assets/DiffPanel-cvlTVhB4.js +0 -2
  319. package/dist/client/assets/ProjectDefaultsSettings-Cu80XFdb.js +0 -2
  320. package/dist/client/assets/ProjectIconPickerDialog-Dwmv78OH.js +0 -2
  321. package/dist/client/assets/ProviderModelPicker-riIGf-PI.js +0 -2
  322. package/dist/client/assets/ScheduledTasksSettings-Cp8h_lNS.js +0 -4
  323. package/dist/client/assets/ScopedSwitch-CLAFXjj6.js +0 -2
  324. package/dist/client/assets/ThemeEditorPanel-BBkly3jP.js +0 -5
  325. package/dist/client/assets/WorkspaceBreadcrumb-fx0ZD7ay.js +0 -2
  326. package/dist/client/assets/WorkspacePageContainer-DFsaHi02.js +0 -2
  327. package/dist/client/assets/_chat-BerxDjpp.js +0 -58
  328. package/dist/client/assets/_chat.pull-requests-BwpBKnt3.js +0 -2
  329. package/dist/client/assets/app-window-CVIo0C1R.js +0 -2
  330. package/dist/client/assets/architecture-7GRP2DOG-CT4QCEL3.js +0 -1
  331. package/dist/client/assets/arrow-left-BiKrB-pT.js +0 -1
  332. package/dist/client/assets/arrow-right-DWAwZU0q.js +0 -1
  333. package/dist/client/assets/arrow-up-down-CfYH5v22.js +0 -1
  334. package/dist/client/assets/assets-DwywdbuJ.js +0 -2
  335. package/dist/client/assets/bell-C3RUvq1T.js +0 -1
  336. package/dist/client/assets/blocks-CoLUV11Q.js +0 -1
  337. package/dist/client/assets/bot-CjcO3F5G.js +0 -1
  338. package/dist/client/assets/brain-B_3rxsLd.js +0 -2
  339. package/dist/client/assets/calendar-clock-CJyS1C-x.js +0 -1
  340. package/dist/client/assets/channel-kQEwHVv9.js +0 -2
  341. package/dist/client/assets/chart-no-axes-column-B3ZqbY05.js +0 -1
  342. package/dist/client/assets/checkbox-Cw_SXlJ5.js +0 -2
  343. package/dist/client/assets/chromium-CvI58Z0o.js +0 -2
  344. package/dist/client/assets/classDiagram-ZZMXUADV-BO_GIPO1.js +0 -2
  345. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BO_GIPO1.js +0 -2
  346. package/dist/client/assets/corner-left-up-D653FjvK.js +0 -1
  347. package/dist/client/assets/device-DrIICsXu.js +0 -2
  348. package/dist/client/assets/download-CNXPbBhc.js +0 -1
  349. package/dist/client/assets/dynamic-BRlOHH6g.js +0 -3
  350. package/dist/client/assets/earth-C1f0Qxwi.js +0 -1
  351. package/dist/client/assets/ellipsis-0J7zX441.js +0 -1
  352. package/dist/client/assets/entities-yblphBg3.js +0 -2
  353. package/dist/client/assets/eventmodeling-NTZA5JFV-bjJqzJYE.js +0 -1
  354. package/dist/client/assets/eye-CmsLgU-5.js +0 -1
  355. package/dist/client/assets/file-search-ClaIV60V.js +0 -1
  356. package/dist/client/assets/flowDiagram-HODETNUW-CsPXFMK4.js +0 -1
  357. package/dist/client/assets/fold-vertical-BMLbHh0a.js +0 -2
  358. package/dist/client/assets/folder-git-2-BxqGR5ht.js +0 -2
  359. package/dist/client/assets/folder-open-gQZmKQ4n.js +0 -1
  360. package/dist/client/assets/folder-plus-BVmedEeH.js +0 -1
  361. package/dist/client/assets/git-branch-Ba9jLbPu.js +0 -1
  362. package/dist/client/assets/grip-vertical-BmIJSASv.js +0 -1
  363. package/dist/client/assets/hard-drive-hWUfbbG9.js +0 -1
  364. package/dist/client/assets/history-jvN7Bdkc.js +0 -1
  365. package/dist/client/assets/house-ozmwce4p.js +0 -1
  366. package/dist/client/assets/index-FZqrCEhr.js +0 -3
  367. package/dist/client/assets/kbd-BR8-VeaN.js +0 -2
  368. package/dist/client/assets/keyboard-_YjrW4PX.js +0 -1
  369. package/dist/client/assets/link-BcMcYjHb.js +0 -1
  370. package/dist/client/assets/list-DEjg_Q5H.js +0 -1
  371. package/dist/client/assets/main-BQLZB-ZD.css +0 -2
  372. package/dist/client/assets/main-Ch0n0whg.js +0 -26
  373. package/dist/client/assets/message-circle-question-mark-DzWFFMDp.js +0 -1
  374. package/dist/client/assets/message-square-BqGKFtP8.js +0 -1
  375. package/dist/client/assets/message-square-dashed-FPkUUYSB.js +0 -1
  376. package/dist/client/assets/mouse-pointer-2-DbBU41il.js +0 -2
  377. package/dist/client/assets/number-field-DsVu9T6C.js +0 -2
  378. package/dist/client/assets/palette-JCVMAFVd.js +0 -1
  379. package/dist/client/assets/panel-left-STqObAvQ.js +0 -1
  380. package/dist/client/assets/panels-top-left-B90U_rdS.js +0 -1
  381. package/dist/client/assets/popover-UOfX8iZ4.js +0 -2
  382. package/dist/client/assets/primary-BubJSDIO.js +0 -2
  383. package/dist/client/assets/primaryCloudLinkState-CFnZkCiA.js +0 -2
  384. package/dist/client/assets/projectScriptEditor-_TwHfcHY.js +0 -2
  385. package/dist/client/assets/pullRequests-C0Gr2876.js +0 -2
  386. package/dist/client/assets/queries-DbiotSzd.js +0 -2
  387. package/dist/client/assets/radio-group-DhxCP5q0.js +0 -2
  388. package/dist/client/assets/railroad-abnf-HS5TGJTU-DRzBu_EH.js +0 -1
  389. package/dist/client/assets/railroad-ebnf-LZEXJU2U-BuQh-rCG.js +0 -1
  390. package/dist/client/assets/railroad-peg-WCYAUIDC-DH1f3-__.js +0 -1
  391. package/dist/client/assets/rotate-ccw-98iN1bsB.js +0 -1
  392. package/dist/client/assets/rotate-cw-DdW3sRx4.js +0 -1
  393. package/dist/client/assets/runtime-BUB2ex14.js +0 -2
  394. package/dist/client/assets/runtime-BoEmkhOe.js +0 -6
  395. package/dist/client/assets/scheduledTasksSettings.logic-Bk1lq8Ri.js +0 -3
  396. package/dist/client/assets/session-CyPECDtf.js +0 -2
  397. package/dist/client/assets/session-logic-BBZj8pNB.js +0 -13
  398. package/dist/client/assets/settings-2-C-KVP40_.js +0 -1
  399. package/dist/client/assets/settings-D62zpRkD.js +0 -1
  400. package/dist/client/assets/settings.appearance-C-MzWdtB.js +0 -2
  401. package/dist/client/assets/settings.archived-BZ0wU-2j.js +0 -2
  402. package/dist/client/assets/settings.connections-B-h_wi7q.js +0 -2
  403. package/dist/client/assets/settings.general-DodDmaXX.js +0 -2
  404. package/dist/client/assets/settings.integrations-Dq9yt9c-.js +0 -2
  405. package/dist/client/assets/settings.projects-Bj9oI9dE.js +0 -4
  406. package/dist/client/assets/settings.providers-BPb4TbH8.js +0 -3
  407. package/dist/client/assets/settings.scheduled-tasks-TxnTVd7r.js +0 -2
  408. package/dist/client/assets/settings.snap-shot-DZaxUAEE.js +0 -2
  409. package/dist/client/assets/settingsLayout-De_r3pyr.js +0 -3
  410. package/dist/client/assets/shield-question-mark-B5w7j5aC.js +0 -1
  411. package/dist/client/assets/square-pen-DYBPSam-.js +0 -1
  412. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CJW4DyfF.js +0 -2
  413. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Buz7ig8b.js +0 -9
  414. package/dist/client/assets/text-search-DrO_MCzY.js +0 -1
  415. package/dist/client/assets/threadSort-R2JvSO3D.js +0 -2
  416. package/dist/client/assets/toast-CIGvRti2.js +0 -2
  417. package/dist/client/assets/tooltip-Ciaezkl4.js +0 -2
  418. package/dist/client/assets/unfold-vertical-BLnEY4R7.js +0 -2
  419. package/dist/client/assets/useHandleNewThread-Csguf2GC.js +0 -2
  420. package/dist/client/assets/useNavigate-CnhAAl0Z.js +0 -2
  421. package/dist/client/assets/usePullRequestActions-CiF7znkV.js +0 -3
  422. package/dist/client/assets/useScopedModelAvailability-kFNRNx2C.js +0 -2
  423. package/dist/client/assets/useSettings-CNd8OM7A.js +0 -3
  424. package/dist/client/assets/utils-geC9CGP4.js +0 -37
  425. package/dist/client/assets/vcsRefInvalidation-DMpp-BNA.js +0 -2
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Al as n,Bt as r,Cb as i,Ft as a,Mt as o,Pt as s,Sx as c,Tb as l,Un as u,Vt as d,Wb as f,kl as p,ma as m,or as h,qt as g,sr as _,t as v,tn as y,vl as b,xs as x}from"./utils-geC9CGP4.js";import{t as S}from"./chevron-down-DHV04o66.js";import{t as C}from"./external-link-NWS0I_zo.js";import{t as w}from"./eye-off-BJFC-Vn7.js";import{a as T,n as E,t as D}from"./tooltip-Ciaezkl4.js";import{a as O,i as k,n as A,r as j,t as M}from"./number-field-DsVu9T6C.js";import{a as N,c as P,o as F,s as ee,t as te}from"./select-BDMo6Fqt.js";import{t as ne}from"./useNavigate-CnhAAl0Z.js";import{i as re}from"./toast-CIGvRti2.js";import{F as ie,I as ae,N as oe,P as se,f as ce,z as le}from"./useSettings-CNd8OM7A.js";import{f as ue,t as de}from"./server-DNo9AqHW.js";import{n as fe}from"./query-DG-FU00d.js";import{t as pe}from"./use-atom-command-Bc7LgQy1.js";import{t as I}from"./skeleton-BFPHmDcq.js";import{t as me}from"./textarea-D7qN_9_U.js";import{t as he}from"./input-BOT1WFGI.js";import{a as ge,i as _e,n as ve,o as L,r as ye,t as be}from"./empty-B3wHlMsI.js";import{n as xe,t as R}from"./collapsible-CLujF6F7.js";import{t as Se}from"./sourceControl-DfhPxa0l.js";import{g as Ce,m as we}from"./Icons-BlUgSxml.js";import{o as Te,s as z}from"./threadSort-R2JvSO3D.js";import{n as B}from"./pullRequestIcons-BWiN_14V.js";import{I as Ee,N as De,P as Oe,a as V,f as ke,i as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe,z as Ie}from"./settingsLayout-De_r3pyr.js";import{Pa as H,ko as Le,ln as Re,or as U,sr as ze,wa as Be,xn as Ve}from"./main-Ch0n0whg.js";import{n as He,t as Ue}from"./RedactedSensitiveText-D5aX1wQs.js";import{t as We}from"./ProviderModelPicker-riIGf-PI.js";import{t as Ge}from"./useScopedModelAvailability-kFNRNx2C.js";import{t as Ke}from"./ProjectDefaultsSettings-Cu80XFdb.js";import{r as qe,t as Je}from"./ProviderSettingsForm-Dh_vspcE.js";var W=c(),G=e(t(),1),K=e(m(),1);function Ye({environmentId:e,definition:t,onSaved:n}){let r=ce(e,e=>e.sourceControlHosts[t.kind]),i=pe(ue.updateSettings,{label:`save ${t.label} settings`}),[a,o]=(0,G.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,K.jsxs)(`fieldset`,{disabled:a,className:`contents`,children:[(0,K.jsx)(Je,{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,K.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,K.jsx)(h,{size:`xs`,variant:`outline`,onClick:()=>void l(Object.fromEntries(Object.keys(r??{}).map(e=>[e,``]))),children:`Remove`})}):null]})}function Xe(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 Ze(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 q=`active gh account`;function J(e){let t=(0,W.c)(4),n;return t[0]!==e.account||t[1]!==e.label||t[2]!==e.revealed?(n=e.revealed?(0,K.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:e.account}):(0,K.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:[(0,K.jsx)(`span`,{className:`select-none blur-xs`,"aria-hidden":!0,children:He(e.account)}),(0,K.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 Qe({environmentId:e,auth:t,onSaved:n}){let r=ce(e,Te).hosts,i=pe(ue.updateSettings,{label:`save GitHub account settings`}),[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(!1),l=Xe(t.accounts??[]),u=async(t,a)=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{github:{hosts:Ze(r,t,a)}}}}}))._tag===`Success`&&n()}finally{o(!1)}};return l.length===0?(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Sign in with `,(0,K.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,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,K.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,K.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,K.jsx)(w,{}):(0,K.jsx)(Le,{})})]}),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:q;return(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.host}),e.selectable.length===1&&e.selectable[0]!==void 0?(0,K.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,K.jsx)(`span`,{children:`Signed in as`}),(0,K.jsx)(J,{revealed:s,account:e.selectable[0]})]}):null]}),(0,K.jsx)(Be,{checked:n,disabled:a,"aria-label":`Use GitHub on ${e.host}`,onCheckedChange:t=>void u(e.host,{enabled:t})})]}),e.selectable.length>1?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Account`}),(0,K.jsx)(`div`,{className:`w-64 max-w-full`,children:(0,K.jsxs)(te,{value:o,disabled:a||!n,onValueChange:t=>{typeof t==`string`&&u(e.host,{account:t===q?null:t})},children:[(0,K.jsx)(ee,{size:`sm`,"aria-label":`GitHub account for ${e.host}`,children:(0,K.jsx)(P,{children:t=>t===q?(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,K.jsxs)(K.Fragment,{children:[`(`,(0,K.jsx)(J,{revealed:s,account:e.activeAccount}),`)`]}):null]}):(0,K.jsx)(J,{revealed:s,account:t})})}),(0,K.jsxs)(F,{align:`end`,alignItemWithTrigger:!1,children:[(0,K.jsx)(N,{value:q,children:(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,K.jsxs)(K.Fragment,{children:[`(`,(0,K.jsx)(J,{revealed:s,account:e.activeAccount}),`)`]}):null]})}),e.selectable.map((e,t)=>(0,K.jsx)(N,{value:e,children:(0,K.jsx)(J,{revealed:s,account:e,label:`Account ${t+1}`})},e))]})]})})]}):null,i?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`p`,{className:`text-xs text-warning`,children:`The chosen login is no longer signed in, so the active gh login is used.`}),(0,K.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,K.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground/70`,children:[(0,K.jsx)(J,{revealed:s,account:e.account}),(0,K.jsxs)(`span`,{children:[`can't be used: `,e.error??`gh reports this login as invalid.`]})]},e.account)),e.environmentVariable?(0,K.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 Y=`github.com`;function $e(e){return`https://${e}/settings/personal-access-tokens/new`}function et({environmentId:e,onSaved:t}){let{tokens:n}=ce(e,Te),r=pe(ue.updateSettings,{label:`save GitHub token`}),[i,a]=(0,G.useState)(Y),[o,s]=(0,G.useState)(``),[c,l]=(0,G.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,K.jsx)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),u&&o.trim()&&p(u,o.trim())},children:(0,K.jsxs)(`fieldset`,{disabled:c,className:`contents`,children:[(0,K.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`A token saved here is used before`,` `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`GH_TOKEN`}),` and the`,` `,(0,K.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,K.jsxs)(_,{render:(0,K.jsx)(`a`,{href:$e(u||Y),target:`_blank`,rel:`noreferrer noopener`}),children:[`Create a token`,(0,K.jsx)(C,{"aria-hidden":!0,className:`size-3`})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[12rem_1fr]`,children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(Re,{htmlFor:`github-token-host-${e}`,children:`Host`}),(0,K.jsx)(he,{id:`github-token-host-${e}`,autoComplete:`off`,size:`sm`,placeholder:Y,value:i,onChange:e=>a(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(Re,{htmlFor:`github-token-${e}`,children:`Token`}),(0,K.jsx)(qe,{id:`github-token-${e}`,size:`sm`,configured:d,value:o,onChange:e=>s(e.target.value)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.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,K.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[d?(0,K.jsx)(h,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void p(u,``),children:`Remove`}):null,(0,K.jsx)(h,{type:`submit`,size:`xs`,disabled:!u||!o.trim()||c,children:`Save`})]})]})]})})}var X={static:`Static prefix`,semantic:`Semantic prefix`,custom:`Custom instructions`};function tt(){let e=(0,W.c)(40),t=De(),{targets:n}=Ie(),r;e[0]===n?r=e[1]:(r=n.map(it).join(`,`),e[0]=n,e[1]=r);let i=r,a=(0,G.useRef)(!1),o=(0,G.useRef)(!1),s=Ee(),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`branchNamingMode`],e[2]=c):c=e[2];let l=Oe(c),u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=[`branchNamePrefix`],e[3]=u):u=e[3];let d=Oe(u),f;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=[`branchNameInstructions`],e[4]=f):f=e[4];let m=Oe(f),h,g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=[`branchNamingMode`],g=U(`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,v;e[7]!==l||e[8]!==t.branchNamingMode||e[9]!==s?(v=t.branchNamingMode!==p.branchNamingMode||l?(0,K.jsx)(Ne,{label:`branch naming`,onClick:()=>s({branchNamingMode:p.branchNamingMode})}):null,e[7]=l,e[8]=t.branchNamingMode,e[9]=s,e[10]=v):v=e[10];let y=l?null:t.branchNamingMode,x;e[11]===s?x=e[12]:(x=e=>{b.literals.includes(e)&&s({branchNamingMode:e})},e[11]=s,e[12]=x);let S;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,K.jsx)(ee,{size:`sm`,"aria-label":`Worktree branch naming`,children:(0,K.jsx)(P,{children:rt})}),e[13]=S):S=e[13];let C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(F,{align:`end`,alignItemWithTrigger:!1,children:b.literals.map(nt)}),e[14]=C):C=e[14];let w;e[15]!==y||e[16]!==x?(w=(0,K.jsxs)(te,{value:y,onValueChange:x,children:[S,C]}),e[15]=y,e[16]=x,e[17]=w):w=e[17];let T;e[18]!==w||e[19]!==_||e[20]!==v?(T=(0,K.jsx)(V,{serverScoped:!0,settingKeys:h,...g,description:`Choose how new worktree branches are named from your first message.`,status:_,resetAction:v,control:w}),e[18]=w,e[19]=_,e[20]=v,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,K.jsx)(V,{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!==p.branchNamePrefix?(0,K.jsx)(Ne,{label:`branch prefix`,onClick:()=>s({branchNamePrefix:p.branchNamePrefix})}):null,control:(0,K.jsx)(he,{"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,K.jsx)(V,{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,K.jsx)(Ne,{label:`branch naming instructions`,onClick:()=>s({branchNameInstructions:``})}):null,children:(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,K.jsx)(me,{"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,K.jsxs)(K.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,K.jsx)(N,{value:e,children:X[e]},e)}function rt(e){return e===null?`Mixed`:X[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,W.c)(80),t=De(),i=Ee(),c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`reviewGuidesEnabled`],e[0]=c):c=e[0];let l=Oe(c),u=ne(),{environment:f,connectedEnvironments:p,targets:m,target:_}=Ie(),v=f?.environmentId??null,b=p.length>0,S=f?.serverConfig?.providers??de,C;e[1]===m?C=e[2]:(C=e=>{let t=m[0];return t!==void 0&&m.some(n=>n.settings.sourceControlWritingStyle[e]!==t.settings.sourceControlWritingStyle[e])},e[1]=m,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,M;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=[`sourceControlWriterModelSelection`],e[9]=M):M=e[9];let N=Oe(M),ie;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(ie=[`reviewGuideModelSelection`],e[10]=ie):ie=e[10];let ae=Oe(ie),ce;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(ce=[`reviewGuideInstructions`],e[11]=ce):ce=e[11];let le=Oe(ce),ue=(0,G.useRef)(!1),fe;e[12]===m?fe=e[13]:(fe=m.map(mt).join(`,`),e[12]=m,e[13]=fe);let pe=fe,I=(0,G.useRef)(null),[he,ge]=(0,G.useState)(!1),[_e,ve]=(0,G.useState)(null),L=t.sourceControlWritingStyle,ye=n.sourceControlWritingStyle,be=j||L.mode!==ye.mode||L.customInstructions!==ye.customInstructions,xe=S.filter(pt),R=g(r(d(xe),t,_?.projectId??null)),Se=new Set(R.filter(ft).map(dt)),Ce=xe.filter(e=>Se.has(e.instanceId)),we=s(t,Ce),Te=t.sourceControlWriterModelSelection!==null,z=s({...t,textGenerationModelSelection:se(t,Ce,_?.projectId??null)},Ce),B=R.some(e=>e.instanceId===we.instanceId&&e.enabled&&e.isAvailable),ke=o(t,Ce,z.instanceId,z.model),Ae=Ge(t,R),Me=R.find(e=>e.instanceId===z.instanceId),Fe=t.reviewGuideModelSelection!==null,H=s({...t,textGenerationModelSelection:oe(t,xe,_?.projectId??null)},xe),Le=o(t,xe,H.instanceId,H.model),Re=R.find(e=>e.instanceId===H.instanceId),ze=Pe,Ve;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,K.jsx)(tt,{}),e[14]=Ve):Ve=e[14];let He;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(He=[`sourceControlWritingStyle`],e[15]=He):He=e[15];let Ue;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=U(`source-control-writing-style`),e[16]=Ue):Ue=e[16];let Ke=at[L.mode],qe;e[17]!==be||e[18]!==i?(qe=be?(0,K.jsx)(Ne,{label:`source control writing style`,onClick:()=>i({sourceControlWritingStyle:{mode:ye.mode,customInstructions:ye.customInstructions}})}):null,e[17]=be,e[18]=i,e[19]=qe):qe=e[19];let Je=E?null:L.mode,Ye;e[20]===i?Ye=e[21]:(Ye=e=>{let t=I.current?.value.trim();i({sourceControlWritingStyle:{mode:e,...t===void 0?{}:{customInstructions:t}}})},e[20]=i,e[21]=Ye);let Xe;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,K.jsx)(ee,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Source control writing style`,children:(0,K.jsx)(P,{children:ut})}),e[22]=Xe):Xe=e[22];let Ze;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=Object.keys(at),e[23]=Ze):Ze=e[23];let q;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,K.jsx)(F,{align:`end`,alignItemWithTrigger:!1,children:Ze.map(lt)}),e[24]=q):q=e[24];let J;e[25]!==Je||e[26]!==Ye?(J=(0,K.jsxs)(te,{value:Je,onValueChange:Ye,children:[Xe,q]}),e[25]=Je,e[26]=Ye,e[27]=J):J=e[27];let Qe;e[28]!==_e||e[29]!==he||e[30]!==L.customInstructions||e[31]!==L.mode||e[32]!==i||e[33]!==j?(Qe=j?(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl space-y-2 pb-3.5`,children:he?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(me,{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,K.jsx)(h,{size:`sm`,variant:`outline`,disabled:_e===null,onClick:()=>{_e!==null&&(i({sourceControlWritingStyle:{mode:`custom`,customInstructions:_e.trim()}}),ge(!1))},children:`Apply instructions to all`})]}):(0,K.jsx)(h,{size:`sm`,variant:`outline`,onClick:()=>{ve(null),ge(!0)},children:`Write custom instructions for all`})}):L.mode===`custom`?(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,K.jsx)(me,{ref:I,defaultValue:L.customInstructions,onBlur:e=>{let t=e.target.value.trim();t!==L.customInstructions&&i({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]=he,e[30]=L.customInstructions,e[31]=L.mode,e[32]=i,e[33]=j,e[34]=Qe):Qe=e[34];let Y;e[35]!==Ke.description||e[36]!==qe||e[37]!==J||e[38]!==Qe||e[39]!==j?(Y=(0,K.jsx)(V,{serverScoped:!0,settingKeys:He,mixed:j,...Ue,description:Ke.description,resetAction:qe,control:J,children:Qe}),e[35]=Ke.description,e[36]=qe,e[37]=J,e[38]=Qe,e[39]=j,e[40]=Y):Y=e[40];let $e;e[41]===Symbol.for(`react.memo_cache_sentinel`)?($e=[`sourceControlWritingStyle`],e[41]=$e):$e=e[41];let et;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(et=U(`follow-change-request-templates`),e[42]=et):et=e[42];let X;e[43]!==L.followChangeRequestTemplates||e[44]!==A||e[45]!==i?(X=A||L.followChangeRequestTemplates!==ye.followChangeRequestTemplates?(0,K.jsx)(Ne,{label:`change request templates`,onClick:()=>i({sourceControlWritingStyle:{followChangeRequestTemplates:ye.followChangeRequestTemplates}})}):null,e[43]=L.followChangeRequestTemplates,e[44]=A,e[45]=i,e[46]=X):X=e[46];let nt=!A&&L.followChangeRequestTemplates,rt;e[47]===i?rt=e[48]:(rt=e=>i({sourceControlWritingStyle:{followChangeRequestTemplates:!!e}}),e[47]=i,e[48]=rt);let it;e[49]!==nt||e[50]!==rt||e[51]!==A?(it=(0,K.jsx)(Be,{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]!==X||e[54]!==it||e[55]!==A?(ot=(0,K.jsx)(V,{serverScoped:!0,settingKeys:$e,mixed:A,...et,description:`Use the repository's template for change request descriptions when available.`,resetAction:X,control:it}),e[53]=X,e[54]=it,e[55]=A,e[56]=ot):ot=e[56];let ht,gt;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(ht=[`sourceControlWriterModelSelection`],gt=U(`source-control-writer-model`),e[57]=ht,e[58]=gt):(ht=e[57],gt=e[58]);let _t=b?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[Te&&!B?(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No text generation providers available.`}):null,Te&&B?(0,K.jsx)(We,{environmentId:v,activeInstanceId:z.instanceId,model:z.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:ke,triggerClassName:je,triggerAriaLabel:`Source control writer model`,...N?{triggerLabel:`Mixed`}:{},...v?{onOpenProviderSetup:e=>{u({to:`/settings/providers`,search:{environmentId:v,instanceId:e}})}}:{},getModelDisabledReason:Ae,onInstanceModelChange:(e,t)=>{let n=Ae(e,t);if(n){re.add({type:`error`,title:`Source control writer model not saved`,description:n});return}i({sourceControlWriterModelSelection:x(e,t)})}}):null,Te&&B&&!N&&Me?(0,K.jsx)(y,{provider:Me.driverKind,models:Me.models,model:z.model,prompt:``,onPromptChange:ct,modelOptions:z.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||a(z.options),triggerClassName:je,onModelOptionsChange:e=>i({sourceControlWriterModelSelection:x(z.instanceId,z.model,e)})}):null,(0,K.jsx)(Be,{checked:Te,disabled:!Te&&!B,onCheckedChange:e=>i({sourceControlWriterModelSelection:e?x(we.instanceId,we.model,we.options):null}),"aria-label":`Use a separate source control writer model`})]}):(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its source control writer model.`}),vt;e[59]===_t?vt=e[60]:(vt=(0,K.jsx)(V,{serverScoped:!0,settingKeys:ht,...gt,description:`Model for source control text and branch or bookmark names. Off uses the environment's text generation model.`,control:_t}),e[59]=_t,e[60]=vt);let yt;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(yt=[`reviewGuidesEnabled`],e[61]=yt):yt=e[61];let bt;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(bt=U(`review-guides`),e[62]=bt):bt=e[62];let xt=!l&&t.reviewGuidesEnabled,Z;e[63]===i?Z=e[64]:(Z=e=>i({reviewGuidesEnabled:!!e}),e[63]=i,e[64]=Z);let Q;e[65]!==l||e[66]!==xt||e[67]!==Z?(Q=(0,K.jsx)(Be,{mixed:l,checked:xt,onCheckedChange:Z,"aria-label":`Review guides`}),e[65]=l,e[66]=xt,e[67]=Z,e[68]=Q):Q=e[68];let $;e[69]!==l||e[70]!==Q?($=(0,K.jsx)(V,{serverScoped:!0,settingKeys:yt,mixed:l,...bt,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]=l,e[70]=Q,e[71]=$):$=e[71];let St=t.reviewGuidesEnabled||l?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(V,{serverScoped:!0,settingKeys:[`reviewGuideModelSelection`],...U(`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:b?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(Fe||ae)&&B?(0,K.jsx)(We,{environmentId:v,activeInstanceId:H.instanceId,model:H.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:Le,triggerClassName:je,triggerAriaLabel:`Review guide model`,...ae?{triggerLabel:`Mixed`}:{},getModelDisabledReason:Ae,onInstanceModelChange:(e,t)=>{let n=Ae(e,t);if(n){re.add({type:`error`,title:`Review guide model not saved`,description:n});return}i({reviewGuideModelSelection:x(e,t)})}}):null,Fe&&B&&!ae&&Re?(0,K.jsx)(y,{provider:Re.driverKind,models:Re.models,model:H.model,prompt:``,onPromptChange:st,modelOptions:H.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||a(H.options),triggerClassName:je,onModelOptionsChange:e=>i({reviewGuideModelSelection:x(H.instanceId,H.model,e)})}):null,(0,K.jsx)(Be,{mixed:ae,checked:!ae&&Fe,disabled:!Fe&&!B,onCheckedChange:e=>{if(!e){i({reviewGuideModelSelection:null});return}let t=Ae(z.instanceId,z.model);if(t){re.add({type:`error`,title:`Review guide model not saved`,description:t});return}i({reviewGuideModelSelection:x(z.instanceId,z.model,z.options)})},"aria-label":`Use a separate review guide model`})]}):(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its review guide model.`})}),(0,K.jsx)(V,{serverScoped:!0,settingKeys:[`reviewGuideInstructions`],...U(`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:le||t.reviewGuideInstructions!==``?(0,K.jsx)(Ne,{label:`review guide instructions`,onClick:()=>i({reviewGuideInstructions:``})}):null,children:(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,K.jsx)(me,{"aria-label":`Review guide instructions`,onChange:()=>{ue.current=!0},rows:4,defaultValue:le?``:t.reviewGuideInstructions,placeholder:le?`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 n=e.target.value.trim();ue.current&&(le||n!==t.reviewGuideInstructions)&&i({reviewGuideInstructions:n}),ue.current=!1}},`${pe}:${le}:${t.reviewGuideInstructions}`)})})]}):null,Ct;return e[72]!==ze||e[73]!==Ve||e[74]!==Y||e[75]!==ot||e[76]!==vt||e[77]!==$||e[78]!==St?(Ct=(0,K.jsxs)(ze,{id:`source-control-text-generation`,title:`Text generation`,children:[Ve,Y,ot,vt,$,St]}),e[72]=ze,e[73]=Ve,e[74]=Y,e[75]=ot,e[76]=vt,e[77]=$,e[78]=St,e[79]=Ct):Ct=e[79],Ct}function st(){}function ct(){}function lt(e){return(0,K.jsx)(N,{hideIndicator:!0,value:e,children:at[e].label},e)}function ut(e){return e===null?`Mixed`:at[e].label}function dt(e){return e.instanceId}function ft(e){return e.enabled&&e.isAvailable}function pt(e){return e.supportsTextGeneration!==!1}function mt(e){return`${e.environmentId}:${e.projectId}`}var ht={versionControlSystems:[],sourceControlProviders:[]},gt={git:we,jj:Ce},_t=[`primary`,`secondary`],vt=5;function yt(e){return Math.round(l(e)/1e3)}function bt(e){return e===null||!Number.isFinite(e)?0:Math.max(0,Math.round(e))}function xt(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:ie(e),overrides:n}}}function Z(e){return f(e)}function Q(e){return`auth`in e}function $(e){return!Q(e)&&!e.implemented}function St(e){return e.status===`authenticated`?{label:`Authenticated`,badge:null}:e.status===`unauthenticated`?{label:`Not authenticated`,badge:`warning`}:{label:`Status unknown`,badge:null}}function Ct(e){let t=(0,W.c)(2),n;return t[0]===e.account?n=t[1]:(n=(0,K.jsx)(Ue,{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 wt(e){return $(e)?`bg-muted-foreground/35`:e.status!==`available`||Q(e)&&e.auth.status!==`authenticated`?`bg-warning`:`bg-success`}function Tt(e){let t=(0,W.c)(13),{item:n}=e,r,i,a,o;if(t[0]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=wt(n),s=Q(n)?z.find(n.kind):void 0,c=Q(n)?s&&Ve(s):gt[n.kind];if(!c){o=(0,K.jsx)(`span`,{className:v(`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,K.jsx)(c,{className:`size-4.5 text-foreground/80`,"aria-hidden":!0}),t[5]=c,t[6]=a),r=v(`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,K.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,K.jsxs)(`span`,{className:i,children:[a,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function Et({item:e,auth:t,authAccount:n}){if($(e))return(0,K.jsxs)(`span`,{children:[`Support for `,e.label,` is coming soon.`]});if(e.status!==`available`)return(0,K.jsxs)(`span`,{children:[`Not available on this server: `,e.installHint]});if(t){if(t.status===`authenticated`){let e=Z(t.detail);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{children:`Authenticated`}),n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":!0,children:`as`}),(0,K.jsx)(Ct,{account:n})]}):null,e?(0,K.jsxs)(`span`,{children:[`· `,e]}):null]})}if(!e.executable&&t.status===`unauthenticated`)return(0,K.jsxs)(`span`,{children:[`Available. `,e.installHint]});if(t.status===`unauthenticated`&&t.accounts?.some(e=>e.authenticated))return(0,K.jsx)(`span`,{children:Z(t.detail)??`Every ${e.label} host is turned off.`});if(t.status===`unauthenticated`)return(0,K.jsxs)(`span`,{children:[e.label,` is not authenticated on this server. Sign in or configure credentials using the `,(0,K.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,K.jsxs)(`span`,{children:[`Could not verify `,e.label,`. `,r??e.installHint]})}return(0,K.jsx)(`span`,{children:`Available`})}function Dt(e){let t=(0,W.c)(57),{item:n,children:r}=e,i;t[0]===n.version?i=t[1]:(i=Z(n.version),t[0]=n.version,t[1]=i);let a=i,o=Q(n)?n.status===`available`&&n.auth.status===`authenticated`:n.status===`available`&&n.implemented,s=Q(n)?n.auth:null,c;t[2]===s?c=t[3]:(c=s?St(s):null,t[2]=s,t[3]=c);let l=c,d=s?Z(s.account):null,[f,p]=(0,G.useState)(!1),m=r!==void 0,g=ke(),_;t[4]!==n.kind||t[5]!==g||t[6]!==p?(_=()=>{(n.kind===`git`&&g===U(`git-fetch-interval`).id||g===ze(n.kind)||n.kind===`github`&&g===U(`github-accounts`).id)&&p(!0)},t[4]=n.kind,t[5]=g,t[6]=p,t[7]=_):_=t[7];let y;t[8]!==n.kind||t[9]!==g?(y=[n.kind,g],t[8]=n.kind,t[9]=g,t[10]=y):y=t[10],(0,G.useEffect)(_,y);let b;t[11]===n?b=t[12]:(b=v(`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,K.jsx)(Tt,{item:n}),t[13]=n,t[14]=x);let C;t[15]===n.label?C=t[16]:(C=(0,K.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n.label}),t[15]=n.label,t[16]=C);let w;t[17]===a?w=t[18]:(w=a?(0,K.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:a}):null,t[17]=a,t[18]=w);let T;t[19]===n?T=t[20]:(T=$(n)?(0,K.jsx)(u,{variant:`warning`,size:`sm`,children:`Coming Soon`}):null,t[19]=n,t[20]=T);let E;t[21]===l?E=t[22]:(E=l?.badge?(0,K.jsx)(u,{variant:l.badge,size:`sm`,children:l.label}):null,t[21]=l,t[22]=E);let D;t[23]!==C||t[24]!==w||t[25]!==T||t[26]!==E||t[27]!==x?(D=(0,K.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=Et({item:n,auth:s,authAccount:d}),k;t[29]===O?k=t[30]:(k=(0,K.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,K.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]!==m||t[35]!==f||t[36]!==n.label||t[37]!==p?(j=m?(0,K.jsx)(h,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>p(Ot),"aria-expanded":f,"aria-label":`Toggle ${n.label} details`,children:(0,K.jsx)(S,{className:v(`size-3.5 transition-transform`,f&&`rotate-180`)})}):null,t[34]=m,t[35]=f,t[36]=n.label,t[37]=p,t[38]=j):j=t[38];let M;t[39]!==o||t[40]!==n?(M=$(n)?null:(0,K.jsx)(Be,{checked:o,disabled:!0,"aria-label":`${n.label} availability`}),t[39]=o,t[40]=n,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,K.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,K.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:(0,K.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]!==m||t[50]!==f||t[51]!==p?(F=m?(0,K.jsx)(R,{open:f,onOpenChange:p,children:(0,K.jsx)(xe,{children:(0,K.jsx)(`div`,{className:`px-3 pb-4 pt-1 sm:px-4`,children:r})})}):null,t[48]=r,t[49]=m,t[50]=f,t[51]=p,t[52]=F):F=t[52];let ee;return t[53]!==P||t[54]!==F||t[55]!==b?(ee=(0,K.jsxs)(`div`,{className:b,children:[P,F]}),t[53]=P,t[54]=F,t[55]=b,t[56]=ee):ee=t[56],ee}function Ot(e){return!e}function kt(){let e=(0,W.c)(33),t=De(),n=Ee(),r;e[0]===t?r=e[1]:(r=yt(le(t).automaticGitFetchInterval),e[0]=t,e[1]=r);let a=r,o;e[2]===t.backgroundActivity?o=e[3]:(o=yt(ae(ie(t.backgroundActivity)).automaticGitFetchInterval),e[2]=t.backgroundActivity,e[3]=o);let s=a!==o,c;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=U(`git-fetch-interval`),e[4]=c):c=e[4];let l=c,u=l.id,d,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:l.title}),f=(0,K.jsx)(Fe,{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]=d,e[6]=f):(d=e[5],f=e[6]);let p=s?`opacity-100`:`pointer-events-none opacity-0`,m;e[7]===p?m=e[8]:(m=v(`inline-flex size-5 shrink-0 items-center justify-center transition-opacity`,p),e[7]=p,e[8]=m);let h=!s,g;e[9]!==s||e[10]!==t.backgroundActivity||e[11]!==n?(g=s?(0,K.jsx)(Ne,{label:`fetch interval`,onClick:()=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:void 0}))}):null,e[9]=s,e[10]=t.backgroundActivity,e[11]=n,e[12]=g):g=e[12];let _;e[13]!==m||e[14]!==h||e[15]!==g?(_=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[d,f,(0,K.jsx)(`span`,{className:m,"aria-hidden":h,children:g})]}),e[13]=m,e[14]=h,e[15]=g,e[16]=_):_=e[16];let y;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,K.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]=y):y=e[17];let b;e[18]===_?b=e[19]:(b=(0,K.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[_,y]}),e[18]=_,e[19]=b);let x;e[20]!==t.backgroundActivity||e[21]!==n?(x=e=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:i(bt(e))})),e[20]=t.backgroundActivity,e[21]=n,e[22]=x):x=e[22];let S;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,K.jsxs)(j,{children:[(0,K.jsx)(A,{"aria-label":`Decrease fetch interval`}),(0,K.jsx)(O,{"aria-label":`Automatic Git fetch interval in seconds`}),(0,K.jsx)(k,{"aria-label":`Increase fetch interval`})]}),e[23]=S):S=e[23];let C;e[24]!==a||e[25]!==x?(C=(0,K.jsx)(M,{value:a,min:0,step:vt,size:`sm`,className:`w-32`,onValueChange:x,children:S}),e[24]=a,e[25]=x,e[26]=C):C=e[26];let w;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),e[27]=w):w=e[27];let T;e[28]===C?T=e[29]:(T=(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[C,w]}),e[28]=C,e[29]=T);let E;return e[30]!==b||e[31]!==T?(E=(0,K.jsx)(Me,{id:u,className:`grid gap-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[b,T]})}),e[30]=b,e[31]=T,e[32]=E):E=e[32],E}function At(e){let t=(0,W.c)(4),{title:n,headerAction:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=_t.map(jt),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,K.jsx)(Pe,{title:n,headerAction:r,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function jt(e){return(0,K.jsx)(`div`,{className:`first:rounded-t-xl last:rounded-b-xl px-3 py-3 sm:px-4`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`span`,{className:`relative inline-flex size-5 shrink-0 items-center justify-center`,children:[(0,K.jsx)(I,{className:`size-4.5`}),(0,K.jsx)(I,{shape:`pill`,className:`pointer-events-none absolute -left-0.5 -top-0.5 size-2`,"aria-hidden":!0})]}),(0,K.jsx)(I,{shape:`pill`,className:`h-4 w-28`}),(0,K.jsx)(I,{shape:`pill`,className:`h-5 w-14`})]}),(0,K.jsx)(I,{shape:`pill`,className:`h-3 w-full max-w-xs`})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,K.jsx)(I,{className:`size-7`}),(0,K.jsx)(I,{shape:`pill`,className:`h-5 w-9`})]})]})},e)}function Mt(e){let t=(0,W.c)(18),{error:n,isPending:r,onScan:i}=e,a=n!==null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=U(`source-control`),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(ge,{variant:`icon`,children:(0,K.jsx)(B.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,K.jsx)(L,{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,K.jsx)(ye,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==l||t[7]!==d?(f=(0,K.jsxs)(_e,{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,K.jsx)(H,{size:`sm`,refreshing:r}),t[9]=r,t[10]=p);let m;t[11]!==r||t[12]!==i||t[13]!==p?(m=(0,K.jsx)(ve,{children:(0,K.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,K.jsx)(Pe,{id:o.id,title:`Server environment`,children:(0,K.jsxs)(be,{children:[s,f,m]})}),t[15]=f,t[16]=m,t[17]=g):g=t[17],g}function Nt(){let e=(0,W.c)(33),{scope:t,environment:n,connectedEnvironments:r}=Ie(),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:Se.discovery({environmentId:i,input:{}}),e[0]=i,e[1]=o);let s=fe(o),c=s.data??ht,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=z.find(e);if(t?.settings&&i!==null)return(0,K.jsx)(Me,{id:ze(e),children:(0,K.jsx)(Ye,{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,K.jsx)(H,{refreshing:s.isPending}),e[7]=s.isPending,e[8]=_);let v;e[9]!==s.isPending||e[10]!==p||e[11]!==_?(v=(0,K.jsx)(T,{render:(0,K.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,K.jsx)(E,{side:`top`,children:`Rescan Git and hosting integrations`}),e[13]=y):y=e[13];let b;e[14]===v?b=e[15]:(b=(0,K.jsxs)(D,{children:[v,y]}),e[14]=v,e[15]=b);let x=b,S;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,K.jsx)(Ke,{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,K.jsx)(Pe,{id:U(`source-control`).id,title:`Server environment`,children:(0,K.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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(At,{title:`Version Control${a}`,headerAction:x}),(0,K.jsx)(At,{title:`Source Control Providers`})]}):u?(0,K.jsxs)(K.Fragment,{children:[l?(0,K.jsx)(Pe,{id:U(`source-control`).id,title:`Version Control${a}`,headerAction:x,children:c.versionControlSystems.map(Pt)}):null,c.sourceControlProviders.length>0?(0,K.jsx)(Pe,{id:l?void 0:U(`source-control`).id,title:l?`Source Control Providers`:`Source Control Providers${a}`,headerAction:l?null:x,children:c.sourceControlProviders.map(e=>(0,K.jsx)(Dt,{item:e,children:e.kind===`github`?(0,K.jsx)(Me,{id:U(`github-accounts`).id,children:(0,K.jsxs)(`div`,{className:`grid gap-6`,children:[(0,K.jsx)(et,{environmentId:i,onSaved:p},`token-${i}`),e.status===`available`?(0,K.jsx)(Qe,{environmentId:i,auth:e.auth,onSaved:p},i):null]})}):g(e.kind)},`provider:${e.kind}`))}):null]}):(0,K.jsx)(Mt,{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,K.jsx)(ot,{}),e[30]=w):w=e[30];let O;return e[31]===C?O=e[32]:(O=(0,K.jsxs)(Ae,{children:[S,C,w]}),e[31]=C,e[32]=O),O}function Pt(e){return(0,K.jsx)(Dt,{item:e,children:e.kind===`git`?(0,K.jsx)(kt,{}):void 0},`vcs:${e.kind}`)}var Ft=Nt;export{Ft as component};
2
- //# sourceMappingURL=settings.source-control-BlHoYUC0.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Al as n,Bt as r,Db as i,Ft as a,Kb as o,Mt as s,Pt as c,Tb as l,Un as u,Vt as d,kl as f,ma as p,or as m,qt as h,sr as g,t as _,tn as v,vl as y,wx as b,xs as x}from"./utils-DmS758az.js";import{t as S}from"./chevron-down-DHV04o66.js";import{t as C}from"./external-link-NWS0I_zo.js";import{t as w}from"./eye-off-BJFC-Vn7.js";import{a as T,n as E,t as D}from"./tooltip-Df-4YKs5.js";import{a as O,i as k,n as A,r as j,t as M}from"./number-field-BLz8W5SU.js";import{a as N,c as P,o as F,s as ee,t as te}from"./select-BiARKKgd.js";import{t as ne}from"./useNavigate-BK_XZ1It.js";import{i as re}from"./toast-Bm36EaG6.js";import{F as ie,I as ae,N as oe,P as se,f as ce,z as le}from"./useSettings-CckatJFa.js";import{f as ue,t as de}from"./server-B26doYv6.js";import{n as fe}from"./query-CK8MOmXr.js";import{t as pe}from"./use-atom-command-CiEeUGsC.js";import{t as I}from"./skeleton-CtSxs1y1.js";import{t as me}from"./textarea-DZLyhzuZ.js";import{t as he}from"./input-u5qjnfMr.js";import{a as ge,i as _e,n as ve,o as L,r as ye,t as be}from"./empty-uoiaKPHo.js";import{n as xe,t as R}from"./collapsible-C3qenpEI.js";import{t as Se}from"./sourceControl-C3RSledt.js";import{g as Ce,m as we}from"./Icons-C12feMOO.js";import{o as Te,s as z}from"./threadSort-BvhI6zOp.js";import{n as B}from"./pullRequestIcons-BWiN_14V.js";import{I as Ee,N as De,P as Oe,a as V,f as ke,i as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe,z as Ie}from"./settingsLayout-BzyY4qHt.js";import{Ea as Le,Ia as H,Ti as Re,ar as ze,ir as U,yn as Be,zo as Ve}from"./main-D9z9rMK1.js";import{n as He,t as Ue}from"./RedactedSensitiveText-citJBx4E.js";import{t as We}from"./ProviderModelPicker-CpgHpUCG.js";import{t as Ge}from"./useScopedModelAvailability-IKTxpeQL.js";import{t as Ke}from"./ProjectDefaultsSettings-BRRQlvgR.js";import{r as qe,t as Je}from"./ProviderSettingsForm-CaNO8FYK.js";var W=b(),G=e(t(),1),K=e(p(),1);function Ye({environmentId:e,definition:t,onSaved:n}){let r=ce(e,e=>e.sourceControlHosts[t.kind]),i=pe(ue.updateSettings,{label:`save ${t.label} settings`}),[a,o]=(0,G.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,K.jsxs)(`fieldset`,{disabled:a,className:`contents`,children:[(0,K.jsx)(Je,{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,K.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,K.jsx)(m,{size:`xs`,variant:`outline`,onClick:()=>void l(Object.fromEntries(Object.keys(r??{}).map(e=>[e,``]))),children:`Remove`})}):null]})}function Xe(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 Ze(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 q=`active gh account`;function J(e){let t=(0,W.c)(4),n;return t[0]!==e.account||t[1]!==e.label||t[2]!==e.revealed?(n=e.revealed?(0,K.jsx)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:e.account}):(0,K.jsxs)(`span`,{className:`min-w-0 truncate font-mono text-2xs`,children:[(0,K.jsx)(`span`,{className:`select-none blur-xs`,"aria-hidden":!0,children:He(e.account)}),(0,K.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 Qe({environmentId:e,auth:t,onSaved:n}){let r=ce(e,Te).hosts,i=pe(ue.updateSettings,{label:`save GitHub account settings`}),[a,o]=(0,G.useState)(!1),[s,c]=(0,G.useState)(!1),l=Xe(t.accounts??[]),u=async(t,a)=>{o(!0);try{(await i({environmentId:e,input:{patch:{sourceControlHosts:{github:{hosts:Ze(r,t,a)}}}}}))._tag===`Success`&&n()}finally{o(!1)}};return l.length===0?(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Sign in with `,(0,K.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,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`Choose which `,(0,K.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,K.jsx)(m,{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,K.jsx)(w,{}):(0,K.jsx)(Ve,{})})]}),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:q;return(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.host}),e.selectable.length===1&&e.selectable[0]!==void 0?(0,K.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,K.jsx)(`span`,{children:`Signed in as`}),(0,K.jsx)(J,{revealed:s,account:e.selectable[0]})]}):null]}),(0,K.jsx)(Le,{checked:n,disabled:a,"aria-label":`Use GitHub on ${e.host}`,onCheckedChange:t=>void u(e.host,{enabled:t})})]}),e.selectable.length>1?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Account`}),(0,K.jsx)(`div`,{className:`w-64 max-w-full`,children:(0,K.jsxs)(te,{value:o,disabled:a||!n,onValueChange:t=>{typeof t==`string`&&u(e.host,{account:t===q?null:t})},children:[(0,K.jsx)(ee,{size:`sm`,"aria-label":`GitHub account for ${e.host}`,children:(0,K.jsx)(P,{children:t=>t===q?(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,K.jsxs)(K.Fragment,{children:[`(`,(0,K.jsx)(J,{revealed:s,account:e.activeAccount}),`)`]}):null]}):(0,K.jsx)(J,{revealed:s,account:t})})}),(0,K.jsxs)(F,{align:`end`,alignItemWithTrigger:!1,children:[(0,K.jsx)(N,{value:q,children:(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[`Active gh account`,e.activeAccount?(0,K.jsxs)(K.Fragment,{children:[`(`,(0,K.jsx)(J,{revealed:s,account:e.activeAccount}),`)`]}):null]})}),e.selectable.map((e,t)=>(0,K.jsx)(N,{value:e,children:(0,K.jsx)(J,{revealed:s,account:e,label:`Account ${t+1}`})},e))]})]})})]}):null,i?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`p`,{className:`text-xs text-warning`,children:`The chosen login is no longer signed in, so the active gh login is used.`}),(0,K.jsx)(m,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void u(e.host,{account:null}),children:`Use active login`})]}):null,e.broken.map(e=>(0,K.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-xs text-muted-foreground/70`,children:[(0,K.jsx)(J,{revealed:s,account:e.account}),(0,K.jsxs)(`span`,{children:[`can't be used: `,e.error??`gh reports this login as invalid.`]})]},e.account)),e.environmentVariable?(0,K.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 Y=`github.com`;function $e(e){return`https://${e}/settings/personal-access-tokens/new`}function et({environmentId:e,onSaved:t}){let{tokens:n}=ce(e,Te),r=pe(ue.updateSettings,{label:`save GitHub token`}),[i,a]=(0,G.useState)(Y),[o,s]=(0,G.useState)(``),[c,l]=(0,G.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,K.jsx)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),u&&o.trim()&&p(u,o.trim())},children:(0,K.jsxs)(`fieldset`,{disabled:c,className:`contents`,children:[(0,K.jsxs)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:[`A token saved here is used before`,` `,(0,K.jsx)(`code`,{className:`rounded bg-muted px-1 py-px text-2xs`,children:`GH_TOKEN`}),` and the`,` `,(0,K.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,K.jsxs)(g,{render:(0,K.jsx)(`a`,{href:$e(u||Y),target:`_blank`,rel:`noreferrer noopener`}),children:[`Create a token`,(0,K.jsx)(C,{"aria-hidden":!0,className:`size-3`})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[12rem_1fr]`,children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(Re,{htmlFor:`github-token-host-${e}`,children:`Host`}),(0,K.jsx)(he,{id:`github-token-host-${e}`,autoComplete:`off`,size:`sm`,placeholder:Y,value:i,onChange:e=>a(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(Re,{htmlFor:`github-token-${e}`,children:`Token`}),(0,K.jsx)(qe,{id:`github-token-${e}`,size:`sm`,configured:d,value:o,onChange:e=>s(e.target.value)})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.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,K.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[d?(0,K.jsx)(m,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>void p(u,``),children:`Remove`}):null,(0,K.jsx)(m,{type:`submit`,size:`xs`,disabled:!u||!o.trim()||c,children:`Save`})]})]})]})})}var X={static:`Static prefix`,semantic:`Semantic prefix`,custom:`Custom instructions`};function tt(){let e=(0,W.c)(40),t=De(),{targets:n}=Ie(),r;e[0]===n?r=e[1]:(r=n.map(it).join(`,`),e[0]=n,e[1]=r);let i=r,a=(0,G.useRef)(!1),o=(0,G.useRef)(!1),s=Ee(),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`branchNamingMode`],e[2]=c):c=e[2];let l=Oe(c),u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=[`branchNamePrefix`],e[3]=u):u=e[3];let d=Oe(u),p;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=[`branchNameInstructions`],e[4]=p):p=e[4];let m=Oe(p),h,g;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=[`branchNamingMode`],g=U(`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,v;e[7]!==l||e[8]!==t.branchNamingMode||e[9]!==s?(v=t.branchNamingMode!==f.branchNamingMode||l?(0,K.jsx)(Ne,{label:`branch naming`,onClick:()=>s({branchNamingMode:f.branchNamingMode})}):null,e[7]=l,e[8]=t.branchNamingMode,e[9]=s,e[10]=v):v=e[10];let b=l?null:t.branchNamingMode,x;e[11]===s?x=e[12]:(x=e=>{y.literals.includes(e)&&s({branchNamingMode:e})},e[11]=s,e[12]=x);let S;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,K.jsx)(ee,{size:`sm`,"aria-label":`Worktree branch naming`,children:(0,K.jsx)(P,{children:rt})}),e[13]=S):S=e[13];let C;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(F,{align:`end`,alignItemWithTrigger:!1,children:y.literals.map(nt)}),e[14]=C):C=e[14];let w;e[15]!==b||e[16]!==x?(w=(0,K.jsxs)(te,{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]!==v?(T=(0,K.jsx)(V,{serverScoped:!0,settingKeys:h,...g,description:`Choose how new worktree branches are named from your first message.`,status:_,resetAction:v,control:w}),e[18]=w,e[19]=_,e[20]=v,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,K.jsx)(V,{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,K.jsx)(Ne,{label:`branch prefix`,onClick:()=>s({branchNamePrefix:f.branchNamePrefix})}):null,control:(0,K.jsx)(he,{"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,K.jsx)(V,{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,K.jsx)(Ne,{label:`branch naming instructions`,onClick:()=>s({branchNameInstructions:``})}):null,children:(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,K.jsx)(me,{"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,K.jsxs)(K.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,K.jsx)(N,{value:e,children:X[e]},e)}function rt(e){return e===null?`Mixed`:X[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,W.c)(80),t=De(),i=Ee(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=[`reviewGuidesEnabled`],e[0]=o):o=e[0];let l=Oe(o),u=ne(),{environment:f,connectedEnvironments:p,targets:g,target:_}=Ie(),y=f?.environmentId??null,b=p.length>0,S=f?.serverConfig?.providers??de,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,M;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=[`sourceControlWriterModelSelection`],e[9]=M):M=e[9];let N=Oe(M),ie;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(ie=[`reviewGuideModelSelection`],e[10]=ie):ie=e[10];let ae=Oe(ie),ce;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(ce=[`reviewGuideInstructions`],e[11]=ce):ce=e[11];let le=Oe(ce),ue=(0,G.useRef)(!1),fe;e[12]===g?fe=e[13]:(fe=g.map(mt).join(`,`),e[12]=g,e[13]=fe);let pe=fe,I=(0,G.useRef)(null),[he,ge]=(0,G.useState)(!1),[_e,ve]=(0,G.useState)(null),L=t.sourceControlWritingStyle,ye=n.sourceControlWritingStyle,be=j||L.mode!==ye.mode||L.customInstructions!==ye.customInstructions,xe=S.filter(pt),R=h(r(d(xe),t,_?.projectId??null)),Se=new Set(R.filter(ft).map(dt)),Ce=xe.filter(e=>Se.has(e.instanceId)),we=c(t,Ce),Te=t.sourceControlWriterModelSelection!==null,z=c({...t,textGenerationModelSelection:se(t,Ce,_?.projectId??null)},Ce),B=R.some(e=>e.instanceId===we.instanceId&&e.enabled&&e.isAvailable),ke=s(t,Ce,z.instanceId,z.model),Ae=Ge(t,R),Me=R.find(e=>e.instanceId===z.instanceId),Fe=t.reviewGuideModelSelection!==null,H=c({...t,textGenerationModelSelection:oe(t,xe,_?.projectId??null)},xe),Re=s(t,xe,H.instanceId,H.model),ze=R.find(e=>e.instanceId===H.instanceId),Be=Pe,Ve;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,K.jsx)(tt,{}),e[14]=Ve):Ve=e[14];let He;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(He=[`sourceControlWritingStyle`],e[15]=He):He=e[15];let Ue;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=U(`source-control-writing-style`),e[16]=Ue):Ue=e[16];let Ke=at[L.mode],qe;e[17]!==be||e[18]!==i?(qe=be?(0,K.jsx)(Ne,{label:`source control writing style`,onClick:()=>i({sourceControlWritingStyle:{mode:ye.mode,customInstructions:ye.customInstructions}})}):null,e[17]=be,e[18]=i,e[19]=qe):qe=e[19];let Je=E?null:L.mode,Ye;e[20]===i?Ye=e[21]:(Ye=e=>{let t=I.current?.value.trim();i({sourceControlWritingStyle:{mode:e,...t===void 0?{}:{customInstructions:t}}})},e[20]=i,e[21]=Ye);let Xe;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,K.jsx)(ee,{size:`sm`,className:`w-full sm:w-56`,"aria-label":`Source control writing style`,children:(0,K.jsx)(P,{children:ut})}),e[22]=Xe):Xe=e[22];let Ze;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=Object.keys(at),e[23]=Ze):Ze=e[23];let q;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,K.jsx)(F,{align:`end`,alignItemWithTrigger:!1,children:Ze.map(lt)}),e[24]=q):q=e[24];let J;e[25]!==Je||e[26]!==Ye?(J=(0,K.jsxs)(te,{value:Je,onValueChange:Ye,children:[Xe,q]}),e[25]=Je,e[26]=Ye,e[27]=J):J=e[27];let Qe;e[28]!==_e||e[29]!==he||e[30]!==L.customInstructions||e[31]!==L.mode||e[32]!==i||e[33]!==j?(Qe=j?(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl space-y-2 pb-3.5`,children:he?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(me,{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,K.jsx)(m,{size:`sm`,variant:`outline`,disabled:_e===null,onClick:()=>{_e!==null&&(i({sourceControlWritingStyle:{mode:`custom`,customInstructions:_e.trim()}}),ge(!1))},children:`Apply instructions to all`})]}):(0,K.jsx)(m,{size:`sm`,variant:`outline`,onClick:()=>{ve(null),ge(!0)},children:`Write custom instructions for all`})}):L.mode===`custom`?(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,K.jsx)(me,{ref:I,defaultValue:L.customInstructions,onBlur:e=>{let t=e.target.value.trim();t!==L.customInstructions&&i({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]=he,e[30]=L.customInstructions,e[31]=L.mode,e[32]=i,e[33]=j,e[34]=Qe):Qe=e[34];let Y;e[35]!==Ke.description||e[36]!==qe||e[37]!==J||e[38]!==Qe||e[39]!==j?(Y=(0,K.jsx)(V,{serverScoped:!0,settingKeys:He,mixed:j,...Ue,description:Ke.description,resetAction:qe,control:J,children:Qe}),e[35]=Ke.description,e[36]=qe,e[37]=J,e[38]=Qe,e[39]=j,e[40]=Y):Y=e[40];let $e;e[41]===Symbol.for(`react.memo_cache_sentinel`)?($e=[`sourceControlWritingStyle`],e[41]=$e):$e=e[41];let et;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(et=U(`follow-change-request-templates`),e[42]=et):et=e[42];let X;e[43]!==L.followChangeRequestTemplates||e[44]!==A||e[45]!==i?(X=A||L.followChangeRequestTemplates!==ye.followChangeRequestTemplates?(0,K.jsx)(Ne,{label:`change request templates`,onClick:()=>i({sourceControlWritingStyle:{followChangeRequestTemplates:ye.followChangeRequestTemplates}})}):null,e[43]=L.followChangeRequestTemplates,e[44]=A,e[45]=i,e[46]=X):X=e[46];let nt=!A&&L.followChangeRequestTemplates,rt;e[47]===i?rt=e[48]:(rt=e=>i({sourceControlWritingStyle:{followChangeRequestTemplates:!!e}}),e[47]=i,e[48]=rt);let it;e[49]!==nt||e[50]!==rt||e[51]!==A?(it=(0,K.jsx)(Le,{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]!==X||e[54]!==it||e[55]!==A?(ot=(0,K.jsx)(V,{serverScoped:!0,settingKeys:$e,mixed:A,...et,description:`Use the repository's template for change request descriptions when available.`,resetAction:X,control:it}),e[53]=X,e[54]=it,e[55]=A,e[56]=ot):ot=e[56];let ht,gt;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(ht=[`sourceControlWriterModelSelection`],gt=U(`source-control-writer-model`),e[57]=ht,e[58]=gt):(ht=e[57],gt=e[58]);let _t=b?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[Te&&!B?(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No text generation providers available.`}):null,Te&&B?(0,K.jsx)(We,{environmentId:y,activeInstanceId:z.instanceId,model:z.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:ke,triggerClassName:je,triggerAriaLabel:`Source control writer model`,...N?{triggerLabel:`Mixed`}:{},...y?{onOpenProviderSetup:e=>{u({to:`/settings/providers`,search:{environmentId:y,instanceId:e}})}}:{},getModelDisabledReason:Ae,onInstanceModelChange:(e,t)=>{let n=Ae(e,t);if(n){re.add({type:`error`,title:`Source control writer model not saved`,description:n});return}i({sourceControlWriterModelSelection:x(e,t)})}}):null,Te&&B&&!N&&Me?(0,K.jsx)(v,{provider:Me.driverKind,models:Me.models,model:z.model,prompt:``,onPromptChange:ct,modelOptions:z.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||a(z.options),triggerClassName:je,onModelOptionsChange:e=>i({sourceControlWriterModelSelection:x(z.instanceId,z.model,e)})}):null,(0,K.jsx)(Le,{checked:Te,disabled:!Te&&!B,onCheckedChange:e=>i({sourceControlWriterModelSelection:e?x(we.instanceId,we.model,we.options):null}),"aria-label":`Use a separate source control writer model`})]}):(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its source control writer model.`}),vt;e[59]===_t?vt=e[60]:(vt=(0,K.jsx)(V,{serverScoped:!0,settingKeys:ht,...gt,description:`Model for source control text and branch or bookmark names. Off uses the environment's text generation model.`,control:_t}),e[59]=_t,e[60]=vt);let yt;e[61]===Symbol.for(`react.memo_cache_sentinel`)?(yt=[`reviewGuidesEnabled`],e[61]=yt):yt=e[61];let bt;e[62]===Symbol.for(`react.memo_cache_sentinel`)?(bt=U(`review-guides`),e[62]=bt):bt=e[62];let xt=!l&&t.reviewGuidesEnabled,Z;e[63]===i?Z=e[64]:(Z=e=>i({reviewGuidesEnabled:!!e}),e[63]=i,e[64]=Z);let Q;e[65]!==l||e[66]!==xt||e[67]!==Z?(Q=(0,K.jsx)(Le,{mixed:l,checked:xt,onCheckedChange:Z,"aria-label":`Review guides`}),e[65]=l,e[66]=xt,e[67]=Z,e[68]=Q):Q=e[68];let $;e[69]!==l||e[70]!==Q?($=(0,K.jsx)(V,{serverScoped:!0,settingKeys:yt,mixed:l,...bt,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]=l,e[70]=Q,e[71]=$):$=e[71];let St=t.reviewGuidesEnabled||l?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(V,{serverScoped:!0,settingKeys:[`reviewGuideModelSelection`],...U(`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:b?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(Fe||ae)&&B?(0,K.jsx)(We,{environmentId:y,activeInstanceId:H.instanceId,model:H.model,lockedProvider:null,instanceEntries:R,modelOptionsByInstance:Re,triggerClassName:je,triggerAriaLabel:`Review guide model`,...ae?{triggerLabel:`Mixed`}:{},getModelDisabledReason:Ae,onInstanceModelChange:(e,t)=>{let n=Ae(e,t);if(n){re.add({type:`error`,title:`Review guide model not saved`,description:n});return}i({reviewGuideModelSelection:x(e,t)})}}):null,Fe&&B&&!ae&&ze?(0,K.jsx)(v,{provider:ze.driverKind,models:ze.models,model:H.model,prompt:``,onPromptChange:st,modelOptions:H.options??[],allowPromptInjectedEffort:!1,planModeEnabled:t.planModeEnabled||a(H.options),triggerClassName:je,onModelOptionsChange:e=>i({reviewGuideModelSelection:x(H.instanceId,H.model,e)})}):null,(0,K.jsx)(Le,{mixed:ae,checked:!ae&&Fe,disabled:!Fe&&!B,onCheckedChange:e=>{if(!e){i({reviewGuideModelSelection:null});return}let t=Ae(z.instanceId,z.model);if(t){re.add({type:`error`,title:`Review guide model not saved`,description:t});return}i({reviewGuideModelSelection:x(z.instanceId,z.model,z.options)})},"aria-label":`Use a separate review guide model`})]}):(0,K.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Connect an environment to choose its review guide model.`})}),(0,K.jsx)(V,{serverScoped:!0,settingKeys:[`reviewGuideInstructions`],...U(`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:le||t.reviewGuideInstructions!==``?(0,K.jsx)(Ne,{label:`review guide instructions`,onClick:()=>i({reviewGuideInstructions:``})}):null,children:(0,K.jsx)(`div`,{className:`mt-3 max-w-2xl pb-3.5`,children:(0,K.jsx)(me,{"aria-label":`Review guide instructions`,onChange:()=>{ue.current=!0},rows:4,defaultValue:le?``:t.reviewGuideInstructions,placeholder:le?`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 n=e.target.value.trim();ue.current&&(le||n!==t.reviewGuideInstructions)&&i({reviewGuideInstructions:n}),ue.current=!1}},`${pe}:${le}:${t.reviewGuideInstructions}`)})})]}):null,Ct;return e[72]!==Be||e[73]!==Ve||e[74]!==Y||e[75]!==ot||e[76]!==vt||e[77]!==$||e[78]!==St?(Ct=(0,K.jsxs)(Be,{id:`source-control-text-generation`,title:`Text generation`,children:[Ve,Y,ot,vt,$,St]}),e[72]=Be,e[73]=Ve,e[74]=Y,e[75]=ot,e[76]=vt,e[77]=$,e[78]=St,e[79]=Ct):Ct=e[79],Ct}function st(){}function ct(){}function lt(e){return(0,K.jsx)(N,{hideIndicator:!0,value:e,children:at[e].label},e)}function ut(e){return e===null?`Mixed`:at[e].label}function dt(e){return e.instanceId}function ft(e){return e.enabled&&e.isAvailable}function pt(e){return e.supportsTextGeneration!==!1}function mt(e){return`${e.environmentId}:${e.projectId}`}var ht={versionControlSystems:[],sourceControlProviders:[]},gt={git:we,jj:Ce},_t=[`primary`,`secondary`],vt=5;function yt(e){return Math.round(i(e)/1e3)}function bt(e){return e===null||!Number.isFinite(e)?0:Math.max(0,Math.round(e))}function xt(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:ie(e),overrides:n}}}function Z(e){return o(e)}function Q(e){return`auth`in e}function $(e){return!Q(e)&&!e.implemented}function St(e){return e.status===`authenticated`?{label:`Authenticated`,badge:null}:e.status===`unauthenticated`?{label:`Not authenticated`,badge:`warning`}:{label:`Status unknown`,badge:null}}function Ct(e){let t=(0,W.c)(2),n;return t[0]===e.account?n=t[1]:(n=(0,K.jsx)(Ue,{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 wt(e){return $(e)?`bg-muted-foreground/35`:e.status!==`available`||Q(e)&&e.auth.status!==`authenticated`?`bg-warning`:`bg-success`}function Tt(e){let t=(0,W.c)(13),{item:n}=e,r,i,a,o;if(t[0]!==n){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=wt(n),s=Q(n)?z.find(n.kind):void 0,c=Q(n)?s&&Be(s):gt[n.kind];if(!c){o=(0,K.jsx)(`span`,{className:_(`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,K.jsx)(c,{className:`size-4.5 text-foreground/80`,"aria-hidden":!0}),t[5]=c,t[6]=a),r=_(`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,K.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,K.jsxs)(`span`,{className:i,children:[a,s]}),t[9]=i,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}function Et({item:e,auth:t,authAccount:n}){if($(e))return(0,K.jsxs)(`span`,{children:[`Support for `,e.label,` is coming soon.`]});if(e.status!==`available`)return(0,K.jsxs)(`span`,{children:[`Not available on this server: `,e.installHint]});if(t){if(t.status===`authenticated`){let e=Z(t.detail);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{children:`Authenticated`}),n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":!0,children:`as`}),(0,K.jsx)(Ct,{account:n})]}):null,e?(0,K.jsxs)(`span`,{children:[`· `,e]}):null]})}if(!e.executable&&t.status===`unauthenticated`)return(0,K.jsxs)(`span`,{children:[`Available. `,e.installHint]});if(t.status===`unauthenticated`&&t.accounts?.some(e=>e.authenticated))return(0,K.jsx)(`span`,{children:Z(t.detail)??`Every ${e.label} host is turned off.`});if(t.status===`unauthenticated`)return(0,K.jsxs)(`span`,{children:[e.label,` is not authenticated on this server. Sign in or configure credentials using the `,(0,K.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,K.jsxs)(`span`,{children:[`Could not verify `,e.label,`. `,r??e.installHint]})}return(0,K.jsx)(`span`,{children:`Available`})}function Dt(e){let t=(0,W.c)(57),{item:n,children:r}=e,i;t[0]===n.version?i=t[1]:(i=Z(n.version),t[0]=n.version,t[1]=i);let a=i,o=Q(n)?n.status===`available`&&n.auth.status===`authenticated`:n.status===`available`&&n.implemented,s=Q(n)?n.auth:null,c;t[2]===s?c=t[3]:(c=s?St(s):null,t[2]=s,t[3]=c);let l=c,d=s?Z(s.account):null,[f,p]=(0,G.useState)(!1),h=r!==void 0,g=ke(),v;t[4]!==n.kind||t[5]!==g||t[6]!==p?(v=()=>{(n.kind===`git`&&g===U(`git-fetch-interval`).id||g===ze(n.kind)||n.kind===`github`&&g===U(`github-accounts`).id)&&p(!0)},t[4]=n.kind,t[5]=g,t[6]=p,t[7]=v):v=t[7];let y;t[8]!==n.kind||t[9]!==g?(y=[n.kind,g],t[8]=n.kind,t[9]=g,t[10]=y):y=t[10],(0,G.useEffect)(v,y);let b;t[11]===n?b=t[12]:(b=_(`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,K.jsx)(Tt,{item:n}),t[13]=n,t[14]=x);let C;t[15]===n.label?C=t[16]:(C=(0,K.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:n.label}),t[15]=n.label,t[16]=C);let w;t[17]===a?w=t[18]:(w=a?(0,K.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:a}):null,t[17]=a,t[18]=w);let T;t[19]===n?T=t[20]:(T=$(n)?(0,K.jsx)(u,{variant:`warning`,size:`sm`,children:`Coming Soon`}):null,t[19]=n,t[20]=T);let E;t[21]===l?E=t[22]:(E=l?.badge?(0,K.jsx)(u,{variant:l.badge,size:`sm`,children:l.label}):null,t[21]=l,t[22]=E);let D;t[23]!==C||t[24]!==w||t[25]!==T||t[26]!==E||t[27]!==x?(D=(0,K.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=Et({item:n,auth:s,authAccount:d}),k;t[29]===O?k=t[30]:(k=(0,K.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,K.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]!==h||t[35]!==f||t[36]!==n.label||t[37]!==p?(j=h?(0,K.jsx)(m,{size:`icon-xs`,variant:`ghost-muted`,onClick:()=>p(Ot),"aria-expanded":f,"aria-label":`Toggle ${n.label} details`,children:(0,K.jsx)(S,{className:_(`size-3.5 transition-transform`,f&&`rotate-180`)})}):null,t[34]=h,t[35]=f,t[36]=n.label,t[37]=p,t[38]=j):j=t[38];let M;t[39]!==o||t[40]!==n?(M=$(n)?null:(0,K.jsx)(Le,{checked:o,disabled:!0,"aria-label":`${n.label} availability`}),t[39]=o,t[40]=n,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,K.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,K.jsx)(`div`,{className:`px-3 py-3 sm:px-4`,children:(0,K.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]!==h||t[50]!==f||t[51]!==p?(F=h?(0,K.jsx)(R,{open:f,onOpenChange:p,children:(0,K.jsx)(xe,{children:(0,K.jsx)(`div`,{className:`px-3 pb-4 pt-1 sm:px-4`,children:r})})}):null,t[48]=r,t[49]=h,t[50]=f,t[51]=p,t[52]=F):F=t[52];let ee;return t[53]!==P||t[54]!==F||t[55]!==b?(ee=(0,K.jsxs)(`div`,{className:b,children:[P,F]}),t[53]=P,t[54]=F,t[55]=b,t[56]=ee):ee=t[56],ee}function Ot(e){return!e}function kt(){let e=(0,W.c)(33),t=De(),n=Ee(),r;e[0]===t?r=e[1]:(r=yt(le(t).automaticGitFetchInterval),e[0]=t,e[1]=r);let i=r,a;e[2]===t.backgroundActivity?a=e[3]:(a=yt(ae(ie(t.backgroundActivity)).automaticGitFetchInterval),e[2]=t.backgroundActivity,e[3]=a);let o=i!==a,s;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=U(`git-fetch-interval`),e[4]=s):s=e[4];let c=s,u=c.id,d,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:c.title}),f=(0,K.jsx)(Fe,{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]=d,e[6]=f):(d=e[5],f=e[6]);let p=o?`opacity-100`:`pointer-events-none opacity-0`,m;e[7]===p?m=e[8]:(m=_(`inline-flex size-5 shrink-0 items-center justify-center transition-opacity`,p),e[7]=p,e[8]=m);let h=!o,g;e[9]!==o||e[10]!==t.backgroundActivity||e[11]!==n?(g=o?(0,K.jsx)(Ne,{label:`fetch interval`,onClick:()=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:void 0}))}):null,e[9]=o,e[10]=t.backgroundActivity,e[11]=n,e[12]=g):g=e[12];let v;e[13]!==m||e[14]!==h||e[15]!==g?(v=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[d,f,(0,K.jsx)(`span`,{className:m,"aria-hidden":h,children:g})]}),e[13]=m,e[14]=h,e[15]=g,e[16]=v):v=e[16];let y;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,K.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]=y):y=e[17];let b;e[18]===v?b=e[19]:(b=(0,K.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[v,y]}),e[18]=v,e[19]=b);let x;e[20]!==t.backgroundActivity||e[21]!==n?(x=e=>n(xt(t.backgroundActivity,{automaticGitFetchInterval:l(bt(e))})),e[20]=t.backgroundActivity,e[21]=n,e[22]=x):x=e[22];let S;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,K.jsxs)(j,{children:[(0,K.jsx)(A,{"aria-label":`Decrease fetch interval`}),(0,K.jsx)(O,{"aria-label":`Automatic Git fetch interval in seconds`}),(0,K.jsx)(k,{"aria-label":`Increase fetch interval`})]}),e[23]=S):S=e[23];let C;e[24]!==i||e[25]!==x?(C=(0,K.jsx)(M,{value:i,min:0,step:vt,size:`sm`,className:`w-32`,onValueChange:x,children:S}),e[24]=i,e[25]=x,e[26]=C):C=e[26];let w;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`seconds`}),e[27]=w):w=e[27];let T;e[28]===C?T=e[29]:(T=(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[C,w]}),e[28]=C,e[29]=T);let E;return e[30]!==b||e[31]!==T?(E=(0,K.jsx)(Me,{id:u,className:`grid gap-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[b,T]})}),e[30]=b,e[31]=T,e[32]=E):E=e[32],E}function At(e){let t=(0,W.c)(4),{title:n,headerAction:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=_t.map(jt),t[0]=i):i=t[0];let a;return t[1]!==r||t[2]!==n?(a=(0,K.jsx)(Pe,{title:n,headerAction:r,children:i}),t[1]=r,t[2]=n,t[3]=a):a=t[3],a}function jt(e){return(0,K.jsx)(`div`,{className:`first:rounded-t-xl last:rounded-b-xl px-3 py-3 sm:px-4`,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(`span`,{className:`relative inline-flex size-5 shrink-0 items-center justify-center`,children:[(0,K.jsx)(I,{className:`size-4.5`}),(0,K.jsx)(I,{shape:`pill`,className:`pointer-events-none absolute -left-0.5 -top-0.5 size-2`,"aria-hidden":!0})]}),(0,K.jsx)(I,{shape:`pill`,className:`h-4 w-28`}),(0,K.jsx)(I,{shape:`pill`,className:`h-5 w-14`})]}),(0,K.jsx)(I,{shape:`pill`,className:`h-3 w-full max-w-xs`})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,K.jsx)(I,{className:`size-7`}),(0,K.jsx)(I,{shape:`pill`,className:`h-5 w-9`})]})]})},e)}function Mt(e){let t=(0,W.c)(18),{error:n,isPending:r,onScan:i}=e,a=n!==null,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=U(`source-control`),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(ge,{variant:`icon`,children:(0,K.jsx)(B.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,K.jsx)(L,{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,K.jsx)(ye,{children:u}),t[4]=u,t[5]=d);let f;t[6]!==l||t[7]!==d?(f=(0,K.jsxs)(_e,{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,K.jsx)(H,{size:`sm`,refreshing:r}),t[9]=r,t[10]=p);let h;t[11]!==r||t[12]!==i||t[13]!==p?(h=(0,K.jsx)(ve,{children:(0,K.jsxs)(m,{size:`sm`,variant:`outline`,onClick:i,disabled:r,children:[p,`Scan`]})}),t[11]=r,t[12]=i,t[13]=p,t[14]=h):h=t[14];let g;return t[15]!==f||t[16]!==h?(g=(0,K.jsx)(Pe,{id:o.id,title:`Server environment`,children:(0,K.jsxs)(be,{children:[s,f,h]})}),t[15]=f,t[16]=h,t[17]=g):g=t[17],g}function Nt(){let e=(0,W.c)(33),{scope:t,environment:n,connectedEnvironments:r}=Ie(),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:Se.discovery({environmentId:i,input:{}}),e[0]=i,e[1]=o);let s=fe(o),c=s.data??ht,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,h;e[4]!==i||e[5]!==p?(h=e=>{let t=z.find(e);if(t?.settings&&i!==null)return(0,K.jsx)(Me,{id:ze(e),children:(0,K.jsx)(Ye,{environmentId:i,definition:{...t,settings:t.settings},onSaved:p},i)})},e[4]=i,e[5]=p,e[6]=h):h=e[6];let g=h,_;e[7]===s.isPending?_=e[8]:(_=(0,K.jsx)(H,{refreshing:s.isPending}),e[7]=s.isPending,e[8]=_);let v;e[9]!==s.isPending||e[10]!==p||e[11]!==_?(v=(0,K.jsx)(T,{render:(0,K.jsx)(m,{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,K.jsx)(E,{side:`top`,children:`Rescan Git and hosting integrations`}),e[13]=y):y=e[13];let b;e[14]===v?b=e[15]:(b=(0,K.jsxs)(D,{children:[v,y]}),e[14]=v,e[15]=b);let x=b,S;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,K.jsx)(Ke,{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,K.jsx)(Pe,{id:U(`source-control`).id,title:`Server environment`,children:(0,K.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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(At,{title:`Version Control${a}`,headerAction:x}),(0,K.jsx)(At,{title:`Source Control Providers`})]}):u?(0,K.jsxs)(K.Fragment,{children:[l?(0,K.jsx)(Pe,{id:U(`source-control`).id,title:`Version Control${a}`,headerAction:x,children:c.versionControlSystems.map(Pt)}):null,c.sourceControlProviders.length>0?(0,K.jsx)(Pe,{id:l?void 0:U(`source-control`).id,title:l?`Source Control Providers`:`Source Control Providers${a}`,headerAction:l?null:x,children:c.sourceControlProviders.map(e=>(0,K.jsx)(Dt,{item:e,children:e.kind===`github`?(0,K.jsx)(Me,{id:U(`github-accounts`).id,children:(0,K.jsxs)(`div`,{className:`grid gap-6`,children:[(0,K.jsx)(et,{environmentId:i,onSaved:p},`token-${i}`),e.status===`available`?(0,K.jsx)(Qe,{environmentId:i,auth:e.auth,onSaved:p},i):null]})}):g(e.kind)},`provider:${e.kind}`))}):null]}):(0,K.jsx)(Mt,{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,K.jsx)(ot,{}),e[30]=w):w=e[30];let O;return e[31]===C?O=e[32]:(O=(0,K.jsxs)(Ae,{children:[S,C,w]}),e[31]=C,e[32]=O),O}function Pt(e){return(0,K.jsx)(Dt,{item:e,children:e.kind===`git`?(0,K.jsx)(kt,{}):void 0},`vcs:${e.kind}`)}var Ft=Nt;export{Ft as component};
2
+ //# sourceMappingURL=settings.source-control-R63Z9kEM.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Go as n,Sx as r,Vo as i,ma as a,or as o}from"./utils-geC9CGP4.js";import{L as s,U as c}from"./runtime-BoEmkhOe.js";import{a as l,i as u,n as d,r as f,t as p}from"./number-field-DsVu9T6C.js";import{a as m,c as h,o as g,s as _,t as v}from"./select-BDMo6Fqt.js";import{i as y}from"./toast-CIGvRti2.js";import{f as b}from"./server-DNo9AqHW.js";import{t as x}from"./use-atom-command-Bc7LgQy1.js";import{o as S}from"./timestampFormat-wac2e_Jz.js";import{t as C}from"./input-BOT1WFGI.js";import{a as w}from"./p4ProjectFile-DVeZFEli.js";import{H as T,I as E,N as D,P as O,a as k,i as A,j,r as M,s as N,u as P,z as F}from"./settingsLayout-De_r3pyr.js";import{or as I,wa as L}from"./main-Ch0n0whg.js";import{t as R}from"./FoldedSettingsSection-BimbnaOl.js";import{t as z}from"./formatBytes-D8LhsSVR.js";import{t as B}from"./SettingsScopeNotice-CAaNSKvu.js";var V=r(),H=e(t(),1),U=e(a(),1);function W(){let e=(0,V.c)(22),{connectedEnvironments:t,targets:n}=F(),r=D(),i=E(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[`worktreesDirectory`],e[0]=a):a=e[0];let o=O(a),s=(0,H.useRef)(!1);if(t.some(K))return null;let c;e[1]===n?c=e[2]:(c=n.map(G).join(`,`),e[1]=n,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=I(`storage-worktrees-location`),e[3]=u):u=e[3];let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`worktreesDirectory`],e[4]=d):d=e[4];let f;e[5]!==o||e[6]!==r.worktreesDirectory||e[7]!==i?(f=o||r.worktreesDirectory!==``?(0,U.jsx)(M,{label:`worktree location`,onClick:()=>i({worktreesDirectory:``})}):null,e[5]=o,e[6]=r.worktreesDirectory,e[7]=i,e[8]=f):f=e[8];let p=`${l}:${o}:${r.worktreesDirectory}`,m=o?`Mixed`:`Default`,h=o?``:r.worktreesDirectory,g;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s.current=!0},e[9]=g):g=e[9];let _;e[10]!==o||e[11]!==r.worktreesDirectory||e[12]!==i?(_=e=>{let t=e.target.value.trim();s.current&&(o||t!==r.worktreesDirectory)&&i({worktreesDirectory:t}),s.current=!1},e[10]=o,e[11]=r.worktreesDirectory,e[12]=i,e[13]=_):_=e[13];let v;e[14]!==p||e[15]!==m||e[16]!==h||e[17]!==_?(v=(0,U.jsx)(C,{"aria-label":`Worktree location`,autoCapitalize:`none`,spellCheck:!1,placeholder:m,defaultValue:h,onChange:g,onBlur:_},p),e[14]=p,e[15]=m,e[16]=h,e[17]=_,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==f?(y=(0,U.jsx)(k,{...u,description:`Folder where new worktrees are created, on any drive, such as D:\\worktrees or ~/worktrees. Existing worktrees stay where they are. Leave empty to use the P4 Code home folder.`,serverScoped:!0,settingKeys:d,resetAction:f,control:v}),e[19]=v,e[20]=f,e[21]=y):y=e[21],y}function G(e){return e.environmentId}function K(e){return e.serverConfig?.environment.capabilities.worktreesDirectory!==!0}function q(e){let t=(0,V.c)(14),{label:n,value:r,onChange:i}=e,[a,o]=(0,H.useState)(r),[s,c]=(0,H.useState)(r);s!==r&&(c(r),o(r));let m;t[0]!==a||t[1]!==n||t[2]!==i||t[3]!==r?(m=r===null?(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Off`}):(0,U.jsx)(p,{value:a,min:1,max:3650,step:1,size:`sm`,className:`w-auto`,onValueChange:o,onValueCommitted:e=>{if(e===null)o(r);else{let t=Math.min(3650,Math.max(1,Math.round(e)));o(t),i(t)}},children:(0,U.jsxs)(f,{children:[(0,U.jsx)(d,{"aria-label":`Decrease ${n}`}),(0,U.jsx)(l,{"aria-label":`${n} in days`,size:new Intl.NumberFormat().format(a??r).length,className:`field-sizing-content w-auto min-w-[1ch] grow-0 text-right`}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`self-center pr-2 text-xs`,children:`days`}),(0,U.jsx)(u,{"aria-label":`Increase ${n}`})]})}),t[0]=a,t[1]=n,t[2]=i,t[3]=r,t[4]=m):m=t[4];let h=r!==null,g;t[5]===i?g=t[6]:(g=e=>i(e?8:null),t[5]=i,t[6]=g);let _;t[7]!==n||t[8]!==h||t[9]!==g?(_=(0,U.jsx)(L,{"aria-label":n,checked:h,onCheckedChange:g}),t[7]=n,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v;return t[11]!==m||t[12]!==_?(v=(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,_]}),t[11]=m,t[12]=_,t[13]=v):v=t[13],v}var J={"any-local-files":`Any local files`,"uncommitted-changes":`Uncommitted changes`,"tracked-changes":`Edited tracked files`};function Y(e){let t=(0,V.c)(16),{report:n,environmentLabel:r}=e,i;if(t[0]!==r||t[1]!==n.entries){let e;t[3]===r?e=t[4]:(e=(e,t)=>{let n=e.kind===`worktree`?e.path?.split(/[\\/]/).findLast(Boolean)??`Worktrees`:e.kind===`logs`?`Rotated logs`:`Browser artifacts`;return(0,U.jsx)(k,{title:r?`${r}: ${n}`:n,description:(0,U.jsxs)(`span`,{className:`wrap-anywhere ${e.outcome===`failed`?`text-destructive`:``}`,children:[e.threadTitle&&e.threadTitle!==n?`${e.threadTitle}. `:``,e.reason]}),control:e.outcome===`removed`&&(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:[e.kind!==`worktree`&&e.files!==null?`${e.files.toLocaleString()} ${e.files===1?`file`:`files`}`:null,e.bytes===null?null:z(e.bytes)].filter(Boolean).join(` · `)})},`${e.path??e.kind}:${e.threadId??t}`)},t[3]=r,t[4]=e),i=n.entries.map(e),t[0]=r,t[1]=n.entries,t[2]=i}else i=t[2];let a;t[5]!==r||t[6]!==n.omittedCount?(a=n.omittedCount>0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,n.omittedCount.toLocaleString(),` more results.`]}),t[5]=r,t[6]=n.omittedCount,t[7]=a):a=t[7];let o;t[8]!==r||t[9]!==n.entries.length||t[10]!==n.omittedCount?(o=n.entries.length===0&&n.omittedCount===0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,`Nothing needed cleanup.`]}),t[8]=r,t[9]=n.entries.length,t[10]=n.omittedCount,t[11]=o):o=t[11];let s;return t[12]!==i||t[13]!==a||t[14]!==o?(s=(0,U.jsxs)(U.Fragment,{children:[i,a,o]}),t[12]=i,t[13]=a,t[14]=o,t[15]=s):s=t[15],s}function X(){P(6e4);let{connectedEnvironments:e}=F(),[t,r]=(0,H.useState)(!1),a=x(b.runStorageCleanup),l=e.filter(e=>e.serverConfig?.environment.capabilities.storageCleanupRun===!0),u=i((0,H.useMemo)(()=>n(t=>e.flatMap(e=>{if(e.serverConfig?.environment.capabilities.storageCleanupRun!==!0)return[];let n=t(b.storageCleanupReport({environmentId:e.environmentId,input:{}}));return[{environmentId:e.environmentId,allowed:t(b.runStorageCleanup.permissionAtom(e.environmentId)),report:n._tag===`Success`?n.value:null,loading:n.waiting,failed:n._tag===`Failure`}]})),[e])),d=l.some(e=>{let t=e.serverConfig?.settings;if(!t)return!1;let n=e=>e.worktreeAfterDays!==null||e.worktreeOnMerge||e.worktreeOnDelete||e.worktreeUnchanged;return t.storageCleanup.browserArtifactsAfterDays!==null||t.storageCleanup.logsAfterDays!==null||n(w(t,null))||Object.values(t.projectSettingsOverrides).some(e=>e.worktreeCleanup?.mode===`custom`&&n(e.worktreeCleanup.rules))});if(l.length===0)return null;let f=l.map(e=>{let t=u.find(t=>t.environmentId===e.environmentId),n=t?.report??null;return{environment:e,report:n,description:n?`Last run ${S(n.finishedAt)}. ${z(n.bytesFreed)} recovered.${n.counts.failed>0?` ${n.counts.failed} ${n.counts.failed===1?`item`:`items`} couldn't be removed.`:``}`:t?.failed?`Could not load the last run.`:t?.loading?`Loading last run…`:`Cleanup hasn't run yet.`}}),p=async()=>{if(!t){r(!0);try{await Promise.all(l.filter(e=>u.some(t=>t.environmentId===e.environmentId&&t.allowed)).map(async e=>{let t=await a({environmentId:e.environmentId,input:{}});if(t._tag===`Success`){let n=t.value.entries.filter(e=>e.outcome===`failed`);n.length>0&&y.add({type:`error`,title:`Cleanup failed on ${e.label}`,description:n[0].reason})}else s(t)||y.add({type:`error`,title:`Could not run cleanup on ${e.label}`,description:String(c(t))})}))}finally{r(!1)}}};return(0,U.jsxs)(N,{id:`storage-cleanup`,title:`Cleanup`,variant:`plain`,children:[(0,U.jsx)(T,{children:(0,U.jsx)(k,{...I(`storage-delete-now`),description:(0,U.jsx)(`span`,{children:d?f.map(({environment:e,description:t})=>(0,U.jsxs)(`span`,{className:`block`,children:[l.length>1?`${e.label}: `:``,t]},e.environmentId)):`Turn on a cleanup rule to use this.`}),control:(0,U.jsx)(o,{variant:`outline`,size:`sm`,disabled:t||!d||!u.some(e=>e.allowed),onClick:()=>void p(),children:t?`Deleting…`:`Delete now`})})}),f.some(({report:e})=>e!==null)&&(0,U.jsx)(R,{id:`storage-cleanup-last-run`,title:`Last run`,headerPlacement:`inside`,summary:f.flatMap(({environment:t,report:n})=>n?[`${e.length>1?`${t.label}: `:``}${n.counts.removed} removed, ${n.counts.kept} kept${n.counts.failed>0?`, ${n.counts.failed} failed`:``}`]:[]).join(` · `),children:f.map(({environment:t,report:n})=>n&&(0,U.jsx)(Y,{report:n,environmentLabel:e.length>1?t.label:void 0},t.environmentId))})]})}function Z(){let e=(0,V.c)(57),{scope:t,connectedEnvironments:n,targets:r,target:i}=F(),a=D(),o=t.kind===`project`||t.kind===`checkout`,s=a.storageCleanup,c;e[0]===a?c=e[1]:(c=w(a,null),e[0]=a,e[1]=c);let l;e[2]!==a.storageCleanup||e[3]!==c?(l={...s,...c},e[2]=a.storageCleanup,e[3]=c,e[4]=l):l=e[4];let u=l,d=ie,f;e[5]===i?f=e[6]:(f=d(i),e[5]=i,e[6]=f);let p=f,y;if(e[7]!==p||e[8]!==r){let t;e[10]===p?t=e[11]:(t=e=>d(e)!==p,e[10]=p,e[11]=t),y=r.some(t),e[7]=p,e[8]=r,e[9]=y}else y=e[9];let b=y,x=E(),S=j(),C;e[12]!==u||e[13]!==r?(C=e=>r.some(t=>({...t.settings.storageCleanup,...w(t.settings,null)})[e]!==u[e])?`Mixed across selected machines`:void 0,e[12]=u,e[13]=r,e[14]=C):C=e[14];let T=C,O;e[15]===x?O=e[16]:(O=e=>x({storageCleanup:e}),e[15]=x,e[16]=O);let M=O,P;e[17]!==o||e[18]!==M||e[19]!==x?(P=e=>o?x({worktreeCleanup:{mode:`custom`,rules:e}}):M(e),e[17]=o,e[18]=M,e[19]=x,e[20]=P):P=e[20];let R=P;if(o&&n.some(re)){let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(B,{target:`all`,children:`Update the selected machines to configure project worktree cleanup.`}),e[21]=t):t=e[21],t}if(n.some(ne)){let t;e[22]===n?t=e[23]:(t=n.filter(te).map(ee),e[22]=n,e[23]=t);let r;return e[24]===t?r=e[25]:(r=(0,U.jsx)(B,{target:`environment`,eligibleEnvironmentIds:t,children:`Update the selected environments to use storage cleanup, or choose a machine that supports it.`}),e[24]=t,e[25]=r),r}let z;e[26]===o?z=e[27]:(z=!o&&(0,U.jsx)(W,{}),e[26]=o,e[27]=z);let H;e[28]!==S||e[29]!==o||e[30]!==b||e[31]!==p||e[32]!==x?(H=o&&(0,U.jsx)(k,{title:`Automatic worktree cleanup`,description:p===`off`?`Keep this project's worktrees until you delete them manually.`:p===`custom`?`Use these rules for this project.`:`Use each machine's worktree cleanup settings.`,serverScoped:!0,settingKeys:[`worktreeCleanup`],mixed:b,control:(0,U.jsxs)(v,{value:b?null:p,onValueChange:e=>{e===`inherit`?S([`worktreeCleanup`]):e===`off`?x({worktreeCleanup:{mode:`off`}}):e===`custom`&&x({worktreeCleanup:{mode:`custom`,rules:{}}})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Automatic worktree cleanup`,children:(0,U.jsx)(h,{children:b?`Mixed`:p===`inherit`?`Inherit`:p===`off`?`Off`:`Custom`})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`inherit`,children:`Inherit`}),(0,U.jsx)(m,{value:`off`,children:`Off`}),(0,U.jsx)(m,{value:`custom`,children:`Custom`})]})]})}),e[28]=S,e[29]=o,e[30]=b,e[31]=p,e[32]=x,e[33]=H):H=e[33];let G;e[34]!==n||e[35]!==o||e[36]!==b||e[37]!==p||e[38]!==T||e[39]!==u||e[40]!==R?(G=(!o||!b&&p===`custom`)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(k,{title:`Delete worktrees with deleted threads`,status:T(`worktreeOnDelete`),description:`Remove unused worktrees when active or archived threads are deleted. Worktrees with local changes are kept.`,serverScoped:!o,control:(0,U.jsx)(L,{"aria-label":`Delete worktrees with deleted threads`,checked:u.worktreeOnDelete,onCheckedChange:e=>R({worktreeOnDelete:e})})}),(0,U.jsx)(k,{title:`Delete inactive worktrees`,status:T(`worktreeAfterDays`),description:`Remove worktrees after their threads have been inactive for this many days. Branches and thread history are kept.`,serverScoped:!o,control:(0,U.jsx)(q,{label:`Delete inactive worktrees`,value:u.worktreeAfterDays,onChange:e=>R({worktreeAfterDays:e})})}),(0,U.jsx)(k,{title:`Delete merged worktrees`,status:T(`worktreeOnMerge`),description:`Remove worktrees whose pull request is merged and whose commits are included in the default branch.`,serverScoped:!o,control:(0,U.jsx)(L,{"aria-label":`Delete merged worktrees`,checked:u.worktreeOnMerge,onCheckedChange:e=>R({worktreeOnMerge:e})})}),(0,U.jsx)(k,{title:`Delete unchanged worktrees`,status:T(`worktreeUnchanged`),description:`Remove worktrees with no commits beyond the default branch.`,serverScoped:!o,control:(0,U.jsx)(L,{"aria-label":`Delete unchanged worktrees`,checked:u.worktreeUnchanged,onCheckedChange:e=>R({worktreeUnchanged:e})})}),n.every(Q)&&(0,U.jsx)(k,{...I(`storage-worktree-keep-when`),status:T(`worktreeKeepWhen`),description:u.worktreeKeepWhen===`any-local-files`?`Includes ignored files, except node_modules.`:u.worktreeKeepWhen===`tracked-changes`?`Deletes untracked and ignored files, including .env.`:`Keeps edits and untracked files. Deletes ignored files, including .env.`,serverScoped:!o,control:(0,U.jsxs)(v,{value:T(`worktreeKeepWhen`)?null:u.worktreeKeepWhen,onValueChange:e=>{(e===`any-local-files`||e===`uncommitted-changes`||e===`tracked-changes`)&&R({worktreeKeepWhen:e})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Keep worktrees with local changes`,children:(0,U.jsx)(h,{children:T(`worktreeKeepWhen`)?`Mixed`:J[u.worktreeKeepWhen]})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`any-local-files`,children:`Any local files`}),(0,U.jsx)(m,{value:`uncommitted-changes`,children:`Uncommitted changes`}),(0,U.jsx)(m,{value:`tracked-changes`,children:`Edited tracked files`})]})]})})]}),e[34]=n,e[35]=o,e[36]=b,e[37]=p,e[38]=T,e[39]=u,e[40]=R,e[41]=G):G=e[41];let K;e[42]!==G||e[43]!==z||e[44]!==H?(K=(0,U.jsxs)(N,{id:`storage-worktrees`,title:`Worktrees`,children:[z,H,G]}),e[42]=G,e[43]=z,e[44]=H,e[45]=K):K=e[45];let Y;e[46]!==o||e[47]!==T||e[48]!==u||e[49]!==M?(Y=!o&&(0,U.jsxs)(N,{id:`storage-artifacts`,title:`Artifacts and logs`,children:[(0,U.jsx)(k,{title:`Delete old browser artifacts`,status:T(`browserArtifactsAfterDays`),description:`Delete saved browser captures after this many days. Older capture links will no longer open.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old browser artifacts`,value:u.browserArtifactsAfterDays,onChange:e=>M({browserArtifactsAfterDays:e})})}),(0,U.jsx)(k,{title:`Delete old rotated logs`,status:T(`logsAfterDays`),description:`Delete inactive rotated log files after this many days. Current logs are kept.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old rotated logs`,value:u.logsAfterDays,onChange:e=>M({logsAfterDays:e})})})]}),e[46]=o,e[47]=T,e[48]=u,e[49]=M,e[50]=Y):Y=e[50];let Z;e[51]===o?Z=e[52]:(Z=!o&&(0,U.jsx)(X,{}),e[51]=o,e[52]=Z);let $;return e[53]!==K||e[54]!==Y||e[55]!==Z?($=(0,U.jsxs)(A,{children:[K,Y,Z]}),e[53]=K,e[54]=Y,e[55]=Z,e[56]=$):$=e[56],$}function Q(e){return e.serverConfig?.environment.capabilities.storageCleanupRun===!0}function ee(e){return e.environmentId}function te(e){return e.serverConfig?.environment.capabilities.storageCleanup===!0}function ne(e){return e.serverConfig?.environment.capabilities.storageCleanup!==!0}function re(e){return e.serverConfig?.environment.capabilities.projectWorktreeCleanup!==!0}function ie(e){return e?.sources.worktreeCleanup===`project`?e.settings.worktreeCleanup?.mode??`inherit`:`inherit`}var $=Z;export{$ as component};
2
- //# sourceMappingURL=settings.storage-C4lRhJsq.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Go as n,Vo as r,ma as i,or as a,wx as o}from"./utils-DmS758az.js";import{L as s,U as c}from"./runtime-CCr9UADV.js";import{a as l,i as u,n as d,r as f,t as p}from"./number-field-BLz8W5SU.js";import{a as m,c as h,o as g,s as _,t as v}from"./select-BiARKKgd.js";import{i as y}from"./toast-Bm36EaG6.js";import{f as b}from"./server-B26doYv6.js";import{t as x}from"./use-atom-command-CiEeUGsC.js";import{o as S}from"./timestampFormat-wac2e_Jz.js";import{t as C}from"./input-u5qjnfMr.js";import{a as w}from"./p4ProjectFile-BzCYJ8I-.js";import{H as T,I as E,N as D,P as O,a as k,i as A,j,r as M,s as N,u as P,z as F}from"./settingsLayout-BzyY4qHt.js";import{Ea as I,ir as L}from"./main-D9z9rMK1.js";import{t as R}from"./FoldedSettingsSection-BJm8ZaTy.js";import{t as z}from"./formatBytes-D8LhsSVR.js";import{t as B}from"./SettingsScopeNotice-CdNfxmW3.js";var V=o(),H=e(t(),1),U=e(i(),1);function W(){let e=(0,V.c)(22),{connectedEnvironments:t,targets:n}=F(),r=D(),i=E(),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[`worktreesDirectory`],e[0]=a):a=e[0];let o=O(a),s=(0,H.useRef)(!1);if(t.some(K))return null;let c;e[1]===n?c=e[2]:(c=n.map(G).join(`,`),e[1]=n,e[2]=c);let l=c,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=L(`storage-worktrees-location`),e[3]=u):u=e[3];let d;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[`worktreesDirectory`],e[4]=d):d=e[4];let f;e[5]!==o||e[6]!==r.worktreesDirectory||e[7]!==i?(f=o||r.worktreesDirectory!==``?(0,U.jsx)(M,{label:`worktree location`,onClick:()=>i({worktreesDirectory:``})}):null,e[5]=o,e[6]=r.worktreesDirectory,e[7]=i,e[8]=f):f=e[8];let p=`${l}:${o}:${r.worktreesDirectory}`,m=o?`Mixed`:`Default`,h=o?``:r.worktreesDirectory,g;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{s.current=!0},e[9]=g):g=e[9];let _;e[10]!==o||e[11]!==r.worktreesDirectory||e[12]!==i?(_=e=>{let t=e.target.value.trim();s.current&&(o||t!==r.worktreesDirectory)&&i({worktreesDirectory:t}),s.current=!1},e[10]=o,e[11]=r.worktreesDirectory,e[12]=i,e[13]=_):_=e[13];let v;e[14]!==p||e[15]!==m||e[16]!==h||e[17]!==_?(v=(0,U.jsx)(C,{"aria-label":`Worktree location`,autoCapitalize:`none`,spellCheck:!1,placeholder:m,defaultValue:h,onChange:g,onBlur:_},p),e[14]=p,e[15]=m,e[16]=h,e[17]=_,e[18]=v):v=e[18];let y;return e[19]!==v||e[20]!==f?(y=(0,U.jsx)(k,{...u,description:`Folder where new worktrees are created, on any drive, such as D:\\worktrees or ~/worktrees. Existing worktrees stay where they are. Leave empty to use the P4 Code home folder.`,serverScoped:!0,settingKeys:d,resetAction:f,control:v}),e[19]=v,e[20]=f,e[21]=y):y=e[21],y}function G(e){return e.environmentId}function K(e){return e.serverConfig?.environment.capabilities.worktreesDirectory!==!0}function q(e){let t=(0,V.c)(14),{label:n,value:r,onChange:i}=e,[a,o]=(0,H.useState)(r),[s,c]=(0,H.useState)(r);s!==r&&(c(r),o(r));let m;t[0]!==a||t[1]!==n||t[2]!==i||t[3]!==r?(m=r===null?(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Off`}):(0,U.jsx)(p,{value:a,min:1,max:3650,step:1,size:`sm`,className:`w-auto`,onValueChange:o,onValueCommitted:e=>{if(e===null)o(r);else{let t=Math.min(3650,Math.max(1,Math.round(e)));o(t),i(t)}},children:(0,U.jsxs)(f,{children:[(0,U.jsx)(d,{"aria-label":`Decrease ${n}`}),(0,U.jsx)(l,{"aria-label":`${n} in days`,size:new Intl.NumberFormat().format(a??r).length,className:`field-sizing-content w-auto min-w-[1ch] grow-0 text-right`}),(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`self-center pr-2 text-xs`,children:`days`}),(0,U.jsx)(u,{"aria-label":`Increase ${n}`})]})}),t[0]=a,t[1]=n,t[2]=i,t[3]=r,t[4]=m):m=t[4];let h=r!==null,g;t[5]===i?g=t[6]:(g=e=>i(e?8:null),t[5]=i,t[6]=g);let _;t[7]!==n||t[8]!==h||t[9]!==g?(_=(0,U.jsx)(I,{"aria-label":n,checked:h,onCheckedChange:g}),t[7]=n,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v;return t[11]!==m||t[12]!==_?(v=(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[m,_]}),t[11]=m,t[12]=_,t[13]=v):v=t[13],v}var J={"any-local-files":`Any local files`,"uncommitted-changes":`Uncommitted changes`,"tracked-changes":`Edited tracked files`};function Y(e){let t=(0,V.c)(16),{report:n,environmentLabel:r}=e,i;if(t[0]!==r||t[1]!==n.entries){let e;t[3]===r?e=t[4]:(e=(e,t)=>{let n=e.kind===`worktree`?e.path?.split(/[\\/]/).findLast(Boolean)??`Worktrees`:e.kind===`logs`?`Rotated logs`:`Browser artifacts`;return(0,U.jsx)(k,{title:r?`${r}: ${n}`:n,description:(0,U.jsxs)(`span`,{className:`wrap-anywhere ${e.outcome===`failed`?`text-destructive`:``}`,children:[e.threadTitle&&e.threadTitle!==n?`${e.threadTitle}. `:``,e.reason]}),control:e.outcome===`removed`&&(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:[e.kind!==`worktree`&&e.files!==null?`${e.files.toLocaleString()} ${e.files===1?`file`:`files`}`:null,e.bytes===null?null:z(e.bytes)].filter(Boolean).join(` · `)})},`${e.path??e.kind}:${e.threadId??t}`)},t[3]=r,t[4]=e),i=n.entries.map(e),t[0]=r,t[1]=n.entries,t[2]=i}else i=t[2];let a;t[5]!==r||t[6]!==n.omittedCount?(a=n.omittedCount>0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,n.omittedCount.toLocaleString(),` more results.`]}),t[5]=r,t[6]=n.omittedCount,t[7]=a):a=t[7];let o;t[8]!==r||t[9]!==n.entries.length||t[10]!==n.omittedCount?(o=n.entries.length===0&&n.omittedCount===0&&(0,U.jsxs)(`p`,{className:`px-3 py-2.5 text-xs text-muted-foreground sm:px-4`,children:[r?`${r}: `:``,`Nothing needed cleanup.`]}),t[8]=r,t[9]=n.entries.length,t[10]=n.omittedCount,t[11]=o):o=t[11];let s;return t[12]!==i||t[13]!==a||t[14]!==o?(s=(0,U.jsxs)(U.Fragment,{children:[i,a,o]}),t[12]=i,t[13]=a,t[14]=o,t[15]=s):s=t[15],s}function X(){P(6e4);let{connectedEnvironments:e}=F(),[t,i]=(0,H.useState)(!1),o=x(b.runStorageCleanup),l=e.filter(e=>e.serverConfig?.environment.capabilities.storageCleanupRun===!0),u=r((0,H.useMemo)(()=>n(t=>e.flatMap(e=>{if(e.serverConfig?.environment.capabilities.storageCleanupRun!==!0)return[];let n=t(b.storageCleanupReport({environmentId:e.environmentId,input:{}}));return[{environmentId:e.environmentId,allowed:t(b.runStorageCleanup.permissionAtom(e.environmentId)),report:n._tag===`Success`?n.value:null,loading:n.waiting,failed:n._tag===`Failure`}]})),[e])),d=l.some(e=>{let t=e.serverConfig?.settings;if(!t)return!1;let n=e=>e.worktreeAfterDays!==null||e.worktreeOnMerge||e.worktreeOnDelete||e.worktreeUnchanged;return t.storageCleanup.browserArtifactsAfterDays!==null||t.storageCleanup.logsAfterDays!==null||n(w(t,null))||Object.values(t.projectSettingsOverrides).some(e=>e.worktreeCleanup?.mode===`custom`&&n(e.worktreeCleanup.rules))});if(l.length===0)return null;let f=l.map(e=>{let t=u.find(t=>t.environmentId===e.environmentId),n=t?.report??null;return{environment:e,report:n,description:n?`Last run ${S(n.finishedAt)}. ${z(n.bytesFreed)} recovered.${n.counts.failed>0?` ${n.counts.failed} ${n.counts.failed===1?`item`:`items`} couldn't be removed.`:``}`:t?.failed?`Could not load the last run.`:t?.loading?`Loading last run…`:`Cleanup hasn't run yet.`}}),p=async()=>{if(!t){i(!0);try{await Promise.all(l.filter(e=>u.some(t=>t.environmentId===e.environmentId&&t.allowed)).map(async e=>{let t=await o({environmentId:e.environmentId,input:{}});if(t._tag===`Success`){let n=t.value.entries.filter(e=>e.outcome===`failed`);n.length>0&&y.add({type:`error`,title:`Cleanup failed on ${e.label}`,description:n[0].reason})}else s(t)||y.add({type:`error`,title:`Could not run cleanup on ${e.label}`,description:String(c(t))})}))}finally{i(!1)}}};return(0,U.jsxs)(N,{id:`storage-cleanup`,title:`Cleanup`,variant:`plain`,children:[(0,U.jsx)(T,{children:(0,U.jsx)(k,{...L(`storage-delete-now`),description:(0,U.jsx)(`span`,{children:d?f.map(({environment:e,description:t})=>(0,U.jsxs)(`span`,{className:`block`,children:[l.length>1?`${e.label}: `:``,t]},e.environmentId)):`Turn on a cleanup rule to use this.`}),control:(0,U.jsx)(a,{variant:`outline`,size:`sm`,disabled:t||!d||!u.some(e=>e.allowed),onClick:()=>void p(),children:t?`Deleting…`:`Delete now`})})}),f.some(({report:e})=>e!==null)&&(0,U.jsx)(R,{id:`storage-cleanup-last-run`,title:`Last run`,headerPlacement:`inside`,summary:f.flatMap(({environment:t,report:n})=>n?[`${e.length>1?`${t.label}: `:``}${n.counts.removed} removed, ${n.counts.kept} kept${n.counts.failed>0?`, ${n.counts.failed} failed`:``}`]:[]).join(` · `),children:f.map(({environment:t,report:n})=>n&&(0,U.jsx)(Y,{report:n,environmentLabel:e.length>1?t.label:void 0},t.environmentId))})]})}function Z(){let e=(0,V.c)(57),{scope:t,connectedEnvironments:n,targets:r,target:i}=F(),a=D(),o=t.kind===`project`||t.kind===`checkout`,s=a.storageCleanup,c;e[0]===a?c=e[1]:(c=w(a,null),e[0]=a,e[1]=c);let l;e[2]!==a.storageCleanup||e[3]!==c?(l={...s,...c},e[2]=a.storageCleanup,e[3]=c,e[4]=l):l=e[4];let u=l,d=ie,f;e[5]===i?f=e[6]:(f=d(i),e[5]=i,e[6]=f);let p=f,y;if(e[7]!==p||e[8]!==r){let t;e[10]===p?t=e[11]:(t=e=>d(e)!==p,e[10]=p,e[11]=t),y=r.some(t),e[7]=p,e[8]=r,e[9]=y}else y=e[9];let b=y,x=E(),S=j(),C;e[12]!==u||e[13]!==r?(C=e=>r.some(t=>({...t.settings.storageCleanup,...w(t.settings,null)})[e]!==u[e])?`Mixed across selected machines`:void 0,e[12]=u,e[13]=r,e[14]=C):C=e[14];let T=C,O;e[15]===x?O=e[16]:(O=e=>x({storageCleanup:e}),e[15]=x,e[16]=O);let M=O,P;e[17]!==o||e[18]!==M||e[19]!==x?(P=e=>o?x({worktreeCleanup:{mode:`custom`,rules:e}}):M(e),e[17]=o,e[18]=M,e[19]=x,e[20]=P):P=e[20];let R=P;if(o&&n.some(re)){let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,U.jsx)(B,{target:`all`,children:`Update the selected machines to configure project worktree cleanup.`}),e[21]=t):t=e[21],t}if(n.some(ne)){let t;e[22]===n?t=e[23]:(t=n.filter(te).map(ee),e[22]=n,e[23]=t);let r;return e[24]===t?r=e[25]:(r=(0,U.jsx)(B,{target:`environment`,eligibleEnvironmentIds:t,children:`Update the selected environments to use storage cleanup, or choose a machine that supports it.`}),e[24]=t,e[25]=r),r}let z;e[26]===o?z=e[27]:(z=!o&&(0,U.jsx)(W,{}),e[26]=o,e[27]=z);let H;e[28]!==S||e[29]!==o||e[30]!==b||e[31]!==p||e[32]!==x?(H=o&&(0,U.jsx)(k,{title:`Automatic worktree cleanup`,description:p===`off`?`Keep this project's worktrees until you delete them manually.`:p===`custom`?`Use these rules for this project.`:`Use each machine's worktree cleanup settings.`,serverScoped:!0,settingKeys:[`worktreeCleanup`],mixed:b,control:(0,U.jsxs)(v,{value:b?null:p,onValueChange:e=>{e===`inherit`?S([`worktreeCleanup`]):e===`off`?x({worktreeCleanup:{mode:`off`}}):e===`custom`&&x({worktreeCleanup:{mode:`custom`,rules:{}}})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Automatic worktree cleanup`,children:(0,U.jsx)(h,{children:b?`Mixed`:p===`inherit`?`Inherit`:p===`off`?`Off`:`Custom`})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`inherit`,children:`Inherit`}),(0,U.jsx)(m,{value:`off`,children:`Off`}),(0,U.jsx)(m,{value:`custom`,children:`Custom`})]})]})}),e[28]=S,e[29]=o,e[30]=b,e[31]=p,e[32]=x,e[33]=H):H=e[33];let G;e[34]!==n||e[35]!==o||e[36]!==b||e[37]!==p||e[38]!==T||e[39]!==u||e[40]!==R?(G=(!o||!b&&p===`custom`)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(k,{title:`Delete worktrees with deleted threads`,status:T(`worktreeOnDelete`),description:`Remove unused worktrees when active or archived threads are deleted. Worktrees with local changes are kept.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete worktrees with deleted threads`,checked:u.worktreeOnDelete,onCheckedChange:e=>R({worktreeOnDelete:e})})}),(0,U.jsx)(k,{title:`Delete inactive worktrees`,status:T(`worktreeAfterDays`),description:`Remove worktrees after their threads have been inactive for this many days. Branches and thread history are kept.`,serverScoped:!o,control:(0,U.jsx)(q,{label:`Delete inactive worktrees`,value:u.worktreeAfterDays,onChange:e=>R({worktreeAfterDays:e})})}),(0,U.jsx)(k,{title:`Delete merged worktrees`,status:T(`worktreeOnMerge`),description:`Remove worktrees whose pull request is merged and whose commits are included in the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete merged worktrees`,checked:u.worktreeOnMerge,onCheckedChange:e=>R({worktreeOnMerge:e})})}),(0,U.jsx)(k,{title:`Delete unchanged worktrees`,status:T(`worktreeUnchanged`),description:`Remove worktrees with no commits beyond the default branch.`,serverScoped:!o,control:(0,U.jsx)(I,{"aria-label":`Delete unchanged worktrees`,checked:u.worktreeUnchanged,onCheckedChange:e=>R({worktreeUnchanged:e})})}),n.every(Q)&&(0,U.jsx)(k,{...L(`storage-worktree-keep-when`),status:T(`worktreeKeepWhen`),description:u.worktreeKeepWhen===`any-local-files`?`Includes ignored files, except node_modules.`:u.worktreeKeepWhen===`tracked-changes`?`Deletes untracked and ignored files, including .env.`:`Keeps edits and untracked files. Deletes ignored files, including .env.`,serverScoped:!o,control:(0,U.jsxs)(v,{value:T(`worktreeKeepWhen`)?null:u.worktreeKeepWhen,onValueChange:e=>{(e===`any-local-files`||e===`uncommitted-changes`||e===`tracked-changes`)&&R({worktreeKeepWhen:e})},children:[(0,U.jsx)(_,{size:`sm`,"aria-label":`Keep worktrees with local changes`,children:(0,U.jsx)(h,{children:T(`worktreeKeepWhen`)?`Mixed`:J[u.worktreeKeepWhen]})}),(0,U.jsxs)(g,{align:`end`,alignItemWithTrigger:!1,children:[(0,U.jsx)(m,{value:`any-local-files`,children:`Any local files`}),(0,U.jsx)(m,{value:`uncommitted-changes`,children:`Uncommitted changes`}),(0,U.jsx)(m,{value:`tracked-changes`,children:`Edited tracked files`})]})]})})]}),e[34]=n,e[35]=o,e[36]=b,e[37]=p,e[38]=T,e[39]=u,e[40]=R,e[41]=G):G=e[41];let K;e[42]!==G||e[43]!==z||e[44]!==H?(K=(0,U.jsxs)(N,{id:`storage-worktrees`,title:`Worktrees`,children:[z,H,G]}),e[42]=G,e[43]=z,e[44]=H,e[45]=K):K=e[45];let Y;e[46]!==o||e[47]!==T||e[48]!==u||e[49]!==M?(Y=!o&&(0,U.jsxs)(N,{id:`storage-artifacts`,title:`Artifacts and logs`,children:[(0,U.jsx)(k,{title:`Delete old browser artifacts`,status:T(`browserArtifactsAfterDays`),description:`Delete saved browser captures after this many days. Older capture links will no longer open.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old browser artifacts`,value:u.browserArtifactsAfterDays,onChange:e=>M({browserArtifactsAfterDays:e})})}),(0,U.jsx)(k,{title:`Delete old rotated logs`,status:T(`logsAfterDays`),description:`Delete inactive rotated log files after this many days. Current logs are kept.`,serverScoped:!0,control:(0,U.jsx)(q,{label:`Delete old rotated logs`,value:u.logsAfterDays,onChange:e=>M({logsAfterDays:e})})})]}),e[46]=o,e[47]=T,e[48]=u,e[49]=M,e[50]=Y):Y=e[50];let Z;e[51]===o?Z=e[52]:(Z=!o&&(0,U.jsx)(X,{}),e[51]=o,e[52]=Z);let $;return e[53]!==K||e[54]!==Y||e[55]!==Z?($=(0,U.jsxs)(A,{children:[K,Y,Z]}),e[53]=K,e[54]=Y,e[55]=Z,e[56]=$):$=e[56],$}function Q(e){return e.serverConfig?.environment.capabilities.storageCleanupRun===!0}function ee(e){return e.environmentId}function te(e){return e.serverConfig?.environment.capabilities.storageCleanup===!0}function ne(e){return e.serverConfig?.environment.capabilities.storageCleanup!==!0}function re(e){return e.serverConfig?.environment.capabilities.projectWorktreeCleanup!==!0}function ie(e){return e?.sources.worktreeCleanup===`project`?e.settings.worktreeCleanup?.mode??`inherit`:`inherit`}var $=Z;export{$ as component};
2
+ //# sourceMappingURL=settings.storage-J1kthey9.js.map
@@ -0,0 +1,3 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{$n as n,Af as r,Go as i,Hc as a,If as o,Il as s,Kb as c,Ml as l,Nl as u,Qn as d,Uc as f,Um as p,Vl as m,Vo as h,Vv as g,Wn as _,Xn as v,Zn as y,al as b,ar as x,ay as S,bl as C,er as w,kl as T,ma as E,ms as D,or as ee,os as te,sr as O,t as k,ux as ne,wx as A}from"./utils-DmS758az.js";import{t as j}from"./check-Cmy7pM2Y.js";import{t as M}from"./chevron-down-DHV04o66.js";import{t as re}from"./info-BHB-83EA.js";import{t as N}from"./layers-BqgDAlx3.js";import{t as P}from"./undo-2-ZlIXiNdF.js";import{C as ie}from"./entities-DNKDCsf2.js";import{a as ae,n as oe,t as se}from"./tooltip-Df-4YKs5.js";import{t as ce}from"./useNavigate-BK_XZ1It.js";import{t as F}from"./useLocation-9axGTsrg.js";import{i as le}from"./toast-Bm36EaG6.js";import{D as ue,E as I,O as de,a as fe,g as pe,i as me,p as he,s as L,t as ge}from"./useSettings-CckatJFa.js";import{f as _e}from"./server-B26doYv6.js";import{i as ve,n as ye,o as be}from"./session-CQXL-cTI.js";import{t as xe}from"./use-atom-command-CiEeUGsC.js";import{m as Se}from"./queries-Cn1FJB1_.js";import{a as Ce}from"./threadSort-BvhI6zOp.js";import{i as we,o as Te,t as Ee}from"./popover-6BYEGLLK.js";import{t as R}from"./ProjectFavicon-ExMHrN16.js";import{o as z,r as De}from"./projectFilesQueryState-CrGsc81w.js";import{t as Oe}from"./pullRequestDetail.logic-CE7fVOsp.js";import{a as B,f as V,i as H,n as U,t as W}from"./p4ProjectFile-BzCYJ8I-.js";import{r as G}from"./sidebarProjectGrouping-DxzT7QCQ.js";import{n as K}from"./EnvironmentMachineIcon-DMZGa766.js";import{t as q}from"./WorkspacePageContainer-BFo6qTGJ.js";var J=A(),Y=e(E(),1);function X(e){let t=(0,J.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({variant:i,divided:a,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`grouped`:i,s=a===void 0||a,c=o===`grouped`?`rounded-xl border border-border/60 bg-card/40 shadow-xs/5`:`space-y-1`,l=o===`grouped`&&s&&`[&>*+*]:border-t [&>*+*]:border-border/50 [&>[data-slot=settings-row]]:rounded-none`,u;t[5]!==n||t[6]!==c||t[7]!==l?(u=k(`relative overflow-visible text-foreground`,c,l,n),t[5]=n,t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==u?(d=(0,Y.jsx)(`div`,{...r,className:u}),t[9]=r,t[10]=u,t[11]=d):d=t[11],d}var Z=e(t(),1);function Q(){let e=(0,J.c)(5),t=ie(),n=L(V),r=de(),{environments:i}=I(),a;if(e[0]!==i||e[1]!==r||e[2]!==t||e[3]!==n){let o=new Map(i.map(Ae));a=G({projects:t,settings:n,primaryEnvironmentId:r,resolveEnvironmentLabel:e=>o.get(e)??null}).sort(ke),e[0]=i,e[1]=r,e[2]=t,e[3]=n,e[4]=a}else a=e[4];return a}function ke(e,t){return e.displayName.localeCompare(t.displayName)}function Ae(e){return[e.environmentId,e.label]}var je=new Set(Object.keys(u.fields)),Me=new Set(Object.keys(C.fields)),Ne=new Set(l);function $(e){return Ne.has(e)}function Pe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Fe(e,t,n){let r=new Set(e.environmentIds),i=t.filter(e=>r.has(e.environmentId)),a=i.filter(e=>e.connection.phase===`connected`&&e.serverConfig!==null);return{environments:i,connectedEnvironments:a,environment:a.find(e=>e.environmentId===n)??a[0]??null}}function Ie(e,t,n){let r=new Map(t.map(e=>[e.environmentId,e]));return e.kind===`project`||e.kind===`checkout`?e.members.flatMap(e=>{let t=r.get(e.environmentId);if(!t?.serverConfig)return[];let i=n?.get(e.physicalProjectKey),a=i===void 0?H(t.serverConfig.settings,e.id):H(t.serverConfig.settings,e.id,null,i);return[{environmentId:e.environmentId,label:t.label,projectId:e.id,settings:a.settings,sources:a.sources}]}):t.flatMap(e=>e.serverConfig?[{environmentId:e.environmentId,label:e.label,projectId:null,settings:e.serverConfig.settings,sources:H(e.serverConfig.settings,null).sources}]:[])}function Le(e,t){let n=e[0];return n!==void 0&&e.some(e=>t.some(t=>!ne(n.settings[t],e.settings[t])))}function Re(e,t){let n=t.filter($);if(n.length===0||e.length===0)return`environment`;let r=new Set(e.flatMap(e=>n.map(t=>e.sources[t])));return r.size>1?`mixed`:r.has(`project`)?`project`:r.has(`p4.json`)?`p4.json`:`environment`}function ze(e,t,n){let r=new Map(t.map(e=>[e.environmentId,e])),i=new Map;for(let t of e.members){let e=r.get(t.environmentId);if(!e?.serverConfig||e.connection.phase!==`connected`||e.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0)continue;let a=e.serverConfig.settings,o=n(a.projectSettingsOverrides[t.id]??{},a,t.id),s=i.get(t.environmentId);i.set(t.environmentId,{environmentId:t.environmentId,label:e.label,previous:a,patch:{projectSettingsOverrides:{...s?.patch.projectSettingsOverrides,[t.id]:o}}})}return[...i.values()]}function Be(e,t,n){let r=Object.fromEntries(Object.entries(n).filter(([e])=>Me.has(e)&&!je.has(e))),i=Object.fromEntries(Object.entries(n).filter(([e])=>je.has(e))),a=Object.keys(i),{connectedEnvironments:o}=Fe(e,t,null),c=e.kind===`project`||e.kind===`checkout`,l=c?a.filter(e=>!$(e)):[],u=a.length===0?[]:c?l.length>0?[]:ze(e,t,(e,t,n)=>{let r=H(t,n).settings,a={...e};for(let[e,o]of Object.entries(i)){if(e===`worktreeCleanup`&&i.worktreeCleanup?.mode===`custom`){a[e]={mode:`custom`,rules:{...B(t,n),...i.worktreeCleanup.rules}};continue}if(o===null&&!s(e)){delete a[e];continue}let c=r[e];a[e]=Pe(o)&&Pe(c)?{...c,...o}:o}return a}):e.kind===`all`||e.kind===`environment`?o.flatMap(e=>{let t=e.serverConfig?.settings;return t?[{environmentId:e.environmentId,label:e.label,previous:t,patch:t.worktreeCleanup!=null&&i.storageCleanup&&Object.keys(i.storageCleanup).some(e=>e.startsWith(`worktree`))?{...i,worktreeCleanup:{mode:`custom`,rules:{...B(t,null),...Object.fromEntries(Object.entries(i.storageCleanup).filter(([e])=>e.startsWith(`worktree`)))}}}:i}]:[]}):[],d=Object.keys(r).length>0;return{clientPatch:r,hasClientWrite:d,serverWrites:u,unavailableReason:d||u.length>0||Object.keys(n).length===0?null:e.kind===`unavailable`?e.message:l.length>0?`This setting is environment-wide and cannot be overridden by a project.`:c?`Connect the selected checkouts, or update their environments, to save a project override.`:`Connect ${e.kind===`environment`?e.label:`an environment`} to save this setting.`}}function Ve(e,t,n){let r=e.kind===`project`||e.kind===`checkout`?ze(e,t,(e,t,r)=>U(t,r,n)):[];return{clientPatch:{},hasClientWrite:!1,serverWrites:r,unavailableReason:r.length>0?null:`Connect the selected checkouts, or update their environments, to reset this override.`}}function He(e,t){let n=t.filter($);return n.length===0?[]:e.flatMap(e=>{let t=e.serverConfig?.settings.projectSettingsOverrides;return t?Object.entries(t).flatMap(([t,r])=>n.some(e=>Object.hasOwn(r,e))?[{environmentId:e.environmentId,projectId:t}]:[]):[]})}function Ue(e,t,n){let r=new Map(e.map(e=>[e.environmentId,e])),i=new Map;for(let{environmentId:e,projectId:a}of t){let t=r.get(e);if(!t?.serverConfig||t.connection.phase!==`connected`)continue;let o=t.serverConfig.settings,s=i.get(e);i.set(e,{environmentId:e,label:t.label,previous:o,patch:{projectSettingsOverrides:{...s?.patch.projectSettingsOverrides,[a]:U(o,a,n)}}})}let a=[...i.values()];return{clientPatch:{},hasClientWrite:!1,serverWrites:a,unavailableReason:a.length>0?null:`Connect the environments to reset these overrides.`}}function We(e,t,n){if(e===null)return t!=null&&ne(n,t);if(Pe(e)&&!Array.isArray(t)&&!Array.isArray(n)){let r=(e,t)=>Pe(e)?e[t]:void 0;return Object.entries(e).some(([e,i])=>We(i,r(t,e),r(n,e)))}return!(typeof e==`string`&&typeof t==`string`?e.trim()===t:ne(e,t))&&ne(n,t)}function Ge(e,t){return t===void 0?[]:Object.entries(e.patch).flatMap(([n,r])=>We(r,e.previous[n],t[n])?[n]:[])}async function Ke(e,t,n){e.hasClientWrite&&n(e.clientPatch);let r=await Promise.allSettled(e.serverWrites.map(({environmentId:e,patch:n})=>t({environmentId:e,input:{patch:n}}))),i=t=>{let n=r[t];return n?.status===`fulfilled`&&n.value._tag===`Success`&&Ge(e.serverWrites[t],n.value.value).length===0},a=e.serverWrites.flatMap((e,t)=>{if(i(t))return[];let n=r[t];if(n?.status===`fulfilled`&&n.value._tag===`Success`)return[{...e,message:`This environment does not support this setting. Update P4 Code on it.`}];let a=n?.status===`rejected`?n.reason:n?.status===`fulfilled`&&n.value.cause?S(n.value.cause):void 0;return[{...e,message:a instanceof Error?a.message:`The save failed. Try reconnecting and saving again.`}]}),o=e.serverWrites.filter((e,t)=>i(t));return{failedEnvironments:a,savedEnvironments:o,savedEnvironmentCount:o.length}}function qe(e){let t=e=>typeof e==`string`&&e.trim().length>0?e:void 0,n=t(e.project),r=t(e.machine),i=t(e.checkout);return{...n===void 0?{}:{project:n},...r===void 0?{}:{machine:r},...i===void 0?{}:{checkout:i}}}function Je(e,t,n){let r=(e,t)=>({kind:`unavailable`,reason:e,label:`Unavailable selection`,message:t,members:[],environmentIds:[]});if(e.checkout&&!e.project)return r(`project-required`,`Select a project to choose one of its checkouts.`);let i=n.find(t=>t.environmentId===e.machine);if(e.machine&&!i)return r(`environment-missing`,`This environment is no longer available.`);if(e.project){let a=t.find(t=>t.projectKey===e.project);if(!a)return r(`project-missing`,`This project is no longer available.`);let o=a.memberProjects.filter(t=>(e.machine===void 0||t.environmentId===e.machine)&&(e.checkout===void 0||t.physicalProjectKey===e.checkout));if(o.length===0)return r(`checkout-missing`,e.checkout?`This checkout is no longer available in the selected project and environment.`:`This project has no checkout on this environment.`);if(e.checkout){let e=o[0],t=n.find(t=>t.environmentId===e.environmentId);if(!t)return r(`environment-missing`,`This checkout's environment is no longer available.`);let i=a.memberProjects.some(t=>t.environmentId===e.environmentId&&t.physicalProjectKey!==e.physicalProjectKey);return{kind:`checkout`,group:a,checkout:e,environmentId:e.environmentId,label:`${a.displayName} / ${t.label}${i?` · ${e.workspaceRoot}`:``}`,members:o,environmentIds:[e.environmentId]}}return{kind:`project`,group:a,environmentId:i?.environmentId??null,label:`${a.displayName} / ${i?.label??`All checkouts`}`,members:o,environmentIds:[...new Set(o.map(e=>e.environmentId))]}}return i?{kind:`environment`,environmentId:i.environmentId,label:i.label,members:[],environmentIds:[i.environmentId]}:{kind:`all`,label:`All environments`,members:[],environmentIds:n.map(e=>e.environmentId)}}function Ye(e,t){return t.some(t=>t.environmentId!==e.environmentId&&t.label===e.label)?`${e.label} · ${e.displayUrl??e.environmentId}`:e.label}function Xe(e,t){return e.machine??t??`all`}function Ze(e){return e.project??`all`}function Qe(e,t){let n={};return e.project&&(n.project=e.project),t!==`all`&&(n.machine=t),n}function $e(e,t){let n={};return t!==`all`&&(n.project=t),e.machine&&(n.machine=e.machine),n}function et(e,t,n,r){if(e.machine||t.kind===`unavailable`)return e;let i=new Set(t.environmentIds),a=n.filter(e=>i.has(e.environmentId)),o=a.find(e=>e.environmentId===r)??a.find(e=>e.connection.phase===`connected`)??a[0];return o?{...e,machine:o.environmentId}:e}function tt(e){let t=(0,J.c)(5),n;t[0]!==e.kind||t[1]!==e.members?(n=e.kind===`project`||e.kind===`checkout`?e.members:[],t[0]=e.kind,t[1]=e.members,t[2]=n):n=t[2];let r=n,o;return t[3]===r?o=t[4]:(o=i(e=>{let t=new Map;for(let n of r){let r=e(De(n.environmentId,n.workspaceRoot,a));if(r.waiting)continue;let i=c(D(r)),o=e(z(n.environmentId,n.workspaceRoot,`p4.json`))?.data??e(z(n.environmentId,n.workspaceRoot,i?.relativePath??`p4.json`))?.data??i;t.set(n.physicalProjectKey,o===null||o.truncated?null:W(o.contents))}return t}),t[3]=r,t[4]=o),h(o)}function nt(e,t){let n=(0,J.c)(24),r=Q(),{environments:i}=I(),a=de(),o;n[0]!==i||n[1]!==r||n[2]!==a||n[3]!==e||n[4]!==t?(o=t?et(e,Je(e,r,i),i,a):e,n[0]=i,n[1]=r,n[2]=a,n[3]=e,n[4]=t,n[5]=o):o=n[5];let s=o,c;n[6]!==i||n[7]!==r||n[8]!==s?(c=Je(s,r,i),n[6]=i,n[7]=r,n[8]=s,n[9]=c):c=n[9];let l=c,u=tt(l),d,f,p;n[10]!==i||n[11]!==a||n[12]!==u||n[13]!==l?(d=Fe(l,i,a),p=Ie(l,d.connectedEnvironments,u),f=p.find(e=>e.environmentId===d.environment?.environmentId)??p[0]??null,n[10]=i,n[11]=a,n[12]=u,n[13]=l,n[14]=d,n[15]=f,n[16]=p):(d=n[14],f=n[15],p=n[16]);let m=f,h;return n[17]!==r||n[18]!==l||n[19]!==s||n[20]!==d||n[21]!==m||n[22]!==p?(h={scope:l,groups:r,search:s,...d,targets:p,target:m},n[17]=r,n[18]=l,n[19]=s,n[20]=d,n[21]=m,n[22]=p,n[23]=h):h=n[23],h}var rt=(0,Z.createContext)(null);function it(e){let t=(0,J.c)(7),{search:n,onChange:r,children:i,singleEnvironment:a}=e,o=a!==void 0&&a,s=nt(n,o),c;t[0]!==r||t[1]!==s||t[2]!==o?(c={...s,singleEnvironment:o,selectScope:r},t[0]=r,t[1]=s,t[2]=o,t[3]=c):c=t[3];let l=c,u;return t[4]!==i||t[5]!==l?(u=(0,Y.jsx)(rt,{value:l,children:i}),t[4]=i,t[5]=l,t[6]=u):u=t[6],u}function at(){return(0,Z.useContext)(rt)}function ot(){let e=at();if(e===null)throw Error(`Settings scope must be read inside SettingsScopeProvider.`);return e}var st=new Set([`/settings/appearance`,`/settings/snap-shot`,`/settings/connections`]);function ct(){let e=(0,J.c)(20),t=at(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={select:lt},e[0]=n):n=e[0];let r=F(n),{environments:i}=I();if(t===null||st.has(r))return null;let a;e[1]!==i||e[2]!==t.groups||e[3]!==t.search||e[4]!==t.selectScope||e[5]!==t.singleEnvironment?(a={value:t.search,singleEnvironment:t.singleEnvironment,groups:t.groups,environments:i,onChange:t.selectScope},e[1]=i,e[2]=t.groups,e[3]=t.search,e[4]=t.selectScope,e[5]=t.singleEnvironment,e[6]=a):a=e[6];let o=a,s;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(`span`,{className:`shrink-0`,children:`Applying settings for`}),e[7]=s):s=e[7];let c;e[8]===o?c=e[9]:(c=(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[s,(0,Y.jsx)(ft,{...o})]}),e[8]=o,e[9]=c);let l=t.search.machine||t.scope.kind===`checkout`?`on`:`across`,u;e[10]===l?u=e[11]:(u=(0,Y.jsx)(`span`,{className:`shrink-0`,children:l}),e[10]=l,e[11]=u);let d;e[12]===o?d=e[13]:(d=(0,Y.jsx)(dt,{...o}),e[12]=o,e[13]=d);let f;e[14]!==u||e[15]!==d?(f=(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[u,d]}),e[14]=u,e[15]=d,e[16]=f):f=e[16];let p;return e[17]!==c||e[18]!==f?(p=(0,Y.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1 px-3 text-base text-muted-foreground sm:px-4`,children:[c,f]}),e[17]=c,e[18]=f,e[19]=p):p=e[19],p}function lt(e){return e.pathname}function ut(e){let t=(0,J.c)(13),{ariaLabel:n,icon:r,label:i,children:a}=e,o=`${n}: ${i}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Y.jsx)(O,{tone:`picker`}),t[0]=s):s=t[0];let c;t[1]===i?c=t[2]:(c=(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:i}),t[1]=i,t[2]=c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(M,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),t[3]=l):l=t[3];let u;t[4]!==r||t[5]!==o||t[6]!==c?(u=(0,Y.jsxs)(x,{"aria-label":o,render:s,className:`min-w-0 max-w-72`,children:[r,c,l]}),t[4]=r,t[5]=o,t[6]=c,t[7]=u):u=t[7];let d;t[8]===a?d=t[9]:(d=(0,Y.jsx)(v,{align:`start`,children:a}),t[8]=a,t[9]=d);let f;return t[10]!==u||t[11]!==d?(f=(0,Y.jsxs)(_,{children:[u,d]}),t[10]=u,t[11]=d,t[12]=f):f=t[12],f}function dt(e){let t=(0,J.c)(31),{value:r,groups:i,environments:a,onChange:o,singleEnvironment:s}=e,c;if(t[0]!==a||t[1]!==i||t[2]!==r){let e=Je(r,i,a);c=Xe(r,e.kind===`checkout`?e.environmentId:null),t[0]=a,t[1]=i,t[2]=r,t[3]=c}else c=t[3];let l=c,u,f,p,m;if(t[4]!==l||t[5]!==a||t[6]!==s){let e;t[11]===l?e=t[12]:(e=e=>e.environmentId===l,t[11]=l,t[12]=e);let n=a.find(e);u=ut,f=`Environment scope`,p=n?(0,Y.jsx)(K,{"aria-hidden":!0,kind:b(n.serverConfig),className:`size-3.5 shrink-0`}):null,m=n?Ye(n,a):l===`all`?s?`No environments`:`All environments`:`Unavailable environment`,t[4]=l,t[5]=a,t[6]=s,t[7]=u,t[8]=f,t[9]=p,t[10]=m}else u=t[7],f=t[8],p=t[9],m=t[10];let h;t[13]!==o||t[14]!==r?(h=e=>{typeof e==`string`&&o(Qe(r,e))},t[13]=o,t[14]=r,t[15]=h):h=t[15];let g;t[16]===s?g=t[17]:(g=s?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(d,{value:`all`,closeOnClick:!0,children:(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(N,{"aria-hidden":!0,className:`size-3.5`}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`All environments`}),(0,Y.jsx)(n,{})]})}),(0,Y.jsx)(w,{})]}),t[16]=s,t[17]=g);let _;t[18]===a?_=t[19]:(_=a.map(e=>(0,Y.jsx)(d,{value:e.environmentId,closeOnClick:!0,children:(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(K,{"aria-hidden":!0,kind:b(e.serverConfig),className:`size-3.5`}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Ye(e,a)}),e.connection.phase===`connected`?null:(0,Y.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:`Offline`}),(0,Y.jsx)(n,{})]})},e.environmentId)),t[18]=a,t[19]=_);let v;t[20]!==l||t[21]!==h||t[22]!==g||t[23]!==_?(v=(0,Y.jsxs)(y,{value:l,onValueChange:h,children:[g,_]}),t[20]=l,t[21]=h,t[22]=g,t[23]=_,t[24]=v):v=t[24];let x;return t[25]!==u||t[26]!==f||t[27]!==p||t[28]!==m||t[29]!==v?(x=(0,Y.jsx)(u,{ariaLabel:f,icon:p,label:m,children:v}),t[25]=u,t[26]=f,t[27]=p,t[28]=m,t[29]=v,t[30]=x):x=t[30],x}function ft(e){let t=(0,J.c)(24),{value:r,groups:i,onChange:a}=e,o;if(t[0]!==i||t[1]!==r){let e;t[3]===r?e=t[4]:(e=e=>e.projectKey===r.project,t[3]=r,t[4]=e),o=i.find(e),t[0]=i,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]===s?c=t[6]:(c=s?(0,Y.jsx)(R,{project:s,className:`size-3.5 shrink-0`}):null,t[5]=s,t[6]=c);let l=s?.displayName??(r.project?`Unavailable project`:`All projects`),u;t[7]===r?u=t[8]:(u=Ze(r),t[7]=r,t[8]=u);let f;t[9]!==a||t[10]!==r?(f=e=>{typeof e==`string`&&a($e(r,e))},t[9]=a,t[10]=r,t[11]=f):f=t[11];let p,m;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsx)(d,{value:`all`,closeOnClick:!0,children:(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`All projects`}),(0,Y.jsx)(n,{})]})}),m=(0,Y.jsx)(w,{}),t[12]=p,t[13]=m):(p=t[12],m=t[13]);let h;t[14]===i?h=t[15]:(h=i.map(pt),t[14]=i,t[15]=h);let g;t[16]!==u||t[17]!==f||t[18]!==h?(g=(0,Y.jsxs)(y,{value:u,onValueChange:f,children:[p,m,h]}),t[16]=u,t[17]=f,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==c||t[21]!==l||t[22]!==g?(_=(0,Y.jsx)(ut,{ariaLabel:`Project scope`,icon:c,label:l,children:g}),t[20]=c,t[21]=l,t[22]=g,t[23]=_):_=t[23],_}function pt(e){return(0,Y.jsx)(d,{value:e.projectKey,closeOnClick:!0,children:(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(R,{project:e,className:`size-3.5`}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.displayName}),(0,Y.jsx)(n,{})]})},e.projectKey)}function mt(e){let t=(0,J.c)(6),{target:n}=ot(),r=L(),i=n?.settings??T;he(n?.environmentId??null,n?.settings??null);let a;t[0]!==r||t[1]!==i?(a=me(i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=a,s;return t[3]!==e||t[4]!==o?(s=e?e(o):o,t[3]=e,t[4]=o,t[5]=s):s=t[5],s}function ht(e){let t=(0,J.c)(3),{targets:n}=ot(),r;return t[0]!==e||t[1]!==n?(r=Le(n,e),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function gt(e){let t=(0,J.c)(3),{targets:n}=ot(),r;return t[0]!==e||t[1]!==n?(r=Re(n,e),t[0]=e,t[1]=n,t[2]=r):r=t[2],r}function _t(){let e=(0,J.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={reportFailure:!1},e[0]=t):t=e[0];let n=xe(_e.updateSettings,t),r;return e[1]===n?r=e[2]:(r=e=>{if(e.unavailableReason){le.add({type:`warning`,title:`Setting not saved`,description:e.unavailableReason});return}Ke(e,async e=>{let t=m(e.input.patch).find(t=>!ye(e.environmentId,t));return t?te(g(new o({requiredScope:t,message:`This connection lacks permission to change these settings.`}))):n(e)},fe).then(vt)},e[1]=n,e[2]=r),r}function vt(e){let{failedEnvironments:t,savedEnvironments:n,savedEnvironmentCount:r}=e;t.length!==0&&le.add({type:`error`,title:r>0?`Setting saved on some environments`:`Setting not saved`,description:[...t.map(bt),...r>0?[`Saved on ${n.map(yt).join(`, `)}.`]:[]].join(`
2
+ `)})}function yt(e){let{label:t}=e;return t}function bt(e){let{label:t,message:n}=e;return`Could not save on ${t}: ${n}`}function xt(){let e=(0,J.c)(4),{scope:t,environments:n}=ot(),r=_t(),i;return e[0]!==n||e[1]!==r||e[2]!==t?(i=e=>r(Be(t,n,e)),e[0]=n,e[1]=r,e[2]=t,e[3]=i):i=e[3],i}function St(){let e=(0,J.c)(3),t=at(),n=_t(),r;return e[0]!==t||e[1]!==n?(r=e=>{t!==null&&n(Ve(t.scope,t.environments,e))},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}function Ct(){let e=(0,J.c)(3),t=at(),n=_t(),r;return e[0]!==t||e[1]!==n?(r=(e,r)=>{t!==null&&n(Ue(t.environments,e,r))},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}function wt(){let e=(0,J.c)(3),{connectedEnvironments:t}=ot(),n=be(t,r),i;return e[0]!==t||e[1]!==n?(i=t.length>0&&t.every(e=>n.has(e.environmentId)),e[0]=t,e[1]=n,e[2]=i):i=e[2],i}p([`local`,`worktree`]);var Tt=new Set([`local`,`local environment`]);function Et(e){let t=e?.trim();return t&&t.length>0?t:null}function Dt(e){let t=Et(e.runtimeLabel),n=Et(e.savedLabel);return e.isPrimary?[t,n].find(e=>e?!Tt.has(e.toLowerCase()):!1)??`This device`:t??n??e.environmentId}function Ot(e){return e.canPickEnvironment?!0:e.activeEnvironment!==null&&!e.activeEnvironment.isPrimary}function kt(e){return e.hasActiveProject&&(e.isDraftHeroState||e.persistInActiveThreads)&&(e.isGitRepo||e.showEnvironmentIndicator||e.hostsRestingComposerControls)}var At=16;function jt(e){return e.compact?e.neededWidth>e.availableWidth-At:e.neededWidth>e.availableWidth}function Mt(e){return e===`worktree`?`New worktree`:`Current checkout`}var Nt={recursive:`Recursive`,"top-level":`Top level only`,none:`Skip`};function Pt(e){return e?`Current worktree`:Mt(`local`)}function Ft(e,t){return e?`Worktree`:t===`worktree`?Mt(`worktree`):`Local checkout`}function It(e){let t=null;for(let n of e.threads){if(!n.worktreePath||n.worktreePath===e.currentWorktreePath||(n.archivedAt??null)!==null)continue;let r=Ce(n.updatedAt);r!==null&&(t===null||r>t.updatedAt)&&(t={branch:n.branch,worktreePath:n.worktreePath,updatedAt:r})}return t===null?null:{branch:t.branch,worktreePath:t.worktreePath}}function Lt(e){return e.branch?`Previous worktree (${e.branch})`:`Previous worktree`}function Rt(e){let{activeWorktreePath:t,hasServerThread:n,draftThreadEnvMode:r,preparingWorktree:i}=e;return n?t||i?`worktree`:`local`:t?`local`:r===`worktree`?`worktree`:`local`}function zt(e){let{nextWorktreePath:t,currentWorktreePath:n,effectiveEnvMode:r}=e;return t||r===`worktree`&&!n?`worktree`:`local`}function Bt(e){let{envMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return t===`worktree`&&!n?r??i:i??r}function Vt(e){let{activeWorktreePath:t,effectiveEnvMode:n,resolvedActiveBranch:r,resolvedActiveBranchIsRemote:i,startFromOrigin:a}=e;return r?n===`worktree`&&!t?`From ${a&&i===!1?`origin/${r}`:r}`:r:`Select ref`}function Ht(e){return e.activeThreadBranch===e.resolvedActiveBranch?e.activeThreadBranch:null}function Ut(e){let{effectiveEnvMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return t!==`local`||n!==null||!r||!i||r===i?null:{threadBranch:r,currentBranch:i}}function Wt(e){let{activeProjectCwd:t,activeWorktreePath:n,refName:r}=e;if(r.worktreePath)return{checkoutCwd:r.worktreePath,nextWorktreePath:r.worktreePath===t?null:r.worktreePath,reuseExistingWorktree:!0};let i=n!==null&&r.isDefault?null:n;return{checkoutCwd:i??t,nextWorktreePath:i,reuseExistingWorktree:!1}}function Gt(e){let{itemValue:t,normalizedQuery:n,createBranchItemValue:r,checkoutPullRequestItemValue:i}=e;if(n.length===0||r&&t===r||i&&t===i)return!0;let a=t.toLowerCase();if(a.includes(n))return!0;let o=Se(n);return o.length>0&&o!==n&&a.includes(o)}var Kt={repo_conventions:`Repository conventions`,conventional_commits:`Conventional Commits`,custom:`Custom instructions`};function qt(e,t){if(t==null)return e===`pullRequestMergeMethod`?`Last selected`:e===`sidebarAutoSettleAfterDays`?`Never`:e===`defaultModelSelection`?`Automatic`:e===`sourceControlWriterModelSelection`?`Text generation model`:e===`reviewGuideModelSelection`?`Source control writer model`:e===`defaultThreadEnvMode`||e===`worktreeSubmodules`?`Inherit`:`Not set`;if(typeof t==`boolean`)return t?`On`:`Off`;if(typeof t==`number`)return e===`sidebarAutoSettleAfterDays`?`${t} ${t===1?`day`:`days`}`:String(t);if(typeof t==`string`)return e===`defaultThreadEnvMode`&&(t===`local`||t===`worktree`)?Mt(t):e===`worktreeSubmodules`&&t in Nt?Nt[t]:e===`pullRequestMergeMethod`&&t in Oe?Oe[t]:t===``?`Empty`:t;if(Array.isArray(t))return`${t.length} ${t.length===1?`item`:`items`}`;if(typeof t==`object`){if(`model`in t&&typeof t.model==`string`)return t.model;if(`mode`in t&&typeof t.mode==`string`)return Kt[t.mode]??t.mode}return`Custom`}function Jt(e,t,n){let r=t[n],i=$(n)?e.sources[n]:`environment`,a=!ne(r,T[n]),o=Yt(n),s=[];e.projectId!==null&&$(n)&&s.push({key:`project`,label:`Project`,value:i===`project`?qt(n,e.settings[n]):`Inherits`,effective:i===`project`,set:i===`project`}),s.push({key:`environment`,label:e.label,value:a?qt(n,r):`Inherits`,effective:i===`environment`&&a,set:a}),o&&e.projectId!==null&&s.push({key:`p4.json`,label:`p4.json`,value:i===`p4.json`?qt(n,e.settings[n]):`Inherits`,effective:i===`p4.json`,set:i===`p4.json`});let c=o?f[n].builtIn:T[n];return s.push({key:`built-in`,label:`Default`,value:qt(n,c),effective:i===`environment`&&!a,set:!0}),s}function Yt(e){return Object.hasOwn(f,e)}function Xt(e){let t=(0,J.c)(52),{state:n,summary:r,targets:i,environments:a,keys:o,overridingProjects:s,onClearOverrides:c}=e,l;t[0]===s?l=t[1]:(l=s===void 0?[]:s,t[0]=s,t[1]=l);let u=l,d=o[0];if(!d||i.length===0)return null;let f=u.length>0?`${r} · ${u.length} project ${u.length===1?`override`:`overrides`}`:r,p,m,h,g,_,v,y,x;if(t[2]!==a||t[3]!==d||t[4]!==c||t[5]!==f||t[6]!==u||t[7]!==n||t[8]!==i){let e;t[17]!==a||t[18]!==d?(e=e=>{let t=a.find(t=>t.environmentId===e.environmentId);return t?.serverConfig?[{target:e,environment:{...t,serverConfig:t.serverConfig},machine:b(t.serverConfig),layers:Jt(e,t.serverConfig.settings,d)}]:[]},t[17]=a,t[18]=d,t[19]=e):e=t[19];let r=i.flatMap(e);m=Ee;let o=`${f}. Show where this value comes from`,s;t[20]===o?s=t[21]:(s=(0,Y.jsx)(Te,{render:(0,Y.jsx)(ee,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":o})}),t[20]=o,t[21]=s);let l=n===`overridden`&&`text-primary`,S=n===`mixed`&&`text-warning`,C;t[22]!==l||t[23]!==S?(C=k(`size-3`,l,S),t[22]=l,t[23]=S,t[24]=C):C=t[24];let w;t[25]===C?w=t[26]:(w=(0,Y.jsx)(N,{className:C}),t[25]=C,t[26]=w);let T;t[27]!==s||t[28]!==w?(T=(0,Y.jsx)(ae,{render:s,children:w}),t[27]=s,t[28]=w,t[29]=T):T=t[29];let E;t[30]===f?E=t[31]:(E=(0,Y.jsx)(oe,{side:`top`,children:f}),t[30]=f,t[31]=E),t[32]!==T||t[33]!==E?(x=(0,Y.jsxs)(se,{children:[T,E]}),t[32]=T,t[33]=E,t[34]=x):x=t[34],p=we,_=`start`,v=`md`,y=`none`,h=`divide-y divide-border/60`;let D;t[35]!==d||t[36]!==c||t[37]!==u?(D=e=>{let{target:t,environment:n,machine:r,layers:i}=e;return(0,Y.jsxs)(`section`,{className:`px-3 py-2.5`,children:[(0,Y.jsxs)(`h4`,{className:`flex items-center gap-1.5 pb-1.5 text-xs font-medium text-muted-foreground`,children:[(0,Y.jsx)(K,{"aria-hidden":!0,kind:r,className:`size-3.5 shrink-0`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label})]}),(0,Y.jsx)(`ol`,{role:`list`,className:`text-sm`,children:i.map(Zt)}),(()=>{let e=u.filter(e=>e.environmentId===t.environmentId);if(e.length===0)return null;let r=n.serverConfig.settings.projectSettingsOverrides;return(0,Y.jsxs)(`div`,{className:`mt-2 border-t border-border/60 pt-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(`span`,{children:`Overridden by`}),c?(0,Y.jsxs)(O,{onClick:()=>c(e),children:[`Reset `,e.length===1?`it`:`all`]}):null]}),(0,Y.jsx)(`ul`,{role:`list`,className:`mt-0.5 text-sm`,children:e.map(e=>(0,Y.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 px-2 py-1`,children:[(0,Y.jsx)(O,{className:`min-w-0 justify-start`,onClick:e.open,children:(0,Y.jsx)(`span`,{className:`truncate`,children:e.label})}),(0,Y.jsx)(`span`,{className:`max-w-32 truncate text-muted-foreground tabular-nums`,children:$(d)?qt(d,r[e.projectId]?.[d]):null})]},e.projectId))})]})})()]},`${t.environmentId}:${t.projectId??``}`)},t[35]=d,t[36]=c,t[37]=u,t[38]=D):D=t[38],g=r.map(D),t[2]=a,t[3]=d,t[4]=c,t[5]=f,t[6]=u,t[7]=n,t[8]=i,t[9]=p,t[10]=m,t[11]=h,t[12]=g,t[13]=_,t[14]=v,t[15]=y,t[16]=x}else p=t[9],m=t[10],h=t[11],g=t[12],_=t[13],v=t[14],y=t[15],x=t[16];let S;t[39]!==h||t[40]!==g?(S=(0,Y.jsx)(`div`,{className:h,children:g}),t[39]=h,t[40]=g,t[41]=S):S=t[41];let C;t[42]!==p||t[43]!==_||t[44]!==v||t[45]!==y||t[46]!==S?(C=(0,Y.jsx)(p,{align:_,width:v,padding:y,children:S}),t[42]=p,t[43]=_,t[44]=v,t[45]=y,t[46]=S,t[47]=C):C=t[47];let w;return t[48]!==m||t[49]!==C||t[50]!==x?(w=(0,Y.jsxs)(m,{children:[x,C]}),t[48]=m,t[49]=C,t[50]=x,t[51]=w):w=t[51],w}function Zt(e){return(0,Y.jsxs)(`li`,{className:k(`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,Y.jsx)(`span`,{className:k(`min-w-0 truncate`,e.effective?`font-medium text-foreground`:`text-muted-foreground`),children:e.key===`environment`?`Environment`:e.label}),(0,Y.jsxs)(`span`,{className:k(`flex items-center gap-1.5 tabular-nums`,e.effective?`text-foreground`:e.set?`text-muted-foreground`:`text-muted-foreground/60`),children:[(0,Y.jsx)(`span`,{className:`max-w-32 truncate`,children:e.value}),e.effective?(0,Y.jsx)(j,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-primary`}):(0,Y.jsx)(`span`,{"aria-hidden":!0,className:`size-3.5 shrink-0`})]})]},e.key)}var Qt=[],$t=()=>void 0,en=(0,Z.createContext)({targetId:null,highlightTarget:!0,onTargetHandled:$t});function tn(e){let t=(0,J.c)(7),{targetId:n,highlightTarget:r,onTargetHandled:i,children:a}=e,o=r===void 0||r,s=i===void 0?$t:i,c;t[0]!==o||t[1]!==s||t[2]!==n?(c={targetId:n,highlightTarget:o,onTargetHandled:s},t[0]=o,t[1]=s,t[2]=n,t[3]=c):c=t[3];let l=c,u;return t[4]!==a||t[5]!==l?(u=(0,Y.jsx)(en,{value:l,children:a}),t[4]=a,t[5]=l,t[6]=u):u=t[6],u}function nn(e,t=!0){let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;((typeof e.querySelector==`function`?e.querySelector(`:scope > [data-settings-scroll-target]`):null)??(e.tagName===`SECTION`&&e.firstElementChild?e.firstElementChild:e)).scrollIntoView({behavior:n?`auto`:`smooth`,block:`center`}),e.focus({preventScroll:!0}),e.classList.remove(`settings-search-target-pulse`),t&&!n&&(e.offsetWidth,e.classList.add(`settings-search-target-pulse`),e.addEventListener(`blur`,()=>e.classList.remove(`settings-search-target-pulse`),{once:!0}))}function rn(){return(0,Z.useContext)(en).targetId}function an(e){let t=(0,J.c)(4),{targetId:n,highlightTarget:r,onTargetHandled:i}=(0,Z.useContext)(en),a=e!==void 0&&e===n,o;return t[0]!==r||t[1]!==a||t[2]!==i?(o=e=>{e&&a&&(nn(e,r),i())},t[0]=r,t[1]=a,t[2]=i,t[3]=o):o=t[3],o}function on(e){let t=(0,J.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i=an(r.id),a=r.id?-1:r.tabIndex,o;return t[3]!==n||t[4]!==a||t[5]!==r||t[6]!==i?(o=(0,Y.jsx)(`div`,{...r,ref:i,tabIndex:a,children:n}),t[3]=n,t[4]=a,t[5]=r,t[6]=i,t[7]=o):o=t[7],o}var sn=`min-w-0 max-w-none shrink-0`;function cn(e){let t=(0,J.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Y.jsx)(ae,{delay:200,render:(0,Y.jsx)(ee,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`Background policy details`,children:(0,Y.jsx)(re,{className:`size-3.5`})})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,Y.jsxs)(se,{children:[r,(0,Y.jsx)(oe,{side:`top`,children:n})]}),t[1]=n,t[2]=i),i}function ln(e){let t=(0,J.c)(3),n=e===void 0?1e3:e,[r,i]=(0,Z.useState)(un),a,o;return t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=setInterval(()=>i(Date.now()),n);return()=>clearInterval(e)},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,Z.useEffect)(a,o),r}function un(){return Date.now()}function dn(e){let t=(0,J.c)(30),n,r,i,a,o,s,c,l,u;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9]):({title:l,hideTitle:s,icon:a,titleAction:u,headerAction:i,variant:c,children:n,className:r,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u);let d=s!==void 0&&s,f=c===void 0?`grouped`:c,p=an(o.id),m=o.id?-1:o.tabIndex,h=!d&&`space-y-2.5`,g;t[10]!==r||t[11]!==h?(g=k(h,r),t[10]=r,t[11]=h,t[12]=g):g=t[12];let _;t[13]!==i||t[14]!==d||t[15]!==a||t[16]!==l||t[17]!==u?(_=d?(0,Y.jsx)(`h2`,{className:`sr-only`,children:l}):(0,Y.jsxs)(`div`,{"data-settings-scroll-target":!0,className:`flex min-h-7 items-start justify-between gap-4 px-3 sm:px-4`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Y.jsxs)(`h2`,{className:`flex min-h-7 items-center gap-2 text-sm font-normal text-foreground/70`,children:[a,l]}),u]}),(0,Y.jsx)(`div`,{className:`flex min-h-7 min-w-7 items-center justify-end`,children:i})]}),t[13]=i,t[14]=d,t[15]=a,t[16]=l,t[17]=u,t[18]=_):_=t[18];let v=d?``:void 0,y;t[19]!==n||t[20]!==v||t[21]!==f?(y=(0,Y.jsx)(X,{"data-settings-scroll-target":v,variant:f,children:n}),t[19]=n,t[20]=v,t[21]=f,t[22]=y):y=t[22];let b;return t[23]!==o||t[24]!==m||t[25]!==g||t[26]!==_||t[27]!==y||t[28]!==p?(b=(0,Y.jsxs)(`section`,{...o,ref:p,tabIndex:m,className:g,children:[_,y]}),t[23]=o,t[24]=m,t[25]=g,t[26]=_,t[27]=y,t[28]=p,t[29]=b):b=t[29],b}function fn(e){let t=(0,J.c)(8),{children:n,message:r}=e;if(r===void 0)return n;let i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(re,{className:`mt-0.5 size-3.5 shrink-0 text-warning`}),t[0]=i):i=t[0];let a;t[1]===r?a=t[2]:(a=(0,Y.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-2 text-xs leading-relaxed text-muted-foreground sm:px-4`,children:[i,(0,Y.jsx)(`p`,{children:r})]}),t[1]=r,t[2]=a);let o;t[3]===n?o=t[4]:(o=(0,Y.jsx)(`div`,{className:`[&_h3]:opacity-64 [&_p]:opacity-64`,children:n}),t[3]=n,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,Y.jsxs)(`div`,{className:`border-border/60 bg-muted/20 py-1.5`,children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function pn(e){let t=(0,J.c)(118),n,i,a,o,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],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],p=t[11],m=t[12]):({title:m,description:o,status:d,resetAction:l,onResetOverride:c,control:a,serverScoped:f,settingKeys:p,mixed:s,children:n,className:i,...u}=e,t[0]=e,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,t[11]=p,t[12]=m);let h=f!==void 0&&f,g=p===void 0?Qt:p,_=an(u.id),v=pe(),y=at(),b=de(),x=ue(),S=ve(b,r),C;t[13]===y?.connectedEnvironments?C=t[14]:(C=y?.connectedEnvironments??[],t[13]=y?.connectedEnvironments,t[14]=C);let w=be(C,r),E;t[15]!==y||t[16]!==S||t[17]!==w?(E=y?y.connectedEnvironments.length>0&&y.connectedEnvironments.every(e=>w.has(e.environmentId)):S,t[15]=y,t[16]=S,t[17]=w,t[18]=E):E=t[18];let D=E,ee=St(),te=Ct(),O=y!==null&&(y.scope.kind===`project`||y.scope.kind===`checkout`),A,j,M,re;if(t[19]!==y||t[20]!==O||t[21]!==s||t[22]!==h||t[23]!==g){M=g.filter($),A=O&&h&&M.length===0;let e;t[28]!==y||t[29]!==s||t[30]!==g?(e=s??(y!==null&&Le(y.targets,g)),t[28]=y,t[29]=s,t[30]=g,t[31]=e):e=t[31],j=e,re=y&&O?Re(y.targets,M):null,t[19]=y,t[20]=O,t[21]=s,t[22]=h,t[23]=g,t[24]=A,t[25]=j,t[26]=M,t[27]=re}else A=t[24],j=t[25],M=t[26],re=t[27];let N=re,P=h&&(!D||!(y?y.connectedEnvironments.length>0:v)),ie;t[32]!==y||t[33]!==N?(ie=N===`environment`&&y?.scope.environmentIds.length===1?y.environments.find(e=>e.environmentId===y.scope.environmentIds[0])?.label??`environment`:`environment`,t[32]=y,t[33]=N,t[34]=ie):ie=t[34];let ce=ie;y?.connectedEnvironments;let F;t[35]===y?.connectedEnvironments?F=t[36]:(F=new Map((y?.connectedEnvironments??[]).flatMap(hn)),t[35]=y?.connectedEnvironments,t[36]=F);let le=F,I;bb0:{if(y===null||O||M.length===0){let e;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[37]=e):e=t[37],I=e;break bb0}let e;if(t[38]!==y||t[39]!==M){let n;t[41]===y?n=t[42]:(n=e=>{let t=y.groups.find(t=>t.memberProjects.some(t=>t.environmentId===e.environmentId&&t.id===e.projectId));return t?[{...e,label:t.displayName,open:()=>y.selectScope({project:t.projectKey,...y.search.machine?{machine:y.search.machine}:{}})}]:[]},t[41]=y,t[42]=n),e=He(y.connectedEnvironments,M).flatMap(n),t[38]=y,t[39]=M,t[40]=e}else e=t[40];I=e}let fe=I,me;t[43]!==ee||t[44]!==O||t[45]!==c||t[46]!==l||t[47]!==M||t[48]!==N||t[49]!==m||t[50]!==P?(me=P?null:O&&M.length>0?N===`project`||N===`mixed`?(0,Y.jsx)(gn,{label:typeof m==`string`?m:`override`,tooltip:`Reset to inherited value`,onClick:()=>c?c():ee(M)}):null:l,t[43]=ee,t[44]=O,t[45]=c,t[46]=l,t[47]=M,t[48]=N,t[49]=m,t[50]=P,t[51]=me):me=t[51];let he=me,L;t[52]===a?L=t[53]:(L=e=>(0,Y.jsxs)(se,{children:[(0,Y.jsx)(ae,{render:(0,Y.jsx)(`span`,{tabIndex:0,className:`flex w-full items-center rounded-md outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring @min-[32rem]/settings-row:w-auto`}),children:(0,Y.jsx)(`div`,{inert:!0,className:`flex w-full items-center gap-2 opacity-50 @min-[32rem]/settings-row:w-auto`,children:a})}),(0,Y.jsx)(oe,{side:`top`,children:e})]}),t[52]=a,t[53]=L);let _e=L,ye;t[54]!==D||t[55]!==y||t[56]!==a||t[57]!==A||t[58]!==_e||t[59]!==x?.label||t[60]!==P||t[61]!==w?(ye=P&&a?_e(D?y?`Reconnect the selected environment to change this setting.`:ge:`This connection lacks permission to change settings on ${y?y.connectedEnvironments.filter(e=>!w.has(e.environmentId)).map(mn).join(`, `)||`the selected environment`:x?.label??`the primary environment`}.`):A&&a?_e(`Environment-wide setting. Select an environment to change it.`):a,t[54]=D,t[55]=y,t[56]=a,t[57]=A,t[58]=_e,t[59]=x?.label,t[60]=P,t[61]=w,t[62]=ye):ye=t[62];let xe=ye,Se;t[63]!==y||t[64]!==le||t[65]!==g?(Se=y!==null&&g.some(e=>y.targets.some(t=>{let n=le.get(t.environmentId);return n!==void 0&&!ne(n[e],T[e])})),t[63]=y,t[64]=le,t[65]=g,t[66]=Se):Se=t[66];let Ce=Se,we;t[67]!==Ce||t[68]!==ce||t[69]!==j||t[70]!==M||t[71]!==N?(we=j?{state:`mixed`,summary:`Mixed across selected environments`}:N===`project`?{state:`overridden`,summary:`Overridden for this project`}:N===`p4.json`?{state:`inherited`,summary:`Inherited from the repository's p4.json`}:N===`environment`&&M.length>0?{state:`inherited`,summary:`Inherited from ${ce}`}:Ce?{state:`environment`,summary:`Set on the environment`}:{state:`default`,summary:`Built-in default`},t[67]=Ce,t[68]=ce,t[69]=j,t[70]=M,t[71]=N,t[72]=we):we=t[72];let Te=we,Ee;t[73]!==D||t[74]!==te||t[75]!==y||t[76]!==Te||t[77]!==fe||t[78]!==M||t[79]!==h||t[80]!==g?(Ee=y&&h&&g.length>0?(0,Y.jsx)(Xt,{state:Te.state,summary:Te.summary,targets:y.targets,environments:y.connectedEnvironments,keys:g,overridingProjects:fe,...D?{onClearOverrides:e=>te(e,M)}:{}}):null,t[73]=D,t[74]=te,t[75]=y,t[76]=Te,t[77]=fe,t[78]=M,t[79]=h,t[80]=g,t[81]=Ee):Ee=t[81];let R=Ee,z=d,De=u.id?-1:u.tabIndex,Oe=n?`pt-3 pb-1`:`py-3`,B;t[82]!==i||t[83]!==Oe?(B=k(`@container/settings-row rounded-xl px-3 sm:px-4 aria-disabled:opacity-64 aria-disabled:[&_*]:text-muted-foreground`,Oe,i),t[82]=i,t[83]=Oe,t[84]=B):B=t[84];let V;t[85]===m?V=t[86]:(V=(0,Y.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:m}),t[85]=m,t[86]=V);let H;t[87]===R?H=t[88]:(H=R?(0,Y.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:R}):null,t[87]=R,t[88]=H);let U;t[89]===he?U=t[90]:(U=(0,Y.jsx)(`span`,{className:`inline-flex h-5 w-5 shrink-0 items-center justify-center`,children:he}),t[89]=he,t[90]=U);let W;t[91]!==V||t[92]!==H||t[93]!==U?(W=(0,Y.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[V,H,U]}),t[91]=V,t[92]=H,t[93]=U,t[94]=W):W=t[94];let G;t[95]===o?G=t[96]:(G=o?(0,Y.jsx)(`p`,{className:`max-w-xl text-xs leading-normal text-muted-foreground/80`,children:o}):null,t[95]=o,t[96]=G);let K;t[97]===z?K=t[98]:(K=z?(0,Y.jsx)(`div`,{className:`pt-0.5 text-xs text-muted-foreground`,children:z}):null,t[97]=z,t[98]=K);let q;t[99]!==W||t[100]!==G||t[101]!==K?(q=(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[W,G,K]}),t[99]=W,t[100]=G,t[101]=K,t[102]=q):q=t[102];let X;t[103]===xe?X=t[104]:(X=xe?(0,Y.jsx)(`div`,{className:`flex w-full min-w-0 shrink-0 items-center gap-2 @min-[32rem]/settings-row:w-auto @min-[32rem]/settings-row:justify-end`,children:xe}):null,t[103]=xe,t[104]=X);let Z;t[105]!==q||t[106]!==X?(Z=(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 @min-[32rem]/settings-row:grid @min-[32rem]/settings-row:grid-cols-[minmax(0,1fr)_minmax(10rem,auto)] @min-[32rem]/settings-row:items-center @min-[32rem]/settings-row:gap-8`,children:[q,X]}),t[105]=q,t[106]=X,t[107]=Z):Z=t[107];let Q;t[108]!==n||t[109]!==P?(Q=P&&n?(0,Y.jsx)(`div`,{inert:!0,className:`opacity-50`,children:n}):n,t[108]=n,t[109]=P,t[110]=Q):Q=t[110];let ke;return t[111]!==u||t[112]!==De||t[113]!==B||t[114]!==Z||t[115]!==Q||t[116]!==_?(ke=(0,Y.jsxs)(`div`,{...u,ref:_,tabIndex:De,"data-slot":`settings-row`,className:B,children:[Z,Q]}),t[111]=u,t[112]=De,t[113]=B,t[114]=Z,t[115]=Q,t[116]=_,t[117]=ke):ke=t[117],ke}function mn(e){return e.label}function hn(e){return e.serverConfig?[[e.environmentId,e.serverConfig.settings]]:[]}function gn(e){let t=(0,J.c)(12),{label:n,tooltip:r,disabled:i,onClick:a}=e,o=r===void 0?`Reset to default`:r,s=i!==void 0&&i,c=`Reset ${n} to default`,l;t[0]===a?l=t[1]:(l=e=>{e.stopPropagation(),a()},t[0]=a,t[1]=l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Y.jsx)(P,{className:`size-3`}),t[2]=u):u=t[2];let d;t[3]!==s||t[4]!==c||t[5]!==l?(d=(0,Y.jsx)(ae,{render:(0,Y.jsx)(ee,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":c,disabled:s,onClick:l,children:u})}),t[3]=s,t[4]=c,t[5]=l,t[6]=d):d=t[6];let f;t[7]===o?f=t[8]:(f=(0,Y.jsx)(oe,{side:`top`,children:o}),t[7]=o,t[8]=f);let p;return t[9]!==d||t[10]!==f?(p=(0,Y.jsxs)(se,{children:[d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11],p}function _n(e){let t=(0,J.c)(18),{children:n,className:r,width:i}=e,a=i===void 0?`readable`:i,o=ce(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={select:yn},t[0]=s):s=t[0];let c=F(s),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l={select:vn},t[1]=l):l=t[1];let u=F(l),d;t[2]===c?d=t[3]:(d=c.replace(/^#/,``)||null,t[2]=c,t[3]=d);let f=d,p;t[4]===o?p=t[5]:(p=()=>{o({hash:``,replace:!0,resetScroll:!1,hashScrollIntoView:!1,state:{settingsTargetHighlight:!0}})},t[4]=o,t[5]=p);let m=p,h;t[6]===r?h=t[7]:(h=k(`gap-8`,r),t[6]=r,t[7]=h);let g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsx)(ct,{}),t[8]=g):g=t[8];let _;t[9]!==n||t[10]!==h||t[11]!==a?(_=(0,Y.jsx)(`div`,{className:`topbar-scroll-fade scrollbar-gutter-both flex-1 overflow-y-auto`,"data-settings-page-scroll":!0,children:(0,Y.jsxs)(q,{width:a,className:h,children:[g,n]})}),t[9]=n,t[10]=h,t[11]=a,t[12]=_):_=t[12];let v;return t[13]!==m||t[14]!==u||t[15]!==_||t[16]!==f?(v=(0,Y.jsx)(tn,{targetId:f,highlightTarget:u,onTargetHandled:m,children:_}),t[13]=m,t[14]=u,t[15]=_,t[16]=f,t[17]=v):v=t[17],v}function vn(e){return e.state.settingsTargetHighlight!==!1}function yn(e){return e.hash}function bn(e,{highlight:t=!0}={}){let n=document.getElementById(e);return n?(nn(n,t),!0):!1}export{Ot as A,qe as B,Dt as C,It as D,Lt as E,wt as F,X as H,xt as I,st as L,gt as M,mt as N,Gt as O,ht as P,it as R,Mt as S,Ft as T,Q as V,Vt as _,pn as a,zt as b,fn as c,an as d,rn as f,Bt as g,Ht as h,_n as i,St as j,kt as k,bn as l,Wt as m,sn as n,on as o,Nt as p,gn as r,dn as s,cn as t,ln as u,jt as v,Ut as w,Rt as x,Pt as y,ot as z};
3
+ //# sourceMappingURL=settingsLayout-BzyY4qHt.js.map
@@ -0,0 +1 @@
1
+ import{Ua as e,Wa as t}from"./main-D9z9rMK1.js";export{t as __iconNode,e as default};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Rm as n,Sx as r,_s as i,do as a,hs as o,lr as s,ma as c,or as l,t as u,xx as d}from"./utils-geC9CGP4.js";import{t as f}from"./x-CSwbgjBe.js";import{a as p,c as m,n as h,t as g,u as _}from"./tooltip-Ciaezkl4.js";import{t as v}from"./input-BOT1WFGI.js";import{t as y}from"./scroll-area-Cj3OF_L_.js";import{a as b,c as x,l as S,n as C,o as w,r as T,s as E,t as D}from"./DialogTitle-Cwi7QOum.js";import{t as O}from"./useResizeDrag-KJl_F2EN.js";var k=e(t(),1),A=_(),j=r(),M=e(c(),1),N=T,P=b;function F(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`fixed inset-0 z-(--z-sheet) bg-background/60 backdrop-blur-xs transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(S,{className:i,"data-slot":`sheet-backdrop`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function I(e){let t=(0,j.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,side:i,variant:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=i===`bottom`&&`grid grid-rows-[1fr_auto] pt-12`,c=i===`top`&&`grid grid-rows-[auto_1fr] pb-12`,l=i===`left`&&`flex justify-start`,d=i===`right`&&`flex justify-end`,f=o===`inset`&&`sm:p-4`,p;t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==l||t[9]!==d||t[10]!==f?(p=u(`fixed inset-0 z-(--z-sheet) grid`,s,c,l,d,f,n),t[5]=n,t[6]=s,t[7]=c,t[8]=l,t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==r||t[13]!==p?(m=(0,M.jsx)(C,{className:p,"data-slot":`sheet-viewport`,...r}),t[12]=r,t[13]=p,t[14]=m):m=t[14],m}function L(e){let t=(0,j.c)(42),n,r,i,a,o,s,c,d,p;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],d=t[8],p=t[9]):({className:r,children:n,showCloseButton:o,keepMounted:s,transitionDurationMs:p,side:c,variant:d,style:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=d,t[9]=p);let m=o===void 0||o,h=s!==void 0&&s,g=c===void 0?`right`:c,_=d===void 0?`default`:d,v;t[10]===p?v=t[11]:(v=p===void 0?void 0:{transitionDuration:`${p}ms`},t[10]=p,t[11]=v);let y=v,b=p===0,S=b?`transition-none! data-ending-style:opacity-100! data-starting-style:opacity-100!`:void 0,C;t[12]!==S||t[13]!==y?(C=(0,M.jsx)(F,{className:S,style:y}),t[12]=S,t[13]=y,t[14]=C):C=t[14];let T=g===`bottom`&&`row-start-2 border-t data-ending-style:translate-y-8 data-starting-style:translate-y-8`,E=g===`top`&&`data-ending-style:-translate-y-8 data-starting-style:-translate-y-8 border-b`,D=g===`left`&&`data-ending-style:-translate-x-8 data-starting-style:-translate-x-8 w-[calc(100%-(--spacing(12)))] max-w-md border-e`,O=g===`right`&&`col-start-2 w-[calc(100%-(--spacing(12)))] max-w-md border-s data-ending-style:translate-x-8 data-starting-style:translate-x-8`,k=_===`inset`&&`before:hidden sm:rounded-2xl sm:border sm:before:rounded-[calc(var(--radius-2xl)-1px)] sm:**:data-[slot=sheet-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]`,A=b&&`transition-none! will-change-auto! data-ending-style:translate-x-0! data-starting-style:translate-x-0! data-ending-style:translate-y-0! data-starting-style:translate-y-0! data-ending-style:opacity-100! data-starting-style:opacity-100!`,N;t[15]!==r||t[16]!==D||t[17]!==O||t[18]!==k||t[19]!==A||t[20]!==T||t[21]!==E?(N=u(`relative flex max-h-full min-h-0 w-full min-w-0 flex-col bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 transition-[opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,T,E,D,O,k,A,r),t[15]=r,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=T,t[21]=E,t[22]=N):N=t[22];let L;t[23]!==a||t[24]!==y?(L={...y,...a},t[23]=a,t[24]=y,t[25]=L):L=t[25];let R;t[26]===m?R=t[27]:(R=m&&(0,M.jsx)(x,{"aria-label":`Close`,className:`absolute end-2 top-2`,render:(0,M.jsx)(l,{size:`icon`,variant:`ghost`}),children:(0,M.jsx)(f,{})}),t[26]=m,t[27]=R);let z;t[28]!==n||t[29]!==i||t[30]!==N||t[31]!==L||t[32]!==R?(z=(0,M.jsxs)(w,{className:N,"data-slot":`sheet-popup`,style:L,...i,children:[n,R]}),t[28]=n,t[29]=i,t[30]=N,t[31]=L,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==g||t[35]!==z||t[36]!==_?(B=(0,M.jsx)(I,{side:g,variant:_,children:z}),t[34]=g,t[35]=z,t[36]=_,t[37]=B):B=t[37];let V;return t[38]!==h||t[39]!==B||t[40]!==C?(V=(0,M.jsxs)(P,{keepMounted:h,children:[C,B]}),t[38]=h,t[39]=B,t[40]=C,t[41]=V):V=t[41],V}function R(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col gap-2 p-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-panel])]:pb-3 max-sm:pb-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-slot":`sheet-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function z(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`font-semibold text-xl leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(D,{className:i,"data-slot":`sheet-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function B(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(E,{className:i,"data-slot":`sheet-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var V={"2xl":1536,"3xl":1600,"4xl":2e3,lg:1024,md:768,sm:640,xl:1280};function H(e){return`(min-width: ${typeof e==`number`?e:V[e]}px)`}function U(e){return`(max-width: ${(typeof e==`number`?e:V[e])-1}px)`}function ee(e){if(typeof e!=`string`){let t=[];return e.min!=null&&t.push(H(e.min)),e.max!=null&&t.push(U(e.max)),e.pointer===`coarse`&&t.push(`(pointer: coarse)`),e.pointer===`fine`&&t.push(`(pointer: fine)`),t.length===0?`(min-width: 0px)`:t.join(` and `)}if(e.startsWith(`(`))return e;let t=[];for(let n of e.split(`:`))if(n.startsWith(`max-`)){let e=n.slice(4);e in V&&t.push(U(e))}else n in V&&t.push(H(n));return t.length>0?t.join(` and `):e}function te(){return!1}function W(e){let t=(0,j.c)(6),n;t[0]===e?n=t[1]:(n=ee(e),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i=e=>{if(typeof window>`u`)return ne;let t=window.matchMedia(r);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},t[2]=r,t[3]=i);let a=i,o;return t[4]===r?o=t[5]:(o=()=>typeof window>`u`?!1:window.matchMedia(r).matches,t[4]=r,t[5]=o),(0,k.useSyncExternalStore)(a,o,te)}function ne(){}function G(){return W(`max-md`)}function re(e){return(e.isMobile?e.openMobile:e.open)?`expanded`:`collapsed`}var ie=`sidebar_state`,ae=604800,K=`16rem`,q=`calc(100vw - var(--spacing(3)))`,oe=`3rem`,se=256,J=`max-sm:[--workspace-titlebar-control-size:--spacing(8)]`,Y=k.createContext(null),X=k.createContext(null);function Z(){let e=k.use(Y);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function ce(){let{isMobile:e,open:t,openMobile:n}=Z();return e?n:t}function le(e){let t=(0,j.c)(40),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0||c,d=G(),[f,p]=k.useState(!1),[m,h]=k.useState(!1),g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{h(e!==null)},t[8]=g):g=t[8];let _=g,[v,y]=k.useState(l),b=i??v,x;t[9]!==b||t[10]!==o?(x=async e=>{let t=typeof e==`function`?e(b):e;o?o(t):y(t),await cookieStore.set({expires:Date.now()+ae*1e3,name:ie,path:`/`,value:String(t)})},t[9]=b,t[10]=o,t[11]=x):x=t[11];let S=x,C;t[12]!==d||t[13]!==S?(C=()=>d?p(de):S(ue),t[12]=d,t[13]=S,t[14]=C):C=t[14];let w=C,T;t[15]!==d||t[16]!==b||t[17]!==f?(T=re({isMobile:d,open:b,openMobile:f}),t[15]=d,t[16]=b,t[17]=f,t[18]=T):T=t[18];let E=T,D;t[19]!==d||t[20]!==m||t[21]!==b||t[22]!==f||t[23]!==S||t[24]!==E||t[25]!==w?(D={isMobile:d,open:b,openMobile:f,mobileSheetMounted:m,setMobileSheetElement:_,setOpen:S,setOpenMobile:p,state:E,toggleSidebar:w},t[19]=d,t[20]=m,t[21]=b,t[22]=f,t[23]=S,t[24]=E,t[25]=w,t[26]=D):D=t[26];let O=D,A;t[27]===r?A=t[28]:(A=u(`group/sidebar-wrapper flex min-h-svh w-full`,J,r),t[27]=r,t[28]=A);let N;t[29]===s?N=t[30]:(N={"--sidebar-width":K,"--sidebar-width-icon":oe,"--workspace-titlebar-content-left":`calc(var(--workspace-controls-left) + var(--workspace-titlebar-control-size) + var(--workspace-titlebar-control-gap) + var(--workspace-history-controls-width, 0px))`,...s},t[29]=s,t[30]=N);let P=N,F;t[31]!==n||t[32]!==a||t[33]!==E||t[34]!==A||t[35]!==P?(F=(0,M.jsx)(`div`,{className:A,"data-sidebar-state":E,"data-slot":`sidebar-wrapper`,style:P,...a,children:n}),t[31]=n,t[32]=a,t[33]=E,t[34]=A,t[35]=P,t[36]=F):F=t[36];let I;return t[37]!==O||t[38]!==F?(I=(0,M.jsx)(Y,{value:O,children:F}),t[37]=O,t[38]=F,t[39]=I):I=t[39],I}function ue(e){return!e}function de(e){return!e}function fe(e){let t=(0,j.c)(80),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({side:a,variant:o,collapsible:s,resizable:c,separator:l,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let d=a===void 0?`left`:a,f=o===void 0?`sidebar`:o,p=s===void 0?`offcanvas`:s,m=c!==void 0&&c,h=l===void 0||l,{isMobile:g,state:_,openMobile:v,setOpenMobile:y,setMobileSheetElement:b}=Z(),x;bb0:{if(g||p===`none`||!m){x=null;break bb0}let e;t[9]===m?e=t[10]:(e=typeof m==`boolean`?{}:m,t[9]=m,t[10]=e);let n=e,r=n.maxWidth??1/0,i=n.minWidth??se,a=n.storageKey??null,o;t[11]===n.onResize?o=t[12]:(o=n.onResize?{onResize:n.onResize}:{},t[11]=n.onResize,t[12]=o);let s;t[13]===n.shouldAcceptWidth?s=t[14]:(s=n.shouldAcceptWidth?{shouldAcceptWidth:n.shouldAcceptWidth}:{},t[13]=n.shouldAcceptWidth,t[14]=s);let c;t[15]!==a||t[16]!==o||t[17]!==s||t[18]!==r||t[19]!==i?(c={maxWidth:r,minWidth:i,storageKey:a,...o,...s},t[15]=a,t[16]=o,t[17]=s,t[18]=r,t[19]=i,t[20]=c):c=t[20],x=c}let S=x,C;t[21]!==S||t[22]!==d?(C={side:d,resizable:S},t[21]=S,t[22]=d,t[23]=C):C=t[23];let w=C;if(p===`none`){let e;t[24]===r?e=t[25]:(e=u(`flex h-full w-(--sidebar-width) flex-col bg-sidebar surface-grain text-sidebar-foreground`,r),t[24]=r,t[25]=e);let a;t[26]!==n||t[27]!==i||t[28]!==e?(a=(0,M.jsx)(`div`,{className:e,"data-slot":`sidebar`,...i,children:n}),t[26]=n,t[27]=i,t[28]=e,t[29]=a):a=t[29];let o;return t[30]!==w||t[31]!==a?(o=(0,M.jsx)(X,{value:w,children:a}),t[30]=w,t[31]=a,t[32]=o):o=t[32],o}if(g){let e;t[33]===r?e=t[34]:(e=u(`w-(--sidebar-width) max-w-none bg-sidebar surface-grain p-0 text-sidebar-foreground`,r),t[33]=r,t[34]=e);let a;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(a={"--sidebar-width":q},t[35]=a):a=t[35];let o;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsxs)(R,{className:`sr-only`,children:[(0,M.jsx)(z,{children:`Sidebar`}),(0,M.jsx)(B,{children:`Displays the mobile sidebar.`})]}),t[36]=o):o=t[36];let s=d===`left`?`pl-safe`:`pr-safe`,c;t[37]===s?c=t[38]:(c=u(`flex h-full w-full flex-col pb-safe pt-safe`,J,s),t[37]=s,t[38]=c);let l;t[39]!==n||t[40]!==i||t[41]!==c?(l=(0,M.jsx)(`div`,{className:c,...i,children:n}),t[39]=n,t[40]=i,t[41]=c,t[42]=l):l=t[42];let f;t[43]!==b||t[44]!==d||t[45]!==l||t[46]!==e?(f=(0,M.jsxs)(L,{ref:b,className:e,"data-mobile":`true`,"data-sidebar":`sidebar`,"data-slot":`sidebar`,showCloseButton:!1,side:d,style:a,children:[o,l]}),t[43]=b,t[44]=d,t[45]=l,t[46]=e,t[47]=f):f=t[47];let p;t[48]!==v||t[49]!==y||t[50]!==f?(p=(0,M.jsx)(N,{onOpenChange:y,open:v,children:f}),t[48]=v,t[49]=y,t[50]=f,t[51]=p):p=t[51];let m;return t[52]!==w||t[53]!==p?(m=(0,M.jsx)(X,{value:w,children:p}),t[52]=w,t[53]=p,t[54]=m):m=t[54],m}let T=_===`collapsed`?p:``,E=f===`floating`||f===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,D;t[55]===E?D=t[56]:(D=u(`relative w-(--sidebar-width) bg-transparent`,`[[data-panel-animations=true]_&]:transition-[width] [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,E),t[55]=E,t[56]=D);let O;t[57]===D?O=t[58]:(O=(0,M.jsx)(`div`,{className:D,"data-slot":`sidebar-gap`}),t[57]=D,t[58]=O);let k=d===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,A;t[59]!==r||t[60]!==h||t[61]!==k||t[62]!==f?(A=u(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) md:flex`,`[[data-panel-animations=true]_&]:transition-[left,right,width] [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,k,f===`floating`||f===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:u(`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,h&&`group-data-[side=left]:border-r group-data-[side=right]:border-l`),r),t[59]=r,t[60]=h,t[61]=k,t[62]=f,t[63]=A):A=t[63];let P;t[64]===n?P=t[65]:(P=(0,M.jsx)(`div`,{className:`flex h-full w-full flex-col bg-sidebar surface-grain group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm/5`,"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,children:n}),t[64]=n,t[65]=P);let F;t[66]!==i||t[67]!==A||t[68]!==P?(F=(0,M.jsx)(`div`,{className:A,"data-slot":`sidebar-container`,...i,children:P}),t[66]=i,t[67]=A,t[68]=P,t[69]=F):F=t[69];let I;t[70]!==d||t[71]!==_||t[72]!==O||t[73]!==F||t[74]!==T||t[75]!==f?(I=(0,M.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-collapsible":T,"data-side":d,"data-slot":`sidebar`,"data-state":_,"data-variant":f,children:[O,F]}),t[70]=d,t[71]=_,t[72]=O,t[73]=F,t[74]=T,t[75]=f,t[76]=I):I=t[76];let V;return t[77]!==w||t[78]!==I?(V=(0,M.jsx)(X,{value:w,children:I}),t[77]=w,t[78]=I,t[79]=V):V=t[79],V}function pe(e){let t=(0,j.c)(18),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a}=Z(),o=ce(),s;t[4]===n?s=t[5]:(s=u(`size-[var(--workspace-titlebar-control-size)]! [-webkit-app-region:no-drag]`,n),t[4]=n,t[5]=s);let c;t[6]!==r||t[7]!==a?(c=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=c):c=t[8];let d=o?A.PanelLeftClose:A.PanelLeft,f;t[9]===d?f=t[10]:(f=(0,M.jsx)(m,{className:`size-4`,icon:d}),t[9]=d,t[10]=f);let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,M.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[11]=p):p=t[11];let h;return t[12]!==o||t[13]!==i||t[14]!==s||t[15]!==c||t[16]!==f?(h=(0,M.jsxs)(l,{className:s,"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,"aria-pressed":o,onClick:c,size:`icon`,variant:`ghost`,...i,children:[f,p]}),t[12]=o,t[13]=i,t[14]=s,t[15]=c,t[16]=f,t[17]=h):h=t[17],h}function Q(e,t){return Math.max(t.minWidth,Math.min(e,t.maxWidth))}function me(e){let t=(0,j.c)(53),r,a,s,c,l,d,f,p;t[0]===e?(r=t[1],a=t[2],s=t[3],c=t[4],l=t[5],d=t[6],f=t[7],p=t[8]):({className:r,onClick:a,onPointerCancel:c,onLostPointerCapture:s,onPointerDown:l,onPointerMove:d,onPointerUp:f,...p}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=s,t[4]=c,t[5]=l,t[6]=d,t[7]=f,t[8]=p);let{open:m,toggleSidebar:h}=Z(),g=k.use(X),_=k.useRef(null),v=k.useRef(!1),y=g?.resizable??null,b=k.useRef(y),x=y!==null&&m?`Resize Sidebar`:`Toggle Sidebar`,S;t[9]!==m||t[10]!==y||t[11]!==g?.side?(S=e=>{if(!y||!m)return null;let t=e.currentTarget,r=t.closest(`[data-slot='sidebar-wrapper']`),a=t.closest(`[data-slot='sidebar']`),o=a?.querySelector(`[data-slot='sidebar-container']`);if(!r||!a||!o)return null;let s=g?.side??`left`,c=Q(o.getBoundingClientRect().width,y),l=[a.querySelector(`[data-slot='sidebar-gap']`),o].filter(_e),u=e=>{l.forEach(t=>{t.style.setProperty(`width`,`${e}px`)})};return l.forEach(ge),u(c),{width:c,edge:s===`left`?`right`:`left`,resize(e){let n=b.current;if(!n)return c;let i=Q(e,n);return(n.shouldAcceptWidth?.({currentWidth:c,nextWidth:i,rail:t,side:s,sidebarRoot:a,wrapper:r})??!0)&&(u(i),c=i),c},finish(e,t){r.style.setProperty(`--sidebar-width`,`${e}px`),v.current=t;let a=b.current;if(a?.storageKey)try{i(a.storageKey,e,n)}catch(e){console.error(`Could not persist sidebar width.`,e)}a?.onResize?.(e)},cleanup(){l.forEach(he)}}},t[9]=m,t[10]=y,t[11]=g?.side,t[12]=S):S=t[12];let C=O(S,String(m)),w;t[13]!==C||t[14]!==y?(w=()=>{b.current=y,C.refresh()},t[13]=C,t[14]=y,t[15]=w):w=t[15];let T;t[16]===y?T=t[17]:(T=[y],t[16]=y,t[17]=T),k.useLayoutEffect(w,T);let E;t[18]!==a||t[19]!==m||t[20]!==y||t[21]!==h?(E=e=>{if(a?.(e),!e.defaultPrevented){if(v.current){v.current=!1,e.preventDefault();return}if(y&&m){e.preventDefault();return}h()}},t[18]=a,t[19]=m,t[20]=y,t[21]=h,t[22]=E):E=t[22];let D=E,A,N;t[23]===y?(A=t[24],N=t[25]):(A=()=>{if(!y?.storageKey||typeof window>`u`)return;let e=_.current;if(!e)return;let t=e.closest(`[data-slot='sidebar-wrapper']`);if(!t)return;let r;try{r=o(y.storageKey,n)}catch(e){console.error(`Could not restore persisted sidebar width.`,e);return}if(r===null)return;let i=Q(r,y);t.style.setProperty(`--sidebar-width`,`${i}px`),y.onResize?.(i)},N=[y],t[23]=y,t[24]=A,t[25]=N),k.useLayoutEffect(A,N);let P;t[26]===r?P=t[27]:(P=u(`-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex [[data-collapsible=offcanvas][data-state=collapsed]_&]:pointer-events-none`,`[[data-panel-animations=true]_&]:transition-all [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,r),t[26]=r,t[27]=P);let F;t[28]!==s||t[29]!==C?(F=e=>{s?.(e),e.defaultPrevented||C.onLostPointerCapture(e)},t[28]=s,t[29]=C,t[30]=F):F=t[30];let I;t[31]!==c||t[32]!==C?(I=e=>{c?.(e),e.defaultPrevented||C.onPointerCancel(e)},t[31]=c,t[32]=C,t[33]=I):I=t[33];let L;t[34]!==l||t[35]!==C?(L=e=>{l?.(e),e.defaultPrevented||C.onPointerDown(e)},t[34]=l,t[35]=C,t[36]=L):L=t[36];let R;t[37]!==d||t[38]!==C?(R=e=>{d?.(e),e.defaultPrevented||C.onPointerMove(e)},t[37]=d,t[38]=C,t[39]=R):R=t[39];let z;t[40]!==f||t[41]!==C?(z=e=>{f?.(e),e.defaultPrevented||C.onPointerUp(e)},t[40]=f,t[41]=C,t[42]=z):z=t[42];let B;return t[43]!==D||t[44]!==p||t[45]!==x||t[46]!==L||t[47]!==R||t[48]!==z||t[49]!==P||t[50]!==F||t[51]!==I?(B=(0,M.jsx)(`button`,{"aria-label":x,className:P,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,onClick:D,onLostPointerCapture:F,onPointerCancel:I,onPointerDown:L,onPointerMove:R,onPointerUp:z,ref:_,tabIndex:-1,type:`button`,...p}),t[43]=D,t[44]=p,t[45]=x,t[46]=L,t[47]=R,t[48]=z,t[49]=P,t[50]=F,t[51]=I,t[52]=B):B=t[52],B}function he(e){e.style.removeProperty(`width`),e.style.removeProperty(`transition-duration`)}function ge(e){e.style.setProperty(`transition-duration`,`0ms`)}function _e(e){return e!==null}function ve(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`[&_[data-slot=input]]:h-auto [&_[data-slot=input]]:p-0 [&_[data-slot=input]]:font-medium [&_[data-slot=input]]:text-sidebar-foreground [&_[data-slot=input]]:text-sm [&_[data-slot=input]]:leading-normal [&_[data-slot=input]]:placeholder:text-sidebar-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(v,{className:i,unstyled:!0,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ye(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`relative flex min-w-0 w-full flex-1 flex-col bg-background surface-grain`,`md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm/5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`main`,{className:i,"data-slot":`sidebar-inset`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function be(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col gap-2 px-[var(--sidebar-content-inset)] py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-sidebar":`footer`,"data-slot":`sidebar-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $(e){let t=(0,j.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,fixedHeader:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=r?(0,M.jsx)(`div`,{className:`w-full shrink-0`,children:r}):null,t[4]=r,t[5]=a);let o=r&&`[&>[data-sidebar=group]:first-child]:pt-0`,s;t[6]!==n||t[7]!==o?(s=u(`flex w-full min-w-0 flex-col [overflow-anchor:none] group-data-[collapsible=icon]:overflow-hidden [&>[data-sidebar=group]+[data-sidebar=group]]:pt-0`,o,n),t[6]=n,t[7]=o,t[8]=s):s=t[8];let c;t[9]!==i||t[10]!==s?(c=(0,M.jsx)(y,{hideScrollbars:!0,scrollFade:!0,scrollFadePadding:!1,viewportTabIndex:-1,className:`h-auto min-h-0 flex-1 [&>[data-slot=scroll-area-viewport]]:[--fade-size:0.75rem]`,children:(0,M.jsx)(`div`,{className:s,"data-sidebar":`content`,"data-slot":`sidebar-content`,...i})}),t[9]=i,t[10]=s,t[11]=c):c=t[11];let l;return t[12]!==a||t[13]!==c?(l=(0,M.jsxs)(M.Fragment,{children:[a,c]}),t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function xe(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`relative flex w-full min-w-0 flex-col p-[var(--sidebar-content-inset)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-sidebar":`group`,"data-slot":`sidebar-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Se(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex w-full min-w-0 flex-col gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`ul`,{className:i,"data-sidebar":`menu`,"data-slot":`sidebar-menu`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ce(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`li`,{className:i,"data-sidebar":`menu-item`,"data-slot":`sidebar-menu-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var we=d(`peer/menu-button flex w-full cursor-pointer items-center gap-[var(--sidebar-control-gap)] overflow-hidden text-left outline-hidden ring-ring transition-[width,height,padding] hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-64 aria-disabled:pointer-events-none aria-disabled:opacity-64 data-[active=true]:bg-sidebar-row-selected data-[active=true]:font-medium data-[active=true]:text-sidebar-foreground data-[state=open]:hover:bg-sidebar-row-hover data-[state=open]:hover:text-sidebar-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-[var(--sidebar-content-inset)]! [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-[var(--sidebar-icon-color)] hover:[&>svg]:text-sidebar-foreground active:[&>svg]:text-sidebar-foreground data-[active=true]:[&>svg]:text-sidebar-foreground`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-8 rounded-[var(--control-radius)] px-[var(--sidebar-row-content-inset)] py-1.5 text-sm`,icon:`size-8 justify-center rounded-[var(--control-radius)] p-0`,lg:`h-12 rounded-lg p-2 text-sm group-data-[collapsible=icon]:p-0!`,sm:`h-7 rounded-lg p-2 text-xs`},variant:{default:`font-medium text-sidebar-foreground`,outline:`bg-sidebar-control-surface ring-1 ring-sidebar-border`,project:`font-normal text-sidebar-muted-foreground`,settings:`h-9 gap-2.5 rounded-xl px-3 font-normal text-sidebar-foreground data-[active=true]:font-normal [&>svg:not([class*='size-'])]:size-4.5 [&>svg]:text-sidebar-foreground`}}});function Te(e){let t=(0,j.c)(13),{isActive:n,variant:r,size:i,tooltip:o,className:c,render:l,...d}=e,f=n!==void 0&&n,m=r===void 0?`default`:r,_=i===void 0?`default`:i,{isMobile:v,state:y}=Z(),b={className:u(we({size:_,variant:m}),c),"data-active":f,"data-sidebar":`menu-button`,"data-size":_,"data-slot":`sidebar-menu-button`},x=a(b,d),S;t[0]!==x||t[1]!==l?(S={defaultTagName:`button`,props:x,render:l},t[0]=x,t[1]=l,t[2]=S):S=t[2];let C=s(S);if(!o)return C;if(typeof o==`string`){let e;t[3]===o?e=t[4]:(e={children:o},t[3]=o,t[4]=e),o=e}let w=C,T;t[5]===w?T=t[6]:(T=(0,M.jsx)(p,{render:w}),t[5]=w,t[6]=T);let E=y!==`collapsed`||v,D;t[7]!==E||t[8]!==o?(D=(0,M.jsx)(h,{align:`center`,hidden:E,side:`right`,...o}),t[7]=E,t[8]=o,t[9]=D):D=t[9];let O;return t[10]!==T||t[11]!==D?(O=(0,M.jsxs)(g,{children:[T,D]}),t[10]=T,t[11]=D,t[12]=O):O=t[12],O}function Ee(e){let t=(0,j.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?`tree`:i)===`flat`?`gap-0.5`:`mx-3.5 translate-x-px gap-1 border-sidebar-border border-l px-2.5 py-0.5`,o;t[4]!==n||t[5]!==a?(o=u(`flex min-w-0 flex-col`,a,`group-data-[collapsible=icon]:hidden`,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,M.jsx)(`ul`,{className:o,"data-sidebar":`menu-sub`,"data-slot":`sidebar-menu-sub`,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function De(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`group/menu-sub-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`li`,{className:i,"data-sidebar":`menu-sub-item`,"data-slot":`sidebar-menu-sub-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Oe(e){let t=(0,j.c)(9),n,r,i,o;if(t[0]!==e){let{size:c,isActive:l,className:d,render:f,...p}=e;n=f;let m=c===void 0?`md`:c,h=l!==void 0&&l,g={className:u(`-translate-x-px flex h-7 min-w-0 cursor-pointer items-center gap-2 overflow-hidden rounded-lg px-2 text-sidebar-foreground outline-hidden ring-ring hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-64 aria-disabled:pointer-events-none aria-disabled:opacity-64 [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-foreground`,`data-[active=true]:bg-sidebar-row-selected data-[active=true]:text-sidebar-foreground`,m===`sm`&&`text-xs`,m===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,d),"data-active":h,"data-sidebar":`menu-sub-button`,"data-size":m,"data-slot":`sidebar-menu-sub-button`};o=s,r=`a`,i=a(g,p),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o}else n=t[1],r=t[2],i=t[3],o=t[4];let c;return t[5]!==n||t[6]!==r||t[7]!==i?(c={defaultTagName:r,props:i,render:n},t[5]=n,t[6]=r,t[7]=i,t[8]=c):c=t[8],o(c)}export{G as _,ve as a,L as b,Te as c,Oe as d,De as f,Z as g,pe as h,xe as i,Ce as l,me as m,$ as n,ye as o,le as p,be as r,Se as s,fe as t,Ee as u,W as v,N as y};
2
- //# sourceMappingURL=sidebar-Bulbb3cX.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Bm as n,Cx as r,_s as i,do as a,hs as o,lr as s,ma as c,or as l,t as u,wx as d}from"./utils-DmS758az.js";import{t as f}from"./x-CSwbgjBe.js";import{a as p,c as m,n as h,t as g,u as _}from"./tooltip-Df-4YKs5.js";import{t as v}from"./input-u5qjnfMr.js";import{t as y}from"./scroll-area-CsrtHuL8.js";import{a as b,c as x,l as S,n as C,o as w,r as T,s as E,t as D}from"./DialogTitle-7tvQYVxE.js";import{t as O}from"./useResizeDrag-KJl_F2EN.js";var k=e(t(),1),A=_(),j=d(),M=e(c(),1),N=T,P=b;function F(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`fixed inset-0 z-(--z-sheet) bg-background/60 backdrop-blur-xs transition-all duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(S,{className:i,"data-slot":`sheet-backdrop`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function I(e){let t=(0,j.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,side:i,variant:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s=i===`bottom`&&`grid grid-rows-[1fr_auto] pt-12`,c=i===`top`&&`grid grid-rows-[auto_1fr] pb-12`,l=i===`left`&&`flex justify-start`,d=i===`right`&&`flex justify-end`,f=o===`inset`&&`sm:p-4`,p;t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==l||t[9]!==d||t[10]!==f?(p=u(`fixed inset-0 z-(--z-sheet) grid`,s,c,l,d,f,n),t[5]=n,t[6]=s,t[7]=c,t[8]=l,t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==r||t[13]!==p?(m=(0,M.jsx)(C,{className:p,"data-slot":`sheet-viewport`,...r}),t[12]=r,t[13]=p,t[14]=m):m=t[14],m}function L(e){let t=(0,j.c)(42),n,r,i,a,o,s,c,d,p;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],d=t[8],p=t[9]):({className:r,children:n,showCloseButton:o,keepMounted:s,transitionDurationMs:p,side:c,variant:d,style:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=d,t[9]=p);let m=o===void 0||o,h=s!==void 0&&s,g=c===void 0?`right`:c,_=d===void 0?`default`:d,v;t[10]===p?v=t[11]:(v=p===void 0?void 0:{transitionDuration:`${p}ms`},t[10]=p,t[11]=v);let y=v,b=p===0,S=b?`transition-none! data-ending-style:opacity-100! data-starting-style:opacity-100!`:void 0,C;t[12]!==S||t[13]!==y?(C=(0,M.jsx)(F,{className:S,style:y}),t[12]=S,t[13]=y,t[14]=C):C=t[14];let T=g===`bottom`&&`row-start-2 border-t data-ending-style:translate-y-8 data-starting-style:translate-y-8`,E=g===`top`&&`data-ending-style:-translate-y-8 data-starting-style:-translate-y-8 border-b`,D=g===`left`&&`data-ending-style:-translate-x-8 data-starting-style:-translate-x-8 w-[calc(100%-(--spacing(12)))] max-w-md border-e`,O=g===`right`&&`col-start-2 w-[calc(100%-(--spacing(12)))] max-w-md border-s data-ending-style:translate-x-8 data-starting-style:translate-x-8`,k=_===`inset`&&`before:hidden sm:rounded-2xl sm:border sm:before:rounded-[calc(var(--radius-2xl)-1px)] sm:**:data-[slot=sheet-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]`,A=b&&`transition-none! will-change-auto! data-ending-style:translate-x-0! data-starting-style:translate-x-0! data-ending-style:translate-y-0! data-starting-style:translate-y-0! data-ending-style:opacity-100! data-starting-style:opacity-100!`,N;t[15]!==r||t[16]!==D||t[17]!==O||t[18]!==k||t[19]!==A||t[20]!==T||t[21]!==E?(N=u(`relative flex max-h-full min-h-0 w-full min-w-0 flex-col bg-popover not-dark:bg-clip-padding text-popover-foreground shadow-lg/5 transition-[opacity,translate] duration-200 ease-in-out will-change-transform before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,T,E,D,O,k,A,r),t[15]=r,t[16]=D,t[17]=O,t[18]=k,t[19]=A,t[20]=T,t[21]=E,t[22]=N):N=t[22];let L;t[23]!==a||t[24]!==y?(L={...y,...a},t[23]=a,t[24]=y,t[25]=L):L=t[25];let R;t[26]===m?R=t[27]:(R=m&&(0,M.jsx)(x,{"aria-label":`Close`,className:`absolute end-2 top-2`,render:(0,M.jsx)(l,{size:`icon`,variant:`ghost`}),children:(0,M.jsx)(f,{})}),t[26]=m,t[27]=R);let z;t[28]!==n||t[29]!==i||t[30]!==N||t[31]!==L||t[32]!==R?(z=(0,M.jsxs)(w,{className:N,"data-slot":`sheet-popup`,style:L,...i,children:[n,R]}),t[28]=n,t[29]=i,t[30]=N,t[31]=L,t[32]=R,t[33]=z):z=t[33];let B;t[34]!==g||t[35]!==z||t[36]!==_?(B=(0,M.jsx)(I,{side:g,variant:_,children:z}),t[34]=g,t[35]=z,t[36]=_,t[37]=B):B=t[37];let V;return t[38]!==h||t[39]!==B||t[40]!==C?(V=(0,M.jsxs)(P,{keepMounted:h,children:[C,B]}),t[38]=h,t[39]=B,t[40]=C,t[41]=V):V=t[41],V}function R(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col gap-2 p-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-panel])]:pb-3 max-sm:pb-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-slot":`sheet-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function z(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`font-semibold text-xl leading-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(D,{className:i,"data-slot":`sheet-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function B(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(E,{className:i,"data-slot":`sheet-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var V={"2xl":1536,"3xl":1600,"4xl":2e3,lg:1024,md:768,sm:640,xl:1280};function H(e){return`(min-width: ${typeof e==`number`?e:V[e]}px)`}function U(e){return`(max-width: ${(typeof e==`number`?e:V[e])-1}px)`}function ee(e){if(typeof e!=`string`){let t=[];return e.min!=null&&t.push(H(e.min)),e.max!=null&&t.push(U(e.max)),e.pointer===`coarse`&&t.push(`(pointer: coarse)`),e.pointer===`fine`&&t.push(`(pointer: fine)`),t.length===0?`(min-width: 0px)`:t.join(` and `)}if(e.startsWith(`(`))return e;let t=[];for(let n of e.split(`:`))if(n.startsWith(`max-`)){let e=n.slice(4);e in V&&t.push(U(e))}else n in V&&t.push(H(n));return t.length>0?t.join(` and `):e}function te(){return!1}function W(e){let t=(0,j.c)(6),n;t[0]===e?n=t[1]:(n=ee(e),t[0]=e,t[1]=n);let r=n,i;t[2]===r?i=t[3]:(i=e=>{if(typeof window>`u`)return ne;let t=window.matchMedia(r);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},t[2]=r,t[3]=i);let a=i,o;return t[4]===r?o=t[5]:(o=()=>typeof window>`u`?!1:window.matchMedia(r).matches,t[4]=r,t[5]=o),(0,k.useSyncExternalStore)(a,o,te)}function ne(){}function G(){return W(`max-md`)}function re(e){return(e.isMobile?e.openMobile:e.open)?`expanded`:`collapsed`}var ie=`sidebar_state`,ae=604800,K=`16rem`,q=`calc(100vw - var(--spacing(3)))`,oe=`3rem`,se=256,J=`max-sm:[--workspace-titlebar-control-size:--spacing(8)]`,Y=k.createContext(null),X=k.createContext(null);function Z(){let e=k.use(Y);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function ce(){let{isMobile:e,open:t,openMobile:n}=Z();return e?n:t}function le(e){let t=(0,j.c)(40),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0||c,d=G(),[f,p]=k.useState(!1),[m,h]=k.useState(!1),g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>{h(e!==null)},t[8]=g):g=t[8];let _=g,[v,y]=k.useState(l),b=i??v,x;t[9]!==b||t[10]!==o?(x=async e=>{let t=typeof e==`function`?e(b):e;o?o(t):y(t),await cookieStore.set({expires:Date.now()+ae*1e3,name:ie,path:`/`,value:String(t)})},t[9]=b,t[10]=o,t[11]=x):x=t[11];let S=x,C;t[12]!==d||t[13]!==S?(C=()=>d?p(de):S(ue),t[12]=d,t[13]=S,t[14]=C):C=t[14];let w=C,T;t[15]!==d||t[16]!==b||t[17]!==f?(T=re({isMobile:d,open:b,openMobile:f}),t[15]=d,t[16]=b,t[17]=f,t[18]=T):T=t[18];let E=T,D;t[19]!==d||t[20]!==m||t[21]!==b||t[22]!==f||t[23]!==S||t[24]!==E||t[25]!==w?(D={isMobile:d,open:b,openMobile:f,mobileSheetMounted:m,setMobileSheetElement:_,setOpen:S,setOpenMobile:p,state:E,toggleSidebar:w},t[19]=d,t[20]=m,t[21]=b,t[22]=f,t[23]=S,t[24]=E,t[25]=w,t[26]=D):D=t[26];let O=D,A;t[27]===r?A=t[28]:(A=u(`group/sidebar-wrapper flex min-h-svh w-full`,J,r),t[27]=r,t[28]=A);let N;t[29]===s?N=t[30]:(N={"--sidebar-width":K,"--sidebar-width-icon":oe,"--workspace-titlebar-content-left":`calc(var(--workspace-controls-left) + var(--workspace-titlebar-control-size) + var(--workspace-titlebar-control-gap) + var(--workspace-history-controls-width, 0px))`,...s},t[29]=s,t[30]=N);let P=N,F;t[31]!==n||t[32]!==a||t[33]!==E||t[34]!==A||t[35]!==P?(F=(0,M.jsx)(`div`,{className:A,"data-sidebar-state":E,"data-slot":`sidebar-wrapper`,style:P,...a,children:n}),t[31]=n,t[32]=a,t[33]=E,t[34]=A,t[35]=P,t[36]=F):F=t[36];let I;return t[37]!==O||t[38]!==F?(I=(0,M.jsx)(Y,{value:O,children:F}),t[37]=O,t[38]=F,t[39]=I):I=t[39],I}function ue(e){return!e}function de(e){return!e}function fe(e){let t=(0,j.c)(80),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({side:a,variant:o,collapsible:s,resizable:c,separator:l,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let d=a===void 0?`left`:a,f=o===void 0?`sidebar`:o,p=s===void 0?`offcanvas`:s,m=c!==void 0&&c,h=l===void 0||l,{isMobile:g,state:_,openMobile:v,setOpenMobile:y,setMobileSheetElement:b}=Z(),x;bb0:{if(g||p===`none`||!m){x=null;break bb0}let e;t[9]===m?e=t[10]:(e=typeof m==`boolean`?{}:m,t[9]=m,t[10]=e);let n=e,r=n.maxWidth??1/0,i=n.minWidth??se,a=n.storageKey??null,o;t[11]===n.onResize?o=t[12]:(o=n.onResize?{onResize:n.onResize}:{},t[11]=n.onResize,t[12]=o);let s;t[13]===n.shouldAcceptWidth?s=t[14]:(s=n.shouldAcceptWidth?{shouldAcceptWidth:n.shouldAcceptWidth}:{},t[13]=n.shouldAcceptWidth,t[14]=s);let c;t[15]!==a||t[16]!==o||t[17]!==s||t[18]!==r||t[19]!==i?(c={maxWidth:r,minWidth:i,storageKey:a,...o,...s},t[15]=a,t[16]=o,t[17]=s,t[18]=r,t[19]=i,t[20]=c):c=t[20],x=c}let S=x,C;t[21]!==S||t[22]!==d?(C={side:d,resizable:S},t[21]=S,t[22]=d,t[23]=C):C=t[23];let w=C;if(p===`none`){let e;t[24]===r?e=t[25]:(e=u(`flex h-full w-(--sidebar-width) flex-col bg-sidebar surface-grain text-sidebar-foreground`,r),t[24]=r,t[25]=e);let a;t[26]!==n||t[27]!==i||t[28]!==e?(a=(0,M.jsx)(`div`,{className:e,"data-slot":`sidebar`,...i,children:n}),t[26]=n,t[27]=i,t[28]=e,t[29]=a):a=t[29];let o;return t[30]!==w||t[31]!==a?(o=(0,M.jsx)(X,{value:w,children:a}),t[30]=w,t[31]=a,t[32]=o):o=t[32],o}if(g){let e;t[33]===r?e=t[34]:(e=u(`w-(--sidebar-width) max-w-none bg-sidebar surface-grain p-0 text-sidebar-foreground`,r),t[33]=r,t[34]=e);let a;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(a={"--sidebar-width":q},t[35]=a):a=t[35];let o;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,M.jsxs)(R,{className:`sr-only`,children:[(0,M.jsx)(z,{children:`Sidebar`}),(0,M.jsx)(B,{children:`Displays the mobile sidebar.`})]}),t[36]=o):o=t[36];let s=d===`left`?`pl-safe`:`pr-safe`,c;t[37]===s?c=t[38]:(c=u(`flex h-full w-full flex-col pb-safe pt-safe`,J,s),t[37]=s,t[38]=c);let l;t[39]!==n||t[40]!==i||t[41]!==c?(l=(0,M.jsx)(`div`,{className:c,...i,children:n}),t[39]=n,t[40]=i,t[41]=c,t[42]=l):l=t[42];let f;t[43]!==b||t[44]!==d||t[45]!==l||t[46]!==e?(f=(0,M.jsxs)(L,{ref:b,className:e,"data-mobile":`true`,"data-sidebar":`sidebar`,"data-slot":`sidebar`,showCloseButton:!1,side:d,style:a,children:[o,l]}),t[43]=b,t[44]=d,t[45]=l,t[46]=e,t[47]=f):f=t[47];let p;t[48]!==v||t[49]!==y||t[50]!==f?(p=(0,M.jsx)(N,{onOpenChange:y,open:v,children:f}),t[48]=v,t[49]=y,t[50]=f,t[51]=p):p=t[51];let m;return t[52]!==w||t[53]!==p?(m=(0,M.jsx)(X,{value:w,children:p}),t[52]=w,t[53]=p,t[54]=m):m=t[54],m}let T=_===`collapsed`?p:``,E=f===`floating`||f===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,D;t[55]===E?D=t[56]:(D=u(`relative w-(--sidebar-width) bg-transparent`,`[[data-panel-animations=true]_&]:transition-[width] [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,E),t[55]=E,t[56]=D);let O;t[57]===D?O=t[58]:(O=(0,M.jsx)(`div`,{className:D,"data-slot":`sidebar-gap`}),t[57]=D,t[58]=O);let k=d===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,A;t[59]!==r||t[60]!==h||t[61]!==k||t[62]!==f?(A=u(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) md:flex`,`[[data-panel-animations=true]_&]:transition-[left,right,width] [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,k,f===`floating`||f===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:u(`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,h&&`group-data-[side=left]:border-r group-data-[side=right]:border-l`),r),t[59]=r,t[60]=h,t[61]=k,t[62]=f,t[63]=A):A=t[63];let P;t[64]===n?P=t[65]:(P=(0,M.jsx)(`div`,{className:`flex h-full w-full flex-col bg-sidebar surface-grain group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm/5`,"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,children:n}),t[64]=n,t[65]=P);let F;t[66]!==i||t[67]!==A||t[68]!==P?(F=(0,M.jsx)(`div`,{className:A,"data-slot":`sidebar-container`,...i,children:P}),t[66]=i,t[67]=A,t[68]=P,t[69]=F):F=t[69];let I;t[70]!==d||t[71]!==_||t[72]!==O||t[73]!==F||t[74]!==T||t[75]!==f?(I=(0,M.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-collapsible":T,"data-side":d,"data-slot":`sidebar`,"data-state":_,"data-variant":f,children:[O,F]}),t[70]=d,t[71]=_,t[72]=O,t[73]=F,t[74]=T,t[75]=f,t[76]=I):I=t[76];let V;return t[77]!==w||t[78]!==I?(V=(0,M.jsx)(X,{value:w,children:I}),t[77]=w,t[78]=I,t[79]=V):V=t[79],V}function pe(e){let t=(0,j.c)(18),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a}=Z(),o=ce(),s;t[4]===n?s=t[5]:(s=u(`size-[var(--workspace-titlebar-control-size)]! [-webkit-app-region:no-drag]`,n),t[4]=n,t[5]=s);let c;t[6]!==r||t[7]!==a?(c=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=c):c=t[8];let d=o?A.PanelLeftClose:A.PanelLeft,f;t[9]===d?f=t[10]:(f=(0,M.jsx)(m,{className:`size-4`,icon:d}),t[9]=d,t[10]=f);let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,M.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[11]=p):p=t[11];let h;return t[12]!==o||t[13]!==i||t[14]!==s||t[15]!==c||t[16]!==f?(h=(0,M.jsxs)(l,{className:s,"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,"aria-pressed":o,onClick:c,size:`icon`,variant:`ghost`,...i,children:[f,p]}),t[12]=o,t[13]=i,t[14]=s,t[15]=c,t[16]=f,t[17]=h):h=t[17],h}function Q(e,t){return Math.max(t.minWidth,Math.min(e,t.maxWidth))}function me(e){let t=(0,j.c)(53),r,a,s,c,l,d,f,p;t[0]===e?(r=t[1],a=t[2],s=t[3],c=t[4],l=t[5],d=t[6],f=t[7],p=t[8]):({className:r,onClick:a,onPointerCancel:c,onLostPointerCapture:s,onPointerDown:l,onPointerMove:d,onPointerUp:f,...p}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=s,t[4]=c,t[5]=l,t[6]=d,t[7]=f,t[8]=p);let{open:m,toggleSidebar:h}=Z(),g=k.use(X),_=k.useRef(null),v=k.useRef(!1),y=g?.resizable??null,b=k.useRef(y),x=y!==null&&m?`Resize Sidebar`:`Toggle Sidebar`,S;t[9]!==m||t[10]!==y||t[11]!==g?.side?(S=e=>{if(!y||!m)return null;let t=e.currentTarget,r=t.closest(`[data-slot='sidebar-wrapper']`),a=t.closest(`[data-slot='sidebar']`),o=a?.querySelector(`[data-slot='sidebar-container']`);if(!r||!a||!o)return null;let s=g?.side??`left`,c=Q(o.getBoundingClientRect().width,y),l=[a.querySelector(`[data-slot='sidebar-gap']`),o].filter(_e),u=e=>{l.forEach(t=>{t.style.setProperty(`width`,`${e}px`)})};return l.forEach(ge),u(c),{width:c,edge:s===`left`?`right`:`left`,resize(e){let n=b.current;if(!n)return c;let i=Q(e,n);return(n.shouldAcceptWidth?.({currentWidth:c,nextWidth:i,rail:t,side:s,sidebarRoot:a,wrapper:r})??!0)&&(u(i),c=i),c},finish(e,t){r.style.setProperty(`--sidebar-width`,`${e}px`),v.current=t;let a=b.current;if(a?.storageKey)try{i(a.storageKey,e,n)}catch(e){console.error(`Could not persist sidebar width.`,e)}a?.onResize?.(e)},cleanup(){l.forEach(he)}}},t[9]=m,t[10]=y,t[11]=g?.side,t[12]=S):S=t[12];let C=O(S,String(m)),w;t[13]!==C||t[14]!==y?(w=()=>{b.current=y,C.refresh()},t[13]=C,t[14]=y,t[15]=w):w=t[15];let T;t[16]===y?T=t[17]:(T=[y],t[16]=y,t[17]=T),k.useLayoutEffect(w,T);let E;t[18]!==a||t[19]!==m||t[20]!==y||t[21]!==h?(E=e=>{if(a?.(e),!e.defaultPrevented){if(v.current){v.current=!1,e.preventDefault();return}if(y&&m){e.preventDefault();return}h()}},t[18]=a,t[19]=m,t[20]=y,t[21]=h,t[22]=E):E=t[22];let D=E,A,N;t[23]===y?(A=t[24],N=t[25]):(A=()=>{if(!y?.storageKey||typeof window>`u`)return;let e=_.current;if(!e)return;let t=e.closest(`[data-slot='sidebar-wrapper']`);if(!t)return;let r;try{r=o(y.storageKey,n)}catch(e){console.error(`Could not restore persisted sidebar width.`,e);return}if(r===null)return;let i=Q(r,y);t.style.setProperty(`--sidebar-width`,`${i}px`),y.onResize?.(i)},N=[y],t[23]=y,t[24]=A,t[25]=N),k.useLayoutEffect(A,N);let P;t[26]===r?P=t[27]:(P=u(`-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 after:absolute after:inset-y-0 after:left-1/2 after:w-px after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex [[data-collapsible=offcanvas][data-state=collapsed]_&]:pointer-events-none`,`[[data-panel-animations=true]_&]:transition-all [[data-panel-animations=true]_&]:[transition-duration:var(--panel-animation-duration)] [[data-panel-animations=true]_&]:ease-out`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,r),t[26]=r,t[27]=P);let F;t[28]!==s||t[29]!==C?(F=e=>{s?.(e),e.defaultPrevented||C.onLostPointerCapture(e)},t[28]=s,t[29]=C,t[30]=F):F=t[30];let I;t[31]!==c||t[32]!==C?(I=e=>{c?.(e),e.defaultPrevented||C.onPointerCancel(e)},t[31]=c,t[32]=C,t[33]=I):I=t[33];let L;t[34]!==l||t[35]!==C?(L=e=>{l?.(e),e.defaultPrevented||C.onPointerDown(e)},t[34]=l,t[35]=C,t[36]=L):L=t[36];let R;t[37]!==d||t[38]!==C?(R=e=>{d?.(e),e.defaultPrevented||C.onPointerMove(e)},t[37]=d,t[38]=C,t[39]=R):R=t[39];let z;t[40]!==f||t[41]!==C?(z=e=>{f?.(e),e.defaultPrevented||C.onPointerUp(e)},t[40]=f,t[41]=C,t[42]=z):z=t[42];let B;return t[43]!==D||t[44]!==p||t[45]!==x||t[46]!==L||t[47]!==R||t[48]!==z||t[49]!==P||t[50]!==F||t[51]!==I?(B=(0,M.jsx)(`button`,{"aria-label":x,className:P,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,onClick:D,onLostPointerCapture:F,onPointerCancel:I,onPointerDown:L,onPointerMove:R,onPointerUp:z,ref:_,tabIndex:-1,type:`button`,...p}),t[43]=D,t[44]=p,t[45]=x,t[46]=L,t[47]=R,t[48]=z,t[49]=P,t[50]=F,t[51]=I,t[52]=B):B=t[52],B}function he(e){e.style.removeProperty(`width`),e.style.removeProperty(`transition-duration`)}function ge(e){e.style.setProperty(`transition-duration`,`0ms`)}function _e(e){return e!==null}function ve(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`[&_[data-slot=input]]:h-auto [&_[data-slot=input]]:p-0 [&_[data-slot=input]]:font-medium [&_[data-slot=input]]:text-sidebar-foreground [&_[data-slot=input]]:text-sm [&_[data-slot=input]]:leading-normal [&_[data-slot=input]]:placeholder:text-sidebar-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(v,{className:i,unstyled:!0,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ye(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`relative flex min-w-0 w-full flex-1 flex-col bg-background surface-grain`,`md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ms-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ms-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm/5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`main`,{className:i,"data-slot":`sidebar-inset`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function be(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex flex-col gap-2 px-[var(--sidebar-content-inset)] py-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-sidebar":`footer`,"data-slot":`sidebar-footer`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $(e){let t=(0,j.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,fixedHeader:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=r?(0,M.jsx)(`div`,{className:`w-full shrink-0`,children:r}):null,t[4]=r,t[5]=a);let o=r&&`[&>[data-sidebar=group]:first-child]:pt-0`,s;t[6]!==n||t[7]!==o?(s=u(`flex w-full min-w-0 flex-col [overflow-anchor:none] group-data-[collapsible=icon]:overflow-hidden [&>[data-sidebar=group]+[data-sidebar=group]]:pt-0`,o,n),t[6]=n,t[7]=o,t[8]=s):s=t[8];let c;t[9]!==i||t[10]!==s?(c=(0,M.jsx)(y,{hideScrollbars:!0,scrollFade:!0,scrollFadePadding:!1,viewportTabIndex:-1,className:`h-auto min-h-0 flex-1 [&>[data-slot=scroll-area-viewport]]:[--fade-size:0.75rem]`,children:(0,M.jsx)(`div`,{className:s,"data-sidebar":`content`,"data-slot":`sidebar-content`,...i})}),t[9]=i,t[10]=s,t[11]=c):c=t[11];let l;return t[12]!==a||t[13]!==c?(l=(0,M.jsxs)(M.Fragment,{children:[a,c]}),t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function xe(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`relative flex w-full min-w-0 flex-col p-[var(--sidebar-content-inset)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`div`,{className:i,"data-sidebar":`group`,"data-slot":`sidebar-group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Se(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`flex w-full min-w-0 flex-col gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`ul`,{className:i,"data-sidebar":`menu`,"data-slot":`sidebar-menu`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ce(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`li`,{className:i,"data-sidebar":`menu-item`,"data-slot":`sidebar-menu-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var we=r(`peer/menu-button flex w-full cursor-pointer items-center gap-[var(--sidebar-control-gap)] overflow-hidden text-left outline-hidden ring-ring transition-[width,height,padding] hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-64 aria-disabled:pointer-events-none aria-disabled:opacity-64 data-[active=true]:bg-sidebar-row-selected data-[active=true]:font-medium data-[active=true]:text-sidebar-foreground data-[state=open]:hover:bg-sidebar-row-hover data-[state=open]:hover:text-sidebar-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-[var(--sidebar-content-inset)]! [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-[var(--sidebar-icon-color)] hover:[&>svg]:text-sidebar-foreground active:[&>svg]:text-sidebar-foreground data-[active=true]:[&>svg]:text-sidebar-foreground`,{defaultVariants:{size:`default`,variant:`default`},variants:{size:{default:`h-8 rounded-[var(--control-radius)] px-[var(--sidebar-row-content-inset)] py-1.5 text-sm`,icon:`size-8 justify-center rounded-[var(--control-radius)] p-0`,lg:`h-12 rounded-lg p-2 text-sm group-data-[collapsible=icon]:p-0!`,sm:`h-7 rounded-lg p-2 text-xs`},variant:{default:`font-medium text-sidebar-foreground`,outline:`bg-sidebar-control-surface ring-1 ring-sidebar-border`,project:`font-normal text-sidebar-muted-foreground`,settings:`h-9 gap-2.5 rounded-xl px-3 font-normal text-sidebar-foreground data-[active=true]:font-normal [&>svg:not([class*='size-'])]:size-4.5 [&>svg]:text-sidebar-foreground`}}});function Te(e){let t=(0,j.c)(13),{isActive:n,variant:r,size:i,tooltip:o,className:c,render:l,...d}=e,f=n!==void 0&&n,m=r===void 0?`default`:r,_=i===void 0?`default`:i,{isMobile:v,state:y}=Z(),b={className:u(we({size:_,variant:m}),c),"data-active":f,"data-sidebar":`menu-button`,"data-size":_,"data-slot":`sidebar-menu-button`},x=a(b,d),S;t[0]!==x||t[1]!==l?(S={defaultTagName:`button`,props:x,render:l},t[0]=x,t[1]=l,t[2]=S):S=t[2];let C=s(S);if(!o)return C;if(typeof o==`string`){let e;t[3]===o?e=t[4]:(e={children:o},t[3]=o,t[4]=e),o=e}let w=C,T;t[5]===w?T=t[6]:(T=(0,M.jsx)(p,{render:w}),t[5]=w,t[6]=T);let E=y!==`collapsed`||v,D;t[7]!==E||t[8]!==o?(D=(0,M.jsx)(h,{align:`center`,hidden:E,side:`right`,...o}),t[7]=E,t[8]=o,t[9]=D):D=t[9];let O;return t[10]!==T||t[11]!==D?(O=(0,M.jsxs)(g,{children:[T,D]}),t[10]=T,t[11]=D,t[12]=O):O=t[12],O}function Ee(e){let t=(0,j.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?`tree`:i)===`flat`?`gap-0.5`:`mx-3.5 translate-x-px gap-1 border-sidebar-border border-l px-2.5 py-0.5`,o;t[4]!==n||t[5]!==a?(o=u(`flex min-w-0 flex-col`,a,`group-data-[collapsible=icon]:hidden`,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,M.jsx)(`ul`,{className:o,"data-sidebar":`menu-sub`,"data-slot":`sidebar-menu-sub`,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function De(e){let t=(0,j.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=u(`group/menu-sub-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,M.jsx)(`li`,{className:i,"data-sidebar":`menu-sub-item`,"data-slot":`sidebar-menu-sub-item`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Oe(e){let t=(0,j.c)(9),n,r,i,o;if(t[0]!==e){let{size:c,isActive:l,className:d,render:f,...p}=e;n=f;let m=c===void 0?`md`:c,h=l!==void 0&&l,g={className:u(`-translate-x-px flex h-7 min-w-0 cursor-pointer items-center gap-2 overflow-hidden rounded-lg px-2 text-sidebar-foreground outline-hidden ring-ring hover:bg-sidebar-row-hover hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-inset active:bg-sidebar-row-active active:text-sidebar-foreground disabled:pointer-events-none disabled:opacity-64 aria-disabled:pointer-events-none aria-disabled:opacity-64 [&>span:last-child]:truncate [&>svg:not([class*='size-'])]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-foreground`,`data-[active=true]:bg-sidebar-row-selected data-[active=true]:text-sidebar-foreground`,m===`sm`&&`text-xs`,m===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,d),"data-active":h,"data-sidebar":`menu-sub-button`,"data-size":m,"data-slot":`sidebar-menu-sub-button`};o=s,r=`a`,i=a(g,p),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o}else n=t[1],r=t[2],i=t[3],o=t[4];let c;return t[5]!==n||t[6]!==r||t[7]!==i?(c={defaultTagName:r,props:i,render:n},t[5]=n,t[6]=r,t[7]=i,t[8]=c):c=t[8],o(c)}export{G as _,ve as a,L as b,Te as c,Oe as d,De as f,Z as g,pe as h,xe as i,Ce as l,me as m,$ as n,ye as o,le as p,be as r,Se as s,fe as t,Ee as u,W as v,N as y};
2
+ //# sourceMappingURL=sidebar-Dj0htG-5.js.map
@@ -1,2 +1,2 @@
1
- import{o as e}from"./p4ProjectFile-DVeZFEli.js";function t(e){let t=new Set;for(let n of e)for(let e of n.memberProjects)if(t.add(e.environmentId),t.size>1)return!0;return!1}function n(t){let n=new Map,r=e({projects:t.projects,settings:t.settings,preferredEnvironmentId:t.primaryEnvironmentId});for(let e of r)for(let t of e.members)n.set(t.physicalProjectKey,e.key);return n}function r(t){return e({projects:t.projects,groupScratchProjects:t.groupScratchProjects??!1,settings:t.settings,preferredEnvironmentId:t.primaryEnvironmentId}).map(e=>{let n=e.members.map(({physicalProjectKey:e,project:n})=>({...n,physicalProjectKey:e,environmentLabel:t.resolveEnvironmentLabel(n.environmentId)})),r=n.find(t=>t.environmentId===e.representative.environmentId&&t.id===e.representative.id)??n[0],i=t.primaryEnvironmentId!==null&&n.some(e=>e.environmentId===t.primaryEnvironmentId),a=t.primaryEnvironmentId!==null&&n.some(e=>e.environmentId!==t.primaryEnvironmentId),o=n.filter(e=>t.primaryEnvironmentId!==null&&e.environmentId!==t.primaryEnvironmentId),s=o.flatMap(e=>e.environmentLabel?[e.environmentLabel]:[]).filter((e,t,n)=>n.indexOf(e)===t),c=t.isDesktopLocalEnvironment??(()=>!1),l=t.isWslEnvironment??(()=>!1),u=o.length>0&&o.every(e=>c(e.environmentId)),d=o.length>0&&o.every(e=>l(e.environmentId));return{...r,projectKey:e.key,displayName:e.label,groupedProjectCount:n.length,environmentPresence:i&&a?`mixed`:a?`remote-only`:`local-only`,allRemoteMembersAreDesktopLocal:u,allRemoteMembersAreWsl:d,memberProjects:n,memberProjectRefs:e.memberProjectRefs,remoteEnvironmentLabels:s}})}function i(e){let t=e.preferredProjectRef,n=e.groups.flatMap(e=>{let n=t?e.memberProjectRefs.some(e=>e.environmentId===t.environmentId&&e.projectId===t.projectId):!1,r=(t?e.memberProjects.find(e=>e.environmentId===t.environmentId&&e.id===t.projectId)??e.memberProjects.find(e=>e.environmentId===t.environmentId):null)??e.memberProjects.find(t=>t.environmentId===e.environmentId&&t.id===e.id)??e.memberProjects[0];return r?[{group:e,targetProject:r,isPreferred:n}]:[]}),r=n.findIndex(e=>e.isPreferred);return r<=0?n:[n[r],...n.slice(0,r),...n.slice(r+1)]}export{t as i,i as n,r,n as t};
2
- //# sourceMappingURL=sidebarProjectGrouping-DEvzxecx.js.map
1
+ import{o as e}from"./p4ProjectFile-BzCYJ8I-.js";function t(e){let t=new Set;for(let n of e)for(let e of n.memberProjects)if(t.add(e.environmentId),t.size>1)return!0;return!1}function n(t){let n=new Map,r=e({projects:t.projects,settings:t.settings,preferredEnvironmentId:t.primaryEnvironmentId});for(let e of r)for(let t of e.members)n.set(t.physicalProjectKey,e.key);return n}function r(t){return e({projects:t.projects,groupScratchProjects:t.groupScratchProjects??!1,settings:t.settings,preferredEnvironmentId:t.primaryEnvironmentId}).map(e=>{let n=e.members.map(({physicalProjectKey:e,project:n})=>({...n,physicalProjectKey:e,environmentLabel:t.resolveEnvironmentLabel(n.environmentId)})),r=n.find(t=>t.environmentId===e.representative.environmentId&&t.id===e.representative.id)??n[0],i=t.primaryEnvironmentId!==null&&n.some(e=>e.environmentId===t.primaryEnvironmentId),a=t.primaryEnvironmentId!==null&&n.some(e=>e.environmentId!==t.primaryEnvironmentId),o=n.filter(e=>t.primaryEnvironmentId!==null&&e.environmentId!==t.primaryEnvironmentId),s=o.flatMap(e=>e.environmentLabel?[e.environmentLabel]:[]).filter((e,t,n)=>n.indexOf(e)===t),c=t.isDesktopLocalEnvironment??(()=>!1),l=t.isWslEnvironment??(()=>!1),u=o.length>0&&o.every(e=>c(e.environmentId)),d=o.length>0&&o.every(e=>l(e.environmentId));return{...r,projectKey:e.key,displayName:e.label,groupedProjectCount:n.length,environmentPresence:i&&a?`mixed`:a?`remote-only`:`local-only`,allRemoteMembersAreDesktopLocal:u,allRemoteMembersAreWsl:d,memberProjects:n,memberProjectRefs:e.memberProjectRefs,remoteEnvironmentLabels:s}})}function i(e){let t=e.preferredProjectRef,n=e.groups.flatMap(e=>{let n=t?e.memberProjectRefs.some(e=>e.environmentId===t.environmentId&&e.projectId===t.projectId):!1,r=(t?e.memberProjects.find(e=>e.environmentId===t.environmentId&&e.id===t.projectId)??e.memberProjects.find(e=>e.environmentId===t.environmentId):null)??e.memberProjects.find(t=>t.environmentId===e.environmentId&&t.id===e.id)??e.memberProjects[0];return r?[{group:e,targetProject:r,isPreferred:n}]:[]}),r=n.findIndex(e=>e.isPreferred);return r<=0?n:[n[r],...n.slice(0,r),...n.slice(r+1)]}export{t as i,i as n,r,n as t};
2
+ //# sourceMappingURL=sidebarProjectGrouping-DxzT7QCQ.js.map
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Sx as t,ma as n,t as r,xx as i}from"./utils-geC9CGP4.js";var a=t(),o=e(n(),1),s=i(`bg-muted-foreground/15 motion-safe:animate-skeleton`,{variants:{shape:{block:`rounded-sm`,card:`rounded-lg`,pill:`rounded-full`}},defaultVariants:{shape:`block`}});function c(e){let t=(0,a.c)(10),n,i,c;t[0]===e?(n=t[1],i=t[2],c=t[3]):({className:n,shape:c,...i}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=c);let l;t[4]!==n||t[5]!==c?(l=r(s({shape:c}),n),t[4]=n,t[5]=c,t[6]=l):l=t[6];let u;return t[7]!==i||t[8]!==l?(u=(0,o.jsx)(`div`,{className:l,"data-slot":`skeleton`,...i}),t[7]=i,t[8]=l,t[9]=u):u=t[9],u}export{c as t};
2
- //# sourceMappingURL=skeleton-BFPHmDcq.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{Cx as t,ma as n,t as r,wx as i}from"./utils-DmS758az.js";var a=i(),o=e(n(),1),s=t(`bg-muted-foreground/15 motion-safe:animate-skeleton`,{variants:{shape:{block:`rounded-sm`,card:`rounded-lg`,pill:`rounded-full`}},defaultVariants:{shape:`block`}});function c(e){let t=(0,a.c)(10),n,i,c;t[0]===e?(n=t[1],i=t[2],c=t[3]):({className:n,shape:c,...i}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=c);let l;t[4]!==n||t[5]!==c?(l=r(s({shape:c}),n),t[4]=n,t[5]=c,t[6]=l):l=t[6];let u;return t[7]!==i||t[8]!==l?(u=(0,o.jsx)(`div`,{className:l,"data-slot":`skeleton`,...i}),t[7]=i,t[8]=l,t[9]=u):u=t[9],u}export{c as t};
2
+ //# sourceMappingURL=skeleton-CtSxs1y1.js.map