@p4code/cli 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (412) 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-mL63pmet.mjs} +7185 -5813
  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 +2114 -2088
  9. package/dist/client/assets/{AnimatedHeight-BwS0L5jd.js → AnimatedHeight-CcLJhBdM.js} +2 -2
  10. package/dist/client/assets/{AuthSurfaceShell-B5dTwcVl.js → AuthSurfaceShell-DV9IfxfT.js} +2 -2
  11. package/dist/client/assets/{CSPContext-B1m61J9R.js → CSPContext-5fUBIm56.js} +2 -2
  12. package/dist/client/assets/ChatGptUsageButton-BjxGhmRJ.js +2 -0
  13. package/dist/client/assets/ChatMarkdown-S_dLZdsH.js +65 -0
  14. package/dist/client/assets/{CodexSetupSection.logic-BpefaM8S.js → CodexSetupSection.logic-CpyIRPfJ.js} +2 -2
  15. package/dist/client/assets/{ComboboxClear-CSnbXRcJ.js → ComboboxClear-DCanpiKf.js} +2 -2
  16. package/dist/client/assets/{CommandBlock-DcgLBXYD.js → CommandBlock-CCY3uLti.js} +2 -2
  17. package/dist/client/assets/{ComposerPromptEditor-oniaSNnQ.js → ComposerPromptEditor-CTei4iV_.js} +13 -13
  18. package/dist/client/assets/{CompositeRoot-ykxKqF8U.js → CompositeRoot-Dz15SC7i.js} +2 -2
  19. package/dist/client/assets/{ConnectionStatusDot-BvfbN2Tp.js → ConnectionStatusDot-BXxnqJgm.js} +2 -2
  20. package/dist/client/assets/{DevicePanel-wE6eEt9P.js → DevicePanel-hMvCLVG0.js} +2 -2
  21. package/dist/client/assets/{DeviceSetup-kaQqI-00.js → DeviceSetup--U2_cth3.js} +2 -2
  22. package/dist/client/assets/{DialogTitle-Cwi7QOum.js → DialogTitle-CdRWiE23.js} +2 -2
  23. package/dist/client/assets/{DiffCommentAnnotation-CnCPh4ot.js → DiffCommentAnnotation-BO9ZEof3.js} +3 -3
  24. package/dist/client/assets/DiffFileTree-DOh6vP89.js +2 -0
  25. package/dist/client/assets/DiffPanel-BdHAXHTV.js +2 -0
  26. package/dist/client/assets/{DiffWorkerPoolProvider-C8TyWhmO.js → DiffWorkerPoolProvider-HxohyeGq.js} +3 -3
  27. package/dist/client/assets/{EnvironmentMachineIcon-CBS8TSmT.js → EnvironmentMachineIcon-DYqBsAxl.js} +2 -2
  28. package/dist/client/assets/{ExpandableText-CWbIeyDn.js → ExpandableText-B9MQs34j.js} +3 -3
  29. package/dist/client/assets/{FieldControl-CWR3fEt0.js → FieldControl-DuWupdaP.js} +2 -2
  30. package/dist/client/assets/{FileDiff-BiIVs0i-.js → FileDiff-XdtrigfB.js} +2 -2
  31. package/dist/client/assets/{FilePreviewPanel-CXgaN8cb.js → FilePreviewPanel-Dj_tLsu8.js} +5 -5
  32. package/dist/client/assets/{FoldedSettingsSection-BimbnaOl.js → FoldedSettingsSection-CJhrFR0_.js} +2 -2
  33. package/dist/client/assets/{FormContext-DyOeI4sU.js → FormContext-DzMW0viI.js} +2 -2
  34. package/dist/client/assets/{Icons-BlUgSxml.js → Icons-DJ824_3l.js} +2 -2
  35. package/dist/client/assets/{KeybindingsSettings.logic-Dfld_XQx.js → KeybindingsSettings.logic-DBks3HZy.js} +2 -2
  36. package/dist/client/assets/{NoProjectsHero-ZE4gAFj0.js → NoProjectsHero-DyYs0dvZ.js} +2 -2
  37. package/dist/client/assets/{PanelLayoutControls-x5a58Pdn.js → PanelLayoutControls-DmAKKHlt.js} +10 -10
  38. package/dist/client/assets/{PierreEntryIcon-DeBbijxO.js → PierreEntryIcon-uqPwKknu.js} +2 -2
  39. package/dist/client/assets/{PreviewPanel-2vuw0skj.js → PreviewPanel-BQkFJlas.js} +2 -2
  40. package/dist/client/assets/ProjectDefaultsSettings-DglkVzkM.js +2 -0
  41. package/dist/client/assets/{ProjectFavicon-BhJj4G_1.js → ProjectFavicon-CDpXbAhP.js} +3 -3
  42. package/dist/client/assets/ProjectIconPickerDialog-yxBKY_6V.js +2 -0
  43. package/dist/client/assets/{ProjectMonogram-BgobvHld.js → ProjectMonogram-Dd6xeLhS.js} +2 -2
  44. package/dist/client/assets/{ProviderAuthTerminal-CJSJcjB9.js → ProviderAuthTerminal-DgUIYMm9.js} +2 -2
  45. package/dist/client/assets/{ProviderModelPicker-riIGf-PI.js → ProviderModelPicker-lxEwYGAB.js} +2 -2
  46. package/dist/client/assets/{ProviderSettingsForm-Dh_vspcE.js → ProviderSettingsForm-DGMc_kKy.js} +2 -2
  47. package/dist/client/assets/{PullRequestCodeTab-Do36z71f.js → PullRequestCodeTab-CXrKDJ3m.js} +3 -3
  48. package/dist/client/assets/{ReadOnlySourcePreview-BfLIaC5x.js → ReadOnlySourcePreview-DkXxXiTJ.js} +2 -2
  49. package/dist/client/assets/{RedactedSensitiveText-D5aX1wQs.js → RedactedSensitiveText-DtYR94zZ.js} +2 -2
  50. package/dist/client/assets/{RenderErrorBoundary-DTEG6arv.js → RenderErrorBoundary-Dla4qj6V.js} +2 -2
  51. package/dist/client/assets/ScheduledTasksSettings-2vzTutJz.js +4 -0
  52. package/dist/client/assets/ScopedSwitch-BdMg8rKM.js +2 -0
  53. package/dist/client/assets/{SettingsPanels-Betza2Al.js → SettingsPanels-XjjE56Xl.js} +7 -7
  54. package/dist/client/assets/{SettingsPanels.logic-Dn2Jcxyy.js → SettingsPanels.logic-DSOfF88n.js} +2 -2
  55. package/dist/client/assets/{SettingsScopeNotice-CAaNSKvu.js → SettingsScopeNotice-um2bOG_J.js} +2 -2
  56. package/dist/client/assets/{T3ConnectAccountPages-DEqOE3hy.js → T3ConnectAccountPages-Dx0LK6U5.js} +2 -2
  57. package/dist/client/assets/{T3ConnectSidebarSignIn-C4jpzdPh.js → T3ConnectSidebarSignIn-2r05ubXZ.js} +2 -2
  58. package/dist/client/assets/{ThemeEditorPanel-BBkly3jP.js → ThemeEditorPanel-CnhjGelD.js} +3 -3
  59. package/dist/client/assets/{ThreadTerminalDrawer-Z7ArIuq0.js → ThreadTerminalDrawer-BzElqolI.js} +4 -4
  60. package/dist/client/assets/{UsageLimits-7-_nKQT_.js → UsageLimits-B_IIjpyx.js} +2 -2
  61. package/dist/client/assets/{Virtualizer-EvXC5PAR.js → Virtualizer-DItXd38b.js} +2 -2
  62. package/dist/client/assets/WorkspaceBreadcrumb-Y41aNu4D.js +2 -0
  63. package/dist/client/assets/WorkspacePageContainer-D3YV5jc4.js +2 -0
  64. package/dist/client/assets/{WorkspacePageHeader-DB9Z9OtR.js → WorkspacePageHeader-Dduxade-.js} +2 -2
  65. package/dist/client/assets/_chat-B4G7pIId.js +58 -0
  66. package/dist/client/assets/{_chat.index-CTfxLY4F.js → _chat.index-BGOR58rk.js} +2 -2
  67. package/dist/client/assets/{_chat.new-B_FNmP8f.js → _chat.new-CioC4l4P.js} +3 -3
  68. package/dist/client/assets/_chat.pull-requests-Cs7eiOH6.js +2 -0
  69. package/dist/client/assets/{abnfDiagram-VCTEODGH-Du15a8Yu.js → abnfDiagram-VCTEODGH-l9yoycqs.js} +2 -2
  70. package/dist/client/assets/{alert-DUQHh6vz.js → alert-B49R80NU.js} +2 -2
  71. package/dist/client/assets/architecture-7GRP2DOG-B67w-l9F.js +1 -0
  72. package/dist/client/assets/{architectureDiagram-5GKGNRK7-DhXH9Bsf.js → architectureDiagram-5GKGNRK7-BQwAkSAo.js} +2 -2
  73. package/dist/client/assets/arrow-left-D1nB4UjJ.js +1 -0
  74. package/dist/client/assets/arrow-right-Cbg5uZyw.js +1 -0
  75. package/dist/client/assets/arrow-up-down-DRcJBavW.js +1 -0
  76. package/dist/client/assets/assets-CLIqG-m-.js +2 -0
  77. package/dist/client/assets/bell-D5jiydSo.js +1 -0
  78. package/dist/client/assets/{blockDiagram-I7D4REHJ-CZ4PIO64.js → blockDiagram-I7D4REHJ-C1YTuxst.js} +2 -2
  79. package/dist/client/assets/blocks-mHGBm843.js +1 -0
  80. package/dist/client/assets/bot-Db9dBVz5.js +1 -0
  81. package/dist/client/assets/{browserHistoryStore-D6A_83JY.js → browserHistoryStore-D6dhsqE8.js} +2 -2
  82. package/dist/client/assets/{browserLinkTarget-BuFHp5RQ.js → browserLinkTarget-D0HujxdB.js} +2 -2
  83. package/dist/client/assets/{c4Diagram-7LVT6UL2-tMXW_Jy8.js → c4Diagram-7LVT6UL2-DpPcyaba.js} +2 -2
  84. package/dist/client/assets/calendar-clock-KAbrMUlv.js +1 -0
  85. package/dist/client/assets/channel-D8Is9vbt.js +2 -0
  86. package/dist/client/assets/chart-no-axes-column-CnM4ppv4.js +1 -0
  87. package/dist/client/assets/checkbox-WRJ0D_10.js +2 -0
  88. package/dist/client/assets/{chunk-4HAMMTFA-gISFFADw.js → chunk-4HAMMTFA-C0t_GKFv.js} +2 -2
  89. package/dist/client/assets/{chunk-75Z2AOVW-iWd1WVXJ.js → chunk-75Z2AOVW-B6rgeqZP.js} +2 -2
  90. package/dist/client/assets/{chunk-DU6HZSFF-hD69jU_T.js → chunk-DU6HZSFF-BuYM0Cu8.js} +2 -2
  91. package/dist/client/assets/{chunk-F27PBJKO-DnDFIjHp.js → chunk-F27PBJKO-CvPd3lcw.js} +2 -2
  92. package/dist/client/assets/{chunk-GMAD6QVW-Chr0sR5B.js → chunk-GMAD6QVW-DbBkxyCE.js} +2 -2
  93. package/dist/client/assets/{chunk-GVQU2GXP-D84Xc6Vy.js → chunk-GVQU2GXP-CVZeJiG5.js} +2 -2
  94. package/dist/client/assets/{chunk-IMKFNOWR-DOdemMNR.js → chunk-IMKFNOWR-CbY3DGV3.js} +2 -2
  95. package/dist/client/assets/{chunk-L3NEJ4N5-CILnb7VE.js → chunk-L3NEJ4N5-Bhkym4YW.js} +2 -2
  96. package/dist/client/assets/{chunk-OSK3NFVY-Bxpu9Oo4.js → chunk-OSK3NFVY-B89_sN-h.js} +2 -2
  97. package/dist/client/assets/{chunk-P2QGCYS3-75l6wJUu.js → chunk-P2QGCYS3-zeIYnZbd.js} +2 -2
  98. package/dist/client/assets/{chunk-POPQ4Y6H-jYZ1RdM0.js → chunk-POPQ4Y6H-Bv7ZWEJI.js} +2 -2
  99. package/dist/client/assets/{chunk-PWAF6VOD-DtONZJrC.js → chunk-PWAF6VOD-BnsKTwi6.js} +2 -2
  100. package/dist/client/assets/{chunk-SHT3W25Y-NY6-WqgC.js → chunk-SHT3W25Y-Daoidttm.js} +2 -2
  101. package/dist/client/assets/{chunk-SVP7TREG-CGG6Z85U.js → chunk-SVP7TREG-BK4Qxtm6.js} +2 -2
  102. package/dist/client/assets/{chunk-TICWLB2K-DzB7PtXF.js → chunk-TICWLB2K-CihSBYRG.js} +2 -2
  103. package/dist/client/assets/classDiagram-ZZMXUADV-CxsiNRJs.js +2 -0
  104. package/dist/client/assets/classDiagram-v2-VYDZK3BY-CxsiNRJs.js +2 -0
  105. package/dist/client/assets/{collapsible-CLujF6F7.js → collapsible-DyaDJVJ5.js} +2 -2
  106. package/dist/client/assets/{color-picker-BG3Rpy98.js → color-picker-BWffD8SG.js} +2 -2
  107. package/dist/client/assets/{combobox-Cx4FP7Bk.js → combobox-zg5NNJOT.js} +2 -2
  108. package/dist/client/assets/{command-CVKxjYiJ.js → command-CBIpuXFt.js} +2 -2
  109. package/dist/client/assets/{connect-DeTNO4tO.js → connect-BVveo2H6.js} +2 -2
  110. package/dist/client/assets/{connect-agent-CTLxG7lp.js → connect-agent-Rlpt-C4T.js} +2 -2
  111. package/dist/client/assets/corner-left-up-DSgsQQJh.js +1 -0
  112. package/dist/client/assets/{cynefin-OW5HDTMX-C3y7gjYM.js → cynefin-OW5HDTMX-BTvkQvHj.js} +1 -1
  113. package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-DEFegOUv.js → cynefinDiagram-5FMLGOSQ-glf_yMKF.js} +2 -2
  114. package/dist/client/assets/{dagre-GXQ25YYZ-C3YHw-ZL.js → dagre-GXQ25YYZ-XUkjXaQW.js} +2 -2
  115. package/dist/client/assets/device-Bu2mO4gL.js +2 -0
  116. package/dist/client/assets/{diagram-S7CK7UJ4-B04fDyJ1.js → diagram-S7CK7UJ4-CiNxlSJZ.js} +2 -2
  117. package/dist/client/assets/{diagram-UQ7AKVKN-DJ5yQdqn.js → diagram-UQ7AKVKN-C4_9QuDF.js} +2 -2
  118. package/dist/client/assets/{diagram-VSXAHHWV-DwQn4LJH.js → diagram-VSXAHHWV-BoRcnfst.js} +2 -2
  119. package/dist/client/assets/{diagram-VX7I27RA-BFeEJB2L.js → diagram-VX7I27RA-g5AlZjEL.js} +2 -2
  120. package/dist/client/assets/{diagram-Z3DM3KII-DjNPPgna.js → diagram-Z3DM3KII-Crw_yJrX.js} +2 -2
  121. package/dist/client/assets/{dialog-BBidAZq_.js → dialog-C5PVc2Dc.js} +2 -2
  122. package/dist/client/assets/{diffRendering-BcgWZBc6.js → diffRendering-DVfiIxj4.js} +2 -2
  123. package/dist/client/assets/{discovery-list-BOhsy2yk.js → discovery-list-Bb2RP3-9.js} +2 -2
  124. package/dist/client/assets/{dist-D-bAcBTo.js → dist-BTyn8sKm.js} +3 -3
  125. package/dist/client/assets/download-BrSkg4EE.js +1 -0
  126. package/dist/client/assets/{draft-input-Dk-JXf0v.js → draft-input-CwdApNsc.js} +2 -2
  127. package/dist/client/assets/{duoViewer-DELDCd_3.js → duoViewer-BsAzTMk3.js} +2 -2
  128. package/dist/client/assets/dynamic-COZhF9Vt.js +3 -0
  129. package/dist/client/assets/earth-D0ZhOX9I.js +1 -0
  130. package/dist/client/assets/{ebnfDiagram-PWID7BFC-R_zFp3Q4.js → ebnfDiagram-PWID7BFC-Co02q3t2.js} +2 -2
  131. package/dist/client/assets/ellipsis-Dze-H3uy.js +1 -0
  132. package/dist/client/assets/{embeddedScripts-S6heIv6s.js → embeddedScripts-cxUGD6UP.js} +2 -2
  133. package/dist/client/assets/{empty-B3wHlMsI.js → empty-B9cgefGv.js} +2 -2
  134. package/dist/client/assets/entities-B0tFBQjY.js +2 -0
  135. package/dist/client/assets/{erDiagram-RLTQ6QDP-DgSVOlTI.js → erDiagram-RLTQ6QDP-BuoWr1gw.js} +2 -2
  136. package/dist/client/assets/eventmodeling-NTZA5JFV-jDgS08dP.js +1 -0
  137. package/dist/client/assets/eye-OVEPp8Os.js +1 -0
  138. package/dist/client/assets/file-search-Y-7Ql86o.js +1 -0
  139. package/dist/client/assets/{fileLinks-M_i1pQMr.js → fileLinks-BBnShh-N.js} +2 -2
  140. package/dist/client/assets/{fileTreeExpansion-BoH-LpwD.js → fileTreeExpansion-DaFd8SRp.js} +2 -2
  141. package/dist/client/assets/flowDiagram-HODETNUW-DsHnGCQL.js +1 -0
  142. package/dist/client/assets/folder-git-2-DdgpEuW8.js +1 -0
  143. package/dist/client/assets/folder-open-B9DmXcog.js +1 -0
  144. package/dist/client/assets/folder-plus-CLFJj-Gh.js +1 -0
  145. package/dist/client/assets/{ganttDiagram-EL5Y4UJY-CsDp8eOV.js → ganttDiagram-EL5Y4UJY-CMAUkeMs.js} +2 -2
  146. package/dist/client/assets/{getDiffFileInput-y6l8uCrc.js → getDiffFileInput-D0WCXPuc.js} +2 -2
  147. package/dist/client/assets/git-branch-SJsNyJlB.js +1 -0
  148. package/dist/client/assets/{gitGraph-4MIJSDKK-ByZ8Ddcu.js → gitGraph-4MIJSDKK-B22BskFD.js} +1 -1
  149. package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-QkPoZOxP.js → gitGraphDiagram-WWUBYQGX-D9yz6pSR.js} +2 -2
  150. package/dist/client/assets/grip-vertical-_2pxkeEI.js +1 -0
  151. package/dist/client/assets/{guideRunStore-Ca6LGvkb.js → guideRunStore-CPFfk-BJ.js} +2 -2
  152. package/dist/client/assets/hard-drive-DMfAIp4-.js +1 -0
  153. package/dist/client/assets/history-C7dJNEkM.js +1 -0
  154. package/dist/client/assets/house-BpsJcs6J.js +1 -0
  155. package/dist/client/assets/{htmlRender-Bs_dTcPz.js → htmlRender-Cdm053qU.js} +2 -2
  156. package/dist/client/assets/index-TkyxWt2Q.js +3 -0
  157. package/dist/client/assets/{info-A6RAGUB7-DWgAQmsU.js → info-A6RAGUB7-CicHHROU.js} +1 -1
  158. package/dist/client/assets/{infoDiagram-27XIBGKW-DqBsTg-0.js → infoDiagram-27XIBGKW-DAFhUj2V.js} +2 -2
  159. package/dist/client/assets/{input-BOT1WFGI.js → input-CN9xdIYL.js} +2 -2
  160. package/dist/client/assets/{input-group-13zF6rZl.js → input-group-CV0ZpOg5.js} +2 -2
  161. package/dist/client/assets/{ishikawaDiagram-5VMMS53U-DhvmZSIn.js → ishikawaDiagram-5VMMS53U-CBEywTMi.js} +2 -2
  162. package/dist/client/assets/{journeyDiagram-3NMN7TZE-sBAsW8ZW.js → journeyDiagram-3NMN7TZE-BIKjvqRL.js} +2 -2
  163. package/dist/client/assets/{kanban-definition-UXKFOSKX-7pB8050L.js → kanban-definition-UXKFOSKX-XOFfprGt.js} +2 -2
  164. package/dist/client/assets/kbd-Fa27fInv.js +2 -0
  165. package/dist/client/assets/{keybindings-B4uuYLfE.js → keybindings-C81QSEVL.js} +2 -2
  166. package/dist/client/assets/keyboard-C0H4XsBS.js +1 -0
  167. package/dist/client/assets/{lazyRouteComponent-C2UuNVTE.js → lazyRouteComponent-BTBK1UDq.js} +2 -2
  168. package/dist/client/assets/{line-CYcVbD9r.js → line-CEyB3WPo.js} +2 -2
  169. package/dist/client/assets/{link-DnyZixWB.js → link-C1pmqztR.js} +2 -2
  170. package/dist/client/assets/link-CsVCGX_A.js +1 -0
  171. package/dist/client/assets/{linkedPrompt-Cjzkkr18.js → linkedPrompt-B6Q0Cmi6.js} +2 -2
  172. package/dist/client/assets/list-BKOLPymO.js +1 -0
  173. package/dist/client/assets/main-CJvawsJJ.js +27 -0
  174. package/dist/client/assets/main-DjXoj7An.css +2 -0
  175. package/dist/client/assets/{mediaReference-DCRMHOD7.js → mediaReference-o1DLUGKI.js} +2 -2
  176. package/dist/client/assets/{mediaSource-C-YyAgza.js → mediaSource-Cfv5uiFj.js} +2 -2
  177. package/dist/client/assets/{mermaid-parser.core-CUhkd3Km.js → mermaid-parser.core-BT2QN4a3.js} +4 -4
  178. package/dist/client/assets/{mermaid.core-7L34oYGP.js → mermaid.core-EPDLhovC.js} +5 -5
  179. package/dist/client/assets/message-circle-question-mark-0PixhBRe.js +1 -0
  180. package/dist/client/assets/message-square-dashed-jX8EWVKo.js +1 -0
  181. package/dist/client/assets/message-square-xfL83Fxi.js +1 -0
  182. package/dist/client/assets/messages-square-DwkvqiPv.js +1 -0
  183. package/dist/client/assets/{mindmap-definition-YA3MSWOX-CpfzOIsM.js → mindmap-definition-YA3MSWOX-aqL3ALYK.js} +2 -2
  184. package/dist/client/assets/number-field-BiWh0ioY.js +2 -0
  185. package/dist/client/assets/{observeResize-CK9qVTLF.js → observeResize-DBJpB0Hu.js} +2 -2
  186. package/dist/client/assets/{onboarding-DWVdcMTo.js → onboarding-gue-HaiI.js} +2 -2
  187. package/dist/client/assets/{openFileInPreview-DsWLDsnf.js → openFileInPreview-BuKYchiT.js} +2 -2
  188. package/dist/client/assets/{p4ProjectFile-DVeZFEli.js → p4ProjectFile-DH7qoFHx.js} +2 -2
  189. package/dist/client/assets/{packet-AYTQ26CC-TJIgXg7Z.js → packet-AYTQ26CC-BkyzJMIf.js} +1 -1
  190. package/dist/client/assets/{pair-Ds7MhGzA.js → pair-DESVHftX.js} +2 -2
  191. package/dist/client/assets/palette-DvhXYFMC.js +1 -0
  192. package/dist/client/assets/panel-left-DCz3M7jv.js +1 -0
  193. package/dist/client/assets/{panel-tab-close-button-CeVf2Cp1.js → panel-tab-close-button-DKugpobT.js} +2 -2
  194. package/dist/client/assets/panels-top-left-C1xu8Xiu.js +1 -0
  195. package/dist/client/assets/{pegDiagram-XKGWAZYB-BWjyJv0r.js → pegDiagram-XKGWAZYB-DilAu2aa.js} +2 -2
  196. package/dist/client/assets/{phoneViewer-4yzlTfRU.js → phoneViewer-xqyGZwKn.js} +2 -2
  197. package/dist/client/assets/{pie-WAS4IAKB-DI1xrBNC.js → pie-WAS4IAKB-DgPx2D64.js} +1 -1
  198. package/dist/client/assets/{pieDiagram-E7YTZNPT-D5BJ4dMD.js → pieDiagram-E7YTZNPT-D9PFl5qt.js} +2 -2
  199. package/dist/client/assets/{pierre-icons-C4_Is1e6.js → pierre-icons-BVuUNHGs.js} +2 -2
  200. package/dist/client/assets/popover-aTTlR6NX.js +2 -0
  201. package/dist/client/assets/{preview-ChiUlq6M.js → preview-8KYmxrad.js} +2 -2
  202. package/dist/client/assets/{preview-BXSjnvc2.js → preview-DgLUnqIn.js} +2 -2
  203. package/dist/client/assets/{previewMiniPlayerStore-BWBB4WZZ.js → previewMiniPlayerStore-CZUX4gpf.js} +2 -2
  204. package/dist/client/assets/primary-GHQewxsn.js +2 -0
  205. package/dist/client/assets/primaryCloudLinkState-BS4O3v7M.js +2 -0
  206. package/dist/client/assets/{projectFilesQueryState-DLmHVuBp.js → projectFilesQueryState-DmDFr3yJ.js} +2 -2
  207. package/dist/client/assets/projectScriptEditor-DxxYqdMP.js +2 -0
  208. package/dist/client/assets/{pullRequestDetail.logic-CiIqeGLs.js → pullRequestDetail.logic-C6mxjZFd.js} +4 -4
  209. package/dist/client/assets/{pullRequestReviewStore-Ckm9o--D.js → pullRequestReviewStore-VIPIhGsh.js} +2 -2
  210. package/dist/client/assets/pullRequests-DEHxyBeZ.js +2 -0
  211. package/dist/client/assets/{quadrantDiagram-AXDQQJYC-USH3mFeD.js → quadrantDiagram-AXDQQJYC-36GcvWjt.js} +2 -2
  212. package/dist/client/assets/queries-BAbZ6wRj.js +2 -0
  213. package/dist/client/assets/{query-DG-FU00d.js → query-gfas_Faw.js} +2 -2
  214. package/dist/client/assets/{radar-RG4KPBEZ-BgwqseQY.js → radar-RG4KPBEZ-B_1p1XBS.js} +1 -1
  215. package/dist/client/assets/radio-group-BcuemB8E.js +2 -0
  216. package/dist/client/assets/{railroad-74A4TZTK-lU1hozFq.js → railroad-74A4TZTK-DjaD7aBa.js} +1 -1
  217. package/dist/client/assets/railroad-abnf-HS5TGJTU-CA1GF-5t.js +1 -0
  218. package/dist/client/assets/railroad-ebnf-LZEXJU2U-Beda5tl-.js +1 -0
  219. package/dist/client/assets/railroad-peg-WCYAUIDC-D2CRVbbY.js +1 -0
  220. package/dist/client/assets/{railroadDiagram-O6MQD6OU-BX2DBjFX.js → railroadDiagram-O6MQD6OU-BfFU3IUU.js} +2 -2
  221. package/dist/client/assets/{renderScheduler-e5LS9_r8.js → renderScheduler-DE6WzqZi.js} +2 -2
  222. package/dist/client/assets/{requirementDiagram-BXWQKSXE-Bp2BwkCA.js → requirementDiagram-BXWQKSXE-WVgmezGx.js} +2 -2
  223. package/dist/client/assets/{rightPanelStore-Dnc28mSJ.js → rightPanelStore-CsSGBQ8t.js} +2 -2
  224. package/dist/client/assets/rotate-ccw-CyPuoUiH.js +1 -0
  225. package/dist/client/assets/rotate-cw-B20Q7RJJ.js +1 -0
  226. package/dist/client/assets/runtime-C9evwoB9.js +2 -0
  227. package/dist/client/assets/runtime-CxeCZPZ3.js +6 -0
  228. package/dist/client/assets/{sankeyDiagram-P5KCCOFB-BklNNjEB.js → sankeyDiagram-P5KCCOFB-BsCi2aYb.js} +2 -2
  229. package/dist/client/assets/scheduledTasksSettings.logic-Bin7R9R3.js +3 -0
  230. package/dist/client/assets/{scroll-area-Cj3OF_L_.js → scroll-area-CRoS-lxP.js} +2 -2
  231. package/dist/client/assets/{select-BDMo6Fqt.js → select-BXOHHCMJ.js} +2 -2
  232. package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-ufTHSg4p.js → sequenceDiagram-WJ2MYXX4-C_qj_Szb.js} +2 -2
  233. package/dist/client/assets/{server-DNo9AqHW.js → server-BBIVfjrf.js} +2 -2
  234. package/dist/client/assets/session-DZH3pyoG.js +2 -0
  235. package/dist/client/assets/session-logic-RDMPhilH.js +13 -0
  236. package/dist/client/assets/{settings-DxGY3RT5.js → settings-0qbtr9oy.js} +2 -2
  237. package/dist/client/assets/settings-2-DmZK5Wif.js +1 -0
  238. package/dist/client/assets/settings-Br2yM9q3.js +1 -0
  239. package/dist/client/assets/settings.appearance-CtG85Hzv.js +2 -0
  240. package/dist/client/assets/settings.archived-D1CPem1-.js +2 -0
  241. package/dist/client/assets/settings.computer-use-DvBtreaX.js +2 -0
  242. package/dist/client/assets/settings.connections-CeSH1Y-S.js +2 -0
  243. package/dist/client/assets/settings.decisions-FBz5pyct.js +2 -0
  244. package/dist/client/assets/settings.diagnostics-Ct39tZgQ.js +2 -0
  245. package/dist/client/assets/settings.general-YgAeT2ec.js +2 -0
  246. package/dist/client/assets/settings.integrations-DIuNSxXg.js +2 -0
  247. package/dist/client/assets/{settings.keybindings-CITYXalz.js → settings.keybindings-BHpTOm8T.js} +2 -2
  248. package/dist/client/assets/{settings.open-source-licenses-CTznEYnQ.js → settings.open-source-licenses-Dlp4u1NR.js} +2 -2
  249. package/dist/client/assets/settings.projects-BZP8BJZK.js +4 -0
  250. package/dist/client/assets/settings.providers-Dad6hRGg.js +3 -0
  251. package/dist/client/assets/settings.scheduled-tasks-B1Q7wnRI.js +2 -0
  252. package/dist/client/assets/settings.snap-shot-ZBGDHF90.js +2 -0
  253. package/dist/client/assets/settings.source-control-BXuO43FQ.js +2 -0
  254. package/dist/client/assets/{settings.storage-C4lRhJsq.js → settings.storage-Dl3cI_3U.js} +2 -2
  255. package/dist/client/assets/settingsLayout-DKjAOwp4.js +3 -0
  256. package/dist/client/assets/shield-question-mark-Cmz7w9_M.js +1 -0
  257. package/dist/client/assets/{sidebar-Bulbb3cX.js → sidebar-D6V5N0ZC.js} +2 -2
  258. package/dist/client/assets/{sidebarProjectGrouping-DEvzxecx.js → sidebarProjectGrouping-DVAIOuq4.js} +2 -2
  259. package/dist/client/assets/{skeleton-BFPHmDcq.js → skeleton-DuFqUDDw.js} +2 -2
  260. package/dist/client/assets/{sortable.esm-CHiRbsvI.js → sortable.esm-DdMawn0Y.js} +2 -2
  261. package/dist/client/assets/{sourceControl-DfhPxa0l.js → sourceControl-U8x7jR8g.js} +2 -2
  262. package/dist/client/assets/{spinner-rP6J82Of.js → spinner-C6X42yHv.js} +2 -2
  263. package/dist/client/assets/square-pen-Dew4fHbM.js +1 -0
  264. package/dist/client/assets/{standalone-page-BkHTM3MP.js → standalone-page-hDUmjFb0.js} +2 -2
  265. package/dist/client/assets/{stateDiagram-D77RDMKH-UnviM1_a.js → stateDiagram-D77RDMKH-FdsqVfsR.js} +2 -2
  266. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-PvZEFfKe.js +2 -0
  267. package/dist/client/assets/{swimlanes-42K2YHIH-CpD6LDbC.js → swimlanes-42K2YHIH-D65Z1Od_.js} +2 -2
  268. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DIDrEY3U.js +9 -0
  269. package/dist/client/assets/{terminalSessions-C9u_KQdo.js → terminalSessions-DhPFaHUr.js} +2 -2
  270. package/dist/client/assets/text-search-Cchv2p-9.js +1 -0
  271. package/dist/client/assets/{textarea-D7qN_9_U.js → textarea-CCFZJhy-.js} +2 -2
  272. package/dist/client/assets/{themePalette-au2ZXbqB.js → themePalette-CxbxrCEH.js} +3 -3
  273. package/dist/client/assets/threadSort-TlzPAte9.js +2 -0
  274. package/dist/client/assets/{timeline-definition-24CTP7MA-CNy-4Mtq.js → timeline-definition-24CTP7MA-DrXF0NCa.js} +2 -2
  275. package/dist/client/assets/toast-B-l3XS_F.js +2 -0
  276. package/dist/client/assets/{toggle-4i71sOFB.js → toggle-DOFhC9C7.js} +2 -2
  277. package/dist/client/assets/{toggle-group-BtpeJU3C.js → toggle-group-B1ghB_yR.js} +2 -2
  278. package/dist/client/assets/tooltip-CYNXW1Ow.js +2 -0
  279. package/dist/client/assets/{treeView-Q6P3EWNA-fz73DkUg.js → treeView-Q6P3EWNA-D6bZIPSq.js} +1 -1
  280. package/dist/client/assets/{treemap-WGGIJYW6-CHp0lk61.js → treemap-WGGIJYW6-CJr_vK1t.js} +1 -1
  281. package/dist/client/assets/{usage-BoYlRHNx.js → usage-1aJeDf79.js} +2 -2
  282. package/dist/client/assets/{usageAccess-BmfDNhp2.js → usageAccess-9ld15_dP.js} +2 -2
  283. package/dist/client/assets/{usageFormat-DdjdHqj5.js → usageFormat-D7uBkeaA.js} +2 -2
  284. package/dist/client/assets/{usageShortcuts-RpypNfqZ.js → usageShortcuts--2waLBa-.js} +2 -2
  285. package/dist/client/assets/{use-atom-command-Bc7LgQy1.js → use-atom-command-DdGPgtPS.js} +2 -2
  286. package/dist/client/assets/{useAriaLabelledBy-B_3SmrJo.js → useAriaLabelledBy-Bp_qmGgf.js} +2 -2
  287. package/dist/client/assets/{useHandleNewThread-Csguf2GC.js → useHandleNewThread-DtCuKpGU.js} +2 -2
  288. package/dist/client/assets/{useLocation-DaTcl6iI.js → useLocation-yjRHv-GS.js} +2 -2
  289. package/dist/client/assets/useNavigate-DfvN7ISg.js +2 -0
  290. package/dist/client/assets/{useNavigateBack-C43_t49N.js → useNavigateBack-NMRi6phK.js} +2 -2
  291. package/dist/client/assets/{useParams-s9hrFQQQ.js → useParams-OFLEf5Ub.js} +2 -2
  292. package/dist/client/assets/{usePermissionStatus-CCpQkKk1.js → usePermissionStatus-D4K04nHy.js} +2 -2
  293. package/dist/client/assets/usePullRequestActions-DyXuVFpA.js +3 -0
  294. package/dist/client/assets/{useRegisterFieldControl-BVraoamc.js → useRegisterFieldControl-QWoLGfik.js} +2 -2
  295. package/dist/client/assets/useScopedModelAvailability-udJ9IYpQ.js +2 -0
  296. package/dist/client/assets/useSettings-C1hmCYRR.js +3 -0
  297. package/dist/client/assets/{useT3ConnectAuthPrompt-D3ARnr92.js → useT3ConnectAuthPrompt-NQ5SmnTg.js} +2 -2
  298. package/dist/client/assets/utils-Nv21__t3.js +37 -0
  299. package/dist/client/assets/vcsRefInvalidation-CEbBuVCf.js +2 -0
  300. package/dist/client/assets/{vennDiagram-4TSXK5OY-BBpGz6rf.js → vennDiagram-4TSXK5OY-BJt3j1aO.js} +2 -2
  301. package/dist/client/assets/{wardley-WFR3VGLG-M4Al1qCV.js → wardley-WFR3VGLG-D_UZZZRB.js} +1 -1
  302. package/dist/client/assets/{wardleyDiagram-VM6X3IG4-V-_mOkU8.js → wardleyDiagram-VM6X3IG4-gZMVt8-K.js} +2 -2
  303. package/dist/client/assets/{welcome-Bok5fRqT.js → welcome-BRjof1AW.js} +2 -2
  304. package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CZOR99Bj.js → xychartDiagram-S5SC5T6Z-BwaDo7WT.js} +2 -2
  305. package/dist/client/index.html +1 -1
  306. package/package.json +1 -1
  307. package/dist/AcpMcpStdioBridge-Ch5bMyss.mjs +0 -4
  308. package/dist/client/assets/ChatGptUsageButton-GxPReM3u.js +0 -2
  309. package/dist/client/assets/ChatMarkdown-DOdrk8tK.js +0 -65
  310. package/dist/client/assets/DiffFileTree-D3P47wbG.js +0 -2
  311. package/dist/client/assets/DiffPanel-cvlTVhB4.js +0 -2
  312. package/dist/client/assets/ProjectDefaultsSettings-Cu80XFdb.js +0 -2
  313. package/dist/client/assets/ProjectIconPickerDialog-Dwmv78OH.js +0 -2
  314. package/dist/client/assets/ScheduledTasksSettings-Cp8h_lNS.js +0 -4
  315. package/dist/client/assets/ScopedSwitch-CLAFXjj6.js +0 -2
  316. package/dist/client/assets/WorkspaceBreadcrumb-fx0ZD7ay.js +0 -2
  317. package/dist/client/assets/WorkspacePageContainer-DFsaHi02.js +0 -2
  318. package/dist/client/assets/_chat-BerxDjpp.js +0 -58
  319. package/dist/client/assets/_chat.pull-requests-BwpBKnt3.js +0 -2
  320. package/dist/client/assets/architecture-7GRP2DOG-CT4QCEL3.js +0 -1
  321. package/dist/client/assets/arrow-left-BiKrB-pT.js +0 -1
  322. package/dist/client/assets/arrow-right-DWAwZU0q.js +0 -1
  323. package/dist/client/assets/arrow-up-down-CfYH5v22.js +0 -1
  324. package/dist/client/assets/assets-DwywdbuJ.js +0 -2
  325. package/dist/client/assets/bell-C3RUvq1T.js +0 -1
  326. package/dist/client/assets/blocks-CoLUV11Q.js +0 -1
  327. package/dist/client/assets/bot-CjcO3F5G.js +0 -1
  328. package/dist/client/assets/calendar-clock-CJyS1C-x.js +0 -1
  329. package/dist/client/assets/channel-kQEwHVv9.js +0 -2
  330. package/dist/client/assets/chart-no-axes-column-B3ZqbY05.js +0 -1
  331. package/dist/client/assets/checkbox-Cw_SXlJ5.js +0 -2
  332. package/dist/client/assets/classDiagram-ZZMXUADV-BO_GIPO1.js +0 -2
  333. package/dist/client/assets/classDiagram-v2-VYDZK3BY-BO_GIPO1.js +0 -2
  334. package/dist/client/assets/corner-left-up-D653FjvK.js +0 -1
  335. package/dist/client/assets/device-DrIICsXu.js +0 -2
  336. package/dist/client/assets/download-CNXPbBhc.js +0 -1
  337. package/dist/client/assets/dynamic-BRlOHH6g.js +0 -3
  338. package/dist/client/assets/earth-C1f0Qxwi.js +0 -1
  339. package/dist/client/assets/ellipsis-0J7zX441.js +0 -1
  340. package/dist/client/assets/entities-yblphBg3.js +0 -2
  341. package/dist/client/assets/eventmodeling-NTZA5JFV-bjJqzJYE.js +0 -1
  342. package/dist/client/assets/eye-CmsLgU-5.js +0 -1
  343. package/dist/client/assets/file-search-ClaIV60V.js +0 -1
  344. package/dist/client/assets/flowDiagram-HODETNUW-CsPXFMK4.js +0 -1
  345. package/dist/client/assets/folder-git-2-BxqGR5ht.js +0 -2
  346. package/dist/client/assets/folder-open-gQZmKQ4n.js +0 -1
  347. package/dist/client/assets/folder-plus-BVmedEeH.js +0 -1
  348. package/dist/client/assets/git-branch-Ba9jLbPu.js +0 -1
  349. package/dist/client/assets/grip-vertical-BmIJSASv.js +0 -1
  350. package/dist/client/assets/hard-drive-hWUfbbG9.js +0 -1
  351. package/dist/client/assets/history-jvN7Bdkc.js +0 -1
  352. package/dist/client/assets/house-ozmwce4p.js +0 -1
  353. package/dist/client/assets/index-FZqrCEhr.js +0 -3
  354. package/dist/client/assets/kbd-BR8-VeaN.js +0 -2
  355. package/dist/client/assets/keyboard-_YjrW4PX.js +0 -1
  356. package/dist/client/assets/link-BcMcYjHb.js +0 -1
  357. package/dist/client/assets/list-DEjg_Q5H.js +0 -1
  358. package/dist/client/assets/main-BQLZB-ZD.css +0 -2
  359. package/dist/client/assets/main-Ch0n0whg.js +0 -26
  360. package/dist/client/assets/message-circle-question-mark-DzWFFMDp.js +0 -1
  361. package/dist/client/assets/message-square-BqGKFtP8.js +0 -1
  362. package/dist/client/assets/message-square-dashed-FPkUUYSB.js +0 -1
  363. package/dist/client/assets/messages-square-BNeF2306.js +0 -2
  364. package/dist/client/assets/number-field-DsVu9T6C.js +0 -2
  365. package/dist/client/assets/palette-JCVMAFVd.js +0 -1
  366. package/dist/client/assets/panel-left-STqObAvQ.js +0 -1
  367. package/dist/client/assets/panels-top-left-B90U_rdS.js +0 -1
  368. package/dist/client/assets/popover-UOfX8iZ4.js +0 -2
  369. package/dist/client/assets/primary-BubJSDIO.js +0 -2
  370. package/dist/client/assets/primaryCloudLinkState-CFnZkCiA.js +0 -2
  371. package/dist/client/assets/projectScriptEditor-_TwHfcHY.js +0 -2
  372. package/dist/client/assets/pullRequests-C0Gr2876.js +0 -2
  373. package/dist/client/assets/queries-DbiotSzd.js +0 -2
  374. package/dist/client/assets/radio-group-DhxCP5q0.js +0 -2
  375. package/dist/client/assets/railroad-abnf-HS5TGJTU-DRzBu_EH.js +0 -1
  376. package/dist/client/assets/railroad-ebnf-LZEXJU2U-BuQh-rCG.js +0 -1
  377. package/dist/client/assets/railroad-peg-WCYAUIDC-DH1f3-__.js +0 -1
  378. package/dist/client/assets/rotate-ccw-98iN1bsB.js +0 -1
  379. package/dist/client/assets/rotate-cw-DdW3sRx4.js +0 -1
  380. package/dist/client/assets/runtime-BUB2ex14.js +0 -2
  381. package/dist/client/assets/runtime-BoEmkhOe.js +0 -6
  382. package/dist/client/assets/scheduledTasksSettings.logic-Bk1lq8Ri.js +0 -3
  383. package/dist/client/assets/session-CyPECDtf.js +0 -2
  384. package/dist/client/assets/session-logic-BBZj8pNB.js +0 -13
  385. package/dist/client/assets/settings-2-C-KVP40_.js +0 -1
  386. package/dist/client/assets/settings-D62zpRkD.js +0 -1
  387. package/dist/client/assets/settings.appearance-C-MzWdtB.js +0 -2
  388. package/dist/client/assets/settings.archived-BZ0wU-2j.js +0 -2
  389. package/dist/client/assets/settings.connections-B-h_wi7q.js +0 -2
  390. package/dist/client/assets/settings.diagnostics-ByUhN_HC.js +0 -2
  391. package/dist/client/assets/settings.general-DodDmaXX.js +0 -2
  392. package/dist/client/assets/settings.integrations-Dq9yt9c-.js +0 -2
  393. package/dist/client/assets/settings.projects-Bj9oI9dE.js +0 -4
  394. package/dist/client/assets/settings.providers-BPb4TbH8.js +0 -3
  395. package/dist/client/assets/settings.scheduled-tasks-TxnTVd7r.js +0 -2
  396. package/dist/client/assets/settings.snap-shot-DZaxUAEE.js +0 -2
  397. package/dist/client/assets/settings.source-control-BlHoYUC0.js +0 -2
  398. package/dist/client/assets/settingsLayout-De_r3pyr.js +0 -3
  399. package/dist/client/assets/shield-question-mark-B5w7j5aC.js +0 -1
  400. package/dist/client/assets/square-pen-DYBPSam-.js +0 -1
  401. package/dist/client/assets/stateDiagram-v2-MP3YSRHH-CJW4DyfF.js +0 -2
  402. package/dist/client/assets/swimlanesDiagram-VR7AAH4N-Buz7ig8b.js +0 -9
  403. package/dist/client/assets/text-search-DrO_MCzY.js +0 -1
  404. package/dist/client/assets/threadSort-R2JvSO3D.js +0 -2
  405. package/dist/client/assets/toast-CIGvRti2.js +0 -2
  406. package/dist/client/assets/tooltip-Ciaezkl4.js +0 -2
  407. package/dist/client/assets/useNavigate-CnhAAl0Z.js +0 -2
  408. package/dist/client/assets/usePullRequestActions-CiF7znkV.js +0 -3
  409. package/dist/client/assets/useScopedModelAvailability-kFNRNx2C.js +0 -2
  410. package/dist/client/assets/useSettings-CNd8OM7A.js +0 -3
  411. package/dist/client/assets/utils-geC9CGP4.js +0 -37
  412. package/dist/client/assets/vcsRefInvalidation-DMpp-BNA.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Af as n,Cu as r,Jl as i,Jn as a,Kn as o,Lc as s,Ql as c,Rc as l,Su as u,Tl as d,Un as f,Wn as p,Xb as m,Xn as h,_l as g,ar as _,er as v,eu as y,l as b,ma as x,mh as S,ny as C,or as w,ql as T,qn as E,sr as D,su as O,t as k,wl as A,wx as j,xu as M,yu as N}from"./utils-Nv21__t3.js";import{t as P}from"./arrow-down-DvRecXuy.js";import{t as F}from"./check-Cmy7pM2Y.js";import{t as I}from"./ellipsis-vertical-fYTS1grT.js";import{t as L}from"./minus-C7W28oE7.js";import{t as ee}from"./monitor-Ddj8MK6z.js";import{t as te}from"./plus-Cr075-cy.js";import{t as R}from"./x-CSwbgjBe.js";import{U as ne}from"./runtime-CxeCZPZ3.js";import{w as re}from"./entities-B0tFBQjY.js";import{a as z,n as ie,t as ae}from"./tooltip-CYNXW1Ow.js";import{a as B,r as oe,t as se}from"./number-field-BiWh0ioY.js";import{a as V,c as H,i as ce,o as U,r as le,s as W,t as G}from"./select-BXOHHCMJ.js";import{t as ue}from"./spinner-C6X42yHv.js";import{i as K}from"./toast-B-l3XS_F.js";import{D as de,E as fe,J as pe,c as me,o as he,r as ge,s as q,x as J}from"./useSettings-C1hmCYRR.js";import{f as _e}from"./server-BBIVfjrf.js";import{i as ve,n as ye}from"./session-DZH3pyoG.js";import{t as be}from"./use-atom-command-DdGPgtPS.js";import{t as xe}from"./env-wK1YYxA8.js";import{t as Se}from"./input-CN9xdIYL.js";import{a as Ce,c as we,i as Te,n as Ee,o as De,r as Oe,s as ke,t as Ae}from"./dialog-C5PVc2Dc.js";import{i as je,t as Me}from"./device-Bu2mO4gL.js";import{a as Ne,c as Pe,i as Fe,n as Ie,o as Le,s as Re,t as ze}from"./DeviceSetup--U2_cth3.js";import{t as Be}from"./AnimatedHeight-CcLJhBdM.js";import{i as Ve,n as He}from"./Icons-DJ824_3l.js";import{t as Ue}from"./preview-8KYmxrad.js";import{a as We,i as Ge,o as Ke,t as qe}from"./popover-aTTlR6NX.js";import{C as Je,I as Ye,N as Xe,a as Y,c as Ze,i as Qe,r as $e,s as et,z as tt}from"./settingsLayout-DKjAOwp4.js";import{$i as nt,Co as rt,Cr as it,Dr as at,Er as ot,Oa as st,Or as ct,Qi as lt,Sr as ut,Tr as dt,as as ft,ir as X,oa as pt,wr as mt}from"./main-CJvawsJJ.js";import{t as ht}from"./ProjectDefaultsSettings-DglkVzkM.js";import{t as gt}from"./draft-input-CwdApNsc.js";import{t as _t}from"./ScopedSwitch-BdMg8rKM.js";import{n as vt,r as yt,t as bt}from"./usePermissionStatus-D4K04nHy.js";var Z=j(),Q=e(x(),1);function xt(e){let t=(0,Z.c)(27),{tools:n,action:r,kind:i,owner:a,error:o}=e,s=i?n?.[i]:void 0,c;t[0]===s?c=t[1]:(c=s?.runningVersion??(s?.installedVersions.includes(s.requiredVersion)?s.requiredVersion:s?.installedVersions.toSorted(St).at(-1)),t[0]=s,t[1]=c);let l=c,u=i===`hub`?`Device hub`:`Agent device`,d=i?`${u}: ${l?`version ${l}`:s?`not installed`:`version unknown`}. Show details`:void 0,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(D,{tone:`muted`}),t[2]=f):f=t[2];let p=i?l?`v${l}`:s?`Not installed`:`Version unknown`:o?`Versions unavailable`:`Versions`,m;t[3]!==d||t[4]!==p?(m=(0,Q.jsx)(Ke,{"aria-label":d,render:f,children:p}),t[3]=d,t[4]=p,t[5]=m):m=t[5];let h=i?u:`Device tools`,g;t[6]===h?g=t[7]:(g=(0,Q.jsx)(We,{children:h}),t[6]=h,t[7]=g);let _;t[8]!==i||t[9]!==u||t[10]!==n?(_=n?(0,Q.jsx)(`div`,{className:`mt-4 divide-y divide-border/50`,children:[[`Device hub`,n.hub],[`Agent device`,n.agent]].filter(e=>{let[t]=e;return!i||t===u}).map(e=>{let[t,n]=e;return(0,Q.jsxs)(`div`,{className:`space-y-2 py-3 first:pt-0 last:pb-0`,children:[i?null:(0,Q.jsx)(`p`,{className:`text-xs font-medium`,children:t}),(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-6 gap-y-1 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Running`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.runningVersion??`Not running`}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Required`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono`,children:n.requiredVersion}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:`Installed`}),(0,Q.jsx)(`dd`,{className:`text-right font-mono break-words`,children:n.installedVersions.join(`, `)||`None`})]})]},t)})}):(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Versions have not been checked.`}),t[8]=i,t[9]=u,t[10]=n,t[11]=_):_=t[11];let v=a?`Managed by ${a}. `:``,y;t[12]===v?y=t[13]:(y=(0,Q.jsxs)(`p`,{className:`mt-4 border-t border-border/50 pt-3 text-xs text-muted-foreground`,children:[v,`Tools update automatically on this host when needed.`]}),t[12]=v,t[13]=y);let b;t[14]===o?b=t[15]:(b=o?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:o}):null,t[14]=o,t[15]=b);let x;t[16]===r?x=t[17]:(x=r?(0,Q.jsx)(`div`,{className:`mt-3`,children:r}):null,t[16]=r,t[17]=x);let S;t[18]!==y||t[19]!==b||t[20]!==x||t[21]!==g||t[22]!==_?(S=(0,Q.jsxs)(Ge,{align:`end`,width:`md`,children:[g,_,y,b,x]}),t[18]=y,t[19]=b,t[20]=x,t[21]=g,t[22]=_,t[23]=S):S=t[23];let C;return t[24]!==S||t[25]!==m?(C=(0,Q.jsxs)(qe,{children:[m,S]}),t[24]=S,t[25]=m,t[26]=C):C=t[26],C}function St(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function Ct(e,t,n,r=t){let i=(e,t)=>e.target===t.target&&e.port===t.port&&e.identityFile===t.identityFile,a=t=>{let n=e.filter(e=>i(e,t));if(n.length>1)throw Error(`Multiple hosts match this SSH destination. Select the environment to edit its hosts.`);return n[0]},o=e.find(e=>e.id===r.id)??a(r)??(n?void 0:a(t));return n?e.filter(e=>e.id!==o?.id):o?e.map(e=>e.id===o.id?{...t,id:o.id}:e):[...e,t]}function wt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Tt),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:r}),t[2]=r,t[3]=i),i}function Tt(e){return(0,Q.jsxs)(ae,{children:[(0,Q.jsxs)(z,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(F,{className:`size-3`}):(0,Q.jsx)(L,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(ie,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var Et=S(O);function Dt(e){let{identityFile:t,...n}=e;return Et({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Ot(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function kt(e,t,n,r){await Promise.all(e.map(async e=>{r(e.environmentId,{status:`pending`});try{if(!e.connected)throw Error(`Environment disconnected`);let i=await n(e.environmentId,t);r(e.environmentId,i.kind===`local`?{status:`local`}:{status:`connected`,platforms:i.platforms,...i.tools?{tools:i.tools}:{}})}catch(t){r(e.environmentId,{status:`failed`,error:t instanceof Error?t.message:String(t)})}}))}function At(e){let t=be(Me.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let a=Ot(n);if(i.current.has(a))return;i.current.add(a),r(e=>({...e,[a]:{}}));let o={};try{return await kt(e,n,async(e,n)=>{if(!ye(e,`settings:write`))throw Error(`This connection cannot test device hosts.`);let r=await t({environmentId:e,input:n});if(r._tag===`Failure`)throw Error(C(r.cause));return r.value},(e,t)=>{o[e]=t,r(n=>({...n,[a]:{...n[a],[e]:t}}))}),o}finally{i.current.delete(a)}}}}function jt(e){let t=(0,Z.c)(107),{host:n,isNew:r,targets:i,busy:a,onSave:o,onClose:s}=e,[c,l]=(0,$.useState)(n),{checks:u,testConnection:d}=At(i),f=u[Ot(c)],p=Object.values(f??{}).some(Nt),h,g;t[0]===c?(h=t[1],g=t[2]):(h=Dt({...c,label:c.label.trim()||c.target}),g=m(h),t[0]=c,t[1]=h,t[2]=g);let _=g,v;t[3]===f?v=t[4]:(v=Object.values(f??{}).filter(Mt),t[3]=f,t[4]=v);let y=v.length,b;t[5]!==a||t[6]!==s?(b=e=>{!e&&!a&&s()},t[5]=a,t[6]=s,t[7]=b):b=t[7];let x=!a,S;t[8]!==a||t[9]!==p||t[10]!==c.label||t[11]!==h||t[12]!==o?(S=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),m(h)&&c.label.trim()&&!a&&!p&&o(h.value)}}),t[8]=a,t[9]=p,t[10]=c.label,t[11]=h,t[12]=o,t[13]=S):S=t[13];let C=r?`Add device host`:`Edit device host`,T;t[14]===C?T=t[15]:(T=(0,Q.jsx)(we,{children:C}),t[14]=C,t[15]=T);let E=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,D;t[16]===E?D=t[17]:(D=(0,Q.jsxs)(Oe,{children:[E,` `,`Hosts on the same machine are skipped.`]}),t[16]=E,t[17]=D);let O;t[18]!==T||t[19]!==D?(O=(0,Q.jsxs)(Ce,{children:[T,D]}),t[18]=T,t[19]=D,t[20]=O):O=t[20];let k;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=k):k=t[21];let A;t[22]===c?A=t[23]:(A=e=>l({...c,label:e.target.value}),t[22]=c,t[23]=A);let j;t[24]!==a||t[25]!==c.label||t[26]!==A?(j=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[k,(0,Q.jsx)(Se,{autoFocus:!0,required:!0,value:c.label,disabled:a,onChange:A,placeholder:`Mac mini`})]}),t[24]=a,t[25]=c.label,t[26]=A,t[27]=j):j=t[27];let M;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=M):M=t[28];let N;t[29]===c?N=t[30]:(N=e=>l({...c,target:e.target.value}),t[29]=c,t[30]=N);let P;t[31]!==a||t[32]!==c.target||t[33]!==N?(P=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[M,(0,Q.jsx)(Se,{required:!0,value:c.target,disabled:a,onChange:N,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=c.target,t[33]=N,t[34]=P):P=t[34];let I=n.port!==void 0||n.identityFile!==void 0||void 0,L;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=L):L=t[35];let te;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=te):te=t[36];let ne=c.identityFile??``,re;t[37]===c?re=t[38]:(re=e=>{let{identityFile:t,...n}=c;l(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=c,t[38]=re);let z;t[39]!==a||t[40]!==ne||t[41]!==re?(z=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[te,(0,Q.jsx)(Se,{value:ne,disabled:a,onChange:re,placeholder:`SSH config default`})]}),t[39]=a,t[40]=ne,t[41]=re,t[42]=z):z=t[42];let ie;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ie):ie=t[43];let ae=c.port??``,B;t[44]===c?B=t[45]:(B=e=>{let{port:t,...n}=c;l(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=c,t[45]=B);let oe;t[46]!==a||t[47]!==ae||t[48]!==B?(oe=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ie,(0,Q.jsx)(Se,{type:`number`,min:1,max:65535,value:ae,disabled:a,onChange:B,placeholder:`Default`})]}),t[46]=a,t[47]=ae,t[48]=B,t[49]=oe):oe=t[49];let se;t[50]!==z||t[51]!==oe?(se=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[z,oe]}),t[50]=z,t[51]=oe,t[52]=se):se=t[52];let V;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=V):V=t[53];let H;t[54]!==I||t[55]!==se?(H=(0,Q.jsxs)(`details`,{open:I,className:`text-sm`,children:[L,se,V]}),t[54]=I,t[55]=se,t[56]=H):H=t[56];let ce=p?`Checking environments…`:f?y?`${y} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,U;t[57]===ce?U=t[58]:(U=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:ce}),t[57]=ce,t[58]=U);let le=a||p||!_,W;t[59]!==h||t[60]!==d?(W=()=>{m(h)&&d(h.value)},t[59]=h,t[60]=d,t[61]=W):W=t[61];let G;t[62]===p?G=t[63]:(G=p?(0,Q.jsx)(ue,{size:`xs`}):null,t[62]=p,t[63]=G);let K;t[64]!==le||t[65]!==W||t[66]!==G?(K=(0,Q.jsxs)(w,{type:`button`,size:`sm`,variant:`outline`,disabled:le,onClick:W,children:[G,` Test connection`]}),t[64]=le,t[65]=W,t[66]=G,t[67]=K):K=t[67];let de;t[68]!==U||t[69]!==K?(de=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[U,K]}),t[68]=U,t[69]=K,t[70]=de):de=t[70];let fe;t[71]!==f||t[72]!==i?(fe=f?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=f[e.environmentId];return t?(0,Q.jsxs)(`li`,{className:`px-3 py-2.5 text-xs`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`truncate font-medium`,children:e.label}),(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center gap-1.5 ${t.status===`failed`?`text-destructive`:`text-muted-foreground`}`,children:t.status===`pending`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ue,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ee,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(R,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(F,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(wt,{platforms:t.platforms})}):null,t.status===`failed`?(0,Q.jsxs)(`details`,{className:`mt-1.5 text-muted-foreground`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Show error`}),(0,Q.jsx)(`p`,{className:`mt-1 max-h-32 overflow-auto whitespace-pre-wrap break-words`,children:t.error})]}):null]},e.environmentId):null})}):null,t[71]=f,t[72]=i,t[73]=fe):fe=t[73];let pe;t[74]!==de||t[75]!==fe?(pe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[de,fe]}),t[74]=de,t[75]=fe,t[76]=pe):pe=t[76];let me;t[77]!==j||t[78]!==P||t[79]!==H||t[80]!==pe?(me=(0,Q.jsxs)(De,{children:[j,P,H,pe]}),t[77]=j,t[78]=P,t[79]=H,t[80]=pe,t[81]=me):me=t[81];let he;t[82]!==a||t[83]!==s?(he=(0,Q.jsx)(w,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=he):he=t[84];let ge;t[85]!==a||t[86]!==p||t[87]!==c.label||t[88]!==_?(ge=a||p||!_||!c.label.trim(),t[85]=a,t[86]=p,t[87]=c.label,t[88]=_,t[89]=ge):ge=t[89];let q;t[90]===a?q=t[91]:(q=a?(0,Q.jsx)(ue,{size:`xs`}):null,t[90]=a,t[91]=q);let J;t[92]!==ge||t[93]!==q?(J=(0,Q.jsxs)(w,{type:`submit`,disabled:ge,children:[q,` Save host`]}),t[92]=ge,t[93]=q,t[94]=J):J=t[94];let _e;t[95]!==he||t[96]!==J?(_e=(0,Q.jsxs)(Te,{children:[he,J]}),t[95]=he,t[96]=J,t[97]=_e):_e=t[97];let ve;t[98]!==O||t[99]!==me||t[100]!==x||t[101]!==_e||t[102]!==S?(ve=(0,Q.jsxs)(ke,{showCloseButton:x,render:S,children:[O,me,_e]}),t[98]=O,t[99]=me,t[100]=x,t[101]=_e,t[102]=S,t[103]=ve):ve=t[103];let ye;return t[104]!==b||t[105]!==ve?(ye=(0,Q.jsx)(Ae,{open:!0,onOpenChange:b,children:ve}),t[104]=b,t[105]=ve,t[106]=ye):ye=t[106],ye}function Mt(e){return e.status===`failed`}function Nt(e){return e.status===`pending`}function Pt(e){let{scope:t,environments:r,connectedEnvironments:i}=tt(),a=ve(e.environmentId,n),o=t.kind===`project`||t.kind===`checkout`,s=be(_e.updateSettings,{reportFailure:!1}),[c,l]=(0,$.useState)(null),[u,d]=(0,$.useState)(null),[f,p]=(0,$.useState)(!1),m=r.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:h,testConnection:g}=At(m),_=async(t,n=!1,i=t)=>{if(e.environmentId&&!o){p(!0);try{let e=await Promise.allSettled(r.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ye(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return s({environmentId:e.environmentId,input:{patch:{deviceHosts:Ct(e.serverConfig.settings.deviceHosts,t,n,i)}}})})),a=r.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});a.length===0?l(null):K.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{p(!1)}}};return(0,Q.jsx)(Y,{id:`device-hosts`,title:`Device hosts`,serverScoped:!0,settingKeys:[`deviceHosts`],description:`Add remote machines with simulator or emulator runtimes installed, and the selected environments will connect over SSH and set up device tools automatically.`,control:(0,Q.jsxs)(w,{size:`sm`,variant:`outline`,disabled:!a||o||f||!e.environmentId||c!==null,onClick:()=>{d(null),l({id:b(),label:``,target:``})},children:[(0,Q.jsx)(te,{className:`size-3.5`}),` Add host`]}),children:(0,Q.jsx)(`div`,{className:`pt-3 pb-2`,children:e.environmentId?(0,Q.jsxs)(Q.Fragment,{children:[i.map(e=>(0,Q.jsxs)(`div`,{children:[i.length>1?(0,Q.jsx)(`p`,{className:`pt-3 pb-1 text-xs font-medium text-muted-foreground`,children:e.label}):null,(0,Q.jsx)(Ft,{environmentLabel:e.label,environmentId:e.environmentId,hosts:e.serverConfig?.settings.deviceHosts??[],busy:!a||o||f,checks:h,testConnection:async e=>{let t=await g(e);if(!t)return;let n=m.filter(e=>t[e.environmentId]?.status===`failed`);return K.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${m.length} environments failed`:`${e.label}: connection checks passed`,description:n.length?`Could not connect from ${n.map(e=>e.label).join(`, `)}.`:`Connected or already available locally on each selected environment.`}),t},onEdit:e=>{d(e),l(e)},onRemove:e=>void _(e,!0)})]},e.environmentId)),c?(0,Q.jsx)(jt,{host:c,isNew:u===null,targets:m,busy:f,onSave:e=>void _(e,!1,u??e),onClose:()=>l(null)},c.id):null]}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a selected environment to manage device hosts.`})})})}function Ft(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:o,onEdit:s,onRemove:c,checks:l,testConnection:u}=e,{state:d}=je(r),f=be(Me.list),[m,g]=(0,$.useState)(null),v;t[0]===i.length?v=t[1]:(v=i.length===0?(0,Q.jsx)(`p`,{className:`py-2 text-sm text-muted-foreground`,children:`No device hosts.`}):null,t[0]=i.length,t[1]=v);let y;if(t[2]!==o||t[3]!==l||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==s||t[8]!==c||t[9]!==f||t[10]!==m||t[11]!==d||t[12]!==u){let e;t[14]!==o||t[15]!==l||t[16]!==r||t[17]!==n||t[18]!==s||t[19]!==c||t[20]!==f||t[21]!==m||t[22]!==d||t[23]!==u?(e=e=>{let t=d.hostStatuses[e.id],i=l[Ot(e)]?.[r],v=(i?.status===`connected`?i.platforms:void 0)??d.hosts.find(t=>t.id===e.id)?.platforms??[],y=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,b=i?.status===`failed`?i.error:i?.status===`local`?void 0:t?.status===`failed`?t.detail:void 0;return(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border/50 py-2.5`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`truncate text-sm font-medium`,children:e.label}),v.filter(Lt).map(It)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(xt,{owner:n,error:d.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:d.hosts.find(t=>t.id===e.id)?.tools??(i?.status===`connected`?i.tools:void 0)}),i?.status===`local`?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Already available locally`}):null,b?(0,Q.jsx)(`div`,{className:`mt-1`,role:`status`,children:(0,Q.jsxs)(`details`,{className:`text-xs text-destructive`,children:[(0,Q.jsx)(`summary`,{children:`Connection failed`}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:b})]})}):null]}),y?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(ue,{size:`xs`}),y]}):null,(0,Q.jsxs)(p,{children:[(0,Q.jsx)(_,{render:(0,Q.jsx)(w,{size:`icon-sm`,variant:`ghost-muted`,disabled:o,"aria-label":e.label+` options`}),children:(0,Q.jsx)(I,{})}),(0,Q.jsxs)(h,{align:`end`,children:[(0,Q.jsx)(a,{onClick:()=>{s(e)},children:`Edit`}),(0,Q.jsx)(a,{variant:`destructive`,onClick:()=>c(e),children:`Remove`})]})]}),t?.status===`failed`&&d.supportsHostRetry&&d.hostStatus!==`disabled`?(0,Q.jsx)(w,{size:`sm`,variant:`outline`,disabled:o||m!==null,onClick:()=>{g(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>g(null))},children:m===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(w,{size:`sm`,variant:`outline`,disabled:o||y!==null,onClick:()=>void u(e),children:`Test connection`})]},e.id)},t[14]=o,t[15]=l,t[16]=r,t[17]=n,t[18]=s,t[19]=c,t[20]=f,t[21]=m,t[22]=d,t[23]=u,t[24]=e):e=t[24],y=i.map(e),t[2]=o,t[3]=l,t[4]=r,t[5]=n,t[6]=i,t[7]=s,t[8]=c,t[9]=f,t[10]=m,t[11]=d,t[12]=u,t[13]=y}else y=t[13];let b;return t[25]!==v||t[26]!==y?(b=(0,Q.jsxs)(Q.Fragment,{children:[v,y]}),t[25]=v,t[26]=y,t[27]=b):b=t[27],b}function It(e){return(0,Q.jsxs)(ae,{children:[(0,Q.jsx)(z,{render:(0,Q.jsx)(`span`,{tabIndex:0,role:`img`,"aria-label":e.platform===`ios`?`iOS available`:`Android available`,className:`shrink-0 text-muted-foreground`}),children:e.platform===`ios`?(0,Q.jsx)(Ve,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)(He,{className:`size-3.5`})}),(0,Q.jsx)(ie,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Lt(e){return e.available}function Rt(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function zt(e,t,n){if(e.kind===`new`)return{kind:`new`,profileId:t};let r=n.find(t=>t.id===e.profileId);if(r!==void 0)return{kind:`existing`,profileId:e.profileId,name:r.name}}function Bt(e){return e.step!==`importing`}function Vt(e){return e.unavailable===`browserRunning`?{step:`quit`}:e.unavailable===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`configure`}:e.unavailable===void 0?e.profiles.length===0?{step:`blocked`,reason:`unknownSourceProfile`}:{step:`configure`}:{step:`blocked`,reason:e.unavailable}}function Ht(e){return e.kind===`imported`?{step:`done`,imported:e.imported,skipped:e.skipped,skippedDomains:e.skippedDomains,targetName:e.targetName}:e.reason===`browserRunning`?{step:`quit`}:e.reason===`needsFullDiskAccess`?{step:`fullDiskAccess`,resume:`import`,checked:!0}:{step:`blocked`,reason:e.reason}}function Ut(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:Vt(e)}function Wt(e){let t=Ut(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function Gt(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function Kt(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function qt(e){return e.length===0?``:e.length===1?e[0]:e.length<=3?`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`:`${e.slice(0,3).join(`, `)} and ${e.length-3} more`}function Jt(e){let t=(0,Z.c)(46),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,onImport:o,onRefreshSource:s,onOpenFullDiskAccessSettings:c,onCheckFullDiskAccess:l,onClose:u}=e,[d,f]=(0,$.useState)(n),p;t[0]===n?p=t[1]:(p=()=>Vt(n),t[0]=n,t[1]=p);let[m,h]=(0,$.useState)(p),g;t[2]===n.profiles[0]?.directory?g=t[3]:(g=()=>n.profiles[0]?.directory??``,t[2]=n.profiles[0]?.directory,t[3]=g);let[_,v]=(0,$.useState)(g),y;t[4]!==a||t[5]!==i?(y=()=>Rt(a,i),t[4]=a,t[5]=i,t[6]=y):y=t[6];let[x,S]=(0,$.useState)(y),[C,w]=(0,$.useState)(),T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=b(),t[7]=T):T=t[7];let E=(0,$.useRef)(`profile-${T}`),D=(0,$.useRef)(!1),O;t[8]!==o||t[9]!==_||t[10]!==x||t[11]!==i?(O=()=>{if(D.current)return;let e=zt(x,E.current,i);if(e===void 0){w(`That profile is no longer available. Choose where to import these cookies.`),h({step:`configure`});return}w(void 0),D.current=!0,h({step:`importing`}),o({sourceProfileDirectory:_,target:e}).then(e=>h(Ht(e))).catch(()=>h({step:`blocked`,reason:`readFailed`})).finally(()=>{D.current=!1})},t[8]=o,t[9]=_,t[10]=x,t[11]=i,t[12]=O):O=t[12];let k=O,A;t[13]===s?A=t[14]:(A=(e,t)=>{h({step:`checking`,check:e}),s().then(e=>{e&&(f(e),v(t=>Gt(t,e))),h(t(e))}).catch(()=>h({step:`blocked`,reason:`readFailed`}))},t[13]=s,t[14]=A);let j=A,M;t[15]===j?M=t[16]:(M=()=>j(`browser`,Ut),t[15]=j,t[16]=M);let N=M,P;t[17]===j?P=t[18]:(P=()=>j(`fullDiskAccess`,Wt),t[17]=j,t[18]=P);let F=P,I;t[19]!==u||t[20]!==m?(I=e=>e||!Bt(m)?void 0:u(),t[19]=u,t[20]=m,t[21]=I):I=t[21];let L;t[22]===m?L=t[23]:(L=Bt(m),t[22]=m,t[23]=L);let ee;t[24]!==a||t[25]!==r||t[26]!==l||t[27]!==u||t[28]!==c||t[29]!==s||t[30]!==N||t[31]!==F||t[32]!==k||t[33]!==d||t[34]!==_||t[35]!==m||t[36]!==x||t[37]!==C||t[38]!==i?(ee=m.step===`quit`?(0,Q.jsx)(Yt,{source:d,onCancel:u,onRechecked:N}):m.step===`fullDiskAccess`?(0,Q.jsx)(Qt,{source:d,onCancel:u,onOpenSettings:c,onCheck:l??(async()=>{let e=await s();return e!==void 0&&e.unavailable===void 0}),onGranted:m.resume===`import`?k:F,stillRequired:m.checked===!0}):m.step===`importing`?(0,Q.jsx)(tn,{}):m.step===`checking`?(0,Q.jsx)(nn,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(rn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(an,{source:d,reason:m.reason,onClose:u,onRetry:Kt(m.reason)?k:void 0}):(0,Q.jsx)($t,{source:d,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:_,onSourceProfileChange:v,target:x,onTargetChange:e=>{S(e),w(void 0)},targetError:C,onCancel:u,onImport:k}),t[24]=a,t[25]=r,t[26]=l,t[27]=u,t[28]=c,t[29]=s,t[30]=N,t[31]=F,t[32]=k,t[33]=d,t[34]=_,t[35]=m,t[36]=x,t[37]=C,t[38]=i,t[39]=ee):ee=t[39];let te;t[40]!==L||t[41]!==ee?(te=(0,Q.jsx)(ke,{className:`max-w-lg`,showCloseButton:L,children:ee}),t[40]=L,t[41]=ee,t[42]=te):te=t[42];let R;return t[43]!==te||t[44]!==I?(R=(0,Q.jsx)(Ae,{open:!0,onOpenChange:I,children:te}),t[43]=te,t[44]=I,t[45]=R):R=t[45],R}function Yt(e){let t=(0,Z.c)(12),{source:n,onCancel:r,onRechecked:i}=e,a;t[0]===n.name?a=t[1]:(a=(0,Q.jsxs)(Ce,{children:[(0,Q.jsxs)(we,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(Oe,{children:[n.name,` is open, so its cookies can’t be read yet. Quit it, then continue.`]})]}),t[0]=n.name,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Q.jsx)(w,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(w,{onClick:i,children:`I’ve quit it`}),t[4]=i,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Q.jsxs)(Te,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Q.jsxs)(Q.Fragment,{children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function Xt(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Zt(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Qt(e){let t=(0,Z.c)(43),{source:n,onCancel:r,onOpenSettings:i,onGranted:a,stillRequired:o,onCheck:s}=e,[c,l]=(0,$.useState)(!1),[u,d]=(0,$.useState)(null),f;t[0]===s?f=t[1]:(f=async()=>({fullDiskAccess:await s()}),t[0]=s,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p={fullDiskAccess:!1},t[2]=p):p=t[2];let m=bt(f,p),h;t[3]!==i||t[4]!==c?(h=()=>{c||(l(!0),d(null),Promise.resolve().then(i).catch(()=>d(`Could not open System Settings. Try Allow again.`)).finally(()=>l(!1)))},t[3]=i,t[4]=c,t[5]=h):h=t[5];let g=h,_;t[6]===n.name?_=t[7]:(_=(0,Q.jsxs)(Ce,{children:[(0,Q.jsxs)(we,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(Oe,{children:[`To import cookies from `,n.name,`, P4 Code needs Full Disk Access. Turn it on in System Settings, then come back to finish the import — you can revoke it again once the import is done.`]})]}),t[6]=n.name,t[7]=_);let v;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Q.jsx)(rt,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=v):v=t[8];let y=`Read ${n.name}'s cookies for this import.`,b;t[9]===g?b=t[10]:(b=()=>void g(),t[9]=g,t[10]=b);let x;t[11]!==m.status.fullDiskAccess||t[12]!==y||t[13]!==b?(x=[{id:`fullDiskAccess`,icon:v,title:`Full Disk Access`,description:y,granted:m.status.fullDiskAccess,onAllow:b}],t[11]=m.status.fullDiskAccess,t[12]=y,t[13]=b,t[14]=x):x=t[14];let S;t[15]!==c||t[16]!==x?(S=(0,Q.jsx)(vt,{busy:c,permissions:x}),t[15]=c,t[16]=x,t[17]=S):S=t[17];let C;t[18]!==u||t[19]!==m.error?(C=u||m.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:u??m.error}):null,t[18]=u,t[19]=m.error,t[20]=C):C=t[20];let T;t[21]!==m||t[22]!==o?(T=m.isReady([`fullDiskAccess`])?null:(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:o?`Access is still required. Quit and reopen P4 Code if you just allowed it, then retry the import.`:`If access doesn't update after you allow it, quit and reopen P4 Code, then retry the import.`}),t[21]=m,t[22]=o,t[23]=T):T=t[23];let E;t[24]!==C||t[25]!==T||t[26]!==S?(E=(0,Q.jsxs)(De,{children:[S,C,T]}),t[24]=C,t[25]=T,t[26]=S,t[27]=E):E=t[27];let D;t[28]===r?D=t[29]:(D=(0,Q.jsx)(w,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=D);let O;t[30]===m?O=t[31]:(O=m.isReady([`fullDiskAccess`]),t[30]=m,t[31]=O);let k;t[32]!==a||t[33]!==c||t[34]!==O?(k=(0,Q.jsx)(yt,{ready:O,busy:c,onClick:a,children:`Continue`}),t[32]=a,t[33]=c,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==D||t[37]!==k?(A=(0,Q.jsxs)(Te,{children:[D,k]}),t[36]=D,t[37]=k,t[38]=A):A=t[38];let j;return t[39]!==E||t[40]!==A||t[41]!==_?(j=(0,Q.jsxs)(Q.Fragment,{children:[_,E,A]}),t[39]=E,t[40]=A,t[41]=_,t[42]=j):j=t[42],j}function $t(e){let t=(0,Z.c)(59),{source:n,destinationEnvironmentName:r,targetProfiles:i,canCreateProfile:a,sourceProfileDirectory:o,onSourceProfileChange:s,target:c,targetError:l,onTargetChange:u,onCancel:d,onImport:f}=e,p;t[0]!==c.kind||t[1]!==c.profileId||t[2]!==i?(p=c.kind===`existing`&&!i.some(e=>e.id===c.profileId),t[0]=c.kind,t[1]=c.profileId,t[2]=i,t[3]=p):p=t[3];let m=p,h=c.kind===`new`&&!a,g=l??(m?`That profile is no longer available. Choose where to import these cookies.`:h?`You've reached the profile limit. Choose an existing profile to import into.`:void 0),_;t[4]===n.name?_=t[5]:(_=(0,Q.jsxs)(we,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=_);let v;t[6]===r?v=t[7]:(v=(0,Q.jsxs)(Oe,{children:[`Choose which cookies to import for `,r,`.`]}),t[6]=r,t[7]=v);let y;t[8]!==_||t[9]!==v?(y=(0,Q.jsxs)(Ce,{children:[_,v]}),t[8]=_,t[9]=v,t[10]=y):y=t[10];let b;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`From`}),t[11]=b):b=t[11];let x;if(t[12]!==s||t[13]!==n.profiles||t[14]!==o){let e;t[16]!==s||t[17]!==o?(e=e=>(0,Q.jsx)(en,{selected:o===e.directory,title:e.name,subtitle:Xt(e.cookieCount),onSelect:()=>s(e.directory)},e.directory),t[16]=s,t[17]=o,t[18]=e):e=t[18],x=n.profiles.map(e),t[12]=s,t[13]=n.profiles,t[14]=o,t[15]=x}else x=t[15];let S;t[19]===x?S=t[20]:(S=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[b,x]}),t[19]=x,t[20]=S);let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(P,{className:`size-4 sm:hidden`}),(0,Q.jsx)(ft,{className:`hidden size-4 sm:block`})]}),t[21]=C):C=t[21];let T;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Into`}),t[22]=T):T=t[22];let E;t[23]!==a||t[24]!==u||t[25]!==c.kind?(E=a?(0,Q.jsx)(en,{selected:c.kind===`new`,title:`New profile`,subtitle:`Created for these cookies`,onSelect:()=>u({kind:`new`})}):null,t[23]=a,t[24]=u,t[25]=c.kind,t[26]=E):E=t[26];let D;if(t[27]!==u||t[28]!==c.kind||t[29]!==c.profileId||t[30]!==i){let e;t[32]!==u||t[33]!==c.kind||t[34]!==c.profileId?(e=e=>(0,Q.jsx)(en,{selected:c.kind===`existing`&&c.profileId===e.id,title:e.name,subtitle:`Existing profile`,onSelect:()=>u({kind:`existing`,profileId:e.id})},e.id),t[32]=u,t[33]=c.kind,t[34]=c.profileId,t[35]=e):e=t[35],D=i.map(e),t[27]=u,t[28]=c.kind,t[29]=c.profileId,t[30]=i,t[31]=D}else D=t[31];let O;t[36]!==E||t[37]!==D?(O=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[T,E,D]}),t[36]=E,t[37]=D,t[38]=O):O=t[38];let k;t[39]!==O||t[40]!==S?(k=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4`,children:[S,C,O]}),t[39]=O,t[40]=S,t[41]=k):k=t[41];let A;t[42]===g?A=t[43]:(A=g?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:g}):null,t[42]=g,t[43]=A);let j;t[44]!==k||t[45]!==A?(j=(0,Q.jsxs)(De,{children:[k,A]}),t[44]=k,t[45]=A,t[46]=j):j=t[46];let M;t[47]===d?M=t[48]:(M=(0,Q.jsx)(w,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=M);let N=o===``||m||h,F;t[49]!==f||t[50]!==N?(F=(0,Q.jsx)(w,{disabled:N,onClick:f,children:`Import`}),t[49]=f,t[50]=N,t[51]=F):F=t[51];let I;t[52]!==M||t[53]!==F?(I=(0,Q.jsxs)(Te,{children:[M,F]}),t[52]=M,t[53]=F,t[54]=I):I=t[54];let L;return t[55]!==j||t[56]!==I||t[57]!==y?(L=(0,Q.jsxs)(Q.Fragment,{children:[y,j,I]}),t[55]=j,t[56]=I,t[57]=y,t[58]=L):L=t[58],L}function en(e){let t=(0,Z.c)(22),{selected:n,title:r,subtitle:i,onSelect:a}=e,o=n?`border-primary bg-primary/8`:`border-border/60 hover:border-border hover:bg-muted/40`,s;t[0]===o?s=t[1]:(s=k(`flex w-full cursor-pointer items-center justify-between gap-3 rounded-lg border px-3 py-2 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,o),t[0]=o,t[1]=s);let c;t[2]===r?c=t[3]:(c=(0,Q.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:r}),t[2]=r,t[3]=c);let l;t[4]===i?l=t[5]:(l=i?(0,Q.jsx)(`span`,{className:`block truncate text-xs tabular-nums text-muted-foreground`,children:i}):null,t[4]=i,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d=n?`border-primary bg-primary text-primary-foreground`:`border-input`,f;t[9]===d?f=t[10]:(f=k(`grid size-4 shrink-0 place-items-center rounded-full border`,d),t[9]=d,t[10]=f);let p;t[11]===n?p=t[12]:(p=n?(0,Q.jsx)(F,{className:`size-2.5`}):null,t[11]=n,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Q.jsx)(`span`,{className:f,children:p}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h;return t[16]!==a||t[17]!==n||t[18]!==s||t[19]!==u||t[20]!==m?(h=(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:a,className:s,children:[u,m]}),t[16]=a,t[17]=n,t[18]=s,t[19]=u,t[20]=m,t[21]=h):h=t[21],h}function tn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Ce,{children:[(0,Q.jsx)(we,{children:`Importing cookies`}),(0,Q.jsx)(Oe,{children:`This may take a moment.`})]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[t,(0,Q.jsx)(De,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(ue,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function nn(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(we,{children:[`Checking `,n]}),t[0]=n,t[1]=i);let a=r===`fullDiskAccess`?`Checking Full Disk Access.`:`Checking whether the browser has closed.`,o;t[2]===a?o=t[3]:(o=(0,Q.jsx)(Oe,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Ce,{children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(ue,{size:`md`,tone:`muted`}),t[7]=c):c=t[7];let l=r===`fullDiskAccess`?`Checking access…`:`Checking…`,u;t[8]===l?u=t[9]:(u=(0,Q.jsx)(De,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[c,(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:l})]})}),t[8]=l,t[9]=u);let d;return t[10]!==s||t[11]!==u?(d=(0,Q.jsxs)(Q.Fragment,{children:[s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12],d}function rn(e){let t=(0,Z.c)(24),{imported:n,skipped:r,skippedDomains:i,targetName:a,destinationEnvironmentName:o,onClose:s}=e,c;t[0]!==n||t[1]!==r?(c=n>0?`Imported ${Zt(n)}`:r>0?`Skipped ${Zt(r)}`:`No cookies found`,t[0]=n,t[1]=r,t[2]=c):c=t[2];let l;t[3]===c?l=t[4]:(l=(0,Q.jsx)(we,{children:c}),t[3]=c,t[4]=l);let u;t[5]!==o||t[6]!==n||t[7]!==r||t[8]!==a?(u=n>0?`Added to ${a} for ${o}.${r>0?` ${Zt(r)} skipped.`:``}`:r>0?`No cookies were imported for ${o}.`:`There were no cookies to import for ${o}.`,t[5]=o,t[6]=n,t[7]=r,t[8]=a,t[9]=u):u=t[9];let d;t[10]===u?d=t[11]:(d=(0,Q.jsx)(Oe,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Ce,{children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;t[15]===i?p=t[16]:(p=i.length>0?(0,Q.jsxs)(De,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Skipped`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:qt(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(w,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(Te,{children:(0,Q.jsx)(Ee,{render:m,onClick:s,children:`Done`})}),t[18]=s,t[19]=h);let g;return t[20]!==f||t[21]!==p||t[22]!==h?(g=(0,Q.jsxs)(Q.Fragment,{children:[f,p,h]}),t[20]=f,t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function an(e){let t=(0,Z.c)(17),{source:n,reason:r,onClose:i,onRetry:a}=e,o;t[0]===n.name?o=t[1]:(o=(0,Q.jsxs)(we,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let c=s[r],l;t[2]===c?l=t[3]:(l=(0,Q.jsx)(Oe,{children:c}),t[2]=c,t[3]=l);let u;t[4]!==o||t[5]!==l?(u=(0,Q.jsxs)(Ce,{children:[o,l]}),t[4]=o,t[5]=l,t[6]=u):u=t[6];let d;t[7]===i?d=t[8]:(d=(0,Q.jsx)(w,{variant:`outline`,onClick:i,children:`Close`}),t[7]=i,t[8]=d);let f;t[9]===a?f=t[10]:(f=a?(0,Q.jsx)(w,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=f);let p;t[11]!==d||t[12]!==f?(p=(0,Q.jsxs)(Te,{children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==u||t[15]!==p?(m=(0,Q.jsxs)(Q.Fragment,{children:[u,p]}),t[14]=u,t[15]=p,t[16]=m):m=t[16],m}var on=`fill`,sn=`responsive`;async function cn(e,t,n,r){let i=e===null?[]:t,a=r?.environmentIds??[];if(i.length===0&&a.length===0)throw Error(`Browser profile data is not available to clear.`);await Promise.all([...i.flatMap(t=>[e.clearCookies(t,n),e.clearCache(t,n)]),...a.map(e=>r.clear(e,n))])}function ln(e,t,n,r=0){return(e||r>0)&&t&&n>0}var un={width:1280,height:800},dn={useGrouping:!1},fn={system:`System`,light:`Light`,dark:`Dark`},pn=e=>`${Math.round(e*100)}%`,mn=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},hn=e=>{let t=String(e?.message??``);return l.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},gn=e=>e._tag===`fill`?on:e._tag===`preset`&&nt.some(t=>t.id===e.presetId)?e.presetId:sn,_n=e=>{let t=gn(e);return t===on?`Fill panel`:t===sn?`Responsive`:nt.find(e=>e.id===t)?.label??`Responsive`},vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,yn=e=>({...e,width:e.height,height:e.width});function bn(e){let t=(0,Z.c)(42),{disabled:n}=e,r=q(Sn),a=J(),o=r._tag===`fill`?null:r,s=o?.width??un.width,l=o?.height??un.height,u;t[0]!==s||t[1]!==l?(u={width:s,height:l},t[0]=s,t[1]=l,t[2]=u):u=t[2];let f=u,p;t[3]!==o?.height||t[4]!==o?.width||t[5]!==a?(p=e=>{if(e===on){a({browserDefaultViewport:i});return}if(e===sn){a({browserDefaultViewport:{_tag:`freeform`,width:o?.width??un.width,height:o?.height??un.height}});return}let t=nt.find(t=>t.id===e);t&&a({browserDefaultViewport:{_tag:`preset`,width:t.width,height:t.height,presetId:t.id}})},t[3]=o?.height,t[4]=o?.width,t[5]=a,t[6]=p):p=t[6];let m=p,h;t[7]!==f||t[8]!==o||t[9]!==a?(h=(e,t)=>{if(t===null||!vn(t))return;let n={...f,[e]:t};n.width*n.height>8294400||o&&n.width===o.width&&n.height===o.height||a({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=f,t[8]=o,t[9]=a,t[10]=h):h=t[10];let g=h,_;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=X(`browser-default-viewport`),t[11]=_):_=t[11];let v;t[12]!==n||t[13]!==a||t[14]!==r._tag?(v=!n&&r._tag!==d._tag?(0,Q.jsx)($e,{label:`default browser viewport`,onClick:()=>a({browserDefaultViewport:d})}):null,t[12]=n,t[13]=a,t[14]=r._tag,t[15]=v):v=t[15];let y;t[16]===r?y=t[17]:(y=gn(r),t[16]=r,t[17]=y);let b;t[18]===r?b=t[19]:(b=_n(r),t[18]=r,t[19]=b);let x;t[20]===b?x=t[21]:(x=(0,Q.jsx)(W,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(H,{children:b})}),t[20]=b,t[21]=x);let S,C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsx)(V,{value:on,children:`Fill panel`}),C=(0,Q.jsx)(V,{value:sn,children:`Responsive`}),t[22]=S,t[23]=C):(S=t[22],C=t[23]);let T;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Q.jsxs)(U,{align:`end`,alignItemWithTrigger:!1,children:[S,C,(0,Q.jsxs)(le,{children:[(0,Q.jsx)(ce,{children:`Standard`}),nt.map(xn)]})]}),t[24]=T):T=t[24];let E;t[25]!==n||t[26]!==m||t[27]!==x||t[28]!==y?(E=(0,Q.jsxs)(G,{value:y,onValueChange:m,disabled:n,children:[x,T]}),t[25]=n,t[26]=m,t[27]=x,t[28]=y,t[29]=E):E=t[29];let D;t[30]!==g||t[31]!==n||t[32]!==f||t[33]!==o||t[34]!==a?(D=o?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(se,{value:f.width,min:240,max:c,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>g(`width`,e),children:(0,Q.jsx)(oe,{children:(0,Q.jsx)(B,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(se,{value:f.height,min:240,max:c,disabled:n,format:dn,size:`sm`,className:`w-20`,onValueCommitted:e=>g(`height`,e),children:(0,Q.jsx)(oe,{children:(0,Q.jsx)(B,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(ae,{children:[(0,Q.jsx)(z,{render:(0,Q.jsx)(w,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${f.height>=f.width?`landscape`:`portrait`}`,onClick:()=>a({browserDefaultViewport:yn(o)}),children:(0,Q.jsx)(lt,{})})}),(0,Q.jsx)(ie,{side:`top`,children:`Rotate`})]})]}):null,t[30]=g,t[31]=n,t[32]=f,t[33]=o,t[34]=a,t[35]=D):D=t[35];let O;t[36]!==E||t[37]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[E,D]}),t[36]=E,t[37]=D,t[38]=O):O=t[38];let k;return t[39]!==O||t[40]!==v?(k=(0,Q.jsx)(Y,{..._,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:v,control:O}),t[39]=O,t[40]=v,t[41]=k):k=t[41],k}function xn(e){return(0,Q.jsx)(V,{value:e.id,children:(0,Q.jsxs)(`span`,{className:`flex w-full items-center justify-between gap-5`,children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:e.detail})]})},e.id)}function Sn(e){return e.browserDefaultViewport}function Cn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=q(Tn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-zoom`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==i||t[3]!==r?(o=!n&&r!==1?(0,Q.jsx)($e,{label:`default browser zoom`,onClick:()=>i({browserDefaultZoomFactor:1})}):null,t[1]=n,t[2]=i,t[3]=r,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=y.find(t=>String(t)===e);t!==void 0&&i({browserDefaultZoomFactor:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=pn(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(H,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:y.map(wn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(G,{disabled:n,value:s,onValueChange:c,children:[u,d]}),t[12]=n,t[13]=s,t[14]=c,t[15]=u,t[16]=f):f=t[16];let p;return t[17]!==o||t[18]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Page zoom applied to new browser tabs.`,resetAction:o,control:f}),t[17]=o,t[18]=f,t[19]=p):p=t[19],p}function wn(e){return(0,Q.jsx)(V,{hideIndicator:!0,value:String(e),children:pn(e)},e)}function Tn(e){return e.browserDefaultZoomFactor}function En(e){let t=(0,Z.c)(18),{disabled:n}=e,r=q(On),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-default-appearance`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)($e,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:T})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`light`||e===`dark`)&&i({browserDefaultAppearance:e})},t[5]=i,t[6]=s);let c=fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(H,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(fn).map(Dn)}),t[9]=u):u=t[9];let d;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(d=(0,Q.jsxs)(G,{disabled:n,value:r,onValueChange:s,children:[l,u]}),t[10]=r,t[11]=n,t[12]=s,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(Y,{...a,description:`The color scheme pages are told to prefer. System follows your OS setting.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Dn(e){let[t,n]=e;return(0,Q.jsx)(V,{hideIndicator:!0,value:t,children:n},t)}function On(e){return e.browserDefaultAppearance}function kn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=q(jn),i=q(An),a=J(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=X(`browser-recording-key-presses`),t[0]=o):o=t[0];let s;t[1]===a?s=t[2]:(s=e=>a({browserRecordingShowKeyPresses:!!e}),t[1]=a,t[2]=s);let c;t[3]!==n||t[4]!==r||t[5]!==s?(c=(0,Q.jsx)(Y,{...o,description:`Show pressed keys and shortcuts in new recordings. Password fields are excluded.`,control:(0,Q.jsx)(st,{disabled:n,checked:r,"aria-label":`Show key presses in recordings`,onCheckedChange:s})}),t[3]=n,t[4]=r,t[5]=s,t[6]=c):c=t[6];let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=X(`browser-recording-mouse-presses`),t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=e=>a({browserRecordingShowMousePresses:!!e}),t[8]=a,t[9]=u);let d;t[10]!==n||t[11]!==i||t[12]!==u?(d=(0,Q.jsx)(Y,{...l,description:`Highlight mouse presses and held buttons in new recordings.`,control:(0,Q.jsx)(st,{disabled:n,checked:i,"aria-label":`Show mouse presses in recordings`,onCheckedChange:u})}),t[10]=n,t[11]=i,t[12]=u,t[13]=d):d=t[13];let f;return t[14]!==c||t[15]!==d?(f=(0,Q.jsxs)(Q.Fragment,{children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function An(e){return e.browserRecordingShowMousePresses}function jn(e){return e.browserRecordingShowKeyPresses}function Mn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=q(Pn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-recording-frame-rate`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==30?(0,Q.jsx)($e,{label:`browser recording frame rate`,onClick:()=>i({browserRecordingFrameRate:30})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s=String(r),c;t[5]===i?c=t[6]:(c=e=>{let t=g.find(t=>String(t)===e);t!==void 0&&i({browserRecordingFrameRate:t})},t[5]=i,t[6]=c);let l;t[7]===r?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(H,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:g.map(Nn)}),t[9]=u):u=t[9];let d;t[10]!==n||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,Q.jsxs)(G,{disabled:n,value:s,onValueChange:c,children:[l,u]}),t[10]=n,t[11]=s,t[12]=c,t[13]=l,t[14]=d):d=t[14];let f;return t[15]!==o||t[16]!==d?(f=(0,Q.jsx)(Y,{...a,description:`Maximum recording rate. 30 fps saves CPU and storage; 60 fps is smoother.`,resetAction:o,control:d}),t[15]=o,t[16]=d,t[17]=f):f=t[17],f}function Nn(e){return(0,Q.jsxs)(V,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function Pn(e){return e.browserRecordingFrameRate}var Fn={system:`Your default browser`,app:`P4 Code`};function In(e){let t=(0,Z.c)(19),{disabled:n}=e,r=q(Rn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-link-target`),t[0]=a):a=t[0];let o;t[1]!==n||t[2]!==r||t[3]!==i?(o=!n&&r!==`system`?(0,Q.jsx)($e,{label:`link target`,onClick:()=>i({browserLinkTarget:A})}):null,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>{(e===`system`||e===`app`)&&i({browserLinkTarget:e})},t[5]=i,t[6]=s);let c=Fn[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(W,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(H,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.keys(Fn),t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(U,{align:`end`,alignItemWithTrigger:!1,children:u.map(Ln)}),t[10]=d):d=t[10];let f;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==l?(f=(0,Q.jsxs)(G,{disabled:n,value:r,onValueChange:s,children:[l,d]}),t[11]=n,t[12]=r,t[13]=s,t[14]=l,t[15]=f):f=t[15];let p;return t[16]!==o||t[17]!==f?(p=(0,Q.jsx)(Y,{...a,description:`Where links in the chat and terminal open. Hold ⌘ or Ctrl while clicking a link to open it in your default browser either way.`,resetAction:o,control:f}),t[16]=o,t[17]=f,t[18]=p):p=t[18],p}function Ln(e){return(0,Q.jsx)(V,{hideIndicator:!0,value:e,children:Fn[e]},e)}function Rn(e){return e.browserLinkTarget}function zn(){let e=(0,Z.c)(7),{search:t,environment:n}=tt(),r=Xe(),i=n?.connection.phase===`connected`&&n.serverConfig!==null?n.environmentId:null,a;e[0]===t?a=e[1]:(a=JSON.stringify(t),e[0]=t,e[1]=a);let o=`${i}:${a}`,s;return e[2]!==i||e[3]!==r.enableAgentDeviceAccess||e[4]!==r.enableDeviceSupport||e[5]!==o?(s=(0,Q.jsx)(et,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(Bn,{environmentId:i,enabled:r.enableDeviceSupport,agentAccessEnabled:r.enableAgentDeviceAccess},o)}),e[2]=i,e[3]=r.enableAgentDeviceAccess,e[4]=r.enableDeviceSupport,e[5]=o,e[6]=s):s=e[6],s}function Bn({environmentId:e,enabled:t,agentAccessEnabled:r}){let i=ve(e,n),{state:a,loaded:o}=je(e),{scope:s,environments:c,connectedEnvironments:l}=tt(),u=Ye(),d=s.kind===`project`||s.kind===`checkout`,f=l.some(e=>e.serverConfig?.settings.enableDeviceSupport),p=be(Me.configure,{reportFailure:!1}),m=be(Me.list,{reportFailure:!1}),[h,g]=(0,$.useState)(null),_=a.hostStatus===`installing`||a.hostStatus===`starting`,v=a.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[y,b]=(0,$.useState)(!1);y&&!t&&b(!1),t&&!y&&(a.hostStatus===`ready`||v)&&h!==`hub`&&b(!0);let x=async(t,n)=>{if(e&&ye(e,`settings:write`)){g(t);try{let e=await Promise.allSettled(c.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!ye(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return p({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=c.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&K.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{g(null)}}},[S,C]=(0,$.useState)(null),T=a.hosts.find(e=>e.kind===`local`)?.tools,E=t=>{let n=T?.[t],r=n&&!n.installedVersions.includes(n.requiredVersion);return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[a.supportsToolUpdate&&r?(0,Q.jsx)(w,{size:`sm`,disabled:!e||h!==null||_,onClick:()=>{e&&(C(null),g(`update-${t}`),m({environmentId:e,input:{updateTool:t}}).then(e=>{e._tag===`Failure`&&C({tool:t,message:`Update failed. Check this host's network connection and try again.`})}).finally(()=>g(null)))},children:h===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,a.supportsToolInspection?(0,Q.jsx)(w,{size:`sm`,variant:`outline`,disabled:!e||h!==null||_,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{inspectOnly:!0}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Check versions`}):null]}),S?.tool===t?(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:S.message}):null]})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{...X(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:Le,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:E(`hub`),kind:`hub`,tools:a.hosts.find(e=>e.kind===`local`)?.tools}),h===`hub`?(0,Q.jsx)(Ie,{state:a,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!i||d||!o||!e||_||h!==null,"aria-label":`Device hub`,onCheckedChange:e=>void x(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(Be,{children:y?(0,Q.jsx)(Y,{...X(`device-platform-support`),description:l.length>1?`Status for ${l.find(t=>t.environmentId===e)?.label}. Select an environment to inspect its simulator support.`:void 0,status:(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-x-5 gap-y-2`,children:[(0,Q.jsx)(Fe,{compact:!0,platform:`iOS`,status:Re(a,`ios`)}),(0,Q.jsx)(Fe,{compact:!0,platform:`Android`,status:Re(a,`android`)})]}),control:(0,Q.jsx)(w,{size:`sm`,variant:`outline`,disabled:!e||!t||_||h!==null,onClick:()=>{e&&(g(`check`),m({environmentId:e,input:{}}).finally(()=>g(null)))},children:h===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(Y,{...X(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:Ne,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xt,{action:E(`agent`),kind:`agent`,tools:a.hosts.find(e=>e.kind===`local`)?.tools}),h===`agent`?(0,Q.jsx)(ze,{state:a,pending:!0,compact:!0}):null,(0,Q.jsx)(_t,{settingKeys:[`enableAgentDeviceAccess`],checked:r,disabled:!i||l.length===0||!d&&(!o||!f||_)||h!==null,"aria-label":`Agent device access`,onCheckedChange:e=>d?u({enableAgentDeviceAccess:!!e}):void x(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Pe,{state:{...a,hosts:a.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(Pt,{environmentId:e})]})}function Vn(e){let t=(0,Z.c)(14),{disabled:n}=e,r=q(Hn),i=J(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=X(`browser-auto-show-floating-preview`),t[0]=a):a=t[0];let o;t[1]!==r||t[2]!==n||t[3]!==i?(o=!n&&r!==!0?(0,Q.jsx)($e,{label:`auto-show floating preview`,onClick:()=>i({browserAutoShowFloatingPreview:!0})}):null,t[1]=r,t[2]=n,t[3]=i,t[4]=o):o=t[4];let s;t[5]===i?s=t[6]:(s=e=>i({browserAutoShowFloatingPreview:!!e}),t[5]=i,t[6]=s);let c;t[7]!==r||t[8]!==n||t[9]!==s?(c=(0,Q.jsx)(st,{disabled:n,checked:r,onCheckedChange:s,"aria-label":`Auto-show floating preview`}),t[7]=r,t[8]=n,t[9]=s,t[10]=c):c=t[10];let l;return t[11]!==o||t[12]!==c?(l=(0,Q.jsx)(Y,{...a,description:`Show the floating preview when an agent opens a browser or device unless the agent says otherwise.`,resetAction:o,control:c}),t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function Hn(e){return e.browserAutoShowFloatingPreview}function Un({disabled:e}){let t=q(e=>e.browserProfiles),n=q(e=>e.browserDefaultProfileId),i=me(),s=J(),{environments:c,isReady:l}=fe(),d=de(),[m,g]=(0,$.useState)(null),[y,x]=(0,$.useState)(null),[S,C]=(0,$.useState)(null),[T,D]=(0,$.useState)(null),[O,A]=(0,$.useState)(null),[j,P]=(0,$.useState)(!1),F=re(),L=be(Ue.clearProfile,{reportFailure:!1}),ee={environmentIds:c.map(e=>e.environmentId).filter(e=>F.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await L({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw ne(n)}},R=ln(pt!==null,l,c.length,ee.environmentIds.length),z=(0,$.useRef)(!1),[ie,ae]=(0,$.useState)(!1),B=e||!i,oe=r(t).filter(e=>e.kind!==`incognito`),se=M(oe,n)?.id??`default`,V=e=>{if(!i||z.current)return;let t=ge().browserProfiles;if(t.length>=24)return;let n=r(t),a=new Set(n.map(e=>e.name)),o=e;for(let t=2;a.has(o);t+=1)o=`${e} ${t}`;let c={id:`profile-${b()}`,name:o,kind:`persistent`};return s({browserProfiles:[...t,c]}),c},H=(e,t)=>{if(!i||z.current)return;let n=t.trim().slice(0,48);if(n===``)return;let r=ge().browserProfiles;s({browserProfiles:r.map(t=>t.id===e?{...t,name:n}:t)})},ce=(e,t)=>{if(i&&!z.current){if(!R){K.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`});return}cn(pt,c.map(e=>e.environmentId),e,ee).then(()=>{K.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{K.add({type:`error`,title:`Could not clear ${t}'s data`})})}},U=async e=>{if(!i||z.current)return;if(!R){A(`Connect to an environment before removing this profile.`);return}A(null),P(!0);try{await cn(pt,l?c.map(e=>e.environmentId):[],e,ee)}catch{A(`Profile data could not be deleted. Try again.`),P(!1);return}let t=ge();s({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:N}:{}}),P(!1),C(null)},le=(m??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),W=(0,$.useCallback)(()=>{pt&&pt.listBrowserImportSources().then(g).catch(()=>g(e=>e??[]))},[]),G=async(e,t,n)=>{if(!pt||!i)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!r(ge().browserProfiles).some(e=>e.id===n.target.profileId)||z.current)return{kind:`blocked`,reason:`readFailed`};z.current=!0,ae(!0);try{let i=await pt.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!r(ge().browserProfiles).some(e=>e.id===n.target.profileId))return{kind:`blocked`,reason:`readFailed`};let a;if(n.target.kind===`new`){if(i.imported>0)try{a=(await he(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new mn;let i=new Set(r(t.browserProfiles).map(e=>e.name)),a=e.name;for(let t=2;i.has(a);t+=1)a=`${e.name} ${t}`;return{...t,browserProfiles:[...t.browserProfiles,{id:n.target.profileId,name:a,kind:`persistent`}]}})).browserProfiles.find(e=>e.id===n.target.profileId)?.name??e.name}catch(r){await cn(pt,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof mn?`profileLimitReached`:`profileNotSaved`;throw Error(`Importing cookies from ${e.id} failed: ${i}.`,{cause:r})}else a=e.name}else a=n.target.name;return{kind:`imported`,imported:i.imported,skipped:i.skipped,skippedDomains:i.skippedDomains,targetName:a}}catch(e){return{kind:`blocked`,reason:hn(e)}}finally{z.current=!1,ae(!1)}},ue=async e=>{if(pt)try{let t=await pt.listBrowserImportSources();return g(t),t.find(t=>t.id===e)}catch{return}},_e=t.length>=24;return(0,Q.jsxs)(Y,{...X(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(p,{onOpenChange:e=>e&&W(),children:[(0,Q.jsxs)(_,{render:(0,Q.jsx)(w,{size:`sm`,variant:`outline`,disabled:B||ie}),children:[(0,Q.jsx)(te,{}),`Add profile`]}),(0,Q.jsxs)(h,{align:`end`,children:[(0,Q.jsx)(a,{disabled:!i||_e,onClick:()=>V(`New profile`),children:`Blank profile`}),_e?(0,Q.jsx)(a,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(v,{}),(0,Q.jsxs)(o,{children:[(0,Q.jsx)(E,{children:`Import from`}),m===null?(0,Q.jsx)(a,{disabled:!0,children:`Looking for browsers…`}):le.length===0?(0,Q.jsx)(a,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[le.map(e=>(0,Q.jsx)(a,{disabled:!i||d==null,onClick:()=>{i&&d!=null&&x({source:e,environmentId:d.environmentId,environmentName:Je({isPrimary:!0,environmentId:d.environmentId,runtimeLabel:d.label})})},children:e.name},e.id)),d==null?(0,Q.jsx)(a,{disabled:!0,children:`Connect to an environment to import cookies`}):null]})]})]})]}),children:[(0,Q.jsx)(`div`,{className:`mt-2 mb-2 overflow-hidden rounded-lg border border-border/60`,children:oe.map((e,t)=>{let n=u(e.id),r=e.id===se;return(0,Q.jsxs)(`div`,{className:k(`flex items-center gap-3 px-3 py-2`,t>0&&`border-t border-border/60`),children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[n?(0,Q.jsx)(`span`,{className:k(`truncate text-sm text-foreground`,B&&`opacity-64`),children:e.name}):(0,Q.jsx)(gt,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:B||ie,maxLength:48,value:e.name,onCommit:t=>H(e.id,t)}),r?(0,Q.jsx)(`span`,{className:k(`flex`,B&&`opacity-64`),children:(0,Q.jsx)(f,{children:`Default`})}):null]}),(0,Q.jsxs)(p,{children:[(0,Q.jsx)(_,{render:(0,Q.jsx)(w,{size:`icon-xs`,variant:`ghost-muted`,disabled:B||ie,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(I,{})}),(0,Q.jsxs)(h,{align:`end`,children:[(0,Q.jsx)(a,{disabled:!i||r,onClick:()=>{i&&s({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(a,{disabled:!i||!R,onClick:()=>{ee.environmentIds.length>0?D(e):ce(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(a,{variant:`destructive`,disabled:!i||!R,onClick:()=>{i&&C(e)},children:`Remove profile and data`}),R?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(v,{}),(0,Q.jsx)(a,{disabled:!0,children:l?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(ut,{open:S!==null,onOpenChange:e=>{!e&&!j&&(C(null),A(null))},children:(0,Q.jsxs)(at,{children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(ct,{children:[`Remove “`,S?.name,`”?`]}),(0,Q.jsx)(mt,{children:`Its cookies and logins are deleted. Desktop tabs already open in this profile stay open until you close them; server browser tabs close now.`}),O?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:O}):null,R?null:(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect to an environment to remove this profile and its data.`})]}),(0,Q.jsxs)(dt,{children:[(0,Q.jsx)(it,{disabled:j,render:(0,Q.jsx)(w,{variant:`outline`,disabled:j}),children:`Cancel`}),(0,Q.jsx)(w,{variant:`destructive`,disabled:j||!i||!R,onClick:()=>{S&&i&&R&&U(S.id)},children:j?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(ut,{open:T!==null,onOpenChange:e=>{e||D(null)},children:(0,Q.jsxs)(at,{children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(ct,{children:[`Clear “`,T?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(mt,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(dt,{children:[(0,Q.jsx)(it,{render:(0,Q.jsx)(w,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(w,{variant:`destructive`,onClick:()=>{T&&ce(T.id,T.name),D(null)},children:`Clear data`})]})]})}),y?(0,Q.jsx)(Jt,{source:y.source,destinationEnvironmentName:y.environmentName,targetProfiles:oe.map(e=>({id:e.id,name:e.name})),canCreateProfile:i&&!_e,onImport:e=>G(y.source,y.environmentId,e),onRefreshSource:()=>ue(y.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await pe()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{K.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>x(null)}):null]})}function Wn(){let e=(0,Z.c)(3),t=!xe,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(bn,{disabled:t}),(0,Q.jsx)(Cn,{disabled:t}),(0,Q.jsx)(En,{disabled:t}),(0,Q.jsx)(Mn,{disabled:t}),(0,Q.jsx)(kn,{disabled:t}),(0,Q.jsx)(In,{disabled:t}),(0,Q.jsx)(Vn,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(ht,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(Qe,{children:[i,(0,Q.jsx)(et,{id:`browser`,title:`Browser`,children:t?(0,Q.jsx)(Ze,{message:`Only available in the desktop app.`,children:r}):r}),(0,Q.jsx)(zn,{})]}),e[2]=a):a=e[2],a}var Gn=Wn;export{Gn as component};
2
+ //# sourceMappingURL=settings.integrations-DIuNSxXg.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{Jn as n,Of as r,Sf as i,Sx as a,Un as o,Wn as s,Xn as c,ar as l,ma as u,or as d,t as f,xc as p}from"./utils-geC9CGP4.js";import{t as m}from"./chevron-down-DHV04o66.js";import{t as h}from"./circle-x-C-GXnJRB.js";import{t as g}from"./file-braces-CcggTVd0.js";import{t as _}from"./minus-C7W28oE7.js";import{t as v}from"./plus-Cr075-cy.js";import{t as y}from"./search-Cr9eaeTj.js";import{t as b}from"./triangle-alert-BiHUyRl3.js";import{t as x}from"./x-CSwbgjBe.js";import{L as S,U as C}from"./runtime-BoEmkhOe.js";import{a as w,n as T,t as E}from"./tooltip-Ciaezkl4.js";import{a as D,c as O,o as k,s as A,t as j}from"./select-BDMo6Fqt.js";import{t as M}from"./useLocation-DaTcl6iI.js";import{i as N}from"./toast-CIGvRti2.js";import{f as P}from"./server-DNo9AqHW.js";import{i as F,n as I,o as L}from"./session-CyPECDtf.js";import{t as R}from"./use-atom-command-Bc7LgQy1.js";import{t as ee}from"./env-wK1YYxA8.js";import{t as z}from"./toggle-4i71sOFB.js";import{t as B}from"./input-BOT1WFGI.js";import{r as te}from"./keybindings-B4uuYLfE.js";import{i as ne,o as re,t as ie}from"./popover-UOfX8iZ4.js";import{n as V,r as ae,t as oe}from"./input-group-13zF6rZl.js";import{n as se,t as ce}from"./kbd-BR8-VeaN.js";import{H as le,a as ue,i as de,s as fe,z as pe}from"./settingsLayout-De_r3pyr.js";import{a as H,c as me,f as he,i as ge,l as _e,m as ve,n as ye,o as be,p as U,r as xe,s as Se,t as Ce,u as we}from"./KeybindingsSettings.logic-Dfld_XQx.js";import{ar as Te,ja as Ee,jo as De,or as Oe}from"./main-Ch0n0whg.js";var W=a(),G=e(t(),1),K=e(u(),1);function q(e){let t=(0,W.c)(6),{value:n}=e,r,i;if(t[0]!==n){let e=new Map,a=n.split(`+`).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),{part:t,key:n===0?t:`${t}-${n}`}});r=se,i=a.map(ke),t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a;return t[3]!==r||t[4]!==i?(a=(0,K.jsx)(r,{children:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function ke(e){let{part:t,key:n}=e;return(0,K.jsx)(ce,{children:t===`mod`?navigator.platform.toLowerCase().includes(`mac`)?`⌘`:`Ctrl`:t===`shift`?`⇧`:t===`alt`?navigator.platform.toLowerCase().includes(`mac`)?`⌥`:`Alt`:t===`ctrl`?`⌃`:t.length===1?t.toUpperCase():t},n)}function Ae(e){let t=(0,W.c)(11),{query:n,onChange:r,inputRef:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(V,{children:(0,K.jsx)(y,{"aria-hidden":!0,className:`size-3.5`})}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(e.currentTarget.value),t[1]=r,t[2]=o);let s;t[3]!==r||t[4]!==n?(s=e=>{e.key===`Escape`&&(e.preventDefault(),n.length>0?r(``):e.currentTarget.blur())},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c;return t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==s?(c=(0,K.jsxs)(oe,{className:`min-w-0 basis-full **:[input]:h-9 sm:basis-0 sm:flex-1 sm:**:[input]:h-8`,children:[a,(0,K.jsx)(ae,{ref:i,type:`search`,value:n,onChange:o,onKeyDown:s,placeholder:`Search keybindings`,"aria-label":`Search keybindings`,size:`sm`})]}),t[6]=i,t[7]=n,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function je(e,t){return e.type===t?[...je(e.left,t),...je(e.right,t)]:[e]}function J(e,t){let n=e[0];if(n)return e.slice(1).reduce((e,n)=>({type:t,left:e,right:n}),n)}function Me(e){return e.type===`identifier`?{identifier:e.name,negated:!1}:e.type===`not`&&e.node.type===`identifier`?{identifier:e.node.name,negated:!0}:null}function Ne(e,t){let n=Me(e);if(!n)return e;let r={type:`identifier`,name:t};return n.negated?{type:`not`,node:r}:r}function Pe(e,t){let n=Me(e);if(!n)return t?{type:`not`,node:e}:e;let r={type:`identifier`,name:n.identifier};return t?{type:`not`,node:r}:r}function Y(){return{type:`identifier`,name:Ce}}function Fe(e=`and`){return{type:e,left:Y(),right:{type:`not`,node:Y()}}}function Ie(e){let t=(0,W.c)(14),{label:n,focusable:r,className:i,children:a}=e,o=r===void 0||r?0:void 0,s;t[0]===i?s=t[1]:(s=f(`inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-warning outline-none transition-colors hover:bg-warning/10 focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-warning/25`,i),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==o||t[4]!==s?(c=(0,K.jsx)(`span`,{tabIndex:o,"aria-label":n,className:s}),t[2]=n,t[3]=o,t[4]=s,t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(b,{className:`size-3.5`}),t[6]=l):l=t[6];let u;t[7]===c?u=t[8]:(u=(0,K.jsx)(w,{render:c,children:l}),t[7]=c,t[8]=u);let d;t[9]===a?d=t[10]:(d=(0,K.jsx)(T,{side:`top`,children:a}),t[9]=a,t[10]=d);let p;return t[11]!==u||t[12]!==d?(p=(0,K.jsxs)(E,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=p):p=t[13],p}function Le(e){let t=(0,W.c)(5),{identifiers:n,focusable:r}=e,i=r===void 0||r;if(n.length===0)return null;let a;t[0]===n?a=t[1]:(a=n.length===1?`Unknown condition: ${n[0]}`:`Unknown conditions: ${n.join(`, `)}`,t[0]=n,t[1]=a);let o=a,s;return t[2]!==i||t[3]!==o?(s=(0,K.jsx)(Ie,{label:o,focusable:i,className:`size-4.5`,children:`P4 Code does not recognize this condition yet. It can still be saved, but it may not match unless the runtime provides it.`}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function X(e){let t=(0,W.c)(4),{labels:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.length===1?`Conflicts with ${n[0]}.`:`Conflicts with ${n.slice(0,3).join(`, `)}${n.length>3?`, and more`:``}.`,t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,K.jsxs)(Ie,{label:i,children:[i,` The most recent matching binding wins when both conditions can apply.`]}),t[2]=i,t[3]=a),a}function Re(e){let t=(0,W.c)(25),{value:n,variables:r,unknownIdentifiers:i,onChange:a}=e,o;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e===n,t[3]=n,t[4]=e),o=r.find(e),t[0]=n,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]!==s||t[6]!==n||t[7]!==r?(c=s||r.some(e=>e===n)?r:[n,...r],t[5]=s,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l=c,u;t[9]===a?u=t[10]:(u=e=>e&&a(e),t[9]=a,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(O,{placeholder:`Condition`}),t[11]=d):d=t[11];let f;t[12]===i?f=t[13]:(f=i&&i.length>0?(0,K.jsx)(Le,{identifiers:i,focusable:!1}):null,t[12]=i,t[13]=f);let p;t[14]===f?p=t[15]:(p=(0,K.jsxs)(A,{size:`compact`,className:`min-w-0 flex-1`,children:[d,f]}),t[14]=f,t[15]=p);let m;t[16]===l?m=t[17]:(m=l.map(ze),t[16]=l,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(k,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:m}),t[18]=m,t[19]=h);let g;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==n?(g=(0,K.jsxs)(j,{value:n,onValueChange:u,children:[p,h]}),t[20]=u,t[21]=p,t[22]=h,t[23]=n,t[24]=g):g=t[24],g}function ze(e){return(0,K.jsx)(D,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:e})},e)}function Be(e){let t=(0,W.c)(14),{label:n,className:r,onRemove:i}=e,a;t[0]===r?a=t[1]:(a=f(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,K.jsx)(d,{type:`button`,variant:`ghost`,size:`icon-sm`,className:a,"aria-label":n,onClick:i}),t[2]=n,t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(_,{"aria-hidden":!0,className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]===o?c=t[8]:(c=(0,K.jsx)(w,{delay:200,render:o,children:s}),t[7]=o,t[8]=c);let l;t[9]===n?l=t[10]:(l=(0,K.jsx)(T,{side:`top`,children:n}),t[9]=n,t[10]=l);let u;return t[11]!==c||t[12]!==l?(u=(0,K.jsxs)(E,{children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,s=i===void 0?0:i,c;if(t[0]!==s||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Se(e.identifier)?[]:[e.identifier],l;t[6]!==n||t[7]!==a?(l=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=l):l=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==l||t[11]!==u?(d=(0,K.jsx)(z,{pressed:e.negated,onPressedChange:l,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==n||t[14]!==a?(f=e=>a(Ne(n,e)),t[13]=n,t[14]=a,t[15]=f):f=t[15];let p;t[16]!==e||t[17]!==f||t[18]!==i||t[19]!==r?(p=(0,K.jsx)(Re,{value:e.identifier,variables:r,unknownIdentifiers:i,onChange:f}),t[16]=e,t[17]=f,t[18]=i,t[19]=r,t[20]=p):p=t[20];let m;t[21]!==s||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:ve(n,s),onRemove:o}):null,t[21]=s,t[22]=n,t[23]=o,t[24]=m):m=t[24];let h;t[25]!==d||t[26]!==p||t[27]!==m?(h=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/70 bg-background/60 px-2 py-2`,children:[d,p,m]}),t[25]=d,t[26]=p,t[27]=m,t[28]=h):h=t[28],c=h;break bb0}}t[0]=s,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=c}else c=t[5];if(c!==Symbol.for(`react.early_return_sentinel`))return c;if(n.type===`not`){let e=s>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=f(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let c;t[31]!==n||t[32]!==a?(c=(0,K.jsx)(z,{pressed:!0,onPressedChange:e=>a(e?n:n.node),"aria-label":`Negate group`,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[31]=n,t[32]=a,t[33]=c):c=t[33];let l;t[34]!==s||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:ve(n,s),className:`ml-auto`,onRemove:o}):null,t[34]=s,t[35]=n,t[36]=o,t[37]=l):l=t[37];let u;t[38]!==c||t[39]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c,l]}),t[38]=c,t[39]=l,t[40]=u):u=t[40];let d,p;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`absolute top-0 bottom-0 left-1.5 w-px bg-border/70`,"aria-hidden":!0}),p=(0,K.jsx)(`span`,{className:`absolute top-4 left-1.5 h-px w-2.5 bg-border/70`,"aria-hidden":!0}),t[41]=d,t[42]=p):(d=t[41],p=t[42]);let m=s+1,h;t[43]===a?h=t[44]:(h=e=>a({type:`not`,node:e}),t[43]=a,t[44]=h);let g;t[45]!==n.node||t[46]!==m||t[47]!==h||t[48]!==r?(g=(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[d,p,(0,K.jsx)(Z,{node:n.node,variables:r,depth:m,onChange:h})]}),t[45]=n.node,t[46]=m,t[47]=h,t[48]=r,t[49]=g):g=t[49];let _;return t[50]!==g||t[51]!==i||t[52]!==u?(_=(0,K.jsxs)(`div`,{className:i,children:[u,g]}),t[50]=g,t[51]=i,t[52]=u,t[53]=_):_=t[53],_}let l=n.type===`or`?`or`:`and`,u,p,m,h;if(t[54]!==s||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==l||t[59]!==r){let e=je(n,l),i=new Map,c=e.map(e=>{let t=`${e.type}-${U(e)}`,n=i.get(t)??0;return i.set(t,n+1),{child:e,key:n===0?t:`${t}-${n}`}}),g=(t,n)=>{let r=!1,i=J(e.map(e=>!r&&e===t?(r=!0,n):e),l);i&&a(i)},_=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),l);a(r||Y())},y=t=>{if(t===l)return;let n=J(e,t);n&&a(n)},b=()=>{let t=J([...e,Y()],l);t&&a(t)},x=()=>{let t={type:l===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],l);n&&a(n)},S=s>0&&`border-border/70 bg-background/55`;t[64]===S?m=t[65]:(m=f(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,S),t[64]=S,t[65]=m);let C;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(A,{size:`compact`,className:`w-24`,children:(0,K.jsx)(O,{})}),t[66]=C):C=t[66];let w;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(k,{alignItemWithTrigger:!1,matchTriggerWidth:!1,children:[(0,K.jsx)(D,{value:`and`,children:`and`}),(0,K.jsx)(D,{value:`or`,children:`or`})]}),t[67]=w):w=t[67];let T;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(v,{className:`size-3.5`}),t[68]=T):T=t[68];let E;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(v,{className:`size-3.5`}),t[69]=E):E=t[69];let M;t[70]!==s||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:ve(n,s),className:`ml-auto`,onRemove:o}):null,t[70]=s,t[71]=n,t[72]=o,t[73]=M):M=t[73],h=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(j,{value:l,onValueChange:e=>y(e),children:[C,w]}),(0,K.jsxs)(d,{type:`button`,variant:`outline`,size:`compact`,onClick:b,children:[T,`Condition`]}),(0,K.jsxs)(d,{type:`button`,variant:`outline`,size:`compact`,onClick:x,children:[E,`Group`]}),M]}),u=`space-y-2`,p=c.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:f(`absolute top-0 bottom-0 left-1.5 w-px`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:f(`absolute top-4 left-1.5 h-px w-2.5`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:s+1,onChange:e=>g(t,e),onRemove:()=>_(t)})]},n)}),t[54]=s,t[55]=n,t[56]=a,t[57]=o,t[58]=l,t[59]=r,t[60]=u,t[61]=p,t[62]=m,t[63]=h}else u=t[60],p=t[61],m=t[62],h=t[63];let g;t[74]!==u||t[75]!==p?(g=(0,K.jsx)(`div`,{className:u,children:p}),t[74]=u,t[75]=p,t[76]=g):g=t[76];let _;return t[77]!==m||t[78]!==h||t[79]!==g?(_=(0,K.jsxs)(`div`,{className:m,children:[h,g]}),t[77]=m,t[78]=h,t[79]=g,t[80]=_):_=t[80],_}function Ve(e){let t=(0,W.c)(60),{value:n,variables:r,onChange:i,onValidityChange:a}=e,o;t[0]===n?o=t[1]:(o=U(n),t[0]=n,t[1]=o);let[s,c]=(0,G.useState)(o),l;t[2]===s?l=t[3]:(l=we(s),t[2]=s,t[3]=l);let u=l,f=u.ok?null:u.message,p;t[4]!==u.ok||t[5]!==u.value?(p=u.ok?he(u.value):[],t[4]=u.ok,t[5]=u.value,t[6]=p):p=t[6];let m=p,g;t[7]!==i||t[8]!==a?(g=e=>{c(e);let t=we(e);a?.(t.ok),t.ok&&i(t.value)},t[7]=i,t[8]=a,t[9]=g):g=t[9];let _=g,y;t[10]!==i||t[11]!==a?(y=e=>{c(U(e)),a?.(!0),i(e)},t[10]=i,t[11]=a,t[12]=y):y=t[12];let b=y,x;t[13]!==b||t[14]!==n?(x=()=>{if(!n){b(Y());return}b({type:`and`,left:n,right:Y()})},t[13]=b,t[14]=n,t[15]=x):x=t[15];let S=x,C;t[16]!==b||t[17]!==n?(C=()=>{let e=Fe(`or`);if(!n){b(e);return}b({type:`and`,left:n,right:e})},t[16]=b,t[17]=n,t[18]=C):C=t[18];let w=C,T;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`When`})}),t[19]=T):T=t[19];let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(v,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(d,{type:`button`,variant:`outline`,size:`compact`,onClick:S,children:[E,`Condition`]}),t[21]=S,t[22]=D);let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(v,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(d,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[O,`Group`]}),t[24]=w,t[25]=k);let A;t[26]!==D||t[27]!==k?(A=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,k]})]}),t[26]=D,t[27]=k,t[28]=A):A=t[28];let j;t[29]===_?j=t[30]:(j=e=>_(e.currentTarget.value),t[29]=_,t[30]=j);let M=!!f,N;t[31]!==s||t[32]!==j||t[33]!==M?(N=(0,K.jsx)(ae,{value:s,onChange:j,placeholder:`Always`,"aria-invalid":M,"aria-label":`When expression`,size:`compact`,font:`mono`}),t[31]=s,t[32]=j,t[33]=M,t[34]=N):N=t[34];let P;t[35]===m?P=t[36]:(P=m.length>0?(0,K.jsx)(V,{align:`inline-end`,children:(0,K.jsx)(Le,{identifiers:m})}):null,t[35]=m,t[36]=P);let F;t[37]!==N||t[38]!==P?(F=(0,K.jsxs)(oe,{children:[N,P]}),t[37]=N,t[38]=P,t[39]=F):F=t[39];let I;t[40]===f?I=t[41]:(I=f?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(h,{className:`size-3.5`}),f]}):null,t[40]=f,t[41]=I);let L;t[42]!==F||t[43]!==I?(L=(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[F,I]}),t[42]=F,t[43]=I,t[44]=L):L=t[44];let R;t[45]!==S||t[46]!==w||t[47]!==b||t[48]!==n||t[49]!==r?(R=n?(0,K.jsx)(Z,{node:n,variables:r,onChange:b,onRemove:()=>b(void 0)}):(0,K.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/15 p-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(d,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(v,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(d,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(v,{className:`size-3.5`}),`Group`]})]})}),t[45]=S,t[46]=w,t[47]=b,t[48]=n,t[49]=r,t[50]=R):R=t[50];let ee;t[51]===f?ee=t[52]:(ee=f?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-lg border border-destructive/30 bg-background/75 p-4 text-center text-xs text-destructive backdrop-blur-xs`,children:`Fix the expression above to continue editing visually.`}):null,t[51]=f,t[52]=ee);let z;t[53]!==R||t[54]!==ee?(z=(0,K.jsxs)(`div`,{className:`relative`,children:[R,ee]}),t[53]=R,t[54]=ee,t[55]=z):z=t[55];let B;return t[56]!==A||t[57]!==L||t[58]!==z?(B=(0,K.jsxs)(`div`,{className:`w-[min(34rem,calc(100vw-2rem))] space-y-3`,children:[A,L,z]}),t[56]=A,t[57]=L,t[58]=z,t[59]=B):B=t[59],B}function He(e){return{keyDraft:e.key,whenDraft:e.binding.whenAst,isRecording:!1,isWhenDraftValid:!0}}function Q(e,t){return{...e,...t}}function Ue(e){return{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}}function We(e){let t=(0,W.c)(27),{row:n,allRows:r,onSave:i}=e,[a,o]=(0,G.useReducer)(Q,n,He),{keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u}=a,d,f,p;t[0]!==r||t[1]!==s||t[2]!==n.id||t[3]!==n.key||t[4]!==n.when||t[5]!==c?(p=U(c),d=s!==n.key||p!==n.when,f=me(r,{rowId:n.id,key:s,when:p}),t[0]=r,t[1]=s,t[2]=n.id,t[3]=n.key,t[4]=n.when,t[5]=c,t[6]=d,t[7]=f,t[8]=p):(d=t[6],f=t[7],p=t[8]);let m=f,h;t[9]!==s||t[10]!==i||t[11]!==n||t[12]!==p?(h=()=>{i({command:n.command,key:s,when:p.trim().length>0?p:void 0,replace:Ue(n)})},t[9]=s,t[10]=i,t[11]=n,t[12]=p,t[13]=h):h=t[13];let g=h,_;t[14]!==l||t[15]!==n.key?(_=e=>{if(e.key===`Tab`&&!l)return;if(e.preventDefault(),e.key===`Escape`){o({keyDraft:n.key,isRecording:!1});return}let t=_e(e.nativeEvent,navigator.platform);t&&o({keyDraft:t,isRecording:!1})},t[14]=l,t[15]=n.key,t[16]=_):_=t[16];let v=_,y;return t[17]!==v||t[18]!==m||t[19]!==d||t[20]!==l||t[21]!==u||t[22]!==s||t[23]!==g||t[24]!==c||t[25]!==p?(y={keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u,whenDraftExpression:p,isDirty:d,conflictLabels:m,setDraft:o,save:g,captureKeybinding:v},t[17]=v,t[18]=m,t[19]=d,t[20]=l,t[21]=u,t[22]=s,t[23]=g,t[24]=c,t[25]=p,t[26]=y):y=t[26],y}function Ge(e){let t=(0,W.c)(19),{row:n,editor:r,isSaving:i,pillClassName:a}=e,{keyDraft:o,isRecording:s,isDirty:c,isWhenDraftValid:l,setDraft:u,save:p,captureKeybinding:m}=r,h=!s&&o===n.key&&n.key.length>0&&!c,g;t[0]!==c||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==p?(g=c?(0,K.jsx)(d,{size:`sm`,disabled:i||o.trim().length===0||!l,onClick:p,children:i?`Saving`:`Save`}):null,t[0]=c,t[1]=i,t[2]=l,t[3]=o,t[4]=p,t[5]=g):g=t[5];let _;t[6]!==m||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==n.binding||t[11]!==n.command||t[12]!==n.key||t[13]!==u||t[14]!==h?(_=h?(0,K.jsx)(`button`,{type:`button`,onClick:()=>u({isRecording:!0}),"aria-label":`Edit shortcut for ${H(n.command)}: ${te(n.binding.shortcut)}`,className:f(`inline-flex h-8 cursor-pointer items-center rounded-md border border-transparent px-1.5 sm:h-7 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/24`,a),children:(0,K.jsx)(q,{value:n.key})}):(0,K.jsx)(B,{"data-keybinding-capture":``,autoFocus:s,"aria-label":`Keybinding for ${H(n.command)}`,value:s?``:o,placeholder:s?`Press shortcut`:`Unassigned`,size:`sm`,font:`mono`,className:`w-44`,onFocus:()=>u({isRecording:!0}),onBlur:()=>u({isRecording:!1}),onChange:e=>u({keyDraft:e.currentTarget.value}),onKeyDown:m}),t[6]=m,t[7]=s,t[8]=o,t[9]=a,t[10]=n.binding,t[11]=n.command,t[12]=n.key,t[13]=u,t[14]=h,t[15]=_):_=t[15];let v;return t[16]!==g||t[17]!==_?(v=(0,K.jsxs)(K.Fragment,{children:[g,_]}),t[16]=g,t[17]=_,t[18]=v):v=t[18],v}function $(e){let t=(0,W.c)(17),{label:n,expression:r,value:i,variables:a,onChange:o,onValidityChange:s}=e,c=r?`ghost`:`ghost-muted`,l;t[0]===c?l=t[1]:(l=(0,K.jsx)(d,{variant:c,size:`micro`,className:`min-w-0 shrink`}),t[0]=c,t[1]=l);let u=`Edit when clause for ${n}`,f=r||`Always`,p;t[2]===f?p=t[3]:(p=(0,K.jsx)(`span`,{className:`truncate font-mono`,children:f}),t[2]=f,t[3]=p);let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,K.jsx)(m,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=h):h=t[4];let g;t[5]!==l||t[6]!==u||t[7]!==p?(g=(0,K.jsxs)(re,{render:l,"aria-label":u,children:[p,h]}),t[5]=l,t[6]=u,t[7]=p,t[8]=g):g=t[8];let _;t[9]!==o||t[10]!==s||t[11]!==i||t[12]!==a?(_=(0,K.jsx)(ne,{align:`start`,sideOffset:6,children:(0,K.jsx)(Ve,{value:i,variables:a,onChange:o,onValidityChange:s})}),t[9]=o,t[10]=s,t[11]=i,t[12]=a,t[13]=_):_=t[13];let v;return t[14]!==g||t[15]!==_?(v=(0,K.jsxs)(ie,{children:[g,_]}),t[14]=g,t[15]=_,t[16]=v):v=t[16],v}function Ke(e){let t=(0,W.c)(24),{row:r,isSaving:i,onReset:a,onRemove:o}=e,u=r.source===`Custom`&&r.defaultKey!==null,f=r.source!==`Default`;if(!u&&!f)return null;let p;t[0]===r.command?p=t[1]:(p=H(r.command),t[0]=r.command,t[1]=p);let m=`Actions for ${p}`,h;t[2]!==i||t[3]!==m?(h=(0,K.jsx)(d,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:i,"aria-label":m}),t[2]=i,t[3]=m,t[4]=h):h=t[4];let g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,K.jsx)(De,{className:`size-3.5`}),t[5]=g):g=t[5];let _;t[6]===h?_=t[7]:(_=(0,K.jsx)(l,{render:h,children:g}),t[6]=h,t[7]=_);let v;t[8]!==u||t[9]!==i||t[10]!==a||t[11]!==r?(v=u?(0,K.jsx)(n,{disabled:i,onClick:()=>a(r),children:`Reset to default`}):null,t[8]=u,t[9]=i,t[10]=a,t[11]=r,t[12]=v):v=t[12];let y;t[13]!==f||t[14]!==i||t[15]!==o||t[16]!==r?(y=f?(0,K.jsx)(n,{variant:`destructive`,disabled:i,onClick:()=>o(r),children:`Remove`}):null,t[13]=f,t[14]=i,t[15]=o,t[16]=r,t[17]=y):y=t[17];let b;t[18]!==v||t[19]!==y?(b=(0,K.jsxs)(c,{align:`end`,children:[v,y]}),t[18]=v,t[19]=y,t[20]=b):b=t[20];let x;return t[21]!==_||t[22]!==b?(x=(0,K.jsxs)(s,{children:[_,b]}),t[21]=_,t[22]=b,t[23]=x):x=t[23],x}function qe(e){let t=(0,W.c)(2),{source:n}=e;if(n===`Default`)return null;let r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(o,{variant:`outline`,size:`sm`,children:n}),t[0]=n,t[1]=r),r}function Je(e){let t=(0,W.c)(13),{row:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`flex items-center gap-2`}),t[0]=r):r=t[0];let i;t[1]===n.command?i=t[2]:(i=H(n.command),t[1]=n.command,t[2]=i);let a;t[3]===n.source?a=t[4]:(a=(0,K.jsx)(qe,{source:n.source}),t[3]=n.source,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,K.jsxs)(w,{render:r,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]===n.command?s=t[9]:(s=(0,K.jsx)(T,{side:`top`,children:n.command}),t[8]=n.command,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,K.jsxs)(E,{children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ye(e){let t=(0,W.c)(13),{row:n,editor:r,variables:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[0]=a):a=t[0];let o;t[1]===n.command?o=t[2]:(o=H(n.command),t[1]=n.command,t[2]=o);let s,c;t[3]===r?(s=t[4],c=t[5]):(s=e=>r.setDraft({whenDraft:e}),c=e=>r.setDraft({isWhenDraftValid:e}),t[3]=r,t[4]=s,t[5]=c);let l;return t[6]!==r.whenDraft||t[7]!==r.whenDraftExpression||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==i?(l=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[a,(0,K.jsx)($,{label:o,expression:r.whenDraftExpression,value:r.whenDraft,variables:i,onChange:s,onValidityChange:c})]}),t[6]=r.whenDraft,t[7]=r.whenDraftExpression,t[8]=o,t[9]=s,t[10]=c,t[11]=i,t[12]=l):l=t[12],l}function Xe(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(`span`,{className:`flex items-center opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100 has-data-popup-open:opacity-100 pointer-coarse:opacity-100`,children:(0,K.jsx)(Ke,{...e})}),t[0]=e,t[1]=n),n}function Ze(e){let t=(0,W.c)(30),{row:n,isSaving:r,anchorId:i,allRows:a,variables:o,onSave:s,onReset:c,onRemove:l}=e,u;t[0]!==a||t[1]!==s||t[2]!==n?(u={row:n,allRows:a,onSave:s},t[0]=a,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d=We(u),f;t[4]===n?f=t[5]:(f=(0,K.jsx)(Je,{row:n}),t[4]=n,t[5]=f);let p;t[6]!==d||t[7]!==n||t[8]!==o?(p=(0,K.jsx)(Ye,{row:n,editor:d,variables:o}),t[6]=d,t[7]=n,t[8]=o,t[9]=p):p=t[9];let m;t[10]===d.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:d.conflictLabels}),t[10]=d.conflictLabels,t[11]=m);let h;t[12]!==r||t[13]!==l||t[14]!==c||t[15]!==n?(h=(0,K.jsx)(Xe,{row:n,isSaving:r,onReset:c,onRemove:l}),t[12]=r,t[13]=l,t[14]=c,t[15]=n,t[16]=h):h=t[16];let g;t[17]!==d||t[18]!==r||t[19]!==n?(g=(0,K.jsx)(Ge,{row:n,editor:d,isSaving:r,pillClassName:`-mr-1.5`}),t[17]=d,t[18]=r,t[19]=n,t[20]=g):g=t[20];let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==i||t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,K.jsx)(ue,{id:i,className:`group/row rounded-none`,title:f,description:p,control:_}),t[25]=i,t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29],v}function Qe(e){let t=(0,W.c)(30),{allRows:n,onSave:r}=e,[i,a]=(0,G.useState)(``),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={keyDraft:``,whenDraft:void 0,isRecording:!1,isWhenDraftValid:!0},t[0]=o):o=t[0];let[s,c]=(0,G.useReducer)(Q,o),{keyDraft:l,whenDraft:u,isRecording:d,isWhenDraftValid:f}=s,p,m;t[1]!==n||t[2]!==l||t[3]!==u?(m=U(u),p=me(n,{rowId:`new`,key:l,when:m}),t[1]=n,t[2]=l,t[3]=u,t[4]=p,t[5]=m):(p=t[4],m=t[5]);let h=p,g;t[6]===i?g=t[7]:(g=i?H(i):`new keybinding`,t[6]=i,t[7]=g);let _=g,v;t[8]!==i||t[9]!==f||t[10]!==l?(v=!!i&&l.trim().length>0&&f,t[8]=i,t[9]=f,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==l||t[14]!==r||t[15]!==m?(b=()=>{i&&r({command:i,key:l,...m.trim().length>0?{when:m}:{}})},t[12]=i,t[13]=l,t[14]=r,t[15]=m,t[16]=b):b=t[16];let x=b,S;t[17]===d?S=t[18]:(S=e=>{if(e.key===`Tab`&&!d)return;if(e.preventDefault(),e.key===`Escape`){c({keyDraft:``,isRecording:!1});return}let t=_e(e.nativeEvent,navigator.platform);t&&c({keyDraft:t,isRecording:!1})},t[17]=d,t[18]=S);let C=S,w;return t[19]!==y||t[20]!==C||t[21]!==i||t[22]!==_||t[23]!==h||t[24]!==d||t[25]!==l||t[26]!==x||t[27]!==u||t[28]!==m?(w={commandDraft:i,setCommandDraft:a,keyDraft:l,whenDraft:u,whenDraftExpression:m,isRecording:d,conflictLabels:h,commandLabelText:_,canSave:y,setDraft:c,save:x,captureKeybinding:C},t[19]=y,t[20]=C,t[21]=i,t[22]=_,t[23]=h,t[24]=d,t[25]=l,t[26]=x,t[27]=u,t[28]=m,t[29]=w):w=t[29],w}function $e(e){let t=(0,W.c)(14),{draft:n,commandOptions:r,className:i}=e,a=n.commandDraft,o;t[0]===n?o=t[1]:(o=e=>n.setCommandDraft(e),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(O,{placeholder:`Command`}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsx)(A,{size:`sm`,className:i,children:s}),t[3]=i,t[4]=c);let l;t[5]===r?l=t[6]:(l=r.map(et),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,K.jsx)(k,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n.commandDraft||t[10]!==o||t[11]!==c||t[12]!==u?(d=(0,K.jsxs)(j,{value:a,onValueChange:o,children:[c,u]}),t[9]=n.commandDraft,t[10]=o,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function et(e){return(0,K.jsx)(D,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:H(e)})},e)}function tt(e){let t=(0,W.c)(14),{draft:n,autoFocus:r,className:i}=e,a=r!==void 0&&r,o=`Keybinding for ${n.commandLabelText}`,s=n.isRecording?``:n.keyDraft,c=n.isRecording?`Press shortcut`:`Unassigned`,l,u,d;t[0]===n?(l=t[1],u=t[2],d=t[3]):(l=()=>n.setDraft({isRecording:!0}),u=()=>n.setDraft({isRecording:!1}),d=e=>n.setDraft({keyDraft:e.currentTarget.value}),t[0]=n,t[1]=l,t[2]=u,t[3]=d);let f;return t[4]!==a||t[5]!==i||t[6]!==n.captureKeybinding||t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,K.jsx)(B,{"data-keybinding-capture":``,autoFocus:a,"aria-label":o,value:s,placeholder:c,size:`sm`,font:`mono`,className:i,onFocus:l,onBlur:u,onChange:d,onKeyDown:n.captureKeybinding}),t[4]=a,t[5]=i,t[6]=n.captureKeybinding,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function nt(e){let t=(0,W.c)(10),{draft:n,variables:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=e=>n.setDraft({whenDraft:e}),a=e=>n.setDraft({isWhenDraftValid:e}),t[0]=n,t[1]=i,t[2]=a);let o;return t[3]!==n.commandLabelText||t[4]!==n.whenDraft||t[5]!==n.whenDraftExpression||t[6]!==i||t[7]!==a||t[8]!==r?(o=(0,K.jsx)($,{label:n.commandLabelText,expression:n.whenDraftExpression,value:n.whenDraft,variables:r,onChange:i,onValidityChange:a}),t[3]=n.commandLabelText,t[4]=n.whenDraft,t[5]=n.whenDraftExpression,t[6]=i,t[7]=a,t[8]=r,t[9]=o):o=t[9],o}function rt(e){let t=(0,W.c)(9),{isSaving:n,onCancel:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,K.jsx)(d,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:n,"aria-label":`Cancel new keybinding`,onClick:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(x,{className:`size-3.5`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,K.jsx)(w,{render:i,children:a}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(T,{side:`top`,children:`Cancel`}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,K.jsxs)(E,{children:[o,s]}),t[7]=o,t[8]=c),c}function it(e){let t=(0,W.c)(30),{commandOptions:n,allRows:r,variables:i,isSaving:a,onSave:o,onCancel:s}=e,c;t[0]!==r||t[1]!==o?(c={allRows:r,onSave:o},t[0]=r,t[1]=o,t[2]=c):c=t[2];let l=Qe(c),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[3]=u):u=t[3];let f;t[4]!==l||t[5]!==i?(f=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[u,(0,K.jsx)(nt,{draft:l,variables:i})]}),t[4]=l,t[5]=i,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==l?(p=(0,K.jsx)($e,{draft:l,commandOptions:n,className:`w-56`}),t[7]=n,t[8]=l,t[9]=p):p=t[9];let m;t[10]===l.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:l.conflictLabels}),t[10]=l.conflictLabels,t[11]=m);let h;t[12]===l?h=t[13]:(h=(0,K.jsx)(tt,{draft:l,className:`w-44`}),t[12]=l,t[13]=h);let g=a||!l.canSave,_=a?`Saving`:`Save`,v;t[14]!==l.save||t[15]!==g||t[16]!==_?(v=(0,K.jsx)(d,{size:`sm`,disabled:g,onClick:l.save,children:_}),t[14]=l.save,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==s?(y=(0,K.jsx)(rt,{isSaving:a,onCancel:s}),t[18]=a,t[19]=s,t[20]=y):y=t[20];let b;t[21]!==p||t[22]!==m||t[23]!==h||t[24]!==v||t[25]!==y?(b=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[p,m,h,v,y]}),t[21]=p,t[22]=m,t[23]=h,t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;return t[27]!==b||t[28]!==f?(x=(0,K.jsx)(ue,{className:`bg-muted/15`,title:`New keybinding`,description:f,control:b}),t[27]=b,t[28]=f,t[29]=x):x=t[29],x}function at(e){let{groups:t,anchorIds:n,savingCommand:r,...i}=e;return t.map(e=>(0,K.jsx)(fe,{id:`keybindings-${e.id}`,title:e.title,children:e.rows.map(e=>(0,K.jsx)(Ze,{row:e,anchorId:n.get(e.id),isSaving:r===e.command,...i},e.id))},e.id))}function ot(){let e=(0,W.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(E,{children:[(0,K.jsx)(w,{delay:200,render:(0,K.jsx)(d,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first. The desktop app receives them all.`,children:(0,K.jsx)(b,{className:`size-3.5 text-warning`})})}),(0,K.jsx)(T,{side:`top`,className:`max-w-72`,children:`The browser may claim some shortcuts first. The desktop app receives them all.`})]}),e[0]=t):t=e[0],t}function st(){let e=(0,W.c)(83),{environment:t,connectedEnvironments:n}=pe(),a=F(t?.environmentId??null,i),o=L(n,r),s;e[0]!==n||e[1]!==o?(s=n.length>0&&n.every(e=>o.has(e.environmentId)),e[0]=n,e[1]=o,e[2]=s):s=e[2];let c=s,l=t?.serverConfig?.keybindings,u;e[3]===l?u=e[4]:(u=l??[],e[3]=l,e[4]=u);let f;e[5]===u?f=e[6]:(f=p(u),e[5]=u,e[6]=f);let m=f,h=t?.serverConfig?.keybindingsConfigPath??null,_;e[7]===t?.serverConfig?.availableEditors?_=e[8]:(_=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=_);let y=_,b;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(b={reportFailure:!1},e[9]=b):b=e[9];let x=R(P.upsertKeybinding,b),D;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(D={reportFailure:!1},e[10]=D):D=e[10];let O=R(P.removeKeybinding,D),k=Ee(t?.environmentId??null,y),[A,j]=(0,G.useState)(``),z=(0,G.useRef)(null),[B,te]=(0,G.useState)(null),[ne,re]=(0,G.useState)(!1),ie;e[11]!==m||e[12]!==A?(ie=xe(m,A),e[11]=m,e[12]=A,e[13]=ie):ie=e[13];let V=ie,ae;e[14]===V?ae=e[15]:(ae=be(V),e[14]=V,e[15]=ae);let oe=ae,se;if(e[16]!==V){se=new Map;let t=new Set;for(let e of V)t.has(e.command)||(t.add(e.command),se.set(e.id,Te(e.command)));e[16]=V,e[17]=se}else se=e[17];let ce=se,ue;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ue={select:ft},e[18]=ue):ue=e[18];let H=M(ue),[me,he]=(0,G.useState)(H);H!==me&&(he(H),H.startsWith(`keybinding-`)&&j(``));let _e;e[19]===m?_e=e[20]:(_e=ye(m),e[19]=m,e[20]=_e);let ve=_e,U;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=ge(),e[21]=U):U=e[21];let Se=U,Ce;e[22]!==h||e[23]!==k||e[24]!==t?(Ce=()=>{h&&t&&I(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await k(h);if(e._tag===`Success`||S(e))return;let t=C(e);N.add({title:`Unable to open keybindings file`,description:t instanceof Error?t.message:`The keybindings file was not opened.`,type:`error`})})()},e[22]=h,e[23]=k,e[24]=t,e[25]=Ce):Ce=e[25];let we=Ce,De;e[26]!==n||e[27]!==t||e[28]!==x?(De=e=>{if(!t||!n.every(dt))return;te(e.command);let r={command:e.command,key:e.key.trim(),...e.when?.trim()?{when:e.when.trim()}:{},...e.replace?{replace:e.replace}:{}};(async()=>{let e=await Promise.all(n.map(e=>x({environmentId:e.environmentId,input:r})));te(null);let t=e.find(ut);if(!t){re(!1);return}if(!S(t)){let e=C(t);N.add({title:`Unable to save keybinding`,description:e instanceof Error?e.message:`The keybinding was not saved.`,type:`error`})}})()},e[26]=n,e[27]=t,e[28]=x,e[29]=De):De=e[29];let q=De,ke;e[30]!==n||e[31]!==t||e[32]!==O?(ke=e=>{t&&n.every(lt)&&(te(e.command),(async()=>{let t=await Promise.all(n.map(t=>O({environmentId:t.environmentId,input:Ue(e)})));te(null);let r=t.find(ct)??t[0];if(r?._tag===`Failure`&&!S(r)){let e=C(r);N.add({title:`Unable to remove keybinding`,description:e instanceof Error?e.message:`The keybinding was not removed.`,type:`error`})}})())},e[30]=n,e[31]=t,e[32]=O,e[33]=ke):ke=e[33];let je=ke,J;e[34]===q?J=e[35]:(J=e=>{e.defaultKey&&q({command:e.command,key:e.defaultKey,when:e.defaultWhen.trim().length>0?e.defaultWhen:void 0,replace:{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}})},e[34]=q,e[35]=J);let Me=J,Ne;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>re(!1),e[36]=Ne):Ne=e[36];let Pe=Ne,Y;e[37]!==je||e[38]!==Me||e[39]!==V||e[40]!==q?(Y={allRows:V,variables:Se,onSave:q,onReset:Me,onRemove:je},e[37]=je,e[38]=Me,e[39]=V,e[40]=q,e[41]=Y):Y=e[41];let Fe=Y,Ie,Le;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=Oe(`keybindings`),Le=ee?null:(0,K.jsx)(ot,{}),e[42]=Ie,e[43]=Le):(Ie=e[42],Le=e[43]);let X;e[44]===A?X=e[45]:(X=(0,K.jsx)(Ae,{query:A,onChange:j,inputRef:z}),e[44]=A,e[45]=X);let Re=ne||!c,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>re(!0),Be=(0,K.jsx)(v,{"aria-hidden":!0,className:`size-4`}),e[46]=ze,e[47]=Be):(ze=e[46],Be=e[47]);let Z;e[48]===Re?Z=e[49]:(Z=(0,K.jsxs)(d,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!h||!a,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(g,{"aria-hidden":!0,className:`size-4`}),e[50]=He):He=e[50];let Q;e[51]!==we||e[52]!==Ve?(Q=(0,K.jsx)(w,{render:(0,K.jsx)(d,{type:`button`,variant:`outline`,size:`icon`,disabled:Ve,onClick:we,"aria-label":`Open keybindings.json`,children:He})}),e[51]=we,e[52]=Ve,e[53]=Q):Q=e[53];let We;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,K.jsx)(T,{side:`top`,children:`Open keybindings.json`}),e[54]=We):We=e[54];let Ge;e[55]===Q?Ge=e[56]:(Ge=(0,K.jsxs)(E,{children:[Q,We]}),e[55]=Q,e[56]=Ge);let $;e[57]!==X||e[58]!==Z||e[59]!==Ge?($=(0,K.jsx)(fe,{...Ie,headerAction:Le,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[X,Z,Ge]})}),e[57]=X,e[58]=Z,e[59]=Ge,e[60]=$):$=e[60];let Ke;e[61]!==c||e[62]!==n?(Ke=c?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.length===0?`Connect an environment to change keybindings.`:`This connection can view keybindings but cannot change them.`}),e[61]=c,e[62]=n,e[63]=Ke):Ke=e[63];let qe=!c,Je;e[64]!==ve||e[65]!==ne||e[66]!==V||e[67]!==q||e[68]!==B?(Je=ne?(0,K.jsx)(le,{children:(0,K.jsx)(it,{commandOptions:ve,allRows:V,variables:Se,isSaving:B!==null,onSave:q,onCancel:Pe})}):null,e[64]=ve,e[65]=ne,e[66]=V,e[67]=q,e[68]=B,e[69]=Je):Je=e[69];let Ye;e[70]!==ce||e[71]!==oe||e[72]!==Fe||e[73]!==B?(Ye=oe.length>0?(0,K.jsx)(at,{groups:oe,anchorIds:ce,savingCommand:B,...Fe}):(0,K.jsx)(le,{children:(0,K.jsx)(`div`,{className:`px-4 py-12 text-center text-sm text-muted-foreground`,children:`No keybindings match your search.`})}),e[70]=ce,e[71]=oe,e[72]=Fe,e[73]=B,e[74]=Ye):Ye=e[74];let Xe;e[75]!==qe||e[76]!==Je||e[77]!==Ye?(Xe=(0,K.jsxs)(`div`,{inert:qe,className:`flex flex-col gap-8`,children:[Je,Ye]}),e[75]=qe,e[76]=Je,e[77]=Ye,e[78]=Xe):Xe=e[78];let Ze;return e[79]!==$||e[80]!==Ke||e[81]!==Xe?(Ze=(0,K.jsxs)(de,{children:[$,Ke,Xe]}),e[79]=$,e[80]=Ke,e[81]=Xe,e[82]=Ze):Ze=e[82],Ze}function ct(e){return e._tag===`Failure`}function lt(e){return I(e.environmentId,r)}function ut(e){return e._tag===`Failure`}function dt(e){return I(e.environmentId,r)}function ft(e){return e.hash.replace(/^#/,``)}var pt=st;export{pt as component};
2
- //# sourceMappingURL=settings.keybindings-CITYXalz.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{Af as n,Jn as r,Un as i,Wn as a,Xn as o,ar as s,ma as c,or as l,t as u,wf as d,wx as f,xc as p}from"./utils-Nv21__t3.js";import{t as m}from"./chevron-down-DHV04o66.js";import{t as h}from"./circle-x-C-GXnJRB.js";import{t as g}from"./file-braces-CcggTVd0.js";import{t as _}from"./minus-C7W28oE7.js";import{t as v}from"./plus-Cr075-cy.js";import{t as y}from"./search-Cr9eaeTj.js";import{t as b}from"./triangle-alert-BiHUyRl3.js";import{t as x}from"./x-CSwbgjBe.js";import{L as S,U as C}from"./runtime-CxeCZPZ3.js";import{a as w,n as T,t as E}from"./tooltip-CYNXW1Ow.js";import{a as D,c as O,o as k,s as A,t as j}from"./select-BXOHHCMJ.js";import{t as M}from"./useLocation-yjRHv-GS.js";import{i as N}from"./toast-B-l3XS_F.js";import{f as P}from"./server-BBIVfjrf.js";import{i as F,n as I,o as L}from"./session-DZH3pyoG.js";import{t as R}from"./use-atom-command-DdGPgtPS.js";import{t as ee}from"./env-wK1YYxA8.js";import{t as z}from"./toggle-DOFhC9C7.js";import{t as B}from"./input-CN9xdIYL.js";import{r as te}from"./keybindings-C81QSEVL.js";import{i as ne,o as re,t as ie}from"./popover-aTTlR6NX.js";import{n as V,r as ae,t as oe}from"./input-group-CV0ZpOg5.js";import{n as se,t as ce}from"./kbd-Fa27fInv.js";import{H as le,a as ue,i as de,s as fe,z as pe}from"./settingsLayout-DKjAOwp4.js";import{a as H,c as me,f as he,i as ge,l as _e,m as ve,n as ye,o as be,p as U,r as xe,s as Se,t as Ce,u as we}from"./KeybindingsSettings.logic-DBks3HZy.js";import{Fa as Te,ir as Ee,rr as De,zo as Oe}from"./main-CJvawsJJ.js";var W=f(),G=e(t(),1),K=e(c(),1);function q(e){let t=(0,W.c)(6),{value:n}=e,r,i;if(t[0]!==n){let e=new Map,a=n.split(`+`).map(t=>{let n=e.get(t)??0;return e.set(t,n+1),{part:t,key:n===0?t:`${t}-${n}`}});r=se,i=a.map(ke),t[0]=n,t[1]=r,t[2]=i}else r=t[1],i=t[2];let a;return t[3]!==r||t[4]!==i?(a=(0,K.jsx)(r,{children:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function ke(e){let{part:t,key:n}=e;return(0,K.jsx)(ce,{children:t===`mod`?navigator.platform.toLowerCase().includes(`mac`)?`⌘`:`Ctrl`:t===`shift`?`⇧`:t===`alt`?navigator.platform.toLowerCase().includes(`mac`)?`⌥`:`Alt`:t===`ctrl`?`⌃`:t.length===1?t.toUpperCase():t},n)}function Ae(e){let t=(0,W.c)(11),{query:n,onChange:r,inputRef:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(V,{children:(0,K.jsx)(y,{"aria-hidden":!0,className:`size-3.5`})}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(e.currentTarget.value),t[1]=r,t[2]=o);let s;t[3]!==r||t[4]!==n?(s=e=>{e.key===`Escape`&&(e.preventDefault(),n.length>0?r(``):e.currentTarget.blur())},t[3]=r,t[4]=n,t[5]=s):s=t[5];let c;return t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==s?(c=(0,K.jsxs)(oe,{className:`min-w-0 basis-full **:[input]:h-9 sm:basis-0 sm:flex-1 sm:**:[input]:h-8`,children:[a,(0,K.jsx)(ae,{ref:i,type:`search`,value:n,onChange:o,onKeyDown:s,placeholder:`Search keybindings`,"aria-label":`Search keybindings`,size:`sm`})]}),t[6]=i,t[7]=n,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function je(e,t){return e.type===t?[...je(e.left,t),...je(e.right,t)]:[e]}function J(e,t){let n=e[0];if(n)return e.slice(1).reduce((e,n)=>({type:t,left:e,right:n}),n)}function Me(e){return e.type===`identifier`?{identifier:e.name,negated:!1}:e.type===`not`&&e.node.type===`identifier`?{identifier:e.node.name,negated:!0}:null}function Ne(e,t){let n=Me(e);if(!n)return e;let r={type:`identifier`,name:t};return n.negated?{type:`not`,node:r}:r}function Pe(e,t){let n=Me(e);if(!n)return t?{type:`not`,node:e}:e;let r={type:`identifier`,name:n.identifier};return t?{type:`not`,node:r}:r}function Y(){return{type:`identifier`,name:Ce}}function Fe(e=`and`){return{type:e,left:Y(),right:{type:`not`,node:Y()}}}function Ie(e){let t=(0,W.c)(14),{label:n,focusable:r,className:i,children:a}=e,o=r===void 0||r?0:void 0,s;t[0]===i?s=t[1]:(s=u(`inline-flex size-5 shrink-0 items-center justify-center rounded-sm text-warning outline-none transition-colors hover:bg-warning/10 focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-warning/25`,i),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==o||t[4]!==s?(c=(0,K.jsx)(`span`,{tabIndex:o,"aria-label":n,className:s}),t[2]=n,t[3]=o,t[4]=s,t[5]=c):c=t[5];let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,K.jsx)(b,{className:`size-3.5`}),t[6]=l):l=t[6];let d;t[7]===c?d=t[8]:(d=(0,K.jsx)(w,{render:c,children:l}),t[7]=c,t[8]=d);let f;t[9]===a?f=t[10]:(f=(0,K.jsx)(T,{side:`top`,children:a}),t[9]=a,t[10]=f);let p;return t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(E,{children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13],p}function Le(e){let t=(0,W.c)(5),{identifiers:n,focusable:r}=e,i=r===void 0||r;if(n.length===0)return null;let a;t[0]===n?a=t[1]:(a=n.length===1?`Unknown condition: ${n[0]}`:`Unknown conditions: ${n.join(`, `)}`,t[0]=n,t[1]=a);let o=a,s;return t[2]!==i||t[3]!==o?(s=(0,K.jsx)(Ie,{label:o,focusable:i,className:`size-4.5`,children:`P4 Code does not recognize this condition yet. It can still be saved, but it may not match unless the runtime provides it.`}),t[2]=i,t[3]=o,t[4]=s):s=t[4],s}function X(e){let t=(0,W.c)(4),{labels:n}=e;if(n.length===0)return null;let r;t[0]===n?r=t[1]:(r=n.length===1?`Conflicts with ${n[0]}.`:`Conflicts with ${n.slice(0,3).join(`, `)}${n.length>3?`, and more`:``}.`,t[0]=n,t[1]=r);let i=r,a;return t[2]===i?a=t[3]:(a=(0,K.jsxs)(Ie,{label:i,children:[i,` The most recent matching binding wins when both conditions can apply.`]}),t[2]=i,t[3]=a),a}function Re(e){let t=(0,W.c)(25),{value:n,variables:r,unknownIdentifiers:i,onChange:a}=e,o;if(t[0]!==n||t[1]!==r){let e;t[3]===n?e=t[4]:(e=e=>e===n,t[3]=n,t[4]=e),o=r.find(e),t[0]=n,t[1]=r,t[2]=o}else o=t[2];let s=o,c;t[5]!==s||t[6]!==n||t[7]!==r?(c=s||r.some(e=>e===n)?r:[n,...r],t[5]=s,t[6]=n,t[7]=r,t[8]=c):c=t[8];let l=c,u;t[9]===a?u=t[10]:(u=e=>e&&a(e),t[9]=a,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(O,{placeholder:`Condition`}),t[11]=d):d=t[11];let f;t[12]===i?f=t[13]:(f=i&&i.length>0?(0,K.jsx)(Le,{identifiers:i,focusable:!1}):null,t[12]=i,t[13]=f);let p;t[14]===f?p=t[15]:(p=(0,K.jsxs)(A,{size:`compact`,className:`min-w-0 flex-1`,children:[d,f]}),t[14]=f,t[15]=p);let m;t[16]===l?m=t[17]:(m=l.map(ze),t[16]=l,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,K.jsx)(k,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:m}),t[18]=m,t[19]=h);let g;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==n?(g=(0,K.jsxs)(j,{value:n,onValueChange:u,children:[p,h]}),t[20]=u,t[21]=p,t[22]=h,t[23]=n,t[24]=g):g=t[24],g}function ze(e){return(0,K.jsx)(D,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:e})},e)}function Be(e){let t=(0,W.c)(14),{label:n,className:r,onRemove:i}=e,a;t[0]===r?a=t[1]:(a=u(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,K.jsx)(l,{type:`button`,variant:`ghost`,size:`icon-sm`,className:a,"aria-label":n,onClick:i}),t[2]=n,t[3]=i,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(_,{"aria-hidden":!0,className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]===o?c=t[8]:(c=(0,K.jsx)(w,{delay:200,render:o,children:s}),t[7]=o,t[8]=c);let d;t[9]===n?d=t[10]:(d=(0,K.jsx)(T,{side:`top`,children:n}),t[9]=n,t[10]=d);let f;return t[11]!==c||t[12]!==d?(f=(0,K.jsxs)(E,{children:[c,d]}),t[11]=c,t[12]=d,t[13]=f):f=t[13],f}function Z(e){let t=(0,W.c)(81),{node:n,variables:r,depth:i,onChange:a,onRemove:o}=e,s=i===void 0?0:i,c;if(t[0]!==s||t[1]!==n||t[2]!==a||t[3]!==o||t[4]!==r){c=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Me(n);if(e){let i=Se(e.identifier)?[]:[e.identifier],l;t[6]!==n||t[7]!==a?(l=e=>a(Pe(n,e)),t[6]=n,t[7]=a,t[8]=l):l=t[8];let u=`Negate ${e.identifier}`,d;t[9]!==e||t[10]!==l||t[11]!==u?(d=(0,K.jsx)(z,{pressed:e.negated,onPressedChange:l,"aria-label":u,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[9]=e,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==n||t[14]!==a?(f=e=>a(Ne(n,e)),t[13]=n,t[14]=a,t[15]=f):f=t[15];let p;t[16]!==e||t[17]!==f||t[18]!==i||t[19]!==r?(p=(0,K.jsx)(Re,{value:e.identifier,variables:r,unknownIdentifiers:i,onChange:f}),t[16]=e,t[17]=f,t[18]=i,t[19]=r,t[20]=p):p=t[20];let m;t[21]!==s||t[22]!==n||t[23]!==o?(m=o?(0,K.jsx)(Be,{label:ve(n,s),onRemove:o}):null,t[21]=s,t[22]=n,t[23]=o,t[24]=m):m=t[24];let h;t[25]!==d||t[26]!==p||t[27]!==m?(h=(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border/70 bg-background/60 px-2 py-2`,children:[d,p,m]}),t[25]=d,t[26]=p,t[27]=m,t[28]=h):h=t[28],c=h;break bb0}}t[0]=s,t[1]=n,t[2]=a,t[3]=o,t[4]=r,t[5]=c}else c=t[5];if(c!==Symbol.for(`react.early_return_sentinel`))return c;if(n.type===`not`){let e=s>0&&`border-border/50 bg-background/50`,i;t[29]===e?i=t[30]:(i=u(`space-y-2 rounded-lg border border-border/70 bg-muted/20 p-2`,e),t[29]=e,t[30]=i);let c;t[31]!==n||t[32]!==a?(c=(0,K.jsx)(z,{pressed:!0,onPressedChange:e=>a(e?n:n.node),"aria-label":`Negate group`,variant:`outline`,size:`compact`,className:`min-w-10`,children:`Not`}),t[31]=n,t[32]=a,t[33]=c):c=t[33];let l;t[34]!==s||t[35]!==n||t[36]!==o?(l=o?(0,K.jsx)(Be,{label:ve(n,s),className:`ml-auto`,onRemove:o}):null,t[34]=s,t[35]=n,t[36]=o,t[37]=l):l=t[37];let d;t[38]!==c||t[39]!==l?(d=(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c,l]}),t[38]=c,t[39]=l,t[40]=d):d=t[40];let f,p;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,K.jsx)(`span`,{className:`absolute top-0 bottom-0 left-1.5 w-px bg-border/70`,"aria-hidden":!0}),p=(0,K.jsx)(`span`,{className:`absolute top-4 left-1.5 h-px w-2.5 bg-border/70`,"aria-hidden":!0}),t[41]=f,t[42]=p):(f=t[41],p=t[42]);let m=s+1,h;t[43]===a?h=t[44]:(h=e=>a({type:`not`,node:e}),t[43]=a,t[44]=h);let g;t[45]!==n.node||t[46]!==m||t[47]!==h||t[48]!==r?(g=(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[f,p,(0,K.jsx)(Z,{node:n.node,variables:r,depth:m,onChange:h})]}),t[45]=n.node,t[46]=m,t[47]=h,t[48]=r,t[49]=g):g=t[49];let _;return t[50]!==g||t[51]!==i||t[52]!==d?(_=(0,K.jsxs)(`div`,{className:i,children:[d,g]}),t[50]=g,t[51]=i,t[52]=d,t[53]=_):_=t[53],_}let d=n.type===`or`?`or`:`and`,f,p,m,h;if(t[54]!==s||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==d||t[59]!==r){let e=je(n,d),i=new Map,c=e.map(e=>{let t=`${e.type}-${U(e)}`,n=i.get(t)??0;return i.set(t,n+1),{child:e,key:n===0?t:`${t}-${n}`}}),g=(t,n)=>{let r=!1,i=J(e.map(e=>!r&&e===t?(r=!0,n):e),d);i&&a(i)},_=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),d);a(r||Y())},y=t=>{if(t===d)return;let n=J(e,t);n&&a(n)},b=()=>{let t=J([...e,Y()],d);t&&a(t)},x=()=>{let t={type:d===`and`?`or`:`and`,left:Y(),right:{type:`not`,node:Y()}},n=J([...e,t],d);n&&a(n)},S=s>0&&`border-border/70 bg-background/55`;t[64]===S?m=t[65]:(m=u(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,S),t[64]=S,t[65]=m);let C;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(A,{size:`compact`,className:`w-24`,children:(0,K.jsx)(O,{})}),t[66]=C):C=t[66];let w;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,K.jsxs)(k,{alignItemWithTrigger:!1,matchTriggerWidth:!1,children:[(0,K.jsx)(D,{value:`and`,children:`and`}),(0,K.jsx)(D,{value:`or`,children:`or`})]}),t[67]=w):w=t[67];let T;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(v,{className:`size-3.5`}),t[68]=T):T=t[68];let E;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(v,{className:`size-3.5`}),t[69]=E):E=t[69];let M;t[70]!==s||t[71]!==n||t[72]!==o?(M=o?(0,K.jsx)(Be,{label:ve(n,s),className:`ml-auto`,onRemove:o}):null,t[70]=s,t[71]=n,t[72]=o,t[73]=M):M=t[73],h=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(j,{value:d,onValueChange:e=>y(e),children:[C,w]}),(0,K.jsxs)(l,{type:`button`,variant:`outline`,size:`compact`,onClick:b,children:[T,`Condition`]}),(0,K.jsxs)(l,{type:`button`,variant:`outline`,size:`compact`,onClick:x,children:[E,`Group`]}),M]}),f=`space-y-2`,p=c.map(e=>{let{child:t,key:n}=e;return(0,K.jsxs)(`div`,{className:`relative pl-4`,children:[(0,K.jsx)(`span`,{className:u(`absolute top-0 bottom-0 left-1.5 w-px`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(`span`,{className:u(`absolute top-4 left-1.5 h-px w-2.5`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,K.jsx)(Z,{node:t,variables:r,depth:s+1,onChange:e=>g(t,e),onRemove:()=>_(t)})]},n)}),t[54]=s,t[55]=n,t[56]=a,t[57]=o,t[58]=d,t[59]=r,t[60]=f,t[61]=p,t[62]=m,t[63]=h}else f=t[60],p=t[61],m=t[62],h=t[63];let g;t[74]!==f||t[75]!==p?(g=(0,K.jsx)(`div`,{className:f,children:p}),t[74]=f,t[75]=p,t[76]=g):g=t[76];let _;return t[77]!==m||t[78]!==h||t[79]!==g?(_=(0,K.jsxs)(`div`,{className:m,children:[h,g]}),t[77]=m,t[78]=h,t[79]=g,t[80]=_):_=t[80],_}function Ve(e){let t=(0,W.c)(60),{value:n,variables:r,onChange:i,onValidityChange:a}=e,o;t[0]===n?o=t[1]:(o=U(n),t[0]=n,t[1]=o);let[s,c]=(0,G.useState)(o),u;t[2]===s?u=t[3]:(u=we(s),t[2]=s,t[3]=u);let d=u,f=d.ok?null:d.message,p;t[4]!==d.ok||t[5]!==d.value?(p=d.ok?he(d.value):[],t[4]=d.ok,t[5]=d.value,t[6]=p):p=t[6];let m=p,g;t[7]!==i||t[8]!==a?(g=e=>{c(e);let t=we(e);a?.(t.ok),t.ok&&i(t.value)},t[7]=i,t[8]=a,t[9]=g):g=t[9];let _=g,y;t[10]!==i||t[11]!==a?(y=e=>{c(U(e)),a?.(!0),i(e)},t[10]=i,t[11]=a,t[12]=y):y=t[12];let b=y,x;t[13]!==b||t[14]!==n?(x=()=>{if(!n){b(Y());return}b({type:`and`,left:n,right:Y()})},t[13]=b,t[14]=n,t[15]=x):x=t[15];let S=x,C;t[16]!==b||t[17]!==n?(C=()=>{let e=Fe(`or`);if(!n){b(e);return}b({type:`and`,left:n,right:e})},t[16]=b,t[17]=n,t[18]=C):C=t[18];let w=C,T;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`When`})}),t[19]=T):T=t[19];let E;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,K.jsx)(v,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,K.jsxs)(l,{type:`button`,variant:`outline`,size:`compact`,onClick:S,children:[E,`Condition`]}),t[21]=S,t[22]=D);let O;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,K.jsx)(v,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,K.jsxs)(l,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[O,`Group`]}),t[24]=w,t[25]=k);let A;t[26]!==D||t[27]!==k?(A=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[D,k]})]}),t[26]=D,t[27]=k,t[28]=A):A=t[28];let j;t[29]===_?j=t[30]:(j=e=>_(e.currentTarget.value),t[29]=_,t[30]=j);let M=!!f,N;t[31]!==s||t[32]!==j||t[33]!==M?(N=(0,K.jsx)(ae,{value:s,onChange:j,placeholder:`Always`,"aria-invalid":M,"aria-label":`When expression`,size:`compact`,font:`mono`}),t[31]=s,t[32]=j,t[33]=M,t[34]=N):N=t[34];let P;t[35]===m?P=t[36]:(P=m.length>0?(0,K.jsx)(V,{align:`inline-end`,children:(0,K.jsx)(Le,{identifiers:m})}):null,t[35]=m,t[36]=P);let F;t[37]!==N||t[38]!==P?(F=(0,K.jsxs)(oe,{children:[N,P]}),t[37]=N,t[38]=P,t[39]=F):F=t[39];let I;t[40]===f?I=t[41]:(I=f?(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,K.jsx)(h,{className:`size-3.5`}),f]}):null,t[40]=f,t[41]=I);let L;t[42]!==F||t[43]!==I?(L=(0,K.jsxs)(`div`,{className:`space-y-1.5`,children:[F,I]}),t[42]=F,t[43]=I,t[44]=L):L=t[44];let R;t[45]!==S||t[46]!==w||t[47]!==b||t[48]!==n||t[49]!==r?(R=n?(0,K.jsx)(Z,{node:n,variables:r,onChange:b,onRemove:()=>b(void 0)}):(0,K.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/15 p-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(l,{type:`button`,size:`compact`,onClick:S,children:[(0,K.jsx)(v,{className:`size-3.5`}),`Condition`]}),(0,K.jsxs)(l,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,K.jsx)(v,{className:`size-3.5`}),`Group`]})]})}),t[45]=S,t[46]=w,t[47]=b,t[48]=n,t[49]=r,t[50]=R):R=t[50];let ee;t[51]===f?ee=t[52]:(ee=f?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-lg border border-destructive/30 bg-background/75 p-4 text-center text-xs text-destructive backdrop-blur-xs`,children:`Fix the expression above to continue editing visually.`}):null,t[51]=f,t[52]=ee);let z;t[53]!==R||t[54]!==ee?(z=(0,K.jsxs)(`div`,{className:`relative`,children:[R,ee]}),t[53]=R,t[54]=ee,t[55]=z):z=t[55];let B;return t[56]!==A||t[57]!==L||t[58]!==z?(B=(0,K.jsxs)(`div`,{className:`w-[min(34rem,calc(100vw-2rem))] space-y-3`,children:[A,L,z]}),t[56]=A,t[57]=L,t[58]=z,t[59]=B):B=t[59],B}function He(e){return{keyDraft:e.key,whenDraft:e.binding.whenAst,isRecording:!1,isWhenDraftValid:!0}}function Q(e,t){return{...e,...t}}function Ue(e){return{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}}function We(e){let t=(0,W.c)(27),{row:n,allRows:r,onSave:i}=e,[a,o]=(0,G.useReducer)(Q,n,He),{keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u}=a,d,f,p;t[0]!==r||t[1]!==s||t[2]!==n.id||t[3]!==n.key||t[4]!==n.when||t[5]!==c?(p=U(c),d=s!==n.key||p!==n.when,f=me(r,{rowId:n.id,key:s,when:p}),t[0]=r,t[1]=s,t[2]=n.id,t[3]=n.key,t[4]=n.when,t[5]=c,t[6]=d,t[7]=f,t[8]=p):(d=t[6],f=t[7],p=t[8]);let m=f,h;t[9]!==s||t[10]!==i||t[11]!==n||t[12]!==p?(h=()=>{i({command:n.command,key:s,when:p.trim().length>0?p:void 0,replace:Ue(n)})},t[9]=s,t[10]=i,t[11]=n,t[12]=p,t[13]=h):h=t[13];let g=h,_;t[14]!==l||t[15]!==n.key?(_=e=>{if(e.key===`Tab`&&!l)return;if(e.preventDefault(),e.key===`Escape`){o({keyDraft:n.key,isRecording:!1});return}let t=_e(e.nativeEvent,navigator.platform);t&&o({keyDraft:t,isRecording:!1})},t[14]=l,t[15]=n.key,t[16]=_):_=t[16];let v=_,y;return t[17]!==v||t[18]!==m||t[19]!==d||t[20]!==l||t[21]!==u||t[22]!==s||t[23]!==g||t[24]!==c||t[25]!==p?(y={keyDraft:s,whenDraft:c,isRecording:l,isWhenDraftValid:u,whenDraftExpression:p,isDirty:d,conflictLabels:m,setDraft:o,save:g,captureKeybinding:v},t[17]=v,t[18]=m,t[19]=d,t[20]=l,t[21]=u,t[22]=s,t[23]=g,t[24]=c,t[25]=p,t[26]=y):y=t[26],y}function Ge(e){let t=(0,W.c)(19),{row:n,editor:r,isSaving:i,pillClassName:a}=e,{keyDraft:o,isRecording:s,isDirty:c,isWhenDraftValid:d,setDraft:f,save:p,captureKeybinding:m}=r,h=!s&&o===n.key&&n.key.length>0&&!c,g;t[0]!==c||t[1]!==i||t[2]!==d||t[3]!==o||t[4]!==p?(g=c?(0,K.jsx)(l,{size:`sm`,disabled:i||o.trim().length===0||!d,onClick:p,children:i?`Saving`:`Save`}):null,t[0]=c,t[1]=i,t[2]=d,t[3]=o,t[4]=p,t[5]=g):g=t[5];let _;t[6]!==m||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==n.binding||t[11]!==n.command||t[12]!==n.key||t[13]!==f||t[14]!==h?(_=h?(0,K.jsx)(`button`,{type:`button`,onClick:()=>f({isRecording:!0}),"aria-label":`Edit shortcut for ${H(n.command)}: ${te(n.binding.shortcut)}`,className:u(`inline-flex h-8 cursor-pointer items-center rounded-md border border-transparent px-1.5 sm:h-7 outline-none transition-colors hover:border-border/70 hover:bg-accent focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-inset focus-visible:ring-ring/24`,a),children:(0,K.jsx)(q,{value:n.key})}):(0,K.jsx)(B,{"data-keybinding-capture":``,autoFocus:s,"aria-label":`Keybinding for ${H(n.command)}`,value:s?``:o,placeholder:s?`Press shortcut`:`Unassigned`,size:`sm`,font:`mono`,className:`w-44`,onFocus:()=>f({isRecording:!0}),onBlur:()=>f({isRecording:!1}),onChange:e=>f({keyDraft:e.currentTarget.value}),onKeyDown:m}),t[6]=m,t[7]=s,t[8]=o,t[9]=a,t[10]=n.binding,t[11]=n.command,t[12]=n.key,t[13]=f,t[14]=h,t[15]=_):_=t[15];let v;return t[16]!==g||t[17]!==_?(v=(0,K.jsxs)(K.Fragment,{children:[g,_]}),t[16]=g,t[17]=_,t[18]=v):v=t[18],v}function $(e){let t=(0,W.c)(17),{label:n,expression:r,value:i,variables:a,onChange:o,onValidityChange:s}=e,c=r?`ghost`:`ghost-muted`,u;t[0]===c?u=t[1]:(u=(0,K.jsx)(l,{variant:c,size:`micro`,className:`min-w-0 shrink`}),t[0]=c,t[1]=u);let d=`Edit when clause for ${n}`,f=r||`Always`,p;t[2]===f?p=t[3]:(p=(0,K.jsx)(`span`,{className:`truncate font-mono`,children:f}),t[2]=f,t[3]=p);let h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,K.jsx)(m,{className:`size-3.5 shrink-0 opacity-60`}),t[4]=h):h=t[4];let g;t[5]!==u||t[6]!==d||t[7]!==p?(g=(0,K.jsxs)(re,{render:u,"aria-label":d,children:[p,h]}),t[5]=u,t[6]=d,t[7]=p,t[8]=g):g=t[8];let _;t[9]!==o||t[10]!==s||t[11]!==i||t[12]!==a?(_=(0,K.jsx)(ne,{align:`start`,sideOffset:6,children:(0,K.jsx)(Ve,{value:i,variables:a,onChange:o,onValidityChange:s})}),t[9]=o,t[10]=s,t[11]=i,t[12]=a,t[13]=_):_=t[13];let v;return t[14]!==g||t[15]!==_?(v=(0,K.jsxs)(ie,{children:[g,_]}),t[14]=g,t[15]=_,t[16]=v):v=t[16],v}function Ke(e){let t=(0,W.c)(24),{row:n,isSaving:i,onReset:c,onRemove:u}=e,d=n.source===`Custom`&&n.defaultKey!==null,f=n.source!==`Default`;if(!d&&!f)return null;let p;t[0]===n.command?p=t[1]:(p=H(n.command),t[0]=n.command,t[1]=p);let m=`Actions for ${p}`,h;t[2]!==i||t[3]!==m?(h=(0,K.jsx)(l,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:i,"aria-label":m}),t[2]=i,t[3]=m,t[4]=h):h=t[4];let g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,K.jsx)(Oe,{className:`size-3.5`}),t[5]=g):g=t[5];let _;t[6]===h?_=t[7]:(_=(0,K.jsx)(s,{render:h,children:g}),t[6]=h,t[7]=_);let v;t[8]!==d||t[9]!==i||t[10]!==c||t[11]!==n?(v=d?(0,K.jsx)(r,{disabled:i,onClick:()=>c(n),children:`Reset to default`}):null,t[8]=d,t[9]=i,t[10]=c,t[11]=n,t[12]=v):v=t[12];let y;t[13]!==f||t[14]!==i||t[15]!==u||t[16]!==n?(y=f?(0,K.jsx)(r,{variant:`destructive`,disabled:i,onClick:()=>u(n),children:`Remove`}):null,t[13]=f,t[14]=i,t[15]=u,t[16]=n,t[17]=y):y=t[17];let b;t[18]!==v||t[19]!==y?(b=(0,K.jsxs)(o,{align:`end`,children:[v,y]}),t[18]=v,t[19]=y,t[20]=b):b=t[20];let x;return t[21]!==_||t[22]!==b?(x=(0,K.jsxs)(a,{children:[_,b]}),t[21]=_,t[22]=b,t[23]=x):x=t[23],x}function qe(e){let t=(0,W.c)(2),{source:n}=e;if(n===`Default`)return null;let r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(i,{variant:`outline`,size:`sm`,children:n}),t[0]=n,t[1]=r),r}function Je(e){let t=(0,W.c)(13),{row:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,K.jsx)(`span`,{className:`flex items-center gap-2`}),t[0]=r):r=t[0];let i;t[1]===n.command?i=t[2]:(i=H(n.command),t[1]=n.command,t[2]=i);let a;t[3]===n.source?a=t[4]:(a=(0,K.jsx)(qe,{source:n.source}),t[3]=n.source,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,K.jsxs)(w,{render:r,children:[i,a]}),t[5]=i,t[6]=a,t[7]=o):o=t[7];let s;t[8]===n.command?s=t[9]:(s=(0,K.jsx)(T,{side:`top`,children:n.command}),t[8]=n.command,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,K.jsxs)(E,{children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ye(e){let t=(0,W.c)(13),{row:n,editor:r,variables:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[0]=a):a=t[0];let o;t[1]===n.command?o=t[2]:(o=H(n.command),t[1]=n.command,t[2]=o);let s,c;t[3]===r?(s=t[4],c=t[5]):(s=e=>r.setDraft({whenDraft:e}),c=e=>r.setDraft({isWhenDraftValid:e}),t[3]=r,t[4]=s,t[5]=c);let l;return t[6]!==r.whenDraft||t[7]!==r.whenDraftExpression||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==i?(l=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[a,(0,K.jsx)($,{label:o,expression:r.whenDraftExpression,value:r.whenDraft,variables:i,onChange:s,onValidityChange:c})]}),t[6]=r.whenDraft,t[7]=r.whenDraftExpression,t[8]=o,t[9]=s,t[10]=c,t[11]=i,t[12]=l):l=t[12],l}function Xe(e){let t=(0,W.c)(2),n;return t[0]===e?n=t[1]:(n=(0,K.jsx)(`span`,{className:`flex items-center opacity-0 transition-opacity group-focus-within/row:opacity-100 group-hover/row:opacity-100 has-data-popup-open:opacity-100 pointer-coarse:opacity-100`,children:(0,K.jsx)(Ke,{...e})}),t[0]=e,t[1]=n),n}function Ze(e){let t=(0,W.c)(30),{row:n,isSaving:r,anchorId:i,allRows:a,variables:o,onSave:s,onReset:c,onRemove:l}=e,u;t[0]!==a||t[1]!==s||t[2]!==n?(u={row:n,allRows:a,onSave:s},t[0]=a,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d=We(u),f;t[4]===n?f=t[5]:(f=(0,K.jsx)(Je,{row:n}),t[4]=n,t[5]=f);let p;t[6]!==d||t[7]!==n||t[8]!==o?(p=(0,K.jsx)(Ye,{row:n,editor:d,variables:o}),t[6]=d,t[7]=n,t[8]=o,t[9]=p):p=t[9];let m;t[10]===d.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:d.conflictLabels}),t[10]=d.conflictLabels,t[11]=m);let h;t[12]!==r||t[13]!==l||t[14]!==c||t[15]!==n?(h=(0,K.jsx)(Xe,{row:n,isSaving:r,onReset:c,onRemove:l}),t[12]=r,t[13]=l,t[14]=c,t[15]=n,t[16]=h):h=t[16];let g;t[17]!==d||t[18]!==r||t[19]!==n?(g=(0,K.jsx)(Ge,{row:n,editor:d,isSaving:r,pillClassName:`-mr-1.5`}),t[17]=d,t[18]=r,t[19]=n,t[20]=g):g=t[20];let _;t[21]!==m||t[22]!==h||t[23]!==g?(_=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[m,h,g]}),t[21]=m,t[22]=h,t[23]=g,t[24]=_):_=t[24];let v;return t[25]!==i||t[26]!==f||t[27]!==p||t[28]!==_?(v=(0,K.jsx)(ue,{id:i,className:`group/row rounded-none`,title:f,description:p,control:_}),t[25]=i,t[26]=f,t[27]=p,t[28]=_,t[29]=v):v=t[29],v}function Qe(e){let t=(0,W.c)(30),{allRows:n,onSave:r}=e,[i,a]=(0,G.useState)(``),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={keyDraft:``,whenDraft:void 0,isRecording:!1,isWhenDraftValid:!0},t[0]=o):o=t[0];let[s,c]=(0,G.useReducer)(Q,o),{keyDraft:l,whenDraft:u,isRecording:d,isWhenDraftValid:f}=s,p,m;t[1]!==n||t[2]!==l||t[3]!==u?(m=U(u),p=me(n,{rowId:`new`,key:l,when:m}),t[1]=n,t[2]=l,t[3]=u,t[4]=p,t[5]=m):(p=t[4],m=t[5]);let h=p,g;t[6]===i?g=t[7]:(g=i?H(i):`new keybinding`,t[6]=i,t[7]=g);let _=g,v;t[8]!==i||t[9]!==f||t[10]!==l?(v=!!i&&l.trim().length>0&&f,t[8]=i,t[9]=f,t[10]=l,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==l||t[14]!==r||t[15]!==m?(b=()=>{i&&r({command:i,key:l,...m.trim().length>0?{when:m}:{}})},t[12]=i,t[13]=l,t[14]=r,t[15]=m,t[16]=b):b=t[16];let x=b,S;t[17]===d?S=t[18]:(S=e=>{if(e.key===`Tab`&&!d)return;if(e.preventDefault(),e.key===`Escape`){c({keyDraft:``,isRecording:!1});return}let t=_e(e.nativeEvent,navigator.platform);t&&c({keyDraft:t,isRecording:!1})},t[17]=d,t[18]=S);let C=S,w;return t[19]!==y||t[20]!==C||t[21]!==i||t[22]!==_||t[23]!==h||t[24]!==d||t[25]!==l||t[26]!==x||t[27]!==u||t[28]!==m?(w={commandDraft:i,setCommandDraft:a,keyDraft:l,whenDraft:u,whenDraftExpression:m,isRecording:d,conflictLabels:h,commandLabelText:_,canSave:y,setDraft:c,save:x,captureKeybinding:C},t[19]=y,t[20]=C,t[21]=i,t[22]=_,t[23]=h,t[24]=d,t[25]=l,t[26]=x,t[27]=u,t[28]=m,t[29]=w):w=t[29],w}function $e(e){let t=(0,W.c)(14),{draft:n,commandOptions:r,className:i}=e,a=n.commandDraft,o;t[0]===n?o=t[1]:(o=e=>n.setCommandDraft(e),t[0]=n,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(O,{placeholder:`Command`}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,K.jsx)(A,{size:`sm`,className:i,children:s}),t[3]=i,t[4]=c);let l;t[5]===r?l=t[6]:(l=r.map(et),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,K.jsx)(k,{alignItemWithTrigger:!1,matchTriggerWidth:!1,className:`max-h-72`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n.commandDraft||t[10]!==o||t[11]!==c||t[12]!==u?(d=(0,K.jsxs)(j,{value:a,onValueChange:o,children:[c,u]}),t[9]=n.commandDraft,t[10]=o,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function et(e){return(0,K.jsx)(D,{value:e,className:`w-full`,children:(0,K.jsx)(`span`,{className:`truncate`,children:H(e)})},e)}function tt(e){let t=(0,W.c)(14),{draft:n,autoFocus:r,className:i}=e,a=r!==void 0&&r,o=`Keybinding for ${n.commandLabelText}`,s=n.isRecording?``:n.keyDraft,c=n.isRecording?`Press shortcut`:`Unassigned`,l,u,d;t[0]===n?(l=t[1],u=t[2],d=t[3]):(l=()=>n.setDraft({isRecording:!0}),u=()=>n.setDraft({isRecording:!1}),d=e=>n.setDraft({keyDraft:e.currentTarget.value}),t[0]=n,t[1]=l,t[2]=u,t[3]=d);let f;return t[4]!==a||t[5]!==i||t[6]!==n.captureKeybinding||t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d?(f=(0,K.jsx)(B,{"data-keybinding-capture":``,autoFocus:a,"aria-label":o,value:s,placeholder:c,size:`sm`,font:`mono`,className:i,onFocus:l,onBlur:u,onChange:d,onKeyDown:n.captureKeybinding}),t[4]=a,t[5]=i,t[6]=n.captureKeybinding,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function nt(e){let t=(0,W.c)(10),{draft:n,variables:r}=e,i,a;t[0]===n?(i=t[1],a=t[2]):(i=e=>n.setDraft({whenDraft:e}),a=e=>n.setDraft({isWhenDraftValid:e}),t[0]=n,t[1]=i,t[2]=a);let o;return t[3]!==n.commandLabelText||t[4]!==n.whenDraft||t[5]!==n.whenDraftExpression||t[6]!==i||t[7]!==a||t[8]!==r?(o=(0,K.jsx)($,{label:n.commandLabelText,expression:n.whenDraftExpression,value:n.whenDraft,variables:r,onChange:i,onValidityChange:a}),t[3]=n.commandLabelText,t[4]=n.whenDraft,t[5]=n.whenDraftExpression,t[6]=i,t[7]=a,t[8]=r,t[9]=o):o=t[9],o}function rt(e){let t=(0,W.c)(9),{isSaving:n,onCancel:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,K.jsx)(l,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:n,"aria-label":`Cancel new keybinding`,onClick:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,K.jsx)(x,{className:`size-3.5`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,K.jsx)(w,{render:i,children:a}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(T,{side:`top`,children:`Cancel`}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,K.jsxs)(E,{children:[o,s]}),t[7]=o,t[8]=c),c}function it(e){let t=(0,W.c)(30),{commandOptions:n,allRows:r,variables:i,isSaving:a,onSave:o,onCancel:s}=e,c;t[0]!==r||t[1]!==o?(c={allRows:r,onSave:o},t[0]=r,t[1]=o,t[2]=c):c=t[2];let u=Qe(c),d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[3]=d):d=t[3];let f;t[4]!==u||t[5]!==i?(f=(0,K.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[d,(0,K.jsx)(nt,{draft:u,variables:i})]}),t[4]=u,t[5]=i,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==u?(p=(0,K.jsx)($e,{draft:u,commandOptions:n,className:`w-56`}),t[7]=n,t[8]=u,t[9]=p):p=t[9];let m;t[10]===u.conflictLabels?m=t[11]:(m=(0,K.jsx)(X,{labels:u.conflictLabels}),t[10]=u.conflictLabels,t[11]=m);let h;t[12]===u?h=t[13]:(h=(0,K.jsx)(tt,{draft:u,className:`w-44`}),t[12]=u,t[13]=h);let g=a||!u.canSave,_=a?`Saving`:`Save`,v;t[14]!==u.save||t[15]!==g||t[16]!==_?(v=(0,K.jsx)(l,{size:`sm`,disabled:g,onClick:u.save,children:_}),t[14]=u.save,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==s?(y=(0,K.jsx)(rt,{isSaving:a,onCancel:s}),t[18]=a,t[19]=s,t[20]=y):y=t[20];let b;t[21]!==p||t[22]!==m||t[23]!==h||t[24]!==v||t[25]!==y?(b=(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[p,m,h,v,y]}),t[21]=p,t[22]=m,t[23]=h,t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;return t[27]!==b||t[28]!==f?(x=(0,K.jsx)(ue,{className:`bg-muted/15`,title:`New keybinding`,description:f,control:b}),t[27]=b,t[28]=f,t[29]=x):x=t[29],x}function at(e){let{groups:t,anchorIds:n,savingCommand:r,...i}=e;return t.map(e=>(0,K.jsx)(fe,{id:`keybindings-${e.id}`,title:e.title,children:e.rows.map(e=>(0,K.jsx)(Ze,{row:e,anchorId:n.get(e.id),isSaving:r===e.command,...i},e.id))},e.id))}function ot(){let e=(0,W.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(E,{children:[(0,K.jsx)(w,{delay:200,render:(0,K.jsx)(l,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first. The desktop app receives them all.`,children:(0,K.jsx)(b,{className:`size-3.5 text-warning`})})}),(0,K.jsx)(T,{side:`top`,className:`max-w-72`,children:`The browser may claim some shortcuts first. The desktop app receives them all.`})]}),e[0]=t):t=e[0],t}function st(){let e=(0,W.c)(83),{environment:t,connectedEnvironments:r}=pe(),i=F(t?.environmentId??null,d),a=L(r,n),o;e[0]!==r||e[1]!==a?(o=r.length>0&&r.every(e=>a.has(e.environmentId)),e[0]=r,e[1]=a,e[2]=o):o=e[2];let s=o,c=t?.serverConfig?.keybindings,u;e[3]===c?u=e[4]:(u=c??[],e[3]=c,e[4]=u);let f;e[5]===u?f=e[6]:(f=p(u),e[5]=u,e[6]=f);let m=f,h=t?.serverConfig?.keybindingsConfigPath??null,_;e[7]===t?.serverConfig?.availableEditors?_=e[8]:(_=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=_);let y=_,b;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(b={reportFailure:!1},e[9]=b):b=e[9];let x=R(P.upsertKeybinding,b),D;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(D={reportFailure:!1},e[10]=D):D=e[10];let O=R(P.removeKeybinding,D),k=Te(t?.environmentId??null,y),[A,j]=(0,G.useState)(``),z=(0,G.useRef)(null),[B,te]=(0,G.useState)(null),[ne,re]=(0,G.useState)(!1),ie;e[11]!==m||e[12]!==A?(ie=xe(m,A),e[11]=m,e[12]=A,e[13]=ie):ie=e[13];let V=ie,ae;e[14]===V?ae=e[15]:(ae=be(V),e[14]=V,e[15]=ae);let oe=ae,se;if(e[16]!==V){se=new Map;let t=new Set;for(let e of V)t.has(e.command)||(t.add(e.command),se.set(e.id,De(e.command)));e[16]=V,e[17]=se}else se=e[17];let ce=se,ue;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(ue={select:ft},e[18]=ue):ue=e[18];let H=M(ue),[me,he]=(0,G.useState)(H);H!==me&&(he(H),H.startsWith(`keybinding-`)&&j(``));let _e;e[19]===m?_e=e[20]:(_e=ye(m),e[19]=m,e[20]=_e);let ve=_e,U;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=ge(),e[21]=U):U=e[21];let Se=U,Ce;e[22]!==h||e[23]!==k||e[24]!==t?(Ce=()=>{h&&t&&I(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await k(h);if(e._tag===`Success`||S(e))return;let t=C(e);N.add({title:`Unable to open keybindings file`,description:t instanceof Error?t.message:`The keybindings file was not opened.`,type:`error`})})()},e[22]=h,e[23]=k,e[24]=t,e[25]=Ce):Ce=e[25];let we=Ce,Oe;e[26]!==r||e[27]!==t||e[28]!==x?(Oe=e=>{if(!t||!r.every(dt))return;te(e.command);let n={command:e.command,key:e.key.trim(),...e.when?.trim()?{when:e.when.trim()}:{},...e.replace?{replace:e.replace}:{}};(async()=>{let e=await Promise.all(r.map(e=>x({environmentId:e.environmentId,input:n})));te(null);let t=e.find(ut);if(!t){re(!1);return}if(!S(t)){let e=C(t);N.add({title:`Unable to save keybinding`,description:e instanceof Error?e.message:`The keybinding was not saved.`,type:`error`})}})()},e[26]=r,e[27]=t,e[28]=x,e[29]=Oe):Oe=e[29];let q=Oe,ke;e[30]!==r||e[31]!==t||e[32]!==O?(ke=e=>{t&&r.every(lt)&&(te(e.command),(async()=>{let t=await Promise.all(r.map(t=>O({environmentId:t.environmentId,input:Ue(e)})));te(null);let n=t.find(ct)??t[0];if(n?._tag===`Failure`&&!S(n)){let e=C(n);N.add({title:`Unable to remove keybinding`,description:e instanceof Error?e.message:`The keybinding was not removed.`,type:`error`})}})())},e[30]=r,e[31]=t,e[32]=O,e[33]=ke):ke=e[33];let je=ke,J;e[34]===q?J=e[35]:(J=e=>{e.defaultKey&&q({command:e.command,key:e.defaultKey,when:e.defaultWhen.trim().length>0?e.defaultWhen:void 0,replace:{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}})},e[34]=q,e[35]=J);let Me=J,Ne;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=()=>re(!1),e[36]=Ne):Ne=e[36];let Pe=Ne,Y;e[37]!==je||e[38]!==Me||e[39]!==V||e[40]!==q?(Y={allRows:V,variables:Se,onSave:q,onReset:Me,onRemove:je},e[37]=je,e[38]=Me,e[39]=V,e[40]=q,e[41]=Y):Y=e[41];let Fe=Y,Ie,Le;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=Ee(`keybindings`),Le=ee?null:(0,K.jsx)(ot,{}),e[42]=Ie,e[43]=Le):(Ie=e[42],Le=e[43]);let X;e[44]===A?X=e[45]:(X=(0,K.jsx)(Ae,{query:A,onChange:j,inputRef:z}),e[44]=A,e[45]=X);let Re=ne||!s,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>re(!0),Be=(0,K.jsx)(v,{"aria-hidden":!0,className:`size-4`}),e[46]=ze,e[47]=Be):(ze=e[46],Be=e[47]);let Z;e[48]===Re?Z=e[49]:(Z=(0,K.jsxs)(l,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Z);let Ve=!h||!i,He;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,K.jsx)(g,{"aria-hidden":!0,className:`size-4`}),e[50]=He):He=e[50];let Q;e[51]!==we||e[52]!==Ve?(Q=(0,K.jsx)(w,{render:(0,K.jsx)(l,{type:`button`,variant:`outline`,size:`icon`,disabled:Ve,onClick:we,"aria-label":`Open keybindings.json`,children:He})}),e[51]=we,e[52]=Ve,e[53]=Q):Q=e[53];let We;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,K.jsx)(T,{side:`top`,children:`Open keybindings.json`}),e[54]=We):We=e[54];let Ge;e[55]===Q?Ge=e[56]:(Ge=(0,K.jsxs)(E,{children:[Q,We]}),e[55]=Q,e[56]=Ge);let $;e[57]!==X||e[58]!==Z||e[59]!==Ge?($=(0,K.jsx)(fe,{...Ie,headerAction:Le,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[X,Z,Ge]})}),e[57]=X,e[58]=Z,e[59]=Ge,e[60]=$):$=e[60];let Ke;e[61]!==s||e[62]!==r?(Ke=s?null:(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r.length===0?`Connect an environment to change keybindings.`:`This connection can view keybindings but cannot change them.`}),e[61]=s,e[62]=r,e[63]=Ke):Ke=e[63];let qe=!s,Je;e[64]!==ve||e[65]!==ne||e[66]!==V||e[67]!==q||e[68]!==B?(Je=ne?(0,K.jsx)(le,{children:(0,K.jsx)(it,{commandOptions:ve,allRows:V,variables:Se,isSaving:B!==null,onSave:q,onCancel:Pe})}):null,e[64]=ve,e[65]=ne,e[66]=V,e[67]=q,e[68]=B,e[69]=Je):Je=e[69];let Ye;e[70]!==ce||e[71]!==oe||e[72]!==Fe||e[73]!==B?(Ye=oe.length>0?(0,K.jsx)(at,{groups:oe,anchorIds:ce,savingCommand:B,...Fe}):(0,K.jsx)(le,{children:(0,K.jsx)(`div`,{className:`px-4 py-12 text-center text-sm text-muted-foreground`,children:`No keybindings match your search.`})}),e[70]=ce,e[71]=oe,e[72]=Fe,e[73]=B,e[74]=Ye):Ye=e[74];let Xe;e[75]!==qe||e[76]!==Je||e[77]!==Ye?(Xe=(0,K.jsxs)(`div`,{inert:qe,className:`flex flex-col gap-8`,children:[Je,Ye]}),e[75]=qe,e[76]=Je,e[77]=Ye,e[78]=Xe):Xe=e[78];let Ze;return e[79]!==$||e[80]!==Ke||e[81]!==Xe?(Ze=(0,K.jsxs)(de,{children:[$,Ke,Xe]}),e[79]=$,e[80]=Ke,e[81]=Xe,e[82]=Ze):Ze=e[82],Ze}function ct(e){return e._tag===`Failure`}function lt(e){return I(e.environmentId,n)}function ut(e){return e._tag===`Failure`}function dt(e){return I(e.environmentId,n)}function ft(e){return e.hash.replace(/^#/,``)}var pt=st;export{pt as component};
2
+ //# sourceMappingURL=settings.keybindings-BHpTOm8T.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{Sx as n,ma as r,or as i}from"./utils-geC9CGP4.js";import{t as a}from"./chevron-right-NbahR9_s.js";import{t as o}from"./external-link-NWS0I_zo.js";import{t as s}from"./search-Cr9eaeTj.js";import{a as c,n as l,t as u}from"./tooltip-Ciaezkl4.js";import{n as d,r as f,t as p}from"./collapsible-CLujF6F7.js";import{n as m,r as h,t as g}from"./input-group-13zF6rZl.js";import{i as _,s as v}from"./settingsLayout-De_r3pyr.js";var y=e(t(),1),b=n();function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function S(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function C(e){if(typeof e!=`string`)return!1;try{let t=new URL(e).protocol;return t===`http:`||t===`https:`}catch{return!1}}function w(e,t){if(!x(e))throw Error(`License entry ${String(t+1)} is not an object.`);if(!S(e.bundles)||e.bundles.length===0||e.kind!==`custom`&&e.kind!==`package`||typeof e.license!=`string`||typeof e.name!=`string`||typeof e.noticeText!=`string`||e.sourceUrl!==null&&!C(e.sourceUrl)||e.version!==null&&typeof e.version!=`string`)throw Error(`License entry ${String(t+1)} has an invalid shape.`);return{bundles:e.bundles,kind:e.kind,license:e.license,name:e.name,noticeText:e.noticeText,sourceUrl:e.sourceUrl,version:e.version}}function T(e){if(!x(e)||e.schemaVersion!==1||!Array.isArray(e.entries))throw Error(`The open-source license manifest has an unsupported format.`);let t=e.entries.map(w),n=new Set;for(let e of t){let t=k(e);if(n.has(t))throw Error(`The open-source license manifest contains a duplicate entry: ${t}`);n.add(t)}return{schemaVersion:1,entries:t}}function E(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0);return n.length===0?e:e.filter(e=>{let t=[e.name,e.version,e.license,...e.bundles].filter(e=>e!==null).join(` `).toLowerCase();return n.every(e=>t.includes(e))})}var D={android:`Android`,assets:`Assets`,desktop:`Desktop`,"device-tools":`Device tools`,ios:`iOS`,mobile:`Mobile`,server:`Server`,web:`Web`};function O(e){return e.map(e=>Object.prototype.hasOwnProperty.call(D,e)?D[e]:e).join(`, `)}function k(e){return encodeURIComponent(JSON.stringify([e.kind,e.name,e.version]))}var A=e(r(),1),j;async function M(){let e=AbortSignal.timeout(3e4);try{let t=await fetch(`${`/`.replace(/\/$/,``)}/third-party-licenses.json`,{signal:e});if(!t.ok)throw Error(`The license manifest request failed with status ${String(t.status)}.`);return T(await t.json())}catch(t){throw e.aborted?Error(`The license manifest took too long to load.`,{cause:t}):t}}function N(){return j??=M().catch(e=>{throw j=void 0,e}),j}function P(e){let t=(0,b.c)(34),{entry:n,open:r,onOpenChange:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,A.jsx)(a,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t[0]=c):c=t[0];let l;t[1]===n.name?l=t[2]:(l=(0,A.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:n.name}),t[1]=n.name,t[2]=l);let u;t[3]===n.version?u=t[4]:(u=n.version?(0,A.jsx)(`code`,{className:`shrink-0 text-xs text-muted-foreground`,children:n.version}):null,t[3]=n.version,t[4]=u);let m;t[5]!==l||t[6]!==u?(m=(0,A.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[l,u]}),t[5]=l,t[6]=u,t[7]=m):m=t[7];let h=n.license,g;t[8]===n.bundles?g=t[9]:(g=O(n.bundles),t[8]=n.bundles,t[9]=g);let _;t[10]!==n.license||t[11]!==g?(_=(0,A.jsxs)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:[h,` · `,g]}),t[10]=n.license,t[11]=g,t[12]=_):_=t[12];let v;t[13]!==m||t[14]!==_?(v=(0,A.jsxs)(f,{className:`group flex min-h-10 min-w-0 flex-1 items-center gap-2.5 px-3 text-left sm:min-h-9 sm:px-4`,children:[c,m,_]}),t[13]=m,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==n.name||t[17]!==n.sourceUrl?(y=n.sourceUrl?(0,A.jsx)(i,{"aria-label":`View project source for ${n.name}`,className:`me-3 shrink-0 sm:me-4`,render:(0,A.jsx)(`a`,{href:n.sourceUrl,rel:`noreferrer noopener`,target:`_blank`}),size:`icon-micro`,title:`Project source`,variant:`ghost-muted`,children:(0,A.jsx)(o,{"aria-hidden":!0,className:`size-3`})}):null,t[16]=n.name,t[17]=n.sourceUrl,t[18]=y):y=t[18];let x;t[19]!==v||t[20]!==y?(x=(0,A.jsxs)(`div`,{className:`flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9`,children:[v,y]}),t[19]=v,t[20]=y,t[21]=x):x=t[21];let S;t[22]!==n.noticeText||t[23]!==r?(S=r?(0,A.jsx)(`div`,{className:`px-9 pt-1 pb-4 sm:px-10`,children:(0,A.jsx)(`pre`,{className:`max-w-[76ch] whitespace-pre-wrap break-words font-mono text-xs/5 text-foreground/80`,children:n.noticeText})}):null,t[22]=n.noticeText,t[23]=r,t[24]=S):S=t[24];let C;t[25]===S?C=t[26]:(C=(0,A.jsx)(d,{children:S}),t[25]=S,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,A.jsxs)(`article`,{children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==s||t[31]!==r||t[32]!==w?(T=(0,A.jsx)(p,{open:r,onOpenChange:s,children:w}),t[30]=s,t[31]=r,t[32]=w,t[33]=T):T=t[33],T}function F(e){let t=(0,b.c)(2),{filteredCount:n,totalCount:r}=e,i=n===r?`${String(r)} notices`:`${String(n)} of ${String(r)}`,a;return t[0]===i?a=t[1]:(a=(0,A.jsx)(`p`,{className:`whitespace-nowrap text-xs font-normal text-muted-foreground tabular-nums`,children:i}),t[0]=i,t[1]=a),a}function I(e){let t=(0,b.c)(34),{query:n,onQueryChange:r,searchOpen:a,onSearchOpenChange:o,filteredCount:d,totalCount:f}=e;if(!a){let e;t[0]!==d||t[1]!==f?(e=(0,A.jsx)(F,{filteredCount:d,totalCount:f}),t[0]=d,t[1]=f,t[2]=e):e=t[2];let n;t[3]===o?n=t[4]:(n=()=>o(!0),t[3]=o,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,A.jsx)(s,{className:`size-3`}),t[5]=r):r=t[5];let a;t[6]===n?a=t[7]:(a=(0,A.jsx)(c,{render:(0,A.jsx)(i,{"aria-label":`Search open-source licenses`,onClick:n,size:`icon-micro`,type:`button`,variant:`ghost-muted`,children:r})}),t[6]=n,t[7]=a);let p;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,A.jsx)(l,{side:`top`,children:`Search licenses`}),t[8]=p):p=t[8];let m;t[9]===a?m=t[10]:(m=(0,A.jsxs)(u,{children:[a,p]}),t[9]=a,t[10]=m);let h;return t[11]!==e||t[12]!==m?(h=(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e,m]}),t[11]=e,t[12]=m,t[13]=h):h=t[13],h}let p;t[14]!==d||t[15]!==f?(p=(0,A.jsx)(`div`,{className:`hidden sm:block`,children:(0,A.jsx)(F,{filteredCount:d,totalCount:f})}),t[14]=d,t[15]=f,t[16]=p):p=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,A.jsx)(m,{children:(0,A.jsx)(s,{"aria-hidden":!0,className:`size-3`})}),t[17]=_):_=t[17];let v;t[18]!==o||t[19]!==n.length?(v=()=>{n.length===0&&o(!1)},t[18]=o,t[19]=n.length,t[20]=v):v=t[20];let y;t[21]===r?y=t[22]:(y=e=>r(e.currentTarget.value),t[21]=r,t[22]=y);let x;t[23]!==r||t[24]!==o?(x=e=>{e.key===`Escape`&&(e.preventDefault(),r(``),o(!1))},t[23]=r,t[24]=o,t[25]=x):x=t[25];let S;t[26]!==n||t[27]!==v||t[28]!==y||t[29]!==x?(S=(0,A.jsxs)(g,{className:`w-36 sm:w-44`,children:[_,(0,A.jsx)(h,{"aria-label":`Search open-source licenses`,autoFocus:!0,onBlur:v,onChange:y,onKeyDown:x,placeholder:`Search licenses`,size:`sm`,type:`search`,value:n})]}),t[26]=n,t[27]=v,t[28]=y,t[29]=x,t[30]=S):S=t[30];let C;return t[31]!==p||t[32]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,S]}),t[31]=p,t[32]=S,t[33]=C):C=t[33],C}function L(e){let t=(0,b.c)(8),{message:n,onRetry:r}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,A.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Open-source notices are unavailable`}),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[a,(0,A.jsx)(`p`,{className:`max-w-[70ch] text-pretty text-xs leading-normal text-muted-foreground/80`,children:n})]}),t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=(0,A.jsx)(i,{type:`button`,size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function R(){let e=(0,b.c)(25),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`loading`},e[0]=t):t=e[0];let[n,r]=(0,y.useState)(t),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=!1;return r({status:`loading`}),N().then(t=>{e||r({status:`ready`,manifest:t})},t=>{e||r({status:`error`,message:t instanceof Error?t.message:`The license manifest could not load.`})}),()=>{e=!0}},e[1]=f):f=e[1];let p;e[2]===u?p=e[3]:(p=[u],e[2]=u,e[3]=p),(0,y.useEffect)(f,p);let m;e[4]!==n.manifest||e[5]!==n.status?(m=n.status===`ready`?n.manifest.entries:[],e[4]=n.manifest,e[5]=n.status,e[6]=m):m=e[6];let h=m,g;e[7]!==h||e[8]!==i?(g=E(h,i),e[7]=h,e[8]=i,e[9]=g):g=e[9];let x=g,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>d(z),e[10]=S):S=e[10];let C=S,w;e[11]!==h||e[12]!==x||e[13]!==i||e[14]!==o||e[15]!==n.status?(w=n.status===`ready`?(0,A.jsx)(I,{query:i,onQueryChange:a,searchOpen:o,onSearchOpenChange:s,filteredCount:x.length,totalCount:h.length}):null,e[11]=h,e[12]=x,e[13]=i,e[14]=o,e[15]=n.status,e[16]=w):w=e[16];let T;e[17]!==x||e[18]!==c||e[19]!==n.message||e[20]!==n.status?(T=n.status===`ready`?(0,A.jsx)(`div`,{className:`text-base sm:text-sm`,children:x.length>0?x.map(e=>{let t=k(e);return(0,A.jsx)(P,{entry:e,open:c===t,onOpenChange:e=>l(e?t:null)},t)}):(0,A.jsx)(`p`,{className:`px-3 py-8 text-center text-sm/6 text-muted-foreground sm:px-4`,children:`No licenses match that search.`})}):n.status===`error`?(0,A.jsx)(L,{message:n.message,onRetry:C}):(0,A.jsx)(`p`,{className:`px-3 py-5 text-sm/6 text-muted-foreground sm:px-4`,children:`Loading open-source notices…`}),e[17]=x,e[18]=c,e[19]=n.message,e[20]=n.status,e[21]=T):T=e[21];let D;return e[22]!==w||e[23]!==T?(D=(0,A.jsx)(_,{children:(0,A.jsx)(v,{title:`Third-party notices`,headerAction:w,children:T})}),e[22]=w,e[23]=T,e[24]=D):D=e[24],D}function z(e){return e+1}var B=R;export{B as component};
2
- //# sourceMappingURL=settings.open-source-licenses-CTznEYnQ.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t}from"./Icon-l19w4AjM.js";import{ma as n,or as r,wx as i}from"./utils-Nv21__t3.js";import{t as a}from"./chevron-right-NbahR9_s.js";import{t as o}from"./external-link-NWS0I_zo.js";import{t as s}from"./search-Cr9eaeTj.js";import{a as c,n as l,t as u}from"./tooltip-CYNXW1Ow.js";import{n as d,r as f,t as p}from"./collapsible-DyaDJVJ5.js";import{n as m,r as h,t as g}from"./input-group-CV0ZpOg5.js";import{i as _,s as v}from"./settingsLayout-DKjAOwp4.js";var y=e(t(),1),b=i();function x(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function S(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function C(e){if(typeof e!=`string`)return!1;try{let t=new URL(e).protocol;return t===`http:`||t===`https:`}catch{return!1}}function w(e,t){if(!x(e))throw Error(`License entry ${String(t+1)} is not an object.`);if(!S(e.bundles)||e.bundles.length===0||e.kind!==`custom`&&e.kind!==`package`||typeof e.license!=`string`||typeof e.name!=`string`||typeof e.noticeText!=`string`||e.sourceUrl!==null&&!C(e.sourceUrl)||e.version!==null&&typeof e.version!=`string`)throw Error(`License entry ${String(t+1)} has an invalid shape.`);return{bundles:e.bundles,kind:e.kind,license:e.license,name:e.name,noticeText:e.noticeText,sourceUrl:e.sourceUrl,version:e.version}}function T(e){if(!x(e)||e.schemaVersion!==1||!Array.isArray(e.entries))throw Error(`The open-source license manifest has an unsupported format.`);let t=e.entries.map(w),n=new Set;for(let e of t){let t=k(e);if(n.has(t))throw Error(`The open-source license manifest contains a duplicate entry: ${t}`);n.add(t)}return{schemaVersion:1,entries:t}}function E(e,t){let n=t.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0);return n.length===0?e:e.filter(e=>{let t=[e.name,e.version,e.license,...e.bundles].filter(e=>e!==null).join(` `).toLowerCase();return n.every(e=>t.includes(e))})}var D={android:`Android`,assets:`Assets`,desktop:`Desktop`,"device-tools":`Device tools`,ios:`iOS`,mobile:`Mobile`,server:`Server`,web:`Web`};function O(e){return e.map(e=>Object.prototype.hasOwnProperty.call(D,e)?D[e]:e).join(`, `)}function k(e){return encodeURIComponent(JSON.stringify([e.kind,e.name,e.version]))}var A=e(n(),1),j;async function M(){let e=AbortSignal.timeout(3e4);try{let t=await fetch(`${`/`.replace(/\/$/,``)}/third-party-licenses.json`,{signal:e});if(!t.ok)throw Error(`The license manifest request failed with status ${String(t.status)}.`);return T(await t.json())}catch(t){throw e.aborted?Error(`The license manifest took too long to load.`,{cause:t}):t}}function N(){return j??=M().catch(e=>{throw j=void 0,e}),j}function P(e){let t=(0,b.c)(34),{entry:n,open:i,onOpenChange:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,A.jsx)(a,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t[0]=c):c=t[0];let l;t[1]===n.name?l=t[2]:(l=(0,A.jsx)(`span`,{className:`truncate font-medium text-foreground`,children:n.name}),t[1]=n.name,t[2]=l);let u;t[3]===n.version?u=t[4]:(u=n.version?(0,A.jsx)(`code`,{className:`shrink-0 text-xs text-muted-foreground`,children:n.version}):null,t[3]=n.version,t[4]=u);let m;t[5]!==l||t[6]!==u?(m=(0,A.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[l,u]}),t[5]=l,t[6]=u,t[7]=m):m=t[7];let h=n.license,g;t[8]===n.bundles?g=t[9]:(g=O(n.bundles),t[8]=n.bundles,t[9]=g);let _;t[10]!==n.license||t[11]!==g?(_=(0,A.jsxs)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:[h,` · `,g]}),t[10]=n.license,t[11]=g,t[12]=_):_=t[12];let v;t[13]!==m||t[14]!==_?(v=(0,A.jsxs)(f,{className:`group flex min-h-10 min-w-0 flex-1 items-center gap-2.5 px-3 text-left sm:min-h-9 sm:px-4`,children:[c,m,_]}),t[13]=m,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==n.name||t[17]!==n.sourceUrl?(y=n.sourceUrl?(0,A.jsx)(r,{"aria-label":`View project source for ${n.name}`,className:`me-3 shrink-0 sm:me-4`,render:(0,A.jsx)(`a`,{href:n.sourceUrl,rel:`noreferrer noopener`,target:`_blank`}),size:`icon-micro`,title:`Project source`,variant:`ghost-muted`,children:(0,A.jsx)(o,{"aria-hidden":!0,className:`size-3`})}):null,t[16]=n.name,t[17]=n.sourceUrl,t[18]=y):y=t[18];let x;t[19]!==v||t[20]!==y?(x=(0,A.jsxs)(`div`,{className:`flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9`,children:[v,y]}),t[19]=v,t[20]=y,t[21]=x):x=t[21];let S;t[22]!==n.noticeText||t[23]!==i?(S=i?(0,A.jsx)(`div`,{className:`px-9 pt-1 pb-4 sm:px-10`,children:(0,A.jsx)(`pre`,{className:`max-w-[76ch] whitespace-pre-wrap break-words font-mono text-xs/5 text-foreground/80`,children:n.noticeText})}):null,t[22]=n.noticeText,t[23]=i,t[24]=S):S=t[24];let C;t[25]===S?C=t[26]:(C=(0,A.jsx)(d,{children:S}),t[25]=S,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,A.jsxs)(`article`,{children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==s||t[31]!==i||t[32]!==w?(T=(0,A.jsx)(p,{open:i,onOpenChange:s,children:w}),t[30]=s,t[31]=i,t[32]=w,t[33]=T):T=t[33],T}function F(e){let t=(0,b.c)(2),{filteredCount:n,totalCount:r}=e,i=n===r?`${String(r)} notices`:`${String(n)} of ${String(r)}`,a;return t[0]===i?a=t[1]:(a=(0,A.jsx)(`p`,{className:`whitespace-nowrap text-xs font-normal text-muted-foreground tabular-nums`,children:i}),t[0]=i,t[1]=a),a}function I(e){let t=(0,b.c)(34),{query:n,onQueryChange:i,searchOpen:a,onSearchOpenChange:o,filteredCount:d,totalCount:f}=e;if(!a){let e;t[0]!==d||t[1]!==f?(e=(0,A.jsx)(F,{filteredCount:d,totalCount:f}),t[0]=d,t[1]=f,t[2]=e):e=t[2];let n;t[3]===o?n=t[4]:(n=()=>o(!0),t[3]=o,t[4]=n);let i;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(s,{className:`size-3`}),t[5]=i):i=t[5];let a;t[6]===n?a=t[7]:(a=(0,A.jsx)(c,{render:(0,A.jsx)(r,{"aria-label":`Search open-source licenses`,onClick:n,size:`icon-micro`,type:`button`,variant:`ghost-muted`,children:i})}),t[6]=n,t[7]=a);let p;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,A.jsx)(l,{side:`top`,children:`Search licenses`}),t[8]=p):p=t[8];let m;t[9]===a?m=t[10]:(m=(0,A.jsxs)(u,{children:[a,p]}),t[9]=a,t[10]=m);let h;return t[11]!==e||t[12]!==m?(h=(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e,m]}),t[11]=e,t[12]=m,t[13]=h):h=t[13],h}let p;t[14]!==d||t[15]!==f?(p=(0,A.jsx)(`div`,{className:`hidden sm:block`,children:(0,A.jsx)(F,{filteredCount:d,totalCount:f})}),t[14]=d,t[15]=f,t[16]=p):p=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,A.jsx)(m,{children:(0,A.jsx)(s,{"aria-hidden":!0,className:`size-3`})}),t[17]=_):_=t[17];let v;t[18]!==o||t[19]!==n.length?(v=()=>{n.length===0&&o(!1)},t[18]=o,t[19]=n.length,t[20]=v):v=t[20];let y;t[21]===i?y=t[22]:(y=e=>i(e.currentTarget.value),t[21]=i,t[22]=y);let x;t[23]!==i||t[24]!==o?(x=e=>{e.key===`Escape`&&(e.preventDefault(),i(``),o(!1))},t[23]=i,t[24]=o,t[25]=x):x=t[25];let S;t[26]!==n||t[27]!==v||t[28]!==y||t[29]!==x?(S=(0,A.jsxs)(g,{className:`w-36 sm:w-44`,children:[_,(0,A.jsx)(h,{"aria-label":`Search open-source licenses`,autoFocus:!0,onBlur:v,onChange:y,onKeyDown:x,placeholder:`Search licenses`,size:`sm`,type:`search`,value:n})]}),t[26]=n,t[27]=v,t[28]=y,t[29]=x,t[30]=S):S=t[30];let C;return t[31]!==p||t[32]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,S]}),t[31]=p,t[32]=S,t[33]=C):C=t[33],C}function L(e){let t=(0,b.c)(8),{message:n,onRetry:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,A.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Open-source notices are unavailable`}),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[a,(0,A.jsx)(`p`,{className:`max-w-[70ch] text-pretty text-xs leading-normal text-muted-foreground/80`,children:n})]}),t[1]=n,t[2]=o);let s;t[3]===i?s=t[4]:(s=(0,A.jsx)(r,{type:`button`,size:`xs`,variant:`outline`,onClick:i,children:`Try again`}),t[3]=i,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function R(){let e=(0,b.c)(25),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`loading`},e[0]=t):t=e[0];let[n,r]=(0,y.useState)(t),[i,a]=(0,y.useState)(``),[o,s]=(0,y.useState)(!1),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(0),f;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=!1;return r({status:`loading`}),N().then(t=>{e||r({status:`ready`,manifest:t})},t=>{e||r({status:`error`,message:t instanceof Error?t.message:`The license manifest could not load.`})}),()=>{e=!0}},e[1]=f):f=e[1];let p;e[2]===u?p=e[3]:(p=[u],e[2]=u,e[3]=p),(0,y.useEffect)(f,p);let m;e[4]!==n.manifest||e[5]!==n.status?(m=n.status===`ready`?n.manifest.entries:[],e[4]=n.manifest,e[5]=n.status,e[6]=m):m=e[6];let h=m,g;e[7]!==h||e[8]!==i?(g=E(h,i),e[7]=h,e[8]=i,e[9]=g):g=e[9];let x=g,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>d(z),e[10]=S):S=e[10];let C=S,w;e[11]!==h||e[12]!==x||e[13]!==i||e[14]!==o||e[15]!==n.status?(w=n.status===`ready`?(0,A.jsx)(I,{query:i,onQueryChange:a,searchOpen:o,onSearchOpenChange:s,filteredCount:x.length,totalCount:h.length}):null,e[11]=h,e[12]=x,e[13]=i,e[14]=o,e[15]=n.status,e[16]=w):w=e[16];let T;e[17]!==x||e[18]!==c||e[19]!==n.message||e[20]!==n.status?(T=n.status===`ready`?(0,A.jsx)(`div`,{className:`text-base sm:text-sm`,children:x.length>0?x.map(e=>{let t=k(e);return(0,A.jsx)(P,{entry:e,open:c===t,onOpenChange:e=>l(e?t:null)},t)}):(0,A.jsx)(`p`,{className:`px-3 py-8 text-center text-sm/6 text-muted-foreground sm:px-4`,children:`No licenses match that search.`})}):n.status===`error`?(0,A.jsx)(L,{message:n.message,onRetry:C}):(0,A.jsx)(`p`,{className:`px-3 py-5 text-sm/6 text-muted-foreground sm:px-4`,children:`Loading open-source notices…`}),e[17]=x,e[18]=c,e[19]=n.message,e[20]=n.status,e[21]=T):T=e[21];let D;return e[22]!==w||e[23]!==T?(D=(0,A.jsx)(_,{children:(0,A.jsx)(v,{title:`Third-party notices`,headerAction:w,children:T})}),e[22]=w,e[23]=T,e[24]=D):D=e[24],D}function z(e){return e+1}var B=R;export{B as component};
2
+ //# sourceMappingURL=settings.open-source-licenses-Dlp4u1NR.js.map
@@ -0,0 +1,4 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectIconPickerDialog-yxBKY_6V.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/Icon-l19w4AjM.js","assets/utils-Nv21__t3.js","assets/brain-B_3rxsLd.js","assets/createLucideIcon-CacG5mZC.js","assets/check-Cmy7pM2Y.js","assets/chevron-down-DHV04o66.js","assets/chevron-right-NbahR9_s.js","assets/toggle-group-B1ghB_yR.js","assets/CompositeRoot-Dz15SC7i.js","assets/toggle-DOFhC9C7.js","assets/input-CN9xdIYL.js","assets/FieldControl-DuWupdaP.js","assets/useRegisterFieldControl-QWoLGfik.js","assets/scroll-area-CRoS-lxP.js","assets/CSPContext-5fUBIm56.js","assets/dialog-C5PVc2Dc.js","assets/x-CSwbgjBe.js","assets/DialogTitle-CdRWiE23.js","assets/ProjectMonogram-Dd6xeLhS.js","assets/dynamic-COZhF9Vt.js","assets/index-TkyxWt2Q.js"])))=>i.map(i=>d[i]);
2
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./index-TkyxWt2Q.js";import{r as n}from"./Icon-l19w4AjM.js";import{Af as r,E as i,If as a,Jn as o,Kn as s,Ls as c,Rs as l,Tm as u,Vo as d,Vv as f,Wn as p,Xn as m,ar as h,er as g,gc as _,ma as v,n as y,or as b,os as x,ps as S,qn as C,r as w,rn as T,wf as E,wx as D}from"./utils-Nv21__t3.js";import{t as ee}from"./chevron-down-DHV04o66.js";import{t as te}from"./info-BHB-83EA.js";import{t as ne}from"./plus-Cr075-cy.js";import{t as O}from"./trash-2-CiyAV2xI.js";import{H as k,L as re,R as A,U as ie}from"./runtime-CxeCZPZ3.js";import{C as j,P as M,W as N,k as P}from"./entities-B0tFBQjY.js";import{yn as F}from"./runtime-C9evwoB9.js";import{t as I}from"./useNavigate-DfvN7ISg.js";import{t as L}from"./useLocation-yjRHv-GS.js";import{i as R}from"./toast-B-l3XS_F.js";import{E as ae,J as z,K as B,O as V}from"./useSettings-C1hmCYRR.js";import{f as H,s as U}from"./server-BBIVfjrf.js";import{n as W,o as G}from"./session-DZH3pyoG.js";import{t as K}from"./use-atom-command-DdGPgtPS.js";import{n as q}from"./toastHelpers-Dsph6LwL.js";import{i as J,o as Y,r as X}from"./command-CBIpuXFt.js";import{t as oe}from"./input-CN9xdIYL.js";import{A as se,D as ce,E as le,T as ue,v as de}from"./keybindings-C81QSEVL.js";import{t as fe}from"./PierreEntryIcon-uqPwKknu.js";import{t as pe}from"./ProjectFavicon-CDpXbAhP.js";import{u as me}from"./projectFilesQueryState-DmDFr3yJ.js";import{n as he}from"./p4ProjectFile-DH7qoFHx.js";import{r as ge,t as _e}from"./alert-B49R80NU.js";import{F as ve,V as ye,a as Z,i as be,r as xe,s as Se,z as Ce}from"./settingsLayout-DKjAOwp4.js";import{Ei as we,Ga as Te,Sn as Ee,bn as De,pi as Oe,pn as ke}from"./main-CJvawsJJ.js";import{c as Ae,f as je,i as Me,n as Ne,o as Pe,r as Fe,s as Ie,t as Le}from"./projectScriptEditor-DxxYqdMP.js";import{t as Re}from"./ProjectDefaultsSettings-DglkVzkM.js";import{t as ze}from"./SettingsScopeNotice-um2bOG_J.js";var Be=D(),Q=e(n(),1),$=e(v(),1);function Ve(e,t,n){return t||(n?e.trim()?`Searching project files…`:`Indexing project files…`:e.trim()?`No matching image files.`:`No image files found.`)}function He(e,t){return!w(t)||F(e)}function Ue(e){let[t,n]=(0,Q.useState)(``),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(!1),s=me(e.environmentId,e.cwd,t,200,{imageOnly:!0}),{resolvedTheme:c}=B(),l=d(U),u=e.onPickExternal,f=y(typeof navigator>`u`?``:navigator.platform),p=(0,Q.useMemo)(()=>ke(s.entries,s.matchedQuery).map(t=>({kind:`action`,value:`project-favicon:${t.path}`,searchTerms:[t.name,t.path],title:t.name,description:t.path,icon:(0,$.jsx)(fe,{pathValue:t.path,kind:`file`,theme:c}),run:async()=>e.onSelect(t.path)})),[e.onSelect,c,s.entries,s.matchedQuery]);return(0,$.jsx)(X,{open:e.open,onOpenChange:e.onOpenChange,children:e.open?(0,$.jsx)(J,{"aria-label":`Choose project icon`,className:`overflow-hidden`,onBackdropPointerDown:()=>e.onOpenChange(!1),children:(0,$.jsx)(Ee,{"aria-label":`Choose project icon`,autoHighlight:`always`,escapeLabel:`Close`,footerActionLabel:`Select icon`,footerTrailing:u?(0,$.jsx)(Y,{disabled:a,onClick:()=>{o(!0),u().then(t=>{t&&(e.onOpenChange(!1),e.onSelect(t))}).catch(e=>{R.add({type:`error`,title:`Could not open image picker`,description:e instanceof Error?e.message:`An error occurred.`})}).finally(()=>o(!1))},children:`Open in ${f}`}):null,inputProps:{placeholder:`Search image files…`},mode:`none`,onItemHighlighted:e=>{i(typeof e==`string`?e:null)},onValueChange:e=>{i(null),n(e)},panelSize:`tall-list`,testId:`project-favicon-picker`,value:t,children:(0,$.jsx)(De,{groups:p.length>0?[{value:`project-favicon-files`,label:e.projectName,items:p}]:[],highlightedItemValue:r,isActionsOnly:!1,keybindings:l,onExecuteItem:t=>{t.kind===`action`&&(e.onOpenChange(!1),t.run())},emptyStateMessage:Ve(t,s.error,s.isPending)})})}):null})}function We(e){let t=(0,Be.c)(10),{scripts:n,keybindings:r,disabled:i,onEdit:a}=e;if(n.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`px-3 py-2 text-base text-muted-foreground sm:px-4 sm:text-sm`,children:`No actions configured.`}),t[0]=e):e=t[0],e}let o;if(t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==n){let e;t[6]!==i||t[7]!==r||t[8]!==a?(e=e=>{let t=de(r,le(e.id));return(0,$.jsx)(Z,{className:`group py-2`,title:(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Fe,{icon:e.icon,className:`size-4 shrink-0 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),e.runOnWorktreeCreate?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`setup`}):null,e.runOnSettle?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground`,children:`on settle`}):null,e.previewUrl?(0,$.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/60 px-1.5 py-px text-2xs font-normal text-muted-foreground max-sm:hidden`,children:`preview · desktop only`}):null]}),description:(0,$.jsx)(`code`,{className:`block max-w-full truncate font-mono`,children:e.command}),control:(0,$.jsxs)($.Fragment,{children:[t?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t}):null,(0,$.jsx)(`span`,{className:`flex shrink-0 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,$.jsx)(b,{size:`icon-xs`,variant:`ghost-muted`,"aria-label":`Edit ${e.name}`,disabled:i,onClick:()=>a(e),children:(0,$.jsx)(Te,{className:`size-3.5`})})})]})},e.id)},t[6]=i,t[7]=r,t[8]=a,t[9]=e):e=t[9],o=n.map(e),t[1]=i,t[2]=r,t[3]=a,t[4]=n,t[5]=o}else o=t[5];return o}function Ge(e){if(e._tag===`Failure`&&!re(e)){let t=ie(e);R.add({type:`error`,title:`Failed to save project actions`,description:t instanceof Error?t.message:`An error occurred.`})}return A(e,()=>void 0)}function Ke(e){let t=j(),[n,i]=(0,Q.useState)(!1),o=(0,Q.useRef)(!1),s=K(H.updateSettings,`project actions update`),c=K(H.upsertKeybinding,`action shortcut update`),l=K(H.removeKeybinding,`action shortcut removal`);async function u(n,u,d){if(o.current||e.length===0){let e=`No available machine, or another action change is saving.`;return R.add({type:`error`,title:`Actions not saved`,description:e}),x(f(Error(e)))}if(e.some(({environmentId:e})=>!W(e,`settings:write`)))return Ge(x(f(new a({requiredScope:r,message:`This connection cannot change environment settings.`}))));o.current=!0,i(!0);try{for(let{environmentId:r,settings:i,keybindings:a,project:o}of e){let e=o?je(i,o):i.defaultProjectScripts,f=n(e),p=f??i.defaultProjectScripts,m=await s({environmentId:r,input:{patch:o?{projectSettingsOverrides:{[o.id]:f===null?he(i,o.id,[`defaultProjectScripts`]):{...i.projectSettingsOverrides[o.id],defaultProjectScripts:f}}}:{defaultProjectScripts:f??[]}}});if(m._tag===`Failure`)return Ge(m);let h=u?[u]:e.filter(e=>!p.some(t=>t.id===e.id)).map(e=>e.id);for(let e of h){let n=le(e),s=Ae(a,n),u=s?Ie({keybinding:s,command:n}):null,p=Ie({keybinding:d,command:n}),m=!f?.some(t=>t.id===e)&&(o&&i.defaultProjectScripts.some(t=>t.id===e)||Object.entries(i.projectSettingsOverrides).some(([t,n])=>t!==o?.id&&n.defaultProjectScripts?.some(t=>t.id===e))||t.some(t=>t.environmentId===r&&t.id!==o?.id&&(o?je(i,t):t.scripts).some(t=>t.id===e))),h=p?await c({environmentId:r,input:u&&u.key!==p.key?{...p,replace:u}:p}):u&&!m?await l({environmentId:r,input:u}):null;if(h?._tag===`Failure`)return Ge(h)}}return S(void 0)}finally{o.current=!1,i(!1)}}function d(n,r){let i=[...t.flatMap(e=>e.scripts.map(e=>e.id)),...e.flatMap(({settings:e,project:t})=>[...e.defaultProjectScripts,...Object.values(e.projectSettingsOverrides).flatMap(e=>e.defaultProjectScripts??[]),...t?.scripts??[]].map(e=>e.id))],a=n??ce(r.name,i),o=ue(a,r);return u(e=>{let t=e.map(e=>e.id===a?o:se(e,r));return n===null?[...t,o]:t},a,r.keybinding)}return{saving:n,persist:u,submit:d}}function qe(){let e=(0,Be.c)(67),{scope:t,targets:n,target:r}=Ce(),{environments:i}=ae(),a=t.kind===`project`||t.kind===`checkout`,c;e[0]!==i||e[1]!==r?(c=r?i.find(e=>e.environmentId===r.environmentId)?.serverConfig:void 0,e[0]=i,e[1]=r,e[2]=c):c=e[2];let l=c,d;e[3]===r?.settings.defaultProjectScripts?d=e[4]:(d=r?.settings.defaultProjectScripts??[],e[3]=r?.settings.defaultProjectScripts,e[4]=d);let f=d,v=l?.keybindings??_,y;if(e[5]!==f||e[6]!==n){let t;e[8]===f?t=e[9]:(t=e=>JSON.stringify(e.settings.defaultProjectScripts)!==JSON.stringify(f),e[8]=f,e[9]=t),y=n.some(t),e[5]=f,e[6]=n,e[7]=y}else y=e[7];let x=y,S=ve(),[w,T]=(0,Q.useState)(null),E,D,te;e[10]!==i||e[11]!==a||e[12]!==t.members||e[13]!==n?(E=new Map(a?t.members.map(Ye):[]),D=Ke,te=n.flatMap(e=>{let t=i.find(t=>t.environmentId===e.environmentId);if(!t?.serverConfig)return[];let n=e.projectId?E.get(e.projectId):void 0;return n&&t.serverConfig.environment?.capabilities.projectSettingsOverrides!==!0?[]:[{environmentId:e.environmentId,settings:t.serverConfig.settings,keybindings:t.serverConfig.keybindings,...n?{project:n}:{}}]}),e[10]=i,e[11]=a,e[12]=t.members,e[13]=n,e[14]=E,e[15]=D,e[16]=te):(E=e[14],D=e[15],te=e[16]);let{saving:O,persist:k,submit:A}=D(te),j;e[17]!==E||e[18]!==r?(j=r?.projectId?E.get(r.projectId):void 0,e[17]=E,e[18]=r,e[19]=j):j=e[19];let M=j,N;e[20]===M?.environmentId?N=e[21]:(N=M?.environmentId??u.make(`none`),e[20]=M?.environmentId,e[21]=N);let P=Pe(N,M?.workspaceRoot??null),F;if(e[22]!==f||e[23]!==P.scripts){let t;e[25]===f?t=e[26]:(t=e=>!f.some(t=>t.command===e.command||t.name.toLowerCase()===e.name.toLowerCase()),e[25]=f,e[26]=t),F=P.scripts.filter(t),e[22]=f,e[23]=P.scripts,e[24]=F}else F=e[24];let I=F,L;e[27]===A?L=e[28]:(L=async e=>{let t={name:e.name,command:e.command,icon:e.icon??`play`,runOnWorktreeCreate:e.runOnWorktreeCreate??!1,waitForSetup:e.runOnWorktreeCreate===!0&&e.async===!1,runOnSettle:e.runOnSettle??!1,keybinding:null,previewUrl:e.previewUrl??null,autoOpenPreview:e.previewUrl?e.autoOpenPreview??!1:!1},n=await A(null,t);if(n._tag===`Failure`&&!re(n)){let e=ie(n);T({scriptId:null,initial:t,error:e instanceof Error?e.message:`Failed to import action.`})}},e[27]=A,e[28]=L);let R=L,z;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(z=[`defaultProjectScripts`],e[29]=z):z=e[29];let B;e[30]===k?B=e[31]:(B=()=>void k(Je),e[30]=k,e[31]=B);let V;e[32]!==S||e[33]!==R||e[34]!==I||e[35]!==O?(V=I.length>0?(0,$.jsxs)(p,{children:[(0,$.jsxs)(h,{render:(0,$.jsx)(b,{id:`import-scripts`,size:`xs`,variant:`ghost`,disabled:O||!S,type:`button`}),children:[`Import scripts`,(0,$.jsx)(ee,{className:`size-3.5`})]}),(0,$.jsxs)(m,{align:`end`,children:[(0,$.jsxs)(s,{children:[(0,$.jsx)(C,{children:`Import from p4.json`}),(0,$.jsx)(`p`,{className:`px-2 pb-2 text-pretty text-sm text-muted-foreground`,children:`Add actions declared by this checkout without editing them first.`})]}),(0,$.jsx)(g,{}),I.map(e=>(0,$.jsxs)(o,{onClick:()=>void R(e),children:[(0,$.jsx)(Fe,{icon:e.icon??`play`,className:`size-4 shrink-0`}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate font-medium`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-muted-foreground`,children:e.command})]})]},`${e.name} ${e.command}`))]})]}):null,e[32]=S,e[33]=R,e[34]=I,e[35]=O,e[36]=V):V=e[36];let H=O||!S||n.length===0,U,W;e[37]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>T({scriptId:null,initial:Le}),W=(0,$.jsx)(ne,{className:`size-3.5`}),e[37]=U,e[38]=W):(U=e[37],W=e[38]);let G;e[39]===H?G=e[40]:(G=(0,$.jsxs)(b,{size:`xs`,variant:`outline`,disabled:H,onClick:U,children:[W,`Add action`]}),e[39]=H,e[40]=G);let K;e[41]!==V||e[42]!==G?(K=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[V,G]}),e[41]=V,e[42]=G,e[43]=K):K=e[43];let q;e[44]!==x||e[45]!==B||e[46]!==K?(q=(0,$.jsx)(Z,{serverScoped:!0,settingKeys:z,mixed:x,title:`Actions`,description:`Commands that run in this project's checkout or its worktree, with optional shortcuts.`,onResetOverride:B,control:K}),e[44]=x,e[45]=B,e[46]=K,e[47]=q):q=e[47];let J;e[48]!==S||e[49]!==v||e[50]!==x||e[51]!==O||e[52]!==f?(J=x?(0,$.jsx)(Z,{title:`Different actions across environments`,description:`Choose one environment to edit its list. Adding an action here adds it on every selected environment.`}):(0,$.jsx)(We,{scripts:f,keybindings:v,disabled:O||!S,onEdit:e=>T(Me(e,v))}),e[48]=S,e[49]=v,e[50]=x,e[51]=O,e[52]=f,e[53]=J):J=e[53];let Y;e[54]===P.status?Y=e[55]:(Y=P.status===`invalid`?(0,$.jsx)(Z,{title:`p4.json is invalid`,description:`A p4.json exists in this checkout but fails to parse, so every action and icon it declares is ignored. Check the JSON syntax and icon values.`,className:`text-warning`}):null,e[54]=P.status,e[55]=Y);let X;e[56]!==k||e[57]!==w||e[58]!==f||e[59]!==A||e[60]!==r?(X=r&&(0,$.jsx)(Ne,{environmentId:r.environmentId,editScope:`settings:write`,request:w,scripts:f,onSubmit:A,onDelete:e=>void k(t=>t.filter(t=>t.id!==e),e,null),onClose:()=>T(null)}),e[56]=k,e[57]=w,e[58]=f,e[59]=A,e[60]=r,e[61]=X):X=e[61];let oe;return e[62]!==q||e[63]!==J||e[64]!==Y||e[65]!==X?(oe=(0,$.jsxs)(Se,{id:`project-actions`,title:`Actions`,children:[q,J,Y,X]}),e[62]=q,e[63]=J,e[64]=Y,e[65]=X,e[66]=oe):oe=e[66],oe}function Je(){return null}function Ye(e){return[e.id,e]}function Xe(e,t,n){return n&&e.some(e=>e!==t)}var Ze=(0,Q.lazy)(()=>t(()=>import(`./ProjectIconPickerDialog-yxBKY_6V.js`).then(e=>({default:e.ProjectIconPickerDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22])));function Qe(e){return`${e.environmentId}:${e.id}`}function $e(e){let t=(0,Be.c)(34),{projectKey:n,environmentId:r,checkoutKey:i}=e,a=r===void 0?null:r,o=i===void 0?null:i,s=ye(),c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={from:`/settings`},t[0]=c):c=t[0];let l=I(c),u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u={select:tt},t[1]=u):u=t[1];let d=L(u),f;t[2]!==s||t[3]!==n?(f=s.find(e=>e.projectKey===n)??null,t[2]=s,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]!==o||t[6]!==a||t[7]!==p?.memberProjects?(m=p?.memberProjects.filter(e=>(a===null||e.environmentId===a)&&(o===null||e.physicalProjectKey===o))??[],t[5]=o,t[6]=a,t[7]=p?.memberProjects,t[8]=m):m=t[8];let h=m,g=(0,Q.useRef)(null),_,v;t[9]!==o||t[10]!==a||t[11]!==h||t[12]!==p?(_=()=>{p&&h.length!==0&&(g.current={key:p.projectKey,environmentId:a,checkoutKey:o,memberKeys:h.map(et)})},v=[p,h,a,o],t[9]=o,t[10]=a,t[11]=h,t[12]=p,t[13]=_,t[14]=v):(_=t[13],v=t[14]),(0,Q.useEffect)(_,v);let y,b;if(t[15]!==o||t[16]!==a||t[17]!==s||t[18]!==h.length||t[19]!==l||t[20]!==d||t[21]!==n?(b=()=>{if(h.length>0)return;let e=g.current;if(e?.key!==n||e.environmentId!==a||e.checkoutKey!==o)return;let t=s.find(t=>t.memberProjects.some(t=>e.memberKeys.includes(t.physicalProjectKey)));t&&l({to:d,search:()=>({project:t.projectKey,machine:a??void 0,checkout:o??void 0}),replace:!0,hashScrollIntoView:!1})},y=[s,l,d,n,h.length,a,o],t[15]=o,t[16]=a,t[17]=s,t[18]=h.length,t[19]=l,t[20]=d,t[21]=n,t[22]=y,t[23]=b):(y=t[22],b=t[23]),(0,Q.useEffect)(b,y),!p){let e=s.length===0?`Add a project from the sidebar to configure it here.`:`This project is no longer available.`,n;return t[24]===e?n=t[25]:(n=(0,$.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-sm text-muted-foreground`,children:e}),t[24]=e,t[25]=n),n}if(h.length===0){let e;return t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`p`,{className:`p-8 text-sm text-muted-foreground`,children:`This checkout is no longer available in the selected project and environment.`}),t[26]=e):e=t[26],e}let x;t[27]!==h||t[28]!==p?(x={...p,memberProjects:h,environmentId:h[0].environmentId,id:h[0].id},t[27]=h,t[28]=p,t[29]=x):x=t[29];let S=x,C=`${p.projectKey}:${a??`all`}:${o??`all`}`,w=h.length<p.memberProjects.length,T;return t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,$.jsx)(nt,{group:S,hasOtherMembers:w},C),t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}function et(e){return e.physicalProjectKey}function tt(e){return e.pathname}function nt({group:e,hasOtherMembers:t}){let n=I({from:`/settings`}),r=V(),{environments:a}=ae(),o=(0,Q.useMemo)(()=>new Map(a.map(e=>[e.environmentId,e])),[a]),s=G(e.memberProjects,E),u=e.memberProjects.every(e=>s.has(e.environmentId)),d=e.memberProjects.find(e=>o.get(e.environmentId)?.serverConfig!=null)??e.memberProjects[0],p=P(),m=we(N.update,{reportFailure:!1}),h=we(N.delete,{reportFailure:!1}),g=(0,Q.useRef)(!1),_=d.faviconPath??null,v=d.projectIcon??null,y=typeof window<`u`&&e.memberProjects.every(e=>e.environmentId===r&&He(e.workspaceRoot,navigator.platform))?window.desktopBridge?.pickProjectFavicon:void 0,C=(0,Q.useCallback)((e,t)=>{if(t._tag!==`Failure`||re(t))return;let n=ie(t);R.add(q({type:`error`,title:e,description:n instanceof Error?n.message:`An error occurred.`}))},[]),w=(0,Q.useCallback)((e,t)=>{let n=e.find(e=>!W(e.environmentId,E));if(!n)return null;let r=x(f(Error(`This connection cannot change projects in ${n.environmentLabel??`this environment`}.`)));return C(t,r),r},[C]),D=(0,Q.useCallback)(async(t,n)=>{let r=w(e.memberProjects,n);if(r)return r;let i=e.memberProjects.find(e=>{let t=o.get(e.environmentId);return t?.connection.phase!==`connected`||!t.serverConfig});if(i){let e=Error(`Connect ${i.environmentLabel??`the selected environment`} and try again.`),t=x(f(e));return C(n,t),t}for(let r of e.memberProjects){let i=w([r],n);if(i)return i;let a=A(await m({environmentId:r.environmentId,input:{projectId:r.id,...t}}),()=>void 0);if(a._tag===`Failure`)return C(e.memberProjects.length>1?`${n} on ${r.environmentLabel??`the current environment`}`:n,a),a}return S(void 0)},[w,o,e.memberProjects,C,m]),ee=(0,Q.useCallback)(async(t,n)=>{let r=t.trim();if(!r){R.add({type:`warning`,title:`Project title cannot be empty`});return}Xe(e.memberProjects.map(e=>e.title),r,n)&&await D({title:r},`Failed to rename project`)},[e.memberProjects,D]),[ne,j]=T(!u),[F,L]=T(!u),[B,H]=(0,Q.useState)(!1),U=(0,Q.useRef)(!1),K=(0,Q.useCallback)(async e=>{if(!U.current){U.current=!0,H(!0);try{await D(e,`Failed to update project icon`)}finally{U.current=!1,H(!1)}}},[D]),J=e.memberProjects.length>1,Y=(0,Q.useCallback)(async r=>{if(w(r,`Failed to remove project`))return;let a=z();if(!a)return;let o=new Set(r.map(Qe)),s=p.filter(e=>o.has(`${e.environmentId}:${e.projectId}`)),u=r.length===e.memberProjects.length,d=t||!u?`checkout`:`project`,f=r.length===1?r[0]:null,m=f?.title??e.displayName,g=await k(()=>a.dialogs.confirm([s.length>0?`Remove ${d} "${m}" and delete its ${s.length} thread${s.length===1?``:`s`}?`:`Remove ${d} "${m}"?`,...f?[`Path: ${f.workspaceRoot}`,...f.environmentLabel?[`Environment: ${f.environmentLabel}`]:[]]:[`This removes ${r.length} grouped project entries.`],...s.length>0?[`This permanently clears conversation history for those threads and any archived threads.`]:[`This permanently clears any archived conversation history.`],u&&!t?`This removes only the project entries, not the files on disk.`:`Other entries in this grouped project are unaffected.`,`This action cannot be undone.`].join(`
3
+ `),{variant:`destructive`}));if(g._tag===`Failure`||!g.value||w(r,`Failed to remove project`))return;let _=i.getState();for(let e of r){if(w([e],`Failed to remove project`))return;let t=s.filter(t=>t.environmentId===e.environmentId&&t.projectId===e.id),n=A(await h({environmentId:e.environmentId,input:{projectId:e.id,force:!0}}),()=>void 0);if(n._tag===`Failure`){C(`Failed to remove "${e.title}"`,n);return}let r=c(e.environmentId,e.id);await M(r),Oe(r,t.map(e=>l(e.environmentId,e.id)));let i=_.getDraftThreadByProjectRef(r);i&&_.clearDraftThread(i.draftId),_.clearProjectDraftThreadId(r)}u&&!t&&n({to:`/`,replace:!0})},[w,h,e.displayName,e.memberProjects.length,t,n,C,p]),X=(0,$.jsx)(Se,{title:`Checkouts`,children:e.memberProjects.map(e=>(0,$.jsx)(Z,{title:e.environmentLabel??`Environment`,description:e.workspaceRoot,control:(0,$.jsx)(b,{size:`sm`,variant:`outline`,disabled:!s.has(e.environmentId),onClick:()=>void Y([e]),"aria-label":`Remove checkout ${e.workspaceRoot}`,children:`Remove`})},e.physicalProjectKey))});return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(be,{className:`gap-6`,children:[(0,$.jsxs)(_e,{variant:`info`,children:[(0,$.jsx)(te,{"aria-hidden":!0}),(0,$.jsx)(ge,{children:`Can't find a setting? Keep this project picked above and hop to any other settings page.`})]}),(0,$.jsxs)(Se,{id:`project-overview`,title:`Project`,hideTitle:!0,children:[u?null:(0,$.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted-foreground sm:px-4`,children:e.memberProjects.length>1?`Shared settings require permission to change every checkout in this group.`:`This connection cannot change this project.`}),(0,$.jsx)(Z,{title:`Name`,description:`The shared name for this project group in the sidebar and thread lists.`,control:(0,$.jsx)(oe,{size:`sm`,className:`w-full sm:w-64`,"aria-label":`Project name`,disabled:!u,defaultValue:e.displayName,onChange:()=>{g.current=!0},onBlur:e=>{let t=g.current;g.current=!1,ee(e.currentTarget.value,t)},onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()}},`${e.projectKey}:${e.displayName}`)}),(0,$.jsx)(Z,{title:`Project icon`,description:v?.kind===`lucide`?`${v.name} · ${v.color}`:v?.kind===`monogram`?`${v.text} · ${v.color}`:v?.kind===`emoji`?v.emoji:_??`Automatic`,resetAction:e.memberProjects.some(e=>e.faviconPath!=null||e.projectIcon!=null)?(0,$.jsx)(xe,{label:`project icon`,disabled:B||!u,onClick:()=>void K({faviconPath:null,projectIcon:null})}):null,control:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(pe,{project:d,className:`size-6`}),(0,$.jsx)(b,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon`,disabled:B||!u,onClick:()=>L(!0),children:`Choose icon`}),(0,$.jsx)(b,{size:`sm`,variant:`outline`,type:`button`,"aria-label":`Choose a project icon file`,disabled:B||!u,onClick:()=>j(!0),children:`Choose file`})]})})]}),(0,$.jsx)(Re,{category:`project`}),(0,$.jsx)(qe,{}),J?X:null,(0,$.jsx)(Se,{title:`Danger`,children:(0,$.jsx)(Z,{title:t?`Remove checkout`:e.memberProjects.length>1?`Remove this project everywhere`:`Remove project`,description:t?`Deletes the selected machine's checkout entries and their threads. Other machines and files on disk are not touched.`:e.memberProjects.length>1?`Deletes all ${e.memberProjects.length} checkout entries and their threads on every machine. Files on disk are not touched.`:`Deletes the project entry and its threads. Files on disk are not touched.`,control:(0,$.jsxs)(b,{size:`sm`,variant:`destructive-outline`,disabled:!u,onClick:()=>void Y(e.memberProjects),children:[(0,$.jsx)(O,{}),t?`Remove checkout`:e.memberProjects.length>1?`Remove all entries`:`Remove project`]})})})]}),(0,$.jsx)(Ue,{cwd:d.workspaceRoot,environmentId:d.environmentId,onOpenChange:j,...y?{onPickExternal:()=>y(d.workspaceRoot)}:{},onSelect:e=>void K({faviconPath:e,projectIcon:null}),open:ne&&u,projectName:e.displayName},`${d.environmentId}:${d.workspaceRoot}:${ne}`),F&&u?(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Ze,{current:v,projectName:d.title,open:!0,onOpenChange:L,onSelect:e=>void K({faviconPath:null,projectIcon:e})})}):null]})}function rt(){let e=(0,Be.c)(7),{search:t,scope:n}=Ce(),r=n.kind===`project`||n.kind===`checkout`||n.kind===`unavailable`&&(n.reason===`project-missing`||n.reason===`checkout-missing`),i;return e[0]!==r||e[1]!==n.kind||e[2]!==n.message||e[3]!==t.checkout||e[4]!==t.machine||e[5]!==t.project?(i=(0,$.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:t.project&&r?(0,$.jsx)($e,{projectKey:t.project,environmentId:t.machine?u.make(t.machine):null,checkoutKey:t.checkout??null}):n.kind===`unavailable`?(0,$.jsx)(be,{children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.message})}):(0,$.jsx)(ze,{target:`project`,children:`Choose a project to manage its name, icon, checkouts and actions.`})}),e[0]=r,e[1]=n.kind,e[2]=n.message,e[3]=t.checkout,e[4]=t.machine,e[5]=t.project,e[6]=i):i=e[6],i}var it=rt;export{it as component};
4
+ //# sourceMappingURL=settings.projects-BZP8BJZK.js.map