@p4code/cli 0.9.15 → 0.9.17

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 (422) hide show
  1. package/dist/AcpMcpStdioBridge-Bv41U5Ym.mjs +3 -0
  2. package/dist/{AcpMcpStdioBridge-BPNHFfTr.mjs → AcpMcpStdioBridge-CvhQaaYj.mjs} +3 -3
  3. package/dist/{Effect-COOccdaU.mjs → Effect-_Rz7VLdg.mjs} +33 -2
  4. package/dist/{Schema-BXiVImR2.mjs → Schema-APnY3Ozr.mjs} +2 -2
  5. package/dist/{Stream-D2XZdzH6.mjs → Stream-CJtpwu3-.mjs} +2 -2
  6. package/dist/bin.mjs +2 -2
  7. package/dist/{binCli-06acKUH_.mjs → binCli-B298WI-F.mjs} +6254 -4331
  8. package/dist/claude-history-worker.mjs +1 -1
  9. package/dist/{claudeHistoryWorker-BJKXFgWC.mjs → claudeHistoryWorker-Dgk6e0nY.mjs} +2 -2
  10. package/dist/client/.vite/manifest.json +2296 -2067
  11. package/dist/client/assets/{2NI2N5EU-CzVcbH89.js → 2NI2N5EU-D4f5i1y_.js} +2 -2
  12. package/dist/client/assets/{4UO7MD6I-DS3UFSUE.js → 4UO7MD6I-RrpAQ0X1.js} +2 -2
  13. package/dist/client/assets/{5B3SVYGG-lbor_c4_.js → 5B3SVYGG-ClZSmzf_.js} +2 -2
  14. package/dist/client/assets/{5GK6JWQ2-DufacBFC.js → 5GK6JWQ2-B1md9I9Z.js} +2 -2
  15. package/dist/client/assets/{5N7A7DKN-B3iWX-TC.js → 5N7A7DKN-BQIARO23.js} +2 -2
  16. package/dist/client/assets/{5OC2THR4-DoDDWXtD.js → 5OC2THR4-351ZCzKk.js} +2 -2
  17. package/dist/client/assets/{5S6HY5KT-7n94quvm.js → 5S6HY5KT-DmJkK7tt.js} +2 -2
  18. package/dist/client/assets/{6IMQ5BUJ-CqcR9lZq.js → 6IMQ5BUJ-BpvNx_p4.js} +2 -2
  19. package/dist/client/assets/{6OLKWJ4F-BeCI6be_.js → 6OLKWJ4F-C2xPWRsp.js} +2 -2
  20. package/dist/client/assets/{74OO7NKP-XWvi4Kgp.js → 74OO7NKP--xC0IYpN.js} +2 -2
  21. package/dist/client/assets/{75O6YZUN-BbbGiqdI.js → 75O6YZUN-CK0ONIHW.js} +2 -2
  22. package/dist/client/assets/{77XECAW3-BVGMXOi_.js → 77XECAW3-BcsWkjLy.js} +2 -2
  23. package/dist/client/assets/{ABYRPUBD-D4oehH5y.js → ABYRPUBD-D3uBdyxY.js} +2 -2
  24. package/dist/client/assets/AlertDialogRoot-CPanDrss.js +2 -0
  25. package/dist/client/assets/{AnimatedHeight-DT585xP0.js → AnimatedHeight-CVfEvZ5q.js} +2 -2
  26. package/dist/client/assets/{AuthSurfaceShell-C312CXz7.js → AuthSurfaceShell-Cfzl0v4C.js} +2 -2
  27. package/dist/client/assets/{BB2UYUI2-BkFcdWkE.js → BB2UYUI2-BOnjWgZo.js} +2 -2
  28. package/dist/client/assets/{BUM34MOA-DK6xDbTB.js → BUM34MOA-B7RHMom2.js} +2 -2
  29. package/dist/client/assets/{CEQABKGZ-rLn9wSBN.js → CEQABKGZ-Cc9Oxare.js} +2 -2
  30. package/dist/client/assets/{CXAC5362-C1eQCQMX.js → CXAC5362-BNdOJTpr.js} +2 -2
  31. package/dist/client/assets/ChatGptUsageButton-xIp-6pmC.js +2 -0
  32. package/dist/client/assets/{ChatMarkdown-BUoR67CT.js → ChatMarkdown-Bueup3X5.js} +24 -24
  33. package/dist/client/assets/CheckboxIndicator-Bx7Oi3gX.js +2 -0
  34. package/dist/client/assets/ClippedText-CIorIVl7.js +2 -0
  35. package/dist/client/assets/CodexSetupSection.logic-C7e1n48R.js +2 -0
  36. package/dist/client/assets/ComboboxClear-HZ-hIKnq.js +2 -0
  37. package/dist/client/assets/ComboboxGroupLabel-DUYNaL5F.js +2 -0
  38. package/dist/client/assets/{CommandBlock-40eSIrOe.js → CommandBlock-4iMcWKQI.js} +2 -2
  39. package/dist/client/assets/CompositeRoot-BBK88_pH.js +2 -0
  40. package/dist/client/assets/ConnectAgentSurface-BWOV2eWU.js +2 -0
  41. package/dist/client/assets/{ConnectionStatusDot-7Tjfknn6.js → ConnectionStatusDot-ChSEZVFH.js} +2 -2
  42. package/dist/client/assets/DRACOLoader-DluumOSd.js +3 -0
  43. package/dist/client/assets/{DRLTVNUE-BPoomdQn.js → DRLTVNUE-DFsymRUq.js} +2 -2
  44. package/dist/client/assets/{DYY6UVD2-BVvdA84B.js → DYY6UVD2-CBGlYjYj.js} +2 -2
  45. package/dist/client/assets/DevicePanel-DbUlYPs5.js +2 -0
  46. package/dist/client/assets/DeviceSetup-DwoJ9gYG.js +2 -0
  47. package/dist/client/assets/DialogTitle-CZ-x-t6r.js +2 -0
  48. package/dist/client/assets/{DiffCommentAnnotation-C28NAT6f.js → DiffCommentAnnotation-I1NLNQ4a.js} +3 -3
  49. package/dist/client/assets/{DiffFileTree-DNP9E3To.js → DiffFileTree-D2Less6B.js} +2 -2
  50. package/dist/client/assets/DiffPanel-CbeaPGl7.js +2 -0
  51. package/dist/client/assets/{DiffWorkerPoolProvider-TgqbZJCv.js → DiffWorkerPoolProvider-Ed_Eu_5j.js} +3 -3
  52. package/dist/client/assets/{EmbeddedDesign-B4RMmwTG.css → EmbeddedDesign-2h_Gl1nY.css} +1 -1
  53. package/dist/client/assets/EmbeddedDesign-cg069GMG.js +22 -0
  54. package/dist/client/assets/{EnvironmentMachineIcon-B81Bujkx.js → EnvironmentMachineIcon-DX1kvIxN.js} +2 -2
  55. package/dist/client/assets/{ExpandableText-CViqRFUp.js → ExpandableText-DjawxN-Z.js} +2 -2
  56. package/dist/client/assets/{FNOVOB4O-CmMgcKnc.js → FNOVOB4O-CyUhwNfJ.js} +2 -2
  57. package/dist/client/assets/FieldControl-HtKPFtzy.js +2 -0
  58. package/dist/client/assets/{FileDiff-BnZVGRTP.js → FileDiff-B-y5La4j.js} +2 -2
  59. package/dist/client/assets/{FilePreviewPanel-BUTTBdpa.js → FilePreviewPanel-c9WvfrZ_.js} +6 -6
  60. package/dist/client/assets/{FoldedSettingsSection-CioXtXIT.js → FoldedSettingsSection-BJZLAjOM.js} +2 -2
  61. package/dist/client/assets/FormContext-CXpUoAJn.js +2 -0
  62. package/dist/client/assets/GLTFLoader-DL026JyV.js +3833 -0
  63. package/dist/client/assets/{HDGCDEEZ-BsN0BbNt.js → HDGCDEEZ-Bl6z86eT.js} +2 -2
  64. package/dist/client/assets/{HSJLKHB7-Bn8VFRt5.js → HSJLKHB7-Cfn1dqKq.js} +2 -2
  65. package/dist/client/assets/{Icons-D_LFMxsj.js → Icons-CnCqDzcX.js} +2 -2
  66. package/dist/client/assets/Input-DivTTwcy.js +2 -0
  67. package/dist/client/assets/IntervalSecondsField-BEYqyqtO.js +2 -0
  68. package/dist/client/assets/JZOYTAAL-5Iy_ls5m.js +1 -0
  69. package/dist/client/assets/{K3MD6TGW-BEaTend7.js → K3MD6TGW-DbKn4Q-g.js} +2 -2
  70. package/dist/client/assets/{K7RP3OMA-Ca837W6z.js → K7RP3OMA-C2LcLP3I.js} +2 -2
  71. package/dist/client/assets/KeybindingsSettings.logic-BBUqSPsh.js +2 -0
  72. package/dist/client/assets/{LHDIQX7Q-kLYZmy22.js → LHDIQX7Q-D15jphae.js} +2 -2
  73. package/dist/client/assets/{LUXOKEGN-C6-9ARpy.js → LUXOKEGN-a5epevQp.js} +2 -2
  74. package/dist/client/assets/LinkMachineSelect-BeDb1a2o.js +2 -0
  75. package/dist/client/assets/{MathTypeset-CO0wlzDm.js → MathTypeset-wh9NB-6n.js} +2 -2
  76. package/dist/client/assets/ModelLiveLayer-vM3B8fTs.js +3 -0
  77. package/dist/client/assets/{N3JZAHOW-BFAKVTw8.js → N3JZAHOW-CnXyo2Xv.js} +2 -2
  78. package/dist/client/assets/{NUIALGQ3-DJg3tvBl.js → NUIALGQ3-Be5ePBJU.js} +2 -2
  79. package/dist/client/assets/{NoProjectsHero-ClDVFY0-.js → NoProjectsHero-D-hOorzE.js} +2 -2
  80. package/dist/client/assets/{O65XPQGZ-C5dkxqix.js → O65XPQGZ-B6ecTWo6.js} +2 -2
  81. package/dist/client/assets/{O7XIQ6OM-BUT403yQ.js → O7XIQ6OM-DvY9hhop.js} +2 -2
  82. package/dist/client/assets/{OFQON5FD-BPK3FXUG.js → OFQON5FD-Csir9i2q.js} +2 -2
  83. package/dist/client/assets/P4ConnectAccountPages-0UQXNoHX.js +2 -0
  84. package/dist/client/assets/{P4ConnectSidebarSignIn-D7BBbl_u.js → P4ConnectSidebarSignIn-DNS-Ar_U.js} +2 -2
  85. package/dist/client/assets/{PJQHF43J-DrfICuu-.js → PJQHF43J-DDRN0fWF.js} +2 -2
  86. package/dist/client/assets/PanelLayoutControls-1wZHYpgc.js +216 -0
  87. package/dist/client/assets/PierreEntryIcon-C-UBRZGs.js +2 -0
  88. package/dist/client/assets/PopoverHandle-AuBayEmY.js +2 -0
  89. package/dist/client/assets/PreviewPanel-5UQIDtjs.js +2 -0
  90. package/dist/client/assets/ProjectDefaultsSettings-BuSgjMGJ.js +2 -0
  91. package/dist/client/assets/{ProjectFavicon-BbtNdeB8.js → ProjectFavicon-Rj7LmbUX.js} +3 -3
  92. package/dist/client/assets/ProjectIconPickerDialog-75VZboJk.js +2 -0
  93. package/dist/client/assets/{ProjectMonogram-CjAGnMXr.js → ProjectMonogram-o7ZBa1RK.js} +2 -2
  94. package/dist/client/assets/{ProviderAuthTerminal-83vDClUK.js → ProviderAuthTerminal-884jYkPg.js} +2 -2
  95. package/dist/client/assets/ProviderModelPicker-446NiacH.js +2 -0
  96. package/dist/client/assets/ProviderSettingsForm-CBS1Dlfm.js +2 -0
  97. package/dist/client/assets/PullRequestCodeTab-DQzL88wU.js +6 -0
  98. package/dist/client/assets/{RHNBAITX-CzAdLNMd.js → RHNBAITX-DkWE42El.js} +2 -2
  99. package/dist/client/assets/{ReadOnlySourcePreview-CRy5hHfx.js → ReadOnlySourcePreview-DwfiVQrm.js} +2 -2
  100. package/dist/client/assets/{RedactedSensitiveText-B-u4PB3I.js → RedactedSensitiveText-DCu9USVF.js} +2 -2
  101. package/dist/client/assets/{RenderErrorBoundary-BbxLD-66.js → RenderErrorBoundary-ZQ6mGx7s.js} +3 -3
  102. package/dist/client/assets/RightPanelResizeHandle-8oJQkwcU.js +2 -0
  103. package/dist/client/assets/RoomEnvironment-Iz7-KYrN.js +2 -0
  104. package/dist/client/assets/{SLD4V6NK-DIFaAadw.js → SLD4V6NK-DTdKN7s4.js} +2 -2
  105. package/dist/client/assets/ScheduledTasksSettings-BFBxrkf4.js +6 -0
  106. package/dist/client/assets/{ScopedSwitch-sSIKDf2q.js → ScopedSwitch-BC1gPotW.js} +2 -2
  107. package/dist/client/assets/ScrollAreaCorner-C2BGnFEt.js +2 -0
  108. package/dist/client/assets/{SecretInput-DxjaAnSE.js → SecretInput-CTGlsesz.js} +2 -2
  109. package/dist/client/assets/SelectScrollUpArrow-BCdPJCNh.js +2 -0
  110. package/dist/client/assets/SelfImproveSettingsSection-DrWeWHZ3.js +2 -0
  111. package/dist/client/assets/SettingsPanels-dLjfE4mE.js +46 -0
  112. package/dist/client/assets/SettingsPanels.logic-DmWR8tPG.js +2 -0
  113. package/dist/client/assets/{SettingsScopeNotice-B1JDmqM6.js → SettingsScopeNotice-C3QzVYEB.js} +2 -2
  114. package/dist/client/assets/{SidebarStageBackdrop-Bbv3JBlJ.js → SidebarStageBackdrop-B1pFHa1_.js} +2 -2
  115. package/dist/client/assets/{T3PCR2KE-CACWvOHn.js → T3PCR2KE-17rNrwIa.js} +2 -2
  116. package/dist/client/assets/{TKWO2OVW-DpiGaVko.js → TKWO2OVW-duPpJj5d.js} +2 -2
  117. package/dist/client/assets/{TSHNXIZL-Cs6g4gXN.js → TSHNXIZL-DU0_NvP6.js} +2 -2
  118. package/dist/client/assets/{ThemeEditorPanel-w-RJEK3t.js → ThemeEditorPanel-75j9OkFZ.js} +3 -3
  119. package/dist/client/assets/{ThreadDetailsItemsMenu-DEwUOoLt.js → ThreadDetailsItemsMenu-D9bVwLRx.js} +45 -45
  120. package/dist/client/assets/ThreadTerminalDrawer-CdfREoC-.js +5 -0
  121. package/dist/client/assets/TooltipProvider-BUHMH_xT.js +2 -0
  122. package/dist/client/assets/{UQJE5E4I-C2gKDRv_.js → UQJE5E4I-B6R9z_Jl.js} +2 -2
  123. package/dist/client/assets/{USNYFO5S-CQ8LfY6F.js → USNYFO5S-CoqkxDVj.js} +2 -2
  124. package/dist/client/assets/{Virtualizer-DsEq6qUF.js → Virtualizer-CmU5Fo0Z.js} +2 -2
  125. package/dist/client/assets/{WEVWDWVA-DK2GTAKk.js → WEVWDWVA-C_7PWsV9.js} +2 -2
  126. package/dist/client/assets/{WorkspaceBreadcrumb-BImJJpuo.js → WorkspaceBreadcrumb-wSY6JpgP.js} +2 -2
  127. package/dist/client/assets/{WorkspacePageContainer-BlYFBUKE.js → WorkspacePageContainer-Bv3Si0zJ.js} +2 -2
  128. package/dist/client/assets/{WorkspacePageHeader-B7O16593.js → WorkspacePageHeader-D35ZiFO-.js} +2 -2
  129. package/dist/client/assets/{X5RFHQXM-sPxDCIwv.js → X5RFHQXM-BUhlFLY4.js} +2 -2
  130. package/dist/client/assets/{X62E3GBT-DVWr270S.js → X62E3GBT-BpMRLXKj.js} +2 -2
  131. package/dist/client/assets/{XBNEOJTC-C4ZNtSrU.js → XBNEOJTC-BRtSarTS.js} +2 -2
  132. package/dist/client/assets/{YHV2MVVZ-aSYUfq9n.js → YHV2MVVZ-Csy6jL8n.js} +2 -2
  133. package/dist/client/assets/{YURCZMG2-fnxZxUja.js → YURCZMG2-BWgVyhae.js} +2 -2
  134. package/dist/client/assets/{YVG2LODB-DxaZKaXT.js → YVG2LODB-BaRjN-Cm.js} +2 -2
  135. package/dist/client/assets/_chat-3NFUtZzk.js +47 -0
  136. package/dist/client/assets/_chat.design-CPUGyCaX.js +2 -0
  137. package/dist/client/assets/{_chat.index-D1csjyRQ.js → _chat.index-BMWR9-dz.js} +2 -2
  138. package/dist/client/assets/_chat.new-CFxwzp_c.js +4 -0
  139. package/dist/client/assets/_chat.pull-requests-BeA7vnLo.js +2 -0
  140. package/dist/client/assets/alert-DNQ3Wqlu.js +2 -0
  141. package/dist/client/assets/{alert-dialog-BCq0Qme9.js → alert-dialog-BRZulAlJ.js} +2 -2
  142. package/dist/client/assets/{assetUrls-CpRsTTqn.js → assetUrls-C1PZWceM.js} +2 -2
  143. package/dist/client/assets/assets-DPxWpbK1.js +2 -0
  144. package/dist/client/assets/browserHistoryStore-or0m8nek.js +2 -0
  145. package/dist/client/assets/{browserLinkTarget-IOprEiHF.js → browserLinkTarget-DE8VZ118.js} +2 -2
  146. package/dist/client/assets/{checkbox-CGhJug34.js → checkbox-Cz3A131i.js} +2 -2
  147. package/dist/client/assets/{color-picker-CRaqqL5F.js → color-picker-BqJjpRIx.js} +2 -2
  148. package/dist/client/assets/combobox-D28ATySv.js +2 -0
  149. package/dist/client/assets/{command-06bu9QoQ.js → command-BjQ8TOGE.js} +2 -2
  150. package/dist/client/assets/{connect-7OV1IEwO.js → connect-CpfP9Azm.js} +2 -2
  151. package/dist/client/assets/connect-agent-19TQkO9t.js +2 -0
  152. package/dist/client/assets/design-Bz1IpqHZ.js +2 -0
  153. package/dist/client/assets/device-DuASmK9r.js +2 -0
  154. package/dist/client/assets/dialog-BJ3R7bWN.js +2 -0
  155. package/dist/client/assets/diffPanelStore-Yh6lox6N.js +2 -0
  156. package/dist/client/assets/{diffRendering-DAzPanqh.js → diffRendering-CeqwU9XS.js} +2 -2
  157. package/dist/client/assets/{dist-BuxsAlG0.js → dist-C2W3DEZU.js} +3 -3
  158. package/dist/client/assets/draco_decoder-DZ63_CFx.js +2 -0
  159. package/dist/client/assets/draco_decoder-Z1_iN-Ht.wasm +0 -0
  160. package/dist/client/assets/draco_wasm_wrapper-9cRAE0qV.js +2 -0
  161. package/dist/client/assets/draco_wasm_wrapper-fZCQGLGb.js +116 -0
  162. package/dist/client/assets/draft-input-D7yqLT1A.js +2 -0
  163. package/dist/client/assets/duoViewer-DQzDc4Z4.js +2 -0
  164. package/dist/client/assets/{dynamic-wBSCLNxy.js → dynamic-Dz4eLTaa.js} +3 -3
  165. package/dist/client/assets/{embeddedScripts-ZebptRJ0.js → embeddedScripts-DZ2Ii9dE.js} +2 -2
  166. package/dist/client/assets/empty-BwsFVBxJ.js +2 -0
  167. package/dist/client/assets/entities-CNmVqAZs.js +2 -0
  168. package/dist/client/assets/{fileLinks-BfcK2bJU.js → fileLinks-E3IIVHgM.js} +2 -2
  169. package/dist/client/assets/{fileTreeExpansion-DjiK1m5s.js → fileTreeExpansion-gTas243c.js} +2 -2
  170. package/dist/client/assets/{getDiffFileInput-XE3jyXxK.js → getDiffFileInput-CUXcOkYa.js} +2 -2
  171. package/dist/client/assets/{htmlRender-DGe3WaPg.js → htmlRender-DSw3CY7L.js} +2 -2
  172. package/dist/client/assets/hubAccess-CsZ8CNmg.js +2 -0
  173. package/dist/client/assets/image-up-f7X837EZ.js +2 -0
  174. package/dist/client/assets/{index-CurDuwfz.js → index-Bxj8VaXa.js} +3 -3
  175. package/dist/client/assets/{input-CQaedaQh.js → input-BwujRX3Y.js} +2 -2
  176. package/dist/client/assets/input-group-euoW8Z7h.js +2 -0
  177. package/dist/client/assets/{kbd-DQRicdHu.js → kbd-GiLKf_On.js} +2 -2
  178. package/dist/client/assets/keybindings-CCmLKtII.js +2 -0
  179. package/dist/client/assets/{lazy-DmPH_lNd.js → lazy-JsFnphfP.js} +4 -4
  180. package/dist/client/assets/{lazyRouteComponent-CE6uW_5p.js → lazyRouteComponent-DZOLCSfI.js} +2 -2
  181. package/dist/client/assets/{link-CKfckeju.js → link-ByE5ZkNW.js} +2 -2
  182. package/dist/client/assets/{linkedPrompt-68_t5vwh.js → linkedPrompt-Dv_ZP8G8.js} +2 -2
  183. package/dist/client/assets/main-D8lKEPYS.js +37 -0
  184. package/dist/client/assets/main-DIHqY9YX.css +2 -0
  185. package/dist/client/assets/{mediaReference-DQ6GIZY7.js → mediaReference-DKsJ-9R8.js} +2 -2
  186. package/dist/client/assets/mediaSource-CF8tZyds.js +2 -0
  187. package/dist/client/assets/meshopt_decoder.module-BE7cuDBs.js +2 -0
  188. package/dist/client/assets/modelScene-DxcxMNRA.js +3 -0
  189. package/dist/client/assets/number-field-CWsDuEfo.js +2 -0
  190. package/dist/client/assets/{observeResize-BbXolq6K.js → observeResize-BxfFu2qN.js} +2 -2
  191. package/dist/client/assets/onboarding-DbYQeYSX.js +2 -0
  192. package/dist/client/assets/openFileInPreview-BiuuqQ-l.js +2 -0
  193. package/dist/client/assets/orbit-CTbdaXs-.js +2 -0
  194. package/dist/client/assets/p4ProjectFile-CZQao9GZ.js +2 -0
  195. package/dist/client/assets/{pair-BpCo33SH.js → pair-JgOCPd7m.js} +2 -2
  196. package/dist/client/assets/pause-5XtmSS7L.js +2 -0
  197. package/dist/client/assets/{pendingSendStore-Ba--K6cH.js → pendingSendStore-Bf499-Oy.js} +2 -2
  198. package/dist/client/assets/phoneViewer-Bqeu_y-d.js +2 -0
  199. package/dist/client/assets/{pierre-icons-BdcegjLq.js → pierre-icons-tmWDDsbZ.js} +2 -2
  200. package/dist/client/assets/popover-D2KZg7__.js +2 -0
  201. package/dist/client/assets/preview-eatXH_DC.js +2 -0
  202. package/dist/client/assets/preview-rGycedjV.js +2 -0
  203. package/dist/client/assets/previewMiniPlayerStore-7pQoYbpL.js +2 -0
  204. package/dist/client/assets/primary-C0adlG4a.js +2 -0
  205. package/dist/client/assets/primaryCloudLinkState-DStOgXZ7.js +2 -0
  206. package/dist/client/assets/projectFilesQueryState-CXzO_JXd.js +2 -0
  207. package/dist/client/assets/projectScriptEditor-B9Q_BBbL.js +2 -0
  208. package/dist/client/assets/providerSkills-BYU6vU9U.js +2 -0
  209. package/dist/client/assets/pullRequestDetail.logic-CAA5BrcO.js +10 -0
  210. package/dist/client/assets/{pullRequestIcons-CbDg0o8q.js → pullRequestIcons-D0TNfVUp.js} +2 -2
  211. package/dist/client/assets/{pullRequestReviewStore-0WIH92NQ.js → pullRequestReviewStore-szmuenZj.js} +2 -2
  212. package/dist/client/assets/pullRequests-tu-Mn-gv.js +2 -0
  213. package/dist/client/assets/queries-BhrI_odm.js +2 -0
  214. package/dist/client/assets/query-DmYgeaGK.js +2 -0
  215. package/dist/client/assets/radio-group-YcYZQjQu.js +2 -0
  216. package/dist/client/assets/relay-DcCuBtiq.js +2 -0
  217. package/dist/client/assets/renderScheduler-BgdSr0UC.js +2 -0
  218. package/dist/client/assets/rightPanelStore-BpUwMEU6.js +2 -0
  219. package/dist/client/assets/runtime-DciS6GP9.js +7 -0
  220. package/dist/client/assets/{runtimeModeConfig-CRXk0H6e.js → runtimeModeConfig-B8OcO6E5.js} +2 -2
  221. package/dist/client/assets/{scheduledTasksSettings.logic-Dw_swg_M.js → scheduledTasksSettings.logic-Cnm8G_wO.js} +3 -3
  222. package/dist/client/assets/{scroll-area-Cm9XZdHp.js → scroll-area-D7wKdOM7.js} +2 -2
  223. package/dist/client/assets/select--26O8gr7.js +2 -0
  224. package/dist/client/assets/selfImproveFindings-CQHbA_SP.js +2 -0
  225. package/dist/client/assets/server-DKB_3xTN.js +2 -0
  226. package/dist/client/assets/session-D_OiLzln.js +2 -0
  227. package/dist/client/assets/session-logic-lUPcTQRy.js +26 -0
  228. package/dist/client/assets/{settings-Yvo1RMvg.js → settings-BDigjNQr.js} +2 -2
  229. package/dist/client/assets/{settings.appearance-ONDNW-gc.js → settings.appearance-pv_RhojI.js} +2 -2
  230. package/dist/client/assets/settings.archived-UHO0BqSp.js +2 -0
  231. package/dist/client/assets/settings.computer-use-C7FCVkB8.js +2 -0
  232. package/dist/client/assets/settings.connections-MCKul-Qb.js +2 -0
  233. package/dist/client/assets/settings.data-controls-DHSiH1XK.js +2 -0
  234. package/dist/client/assets/settings.decisions-DVAZFuiP.js +2 -0
  235. package/dist/client/assets/settings.designs-Cq_57Bul.js +2 -0
  236. package/dist/client/assets/settings.diagnostics-D3vvP_U2.js +2 -0
  237. package/dist/client/assets/{settings.general-Cf_bIbyH.js → settings.general-BVlKme_0.js} +2 -2
  238. package/dist/client/assets/settings.integrations-CfX639cu.js +2 -0
  239. package/dist/client/assets/settings.keybindings-C4ufqFiE.js +2 -0
  240. package/dist/client/assets/{settings.open-source-licenses-DlqO6HBa.js → settings.open-source-licenses-C7SQX7_o.js} +2 -2
  241. package/dist/client/assets/settings.plugins-JB-_3lB3.js +5 -0
  242. package/dist/client/assets/settings.projects-HbUqS8EQ.js +4 -0
  243. package/dist/client/assets/settings.providers-DDaicTRG.js +3 -0
  244. package/dist/client/assets/{settings.scheduled-tasks-BIaHEXVF.js → settings.scheduled-tasks-CsfZkMNc.js} +2 -2
  245. package/dist/client/assets/settings.secrets-DmkUTUBC.js +2 -0
  246. package/dist/client/assets/settings.snap-shot-CxBBb3GG.js +2 -0
  247. package/dist/client/assets/settings.source-control-Buh1svx1.js +2 -0
  248. package/dist/client/assets/settings.storage-BoCdHcfz.js +2 -0
  249. package/dist/client/assets/settingsLayout-EWRSNE9F.js +3 -0
  250. package/dist/client/assets/sidebar-B2McbSnM.js +2 -0
  251. package/dist/client/assets/{sidebarProjectGrouping-Cy06FqQF.js → sidebarProjectGrouping-ManvShfB.js} +2 -2
  252. package/dist/client/assets/skeleton-CfxEpnM8.js +2 -0
  253. package/dist/client/assets/sourceControl-2E-torWB.js +2 -0
  254. package/dist/client/assets/sourceControlClients-DTwwk4H6.js +2 -0
  255. package/dist/client/assets/spinner-DiQtYQvU.js +2 -0
  256. package/dist/client/assets/src-aYUfWMsw.js +15 -0
  257. package/dist/client/assets/{terminal-links-DkNuyYrs.js → terminal-links-DalIS_T6.js} +2 -2
  258. package/dist/client/assets/terminalSessions-BXRGhdwO.js +2 -0
  259. package/dist/client/assets/textarea-CgJxMEC6.js +2 -0
  260. package/dist/client/assets/{themePalette-1UQmJk98.js → themePalette-BAJL8JDR.js} +3 -3
  261. package/dist/client/assets/threadCheckpoints-A01VyLzN.js +2 -0
  262. package/dist/client/assets/toggle-fVPE0kyD.js +2 -0
  263. package/dist/client/assets/toggle-group-BQBgK4Fh.js +2 -0
  264. package/dist/client/assets/{tooltip-C7NAkYG3.js → tooltip-DDv-MvO4.js} +2 -2
  265. package/dist/client/assets/{uiStateStore-FYiLqqos.js → uiStateStore-Cyle2Grh.js} +2 -2
  266. package/dist/client/assets/usage-DfkVwFPy.js +2 -0
  267. package/dist/client/assets/usageAccess-DGGNF6kP.js +2 -0
  268. package/dist/client/assets/usageFormat-DvpnUmwI.js +2 -0
  269. package/dist/client/assets/{usageShortcuts-BJyp1xT6.js → usageShortcuts-BefcatkO.js} +2 -2
  270. package/dist/client/assets/{use-atom-command-BbFDhw_c.js → use-atom-command-Bfi4daMj.js} +2 -2
  271. package/dist/client/assets/{useAriaLabelledBy-BJnK5b5h.js → useAriaLabelledBy-DjrGw7Iw.js} +2 -2
  272. package/dist/client/assets/useHandleNewThread-idXLHXR7.js +2 -0
  273. package/dist/client/assets/{useLocation-NTw9A5XQ.js → useLocation-fNQqSFar.js} +2 -2
  274. package/dist/client/assets/{useNavigate-DV9bXnWr.js → useNavigate-DwXZ6yA7.js} +2 -2
  275. package/dist/client/assets/{useNavigateBack-D62rsj_4.js → useNavigateBack-mLGu4w8K.js} +2 -2
  276. package/dist/client/assets/{useP4ConnectAuthPrompt-Bj5GIxgy.js → useP4ConnectAuthPrompt-BXgvqiOd.js} +2 -2
  277. package/dist/client/assets/{useParams-jklHVL7l.js → useParams-qFbmBdAa.js} +2 -2
  278. package/dist/client/assets/{usePermissionStatus-DaCu90iN.js → usePermissionStatus-CTyZ03Js.js} +2 -2
  279. package/dist/client/assets/usePopupViewport-Dc46kF33.js +2 -0
  280. package/dist/client/assets/usePullRequestActions-DJ1WiiLA.js +3 -0
  281. package/dist/client/assets/useRegisterFieldControl-BL6Ml_ar.js +2 -0
  282. package/dist/client/assets/useRender-BP5vR6yH.js +2 -0
  283. package/dist/client/assets/{useScopedModelAvailability-hsJL85Tg.js → useScopedModelAvailability-CLTKL2Jf.js} +2 -2
  284. package/dist/client/assets/useSettings-CnHpxSBo.js +3 -0
  285. package/dist/client/assets/utils-CtzgibkN.js +24 -0
  286. package/dist/client/assets/vcsRefInvalidation-BewBnMos.js +2 -0
  287. package/dist/client/assets/welcome-BkJ7M2_8.js +2 -0
  288. package/dist/client/index.html +1 -1
  289. package/dist/{renderer-D9dDeERN.mjs → renderer-7PhJbGDm.mjs} +19 -4
  290. package/dist/{runtime-C3UJDGLb.mjs → runtime-Dbm6Vqjj.mjs} +511 -233
  291. package/package.json +1 -1
  292. package/dist/AcpMcpStdioBridge-CtXfvrFO.mjs +0 -3
  293. package/dist/client/assets/AlertDialogRoot-BI19p1Pb.js +0 -2
  294. package/dist/client/assets/ChatGptUsageButton-BldpBXxU.js +0 -2
  295. package/dist/client/assets/CheckboxIndicator-C4iAbUMh.js +0 -2
  296. package/dist/client/assets/ClippedText-TtLeyAVc.js +0 -2
  297. package/dist/client/assets/CodexSetupSection.logic-BO6ZAijp.js +0 -2
  298. package/dist/client/assets/ComboboxClear-CtNsa8Al.js +0 -2
  299. package/dist/client/assets/ComboboxGroupLabel-vQ7y8c50.js +0 -2
  300. package/dist/client/assets/CompositeRoot-CL7X20MU.js +0 -2
  301. package/dist/client/assets/ConnectAgentSurface-B_AYPHWs.js +0 -2
  302. package/dist/client/assets/DevicePanel-Cqexcbm2.js +0 -2
  303. package/dist/client/assets/DeviceSetup-Cdyw5Z9a.js +0 -2
  304. package/dist/client/assets/DialogTitle-CFYK6V6-.js +0 -2
  305. package/dist/client/assets/DiffPanel-CrswOKS6.js +0 -2
  306. package/dist/client/assets/EmbeddedDesign-Bdq5oAfI.js +0 -21
  307. package/dist/client/assets/FieldControl-95mCsa0m.js +0 -2
  308. package/dist/client/assets/FormContext-BcA1kdFD.js +0 -2
  309. package/dist/client/assets/Input-C9KIhPlP.js +0 -2
  310. package/dist/client/assets/JZOYTAAL-B8H2VC7A.js +0 -1
  311. package/dist/client/assets/KeybindingsSettings.logic-DwMUZYvv.js +0 -2
  312. package/dist/client/assets/LinkMachineSelect-BVNnYUBb.js +0 -2
  313. package/dist/client/assets/P4ConnectAccountPages-ChT866qO.js +0 -2
  314. package/dist/client/assets/PanelLayoutControls-DMUv135M.js +0 -216
  315. package/dist/client/assets/PierreEntryIcon-DLXDEcqA.js +0 -2
  316. package/dist/client/assets/PopoverHandle-D8JhsX32.js +0 -2
  317. package/dist/client/assets/PreviewPanel-D7YWnWZS.js +0 -2
  318. package/dist/client/assets/ProjectDefaultsSettings-BZSw74tU.js +0 -2
  319. package/dist/client/assets/ProjectIconPickerDialog-7vur_TCX.js +0 -2
  320. package/dist/client/assets/ProviderModelPicker-af7MWLPO.js +0 -2
  321. package/dist/client/assets/ProviderSettingsForm-B4N4tsxv.js +0 -2
  322. package/dist/client/assets/PullRequestCodeTab-B07M_QW4.js +0 -6
  323. package/dist/client/assets/RightPanelResizeHandle-BODMyZa6.js +0 -2
  324. package/dist/client/assets/ScheduledTasksSettings-BTi69FRq.js +0 -6
  325. package/dist/client/assets/ScrollAreaCorner-CsKGemsf.js +0 -2
  326. package/dist/client/assets/SelectScrollUpArrow-BMZtcPXM.js +0 -2
  327. package/dist/client/assets/SelfImproveSettingsSection-Dx6spJXh.js +0 -2
  328. package/dist/client/assets/SettingsPanels-DhuEF0_Y.js +0 -46
  329. package/dist/client/assets/SettingsPanels.logic-D5Fnq4gS.js +0 -2
  330. package/dist/client/assets/ThreadTerminalDrawer-CY2qHldP.js +0 -5
  331. package/dist/client/assets/TooltipProvider-Czzm7ro-.js +0 -2
  332. package/dist/client/assets/_chat-BeJoXsdK.js +0 -47
  333. package/dist/client/assets/_chat.design-AJz30uXq.js +0 -2
  334. package/dist/client/assets/_chat.new-IhhWgwNo.js +0 -4
  335. package/dist/client/assets/_chat.pull-requests-B84LUHIv.js +0 -2
  336. package/dist/client/assets/alert-D6MFRWZv.js +0 -2
  337. package/dist/client/assets/assets-Dh1LFwqL.js +0 -2
  338. package/dist/client/assets/browserHistoryStore-BVEWgOnh.js +0 -2
  339. package/dist/client/assets/combobox-5RzytEjd.js +0 -2
  340. package/dist/client/assets/connect-agent-B6pgZuy8.js +0 -2
  341. package/dist/client/assets/design-DSoix9e1.js +0 -2
  342. package/dist/client/assets/device-DQmQm4GC.js +0 -2
  343. package/dist/client/assets/dialog-DTVhbEqi.js +0 -2
  344. package/dist/client/assets/draft-input-BTetoXSt.js +0 -2
  345. package/dist/client/assets/duoViewer-DxmaOmHS.js +0 -2
  346. package/dist/client/assets/empty-B4h5DyMQ.js +0 -2
  347. package/dist/client/assets/entities-CWtNgawi.js +0 -2
  348. package/dist/client/assets/guideRunStore-CzF0q6A8.js +0 -2
  349. package/dist/client/assets/image-up-BN-uYqtM.js +0 -2
  350. package/dist/client/assets/input-group-BQ_2ox-w.js +0 -2
  351. package/dist/client/assets/keybindings-tgj8XFFz.js +0 -2
  352. package/dist/client/assets/main-B1sXOjZZ.js +0 -37
  353. package/dist/client/assets/main-CbkvDRKP.css +0 -2
  354. package/dist/client/assets/mediaSource-DfTsMdqm.js +0 -2
  355. package/dist/client/assets/number-field-xEi5ylvp.js +0 -2
  356. package/dist/client/assets/onboarding-CkdZxdNL.js +0 -2
  357. package/dist/client/assets/openFileInPreview-BHhDd-id.js +0 -2
  358. package/dist/client/assets/orbit-aOr6_vTe.js +0 -2
  359. package/dist/client/assets/p4ProjectFile-5VDI-yAx.js +0 -2
  360. package/dist/client/assets/pause-C-5l1Ug3.js +0 -2
  361. package/dist/client/assets/phoneViewer-C1aGY-h1.js +0 -2
  362. package/dist/client/assets/popover-BB2K1---.js +0 -2
  363. package/dist/client/assets/preview-B4_sjsUX.js +0 -2
  364. package/dist/client/assets/preview-DgXn94k5.js +0 -2
  365. package/dist/client/assets/previewMiniPlayerStore-DguWdL1f.js +0 -2
  366. package/dist/client/assets/primary-BDoRkJqU.js +0 -2
  367. package/dist/client/assets/primaryCloudLinkState-Cc0Xobh6.js +0 -2
  368. package/dist/client/assets/projectFilesQueryState-BdfD5cZ2.js +0 -2
  369. package/dist/client/assets/projectScriptEditor-faOsFlds.js +0 -2
  370. package/dist/client/assets/providerSkills-C8PrnHb-.js +0 -2
  371. package/dist/client/assets/pullRequestDetail.logic-kOhR5jr9.js +0 -10
  372. package/dist/client/assets/pullRequests-Cf9E2kW-.js +0 -2
  373. package/dist/client/assets/queries-Cl508kPw.js +0 -2
  374. package/dist/client/assets/query-D3KVoW9G.js +0 -2
  375. package/dist/client/assets/radio-group-BnZVD-CO.js +0 -2
  376. package/dist/client/assets/relay-Do9UB5iT.js +0 -2
  377. package/dist/client/assets/renderScheduler-DsjkE3rh.js +0 -3833
  378. package/dist/client/assets/rightPanelStore-DB1OP4MT.js +0 -2
  379. package/dist/client/assets/runtime-BBYIQ0f-.js +0 -7
  380. package/dist/client/assets/select-Cz_1ByI4.js +0 -2
  381. package/dist/client/assets/selfImproveFindings-DtoTFNL_.js +0 -2
  382. package/dist/client/assets/server-Dkj4NeYG.js +0 -2
  383. package/dist/client/assets/session-CBEVNHld.js +0 -2
  384. package/dist/client/assets/session-logic-DB_ei-pn.js +0 -26
  385. package/dist/client/assets/settings.archived-CjdyCMyi.js +0 -2
  386. package/dist/client/assets/settings.computer-use-97ffp9C_.js +0 -2
  387. package/dist/client/assets/settings.connections-w3qKRKGa.js +0 -2
  388. package/dist/client/assets/settings.data-controls-C8ozSexu.js +0 -2
  389. package/dist/client/assets/settings.decisions-BvR3_OTv.js +0 -2
  390. package/dist/client/assets/settings.designs-CB8PWHwW.js +0 -2
  391. package/dist/client/assets/settings.diagnostics-DdInPrq0.js +0 -2
  392. package/dist/client/assets/settings.integrations-pj9KVvtd.js +0 -2
  393. package/dist/client/assets/settings.keybindings-3diGciV1.js +0 -2
  394. package/dist/client/assets/settings.plugins-DpaJJH_J.js +0 -5
  395. package/dist/client/assets/settings.projects-Bfh3CJ1a.js +0 -4
  396. package/dist/client/assets/settings.providers-DNiEeQYT.js +0 -3
  397. package/dist/client/assets/settings.secrets-BSNXem5A.js +0 -2
  398. package/dist/client/assets/settings.snap-shot-Ds0ywKhE.js +0 -2
  399. package/dist/client/assets/settings.source-control-C41AVNSm.js +0 -2
  400. package/dist/client/assets/settings.storage-B-Hm5vEC.js +0 -2
  401. package/dist/client/assets/settingsLayout-BbEwQ6Fy.js +0 -3
  402. package/dist/client/assets/sidebar-B70J7v16.js +0 -2
  403. package/dist/client/assets/skeleton-BavPX8IL.js +0 -2
  404. package/dist/client/assets/sourceControl-De64nxc-.js +0 -2
  405. package/dist/client/assets/sourceControlClients-BofXnV5S.js +0 -2
  406. package/dist/client/assets/spinner-BiCpg0TU.js +0 -2
  407. package/dist/client/assets/terminalSessions-BLnAzTpE.js +0 -2
  408. package/dist/client/assets/textarea-DPWqoJRQ.js +0 -2
  409. package/dist/client/assets/threadCheckpoints-C5aLz9nv.js +0 -2
  410. package/dist/client/assets/toggle-DERKSGyC.js +0 -2
  411. package/dist/client/assets/toggle-group-DYSJFIn3.js +0 -2
  412. package/dist/client/assets/usage-CtcqAwlu.js +0 -2
  413. package/dist/client/assets/usageAccess-2Wks5kIN.js +0 -2
  414. package/dist/client/assets/usageFormat-BZJ9qCn4.js +0 -2
  415. package/dist/client/assets/useHandleNewThread-C6MtV3AM.js +0 -2
  416. package/dist/client/assets/usePopupViewport-D1lXH2SQ.js +0 -2
  417. package/dist/client/assets/usePullRequestActions-WFmep5Tm.js +0 -3
  418. package/dist/client/assets/useRegisterFieldControl-BtJcyaxh.js +0 -2
  419. package/dist/client/assets/useSettings-EYJbJzT3.js +0 -3
  420. package/dist/client/assets/utils-DjbLtxuo.js +0 -37
  421. package/dist/client/assets/vcsRefInvalidation-DkXoQApH.js +0 -2
  422. package/dist/client/assets/welcome-uKSqaFeK.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{t as i}from"./cloud-BhcSs4Ie.js";import{t as a}from"./plus-B2sOrZDk.js";import{t as o}from"./x-C35beONT.js";import{$n as s,Bu as c,Cd as l,Dl as u,Ed as d,Sd as f,Xn as p,Yd as m,Zn as h,er as g,fr as _,hr as v,l as y,mr as b,ol as x,rl as S,rp as C,rr as w,ru as T,sr as E,t as D,tr as O}from"./utils-CtzgibkN.js";import{Bp as k,Dn as A,Fc as j,Ms as M,Ns as N,On as P,Up as F,_ as I,_i as L,_n as R,ai as z,bn as B,fh as ee,fi as V,gi as te,ja as ne,kn as re,mi as ie,oi as ae,ui as H,v as oe,vi as U,vn as se}from"./src-aYUfWMsw.js";import{Dr as ce}from"./runtime-DciS6GP9.js";import{w as le}from"./entities-CNmVqAZs.js";import{a as W,r as ue,t as G}from"./number-field-CWsDuEfo.js";import{a as K,c as de,i as fe,o as pe,r as me,s as he,t as ge}from"./select--26O8gr7.js";import{t as _e}from"./spinner-DiQtYQvU.js";import{a as q}from"./relay-DcCuBtiq.js";import{D as ve,J as ye,O as be,c as xe,o as Se,r as Ce,s as J,x as Y}from"./useSettings-CnHpxSBo.js";import{f as we}from"./server-DKB_3xTN.js";import{i as Te,n as Ee}from"./session-D_OiLzln.js";import{t as De}from"./query-DmYgeaGK.js";import{t as Oe}from"./use-atom-command-Bfi4daMj.js";import{t as ke}from"./env-BfPir1X4.js";import{a as Ae,n as je,t as Me}from"./tooltip-DDv-MvO4.js";import{t as Ne}from"./input-BwujRX3Y.js";import{a as Pe,c as Fe,i as Ie,n as Le,o as Re,r as ze,s as Be,t as Ve}from"./dialog-BJ3R7bWN.js";import{i as He,t as Ue}from"./device-DuASmK9r.js";import{a as We,i as Ge,l as Ke,n as qe,o as Je,t as Ye,u as Xe}from"./DeviceSetup-DwoJ9gYG.js";import{t as Ze}from"./AnimatedHeight-CVfEvZ5q.js";import{i as Qe,n as $e}from"./Icons-CnCqDzcX.js";import{t as et}from"./preview-rGycedjV.js";import{r as tt}from"./preview-eatXH_DC.js";import{a as nt,i as rt,o as it,t as at}from"./popover-D2KZg7__.js";import{a as ot,i as st,n as ct,o as lt,r as ut,s as dt,t as ft}from"./alert-dialog-BRZulAlJ.js";import{F as pt,R as mt,V as ht,a as X,c as gt,i as _t,r as vt,s as yt,w as bt}from"./settingsLayout-EWRSNE9F.js";import{$a as xt,Lr as St,Po as Ct,Wo as wt,eo as Tt,so as Et}from"./main-D8lKEPYS.js";import{t as Dt}from"./ProjectDefaultsSettings-BuSgjMGJ.js";import{t as Ot}from"./draft-input-D7yqLT1A.js";import{t as kt}from"./ScopedSwitch-BC1gPotW.js";import{t as At}from"./SecretInput-CTGlsesz.js";import{n as jt,r as Mt,t as Nt}from"./usePermissionStatus-CTyZ03Js.js";var Z=n(),Q=e(r(),1);function Pt(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(Ft).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)(v,{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)(it,{"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)(nt,{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 y=a?`Managed by ${a}. `:``,b;t[12]===y?b=t[13]:(b=(0,Q.jsxs)(`p`,{className:`mt-4 border-t border-border/50 pt-3 text-xs text-muted-foreground`,children:[y,`Tools update automatically on this host when needed.`]}),t[12]=y,t[13]=b);let x;t[14]===o?x=t[15]:(x=o?(0,Q.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-destructive`,children:o}):null,t[14]=o,t[15]=x);let S;t[16]===r?S=t[17]:(S=r?(0,Q.jsx)(`div`,{className:`mt-3`,children:r}):null,t[16]=r,t[17]=S);let C;t[18]!==b||t[19]!==x||t[20]!==S||t[21]!==g||t[22]!==_?(C=(0,Q.jsxs)(rt,{align:`end`,width:`md`,children:[g,_,b,x,S]}),t[18]=b,t[19]=x,t[20]=S,t[21]=g,t[22]=_,t[23]=C):C=t[23];let w;return t[24]!==C||t[25]!==m?(w=(0,Q.jsxs)(at,{children:[m,C]}),t[24]=C,t[25]=m,t[26]=w):w=t[26],w}function Ft(e,t){return e.localeCompare(t,void 0,{numeric:!0})}var $=e(t(),1);function It(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 Lt(e){let t=(0,Z.c)(4),{platforms:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Rt),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 Rt(e){return(0,Q.jsxs)(Me,{children:[(0,Q.jsxs)(Ae,{render:(0,Q.jsx)(`span`,{tabIndex:0,className:`inline-flex items-center gap-1`}),children:[e.available?(0,Q.jsx)(u,{className:`size-3`}):(0,Q.jsx)(f,{className:`size-3`}),e.platform===`ios`?`iOS`:`Android`,` `,e.available?`available`:`unavailable`]}),(0,Q.jsx)(je,{children:e.reason??(e.platform===`ios`?`iOS available`:`Android available`)})]},e.platform)}var zt=j(N);function Bt(e){let{identityFile:t,...n}=e;return zt({...n,...t?.trim()?{identityFile:t.trim()}:{}})}function Vt(e){return JSON.stringify([e.target.trim(),e.port,e.identityFile?.trim()||void 0])}async function Ht(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 Ut(e){let t=Oe(Ue.testHost,{reportFailure:!1}),[n,r]=(0,$.useState)({}),i=(0,$.useRef)(new Set);return{checks:n,testConnection:async n=>{let a=Vt(n);if(i.current.has(a))return;i.current.add(a),r(e=>({...e,[a]:{}}));let o={};try{return await Ht(e,n,async(e,n)=>{if(!Ee(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(k(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 Wt(e){let t=(0,Z.c)(107),{host:n,isNew:r,targets:i,busy:a,onSave:o,onClose:s}=e,[c,d]=(0,$.useState)(n),{checks:f,testConnection:p}=Ut(i),m=f[Vt(c)],h=Object.values(m??{}).some(Kt),g,_;t[0]===c?(g=t[1],_=t[2]):(g=Bt({...c,label:c.label.trim()||c.target}),_=ee(g),t[0]=c,t[1]=g,t[2]=_);let v=_,y;t[3]===m?y=t[4]:(y=Object.values(m??{}).filter(Gt),t[3]=m,t[4]=y);let x=y.length,S;t[5]!==a||t[6]!==s?(S=e=>{!e&&!a&&s()},t[5]=a,t[6]=s,t[7]=S):S=t[7];let w=!a,T;t[8]!==a||t[9]!==h||t[10]!==c.label||t[11]!==g||t[12]!==o?(T=(0,Q.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),ee(g)&&c.label.trim()&&!a&&!h&&o(g.value)}}),t[8]=a,t[9]=h,t[10]=c.label,t[11]=g,t[12]=o,t[13]=T):T=t[13];let E=r?`Add device host`:`Edit device host`,D;t[14]===E?D=t[15]:(D=(0,Q.jsx)(Fe,{children:E}),t[14]=E,t[15]=D);let O=i.length===1?`Connect from ${i[0]?.label}.`:`Connect from ${i.length} selected environments.`,k;t[16]===O?k=t[17]:(k=(0,Q.jsxs)(ze,{children:[O,` `,`Hosts on the same machine are skipped.`]}),t[16]=O,t[17]=k);let A;t[18]!==D||t[19]!==k?(A=(0,Q.jsxs)(Pe,{children:[D,k]}),t[18]=D,t[19]=k,t[20]=A):A=t[20];let j;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Q.jsx)(`span`,{children:`Name`}),t[21]=j):j=t[21];let M;t[22]===c?M=t[23]:(M=e=>d({...c,label:e.target.value}),t[22]=c,t[23]=M);let N;t[24]!==a||t[25]!==c.label||t[26]!==M?(N=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[j,(0,Q.jsx)(Ne,{autoFocus:!0,required:!0,value:c.label,disabled:a,onChange:M,placeholder:`Mac mini`})]}),t[24]=a,t[25]=c.label,t[26]=M,t[27]=N):N=t[27];let P;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(`span`,{children:`SSH target`}),t[28]=P):P=t[28];let F;t[29]===c?F=t[30]:(F=e=>d({...c,target:e.target.value}),t[29]=c,t[30]=F);let I;t[31]!==a||t[32]!==c.target||t[33]!==F?(I=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[P,(0,Q.jsx)(Ne,{required:!0,value:c.target,disabled:a,onChange:F,placeholder:`user@host or SSH alias`})]}),t[31]=a,t[32]=c.target,t[33]=F,t[34]=I):I=t[34];let L=n.port!==void 0||n.identityFile!==void 0||void 0,R;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Q.jsx)(`summary`,{className:`cursor-pointer text-muted-foreground`,children:`SSH options`}),t[35]=R):R=t[35];let z;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(`span`,{children:`Identity file`}),t[36]=z):z=t[36];let B=c.identityFile??``,V;t[37]===c?V=t[38]:(V=e=>{let{identityFile:t,...n}=c;d(e.target.value?{...n,identityFile:e.target.value}:n)},t[37]=c,t[38]=V);let te;t[39]!==a||t[40]!==B||t[41]!==V?(te=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[z,(0,Q.jsx)(Ne,{value:B,disabled:a,onChange:V,placeholder:`SSH config default`})]}),t[39]=a,t[40]=B,t[41]=V,t[42]=te):te=t[42];let ne;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(`span`,{children:`Port`}),t[43]=ne):ne=t[43];let re=c.port??``,ie;t[44]===c?ie=t[45]:(ie=e=>{let{port:t,...n}=c;d(e.target.value?{...n,port:Number(e.target.value)}:n)},t[44]=c,t[45]=ie);let ae;t[46]!==a||t[47]!==re||t[48]!==ie?(ae=(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[ne,(0,Q.jsx)(Ne,{type:`number`,min:1,max:65535,value:re,disabled:a,onChange:ie,placeholder:`Default`})]}),t[46]=a,t[47]=re,t[48]=ie,t[49]=ae):ae=t[49];let H;t[50]!==te||t[51]!==ae?(H=(0,Q.jsxs)(`div`,{className:`mt-3 grid grid-cols-[minmax(0,1fr)_7rem] gap-3`,children:[te,ae]}),t[50]=te,t[51]=ae,t[52]=H):H=t[52];let oe;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Optional. Resolved separately on each environment.`}),t[53]=oe):oe=t[53];let U;t[54]!==L||t[55]!==H?(U=(0,Q.jsxs)(`details`,{open:L,className:`text-sm`,children:[R,H,oe]}),t[54]=L,t[55]=H,t[56]=U):U=t[56];let se=h?`Checking environments…`:m?x?`${x} of ${i.length} failed`:`Connection checks passed`:`Check access before saving`,ce;t[57]===se?ce=t[58]:(ce=(0,Q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:se}),t[57]=se,t[58]=ce);let le=a||h||!v,W;t[59]!==g||t[60]!==p?(W=()=>{ee(g)&&p(g.value)},t[59]=g,t[60]=p,t[61]=W):W=t[61];let ue;t[62]===h?ue=t[63]:(ue=h?(0,Q.jsx)(_e,{size:`xs`}):null,t[62]=h,t[63]=ue);let G;t[64]!==le||t[65]!==W||t[66]!==ue?(G=(0,Q.jsxs)(b,{type:`button`,size:`sm`,variant:`outline`,disabled:le,onClick:W,children:[ue,` Test connection`]}),t[64]=le,t[65]=W,t[66]=ue,t[67]=G):G=t[67];let K;t[68]!==ce||t[69]!==G?(K=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2.5`,children:[ce,G]}),t[68]=ce,t[69]=G,t[70]=K):K=t[70];let de;t[71]!==m||t[72]!==i?(de=m?(0,Q.jsx)(`ul`,{className:`border-t border-border/60 divide-y divide-border/40`,children:i.map(e=>{let t=m[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)(_e,{size:`xs`}),` Checking…`]}):t.status===`local`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(l,{className:`size-3`}),` Already available locally`]}):t.status===`failed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(C,{className:`size-3`}),` Failed`]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(u,{className:`size-3`}),` Connected`]})})]}),t.status===`connected`?(0,Q.jsx)(`div`,{className:`mt-1.5`,children:(0,Q.jsx)(Lt,{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]=m,t[72]=i,t[73]=de):de=t[73];let fe;t[74]!==K||t[75]!==de?(fe=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border/60`,children:[K,de]}),t[74]=K,t[75]=de,t[76]=fe):fe=t[76];let pe;t[77]!==N||t[78]!==I||t[79]!==U||t[80]!==fe?(pe=(0,Q.jsxs)(Re,{children:[N,I,U,fe]}),t[77]=N,t[78]=I,t[79]=U,t[80]=fe,t[81]=pe):pe=t[81];let me;t[82]!==a||t[83]!==s?(me=(0,Q.jsx)(b,{type:`button`,variant:`ghost`,disabled:a,onClick:s,children:`Cancel`}),t[82]=a,t[83]=s,t[84]=me):me=t[84];let he;t[85]!==a||t[86]!==h||t[87]!==c.label||t[88]!==v?(he=a||h||!v||!c.label.trim(),t[85]=a,t[86]=h,t[87]=c.label,t[88]=v,t[89]=he):he=t[89];let ge;t[90]===a?ge=t[91]:(ge=a?(0,Q.jsx)(_e,{size:`xs`}):null,t[90]=a,t[91]=ge);let q;t[92]!==he||t[93]!==ge?(q=(0,Q.jsxs)(b,{type:`submit`,disabled:he,children:[ge,` Save host`]}),t[92]=he,t[93]=ge,t[94]=q):q=t[94];let ve;t[95]!==me||t[96]!==q?(ve=(0,Q.jsxs)(Ie,{children:[me,q]}),t[95]=me,t[96]=q,t[97]=ve):ve=t[97];let ye;t[98]!==A||t[99]!==pe||t[100]!==w||t[101]!==ve||t[102]!==T?(ye=(0,Q.jsxs)(Be,{showCloseButton:w,render:T,children:[A,pe,ve]}),t[98]=A,t[99]=pe,t[100]=w,t[101]=ve,t[102]=T,t[103]=ye):ye=t[103];let be;return t[104]!==S||t[105]!==ye?(be=(0,Q.jsx)(Ve,{open:!0,onOpenChange:S,children:ye}),t[104]=S,t[105]=ye,t[106]=be):be=t[106],be}function Gt(e){return e.status===`failed`}function Kt(e){return e.status===`pending`}function qt(e){let{scope:t,environments:n,connectedEnvironments:r}=ht(),i=Te(e.environmentId,ne),a=t.kind===`project`||t.kind===`checkout`,o=Oe(we.updateSettings,{reportFailure:!1}),[s,c]=(0,$.useState)(null),[l,u]=(0,$.useState)(null),[d,f]=(0,$.useState)(!1),p=n.map(e=>({environmentId:e.environmentId,label:e.label,connected:e.connection.phase===`connected`})),{checks:h,testConnection:g}=Ut(p),_=async(t,r=!1,i=t)=>{if(e.environmentId&&!a){f(!0);try{let e=await Promise.allSettled(n.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!Ee(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return o({environmentId:e.environmentId,input:{patch:{deviceHosts:It(e.serverConfig.settings.deviceHosts,t,r,i)}}})})),a=n.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});a.length===0?c(null):q.add({type:`error`,title:`Device hosts not saved on all environments`,description:`Could not update ${a.map(e=>e.label).join(`, `)}.`})}finally{f(!1)}}};return(0,Q.jsx)(X,{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)(b,{size:`sm`,variant:`outline`,disabled:!i||a||d||!e.environmentId||s!==null,onClick:()=>{u(null),c({kind:`ssh`,id:y(),label:``,target:``})},children:[(0,Q.jsx)(m,{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:[r.map(e=>(0,Q.jsxs)(`div`,{children:[r.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)(Jt,{environmentLabel:e.label,environmentId:e.environmentId,hosts:e.serverConfig?.settings.deviceHosts??[],busy:!i||a||d,checks:h,testConnection:async e=>{let t=await g(e);if(!t)return;let n=p.filter(e=>t[e.environmentId]?.status===`failed`);return q.add({type:n.length?`error`:`success`,title:n.length?`${e.label}: ${n.length} of ${p.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=>{u(e),c(e)},onRemove:e=>void _(e,!0)})]},e.environmentId)),s?(0,Q.jsx)(Wt,{host:s,isNew:l===null,targets:p,busy:d,onSave:e=>void _(e,!1,l??e),onClose:()=>c(null)},s.id):null]}):(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Connect a selected environment to manage device hosts.`})})})}function Jt(e){let t=(0,Z.c)(28),{environmentLabel:n,environmentId:r,hosts:i,busy:a,onEdit:o,onRemove:s,checks:c,testConnection:l}=e,{state:u}=He(r),f=Oe(Ue.list),[p,m]=(0,$.useState)(null),g;t[0]===i.length?g=t[1]:(g=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]=g);let v;if(t[2]!==a||t[3]!==c||t[4]!==r||t[5]!==n||t[6]!==i||t[7]!==o||t[8]!==s||t[9]!==f||t[10]!==p||t[11]!==u||t[12]!==l){let e;t[14]!==a||t[15]!==c||t[16]!==r||t[17]!==n||t[18]!==o||t[19]!==s||t[20]!==f||t[21]!==p||t[22]!==u||t[23]!==l?(e=e=>{let t=u.hostStatuses[e.id],i=c[Vt(e)]?.[r],g=(i?.status===`connected`?i.platforms:void 0)??u.hosts.find(t=>t.id===e.id)?.platforms??[],v=i?.status===`pending`?`Checking connection…`:t?.status===`installing`?`Installing device support…`:t?.status===`starting`?`Connecting…`:null,y=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}),g.filter(Xt).map(Yt)]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.target}),(0,Q.jsx)(Pt,{owner:n,error:u.hosts.find(t=>t.id===e.id)?.toolInspectionError,tools:u.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,y?(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:y})]})}):null]}),v?(0,Q.jsxs)(`span`,{role:`status`,className:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,Q.jsx)(_e,{size:`xs`}),v]}):null,(0,Q.jsxs)(h,{children:[(0,Q.jsx)(_,{render:(0,Q.jsx)(b,{size:`icon-sm`,variant:`ghost-muted`,disabled:a,"aria-label":e.label+` options`}),children:(0,Q.jsx)(d,{})}),(0,Q.jsxs)(w,{align:`end`,children:[(0,Q.jsx)(O,{onClick:()=>{o(e)},children:`Edit`}),(0,Q.jsx)(O,{variant:`destructive`,onClick:()=>s(e),children:`Remove`})]})]}),t?.status===`failed`&&u.supportsHostRetry&&u.hostStatus!==`disabled`?(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:a||p!==null,onClick:()=>{m(e.id),f({environmentId:r,input:{retryHostId:e.id}}).finally(()=>m(null))},children:p===e.id?`Retrying…`:`Retry`}):(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:a||v!==null,onClick:()=>void l(e),children:`Test connection`})]},e.id)},t[14]=a,t[15]=c,t[16]=r,t[17]=n,t[18]=o,t[19]=s,t[20]=f,t[21]=p,t[22]=u,t[23]=l,t[24]=e):e=t[24],v=i.map(e),t[2]=a,t[3]=c,t[4]=r,t[5]=n,t[6]=i,t[7]=o,t[8]=s,t[9]=f,t[10]=p,t[11]=u,t[12]=l,t[13]=v}else v=t[13];let y;return t[25]!==g||t[26]!==v?(y=(0,Q.jsxs)(Q.Fragment,{children:[g,v]}),t[25]=g,t[26]=v,t[27]=y):y=t[27],y}function Yt(e){return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ae,{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)(Qe,{className:`size-3.5 -translate-y-px`}):(0,Q.jsx)($e,{className:`size-3.5`})}),(0,Q.jsx)(je,{children:e.platform===`ios`?`iOS available`:`Android available`})]},e.platform)}function Xt(e){return e.available}var Zt=j(M),Qt=e=>({kind:`eas`,id:e,label:`EAS Simulator`,accessToken:``,maxSessionMinutes:30,idleMinutes:10,maxConcurrentSessions:2});function $t(e,t,n){return n?e.filter(e=>e.id!==t.id):e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[...e,t]}function en(e){return`Up to ${e.maxConcurrentSessions===1?`1 session`:`${e.maxConcurrentSessions} sessions`} at once, each stopped after ${e.maxSessionMinutes} min or ${e.idleMinutes} idle min`}var tn=`thread-project`,nn={settings:`the access token saved here`,env:`EXPO_TOKEN on the server`,"eas-login":`the server's eas login`},rn=e=>{let t=F(e);return t instanceof Error?t.message:String(t)};function an(e){let t=(0,Z.c)(24),{scope:n,connectedEnvironments:r}=ht(),o=Te(e.environmentId,ne),s=n.kind===`project`||n.kind===`checkout`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={reportFailure:!1},t[0]=c):c=t[0];let l=Oe(we.updateSettings,c),u;t[1]===e.environmentId?u=t[2]:(u=t=>t.environmentId===e.environmentId,t[1]=e.environmentId,t[2]=u);let d=r.find(u)?.serverConfig?.settings.easDeviceHosts??[],[f,p]=(0,$.useState)(null),[m,h]=(0,$.useState)(!1),g=!o||s||m||!e.environmentId,_=async(t,n)=>{if(!e.environmentId||!Ee(e.environmentId,`settings:write`))return;h(!0);let r=await l({environmentId:e.environmentId,input:{patch:{easDeviceHosts:$t(d,t,n)}}});h(!1),r._tag===`Success`?p(null):q.add({type:`error`,title:n?`EAS host not removed`:`EAS host not saved`,description:rn(r.cause)})},v=X,x;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=[`easDeviceHosts`],t[3]=x):x=t[3];let S=g||f!==null,C;t[4]===p?C=t[5]:(C=()=>p({host:Qt(y()),isNew:!0}),t[4]=p,t[5]=C);let w;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(a,{className:`size-3.5`}),t[6]=w):w=t[6];let T;t[7]!==S||t[8]!==C?(T=(0,Q.jsxs)(b,{size:`sm`,variant:`outline`,disabled:S,onClick:C,children:[w,` Add EAS host`]}),t[7]=S,t[8]=C,t[9]=T):T=t[9];let E=d.length===0?(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No EAS hosts.`}):(0,Q.jsx)(`ul`,{className:`divide-y divide-border/40`,children:d.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-2.5 text-sm`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 truncate font-medium`,children:[(0,Q.jsx)(i,{className:`size-3.5 shrink-0`}),` `,e.label]}),(0,Q.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:en(e)})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,Q.jsx)(b,{size:`sm`,variant:`ghost`,disabled:g,onClick:()=>p({host:e,isNew:!1}),children:`Edit`}),(0,Q.jsx)(b,{size:`sm`,variant:`ghost-destructive`,disabled:g,onClick:()=>void _(e,!0),children:`Remove`})]})]},e.id))}),D;t[10]!==m||t[11]!==f||t[12]!==e.environmentId||t[13]!==_||t[14]!==p?(D=f&&e.environmentId?(0,Q.jsx)(on,{environmentId:e.environmentId,host:f.host,isNew:f.isNew,busy:m,onSave:e=>void _(e,!1),onClose:()=>p(null)},f.host.id):null,t[10]=m,t[11]=f,t[12]=e.environmentId,t[13]=_,t[14]=p,t[15]=D):D=t[15];let O;t[16]!==E||t[17]!==D?(O=(0,Q.jsxs)(`div`,{className:`pt-3 pb-2`,children:[E,D]}),t[16]=E,t[17]=D,t[18]=O):O=t[18];let k;return t[19]!==v||t[20]!==T||t[21]!==O||t[22]!==x?(k=(0,Q.jsx)(v,{id:`eas-device-hosts`,title:`EAS Simulator`,serverScoped:!0,settingKeys:x,description:`Run iOS Simulators and Android emulators in Expo's cloud from this environment. Sessions bill the Expo account until they stop, so each host limits how many run and for how long. Editing or removing a host stops its running sessions.`,control:T,children:O}),t[19]=v,t[20]=T,t[21]=O,t[22]=x,t[23]=k):k=t[23],k}function on(e){let t=(0,Z.c)(135),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={reportFailure:!1},t[0]=n):n=t[0];let r=Oe(Ue.easAccount,n),[i,a]=(0,$.useState)(e.host),s=(0,$.useId)(),c;t[1]===e.host.accessToken?c=t[2]:(c=e.host.accessToken?{kind:`saved`}:{kind:`cleared`},t[1]=e.host.accessToken,t[2]=c);let[l,u]=(0,$.useState)(c),d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={status:`checking`},t[3]=d):d=t[3];let[f,p]=(0,$.useState)(d),m,h;t[4]!==i||t[5]!==e.host.accessToken||t[6]!==l.kind||t[7]!==l.value?(m={...i,label:i.label.trim(),accessToken:l.kind===`saved`?e.host.accessToken:l.kind===`new`?l.value:``},h=ee(Zt(m)),t[4]=i,t[5]=e.host.accessToken,t[6]=l.kind,t[7]=l.value,t[8]=m,t[9]=h):(m=t[8],h=t[9]);let g=h,_=g?null:i.maxSessionMinutes>0&&i.idleMinutes>=i.maxSessionMinutes?`Idle minutes must be smaller than session minutes.`:`Give the host a label and limits within the ranges shown.`,v;t[10]!==f.account||t[11]!==f.status?(v=f.status===`signed-in`?f.account.apps:[],t[10]=f.account,t[11]=f.status,t[12]=v):v=t[12];let y=v,x=(0,$.useRef)(0),S;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{x.current+=1,p({status:`idle`})},t[13]=S):S=t[13];let C=S,w;t[14]!==r||t[15]!==e.environmentId||t[16]!==e.host.id||t[17]!==e.isNew||t[18]!==l.kind||t[19]!==l.value?(w=async()=>{let t=x.current+=1,n=await r({environmentId:e.environmentId,input:{...l.kind===`saved`&&!e.isNew?{hostId:e.host.id}:{},...l.kind===`new`?{accessToken:l.value}:l.kind===`cleared`?{accessToken:``}:{}}});t===x.current&&p(n._tag===`Success`?{status:`signed-in`,account:n.value}:{status:`failed`,error:rn(n.cause)})},t[14]=r,t[15]=e.environmentId,t[16]=e.host.id,t[17]=e.isNew,t[18]=l.kind,t[19]=l.value,t[20]=w):w=t[20];let T=w,E;t[21]===T?E=t[22]:(E=()=>{p({status:`checking`}),T()},t[21]=T,t[22]=E);let D=E,O;t[23]===T?O=t[24]:(O=()=>void T(),t[23]=T,t[24]=O);let k=(0,$.useEffectEvent)(O),A;t[25]===k?A=t[26]:(A=()=>{k()},t[25]=k,t[26]=A);let j;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(j=[],t[27]=j):j=t[27],(0,$.useEffect)(A,j);let M;t[28]!==i||t[29]!==e.busy?(M=(t,n,r)=>(0,Q.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,Q.jsx)(`span`,{children:n}),(0,Q.jsx)(Ne,{type:`number`,min:1,max:r,value:i[t],disabled:e.busy,onChange:e=>{let n=Number(e.target.value);a(e=>({...e,[t]:n}))}})]}),t[28]=i,t[29]=e.busy,t[30]=M):M=t[30];let N=M,P;t[31]===e?P=t[32]:(P=t=>{!t&&!e.busy&&e.onClose()},t[31]=e,t[32]=P);let F=!e.busy,I;t[33]!==m||t[34]!==e||t[35]!==g?(I=t=>{t.preventDefault(),g&&!e.busy&&e.onSave(m)},t[33]=m,t[34]=e,t[35]=g,t[36]=I):I=t[36];let L=e.isNew?`Add EAS host`:`Edit EAS host`,R;t[37]===L?R=t[38]:(R=(0,Q.jsx)(Fe,{children:L}),t[37]=L,t[38]=R);let z;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Q.jsx)(ze,{children:`The environment's server signs in to Expo and starts the sessions. Without a token here it uses EXPO_TOKEN, then its eas login.`}),t[39]=z):z=t[39];let B;t[40]===R?B=t[41]:(B=(0,Q.jsxs)(Pe,{children:[R,z]}),t[40]=R,t[41]=B);let V;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Q.jsx)(`span`,{children:`Name`}),t[42]=V):V=t[42];let te;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(te=e=>{let t=e.target.value;a(e=>({...e,label:t}))},t[43]=te):te=t[43];let ne;t[44]!==i.label||t[45]!==e.busy?(ne=(0,Q.jsxs)(`label`,{className:`block space-y-1.5 text-sm`,children:[V,(0,Q.jsx)(Ne,{autoFocus:!0,required:!0,value:i.label,disabled:e.busy,onChange:te})]}),t[44]=i.label,t[45]=e.busy,t[46]=ne):ne=t[46];let re;t[47]===s?re=t[48]:(re=(0,Q.jsx)(`label`,{htmlFor:s,className:`block`,children:`Expo access token`}),t[47]=s,t[48]=re);let ie=l.kind===`saved`,ae=l.kind===`new`?l.value:``,H;t[49]===e.host.accessToken?H=t[50]:(H=t=>{let n=t.target.value;u(n?{kind:`new`,value:n}:e.host.accessToken?{kind:`saved`}:{kind:`cleared`}),C()},t[49]=e.host.accessToken,t[50]=H);let oe;t[51]!==e.busy||t[52]!==ie||t[53]!==ae||t[54]!==H||t[55]!==s?(oe=(0,Q.jsx)(At,{id:s,className:`min-w-0 flex-1`,configured:ie,value:ae,disabled:e.busy,placeholder:`Optional`,onChange:H}),t[51]=e.busy,t[52]=ie,t[53]=ae,t[54]=H,t[55]=s,t[56]=oe):oe=t[56];let U;t[57]===l.kind?U=t[58]:(U=l.kind===`cleared`?null:(0,Q.jsx)(b,{type:`button`,size:`icon-sm`,variant:`ghost-destructive`,"aria-label":`Clear access token`,onClick:()=>{u({kind:`cleared`}),C()},children:(0,Q.jsx)(o,{className:`size-3.5`})}),t[57]=l.kind,t[58]=U);let se;t[59]!==oe||t[60]!==U?(se=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[oe,U]}),t[59]=oe,t[60]=U,t[61]=se):se=t[61];let ce;t[62]!==re||t[63]!==se?(ce=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[re,se]}),t[62]=re,t[63]=se,t[64]=ce):ce=t[64];let le=f.status===`signed-in`?`Signed in as ${f.account.signedInAs} with ${nn[f.account.credentialSource]}.`:f.status===`failed`?f.error:f.status===`checking`?`Checking the Expo account…`:`Check the Expo account before choosing a project.`,W;t[65]===le?W=t[66]:(W=(0,Q.jsx)(`p`,{role:`status`,className:`min-w-0 text-xs text-muted-foreground`,children:le}),t[65]=le,t[66]=W);let ue=e.busy||f.status===`checking`,G;t[67]===D?G=t[68]:(G=()=>void D(),t[67]=D,t[68]=G);let fe;t[69]===f.status?fe=t[70]:(fe=f.status===`checking`?(0,Q.jsx)(_e,{size:`xs`}):null,t[69]=f.status,t[70]=fe);let me;t[71]!==ue||t[72]!==G||t[73]!==fe?(me=(0,Q.jsxs)(b,{type:`button`,size:`sm`,variant:`outline`,disabled:ue,onClick:G,children:[fe,` Check account`]}),t[71]=ue,t[72]=G,t[73]=fe,t[74]=me):me=t[74];let q;t[75]!==W||t[76]!==me?(q=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border/60 px-3 py-2.5`,children:[W,me]}),t[75]=W,t[76]=me,t[77]=q):q=t[77];let ve;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Q.jsx)(`span`,{children:`EAS project`}),t[78]=ve):ve=t[78];let ye=i.appId??tn,be=e.busy,xe;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(xe=e=>{typeof e==`string`&&a(t=>{let{appId:n,...r}=t;return e===tn?r:{...r,appId:e}})},t[79]=xe):xe=t[79];let Se;t[80]===y?Se=t[81]:(Se=(0,Q.jsx)(he,{size:`sm`,"aria-label":`EAS project`,children:(0,Q.jsx)(de,{children:e=>e===tn?`From the thread's project`:y.find(t=>t.id===e)?.fullName??e})}),t[80]=y,t[81]=Se);let Ce;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Q.jsx)(K,{value:tn,children:`From the thread's project`}),t[82]=Ce):Ce=t[82];let J;t[83]!==y||t[84]!==i.appId?(J=i.appId&&!y.some(e=>e.id===i.appId)?(0,Q.jsx)(K,{value:i.appId,children:i.appId}):null,t[83]=y,t[84]=i.appId,t[85]=J):J=t[85];let Y;t[86]===y?Y=t[87]:(Y=y.map(sn),t[86]=y,t[87]=Y);let we;t[88]!==J||t[89]!==Y?(we=(0,Q.jsxs)(pe,{children:[Ce,J,Y]}),t[88]=J,t[89]=Y,t[90]=we):we=t[90];let Te;t[91]!==e.busy||t[92]!==ye||t[93]!==Se||t[94]!==we?(Te=(0,Q.jsxs)(ge,{value:ye,disabled:be,onValueChange:xe,children:[Se,we]}),t[91]=e.busy,t[92]=ye,t[93]=Se,t[94]=we,t[95]=Te):Te=t[95];let Ee;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Sessions bill the project's Expo account. "From the thread's project" reads extra.eas.projectId from the project's app config.`}),t[96]=Ee):Ee=t[96];let De;t[97]===Te?De=t[98]:(De=(0,Q.jsxs)(`div`,{className:`space-y-1.5 text-sm`,children:[ve,Te,Ee]}),t[97]=Te,t[98]=De);let ke;t[99]===N?ke=t[100]:(ke=(0,Q.jsxs)(`div`,{className:`grid grid-cols-3 gap-3 text-sm`,children:[N(`maxConcurrentSessions`,`Sessions at once`,20),N(`maxSessionMinutes`,`Session minutes`,115),N(`idleMinutes`,`Idle minutes`,60)]}),t[99]=N,t[100]=ke);let Ae=e.isNew?null:` Saving restarts this host, which stops its running sessions.`,je;t[101]===Ae?je=t[102]:(je=(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Expo allows sessions of up to 40 minutes on free accounts and 115 on paid ones, and ends one after the idle minutes without activity, so idle minutes must be smaller than session minutes.`,Ae]}),t[101]=Ae,t[102]=je);let Me;t[103]===_?Me=t[104]:(Me=_===null?null:(0,Q.jsx)(`p`,{className:`text-xs text-destructive`,role:`alert`,children:_}),t[103]=_,t[104]=Me);let Le;t[105]!==ne||t[106]!==ce||t[107]!==q||t[108]!==De||t[109]!==ke||t[110]!==je||t[111]!==Me?(Le=(0,Q.jsxs)(Re,{children:[ne,ce,q,De,ke,je,Me]}),t[105]=ne,t[106]=ce,t[107]=q,t[108]=De,t[109]=ke,t[110]=je,t[111]=Me,t[112]=Le):Le=t[112];let He;t[113]!==e.busy||t[114]!==e.onClose?(He=(0,Q.jsx)(b,{type:`button`,variant:`ghost`,disabled:e.busy,onClick:e.onClose,children:`Cancel`}),t[113]=e.busy,t[114]=e.onClose,t[115]=He):He=t[115];let We=e.busy||!g,Ge;t[116]===e.busy?Ge=t[117]:(Ge=e.busy?(0,Q.jsx)(_e,{size:`xs`}):null,t[116]=e.busy,t[117]=Ge);let Ke;t[118]!==We||t[119]!==Ge?(Ke=(0,Q.jsxs)(b,{type:`submit`,disabled:We,children:[Ge,` Save host`]}),t[118]=We,t[119]=Ge,t[120]=Ke):Ke=t[120];let qe;t[121]!==He||t[122]!==Ke?(qe=(0,Q.jsxs)(Ie,{children:[He,Ke]}),t[121]=He,t[122]=Ke,t[123]=qe):qe=t[123];let Je;t[124]!==I||t[125]!==B||t[126]!==Le||t[127]!==qe?(Je=(0,Q.jsxs)(`form`,{className:`flex min-h-0 flex-col`,onSubmit:I,children:[B,Le,qe]}),t[124]=I,t[125]=B,t[126]=Le,t[127]=qe,t[128]=Je):Je=t[128];let Ye;t[129]!==F||t[130]!==Je?(Ye=(0,Q.jsx)(Be,{showCloseButton:F,children:Je}),t[129]=F,t[130]=Je,t[131]=Ye):Ye=t[131];let Xe;return t[132]!==P||t[133]!==Ye?(Xe=(0,Q.jsx)(Ve,{open:!0,onOpenChange:P,children:Ye}),t[132]=P,t[133]=Ye,t[134]=Xe):Xe=t[134],Xe}function sn(e){return(0,Q.jsx)(K,{value:e.id,children:e.fullName},e.id)}function cn(e,t){if(e)return{kind:`new`};let n=t[0];return n?{kind:`existing`,profileId:n.id}:{kind:`new`}}function ln(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 un(e){return e.step!==`importing`}function dn(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 fn(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 pn(e){return e===void 0?{step:`blocked`,reason:`unknownSource`}:dn(e)}function mn(e){let t=pn(e);return t.step===`fullDiskAccess`?{...t,checked:!0}:t}function hn(e,t){return t.profiles.some(t=>t.directory===e)?e:t.profiles[0]?.directory??``}function gn(e){switch(e){case`needsKeychainApproval`:case`keychainItemMissing`:case`keychainUnavailable`:case`readFailed`:case`sessionUnavailable`:case`profileNotSaved`:return!0;default:return!1}}function _n(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 vn(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=()=>dn(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),b;t[4]!==a||t[5]!==i?(b=()=>cn(a,i),t[4]=a,t[5]=i,t[6]=b):b=t[6];let[x,S]=(0,$.useState)(b),[C,w]=(0,$.useState)(),T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=y(),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=ln(x,E.current,i);e===void 0?(w(`That profile is no longer available. Choose where to import these cookies.`),h({step:`configure`})):(w(void 0),D.current=!0,h({step:`importing`}),o({sourceProfileDirectory:_,target:e}).then(e=>h(fn(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=>hn(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`,pn),t[15]=j,t[16]=M);let N=M,P;t[17]===j?P=t[18]:(P=()=>j(`fullDiskAccess`,mn),t[17]=j,t[18]=P);let F=P,I;t[19]!==u||t[20]!==m?(I=e=>e||!un(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=un(m),t[22]=m,t[23]=L);let R;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?(R=m.step===`quit`?(0,Q.jsx)(yn,{source:d,onCancel:u,onRechecked:N}):m.step===`fullDiskAccess`?(0,Q.jsx)(Sn,{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)(En,{sourceName:d.name,check:m.check}):m.step===`done`?(0,Q.jsx)(Dn,{...m,destinationEnvironmentName:r,onClose:u}):m.step===`blocked`?(0,Q.jsx)(On,{source:d,reason:m.reason,onClose:u,onRetry:gn(m.reason)?k:void 0}):(0,Q.jsx)(Cn,{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]=R):R=t[39];let z;t[40]!==L||t[41]!==R?(z=(0,Q.jsx)(Be,{className:`max-w-lg`,showCloseButton:L,children:R}),t[40]=L,t[41]=R,t[42]=z):z=t[42];let B;return t[43]!==z||t[44]!==I?(B=(0,Q.jsx)(Ve,{open:!0,onOpenChange:I,children:z}),t[43]=z,t[44]=I,t[45]=B):B=t[45],B}function yn(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)(Pe,{children:[(0,Q.jsxs)(Fe,{children:[`Quit `,n.name,` to import`]}),(0,Q.jsxs)(ze,{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)(b,{variant:`outline`,onClick:r,children:`Cancel`}),t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=(0,Q.jsx)(b,{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)(Ie,{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 bn(e){if(e!==void 0)return e===0?`no cookies`:`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function xn(e){return`${e.toLocaleString()} ${e===1?`cookie`:`cookies`}`}function Sn(e){let t=(0,Z.c)(43),{source:n,onCancel:r,onOpenSettings:i,onGranted:a,stillRequired:o,onCheck:s}=e,[l,u]=(0,$.useState)(!1),[d,f]=(0,$.useState)(null),p;t[0]===s?p=t[1]:(p=async()=>({fullDiskAccess:await s()}),t[0]=s,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m={fullDiskAccess:!1},t[2]=m):m=t[2];let h=Nt(p,m),g;t[3]!==i||t[4]!==l?(g=()=>{l||(u(!0),f(null),Promise.resolve().then(i).catch(()=>f(`Could not open System Settings. Try Allow again.`)).finally(()=>u(!1)))},t[3]=i,t[4]=l,t[5]=g):g=t[5];let _=g,v;t[6]===n.name?v=t[7]:(v=(0,Q.jsxs)(Pe,{children:[(0,Q.jsxs)(Fe,{children:[`Let P4 Code read `,n.name,`’s cookies`]}),(0,Q.jsxs)(ze,{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]=v);let y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(c,{className:`size-8 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),t[8]=y):y=t[8];let x=`Read ${n.name}'s cookies for this import.`,S;t[9]===_?S=t[10]:(S=()=>void _(),t[9]=_,t[10]=S);let C;t[11]!==h.status.fullDiskAccess||t[12]!==x||t[13]!==S?(C=[{id:`fullDiskAccess`,icon:y,title:`Full Disk Access`,description:x,granted:h.status.fullDiskAccess,onAllow:S}],t[11]=h.status.fullDiskAccess,t[12]=x,t[13]=S,t[14]=C):C=t[14];let w;t[15]!==l||t[16]!==C?(w=(0,Q.jsx)(jt,{busy:l,permissions:C}),t[15]=l,t[16]=C,t[17]=w):w=t[17];let T;t[18]!==d||t[19]!==h.error?(T=d||h.error?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-muted-foreground`,children:d??h.error}):null,t[18]=d,t[19]=h.error,t[20]=T):T=t[20];let E;t[21]!==h||t[22]!==o?(E=h.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]=h,t[22]=o,t[23]=E):E=t[23];let D;t[24]!==T||t[25]!==E||t[26]!==w?(D=(0,Q.jsxs)(Re,{children:[w,T,E]}),t[24]=T,t[25]=E,t[26]=w,t[27]=D):D=t[27];let O;t[28]===r?O=t[29]:(O=(0,Q.jsx)(b,{variant:`outline`,onClick:r,children:`Cancel`}),t[28]=r,t[29]=O);let k;t[30]===h?k=t[31]:(k=h.isReady([`fullDiskAccess`]),t[30]=h,t[31]=k);let A;t[32]!==a||t[33]!==l||t[34]!==k?(A=(0,Q.jsx)(Mt,{ready:k,busy:l,onClick:a,children:`Continue`}),t[32]=a,t[33]=l,t[34]=k,t[35]=A):A=t[35];let j;t[36]!==O||t[37]!==A?(j=(0,Q.jsxs)(Ie,{children:[O,A]}),t[36]=O,t[37]=A,t[38]=j):j=t[38];let M;return t[39]!==D||t[40]!==j||t[41]!==v?(M=(0,Q.jsxs)(Q.Fragment,{children:[v,D,j]}),t[39]=D,t[40]=j,t[41]=v,t[42]=M):M=t[42],M}function Cn(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)(Fe,{children:[`Import from `,n.name]}),t[4]=n.name,t[5]=_);let v;t[6]===r?v=t[7]:(v=(0,Q.jsxs)(ze,{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)(Pe,{children:[_,v]}),t[8]=_,t[9]=v,t[10]=y):y=t[10];let C;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`From`}),t[11]=C):C=t[11];let w;if(t[12]!==s||t[13]!==n.profiles||t[14]!==o){let e;t[16]!==s||t[17]!==o?(e=e=>(0,Q.jsx)(wn,{selected:o===e.directory,title:e.name,subtitle:bn(e.cookieCount),onSelect:()=>s(e.directory)},e.directory),t[16]=s,t[17]=o,t[18]=e):e=t[18],w=n.profiles.map(e),t[12]=s,t[13]=n.profiles,t[14]=o,t[15]=w}else w=t[15];let T;t[19]===w?T=t[20]:(T=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[C,w]}),t[19]=w,t[20]=T);let E;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,Q.jsx)(S,{className:`size-4 sm:hidden`}),(0,Q.jsx)(x,{className:`hidden size-4 sm:block`})]}),t[21]=E):E=t[21];let D;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wide text-muted-foreground`,children:`Into`}),t[22]=D):D=t[22];let O;t[23]!==a||t[24]!==u||t[25]!==c.kind?(O=a?(0,Q.jsx)(wn,{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]=O):O=t[26];let k;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)(wn,{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],k=i.map(e),t[27]=u,t[28]=c.kind,t[29]=c.profileId,t[30]=i,t[31]=k}else k=t[31];let A;t[36]!==O||t[37]!==k?(A=(0,Q.jsxs)(`section`,{className:`flex-1 space-y-2`,children:[D,O,k]}),t[36]=O,t[37]=k,t[38]=A):A=t[38];let j;t[39]!==A||t[40]!==T?(j=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4`,children:[T,E,A]}),t[39]=A,t[40]=T,t[41]=j):j=t[41];let M;t[42]===g?M=t[43]:(M=g?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-destructive`,children:g}):null,t[42]=g,t[43]=M);let N;t[44]!==j||t[45]!==M?(N=(0,Q.jsxs)(Re,{children:[j,M]}),t[44]=j,t[45]=M,t[46]=N):N=t[46];let P;t[47]===d?P=t[48]:(P=(0,Q.jsx)(b,{variant:`outline`,onClick:d,children:`Cancel`}),t[47]=d,t[48]=P);let F=o===``||m||h,I;t[49]!==f||t[50]!==F?(I=(0,Q.jsx)(b,{disabled:F,onClick:f,children:`Import`}),t[49]=f,t[50]=F,t[51]=I):I=t[51];let L;t[52]!==P||t[53]!==I?(L=(0,Q.jsxs)(Ie,{children:[P,I]}),t[52]=P,t[53]=I,t[54]=L):L=t[54];let R;return t[55]!==N||t[56]!==L||t[57]!==y?(R=(0,Q.jsxs)(Q.Fragment,{children:[y,N,L]}),t[55]=N,t[56]=L,t[57]=y,t[58]=R):R=t[58],R}function wn(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=D(`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 d;t[6]!==c||t[7]!==l?(d=(0,Q.jsxs)(`span`,{className:`min-w-0`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=d):d=t[8];let f=n?`border-primary bg-primary text-primary-foreground`:`border-input`,p;t[9]===f?p=t[10]:(p=D(`grid size-4 shrink-0 place-items-center rounded-full border`,f),t[9]=f,t[10]=p);let m;t[11]===n?m=t[12]:(m=n?(0,Q.jsx)(u,{className:`size-2.5`}):null,t[11]=n,t[12]=m);let h;t[13]!==p||t[14]!==m?(h=(0,Q.jsx)(`span`,{className:p,children:m}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==a||t[17]!==n||t[18]!==s||t[19]!==d||t[20]!==h?(g=(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:a,className:s,children:[d,h]}),t[16]=a,t[17]=n,t[18]=s,t[19]=d,t[20]=h,t[21]=g):g=t[21],g}function Tn(){let e=(0,Z.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Pe,{children:[(0,Q.jsx)(Fe,{children:`Importing cookies`}),(0,Q.jsx)(ze,{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)(Re,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,Q.jsx)(_e,{size:`md`,tone:`muted`}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Importing…`})]})})]}),e[1]=n):n=e[1],n}function En(e){let t=(0,Z.c)(13),{sourceName:n,check:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsxs)(Fe,{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)(ze,{children:a}),t[2]=a,t[3]=o);let s;t[4]!==i||t[5]!==o?(s=(0,Q.jsxs)(Pe,{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)(_e,{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)(Re,{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 Dn(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 ${xn(n)}`:r>0?`Skipped ${xn(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)(Fe,{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?` ${xn(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)(ze,{children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Q.jsxs)(Pe,{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)(Re,{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:_n(i)})]}):null,t[15]=i,t[16]=p);let m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(b,{}),t[17]=m):m=t[17];let h;t[18]===s?h=t[19]:(h=(0,Q.jsx)(Ie,{children:(0,Q.jsx)(Le,{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 On(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)(Fe,{children:[`Couldn’t import from `,n.name]}),t[0]=n.name,t[1]=o);let s=I[r],c;t[2]===s?c=t[3]:(c=(0,Q.jsx)(ze,{children:s}),t[2]=s,t[3]=c);let l;t[4]!==o||t[5]!==c?(l=(0,Q.jsxs)(Pe,{children:[o,c]}),t[4]=o,t[5]=c,t[6]=l):l=t[6];let u;t[7]===i?u=t[8]:(u=(0,Q.jsx)(b,{variant:`outline`,onClick:i,children:`Close`}),t[7]=i,t[8]=u);let d;t[9]===a?d=t[10]:(d=a?(0,Q.jsx)(b,{onClick:a,children:`Try again`}):null,t[9]=a,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Q.jsxs)(Ie,{children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==l||t[15]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[l,f]}),t[14]=l,t[15]=f,t[16]=p):p=t[16],p}var kn=`fill`,An=`responsive`;async function jn(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 Mn(e,t,n,r=0){return(e||r>0)&&t&&n>0}var Nn={width:1280,height:800},Pn={useGrouping:!1},Fn={system:`System`,light:`Light`,dark:`Dark`},In=e=>`${Math.round(e*100)}%`,Ln=class extends Error{constructor(){super(`Browser profile limit reached.`),this.name=`ProfileLimitReachedError`}},Rn=e=>{let t=String(e?.message??``);return oe.literals.find(e=>t.includes(`failed: ${e}.`))??`readFailed`},zn=e=>e._tag===`fill`?kn:e._tag===`preset`&&Tt.some(t=>t.id===e.presetId)?e.presetId:An,Bn=e=>{let t=zn(e);return t===kn?`Fill panel`:t===An?`Responsive`:Tt.find(e=>e.id===t)?.label??`Responsive`},Vn=e=>Number.isInteger(e)&&e>=240&&e<=3840,Hn=e=>({...e,width:e.height,height:e.width});function Un(e){let t=(0,Z.c)(42),{disabled:n}=e,r=J(Gn),i=Y(),a=r._tag===`fill`?null:r,o=a?.width??Nn.width,s=a?.height??Nn.height,c;t[0]!==o||t[1]!==s?(c={width:o,height:s},t[0]=o,t[1]=s,t[2]=c):c=t[2];let l=c,u;t[3]!==a?.height||t[4]!==a?.width||t[5]!==i?(u=e=>{if(e===kn){i({browserDefaultViewport:ae});return}if(e===An){i({browserDefaultViewport:{_tag:`freeform`,width:a?.width??Nn.width,height:a?.height??Nn.height}});return}let t=Tt.find(t=>t.id===e);t&&i({browserDefaultViewport:{_tag:`preset`,width:t.width,height:t.height,presetId:t.id}})},t[3]=a?.height,t[4]=a?.width,t[5]=i,t[6]=u):u=t[6];let d=u,f;t[7]!==l||t[8]!==a||t[9]!==i?(f=(e,t)=>{if(t===null||!Vn(t))return;let n={...l,[e]:t};n.width*n.height>8294400||a&&n.width===a.width&&n.height===a.height||i({browserDefaultViewport:{_tag:`freeform`,...n}})},t[7]=l,t[8]=a,t[9]=i,t[10]=f):f=t[10];let p=f,m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=St(`browser-default-viewport`),t[11]=m):m=t[11];let h;t[12]!==n||t[13]!==i||t[14]!==r._tag?(h=!n&&r._tag!==re._tag?(0,Q.jsx)(vt,{label:`default browser viewport`,onClick:()=>i({browserDefaultViewport:re})}):null,t[12]=n,t[13]=i,t[14]=r._tag,t[15]=h):h=t[15];let g;t[16]===r?g=t[17]:(g=zn(r),t[16]=r,t[17]=g);let _;t[18]===r?_=t[19]:(_=Bn(r),t[18]=r,t[19]=_);let v;t[20]===_?v=t[21]:(v=(0,Q.jsx)(he,{size:`sm`,className:`w-full min-w-0 sm:w-44`,"aria-label":`Default browser viewport`,children:(0,Q.jsx)(de,{children:_})}),t[20]=_,t[21]=v);let y,x;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(K,{value:kn,children:`Fill panel`}),x=(0,Q.jsx)(K,{value:An,children:`Responsive`}),t[22]=y,t[23]=x):(y=t[22],x=t[23]);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Q.jsxs)(pe,{align:`end`,alignItemWithTrigger:!1,children:[y,x,(0,Q.jsxs)(me,{children:[(0,Q.jsx)(fe,{children:`Standard`}),Tt.map(Wn)]})]}),t[24]=S):S=t[24];let C;t[25]!==n||t[26]!==d||t[27]!==v||t[28]!==g?(C=(0,Q.jsxs)(ge,{value:g,onValueChange:d,disabled:n,children:[v,S]}),t[25]=n,t[26]=d,t[27]=v,t[28]=g,t[29]=C):C=t[29];let w;t[30]!==p||t[31]!==n||t[32]!==l||t[33]!==a||t[34]!==i?(w=a?(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(G,{value:l.width,min:240,max:H,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`width`,e),children:(0,Q.jsx)(ue,{children:(0,Q.jsx)(W,{"aria-label":`Default viewport width`})})}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`×`}),(0,Q.jsx)(G,{value:l.height,min:240,max:H,disabled:n,format:Pn,size:`sm`,className:`w-20`,onValueCommitted:e=>p(`height`,e),children:(0,Q.jsx)(ue,{children:(0,Q.jsx)(W,{"aria-label":`Default viewport height`})})}),(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ae,{render:(0,Q.jsx)(b,{size:`icon-sm`,variant:`ghost-muted`,disabled:n,"aria-label":`Rotate to ${l.height>=l.width?`landscape`:`portrait`}`,onClick:()=>i({browserDefaultViewport:Hn(a)}),children:(0,Q.jsx)(xt,{})})}),(0,Q.jsx)(je,{side:`top`,children:`Rotate`})]})]}):null,t[30]=p,t[31]=n,t[32]=l,t[33]=a,t[34]=i,t[35]=w):w=t[35];let T;t[36]!==C||t[37]!==w?(T=(0,Q.jsxs)(`div`,{className:`flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto`,children:[C,w]}),t[36]=C,t[37]=w,t[38]=T):T=t[38];let E;return t[39]!==T||t[40]!==h?(E=(0,Q.jsx)(X,{...m,description:`Tab size for you and agents. Fill fits the panel; other sizes show the device toolbar.`,resetAction:h,control:T}),t[39]=T,t[40]=h,t[41]=E):E=t[41],E}function Wn(e){return(0,Q.jsx)(K,{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 Gn(e){return e.browserDefaultViewport}function Kn(e){let t=(0,Z.c)(20),{disabled:n}=e,r=J(Jn),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`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)(vt,{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=V.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=In(r),t[7]=r,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser zoom`,children:(0,Q.jsx)(de,{children:l})}),t[9]=l,t[10]=u);let d;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:V.map(qn)}),t[11]=d):d=t[11];let f;t[12]!==n||t[13]!==s||t[14]!==c||t[15]!==u?(f=(0,Q.jsxs)(ge,{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)(X,{...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 qn(e){return(0,Q.jsx)(K,{hideIndicator:!0,value:String(e),children:In(e)},e)}function Jn(e){return e.browserDefaultZoomFactor}function Yn(e){let t=(0,Z.c)(18),{disabled:n}=e,r=J(Zn),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`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)(vt,{label:`default browser appearance`,onClick:()=>i({browserDefaultAppearance:z})}):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)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Default browser appearance`,children:(0,Q.jsx)(de,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:Object.entries(Fn).map(Xn)}),t[9]=u):u=t[9];let d;t[10]!==r||t[11]!==n||t[12]!==s||t[13]!==l?(d=(0,Q.jsxs)(ge,{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)(X,{...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 Xn(e){let[t,n]=e;return(0,Q.jsx)(K,{hideIndicator:!0,value:t,children:n},t)}function Zn(e){return e.browserDefaultAppearance}function Qn(e){let t=(0,Z.c)(17),{disabled:n}=e,r=J(er),i=J($n),a=Y(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=St(`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)(X,{...o,description:`Show pressed keys and shortcuts in new recordings. Password fields are excluded.`,control:(0,Q.jsx)(Ct,{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=St(`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)(X,{...l,description:`Highlight mouse presses and held buttons in new recordings.`,control:(0,Q.jsx)(Ct,{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 $n(e){return e.browserRecordingShowMousePresses}function er(e){return e.browserRecordingShowKeyPresses}function tr(e){let t=(0,Z.c)(18),{disabled:n}=e,r=J(rr),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`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)(vt,{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=se.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)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Browser recording frame rate`,children:(0,Q.jsxs)(de,{children:[r,` fps`]})}),t[7]=r,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:se.map(nr)}),t[9]=u):u=t[9];let d;t[10]!==n||t[11]!==s||t[12]!==c||t[13]!==l?(d=(0,Q.jsxs)(ge,{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)(X,{...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 nr(e){return(0,Q.jsxs)(K,{hideIndicator:!0,value:String(e),children:[e,` fps`]},e)}function rr(e){return e.browserRecordingFrameRate}var ir={system:`Your default browser`,app:`P4 Code`};function ar(e){let t=(0,Z.c)(19),{disabled:n}=e,r=J(sr),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`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)(vt,{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=ir[r],l;t[7]===c?l=t[8]:(l=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Open links in`,children:(0,Q.jsx)(de,{children:c})}),t[7]=c,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.keys(ir),t[9]=u):u=t[9];let d;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:u.map(or)}),t[10]=d):d=t[10];let f;t[11]!==n||t[12]!==r||t[13]!==s||t[14]!==l?(f=(0,Q.jsxs)(ge,{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)(X,{...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 or(e){return(0,Q.jsx)(K,{hideIndicator:!0,value:e,children:ir[e]},e)}function sr(e){return e.browserLinkTarget}var cr={duckduckgo:`DuckDuckGo`,google:`Google`,bing:`Bing`,brave:`Brave Search`,kagi:`Kagi`,ecosia:`Ecosia`,custom:`Custom`};function lr(){let e=(0,Z.c)(24),t=J(fr),n=J(dr),r=Y(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=St(`browser-search-engine`),e[0]=i):i=e[0];let a;e[1]!==n||e[2]!==t||e[3]!==r?(a=t!==`duckduckgo`||n!==``?(0,Q.jsx)(vt,{label:`search engine`,onClick:()=>r({browserSearchEngine:P,browserCustomSearchUrl:``})}):null,e[1]=n,e[2]=t,e[3]=r,e[4]=a):a=e[4];let o;e[5]===r?o=e[6]:(o=e=>{let t=B.literals.find(t=>t===e);t!==void 0&&r({browserSearchEngine:t})},e[5]=r,e[6]=o);let s=cr[t],c;e[7]===s?c=e[8]:(c=(0,Q.jsx)(he,{size:`sm`,className:`w-full sm:w-40`,"aria-label":`Search engine`,children:(0,Q.jsx)(de,{children:s})}),e[7]=s,e[8]=c);let l;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Q.jsx)(pe,{align:`end`,alignItemWithTrigger:!1,children:B.literals.map(ur)}),e[9]=l):l=e[9];let u;e[10]!==t||e[11]!==o||e[12]!==c?(u=(0,Q.jsxs)(ge,{value:t,onValueChange:o,children:[c,l]}),e[10]=t,e[11]=o,e[12]=c,e[13]=u):u=e[13];let d;e[14]!==a||e[15]!==u?(d=(0,Q.jsx)(X,{...i,description:`What the address bar searches when you type something that isn't a URL.`,resetAction:a,control:u}),e[14]=a,e[15]=u,e[16]=d):d=e[16];let f;e[17]!==n||e[18]!==t||e[19]!==r?(f=t===`custom`?(0,Q.jsx)(X,{title:`Custom search URL`,description:`Use %s where the search terms go.`,status:tt(n)?void 0:`Enter an http or https URL containing %s. Searches use DuckDuckGo until then.`,control:(0,Q.jsx)(Ot,{nativeInput:!0,size:`sm`,className:`w-full sm:w-64`,"aria-label":`Custom search URL`,placeholder:`https://example.com/search?q=%s`,autoCapitalize:`none`,spellCheck:!1,maxLength:R,value:n,onCommit:e=>r({browserCustomSearchUrl:e.trim()})})}):null,e[17]=n,e[18]=t,e[19]=r,e[20]=f):f=e[20];let p;return e[21]!==d||e[22]!==f?(p=(0,Q.jsxs)(Q.Fragment,{children:[d,f]}),e[21]=d,e[22]=f,e[23]=p):p=e[23],p}function ur(e){return(0,Q.jsx)(K,{hideIndicator:!0,value:e,children:cr[e]},e)}function dr(e){return e.browserCustomSearchUrl}function fr(e){return e.browserSearchEngine}function pr(){let e=(0,Z.c)(12),t=J(mr),n=Y(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=St(`pull-request-links-open-in-app`),e[0]=r):r=e[0];let i;e[1]!==t||e[2]!==n?(i=t?null:(0,Q.jsx)(vt,{label:`open pull requests in P4 Code`,onClick:()=>n({pullRequestLinksOpenInApp:!0})}),e[1]=t,e[2]=n,e[3]=i):i=e[3];let a;e[4]===n?a=e[5]:(a=e=>n({pullRequestLinksOpenInApp:!!e}),e[4]=n,e[5]=a);let o;e[6]!==t||e[7]!==a?(o=(0,Q.jsx)(Ct,{checked:t,onCheckedChange:a,"aria-label":`Open pull requests in P4 Code`}),e[6]=t,e[7]=a,e[8]=o):o=e[8];let s;return e[9]!==i||e[10]!==o?(s=(0,Q.jsx)(X,{...r,description:`Clicking a pull request link opens it in P4 Code. Turn off to open pull request links like any other link, on GitHub or your git host.`,resetAction:i,control:o}),e[9]=i,e[10]=o,e[11]=s):s=e[11],s}function mr(e){return e.pullRequestLinksOpenInApp}function hr(){let e=(0,Z.c)(7),{search:t,environment:n}=ht(),r=pt(),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)(yt,{id:`devices`,title:`Devices`,children:(0,Q.jsx)(gr,{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 gr({environmentId:e,enabled:t,agentAccessEnabled:n}){let r=Te(e,ne),{state:i,loaded:a}=He(e),{scope:o,environments:s,connectedEnvironments:c}=ht(),l=mt(),u=o.kind===`project`||o.kind===`checkout`,d=c.some(e=>e.serverConfig?.settings.enableDeviceSupport),f=Oe(Ue.configure,{reportFailure:!1}),p=Oe(Ue.list,{reportFailure:!1}),[m,h]=(0,$.useState)(null),g=i.hostStatus===`installing`||i.hostStatus===`starting`,_=i.hosts.some(e=>e.kind===`local`&&!e.platforms.some(e=>e.available)),[v,y]=(0,$.useState)(!1);v&&!t&&y(!1),t&&!v&&(i.hostStatus===`ready`||_)&&m!==`hub`&&y(!0);let x=async(t,n)=>{if(e&&Ee(e,`settings:write`)){h(t);try{let e=await Promise.allSettled(s.map(async e=>{if(e.connection.phase!==`connected`||!e.serverConfig)throw Error(`Environment disconnected`);if(!Ee(e.environmentId,`settings:write`))throw Error(`This connection cannot change device settings.`);return f({environmentId:e.environmentId,input:{...n,...n.enabled?{onboardingCompleted:!0}:{}}})})),t=s.filter((t,n)=>{let r=e[n];return r?.status!==`fulfilled`||r.value._tag===`Failure`});t.length>0&&q.add({type:`error`,title:`Device settings not saved on all environments`,description:`Could not update ${t.map(e=>e.label).join(`, `)}.`})}finally{h(null)}}},[S,C]=(0,$.useState)(null),w=i.hosts.find(e=>e.kind===`local`)?.tools,E=e=>{let t=w?.[e];return i.supportsToolUpdate&&t?!t.installedVersions.includes(t.requiredVersion):!1},D=(t,n=!1)=>{e&&(C(null),h(`update-${t}`),p({environmentId:e,input:{updateTool:t}}).then(e=>{if(e._tag===`Failure`){let r=De(e.cause);C({tool:t,message:r}),n&&q.add({type:`error`,title:r})}}).finally(()=>h(null)))},O=t=>{e&&(h(t),p({environmentId:e,input:{inspectOnly:!0}}).finally(()=>h(null)))},k=t=>{let n=E(t);if(!n&&!i.supportsToolInspection)return null;let r=m===`update-${t}`||m===`check-${t}`,a=n?`Update to v${w?.[t].requiredVersion}`:`Check ${t===`hub`?`device hub`:`agent device`} version`;return(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(Ae,{render:(0,Q.jsx)(b,{size:`icon-xs`,variant:`ghost-muted`,disabled:!e||m!==null||g,"aria-label":a,onClick:()=>n?D(t,!0):O(`check-${t}`)}),children:(0,Q.jsxs)(`span`,{className:`grid *:col-start-1 *:row-start-1 *:transition-[opacity,scale] *:duration-150 *:ease-out motion-reduce:*:transition-none`,children:[(0,Q.jsx)(`span`,{className:n&&!r?void 0:`scale-75 opacity-0`,children:(0,Q.jsx)(T,{"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:n&&!r?`scale-75 opacity-0`:void 0,children:(0,Q.jsx)(wt,{refreshing:r})})]})}),(0,Q.jsx)(je,{side:`top`,children:a})]})},A=t=>{let n=w?.[t];return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n&&E(t)?(0,Q.jsx)(b,{size:`sm`,disabled:!e||m!==null||g,onClick:()=>D(t),children:m===`update-${t}`?`Updating…`:`Update to v${n.requiredVersion}`}):null,i.supportsToolInspection?(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:!e||m!==null||g,onClick:()=>O(`check`),children:m===`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)(X,{...St(`device-hub`),serverScoped:!0,settingKeys:[`enableDeviceSupport`],description:Je,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pt,{action:A(`hub`),kind:`hub`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),k(`hub`),m===`hub`?(0,Q.jsx)(qe,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{settingKeys:[`enableDeviceSupport`],checked:t,disabled:!r||u||!a||!e||g||m!==null,"aria-label":`Device hub`,onCheckedChange:e=>void x(`hub`,{enabled:!!e,...e?{}:{agentAccessEnabled:!1}})})]})}),(0,Q.jsx)(Ze,{children:v?(0,Q.jsx)(X,{...St(`device-platform-support`),description:c.length>1?`Status for ${c.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)(Ge,{compact:!0,platform:`iOS`,status:Ke(i,`ios`)}),(0,Q.jsx)(Ge,{compact:!0,platform:`Android`,status:Ke(i,`android`)})]}),control:(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:!e||!t||g||m!==null,onClick:()=>{e&&(h(`check`),p({environmentId:e,input:{}}).finally(()=>h(null)))},children:m===`check`?`Checking…`:`Refresh`})}):null}),(0,Q.jsx)(X,{...St(`agent-device-access`),serverScoped:!0,settingKeys:[`enableAgentDeviceAccess`],description:We,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Pt,{action:A(`agent`),kind:`agent`,tools:i.hosts.find(e=>e.kind===`local`)?.tools}),k(`agent`),m===`agent`?(0,Q.jsx)(Ye,{state:i,pending:!0,compact:!0}):null,(0,Q.jsx)(kt,{settingKeys:[`enableAgentDeviceAccess`],checked:n,disabled:!r||c.length===0||!u&&(!a||!d||g)||m!==null,"aria-label":`Agent device access`,onCheckedChange:e=>u?l({enableAgentDeviceAccess:!!e}):void x(`agent`,{agentAccessEnabled:!!e})})]})}),e?(0,Q.jsx)(Xe,{state:{...i,hosts:i.hosts.filter(e=>e.kind===`local`)},environmentId:e}):null,(0,Q.jsx)(qt,{environmentId:e}),i.supportsEasHosts?(0,Q.jsx)(an,{environmentId:e}):null]})}function _r(e){let t=(0,Z.c)(14),{disabled:n}=e,r=J(vr),i=Y(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=St(`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)(vt,{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)(Ct,{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)(X,{...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 vr(e){return e.browserAutoShowFloatingPreview}function yr({disabled:e}){let t=J(e=>e.browserProfiles),n=J(e=>e.browserDefaultProfileId),r=xe(),i=Y(),{environments:a,isReady:o}=ve(),c=be(),[l,u]=(0,$.useState)(null),[f,v]=(0,$.useState)(null),[x,S]=(0,$.useState)(null),[C,T]=(0,$.useState)(null),[k,A]=(0,$.useState)(null),[j,M]=(0,$.useState)(!1),N=le(),P=Oe(et.clearProfile,{reportFailure:!1}),F={environmentIds:a.map(e=>e.environmentId).filter(e=>N.get(e)?.environment.capabilities.serverBrowser===!0),clear:async(e,t)=>{let n=await P({environmentId:e,input:{profileId:t}});if(n._tag===`Failure`)throw ce(n)}},I=Mn(Et!==null,o,a.length,F.environmentIds.length),R=(0,$.useRef)(!1),[z,B]=(0,$.useState)(!1),ee=e||!r,V=U(t).filter(e=>e.kind!==`incognito`),ne=te(V,n)?.id??`default`,re=e=>{if(!r||R.current)return;let t=Ce().browserProfiles;if(t.length>=24)return;let n=U(t),a=new Set(n.map(e=>e.name)),o=e;for(let t=2;a.has(o);t+=1)o=`${e} ${t}`;let s={id:`profile-${y()}`,name:o,kind:`persistent`};return i({browserProfiles:[...t,s]}),s},ae=(e,t)=>{if(!r||R.current)return;let n=t.trim().slice(0,48);if(n===``)return;let a=Ce().browserProfiles;i({browserProfiles:a.map(t=>t.id===e?{...t,name:n}:t)})},H=(e,t)=>{r&&!R.current&&(I?jn(Et,a.map(e=>e.environmentId),e,F).then(()=>{q.add({type:`success`,title:`Cleared ${t}'s cookies and cache`})}).catch(()=>{q.add({type:`error`,title:`Could not clear ${t}'s data`})}):q.add({type:`error`,title:`Could not clear ${t}'s data`,description:`You're not connected to a server yet.`}))},oe=async e=>{if(!r||R.current)return;if(!I){A(`Connect to an environment before removing this profile.`);return}A(null),M(!0);try{await jn(Et,o?a.map(e=>e.environmentId):[],e,F)}catch{A(`Profile data could not be deleted. Try again.`),M(!1);return}let t=Ce();i({browserProfiles:t.browserProfiles.filter(t=>t.id!==e),...t.browserDefaultProfileId===e?{browserDefaultProfileId:ie}:{}}),M(!1),S(null)},se=(l??[]).filter(e=>e.unavailable!==`notInstalled`&&e.unavailable!==`unsupportedPlatform`),W=(0,$.useCallback)(()=>{Et&&Et.listBrowserImportSources().then(u).catch(()=>u(e=>e??[]))},[]),ue=async(e,t,n)=>{if(!Et||!r)return{kind:`blocked`,reason:`sessionUnavailable`};if(n.target.kind===`existing`&&!U(Ce().browserProfiles).some(e=>e.id===n.target.profileId)||R.current)return{kind:`blocked`,reason:`readFailed`};R.current=!0,B(!0);try{let r=await Et.importBrowserCookies({environmentId:t,sourceId:e.id,sourceProfileDirectory:n.sourceProfileDirectory,targetProfileId:n.target.profileId});if(n.target.kind===`existing`&&!U(Ce().browserProfiles).some(e=>e.id===n.target.profileId))return{kind:`blocked`,reason:`readFailed`};let i;if(n.target.kind===`new`){if(r.imported>0)try{i=(await Se(t=>{if(t.browserProfiles.find(e=>e.id===n.target.profileId))return t;if(t.browserProfiles.length>=24)throw new Ln;let r=new Set(U(t.browserProfiles).map(e=>e.name)),i=e.name;for(let t=2;r.has(i);t+=1)i=`${e.name} ${t}`;return{...t,browserProfiles:[...t.browserProfiles,{id:n.target.profileId,name:i,kind:`persistent`}]}})).browserProfiles.find(e=>e.id===n.target.profileId)?.name??e.name}catch(r){await jn(Et,[t],n.target.profileId).catch(()=>void 0);let i=r instanceof Ln?`profileLimitReached`:`profileNotSaved`;throw Error(`Importing cookies from ${e.id} failed: ${i}.`,{cause:r})}else i=e.name}else i=n.target.name;return{kind:`imported`,imported:r.imported,skipped:r.skipped,skippedDomains:r.skippedDomains,targetName:i}}catch(e){return{kind:`blocked`,reason:Rn(e)}}finally{R.current=!1,B(!1)}},G=async e=>{if(Et)try{let t=await Et.listBrowserImportSources();return u(t),t.find(t=>t.id===e)}catch{return}},K=t.length>=24;return(0,Q.jsxs)(X,{...St(`browser-profiles`),description:`Profiles separate cookies and logins. Incognito data is cleared when the app closes.`,control:(0,Q.jsxs)(h,{onOpenChange:e=>e&&W(),children:[(0,Q.jsxs)(_,{render:(0,Q.jsx)(b,{size:`sm`,variant:`outline`,disabled:ee||z}),children:[(0,Q.jsx)(m,{}),`Add profile`]}),(0,Q.jsxs)(w,{align:`end`,children:[(0,Q.jsx)(O,{disabled:!r||K,onClick:()=>re(`New profile`),children:`Blank profile`}),K?(0,Q.jsx)(O,{disabled:!0,children:`You’ve reached the profile limit`}):null,(0,Q.jsx)(E,{}),(0,Q.jsxs)(s,{children:[(0,Q.jsx)(g,{children:`Import from`}),l===null?(0,Q.jsx)(O,{disabled:!0,children:`Looking for browsers…`}):se.length===0?(0,Q.jsx)(O,{disabled:!0,children:`No supported browsers found`}):(0,Q.jsxs)(Q.Fragment,{children:[se.map(e=>(0,Q.jsx)(O,{disabled:!r||c==null,onClick:()=>{r&&c!=null&&v({source:e,environmentId:c.environmentId,environmentName:bt({isPrimary:!0,environmentId:c.environmentId,runtimeLabel:c.label})})},children:e.name},e.id)),c==null?(0,Q.jsx)(O,{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:V.map((e,t)=>{let n=L(e.id),a=e.id===ne;return(0,Q.jsxs)(`div`,{className:D(`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:D(`truncate text-sm text-foreground`,ee&&`opacity-64`),children:e.name}):(0,Q.jsx)(Ot,{nativeInput:!0,size:`sm`,className:`w-full max-w-56`,"aria-label":`Rename ${e.name}`,disabled:ee||z,maxLength:48,value:e.name,onCommit:t=>ae(e.id,t)}),a?(0,Q.jsx)(`span`,{className:D(`flex`,ee&&`opacity-64`),children:(0,Q.jsx)(p,{children:`Default`})}):null]}),(0,Q.jsxs)(h,{children:[(0,Q.jsx)(_,{render:(0,Q.jsx)(b,{size:`icon-xs`,variant:`ghost-muted`,disabled:ee||z,"aria-label":`${e.name} options`}),children:(0,Q.jsx)(d,{})}),(0,Q.jsxs)(w,{align:`end`,children:[(0,Q.jsx)(O,{disabled:!r||a,onClick:()=>{r&&i({browserDefaultProfileId:e.id})},children:`Set as default`}),(0,Q.jsx)(O,{disabled:!r||!I,onClick:()=>{F.environmentIds.length>0?T(e):H(e.id,e.name)},children:`Clear cookies and cache`}),n?null:(0,Q.jsx)(O,{variant:`destructive`,disabled:!r||!I,onClick:()=>{r&&S(e)},children:`Remove profile and data`}),I?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{}),(0,Q.jsx)(O,{disabled:!0,children:o?`Connect to an environment to clear profile data`:`Checking environments…`})]})]})]})]},e.id)})}),(0,Q.jsx)(ft,{open:x!==null,onOpenChange:e=>{!e&&!j&&(S(null),A(null))},children:(0,Q.jsxs)(lt,{children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(dt,{children:[`Remove “`,x?.name,`”?`]}),(0,Q.jsx)(ut,{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.`}),k?(0,Q.jsx)(`p`,{"aria-live":`polite`,className:`text-sm text-destructive`,children:k}):null,I?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)(st,{children:[(0,Q.jsx)(ct,{disabled:j,render:(0,Q.jsx)(b,{variant:`outline`,disabled:j}),children:`Cancel`}),(0,Q.jsx)(b,{variant:`destructive`,disabled:j||!r||!I,onClick:()=>{x&&r&&I&&oe(x.id)},children:j?`Removing…`:`Remove profile`})]})]})}),(0,Q.jsx)(ft,{open:C!==null,onOpenChange:e=>{e||T(null)},children:(0,Q.jsxs)(lt,{children:[(0,Q.jsxs)(ot,{children:[(0,Q.jsxs)(dt,{children:[`Clear “`,C?.name,`”’s cookies and cache?`]}),(0,Q.jsx)(ut,{children:`You are signed out of its sites. Server browser tabs open in this profile close now.`})]}),(0,Q.jsxs)(st,{children:[(0,Q.jsx)(ct,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(b,{variant:`destructive`,onClick:()=>{C&&H(C.id,C.name),T(null)},children:`Clear data`})]})]})}),f?(0,Q.jsx)(vn,{source:f.source,destinationEnvironmentName:f.environmentName,targetProfiles:V.map(e=>({id:e.id,name:e.name})),canCreateProfile:r&&!K,onImport:e=>ue(f.source,f.environmentId,e),onRefreshSource:()=>G(f.source.id),onCheckFullDiskAccess:window.desktopBridge?.checkSystemPermission?()=>window.desktopBridge.checkSystemPermission(`full-disk-access`):void 0,onOpenFullDiskAccessSettings:async()=>{await ye()?.shell.openSystemSettings(`full-disk-access`).catch(()=>{q.add({type:`error`,title:`Could not open System Settings`,description:`Open Privacy & Security → Full Disk Access manually.`})})},onClose:()=>v(null)}):null]})}function br(){let e=(0,Z.c)(3),t=!ke,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(yr,{disabled:t}),(0,Q.jsx)(Un,{disabled:t}),(0,Q.jsx)(Kn,{disabled:t}),(0,Q.jsx)(Yn,{disabled:t}),(0,Q.jsx)(tr,{disabled:t}),(0,Q.jsx)(Qn,{disabled:t}),(0,Q.jsx)(ar,{disabled:t}),(0,Q.jsx)(_r,{disabled:t})]}),e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(Dt,{category:`integrations`}),e[1]=i):i=e[1];let a;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsxs)(_t,{children:[i,(0,Q.jsxs)(yt,{id:`browser`,title:`Browser`,children:[t?(0,Q.jsx)(gt,{message:`Only available in the desktop app.`,children:r}):r,(0,Q.jsx)(lr,{}),(0,Q.jsx)(pr,{})]}),(0,Q.jsx)(hr,{})]}),e[2]=a):a=e[2],a}var xr=br;export{xr as component};
2
+ //# sourceMappingURL=settings.integrations-CfX639cu.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Bf as i,Ea as a,Ic as o,Ol as s,Sd as c,Ul as l,Xn as u,Yd as d,Zn as f,du as p,fr as m,iu as h,lf as g,mr as _,rp as v,rr as y,t as b,tr as x}from"./utils-CtzgibkN.js";import{Ta as S,ja as C}from"./src-aYUfWMsw.js";import{Dr as w,Sr as T}from"./runtime-DciS6GP9.js";import{a as E,c as D,o as O,s as k,t as A}from"./select--26O8gr7.js";import{t as j}from"./useLocation-fNQqSFar.js";import{a as M}from"./relay-DcCuBtiq.js";import{f as N}from"./server-DKB_3xTN.js";import{i as P,n as F,o as ee}from"./session-D_OiLzln.js";import{t as I}from"./use-atom-command-Bfi4daMj.js";import{t as L}from"./env-BfPir1X4.js";import{a as R,n as z,t as B}from"./tooltip-DDv-MvO4.js";import{t as te}from"./toggle-fVPE0kyD.js";import{t as ne}from"./input-BwujRX3Y.js";import{i as re}from"./keybindings-CCmLKtII.js";import{i as ie,o as V,t as ae}from"./popover-D2KZg7__.js";import{n as oe,r as se,t as ce}from"./input-group-euoW8Z7h.js";import{n as le,t as ue}from"./kbd-GiLKf_On.js";import{G as de,V as fe,a as pe,i as me,s as he}from"./settingsLayout-EWRSNE9F.js";import{a as H,c as ge,f as _e,i as ve,l as ye,m as be,n as xe,o as Se,p as U,r as Ce,s as we,t as Te,u as W}from"./KeybindingsSettings.logic-BBUqSPsh.js";import{Ir as Ee,Lr as De,Vo as Oe}from"./main-D8lKEPYS.js";var G=n(),K=e(t(),1),ke=e(a(),1),q=e(r(),1);function Ae(e){let t=(0,G.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=le,i=a.map(je),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,q.jsx)(r,{children:i}),t[3]=r,t[4]=i,t[5]=a):a=t[5],a}function je(e){let{part:t,key:n}=e;return(0,q.jsx)(ue,{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 Me(e){let t=(0,G.c)(11),{query:n,onChange:r,inputRef:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.jsx)(oe,{children:(0,q.jsx)(g,{"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,q.jsxs)(ce,{className:`min-w-0 basis-full **:[input]:h-9 sm:basis-0 sm:flex-1 sm:**:[input]:h-8`,children:[a,(0,q.jsx)(se,{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 Ne(e,t){return e.type===t?[...Ne(e.left,t),...Ne(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 Pe(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 Fe(e,t){let n=Pe(e);if(!n)return e;let r={type:`identifier`,name:t};return n.negated?{type:`not`,node:r}:r}function Ie(e,t){let n=Pe(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:Te}}function Le(e=`and`){return{type:e,left:Y(),right:{type:`not`,node:Y()}}}function X(e){let t=(0,G.c)(14),{label:n,focusable:r,className:a,children:o}=e,s=r===void 0||r?0:void 0,c;t[0]===a?c=t[1]:(c=b(`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`,a),t[0]=a,t[1]=c);let l;t[2]!==n||t[3]!==s||t[4]!==c?(l=(0,q.jsx)(`span`,{tabIndex:s,"aria-label":n,className:c}),t[2]=n,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(i,{className:`size-3.5`}),t[6]=u):u=t[6];let d;t[7]===l?d=t[8]:(d=(0,q.jsx)(R,{render:l,children:u}),t[7]=l,t[8]=d);let f;t[9]===o?f=t[10]:(f=(0,q.jsx)(z,{side:`top`,children:o}),t[9]=o,t[10]=f);let p;return t[11]!==d||t[12]!==f?(p=(0,q.jsxs)(B,{children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13],p}function Re(e){let t=(0,G.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,q.jsx)(X,{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 ze(e){let t=(0,G.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,q.jsxs)(X,{label:i,children:[i,` The most recent matching binding wins when both conditions can apply.`]}),t[2]=i,t[3]=a),a}function Be(e){let t=(0,G.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,q.jsx)(D,{placeholder:`Condition`}),t[11]=d):d=t[11];let f;t[12]===i?f=t[13]:(f=i&&i.length>0?(0,q.jsx)(Re,{identifiers:i,focusable:!1}):null,t[12]=i,t[13]=f);let p;t[14]===f?p=t[15]:(p=(0,q.jsxs)(k,{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(Ve),t[16]=l,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,q.jsx)(O,{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,q.jsxs)(A,{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 Ve(e){return(0,q.jsx)(E,{value:e,className:`w-full`,children:(0,q.jsx)(`span`,{className:`truncate`,children:e})},e)}function He(e){let t=(0,G.c)(14),{label:n,className:r,onRemove:i}=e,a;t[0]===r?a=t[1]:(a=b(`size-7`,r),t[0]=r,t[1]=a);let o;t[2]!==n||t[3]!==i||t[4]!==a?(o=(0,q.jsx)(_,{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,q.jsx)(c,{"aria-hidden":!0,className:`size-3.5`}),t[6]=s):s=t[6];let l;t[7]===o?l=t[8]:(l=(0,q.jsx)(R,{delay:200,render:o,children:s}),t[7]=o,t[8]=l);let u;t[9]===n?u=t[10]:(u=(0,q.jsx)(z,{side:`top`,children:n}),t[9]=n,t[10]=u);let d;return t[11]!==l||t[12]!==u?(d=(0,q.jsxs)(B,{children:[l,u]}),t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function Ue(e){let t=(0,G.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=Pe(n);if(e){let i=we(e.identifier)?[]:[e.identifier],l;t[6]!==n||t[7]!==a?(l=e=>a(Ie(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,q.jsx)(te,{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(Fe(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,q.jsx)(Be,{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,q.jsx)(He,{label:be(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,q.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=b(`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,q.jsx)(te,{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,q.jsx)(He,{label:be(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,q.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,f;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,q.jsx)(`span`,{className:`absolute top-0 bottom-0 left-1.5 w-px bg-border/70`,"aria-hidden":!0}),f=(0,q.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]=f):(d=t[41],f=t[42]);let p=s+1,m;t[43]===a?m=t[44]:(m=e=>a({type:`not`,node:e}),t[43]=a,t[44]=m);let h;t[45]!==n.node||t[46]!==p||t[47]!==m||t[48]!==r?(h=(0,q.jsxs)(`div`,{className:`relative pl-4`,children:[d,f,(0,q.jsx)(Ue,{node:n.node,variables:r,depth:p,onChange:m})]}),t[45]=n.node,t[46]=p,t[47]=m,t[48]=r,t[49]=h):h=t[49];let g;return t[50]!==h||t[51]!==i||t[52]!==u?(g=(0,q.jsxs)(`div`,{className:i,children:[u,h]}),t[50]=h,t[51]=i,t[52]=u,t[53]=g):g=t[53],g}let l=n.type===`or`?`or`:`and`,u,f,p,m;if(t[54]!==s||t[55]!==n||t[56]!==a||t[57]!==o||t[58]!==l||t[59]!==r){let e=Ne(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}`}}),h=(t,n)=>{let r=!1,i=J(e.map(e=>!r&&e===t?(r=!0,n):e),l);i&&a(i)},g=t=>{let n=!1,r=J(e.filter(e=>!n&&e===t?(n=!0,!1):!0),l);a(r||Y())},v=t=>{if(t===l)return;let n=J(e,t);n&&a(n)},y=()=>{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?p=t[65]:(p=b(`space-y-2 rounded-lg border border-border/60 bg-muted/10 p-2`,S),t[64]=S,t[65]=p);let C;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,q.jsx)(k,{size:`compact`,className:`w-24`,children:(0,q.jsx)(D,{})}),t[66]=C):C=t[66];let w;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,q.jsxs)(O,{alignItemWithTrigger:!1,matchTriggerWidth:!1,children:[(0,q.jsx)(E,{value:`and`,children:`and`}),(0,q.jsx)(E,{value:`or`,children:`or`})]}),t[67]=w):w=t[67];let T;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,q.jsx)(d,{className:`size-3.5`}),t[68]=T):T=t[68];let j;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,q.jsx)(d,{className:`size-3.5`}),t[69]=j):j=t[69];let M;t[70]!==s||t[71]!==n||t[72]!==o?(M=o?(0,q.jsx)(He,{label:be(n,s),className:`ml-auto`,onRemove:o}):null,t[70]=s,t[71]=n,t[72]=o,t[73]=M):M=t[73],m=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsxs)(A,{value:l,onValueChange:e=>v(e),children:[C,w]}),(0,q.jsxs)(_,{type:`button`,variant:`outline`,size:`compact`,onClick:y,children:[T,`Condition`]}),(0,q.jsxs)(_,{type:`button`,variant:`outline`,size:`compact`,onClick:x,children:[j,`Group`]}),M]}),u=`space-y-2`,f=c.map(e=>{let{child:t,key:n}=e;return(0,q.jsxs)(`div`,{className:`relative pl-4`,children:[(0,q.jsx)(`span`,{className:b(`absolute top-0 bottom-0 left-1.5 w-px`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,q.jsx)(`span`,{className:b(`absolute top-4 left-1.5 h-px w-2.5`,s===0?`bg-border`:`bg-border/70`),"aria-hidden":!0}),(0,q.jsx)(Ue,{node:t,variables:r,depth:s+1,onChange:e=>h(t,e),onRemove:()=>g(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]=f,t[62]=p,t[63]=m}else u=t[60],f=t[61],p=t[62],m=t[63];let h;t[74]!==u||t[75]!==f?(h=(0,q.jsx)(`div`,{className:u,children:f}),t[74]=u,t[75]=f,t[76]=h):h=t[76];let g;return t[77]!==p||t[78]!==m||t[79]!==h?(g=(0,q.jsxs)(`div`,{className:p,children:[m,h]}),t[77]=p,t[78]=m,t[79]=h,t[80]=g):g=t[80],g}function We(e){let t=(0,G.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,K.useState)(o),u;t[2]===s?u=t[3]:(u=W(s),t[2]=s,t[3]=u);let f=u,p=f.ok?null:f.message,m;t[4]!==f.ok||t[5]!==f.value?(m=f.ok?_e(f.value):[],t[4]=f.ok,t[5]=f.value,t[6]=m):m=t[6];let h=m,g;t[7]!==i||t[8]!==a?(g=e=>{c(e);let t=W(e);a?.(t.ok),t.ok&&i(t.value)},t[7]=i,t[8]=a,t[9]=g):g=t[9];let v=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=()=>{b(n?{type:`and`,left:n,right:Y()}: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=Le(`or`);b(n?{type:`and`,left:n,right:e}: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,q.jsx)(`div`,{className:`min-w-0`,children:(0,q.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,q.jsx)(d,{className:`size-3.5`}),t[20]=E):E=t[20];let D;t[21]===S?D=t[22]:(D=(0,q.jsxs)(_,{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,q.jsx)(d,{className:`size-3.5`}),t[23]=O):O=t[23];let k;t[24]===w?k=t[25]:(k=(0,q.jsxs)(_,{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,q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[T,(0,q.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]===v?j=t[30]:(j=e=>v(e.currentTarget.value),t[29]=v,t[30]=j);let M=!!p,N;t[31]!==s||t[32]!==j||t[33]!==M?(N=(0,q.jsx)(se,{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]===h?P=t[36]:(P=h.length>0?(0,q.jsx)(oe,{align:`inline-end`,children:(0,q.jsx)(Re,{identifiers:h})}):null,t[35]=h,t[36]=P);let F;t[37]!==N||t[38]!==P?(F=(0,q.jsxs)(ce,{children:[N,P]}),t[37]=N,t[38]=P,t[39]=F):F=t[39];let ee;t[40]===p?ee=t[41]:(ee=p?(0,q.jsxs)(`div`,{className:`flex items-center gap-1.5 text-2xs text-destructive`,children:[(0,q.jsx)(l,{className:`size-3.5`}),p]}):null,t[40]=p,t[41]=ee);let I;t[42]!==F||t[43]!==ee?(I=(0,q.jsxs)(`div`,{className:`space-y-1.5`,children:[F,ee]}),t[42]=F,t[43]=ee,t[44]=I):I=t[44];let L;t[45]!==S||t[46]!==w||t[47]!==b||t[48]!==n||t[49]!==r?(L=n?(0,q.jsx)(Ue,{node:n,variables:r,onChange:b,onRemove:()=>b(void 0)}):(0,q.jsx)(`div`,{className:`rounded-md border border-dashed border-border/80 bg-muted/15 p-3`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,q.jsxs)(_,{type:`button`,size:`compact`,onClick:S,children:[(0,q.jsx)(d,{className:`size-3.5`}),`Condition`]}),(0,q.jsxs)(_,{type:`button`,variant:`outline`,size:`compact`,onClick:w,children:[(0,q.jsx)(d,{className:`size-3.5`}),`Group`]})]})}),t[45]=S,t[46]=w,t[47]=b,t[48]=n,t[49]=r,t[50]=L):L=t[50];let R;t[51]===p?R=t[52]:(R=p?(0,q.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]=p,t[52]=R);let z;t[53]!==L||t[54]!==R?(z=(0,q.jsxs)(`div`,{className:`relative`,children:[L,R]}),t[53]=L,t[54]=R,t[55]=z):z=t[55];let B;return t[56]!==A||t[57]!==I||t[58]!==z?(B=(0,q.jsxs)(`div`,{className:`w-[min(34rem,calc(100vw-2rem))] space-y-3`,children:[A,I,z]}),t[56]=A,t[57]=I,t[58]=z,t[59]=B):B=t[59],B}function Ge(e){return{keyDraft:e.key,whenDraft:e.binding.whenAst,isRecording:!1,isWhenDraftValid:!0}}function Z(e,t){return{...e,...t}}function Ke(e){return{command:e.command,key:e.key,...e.when.trim().length>0?{when:e.when}:{}}}function Q(e){let t=(0,G.c)(27),{row:n,allRows:r,onSave:i}=e,[a,o]=(0,K.useReducer)(Z,n,Ge),s=(0,K.useRef)(null),{keyDraft:c,whenDraft:l,isRecording:u,isWhenDraftValid:d}=a,f,p,m;t[0]!==r||t[1]!==c||t[2]!==n.id||t[3]!==n.key||t[4]!==n.when||t[5]!==l?(m=U(l),f=c!==n.key||m!==n.when,p=ge(r,{rowId:n.id,key:c,when:m}),t[0]=r,t[1]=c,t[2]=n.id,t[3]=n.key,t[4]=n.when,t[5]=l,t[6]=f,t[7]=p,t[8]=m):(f=t[6],p=t[7],m=t[8]);let h=p,g;t[9]!==c||t[10]!==i||t[11]!==n||t[12]!==m?(g=()=>{i({command:n.command,key:c,when:m.trim().length>0?m:void 0,replace:Ke(n)})},t[9]=c,t[10]=i,t[11]=n,t[12]=m,t[13]=g):g=t[13];let _=g,v;t[14]!==u||t[15]!==n.key?(v=e=>{if(e.key===`Tab`&&!u)return;if(e.preventDefault(),e.key===`Escape`){e.stopPropagation();let t=e.currentTarget;(0,ke.flushSync)(()=>o({keyDraft:n.key,isRecording:!1})),s.current?s.current.focus():t.blur();return}let t=ye(e.nativeEvent,navigator.platform);t&&o({keyDraft:t,isRecording:!1})},t[14]=u,t[15]=n.key,t[16]=v):v=t[16];let y=v,b;return t[17]!==y||t[18]!==h||t[19]!==f||t[20]!==u||t[21]!==d||t[22]!==c||t[23]!==_||t[24]!==l||t[25]!==m?(b={keyDraft:c,whenDraft:l,isRecording:u,isWhenDraftValid:d,whenDraftExpression:m,isDirty:f,conflictLabels:h,setDraft:o,save:_,captureKeybinding:y,pillRef:s},t[17]=y,t[18]=h,t[19]=f,t[20]=u,t[21]=d,t[22]=c,t[23]=_,t[24]=l,t[25]=m,t[26]=b):b=t[26],b}function qe(e){let t=(0,G.c)(20),{row:n,editor:r,isSaving:i,pillClassName:a}=e,{keyDraft:o,isRecording:s,isDirty:c,isWhenDraftValid:l,setDraft:u,save:d,captureKeybinding:f,pillRef:p}=r,m=!s&&o===n.key&&n.key.length>0&&!c,h;t[0]!==c||t[1]!==i||t[2]!==l||t[3]!==o||t[4]!==d?(h=c?(0,q.jsx)(_,{size:`sm`,disabled:i||o.trim().length===0||!l,onClick:d,children:i?`Saving`:`Save`}):null,t[0]=c,t[1]=i,t[2]=l,t[3]=o,t[4]=d,t[5]=h):h=t[5];let g;t[6]!==f||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==p||t[11]!==n.binding||t[12]!==n.command||t[13]!==n.key||t[14]!==u||t[15]!==m?(g=m?(0,q.jsx)(`button`,{ref:p,type:`button`,onClick:()=>u({isRecording:!0}),"aria-label":`Edit shortcut for ${H(n.command)}: ${re(n.binding.shortcut)}`,className:b(`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,q.jsx)(Ae,{value:n.key})}):(0,q.jsx)(ne,{"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:f}),t[6]=f,t[7]=s,t[8]=o,t[9]=a,t[10]=p,t[11]=n.binding,t[12]=n.command,t[13]=n.key,t[14]=u,t[15]=m,t[16]=g):g=t[16];let v;return t[17]!==h||t[18]!==g?(v=(0,q.jsxs)(q.Fragment,{children:[h,g]}),t[17]=h,t[18]=g,t[19]=v):v=t[19],v}function Je(e){let t=(0,G.c)(20),{label:n,expression:r,value:i,variables:a,onChange:o,onValidityChange:c}=e,l;t[0]===c?l=t[1]:(l=e=>{e||c(!0)},t[0]=c,t[1]=l);let u=l,d=r?`ghost`:`ghost-muted`,f;t[2]===d?f=t[3]:(f=(0,q.jsx)(_,{variant:d,size:`micro`,className:`min-w-0 shrink`}),t[2]=d,t[3]=f);let p=`Edit when clause for ${n}`,m=r||`Always`,h;t[4]===m?h=t[5]:(h=(0,q.jsx)(`span`,{className:`truncate font-mono`,children:m}),t[4]=m,t[5]=h);let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,q.jsx)(s,{className:`size-3.5 shrink-0 opacity-60`}),t[6]=g):g=t[6];let v;t[7]!==f||t[8]!==p||t[9]!==h?(v=(0,q.jsxs)(V,{render:f,"aria-label":p,children:[h,g]}),t[7]=f,t[8]=p,t[9]=h,t[10]=v):v=t[10];let y;t[11]!==o||t[12]!==c||t[13]!==i||t[14]!==a?(y=(0,q.jsx)(ie,{align:`start`,sideOffset:6,children:(0,q.jsx)(We,{value:i,variables:a,onChange:o,onValidityChange:c})}),t[11]=o,t[12]=c,t[13]=i,t[14]=a,t[15]=y):y=t[15];let b;return t[16]!==u||t[17]!==v||t[18]!==y?(b=(0,q.jsxs)(ae,{onOpenChange:u,children:[v,y]}),t[16]=u,t[17]=v,t[18]=y,t[19]=b):b=t[19],b}function Ye(e){let t=(0,G.c)(24),{row:n,isSaving:r,onReset:i,onRemove:a}=e,o=n.source===`Custom`&&n.defaultKey!==null,s=n.source!==`Default`;if(!o&&!s)return null;let c;t[0]===n.command?c=t[1]:(c=H(n.command),t[0]=n.command,t[1]=c);let l=`Actions for ${c}`,u;t[2]!==r||t[3]!==l?(u=(0,q.jsx)(_,{type:`button`,variant:`ghost-muted`,size:`icon-sm`,disabled:r,"aria-label":l}),t[2]=r,t[3]=l,t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,q.jsx)(h,{className:`size-3.5`}),t[5]=d):d=t[5];let p;t[6]===u?p=t[7]:(p=(0,q.jsx)(m,{render:u,children:d}),t[6]=u,t[7]=p);let g;t[8]!==o||t[9]!==r||t[10]!==i||t[11]!==n?(g=o?(0,q.jsx)(x,{disabled:r,onClick:()=>i(n),children:`Reset to default`}):null,t[8]=o,t[9]=r,t[10]=i,t[11]=n,t[12]=g):g=t[12];let v;t[13]!==s||t[14]!==r||t[15]!==a||t[16]!==n?(v=s?(0,q.jsx)(x,{variant:`destructive`,disabled:r,onClick:()=>a(n),children:`Remove`}):null,t[13]=s,t[14]=r,t[15]=a,t[16]=n,t[17]=v):v=t[17];let b;t[18]!==g||t[19]!==v?(b=(0,q.jsxs)(y,{align:`end`,children:[g,v]}),t[18]=g,t[19]=v,t[20]=b):b=t[20];let S;return t[21]!==p||t[22]!==b?(S=(0,q.jsxs)(f,{children:[p,b]}),t[21]=p,t[22]=b,t[23]=S):S=t[23],S}function Xe(e){let t=(0,G.c)(2),{source:n}=e;if(n===`Default`)return null;let r;return t[0]===n?r=t[1]:(r=(0,q.jsx)(u,{variant:`outline`,size:`sm`,children:n}),t[0]=n,t[1]=r),r}function $(e){let t=(0,G.c)(13),{row:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,q.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,q.jsx)(Xe,{source:n.source}),t[3]=n.source,t[4]=a);let o;t[5]!==i||t[6]!==a?(o=(0,q.jsxs)(R,{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,q.jsx)(z,{side:`top`,children:n.command}),t[8]=n.command,t[9]=s);let c;return t[10]!==o||t[11]!==s?(c=(0,q.jsxs)(B,{children:[o,s]}),t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Ze(e){let t=(0,G.c)(13),{row:n,editor:r,variables:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,q.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,q.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[a,(0,q.jsx)(Je,{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 Qe(e){let t=(0,G.c)(2),n;return t[0]===e?n=t[1]:(n=(0,q.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,q.jsx)(Ye,{...e})}),t[0]=e,t[1]=n),n}function $e(e){let t=(0,G.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=Q(u),f;t[4]===n?f=t[5]:(f=(0,q.jsx)($,{row:n}),t[4]=n,t[5]=f);let p;t[6]!==d||t[7]!==n||t[8]!==o?(p=(0,q.jsx)(Ze,{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,q.jsx)(ze,{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,q.jsx)(Qe,{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,q.jsx)(qe,{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,q.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,q.jsx)(pe,{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 et(e){let t=(0,G.c)(30),{allRows:n,onSave:r}=e,[i,a]=(0,K.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,K.useReducer)(Z,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=ge(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`){e.stopPropagation(),c({keyDraft:``,isRecording:!1}),e.currentTarget.blur();return}let t=ye(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 tt(e){let t=(0,G.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,q.jsx)(D,{placeholder:`Command`}),t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=(0,q.jsx)(k,{size:`sm`,className:i,children:s}),t[3]=i,t[4]=c);let l;t[5]===r?l=t[6]:(l=r.map(nt),t[5]=r,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,q.jsx)(O,{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,q.jsxs)(A,{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 nt(e){return(0,q.jsx)(E,{value:e,className:`w-full`,children:(0,q.jsx)(`span`,{className:`truncate`,children:H(e)})},e)}function rt(e){let t=(0,G.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,q.jsx)(ne,{"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 it(e){let t=(0,G.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,q.jsx)(Je,{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 at(e){let t=(0,G.c)(9),{isSaving:n,onCancel:r}=e,i;t[0]!==n||t[1]!==r?(i=(0,q.jsx)(_,{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,q.jsx)(v,{className:`size-3.5`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,q.jsx)(R,{render:i,children:a}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,q.jsx)(z,{side:`top`,children:`Cancel`}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,q.jsxs)(B,{children:[o,s]}),t[7]=o,t[8]=c),c}function ot(e){let t=(0,G.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=et(c),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,q.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground/70`,children:`When`}),t[3]=u):u=t[3];let d;t[4]!==l||t[5]!==i?(d=(0,q.jsxs)(`span`,{className:`flex h-6 items-center gap-1.5`,children:[u,(0,q.jsx)(it,{draft:l,variables:i})]}),t[4]=l,t[5]=i,t[6]=d):d=t[6];let f;t[7]!==n||t[8]!==l?(f=(0,q.jsx)(tt,{draft:l,commandOptions:n,className:`w-56`}),t[7]=n,t[8]=l,t[9]=f):f=t[9];let p;t[10]===l.conflictLabels?p=t[11]:(p=(0,q.jsx)(ze,{labels:l.conflictLabels}),t[10]=l.conflictLabels,t[11]=p);let m;t[12]===l?m=t[13]:(m=(0,q.jsx)(rt,{draft:l,className:`w-44`}),t[12]=l,t[13]=m);let h=a||!l.canSave,g=a?`Saving`:`Save`,v;t[14]!==l.save||t[15]!==h||t[16]!==g?(v=(0,q.jsx)(_,{size:`sm`,disabled:h,onClick:l.save,children:g}),t[14]=l.save,t[15]=h,t[16]=g,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==s?(y=(0,q.jsx)(at,{isSaving:a,onCancel:s}),t[18]=a,t[19]=s,t[20]=y):y=t[20];let b;t[21]!==f||t[22]!==p||t[23]!==m||t[24]!==v||t[25]!==y?(b=(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[f,p,m,v,y]}),t[21]=f,t[22]=p,t[23]=m,t[24]=v,t[25]=y,t[26]=b):b=t[26];let x;return t[27]!==b||t[28]!==d?(x=(0,q.jsx)(pe,{className:`bg-muted/15`,title:`New keybinding`,description:d,control:b}),t[27]=b,t[28]=d,t[29]=x):x=t[29],x}function st(e){let{groups:t,anchorIds:n,savingCommand:r,...i}=e;return t.map(e=>(0,q.jsx)(he,{id:`keybindings-${e.id}`,title:e.title,children:e.rows.map(e=>(0,q.jsx)($e,{row:e,anchorId:n.get(e.id),isSaving:r===e.command,...i},e.id))},e.id))}function ct(){let e=(0,G.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,q.jsxs)(B,{children:[(0,q.jsx)(R,{delay:200,render:(0,q.jsx)(_,{size:`icon-micro`,variant:`ghost-muted`,"aria-label":`The browser may claim some shortcuts first. The desktop app receives them all.`,children:(0,q.jsx)(i,{className:`size-3.5 text-warning`})})}),(0,q.jsx)(z,{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 lt(){let e=(0,G.c)(83),{environment:t,connectedEnvironments:n}=fe(),r=P(t?.environmentId??null,S),i=ee(n,C),a;e[0]!==n||e[1]!==i?(a=n.length>0&&n.every(e=>i.has(e.environmentId)),e[0]=n,e[1]=i,e[2]=a):a=e[2];let s=a,c=t?.serverConfig?.keybindings,l;e[3]===c?l=e[4]:(l=c??[],e[3]=c,e[4]=l);let u;e[5]===l?u=e[6]:(u=o(l),e[5]=l,e[6]=u);let f=u,m=t?.serverConfig?.keybindingsConfigPath??null,h;e[7]===t?.serverConfig?.availableEditors?h=e[8]:(h=t?.serverConfig?.availableEditors??[],e[7]=t?.serverConfig?.availableEditors,e[8]=h);let g=h,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(v={reportFailure:!1},e[9]=v):v=e[9];let y=I(N.upsertKeybinding,v),b;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(b={reportFailure:!1},e[10]=b):b=e[10];let x=I(N.removeKeybinding,b),E=Oe(t?.environmentId??null,g),[D,O]=(0,K.useState)(``),k=(0,K.useRef)(null),[A,te]=(0,K.useState)(null),[ne,re]=(0,K.useState)(!1),ie;e[11]!==f||e[12]!==D?(ie=Ce(f,D),e[11]=f,e[12]=D,e[13]=ie):ie=e[13];let V=ie,ae;e[14]===V?ae=e[15]:(ae=Se(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,Ee(e.command)));e[16]=V,e[17]=se}else se=e[17];let ce=se,le;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(le={select:mt},e[18]=le):le=e[18];let ue=j(le),[pe,H]=(0,K.useState)(ue);ue!==pe&&(H(ue),ue.startsWith(`keybinding-`)&&O(``));let ge;e[19]===f?ge=e[20]:(ge=xe(f),e[19]=f,e[20]=ge);let _e=ge,ye;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(ye=ve(),e[21]=ye):ye=e[21];let be=ye,U;e[22]!==m||e[23]!==E||e[24]!==t?(U=()=>{m&&t&&F(t.environmentId,`orchestration:operate`)&&(async()=>{let e=await E(m);if(e._tag===`Success`||T(e))return;let t=w(e);M.add({title:`Unable to open keybindings file`,description:t instanceof Error?t.message:`The keybindings file was not opened.`,type:`error`})})()},e[22]=m,e[23]=E,e[24]=t,e[25]=U):U=e[25];let we=U,Te;e[26]!==n||e[27]!==t||e[28]!==y?(Te=e=>{if(!t||!n.every(pt))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=>y({environmentId:e.environmentId,input:r})));te(null);let t=e.find(ft);if(!t)re(!1);else if(!T(t)){let e=w(t);M.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]=y,e[29]=Te):Te=e[29];let W=Te,ke;e[30]!==n||e[31]!==t||e[32]!==x?(ke=e=>{t&&n.every(dt)&&(te(e.command),(async()=>{let t=await Promise.all(n.map(t=>x({environmentId:t.environmentId,input:Ke(e)})));te(null);let r=t.find(ut)??t[0];if(r?._tag===`Failure`&&!T(r)){let e=w(r);M.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]=x,e[33]=ke):ke=e[33];let Ae=ke,je;e[34]===W?je=e[35]:(je=e=>{e.defaultKey&&W({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]=W,e[35]=je);let Ne=je,J;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(J=()=>re(!1),e[36]=J):J=e[36];let Pe=J,Fe;e[37]!==Ae||e[38]!==Ne||e[39]!==V||e[40]!==W?(Fe={allRows:V,variables:be,onSave:W,onReset:Ne,onRemove:Ae},e[37]=Ae,e[38]=Ne,e[39]=V,e[40]=W,e[41]=Fe):Fe=e[41];let Ie=Fe,Y,Le;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Y=De(`keybindings`),Le=L?null:(0,q.jsx)(ct,{}),e[42]=Y,e[43]=Le):(Y=e[42],Le=e[43]);let X;e[44]===D?X=e[45]:(X=(0,q.jsx)(Me,{query:D,onChange:O,inputRef:k}),e[44]=D,e[45]=X);let Re=ne||!s,ze,Be;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>re(!0),Be=(0,q.jsx)(d,{"aria-hidden":!0,className:`size-4`}),e[46]=ze,e[47]=Be):(ze=e[46],Be=e[47]);let Ve;e[48]===Re?Ve=e[49]:(Ve=(0,q.jsxs)(_,{type:`button`,variant:`outline`,disabled:Re,onClick:ze,children:[Be,`Add keybinding`]}),e[48]=Re,e[49]=Ve);let He=!m||!r,Ue;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,q.jsx)(p,{"aria-hidden":!0,className:`size-4`}),e[50]=Ue):Ue=e[50];let We;e[51]!==we||e[52]!==He?(We=(0,q.jsx)(R,{render:(0,q.jsx)(_,{type:`button`,variant:`outline`,size:`icon`,disabled:He,onClick:we,"aria-label":`Open keybindings.json`,children:Ue})}),e[51]=we,e[52]=He,e[53]=We):We=e[53];let Ge;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,q.jsx)(z,{side:`top`,children:`Open keybindings.json`}),e[54]=Ge):Ge=e[54];let Z;e[55]===We?Z=e[56]:(Z=(0,q.jsxs)(B,{children:[We,Ge]}),e[55]=We,e[56]=Z);let Q;e[57]!==X||e[58]!==Ve||e[59]!==Z?(Q=(0,q.jsx)(he,{...Y,headerAction:Le,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3 py-3 sm:px-4`,children:[X,Ve,Z]})}),e[57]=X,e[58]=Ve,e[59]=Z,e[60]=Q):Q=e[60];let qe;e[61]!==s||e[62]!==n?(qe=s?null:(0,q.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]=s,e[62]=n,e[63]=qe):qe=e[63];let Je=!s,Ye;e[64]!==_e||e[65]!==ne||e[66]!==V||e[67]!==W||e[68]!==A?(Ye=ne?(0,q.jsx)(de,{children:(0,q.jsx)(ot,{commandOptions:_e,allRows:V,variables:be,isSaving:A!==null,onSave:W,onCancel:Pe})}):null,e[64]=_e,e[65]=ne,e[66]=V,e[67]=W,e[68]=A,e[69]=Ye):Ye=e[69];let Xe;e[70]!==ce||e[71]!==oe||e[72]!==Ie||e[73]!==A?(Xe=oe.length>0?(0,q.jsx)(st,{groups:oe,anchorIds:ce,savingCommand:A,...Ie}):(0,q.jsx)(de,{children:(0,q.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]=Ie,e[73]=A,e[74]=Xe):Xe=e[74];let $;e[75]!==Je||e[76]!==Ye||e[77]!==Xe?($=(0,q.jsxs)(`div`,{inert:Je,className:`flex flex-col gap-8`,children:[Ye,Xe]}),e[75]=Je,e[76]=Ye,e[77]=Xe,e[78]=$):$=e[78];let Ze;return e[79]!==Q||e[80]!==qe||e[81]!==$?(Ze=(0,q.jsxs)(me,{children:[Q,qe,$]}),e[79]=Q,e[80]=qe,e[81]=$,e[82]=Ze):Ze=e[82],Ze}function ut(e){return e._tag===`Failure`}function dt(e){return F(e.environmentId,C)}function ft(e){return e._tag===`Failure`}function pt(e){return F(e.environmentId,C)}function mt(e){return e.hash.replace(/^#/,``)}var ht=lt;export{ht as component};
2
+ //# sourceMappingURL=settings.keybindings-C4ufqFiE.js.map
@@ -1,2 +1,2 @@
1
- import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Sm as i,Ud as a,mr as o,vf as s}from"./utils-DjbLtxuo.js";import{a as c,n as l,t as u}from"./tooltip-C7NAkYG3.js";import{n as d,r as f,t as p}from"./input-group-BQ_2ox-w.js";import{i as m,s as h}from"./settingsLayout-BbEwQ6Fy.js";import{_o as g,vo as _,yo as v}from"./main-B1sXOjZZ.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:i}=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 d;t[5]!==l||t[6]!==u?(d=(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]=d):d=t[7];let f=n.license,p;t[8]===n.bundles?p=t[9]:(p=O(n.bundles),t[8]=n.bundles,t[9]=p);let m;t[10]!==n.license||t[11]!==p?(m=(0,A.jsxs)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:[f,` · `,p]}),t[10]=n.license,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,A.jsxs)(v,{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,d,m]}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let y;t[16]!==n.name||t[17]!==n.sourceUrl?(y=n.sourceUrl?(0,A.jsx)(o,{"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)(s,{"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]!==h||t[20]!==y?(x=(0,A.jsxs)(`div`,{className:`flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9`,children:[h,y]}),t[19]=h,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)(_,{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]!==i||t[31]!==r||t[32]!==w?(T=(0,A.jsx)(g,{open:r,onOpenChange:i,children:w}),t[30]=i,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:s,filteredCount:m,totalCount:h}=e;if(!a){let e;t[0]!==m||t[1]!==h?(e=(0,A.jsx)(F,{filteredCount:m,totalCount:h}),t[0]=m,t[1]=h,t[2]=e):e=t[2];let n;t[3]===s?n=t[4]:(n=()=>s(!0),t[3]=s,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,A.jsx)(i,{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)(o,{"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 d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,A.jsx)(l,{side:`top`,children:`Search licenses`}),t[8]=d):d=t[8];let f;t[9]===a?f=t[10]:(f=(0,A.jsxs)(u,{children:[a,d]}),t[9]=a,t[10]=f);let p;return t[11]!==e||t[12]!==f?(p=(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e,f]}),t[11]=e,t[12]=f,t[13]=p):p=t[13],p}let g;t[14]!==m||t[15]!==h?(g=(0,A.jsx)(`div`,{className:`hidden sm:block`,children:(0,A.jsx)(F,{filteredCount:m,totalCount:h})}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,A.jsx)(d,{children:(0,A.jsx)(i,{"aria-hidden":!0,className:`size-3`})}),t[17]=_):_=t[17];let v;t[18]!==s||t[19]!==n.length?(v=()=>{n.length===0&&s(!1)},t[18]=s,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]!==s?(x=e=>{e.key===`Escape`&&(e.preventDefault(),r(``),s(!1))},t[23]=r,t[24]=s,t[25]=x):x=t[25];let S;t[26]!==n||t[27]!==v||t[28]!==y||t[29]!==x?(S=(0,A.jsxs)(p,{className:`w-36 sm:w-44`,children:[_,(0,A.jsx)(f,{"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]!==g||t[32]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,S]}),t[31]=g,t[32]=S,t[33]=C):C=t[33],C}function L(e){let t=(0,b.c)(8),{message:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Open-source notices are unavailable`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i,(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]=a);let s;t[3]===r?s=t[4]:(s=(0,A.jsx)(o,{type:`button`,size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=s);let c;return t[5]!==a||t[6]!==s?(c=(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[a,s]}),t[5]=a,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 g;e[4]!==n.manifest||e[5]!==n.status?(g=n.status===`ready`?n.manifest.entries:[],e[4]=n.manifest,e[5]=n.status,e[6]=g):g=e[6];let _=g,v;e[7]!==_||e[8]!==i?(v=E(_,i),e[7]=_,e[8]=i,e[9]=v):v=e[9];let x=v,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>d(z),e[10]=S):S=e[10];let C=S,w;e[11]!==_||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:_.length}):null,e[11]=_,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)(m,{children:(0,A.jsx)(h,{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-DlqO6HBa.js.map
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Al as i,au as a,lf as o,mr as s}from"./utils-CtzgibkN.js";import{a as c,n as l,t as u}from"./tooltip-DDv-MvO4.js";import{n as d,r as f,t as p}from"./input-group-euoW8Z7h.js";import{i as m,s as h}from"./settingsLayout-EWRSNE9F.js";import{Mo as g,No as _,jo as v}from"./main-D8lKEPYS.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:o}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,A.jsx)(i,{"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 d;t[5]!==l||t[6]!==u?(d=(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]=d):d=t[7];let f=n.license,p;t[8]===n.bundles?p=t[9]:(p=O(n.bundles),t[8]=n.bundles,t[9]=p);let m;t[10]!==n.license||t[11]!==p?(m=(0,A.jsxs)(`span`,{className:`max-w-[42%] shrink-0 truncate text-xs text-muted-foreground`,children:[f,` · `,p]}),t[10]=n.license,t[11]=p,t[12]=m):m=t[12];let h;t[13]!==d||t[14]!==m?(h=(0,A.jsxs)(_,{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,d,m]}),t[13]=d,t[14]=m,t[15]=h):h=t[15];let y;t[16]!==n.name||t[17]!==n.sourceUrl?(y=n.sourceUrl?(0,A.jsx)(s,{"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)(a,{"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]!==h||t[20]!==y?(x=(0,A.jsxs)(`div`,{className:`flex min-h-10 items-center hover:bg-muted/35 sm:min-h-9`,children:[h,y]}),t[19]=h,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)(g,{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]!==o||t[31]!==r||t[32]!==w?(T=(0,A.jsx)(v,{open:r,onOpenChange:o,children:w}),t[30]=o,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:i,onSearchOpenChange:a,filteredCount:m,totalCount:h}=e;if(!i){let e;t[0]!==m||t[1]!==h?(e=(0,A.jsx)(F,{filteredCount:m,totalCount:h}),t[0]=m,t[1]=h,t[2]=e):e=t[2];let n;t[3]===a?n=t[4]:(n=()=>a(!0),t[3]=a,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,A.jsx)(o,{className:`size-3`}),t[5]=r):r=t[5];let i;t[6]===n?i=t[7]:(i=(0,A.jsx)(c,{render:(0,A.jsx)(s,{"aria-label":`Search open-source licenses`,onClick:n,size:`icon-micro`,type:`button`,variant:`ghost-muted`,children:r})}),t[6]=n,t[7]=i);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,A.jsx)(l,{side:`top`,children:`Search licenses`}),t[8]=d):d=t[8];let f;t[9]===i?f=t[10]:(f=(0,A.jsxs)(u,{children:[i,d]}),t[9]=i,t[10]=f);let p;return t[11]!==e||t[12]!==f?(p=(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e,f]}),t[11]=e,t[12]=f,t[13]=p):p=t[13],p}let g;t[14]!==m||t[15]!==h?(g=(0,A.jsx)(`div`,{className:`hidden sm:block`,children:(0,A.jsx)(F,{filteredCount:m,totalCount:h})}),t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,A.jsx)(d,{children:(0,A.jsx)(o,{"aria-hidden":!0,className:`size-3`})}),t[17]=_):_=t[17];let v;t[18]!==a||t[19]!==n.length?(v=()=>{n.length===0&&a(!1)},t[18]=a,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]!==a?(x=e=>{e.key===`Escape`&&(e.preventDefault(),r(``),a(!1))},t[23]=r,t[24]=a,t[25]=x):x=t[25];let S;t[26]!==n||t[27]!==v||t[28]!==y||t[29]!==x?(S=(0,A.jsxs)(p,{className:`w-36 sm:w-44`,children:[_,(0,A.jsx)(f,{"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]!==g||t[32]!==S?(C=(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,S]}),t[31]=g,t[32]=S,t[33]=C):C=t[33],C}function L(e){let t=(0,b.c)(8),{message:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Open-source notices are unavailable`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,A.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i,(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]=a);let o;t[3]===r?o=t[4]:(o=(0,A.jsx)(s,{type:`button`,size:`xs`,variant:`outline`,onClick:r,children:`Try again`}),t[3]=r,t[4]=o);let c;return t[5]!==a||t[6]!==o?(c=(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-3 px-3 py-5 sm:px-4`,children:[a,o]}),t[5]=a,t[6]=o,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 g;e[4]!==n.manifest||e[5]!==n.status?(g=n.status===`ready`?n.manifest.entries:[],e[4]=n.manifest,e[5]=n.status,e[6]=g):g=e[6];let _=g,v;e[7]!==_||e[8]!==i?(v=E(_,i),e[7]=_,e[8]=i,e[9]=v):v=e[9];let x=v,S;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>d(z),e[10]=S):S=e[10];let C=S,w;e[11]!==_||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:_.length}):null,e[11]=_,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)(m,{children:(0,A.jsx)(h,{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-C7SQX7_o.js.map
@@ -0,0 +1,5 @@
1
+ import{a as e,t}from"./react-BUfh6y28.js";import{n,t as r}from"./jsx-runtime-DJeoFXNw.js";import{Jd as i,Jo as a,Lf as o,Ol as s,Qd as c,Td as l,Xn as u,Yd as d,Zn as f,al as p,fr as m,l as h,lf as g,mr as _,pf as v,rf as y,rr as b,t as x,tr as S,ws as C,yl as w}from"./utils-CtzgibkN.js";import{Hc as T,Up as E,aa as D,ca as O,ia as k,la as A,oa as j,ra as M,sa as N,sh as P,ua as F,w as I}from"./src-aYUfWMsw.js";import{n as L}from"./ChatMarkdown-Bueup3X5.js";import{a as R,c as z,o as B,s as V,t as H}from"./select--26O8gr7.js";import{t as U}from"./spinner-DiQtYQvU.js";import{t as W}from"./useLocation-fNQqSFar.js";import{m as G}from"./relay-DcCuBtiq.js";import{C as K}from"./useSettings-CnHpxSBo.js";import{f as q}from"./server-DKB_3xTN.js";import{n as ee}from"./query-DmYgeaGK.js";import{t as J}from"./use-atom-command-Bfi4daMj.js";import{c as te,d as ne}from"./providerSkills-BYU6vU9U.js";import{i as re}from"./usageFormat-DvpnUmwI.js";import{a as ie,n as ae,t as oe}from"./tooltip-DDv-MvO4.js";import{t as se}from"./skeleton-CfxEpnM8.js";import{t as ce}from"./textarea-CgJxMEC6.js";import{n as le,t as ue}from"./toggle-group-BQBgK4Fh.js";import{t as de}from"./input-BwujRX3Y.js";import{c as fe,r as pe,s as me,t as he}from"./dialog-BJ3R7bWN.js";import{i as ge,o as _e,r as ve,t as ye}from"./empty-BwsFVBxJ.js";import{n as be,r as xe,t as Se}from"./input-group-euoW8Z7h.js";import{a as Ce}from"./projectFilesQueryState-CXzO_JXd.js";import{a as we,i as Te,n as Ee,o as De,r as Oe,s as ke,t as Ae}from"./alert-dialog-BRZulAlJ.js";import{F as je,G as Me,V as Ne,a as Y,i as Pe,s as Fe}from"./settingsLayout-EWRSNE9F.js";import{Lr as Ie,Po as Le,ba as X}from"./main-D8lKEPYS.js";import{i as Re}from"./selfImproveFindings-CQHbA_SP.js";import{r as ze,t as Be}from"./SelfImproveSettingsSection-DrWeWHZ3.js";import{t as Ve}from"./SecretInput-CTGlsesz.js";var Z=n(),He={spawn:`Failed to start`,timeout:`Timed out`,protocol:`Not an MCP server`,http:`Can't connect`,auth:`Credentials rejected`};function Ue(e,t,n){if(!e.enabled)return{tone:`muted`,label:`Off`,needsSignIn:!1};if(n)return{tone:`muted`,label:`Checking…`,needsSignIn:!1};if(e.transport.type===`http`&&e.transport.auth===`oauth`&&t?.auth===`signed-out`)return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};let r=t?.health;switch(r?.status){case`connected`:return{tone:`success`,label:`Connected · ${r.toolCount} ${r.toolCount===1?`tool`:`tools`}`,needsSignIn:!1};case`needs-auth`:return{tone:`warning`,label:`Needs sign-in`,needsSignIn:!0};case`error`:return{tone:`error`,label:He[r.category],detail:r.message,needsSignIn:!1};default:return t?.auth===`signed-in`?{tone:`success`,label:`Signed in`,needsSignIn:!1}:{tone:`muted`,label:`Not checked`,needsSignIn:!1}}}function We(e){let t=e.transport;if(t.type===`http`)try{let e=new URL(t.url);return`Remote · ${e.host}${e.pathname===`/`?``:e.pathname}`}catch{return`Remote`}return[t.command,...t.args].join(` `)}var Q=e(t(),1),Ge=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ke=e=>typeof e==`string`&&e.trim()?e:void 0,qe=e=>{if(e!==null)try{let t=JSON.parse(e);return Ge(t)?t:void 0}catch{return}},Je=e=>{let t=Ke(e)?.replace(/^\.\//,``);if(t!==void 0&&t.toLowerCase().endsWith(`.svg`)&&!(t.startsWith(`/`)||t.split(/[\\/]/).includes(`..`)))return t};function Ye(e,t){let n=qe(e),r=qe(t),i=Ge(r?.interface)?r.interface:void 0,a=n?.author??r?.author,o={displayName:Ke(n?.displayName)??Ke(i?.displayName),description:Ke(n?.description)??Ke(r?.description),publisher:Ke(a)??(Ge(a)?Ke(a.name):void 0),iconPath:Je(n?.icon)??Je(i?.logo)??Je(i?.composerIcon)};return Object.fromEntries(Object.entries(o).filter(([,e])=>e!==void 0))}function Xe(e){let t=qe(e)?.userConfig;return Ge(t)?Object.entries(t).map(([e,t])=>{let n=Ge(t)?t:{},r=Ke(n.description);return{key:e,title:Ke(n.title)??e,...r===void 0?{}:{description:r},required:n.required===!0}}):[]}var $=e(r(),1),Ze=e=>{let t=P(C(e));return t&&!t.truncated?t.contents:null};function Qe(e){let t=(0,Z.c)(48),{environmentId:n,plugin:r,enabled:i,disabled:o,onDetails:s,onToggle:u}=e,d;t[0]!==n||t[1]!==r.path?(d=Ce(n,r.path,`.claude-plugin/plugin.json`),t[0]=n,t[1]=r.path,t[2]=d):d=t[2];let p=a(d),h;t[3]!==n||t[4]!==r.path?(h=Ce(n,r.path,`.codex-plugin/plugin.json`),t[3]=n,t[4]=r.path,t[5]=h):h=t[5];let g=a(h),{displayName:v,description:y,publisher:x,iconPath:C}=Ye(Ze(p),Ze(g)),w=Ze(a(Ce(n,r.path,C??null))),T=C&&w?.trimStart().startsWith(`<`)?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(w)}`:null,E=ne(n),D;t[6]===T?D=t[7]:(D=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-xl border border-border/60 bg-muted`,children:T?(0,$.jsx)(`img`,{src:T,alt:``,className:`size-6 object-contain`}):(0,$.jsx)(c,{className:`size-5 text-muted-foreground`})}),t[6]=T,t[7]=D);let O=v??r.name,k;t[8]===O?k=t[9]:(k=(0,$.jsx)(`span`,{className:`break-words text-sm font-medium`,children:O}),t[8]=O,t[9]=k);let A;t[10]===x?A=t[11]:(A=x?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:x}):null,t[10]=x,t[11]=A);let j;t[12]!==k||t[13]!==A?(j=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[k,A]}),t[12]=k,t[13]=A,t[14]=j):j=t[14];let M=y??`Local plugin`,N;t[15]===M?N=t[16]:(N=(0,$.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:M}),t[15]=M,t[16]=N);let P;t[17]!==j||t[18]!==N?(P=(0,$.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[j,N]}),t[17]=j,t[18]=N,t[19]=P):P=t[19];let F=`More for ${r.name}`,I;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(l,{"aria-hidden":!0}),t[20]=I):I=t[20];let L;t[21]===F?L=t[22]:(L=(0,$.jsx)(ie,{render:(0,$.jsx)(m,{render:(0,$.jsx)(_,{variant:`ghost`,size:`icon-sm`,"aria-label":F,children:I})})}),t[21]=F,t[22]=L);let R;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(ae,{children:`Plugin actions`}),t[23]=R):R=t[23];let z;t[24]===L?z=t[25]:(z=(0,$.jsxs)(oe,{children:[L,R]}),t[24]=L,t[25]=z);let B;t[26]!==n||t[27]!==E||t[28]!==r.path?(B=E.capabilities.canOpenDefault?(0,$.jsx)(S,{onClick:()=>void E.activate(`open`,{environmentId:n,filePath:r.path,workspaceRoot:void 0}),children:`Open`}):null,t[26]=n,t[27]=E,t[28]=r.path,t[29]=B):B=t[29];let V;t[30]===s?V=t[31]:(V=(0,$.jsx)(S,{onClick:s,children:`Details`}),t[30]=s,t[31]=V);let H;t[32]!==B||t[33]!==V?(H=(0,$.jsxs)(b,{align:`end`,children:[B,V]}),t[32]=B,t[33]=V,t[34]=H):H=t[34];let U;t[35]!==z||t[36]!==H?(U=(0,$.jsxs)(f,{children:[z,H]}),t[35]=z,t[36]=H,t[37]=U):U=t[37];let W=`Load ${r.name}`,G;t[38]!==o||t[39]!==i||t[40]!==u||t[41]!==W?(G=(0,$.jsx)(Le,{"aria-label":W,checked:i,disabled:o,onCheckedChange:u}),t[38]=o,t[39]=i,t[40]=u,t[41]=W,t[42]=G):G=t[42];let K;return t[43]!==P||t[44]!==U||t[45]!==G||t[46]!==D?(K=(0,$.jsxs)(`li`,{className:`flex items-center gap-4 py-4`,children:[D,P,U,G]}),t[43]=P,t[44]=U,t[45]=G,t[46]=D,t[47]=K):K=t[47],K}var $e=[`Personal`,`Built-in`,`Project`,`Plugins`,`Other`];function et(e){switch(te(e)){case`personal`:return`Personal`;case`system`:return`Built-in`;case`repo`:case`project`:return`Project`;case`app`:return`Plugins`;default:return`Other`}}var tt=[[`codex`,`Codex`],[`claudeAgent`,`Claude`],[`cursor`,`Cursor`],[`grok`,`Grok`],[`antigravity`,`Antigravity`],[`opencode`,`OpenCode`],[`muse`,`Muse`],[`pi`,`Pi`]],nt={remote:`Remote servers aren't supported by this provider`,"working-directory":`Servers with a working directory aren't supported here`,provider:`Not supported by this provider yet`};function rt(e){return tt.find(([t])=>t===e)?.[1]??e}function it(e){switch(e){case`signed-in`:return`Signed in`;case`signed-out`:return`Not signed in`;case`unavailable`:return`Add this server to the provider's own MCP config to sign in.`;case`unknown`:return`Sign-in status unknown`}}function at(e,t){if(!O(e))return`unavailable`;let n=t.filter(t=>t.driver===e);if(n.some(e=>e.status===`signed-in`))return`signed-in`;if(n.some(e=>e.status===`signed-out`))return`needs-sign-in`}function ot(e){return tt.map(([t,n])=>{let r=j(t,e.transport),i=F.make(t);return{driver:i,label:n,enabled:r.supported&&!e.disabledProviders.includes(i),...r.supported?{}:{unsupported:nt[r.reason]}}})}var st={name:``,type:`stdio`,command:``,args:``,cwd:``,url:``,auth:`none`,values:[]};function ct(e){let t=e.transport;return t.type===`stdio`?{...st,name:e.name,type:`stdio`,command:t.command,args:t.args.join(`
2
+ `),cwd:t.cwd??``,values:Object.entries(t.env).map(([e,t])=>({key:e,value:t}))}:{...st,name:e.name,type:`http`,url:t.url,auth:t.auth,values:Object.entries(t.headers).map(([e,t])=>({key:e,value:t}))}}var lt=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;function ut(e,t){let n=e.name.trim();if(!n)return`Enter a name.`;if(!lt.test(n)||n.length>64)return`Use letters, numbers, dashes, and underscores.`;if(n===`p4-code`)return`That name belongs to P4 Code's own server.`;if(t.has(n))return`Another server already uses that name.`;if(e.type===`stdio`&&!e.command.trim())return`Enter the command that starts it.`;if(e.type===`http`&&!/^https?:\/\/\S+$/i.test(e.url.trim()))return`Enter an http or https URL.`}function dt(e,t){let n=Object.fromEntries(e.values.map(e=>[e.key.trim(),e.value]).filter(([e])=>e.length>0)),r=e.type===`stdio`?{type:`stdio`,command:e.command.trim(),args:e.args.split(`
3
+ `).map(e=>e.trim()).filter(e=>e.length>0),env:n,...e.cwd.trim()?{cwd:e.cwd.trim()}:{}}:{type:`http`,url:e.url.trim(),headers:n,auth:e.auth};return{name:e.name.trim(),enabled:t?.enabled??!0,transport:r,disabledProviders:t?.disabledProviders??[],...t?.source===void 0?{}:{source:t.source}}}function ft(e){let t=new Map;for(let n of e){let e=n.displayName??n.driver;for(let r of n.skills){let n=`${r.scope??``}\u0000${r.name}`,i=t.get(n);i===void 0?t.set(n,{skill:r,providers:[e]}):i.providers.includes(e)||i.providers.push(e)}}return[...t.values()].toSorted((e,t)=>pt(e.skill).localeCompare(pt(t.skill)))}var pt=e=>e.displayName??e.name.split(/[-_\s]+/).filter(e=>e.length>0).map(e=>e[0].toUpperCase()+e.slice(1)).join(` `);function mt(e){switch(e){case void 0:return;case`user`:return`Personal`;case`project`:case`repo`:return`Project`;case`system`:return`Built-in`;default:return e[0].toUpperCase()+e.slice(1)}}function ht(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(e);return(t===null?e:e.slice(t[0].length)).trimStart()}function gt(e){let t=(0,Z.c)(14),{title:n,onBack:r,onUninstall:i,children:a}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(p,{"aria-hidden":!0}),t[0]=s):s=t[0];let c;t[1]===r?c=t[2]:(c=(0,$.jsxs)(_,{size:`xs`,variant:`ghost`,className:`w-fit`,onClick:r,children:[s,`Back`]}),t[1]=r,t[2]=c);let l;t[3]===n?l=t[4]:(l=(0,$.jsx)(`h2`,{className:`min-w-0 truncate text-xl font-semibold text-foreground`,children:n}),t[3]=n,t[4]=l);let u;t[5]===i?u=t[6]:(u=i?(0,$.jsxs)(_,{size:`sm`,variant:`destructive-outline`,onClick:i,children:[(0,$.jsx)(o,{"aria-hidden":!0}),`Uninstall`]}):null,t[5]=i,t[6]=u);let d;t[7]!==l||t[8]!==u?(d=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;return t[10]!==a||t[11]!==c||t[12]!==d?(f=(0,$.jsxs)(`div`,{className:`grid gap-6`,children:[c,d,a]}),t[10]=a,t[11]=c,t[12]=d,t[13]=f):f=t[13],f}function _t(e){let t=(0,Z.c)(6),{label:n,htmlFor:r,children:i}=e,a;t[0]!==r||t[1]!==n?(a=(0,$.jsx)(X,{htmlFor:r,children:n}),t[0]=r,t[1]=n,t[2]=a):a=t[2];let o;return t[3]!==i||t[4]!==a?(o=(0,$.jsxs)(`div`,{className:`grid gap-2 px-4 py-4`,children:[a,i]}),t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function vt(e){let t=(0,Z.c)(69),{server:n,takenNames:r,onSave:i}=e,a;t[0]===n?a=t[1]:(a=n===void 0?st:ct(n),t[0]=n,t[1]=a);let s=a,[c,l]=(0,Q.useState)(s),u;t[2]===s?u=t[3]:(u=JSON.stringify(s),t[2]=s,t[3]=u);let f=u,[p,m]=(0,Q.useState)(f);f!==p&&(m(f),l(s));let h;t[4]!==c||t[5]!==r?(h=ut(c,r),t[4]=c,t[5]=r,t[6]=h):h=t[6];let g=h,v;t[7]===c?v=t[8]:(v=JSON.stringify(c),t[7]=c,t[8]=v);let y=v!==f,b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>l(t=>({...t,...e})),t[9]=b):b=t[9];let x=b,S=c.type===`stdio`?`Environment variables`:`Headers`,C;t[10]===c.values?C=t[11]:(C=(e,t)=>x({values:c.values.map((n,r)=>r===e?{...n,...t}:n)}),t[10]=c.values,t[11]=C);let w=C,T;t[12]!==y||t[13]!==c||t[14]!==i||t[15]!==g||t[16]!==n?(T=e=>{e.preventDefault(),y&&g===void 0&&i(dt(c,n))},t[12]=y,t[13]=c,t[14]=i,t[15]=g,t[16]=n,t[17]=T):T=t[17];let E;t[18]===n?E=t[19]:(E=n===void 0?null:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`To switch between a command and a URL, uninstall the server and add it again.`}),t[18]=n,t[19]=E);let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>x({name:e.target.value}),t[20]=D):D=t[20];let O;t[21]===c.name?O=t[22]:(O=(0,$.jsx)(_t,{label:`Name`,htmlFor:`mcp-server-name`,children:(0,$.jsx)(de,{id:`mcp-server-name`,placeholder:`github`,value:c.name,onChange:D})}),t[21]=c.name,t[22]=O);let k;t[23]!==c.type||t[24]!==n?(k=n===void 0?(0,$.jsx)(_t,{label:`Type`,children:(0,$.jsxs)(le,{"aria-label":`How P4 Code reaches the server`,value:[c.type],onValueChange:e=>{let t=e[0];(t===`stdio`||t===`http`)&&x({type:t,values:[]})},children:[(0,$.jsx)(ue,{value:`stdio`,children:`Command`}),(0,$.jsx)(ue,{value:`http`,children:`URL`})]})}):null,t[23]=c.type,t[24]=n,t[25]=k):k=t[25];let A;t[26]!==c.args||t[27]!==c.auth||t[28]!==c.command||t[29]!==c.cwd||t[30]!==c.type||t[31]!==c.url?(A=c.type===`stdio`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_t,{label:`Command`,htmlFor:`mcp-server-command`,children:(0,$.jsx)(de,{id:`mcp-server-command`,placeholder:`npx`,value:c.command,onChange:e=>x({command:e.target.value})})}),(0,$.jsx)(_t,{label:`Arguments, one per line`,htmlFor:`mcp-server-args`,children:(0,$.jsx)(ce,{id:`mcp-server-args`,placeholder:`-y
4
+ @modelcontextprotocol/server-postgres`,value:c.args,onChange:e=>x({args:e.target.value})})}),(0,$.jsx)(_t,{label:`Working directory (optional)`,htmlFor:`mcp-server-cwd`,children:(0,$.jsx)(de,{id:`mcp-server-cwd`,placeholder:`The session's project folder`,value:c.cwd,onChange:e=>x({cwd:e.target.value})})})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(_t,{label:`URL`,htmlFor:`mcp-server-url`,children:(0,$.jsx)(de,{id:`mcp-server-url`,placeholder:`https://mcp.example.com/mcp`,value:c.url,onChange:e=>x({url:e.target.value})})}),(0,$.jsx)(_t,{label:`Authentication`,children:(0,$.jsxs)(H,{value:c.auth,onValueChange:e=>{(e===`none`||e===`oauth`)&&x({auth:e})},children:[(0,$.jsx)(V,{"aria-label":`Authentication`,children:(0,$.jsx)(z,{children:yt})}),(0,$.jsxs)(B,{alignItemWithTrigger:!1,children:[(0,$.jsx)(R,{value:`none`,children:`None or headers`}),(0,$.jsx)(R,{value:`oauth`,children:`OAuth (sign in after saving)`})]})]})})]}),t[26]=c.args,t[27]=c.auth,t[28]=c.command,t[29]=c.cwd,t[30]=c.type,t[31]=c.url,t[32]=A):A=t[32];let j;t[33]!==c.type||t[34]!==c.values||t[35]!==w||t[36]!==S?(j=c.values.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(de,{"aria-label":`${S} name`,placeholder:c.type===`stdio`?`API_TOKEN`:`Authorization`,value:e.key,onChange:e=>w(t,{key:e.target.value})}),(0,$.jsx)(Ve,{"aria-label":`${S} value`,placeholder:`Value`,value:e.value,onChange:e=>w(t,{value:e.target.value})}),(0,$.jsx)(_,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${e.key||`row`}`,onClick:()=>x({values:c.values.filter((e,n)=>n!==t)}),children:(0,$.jsx)(o,{"aria-hidden":!0})})]},t)),t[33]=c.type,t[34]=c.values,t[35]=w,t[36]=S,t[37]=j):j=t[37];let M;t[38]===c.values?M=t[39]:(M=()=>x({values:[...c.values,{key:``,value:``}]}),t[38]=c.values,t[39]=M);let N;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(d,{"aria-hidden":!0}),t[40]=N):N=t[40];let P=c.type===`stdio`?`variable`:`header`,F;t[41]!==M||t[42]!==P?(F=(0,$.jsxs)(_,{variant:`soft`,onClick:M,children:[N,`Add `,P]}),t[41]=M,t[42]=P,t[43]=F):F=t[43];let I;t[44]!==j||t[45]!==F?(I=(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[j,F]}),t[44]=j,t[45]=F,t[46]=I):I=t[46];let L;t[47]!==I||t[48]!==S?(L=(0,$.jsx)(_t,{label:S,children:I}),t[47]=I,t[48]=S,t[49]=L):L=t[49];let U;t[50]!==O||t[51]!==k||t[52]!==A||t[53]!==L?(U=(0,$.jsxs)(Me,{children:[O,k,A,L]}),t[50]=O,t[51]=k,t[52]=A,t[53]=L,t[54]=U):U=t[54];let W;t[55]!==y||t[56]!==g?(W=y&&g!==void 0?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:g}):null,t[55]=y,t[56]=g,t[57]=W):W=t[57];let G=!y||g!==void 0,K=n===void 0?`Add server`:`Save`,q;t[58]!==G||t[59]!==K?(q=(0,$.jsx)(_,{type:`submit`,disabled:G,children:K}),t[58]=G,t[59]=K,t[60]=q):q=t[60];let ee;t[61]!==W||t[62]!==q?(ee=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[W,q]}),t[61]=W,t[62]=q,t[63]=ee):ee=t[63];let J;return t[64]!==U||t[65]!==ee||t[66]!==T||t[67]!==E?(J=(0,$.jsxs)(`form`,{className:`grid gap-3`,onSubmit:T,children:[E,U,ee]}),t[64]=U,t[65]=ee,t[66]=T,t[67]=E,t[68]=J):J=t[68],J}function yt(e){return e===`oauth`?`OAuth (sign in after saving)`:`None or headers`}function bt(e){let t=(0,Z.c)(55),{environmentId:n,plugin:r,environmentLabel:i,onSave:o}=e,s=r?.path??``,c=r===void 0?null:`.claude-plugin/plugin.json`,l;t[0]!==n||t[1]!==s||t[2]!==c?(l=Ce(n,s,c),t[0]=n,t[1]=s,t[2]=c,t[3]=l):l=t[3];let u=P(C(a(l))),d=Xe(r!==void 0&&u!==null&&!u.truncated?u.contents:null),f;t[4]===r?.options?f=t[5]:(f=r?.options??{},t[4]=r?.options,t[5]=f);let p=f,m=[...d,...Object.keys(p).filter(e=>!d.some(t=>t.key===e)).map(St)],[h,g]=(0,Q.useState)(r?.name??``),[v,y]=(0,Q.useState)(r?.path??``),[b,x]=(0,Q.useState)(p),S;t[6]!==r?.name||t[7]!==r?.path||t[8]!==p?(S=JSON.stringify([r?.name??``,r?.path??``,p]),t[6]=r?.name,t[7]=r?.path,t[8]=p,t[9]=S):S=t[9];let w=S,[T,E]=(0,Q.useState)(w);w!==T&&(E(w),g(r?.name??``),y(r?.path??``),x(p));let D,O;t[10]!==h||t[11]!==b||t[12]!==v||t[13]!==r?.name||t[14]!==r?.path||t[15]!==p?(D=Object.fromEntries(Object.entries(b).filter(xt)),O=h!==(r?.name??``)||v!==(r?.path??``)||JSON.stringify(D)!==JSON.stringify(p),t[10]=h,t[11]=b,t[12]=v,t[13]=r?.name,t[14]=r?.path,t[15]=p,t[16]=D,t[17]=O):(D=t[16],O=t[17]);let k=O,A;t[18]!==h||t[19]!==v?(A=h.trim().length>0&&v.trim().startsWith(`/`),t[18]=h,t[19]=v,t[20]=A):A=t[20];let j=A,M;t[21]!==k||t[22]!==h||t[23]!==D||t[24]!==o||t[25]!==v||t[26]!==r?.enabled||t[27]!==j?(M=e=>{e.preventDefault(),k&&j&&o({name:h.trim(),path:v.trim(),enabled:r?.enabled??!0,options:D})},t[21]=k,t[22]=h,t[23]=D,t[24]=o,t[25]=v,t[26]=r?.enabled,t[27]=j,t[28]=M):M=t[28];let N;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(N=e=>g(e.target.value),t[29]=N):N=t[29];let F;t[30]===h?F=t[31]:(F=(0,$.jsx)(_t,{label:`Name`,htmlFor:`plugin-name`,children:(0,$.jsx)(de,{id:`plugin-name`,value:h,onChange:N})}),t[30]=h,t[31]=F);let I=`Folder on ${i}`,L;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>y(e.target.value),t[32]=L):L=t[32];let R;t[33]===v?R=t[34]:(R=(0,$.jsx)(de,{id:`plugin-path`,placeholder:`/Users/me/plugins/my-plugin`,value:v,onChange:L}),t[33]=v,t[34]=R);let z;t[35]!==I||t[36]!==R?(z=(0,$.jsx)(_t,{label:I,htmlFor:`plugin-path`,children:R}),t[35]=I,t[36]=R,t[37]=z):z=t[37];let B=m.map(e=>(0,$.jsx)(_t,{label:e.required?e.title:`${e.title} (optional)`,htmlFor:`plugin-option-${e.key}`,children:(0,$.jsx)(Ve,{id:`plugin-option-${e.key}`,placeholder:`description`in e?e.description:void 0,value:b[e.key]??``,onChange:t=>x(n=>({...n,[e.key]:t.target.value}))})},e.key)),V;t[38]!==F||t[39]!==z||t[40]!==B?(V=(0,$.jsxs)(Me,{children:[F,z,B]}),t[38]=F,t[39]=z,t[40]=B,t[41]=V):V=t[41];let H;t[42]!==k||t[43]!==j?(H=k&&!j?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive-foreground`,children:`Enter a name and the plugin folder's full path.`}):null,t[42]=k,t[43]=j,t[44]=H):H=t[44];let U=!k||!j,W=r===void 0?`Add plugin`:`Save`,G;t[45]!==U||t[46]!==W?(G=(0,$.jsx)(_,{type:`submit`,disabled:U,children:W}),t[45]=U,t[46]=W,t[47]=G):G=t[47];let K;t[48]!==H||t[49]!==G?(K=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[H,G]}),t[48]=H,t[49]=G,t[50]=K):K=t[50];let q;return t[51]!==V||t[52]!==K||t[53]!==M?(q=(0,$.jsxs)(`form`,{className:`grid gap-3`,onSubmit:M,children:[V,K]}),t[51]=V,t[52]=K,t[53]=M,t[54]=q):q=t[54],q}function xt(e){let[,t]=e;return t}function St(e){return{key:e,title:e,required:!1}}var Ct=e=>e.replace(/[\\/][^\\/]*$/,``)||`/`;function wt(e){let t=(0,Z.c)(69),{entry:n,environmentId:r,onClose:i}=e,{skill:o,providers:s}=n,c,u,d;t[0]!==r||t[1]!==o.path?(c=Ct(o.path),u=a,d=Ce(r,c,o.path),t[0]=r,t[1]=o.path,t[2]=c,t[3]=u,t[4]=d):(c=t[2],u=t[3],d=t[4]);let p=u(d),h;t[5]===p?h=t[6]:(h=P(C(p)),t[5]=p,t[6]=h);let g=h,v=ne(r),{copyToClipboard:y}=G(),x;t[7]!==r||t[8]!==o.path?(x={environmentId:r,filePath:o.path,workspaceRoot:void 0},t[7]=r,t[8]=o.path,t[9]=x):x=t[9];let T=x,E=o.shortDescription??o.description,D;t[10]===o.scope?D=t[11]:(D=mt(o.scope),t[10]=o.scope,t[11]=D);let O=D,k;t[12]===i?k=t[13]:(k=e=>!e&&i(),t[12]=i,t[13]=k);let A;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`flex size-12 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,$.jsx)(w,{className:`size-5`})}),t[14]=A):A=t[14];let j;t[15]===o?j=t[16]:(j=pt(o),t[15]=o,t[16]=j);let M=`More for ${j}`,N;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(l,{"aria-hidden":!0}),t[17]=N):N=t[17];let F;t[18]===M?F=t[19]:(F=(0,$.jsx)(m,{render:(0,$.jsx)(_,{size:`icon-sm`,variant:`ghost`,"aria-label":M,children:N})}),t[18]=M,t[19]=F);let I;t[20]!==v||t[21]!==T?(I=v.capabilities.canOpenDefault?(0,$.jsx)(S,{onClick:()=>void v.activate(`open`,T),children:`Open`}):null,t[20]=v,t[21]=T,t[22]=I):I=t[22];let R;t[23]!==v||t[24]!==T?(R=v.capabilities.revealLabel?(0,$.jsx)(S,{onClick:()=>void v.activate(`reveal-in-folder`,T),children:v.capabilities.revealLabel}):null,t[23]=v,t[24]=T,t[25]=R):R=t[25];let z=g===null,B;t[26]!==y||t[27]!==g?(B=()=>g&&y(g.contents,void 0),t[26]=y,t[27]=g,t[28]=B):B=t[28];let V;t[29]!==z||t[30]!==B?(V=(0,$.jsx)(S,{disabled:z,onClick:B,children:`Copy Markdown`}),t[29]=z,t[30]=B,t[31]=V):V=t[31];let H;t[32]!==I||t[33]!==R||t[34]!==V?(H=(0,$.jsxs)(b,{align:`end`,children:[I,R,V]}),t[32]=I,t[33]=R,t[34]=V,t[35]=H):H=t[35];let U;t[36]!==F||t[37]!==H?(U=(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3 pe-8`,children:[A,(0,$.jsxs)(f,{children:[F,H]})]}),t[36]=F,t[37]=H,t[38]=U):U=t[38];let W;t[39]===o?W=t[40]:(W=pt(o),t[39]=o,t[40]=W);let K;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,$.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Skill`}),t[41]=K):K=t[41];let q;t[42]===W?q=t[43]:(q=(0,$.jsxs)(fe,{children:[W,` `,K]}),t[42]=W,t[43]=q);let ee;t[44]===E?ee=t[45]:(ee=E?(0,$.jsx)(pe,{children:E}):null,t[44]=E,t[45]=ee);let J;t[46]!==q||t[47]!==ee?(J=(0,$.jsxs)(`div`,{className:`grid gap-1.5`,children:[q,ee]}),t[46]=q,t[47]=ee,t[48]=J):J=t[48];let te;t[49]!==c||t[50]!==r||t[51]!==g||t[52]!==p?(te=(0,$.jsx)(`div`,{className:`max-h-[50vh] min-h-24 overflow-y-auto rounded-xl border border-border/60 bg-card/40 px-5 py-4`,children:g===null?p._tag===`Failure`?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This skill's file could not be read. It may have moved since the provider last scanned it.`}):(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[(0,$.jsx)(se,{className:`h-4 w-3/4`}),(0,$.jsx)(se,{className:`h-4 w-full`}),(0,$.jsx)(se,{className:`h-4 w-2/3`})]}):(0,$.jsx)(L,{text:ht(g.contents),cwd:c,environmentId:r})}),t[49]=c,t[50]=r,t[51]=g,t[52]=p,t[53]=te):te=t[53];let re;t[54]===s?re=t[55]:(re=s.join(`, `),t[54]=s,t[55]=re);let ie=`Loaded by ${re}`,ae;t[56]!==O||t[57]!==ie?(ae=[O,ie].filter(Boolean),t[56]=O,t[57]=ie,t[58]=ae):ae=t[58];let oe=ae.join(` · `),ce;t[59]===oe?ce=t[60]:(ce=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:oe}),t[59]=oe,t[60]=ce);let le;t[61]!==U||t[62]!==J||t[63]!==te||t[64]!==ce?(le=(0,$.jsx)(me,{className:`max-w-2xl`,children:(0,$.jsxs)(`div`,{className:`grid min-h-0 gap-4 p-6`,children:[U,J,te,ce]})}),t[61]=U,t[62]=J,t[63]=te,t[64]=ce,t[65]=le):le=t[65];let ue;return t[66]!==le||t[67]!==k?(ue=(0,$.jsx)(he,{open:!0,onOpenChange:k,children:le}),t[66]=le,t[67]=k,t[68]=ue):ue=t[68],ue}var Tt={"edited-both-sides":`Changed here and on another machine since the last sync.`,"unmanaged-local-collision":`This machine has its own copy with the same name.`,"deleted-remotely-edited-locally":`Deleted on another machine, changed here.`,"mass-removal-held":`Most synced items vanished from the hub at once, so nothing was removed here.`,"hub-behind-manifest":`The hub has an older copy than this machine last synced.`,"not-writable-here":`This machine cannot hold this item.`,"write-failed":`Could not be written here. The next sync tries again.`,"has-credentials":`Has environment values, headers, or a key in its URL or arguments, which stay on this machine.`,"duplicate-name":`More than one MCP server here has this name.`};function Et(e){return Tt[e]??e}var Dt={skill:`Skill`,agent:`Subagent`,memory:`Memory`,mcp:`MCP server`,settings:`Settings`};function Ot(e){return`${Dt[e.kind]} ${e.name}`}function kt(e){if(e.running)return`Syncing…`;let t=e.lastRun;if(t===null)return`Not synced since the server started.`;let n=re(t.finishedAt);if(t.outcome===`unavailable`)return`Couldn't reach the hub at ${n}.`;let r=[t.received>0?`${t.received} received`:null,t.published>0?`${t.published} shared`:null,t.removed>0?`${t.removed} removed`:null].filter(e=>e!==null);return`Synced ${n}${r.length>0?` · ${r.join(` · `)}`:` · no changes`}.`}function At(){let e=(0,Z.c)(4),{scope:t,environment:n}=Ne(),r=t.environmentIds.length===1?n?.environmentId??null:null,i=n?.connection.phase===`connected`&&n.serverConfig!==null,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=Ie(`hub-sync`),e[0]=a):a=e[0];let o;return e[1]!==i||e[2]!==r?(o=(0,$.jsx)(Fe,{...a,children:r&&i?(0,$.jsx)(Mt,{environmentId:r}):(0,$.jsx)(Y,{title:`Hub`,description:`Pick a single connected environment to sync its skills, subagents and memory.`})}),e[1]=i,e[2]=r,e[3]=o):o=e[3],o}function jt(e,t){let n=Re(e,t);return n.ok?null:n.message}function Mt(e){let t=(0,Z.c)(95),{environmentId:n}=e,r;t[0]===n?r=t[1]:(r=q.hubSyncLive({environmentId:n,input:void 0}),t[0]=n,t[1]=r);let i=ee(r),o;t[2]===n?o=t[3]:(o=q.connectHubSync.permissionAtom(n),t[2]=n,t[3]=o);let s=a(o),c;t[4]===n?c=t[5]:(c=q.runHubSyncNow.permissionAtom(n),t[4]=n,t[5]=c);let l=a(c),u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[6]=u):u=t[6];let d=u,f=J(q.disconnectHubSync,d),p=J(q.setHubSyncMode,d),m=J(q.runHubSyncNow,d),[h,g]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(null),b=i.data;if(!b){let e=i.error?`Couldn't load hub sync.`:`Loading…`,n;return t[7]===e?n=t[8]:(n=(0,$.jsx)(Y,{title:`Hub`,status:e}),t[7]=e,t[8]=n),n}let x=b.source!==`none`,S=b.source===`environment`,C;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(C=async e=>{g(!0),y(await e()),g(!1)},t[9]=C):C=t[9];let w=C,T,E,D,O,k,A,j,M,N,P;if(t[10]!==s||t[11]!==l||t[12]!==f||t[13]!==n||t[14]!==v||t[15]!==S||t[16]!==x||t[17]!==h||t[18]!==m||t[19]!==p||t[20]!==b){let e=b.lastRun?.conflicts??[],r=b.lastRun?.refused??[],i=!x,a=!s||x,o;t[31]!==n||t[32]!==a?(o=(0,$.jsx)(Pt,{environmentId:n,disabled:a}),t[31]=n,t[32]=a,t[33]=o):o=t[33],t[34]!==i||t[35]!==o?(k=(0,$.jsx)(Be,{open:i,children:o}),t[34]=i,t[35]=o,t[36]=k):k=t[36],E=Be,N=x;let c=S?` · set by P4CODE_HUB_URL on the server`:null,u;t[37]===v?u=t[38]:(u=(0,$.jsx)(ze,{text:v}),t[37]=v,t[38]=u);let d;t[39]!==b.baseUrl||t[40]!==c||t[41]!==u?(d=(0,$.jsxs)($.Fragment,{children:[b.baseUrl,c,u]}),t[39]=b.baseUrl,t[40]=c,t[41]=u,t[42]=d):d=t[42];let g;t[43]!==s||t[44]!==f||t[45]!==n||t[46]!==S||t[47]!==x||t[48]!==h?(g=S?null:(0,$.jsx)(_,{size:`sm`,variant:`outline`,disabled:!s||h||!x,onClick:()=>void w(async()=>jt(await f({environmentId:n,input:void 0}),`Couldn't disconnect.`)),children:`Disconnect`}),t[43]=s,t[44]=f,t[45]=n,t[46]=S,t[47]=x,t[48]=h,t[49]=g):g=t[49],t[50]!==d||t[51]!==g?(P=(0,$.jsx)(Y,{title:`Hub`,status:d,control:g}),t[50]=d,t[51]=g,t[52]=P):P=t[52];let y=`When the server starts and every ${b.intervalMinutes} minutes.`,C=b.syncMode===`auto`,F=!s||h||!x,I;t[53]!==n||t[54]!==p?(I=e=>void w(async()=>jt(await p({environmentId:n,input:{syncMode:e?`auto`:`paused`}}),`Couldn't change automatic sync.`)),t[53]=n,t[54]=p,t[55]=I):I=t[55];let L;t[56]!==C||t[57]!==F||t[58]!==I?(L=(0,$.jsx)(Le,{"aria-label":`Sync automatically`,checked:C,disabled:F,onCheckedChange:I}),t[56]=C,t[57]=F,t[58]=I,t[59]=L):L=t[59],t[60]!==y||t[61]!==L?(D=(0,$.jsx)(Y,{title:`Sync automatically`,description:y,control:L}),t[60]=y,t[61]=L,t[62]=D):D=t[62];let R;t[63]===b?R=t[64]:(R=kt(b),t[63]=b,t[64]=R);let z;t[65]===R?z=t[66]:(z=(0,$.jsx)(`span`,{role:`status`,"aria-live":`polite`,children:R}),t[65]=R,t[66]=z);let B=!l||h||b.running||!x,V;t[67]!==n||t[68]!==m?(V=()=>void w(async()=>jt(await m({environmentId:n,input:void 0}),`Couldn't start a sync.`)),t[67]=n,t[68]=m,t[69]=V):V=t[69];let H;t[70]===b.running?H=t[71]:(H=b.running?(0,$.jsx)(U,{size:`xs`}):null,t[70]=b.running,t[71]=H);let W;t[72]!==B||t[73]!==V||t[74]!==H?(W=(0,$.jsxs)(_,{size:`sm`,variant:`outline`,disabled:B,onClick:V,children:[H,`Sync now`]}),t[72]=B,t[73]=V,t[74]=H,t[75]=W):W=t[75],t[76]!==z||t[77]!==W?(O=(0,$.jsx)(Y,{title:`Last sync`,status:z,control:W}),t[76]=z,t[77]=W,t[78]=O):O=t[78],T=Ft,A=n,j=[...e,...r],M=new Set(e.map(Nt)),t[10]=s,t[11]=l,t[12]=f,t[13]=n,t[14]=v,t[15]=S,t[16]=x,t[17]=h,t[18]=m,t[19]=p,t[20]=b,t[21]=T,t[22]=E,t[23]=D,t[24]=O,t[25]=k,t[26]=A,t[27]=j,t[28]=M,t[29]=N,t[30]=P}else T=t[21],E=t[22],D=t[23],O=t[24],k=t[25],A=t[26],j=t[27],M=t[28],N=t[29],P=t[30];let F=!l||b.running||!x,I;t[79]!==T||t[80]!==F||t[81]!==A||t[82]!==j||t[83]!==M?(I=(0,$.jsx)(T,{environmentId:A,issues:j,resolvable:M,disabled:F}),t[79]=T,t[80]=F,t[81]=A,t[82]=j,t[83]=M,t[84]=I):I=t[84];let L;t[85]!==E||t[86]!==D||t[87]!==O||t[88]!==I||t[89]!==N||t[90]!==P?(L=(0,$.jsxs)(E,{open:N,children:[P,D,O,I]}),t[85]=E,t[86]=D,t[87]=O,t[88]=I,t[89]=N,t[90]=P,t[91]=L):L=t[91];let R;return t[92]!==k||t[93]!==L?(R=(0,$.jsxs)($.Fragment,{children:[k,L]}),t[92]=k,t[93]=L,t[94]=R):R=t[94],R}var Nt=e=>`${e.kind}/${e.name}`;function Pt(e){let t=(0,Z.c)(34),[n,r]=(0,Q.useState)(``),[i,a]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={reportFailure:!1},t[0]=u):u=t[0];let d=J(q.connectHubSync,u),f=e.disabled||o,p;t[1]!==n||t[2]!==i?(p=n.trim()!==``&&i.trim()!==``,t[1]=n,t[2]=i,t[3]=p):p=t[3];let m=p,h;t[4]===c?h=t[5]:(h=(0,$.jsx)(ze,{text:c}),t[4]=c,t[5]=h);let g;t[6]!==n||t[7]!==d||t[8]!==f||t[9]!==e.environmentId||t[10]!==m||t[11]!==i?(g=t=>{t.preventDefault(),m&&!f&&(s(!0),d({environmentId:e.environmentId,input:{baseUrl:n.trim(),token:i.trim()}}).then(e=>{let t=jt(e,`Couldn't link the hub.`);l(t),t===null&&a(``),s(!1)}))},t[6]=n,t[7]=d,t[8]=f,t[9]=e.environmentId,t[10]=m,t[11]=i,t[12]=g):g=t[12];let v;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>r(e.target.value),t[13]=v):v=t[13];let y;t[14]!==n||t[15]!==f?(y=(0,$.jsx)(`div`,{className:`min-w-48 flex-1`,children:(0,$.jsx)(de,{"aria-label":`Hub URL`,autoComplete:`off`,value:n,disabled:f,placeholder:`https://hub.example.ts.net`,onChange:v})}),t[14]=n,t[15]=f,t[16]=y):y=t[16];let b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>a(e.target.value),t[17]=b):b=t[17];let x;t[18]!==f||t[19]!==i?(x=(0,$.jsx)(`div`,{className:`min-w-40 flex-1`,children:(0,$.jsx)(de,{"aria-label":`Hub token`,type:`password`,autoComplete:`off`,value:i,disabled:f,placeholder:`Token`,onChange:b})}),t[18]=f,t[19]=i,t[20]=x):x=t[20];let S=f||!m,C;t[21]===o?C=t[22]:(C=o?(0,$.jsx)(U,{size:`xs`}):null,t[21]=o,t[22]=C);let w;t[23]!==S||t[24]!==C?(w=(0,$.jsxs)(_,{type:`submit`,size:`sm`,disabled:S,children:[C,`Connect`]}),t[23]=S,t[24]=C,t[25]=w):w=t[25];let T;t[26]!==w||t[27]!==g||t[28]!==y||t[29]!==x?(T=(0,$.jsxs)(`form`,{className:`flex max-w-xl flex-wrap items-center gap-2 pb-2`,onSubmit:g,children:[y,x,w]}),t[26]=w,t[27]=g,t[28]=y,t[29]=x,t[30]=T):T=t[30];let E;return t[31]!==T||t[32]!==h?(E=(0,$.jsx)(Y,{title:`Hub`,description:`Keep skills, subagents and memory the same on every machine linked to one hub. Mint a token on the hub host with p4c hub token add.`,status:h,children:T}),t[31]=T,t[32]=h,t[33]=E):E=t[33],E}function Ft(e){let t=(0,Z.c)(13),n;t[0]===e.issues?n=t[1]:(n=new Map(e.issues.map(It)),t[0]=e.issues,t[1]=n);let r=n,[i,a]=(0,Q.useState)(e.issues),o;if(t[2]!==e.issues||t[3]!==i){let n;t[5]===i?n=t[6]:(n=e=>!i.some(t=>Nt(t)===Nt(e)),t[5]=i,t[6]=n),o=[...i,...e.issues.filter(n)],t[2]=e.issues,t[3]=i,t[4]=o}else o=t[4];let s=o;s.length!==i.length&&a(s);let c;return t[7]!==r||t[8]!==s||t[9]!==e.disabled||t[10]!==e.environmentId||t[11]!==e.resolvable?(c=(0,$.jsx)($.Fragment,{children:s.map(t=>{let n=Nt(t),i=r.get(n);return(0,$.jsx)(`div`,{onTransitionEnd:e=>{e.target!==e.currentTarget.firstChild||i||a(e=>e.filter(e=>Nt(e)!==n))},children:(0,$.jsx)(Be,{open:i!==void 0,children:(0,$.jsx)(Lt,{environmentId:e.environmentId,issue:i??t,resolutions:e.resolvable.has(n)?I(t.reason):[],disabled:e.disabled||i===void 0})})},n)})}),t[7]=r,t[8]=s,t[9]=e.disabled,t[10]=e.environmentId,t[11]=e.resolvable,t[12]=c):c=t[12],c}function It(e){return[Nt(e),e]}function Lt(e){let t=(0,Z.c)(24),{issue:n}=e,[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(!1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={reportFailure:!1},t[0]=l):l=t[0];let u=J(q.resolveHubSyncConflict,l),d;t[1]===n?d=t[2]:(d=Ot(n),t[1]=n,t[2]=d);let f=d,p;t[3]!==n.kind||t[4]!==n.name||t[5]!==e.environmentId||t[6]!==u?(p=async t=>{i(!0),o(jt(await u({environmentId:e.environmentId,input:{kind:n.kind,name:n.name,resolution:t}}),`Couldn't apply that choice.`)),i(!1),c(!1)},t[3]=n.kind,t[4]=n.name,t[5]=e.environmentId,t[6]=u,t[7]=p):p=t[7];let m=p,h=e.disabled||r,g;t[8]===n.reason?g=t[9]:(g=Et(n.reason),t[8]=n.reason,t[9]=g);let v;t[10]===a?v=t[11]:(v=(0,$.jsx)(ze,{text:a}),t[10]=a,t[11]=v);let y;t[12]!==s||t[13]!==h||t[14]!==r||t[15]!==e.resolutions||t[16]!==m||t[17]!==f?(y=e.resolutions.length===0?null:(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[e.resolutions.includes(`keep-local`)?(0,$.jsx)(_,{size:`sm`,variant:`outline`,disabled:h,onClick:()=>void m(`keep-local`),children:`Keep this machine's`}):null,e.resolutions.includes(`use-hub`)?(0,$.jsxs)(Ae,{open:s,onOpenChange:e=>{r||c(e)},children:[(0,$.jsx)(_,{size:`sm`,variant:`outline`,disabled:h,onClick:()=>c(!0),children:`Use hub's`}),(0,$.jsxs)(De,{children:[(0,$.jsxs)(we,{children:[(0,$.jsxs)(ke,{children:[`Replace this machine's `,f,`?`]}),(0,$.jsx)(Oe,{children:`The hub's copy overwrites the one here. Changes made only on this machine are lost.`})]}),(0,$.jsxs)(Te,{children:[(0,$.jsx)(Ee,{disabled:r,render:(0,$.jsx)(_,{variant:`outline`,disabled:r}),children:`Cancel`}),(0,$.jsxs)(_,{variant:`destructive`,disabled:r,onClick:()=>void m(`use-hub`),children:[r?(0,$.jsx)(U,{size:`sm`}):null,`Replace`]})]})]})]}):null]}),t[12]=s,t[13]=h,t[14]=r,t[15]=e.resolutions,t[16]=m,t[17]=f,t[18]=y):y=t[18];let b;return t[19]!==g||t[20]!==v||t[21]!==y||t[22]!==f?(b=(0,$.jsx)(Y,{title:f,description:g,status:v,control:y}),t[19]=g,t[20]=v,t[21]=y,t[22]=f,t[23]=b):b=t[23],b}var Rt={claude:`Claude`,codex:`Codex`,cursor:`Cursor`},zt={success:`bg-success`,warning:`bg-warning`,error:`bg-destructive`,muted:`bg-muted-foreground/40`},Bt={success:`text-success-foreground`,warning:`text-warning-foreground`,error:`text-destructive-foreground`,muted:`text-muted-foreground`},Vt=T(M);function Ht(e){let t=E(e);return Vt(t)&&t.reason===`rejected`?`This server only lets apps it has approved sign in, and it refused P4 Code. Sign in with a provider below instead.`:`Sign-in could not start. Check the server URL, then try again.`}function Ut(e,t,n){return e.transport.type===`http`&&(e.transport.auth===`oauth`||n?.auth===`signed-in`||t.needsSignIn)}function Wt(e){let t=(0,Z.c)(13),{status:n,className:r}=e,i=Bt[n.tone],a;t[0]!==r||t[1]!==i?(a=x(`flex min-w-0 items-center gap-1.5 text-xs`,i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=zt[n.tone],s;t[3]===o?s=t[4]:(s=x(`size-1.5 shrink-0 rounded-full`,o),t[3]=o,t[4]=s);let c;t[5]===s?c=t[6]:(c=(0,$.jsx)(`span`,{"aria-hidden":!0,className:s}),t[5]=s,t[6]=c);let l;t[7]===n.label?l=t[8]:(l=(0,$.jsx)(`span`,{className:`truncate`,children:n.label}),t[7]=n.label,t[8]=l);let u;return t[9]!==a||t[10]!==c||t[11]!==l?(u=(0,$.jsxs)(`span`,{className:a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function Gt(){let e=(0,Z.c)(11),{environment:t,scope:n}=Ne(),r=t?.connection.phase===`connected`&&t.serverConfig!==null,i=r?t.environmentId:null,a=r&&t.serverConfig?.environment.capabilities.mcpRegistry===!0,o;e[0]!==r||e[1]!==t||e[2]!==i||e[3]!==n||e[4]!==a?(o=t===null||!r?(0,$.jsx)(ye,{children:(0,$.jsxs)(ge,{children:[(0,$.jsx)(_e,{children:`Connect to manage plugins and MCP servers`}),(0,$.jsx)(ve,{children:`They live on each environment. Choose a connected one above.`})]})}):!a||i===null?(0,$.jsx)(ye,{children:(0,$.jsxs)(ge,{children:[(0,$.jsxs)(_e,{children:[`Update `,t.label,` to manage plugins and MCP servers`]}),(0,$.jsx)(ve,{children:`This environment runs a version without them.`})]})}):(0,$.jsx)(Yt,{environmentId:i,environmentLabel:t.label,projectId:n.kind===`checkout`?n.checkout.id:n.kind===`project`?n.members.find(e=>e.environmentId===i)?.id:void 0,projectLabel:n.kind===`project`||n.kind===`checkout`?n.label:void 0},i),e[0]=r,e[1]=t,e[2]=i,e[3]=n,e[4]=a,e[5]=o):o=e[5];let s;e[6]===r?s=e[7]:(s=r?(0,$.jsx)(At,{}):null,e[6]=r,e[7]=s);let c;return e[8]!==o||e[9]!==s?(c=(0,$.jsxs)(Pe,{width:`wide`,children:[o,s]}),e[8]=o,e[9]=s,e[10]=c):c=e[10],c}var Kt={plugins:`Search plugins`,mcps:`Search MCP servers`,skills:`Search skills`},qt=(e,...t)=>e===``||t.some(t=>t.toLowerCase().includes(e));function Jt(e){let t=(0,Z.c)(9),{text:n}=e,r=(0,Q.useRef)(null),[i,a]=(0,Q.useState)(!1),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{let t=r.current;a(e&&t!==null&&t.scrollWidth>t.clientWidth)},t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(`span`,{ref:r,tabIndex:0,className:`block truncate text-xs text-muted-foreground`}),t[1]=s):s=t[1];let c,l;t[2]===n?(c=t[3],l=t[4]):(c=(0,$.jsx)(ie,{render:s,children:n}),l=(0,$.jsx)(ae,{children:n}),t[2]=n,t[3]=c,t[4]=l);let u;return t[5]!==i||t[6]!==c||t[7]!==l?(u=(0,$.jsxs)(oe,{open:i,onOpenChange:o,children:[c,l]}),t[5]=i,t[6]=c,t[7]=l,t[8]=u):u=t[8],u}function Yt({environmentId:e,environmentLabel:t,projectId:n,projectLabel:r}){let o=W({select:e=>e.hash}),[u,d]=(0,Q.useState)(()=>o.replace(/^#/,``)===`mcp-servers`?`mcps`:o.replace(/^#/,``)===`skills`?`skills`:`plugins`),[p,x]=(0,Q.useState)(``),[C,T]=(0,Q.useState)(`All categories`),E=a(q.configValueAtom(e))?.providers,O=(0,Q.useMemo)(()=>ft(E??[]),[E]),[j,M]=(0,Q.useState)(null),P=je(e=>e.mcpServers),F=je(e=>e.plugins),I=je(e=>e.projectSettingsOverrides),L=je(e=>e.skillOverrides),U=ne(e),G=a(q.updateSettings.permissionAtom(e)),[ee,te]=(0,Q.useState)(null),re=a(q.mcpRegistryTest.permissionAtom(e)),se=K(e),ce=J(q.updateSettings,{label:`update MCP registry`,reportFailure:!0}),de=J(q.mcpRegistryState,{reportFailure:!1}),fe=J(q.mcpRegistryTest,{label:`check MCP server`,reportFailure:!0}),pe=J(q.mcpRegistryOAuthStart,{label:`start MCP sign-in`,reportFailure:!0}),me=J(q.mcpRegistryOAuthSignOut,{label:`sign out of MCP server`,reportFailure:!0}),he=J(q.mcpRegistryDiscover,{reportFailure:!1}),ge=J(q.mcpRegistryImport,{label:`import MCP servers`,reportFailure:!0}),[_e,ve]=(0,Q.useState)({}),[ye,Ce]=(0,Q.useState)(new Set),[Me,Ne]=(0,Q.useState)([]),[Y,Pe]=(0,Q.useState)({kind:`list`}),X=Y.kind!==`list`&&Y.id!==null&&(Y.kind===`server`?P[Y.id]===void 0:F[Y.id]===void 0)?{kind:`list`}:Y,[Re,ze]=(0,Q.useState)(o);if(o!==Re){ze(o);let e=o.replace(/^#/,``);(e===`mcp-servers`||e===`plugins`||e===`skills`)&&(d(e===`mcp-servers`?`mcps`:e),Pe({kind:`list`}))}let[Be,Ve]=(0,Q.useState)(null),Z=(0,Q.useRef)(new Map),[He,Ge]=(0,Q.useState)(null),[Ke,qe]=(0,Q.useState)({}),Je=(0,Q.useMemo)(()=>Object.entries(P).map(([e,t])=>[k.make(e),t]).toSorted(([,e],[,t])=>e.name.localeCompare(t.name)),[P]),Ye=(0,Q.useMemo)(()=>Object.entries(F).map(([e,t])=>[D.make(e),t]),[F]),Xe=(0,Q.useCallback)(async()=>{let t=await de({environmentId:e,input:{}});t._tag===`Success`&&ve(t.value.servers)},[e,de]),Ze=(0,Q.useCallback)(async()=>{if(!re)return;let t=await he({environmentId:e,input:n===void 0?{}:{projectId:n}});t._tag===`Success`&&Ne(t.value.servers)},[re,he,e,n]);(0,Q.useEffect)(()=>{Xe(),Ze()},[Xe,Ze]);let tt=e=>{d(`mcps`),Pe({kind:`server`,id:e})},nt=e=>{d(`plugins`),Pe({kind:`plugin`,id:e})},rt=t=>ce({environmentId:e,input:{patch:t}}),it=async t=>{Ce(e=>new Set(e).add(t));let n=await fe({environmentId:e,input:{serverId:t}});if(Ce(e=>{let n=new Set(e);return n.delete(t),n}),n._tag===`Success`)return ve(e=>({...e,[t]:n.value})),n.value},at=(0,Q.useEffectEvent)(async e=>{(await it(e))?.health.status===`connected`&&Ge(null)});(0,Q.useEffect)(()=>{if(He===null)return;let e=()=>void at(He);return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[He]);let ot=async(e,t,n)=>{(await rt({mcpServers:{[e]:t}}))._tag===`Success`&&(n&&Pe({kind:`list`}),Ze(),t.enabled&&await it(e))},st=async(t,n=!1)=>{let r=Z.current.get(t);if(!n&&He===t&&r){window.open(r,`_blank`,`noopener,noreferrer`);return}let i=se??window.location.origin;qe(e=>{let n={...e};return delete n[t],n});let a=await pe({environmentId:e,input:{serverId:t,origin:new URL(i,window.location.href).origin,...n?{reauthenticate:n}:{}}});a._tag===`Success`?a.value.authorizationUrl===null?await it(t):(Z.current.set(t,a.value.authorizationUrl),Ge(t),window.open(a.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):a._tag===`Failure`&&qe(e=>({...e,[t]:Ht(a.cause)}))},ct=async t=>{let n=await me({environmentId:e,input:{serverId:t}});n._tag===`Success`&&ve(e=>({...e,[t]:n.value}))},lt=(e,t,r)=>{if(n===void 0)return;let i=I[n]??{},a={...i[e]};r===void 0?delete a[t]:a[t]={enabled:r},rt({projectSettingsOverrides:{[n]:{...i,[e]:a}}})},ut=async()=>{let t=Be;if(Ve(null),t!==null){if(t.kind===`server`){let n=P[t.id];n?.transport.type===`http`&&n.transport.auth===`oauth`&&await me({environmentId:e,input:{serverId:t.id}}),await rt({mcpServers:{[t.id]:null}})}else await rt({plugins:{[t.id]:null}});Pe({kind:`list`})}},dt=Me.filter(e=>!e.alreadyAdded),mt=new Set(Je.filter(([e])=>X.kind!==`server`||e!==X.id).map(([,e])=>e.name)),ht=p.trim().toLowerCase(),_t=Je.filter(([,e])=>qt(ht,e.name,We(e))),yt=Ye.filter(([,e])=>qt(ht,e.name,e.path)),xt=dt.filter(e=>qt(ht,e.name,e.summary)),St=(e,t)=>N({mcpServers:P,plugins:F,projectSettingsOverrides:I},e,n??null,t),Ct=(e,t,r)=>{n===void 0?rt(e===`mcpServers`?{mcpServers:{[t]:{...P[t],enabled:r}}}:{plugins:{[t]:{...F[t],enabled:r}}}):lt(e,t,r)},Tt=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,$.jsxs)(`div`,{className:`grid gap-1`,children:[(0,$.jsx)(`h1`,{className:`text-2xl font-semibold text-foreground`,children:`Plugins`}),(0,$.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Manage plugins, skills, and MCP servers given to agents on `,t,`.`]})]}),re?(0,$.jsxs)(f,{children:[(0,$.jsx)(m,{render:(0,$.jsxs)(_,{children:[`Add`,(0,$.jsx)(s,{"aria-hidden":!0})]})}),(0,$.jsxs)(b,{align:`end`,children:[(0,$.jsxs)(S,{onClick:()=>tt(null),children:[(0,$.jsx)(i,{"aria-hidden":!0}),`Add MCP server`]}),(0,$.jsxs)(S,{onClick:()=>nt(null),children:[(0,$.jsx)(c,{"aria-hidden":!0}),`Add plugin`]})]})]}):null]}),Et=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,$.jsxs)(le,{"aria-label":`Show`,variant:`default`,value:[u],onValueChange:e=>{let t=e[0];(t===`plugins`||t===`mcps`||t===`skills`)&&(d(t),Pe({kind:`list`}))},children:[(0,$.jsxs)(ue,{value:`plugins`,...Ie(`plugins`),children:[`Plugins `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:Ye.length})]}),(0,$.jsxs)(ue,{value:`mcps`,...Ie(`mcp-servers`),children:[`MCPs `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:Je.length})]}),(0,$.jsxs)(ue,{value:`skills`,...Ie(`skills`),children:[`Skills `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:O.length})]})]}),(0,$.jsxs)(`div`,{className:`flex w-full gap-2 sm:w-auto`,children:[u===`skills`?(0,$.jsx)(`div`,{className:`w-fit shrink-0`,children:(0,$.jsxs)(H,{value:C,onValueChange:e=>e&&T(e),children:[(0,$.jsx)(V,{"aria-label":`Skill category`,children:(0,$.jsx)(z,{})}),(0,$.jsxs)(B,{children:[(0,$.jsx)(R,{value:`All categories`,children:`All categories`}),$e.filter(e=>e===`Personal`||e===`Built-in`||O.some(({skill:t})=>et(t)===e)).map(e=>(0,$.jsx)(R,{value:e,children:e},e))]})]})}):null,(0,$.jsxs)(Se,{className:`min-w-0 flex-1 sm:w-56`,children:[(0,$.jsx)(be,{children:(0,$.jsx)(g,{"aria-hidden":!0})}),(0,$.jsx)(xe,{"aria-label":Kt[u],placeholder:Kt[u],value:p,onChange:e=>x(e.currentTarget.value)})]})]})]}),Dt=(e,t)=>(0,$.jsxs)(oe,{children:[(0,$.jsx)(ie,{render:(0,$.jsx)(_,{size:`icon-sm`,variant:`ghost`,"aria-label":e,onClick:t,children:(0,$.jsx)(v,{"aria-hidden":!0})})}),(0,$.jsx)(ae,{children:e})]}),Ot=yt.length===0?(0,$.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:Ye.length===0?`No plugins yet. Add a Claude Code or Codex plugin folder to give its tools to your agents.`:`No plugins match your search.`}):(0,$.jsx)(`ul`,{className:`grid gap-1`,children:yt.map(([t,n])=>(0,$.jsx)(Qe,{environmentId:e,plugin:n,enabled:St(`plugins`,t),disabled:!G,onDetails:()=>nt(t),onToggle:e=>Ct(`plugins`,t,e)},t))}),kt=O.filter(({skill:e})=>(C===`All categories`||et(e)===C)&&qt(ht,pt(e),e.name,e.shortDescription??``,e.description??``)),At=kt.length===0?(0,$.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:O.length===0?`No skills found. Providers report the skills they load when they start.`:`No skills match these filters.`}):(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Switches apply to new Claude and OpenCode sessions.`}),(0,$.jsx)(`ul`,{className:`grid gap-1`,children:kt.map(t=>{let r=et(t.skill),i=(E??[]).filter(e=>A(e.driver)&&e.skills.some(e=>e.name===t.skill.name)),a=i.length?i.map(e=>e.displayName??e.driver).join(`, `):`Native settings`;return(0,$.jsxs)(`li`,{className:`flex items-center gap-3 py-3`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`flex size-10 shrink-0 items-center justify-center rounded-full border border-border/60 text-muted-foreground`,children:(0,$.jsx)(w,{className:`size-4`})}),(0,$.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-1`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>M(t),className:`w-fit break-words text-left text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,children:pt(t.skill)}),(0,$.jsx)(Jt,{text:t.skill.shortDescription??t.skill.description??t.skill.path}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[r,a].filter(Boolean).join(` · `)})]}),(0,$.jsxs)(f,{children:[(0,$.jsxs)(oe,{children:[(0,$.jsx)(ie,{render:(0,$.jsx)(m,{render:(0,$.jsx)(_,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${pt(t.skill)}`,children:(0,$.jsx)(l,{"aria-hidden":!0})})})}),(0,$.jsx)(ae,{children:`Skill actions`})]}),(0,$.jsxs)(b,{align:`end`,children:[U.capabilities.canOpenDefault?(0,$.jsx)(S,{onClick:()=>void U.activate(`open`,{environmentId:e,filePath:t.skill.path,workspaceRoot:void 0}),children:`Open`}):null,(0,$.jsx)(S,{onClick:()=>M(t),children:`Details`}),n!==void 0&&I[n]?.skillOverrides?.[t.skill.name]!==void 0?(0,$.jsx)(S,{onClick:()=>{let e=I[n]??{},r={...e.skillOverrides};delete r[t.skill.name],rt({projectSettingsOverrides:{[n]:{...e,skillOverrides:r}}})},children:`Use environment setting`}):null]})]}),(0,$.jsx)(Le,{"aria-label":`Enable ${pt(t.skill)} for ${a}`,checked:(n===void 0?void 0:I[n]?.skillOverrides?.[t.skill.name])??L[t.skill.name]??t.skill.enabled,disabled:!G||ee!==null||i.length===0,onCheckedChange:e=>{te(t.skill.name),rt(n===void 0?{skillOverrides:{[t.skill.name]:e}}:{projectSettingsOverrides:{[n]:{...I[n],skillOverrides:{...I[n]?.skillOverrides,[t.skill.name]:e}}}}).finally(()=>te(null))}})]},t.skill.path)})})]}),jt=(0,$.jsxs)(`div`,{className:`grid gap-6`,children:[Je.length>0?(0,$.jsx)(Fe,{title:`Servers`,children:_t.length===0?(0,$.jsx)(`p`,{className:`px-3 text-sm text-muted-foreground sm:px-4`,children:`No MCP servers match your search.`}):(0,$.jsx)($.Fragment,{children:_t.map(([e,t])=>{let n=St(`mcpServers`,e),r=Ue({...t,enabled:n},_e[e],ye.has(e)),i=Ke[e],a=Ut(t,r,_e[e]);return(0,$.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,$.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),r.tone===`error`||a?(0,$.jsx)(Wt,{status:r}):null,i?(0,$.jsx)(`span`,{className:`text-xs text-destructive-foreground`,children:i}):null]}),r.needsSignIn&&re?(0,$.jsx)(_,{size:`xs`,variant:`outline`,onClick:()=>void st(e),children:`Authenticate`}):null,a&&!r.needsSignIn&&re?(0,$.jsxs)(f,{children:[(0,$.jsxs)(oe,{children:[(0,$.jsx)(ie,{render:(0,$.jsx)(m,{render:(0,$.jsx)(_,{variant:`ghost`,size:`icon-sm`,"aria-label":`More for ${t.name}`,children:(0,$.jsx)(l,{"aria-hidden":!0})})})}),(0,$.jsx)(ae,{children:`Sign-in actions`})]}),(0,$.jsxs)(b,{align:`end`,children:[(0,$.jsx)(S,{onClick:()=>void st(e,!0),children:`Re-authenticate`}),_e[e]?.auth===`signed-in`?(0,$.jsx)(S,{onClick:()=>void ct(e),children:`Sign out`}):null]})]}):null,Dt(`Settings for ${t.name}`,()=>tt(e)),(0,$.jsx)(Le,{"aria-label":`Give ${t.name} to agents`,checked:n,disabled:!re,onCheckedChange:t=>Ct(`mcpServers`,e,t)})]},e)})})}):null,re&&xt.length>0?(0,$.jsx)(Fe,{title:`Found in provider configs`,headerAction:(0,$.jsx)(_,{size:`icon-xs`,variant:`ghost`,"aria-label":`Look again`,onClick:()=>void Ze(),children:(0,$.jsx)(y,{"aria-hidden":!0})}),children:(0,$.jsx)($.Fragment,{children:xt.map(t=>(0,$.jsxs)(`div`,{className:`flex min-h-14 items-center gap-3 px-4 py-3`,children:[(0,$.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,$.jsx)(`span`,{className:`break-words text-sm font-medium text-foreground`,children:t.name}),xt.filter(e=>e.name===t.name).length>1?(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(t.providers??[t.provider]).map(e=>Rt[e]).join(`, `)}):null]}),(0,$.jsx)(_,{size:`xs`,variant:`outline`,onClick:async()=>{(await ge({environmentId:e,input:{...n===void 0?{}:{projectId:n},servers:[{provider:t.provider,path:t.path,name:t.name}]}}))._tag===`Success`&&(Ze(),Xe())},children:`Import`})]},`${t.provider}:${t.path}:${t.name}`))})}):null]}),Mt=X.kind===`server`?(0,$.jsxs)(gt,{title:X.id===null?`Add MCP server`:`Update ${P[X.id]?.name??`server`} MCP`,onBack:()=>Pe({kind:`list`}),onUninstall:X.id!==null&&re?()=>Ve({kind:`server`,id:X.id}):void 0,children:[(0,$.jsx)(vt,{server:X.id===null?void 0:P[X.id],takenNames:mt,onSave:e=>void ot(X.id??k.make(h()),e,X.id===null)},X.id??`new`),X.id!==null&&P[X.id]!==void 0?(0,$.jsx)(Zt,{environmentId:e,id:X.id,server:P[X.id],runtime:_e[X.id],checking:ye.has(X.id),canManage:re,projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.mcpServers?.[X.id],awaitingSignIn:He===X.id,onProviderToggle:(e,t)=>{let n=P[X.id],r=t?n.disabledProviders.filter(t=>t!==e):[...n.disabledProviders,e];rt({mcpServers:{[X.id]:{...n,disabledProviders:r}}})},onProjectOverride:n===void 0?void 0:e=>lt(`mcpServers`,X.id,e),signInError:Ke[X.id],onTest:()=>void it(X.id),onSignIn:()=>void st(X.id),onReauthenticate:()=>void st(X.id,!0),onSignOut:()=>void ct(X.id)},`${e}:${X.id}`):null]}):null,Nt=X.kind===`plugin`?(0,$.jsxs)(gt,{title:X.id===null?`Add plugin`:`Update ${F[X.id]?.name??`plugin`}`,onBack:()=>Pe({kind:`list`}),onUninstall:X.id!==null&&re?()=>Ve({kind:`plugin`,id:X.id}):void 0,children:[(0,$.jsx)(bt,{environmentId:e,plugin:X.id===null?void 0:F[X.id],environmentLabel:t,onSave:async e=>{let t=X.id??D.make(h());(await rt({plugins:{[t]:e}}))._tag===`Success`&&X.id===null&&Pe({kind:`list`})}},X.id??`new`),X.id!==null&&F[X.id]!==void 0?(0,$.jsx)(on,{plugin:F[X.id],projectLabel:r,projectOverride:n===void 0?void 0:I[n]?.plugins?.[X.id],onProjectOverride:n===void 0?void 0:e=>lt(`plugins`,X.id,e)}):null]}):null;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`grid gap-6`,children:[Tt,Et,Mt??Nt??(u===`plugins`?Ot:u===`mcps`?jt:At)]}),j===null?null:(0,$.jsx)(wt,{entry:j,environmentId:e,onClose:()=>M(null)}),(0,$.jsx)(Ae,{open:Be!==null,onOpenChange:e=>!e&&Ve(null),children:(0,$.jsxs)(De,{children:[(0,$.jsxs)(we,{children:[(0,$.jsxs)(ke,{children:[`Remove`,` `,Be?.kind===`server`?P[Be.id]?.name??`server`:Be?.kind===`plugin`?F[Be.id]?.name??`plugin`:``,`?`]}),(0,$.jsxs)(Oe,{children:[`New sessions on `,t,` stop getting it. Its stored values and sign-in are deleted. Provider config files are not changed.`]})]}),(0,$.jsxs)(Te,{children:[(0,$.jsx)(Ee,{render:(0,$.jsx)(_,{variant:`outline`,children:`Cancel`})}),(0,$.jsx)(_,{variant:`destructive`,onClick:()=>void ut(),children:`Remove`})]})]})})]})}function Xt(e){let t=(0,Z.c)(16),{projectLabel:n,override:r,inherited:i,onChange:a}=e,o=r?.enabled!==void 0,s=`In ${n}`,c=o?`Set for this project.`:`Follows the environment (${i?`on`:`off`}).`,l;t[0]!==a||t[1]!==o?(l=o?(0,$.jsx)(_,{size:`xs`,variant:`ghost`,onClick:()=>a(void 0),children:`Reset`}):null,t[0]=a,t[1]=o,t[2]=l):l=t[2];let u=`Use in ${n}`,d=r?.enabled??i,f;t[3]===a?f=t[4]:(f=e=>a(e),t[3]=a,t[4]=f);let p;t[5]!==u||t[6]!==d||t[7]!==f?(p=(0,$.jsx)(Le,{"aria-label":u,checked:d,onCheckedChange:f}),t[5]=u,t[6]=d,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==l||t[10]!==p?(m=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l,p]}),t[9]=l,t[10]=p,t[11]=m):m=t[11];let h;return t[12]!==s||t[13]!==c||t[14]!==m?(h=(0,$.jsx)(Y,{title:s,description:c,control:m}),t[12]=s,t[13]=c,t[14]=m,t[15]=h):h=t[15],h}function Zt(e){let t=(0,Z.c)(108),{environmentId:n,id:r,server:i,runtime:a,checking:o,canManage:s,projectLabel:c,projectOverride:l,awaitingSignIn:d,signInError:f,onProviderToggle:p,onProjectOverride:m,onTest:h,onSignIn:g,onReauthenticate:v,onSignOut:y}=e,b=s&&i.transport.type===`http`&&i.transport.auth===`oauth`&&a?.auth===`signed-out`,x=tn(n,r,b),S=x.entries,C;t[0]!==o||t[1]!==a||t[2]!==i?(C=Ue(i,a,o),t[0]=o,t[1]=a,t[2]=i,t[3]=C):C=t[3];let w=C,T;t[4]===S?T=t[5]:(T=S?.filter($t).length??0,t[4]=S,t[5]=T);let E=T,D;t[6]!==w||t[7]!==E||t[8]!==S||t[9]!==b?(D=b?{...w,tone:`muted`,label:S===null?`Checking providers…`:E>0?`Available to ${E} ${E===1?`provider`:`providers`}`:`No providers connected`}:w,t[6]=w,t[7]=E,t[8]=S,t[9]=b,t[10]=D):D=t[10];let O=D,k,A,j,M,N,P,F;if(t[11]!==d||t[12]!==s||t[13]!==o||t[14]!==S||t[15]!==r||t[16]!==p||t[17]!==v||t[18]!==g||t[19]!==y||t[20]!==h||t[21]!==a?.auth||t[22]!==i||t[23]!==f||t[24]!==x||t[25]!==O||t[26]!==b){let e;t[34]===S?e=t[35]:(e=e=>({...e,badge:S===null||e.unsupported!==void 0?void 0:at(e.driver,S)}),t[34]=S,t[35]=e);let n=ot(i).map(e),c=i.transport.type===`http`&&a?.auth===`signed-in`,l=f??O.detail;N=`grid gap-6`,P=r;let m;t[36]===O?m=t[37]:(m=(0,$.jsx)(Wt,{status:O,className:`flex-1 text-sm`}),t[36]=O,t[37]=m);let C;t[38]!==d||t[39]!==s||t[40]!==g||t[41]!==O.needsSignIn||t[42]!==b?(C=O.needsSignIn&&s&&!b?(0,$.jsx)(_,{size:`xs`,onClick:g,children:d?`Open sign-in again`:`Authenticate`}):null,t[38]=d,t[39]=s,t[40]=g,t[41]=O.needsSignIn,t[42]=b,t[43]=C):C=t[43];let w;t[44]!==s||t[45]!==v||t[46]!==c||t[47]!==O.needsSignIn?(w=c&&!O.needsSignIn&&s?(0,$.jsx)(_,{size:`xs`,variant:`outline`,onClick:v,children:`Re-authenticate`}):null,t[44]=s,t[45]=v,t[46]=c,t[47]=O.needsSignIn,t[48]=w):w=t[48];let T;t[49]!==s||t[50]!==y||t[51]!==c?(T=c&&s?(0,$.jsx)(_,{size:`xs`,variant:`ghost`,onClick:y,children:`Sign out`}):null,t[49]=s,t[50]=y,t[51]=c,t[52]=T):T=t[52];let E;t[53]!==s||t[54]!==o||t[55]!==h||t[56]!==i.enabled?(E=s&&i.enabled?(0,$.jsx)(_,{size:`xs`,variant:`outline`,disabled:o,onClick:h,children:`Test connection`}):null,t[53]=s,t[54]=o,t[55]=h,t[56]=i.enabled,t[57]=E):E=t[57];let D;t[58]!==m||t[59]!==C||t[60]!==w||t[61]!==T||t[62]!==E?(D=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[m,C,w,T,E]}),t[58]=m,t[59]=C,t[60]=w,t[61]=T,t[62]=E,t[63]=D):D=t[63];let I;t[64]!==d||t[65]!==O.needsSignIn||t[66]!==b?(I=O.needsSignIn&&!b?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:d?`Finish signing in in your browser, then come back here.`:b?`Sign in here to give it to every provider.`:`Agents can't reach this server until you sign in.`}):null,t[64]=d,t[65]=O.needsSignIn,t[66]=b,t[67]=I):I=t[67];let L;t[68]!==l||t[69]!==b?(L=l&&!b?(0,$.jsx)(`p`,{className:`rounded-md bg-destructive/8 px-2.5 py-1.5 text-xs text-destructive-foreground`,children:l}):null,t[68]=l,t[69]=b,t[70]=L):L=t[70];let R;t[71]!==d||t[72]!==l||t[73]!==g||t[74]!==b?(R=b?(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:l?`Shared sign-in unavailable`:`Shared sign-in`}),(0,$.jsxs)(`div`,{className:`grid gap-2 pt-2`,children:[(0,$.jsx)(`p`,{children:l??`Sign in through P4 Code to share access with every enabled provider.`}),(0,$.jsx)(`div`,{children:(0,$.jsx)(_,{size:`xs`,variant:`outline`,onClick:g,children:d?`Open browser`:l?`Retry shared sign-in`:`Sign in through P4 Code`})})]})]}):null,t[71]=d,t[72]=l,t[73]=g,t[74]=b,t[75]=R):R=t[75];let z;t[76]===i.source?z=t[77]:(z=i.source?(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsx)(`summary`,{className:`cursor-pointer`,children:`Import source`}),(0,$.jsx)(`p`,{className:`break-all pt-2`,children:i.source.path})]}):null,t[76]=i.source,t[77]=z);let B=b?(0,$.jsx)(rn,{serverName:i.name,signIns:x,blocked:n.filter(Qt).length}):null;t[78]!==D||t[79]!==I||t[80]!==L||t[81]!==R||t[82]!==z||t[83]!==B?(F=(0,$.jsx)(Fe,{title:`Status`,children:(0,$.jsx)(Me,{children:(0,$.jsxs)(`div`,{className:`grid gap-2 px-4 py-3`,children:[D,I,L,R,z,B]})})}),t[78]=D,t[79]=I,t[80]=L,t[81]=R,t[82]=z,t[83]=B,t[84]=F):F=t[84],A=Fe,M=`Providers`,k=Me;let V;t[85]!==s||t[86]!==p||t[87]!==i.name?(V=e=>(0,$.jsx)(Y,{title:e.label,...e.unsupported===void 0?{}:{description:e.unsupported},control:(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.badge===void 0?null:(0,$.jsx)(u,{variant:an[e.badge].variant,children:an[e.badge].label}),(0,$.jsx)(Le,{"aria-label":`Give ${i.name} to ${e.label}`,checked:e.enabled&&e.badge!==`unavailable`,disabled:!s||e.unsupported!==void 0||e.badge===`unavailable`,onCheckedChange:t=>p(e.driver,t)})]})},e.driver),t[85]=s,t[86]=p,t[87]=i.name,t[88]=V):V=t[88],j=n.map(V),t[11]=d,t[12]=s,t[13]=o,t[14]=S,t[15]=r,t[16]=p,t[17]=v,t[18]=g,t[19]=y,t[20]=h,t[21]=a?.auth,t[22]=i,t[23]=f,t[24]=x,t[25]=O,t[26]=b,t[27]=k,t[28]=A,t[29]=j,t[30]=M,t[31]=N,t[32]=P,t[33]=F}else k=t[27],A=t[28],j=t[29],M=t[30],N=t[31],P=t[32],F=t[33];let I;t[89]!==k||t[90]!==j?(I=(0,$.jsx)(k,{children:j}),t[89]=k,t[90]=j,t[91]=I):I=t[91];let L;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(`p`,{className:`px-3 text-xs text-muted-foreground sm:px-4`,children:`A change reaches a thread when its provider session next starts.`}),t[92]=L):L=t[92];let R;t[93]!==A||t[94]!==M||t[95]!==I?(R=(0,$.jsxs)(A,{title:M,children:[I,L]}),t[93]=A,t[94]=M,t[95]=I,t[96]=R):R=t[96];let z;t[97]!==m||t[98]!==c||t[99]!==l||t[100]!==i.enabled?(z=c!==void 0&&m!==void 0?(0,$.jsx)(Fe,{title:`Project`,children:(0,$.jsx)(Me,{children:(0,$.jsx)(Xt,{projectLabel:c,override:l,inherited:i.enabled,onChange:m})})}):null,t[97]=m,t[98]=c,t[99]=l,t[100]=i.enabled,t[101]=z):z=t[101];let B;return t[102]!==R||t[103]!==z||t[104]!==N||t[105]!==P||t[106]!==F?(B=(0,$.jsxs)(`div`,{className:N,"data-server-id":P,children:[F,R,z]}),t[102]=R,t[103]=z,t[104]=N,t[105]=P,t[106]=F,t[107]=B):B=t[107],B}function Qt(e){return e.enabled&&e.badge===`unavailable`}function $t(e){return e.status===`signed-in`}function en(e){let t=E(e);return Vt(t)&&t.detail!==void 0?t.detail:`Sign-in could not start. Try again.`}function tn(e,t,n){let r=J(q.mcpRegistryProviderSignInState,{reportFailure:!1}),i=J(q.mcpRegistryProviderSignInStart,{reportFailure:!1}),o=J(q.mcpRegistryProviderSignInWait,{reportFailure:!1}),s=J(q.mcpRegistryProviderSignInComplete,{reportFailure:!1}),c=J(q.mcpRegistryProviderSignInCancel,{reportFailure:!1}),l=J(q.mcpRegistryProviderSignOut,{reportFailure:!1}),u=a(q.mcpRegistryProviderSignInComplete.permissionAtom(e)),d=a(q.mcpRegistryProviderSignInCancel.permissionAtom(e)),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)({}),[g,_]=(0,Q.useState)(new Set),v=(0,Q.useRef)(new Set),y=e=>p(t=>t?.map(t=>t.instanceId===e.instanceId?e:t)??null),b=(e,t)=>h(n=>{let r={...n};return t===void 0?delete r[e]:r[e]=t,r});return(0,Q.useEffect)(()=>{if(!n)return;let i=!1;return r({environmentId:e,input:{serverId:t}}).then(e=>{i||p(e._tag===`Success`?e.value.providers:[])}),()=>{i=!0}},[n,e,r,t]),(0,Q.useEffect)(()=>{if(!n)return;let r=!1;for(let n of f??[]){let i=n.pending;i&&o({environmentId:e,input:{serverId:t,instanceId:n.instanceId,flowId:i.flowId}}).then(e=>{r||(p(t=>t?.map(t=>{if(t.instanceId!==n.instanceId||t.pending?.flowId!==i.flowId)return t;if(e._tag===`Success`)return e.value;let{pending:r,...a}=t;return a})??null),e._tag===`Failure`?b(n.instanceId,en(e.cause)):e._tag===`Success`&&e.value.status!==`signed-in`&&!v.current.has(n.instanceId)&&b(n.instanceId,`Sign-in ended without connecting. Try again.`))})}return()=>{r=!0}},[n,f,e,t,o]),{entries:n?f:null,errors:m,busy:g,run:async(n,r,a)=>{if(!v.current.has(n.instanceId)){v.current.add(n.instanceId),_(new Set(v.current)),b(n.instanceId,void 0);try{let o={serverId:t,instanceId:n.instanceId};if(r===`start`){let t=await i({environmentId:e,input:o});t._tag===`Success`?(y({...n,pending:t.value}),window.open(t.value.authorizationUrl,`_blank`,`noopener,noreferrer`)):t._tag===`Failure`&&b(n.instanceId,en(t.cause));return}let u={...o,flowId:n.pending?.flowId??``},d=r===`complete`?await s({environmentId:e,input:{...u,callbackUrl:a.trim()}}):r===`cancel`?await c({environmentId:e,input:u}):await l({environmentId:e,input:o});d._tag===`Success`?y(d.value):d._tag===`Failure`&&b(n.instanceId,en(d.cause))}finally{v.current.delete(n.instanceId),_(new Set(v.current))}}},canComplete:u,canCancel:d}}function nn(e){let t=(0,Z.c)(39),{entry:n,signIns:r}=e,i;t[0]!==n.displayName||t[1]!==n.driver?(i=n.displayName??rt(n.driver),t[0]=n.displayName,t[1]=n.driver,t[2]=i):i=t[2];let a=i,[o,s]=(0,Q.useState)(``),c=n.pending,l;t[3]!==n.instanceId||t[4]!==r.busy?(l=r.busy.has(n.instanceId),t[3]=n.instanceId,t[4]=r.busy,t[5]=l):l=t[5];let u=l,d=r.errors[n.instanceId],f=`mcp-callback-${n.instanceId}`,p;t[6]===a?p=t[7]:(p=(0,$.jsx)(`p`,{className:`text-sm font-medium`,children:a}),t[6]=a,t[7]=p);let m=c?`text-warning-foreground`:n.status===`signed-in`?`text-success-foreground`:`text-muted-foreground`,h;t[8]===m?h=t[9]:(h=x(`text-xs`,m),t[8]=m,t[9]=h);let g;t[10]!==n.status||t[11]!==c?(g=c?`Waiting for sign-in`:it(n.status),t[10]=n.status,t[11]=c,t[12]=g):g=t[12];let v;t[13]!==h||t[14]!==g?(v=(0,$.jsx)(`p`,{className:h,role:`status`,children:g}),t[13]=h,t[14]=g,t[15]=v):v=t[15];let y;t[16]!==p||t[17]!==v?(y=(0,$.jsxs)(`div`,{className:`grid gap-1`,children:[p,v]}),t[16]=p,t[17]=v,t[18]=y):y=t[18];let b;t[19]!==u||t[20]!==n||t[21]!==d||t[22]!==c||t[23]!==r?(b=!c&&n.status!==`unavailable`?(0,$.jsx)(_,{size:`xs`,variant:n.status===`signed-in`?`outline`:`default`,disabled:u,onClick:()=>void r.run(n,n.status===`signed-in`?`signOut`:`start`),children:u?`Please wait…`:n.status===`signed-in`?`Sign out`:d?`Start over`:`Sign in`}):null,t[19]=u,t[20]=n,t[21]=d,t[22]=c,t[23]=r,t[24]=b):b=t[24];let S;t[25]!==y||t[26]!==b?(S=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[y,b]}),t[25]=y,t[26]=b,t[27]=S):S=t[27];let C;t[28]!==u||t[29]!==o||t[30]!==n||t[31]!==d||t[32]!==f||t[33]!==c||t[34]!==r?(C=c?(0,$.jsxs)(`form`,{className:`grid gap-2`,onSubmit:e=>{e.preventDefault(),o.trim()&&!u&&r.canComplete&&r.run(n,`complete`,o)},children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Approve in your browser. If it ends on a callback URL, paste that URL here.`}),(0,$.jsx)(`label`,{htmlFor:f,className:`text-xs font-medium`,children:`Callback URL`}),(0,$.jsx)(de,{id:f,value:o,onChange:e=>s(e.target.value),placeholder:`http://localhost:…/callback?code=…&state=…`,autoComplete:`off`,spellCheck:!1,disabled:u||!r.canComplete,"aria-invalid":!!d,"aria-describedby":d?`${f}-error`:void 0}),d?(0,$.jsx)(`p`,{id:`${f}-error`,role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(_,{type:`submit`,size:`xs`,disabled:u||!o.trim()||!r.canComplete,children:u?`Please wait…`:`Finish sign-in`}),(0,$.jsx)(_,{type:`button`,size:`xs`,variant:`outline`,disabled:u,onClick:()=>window.open(c.authorizationUrl,`_blank`,`noopener,noreferrer`),children:`Open browser`}),(0,$.jsx)(_,{type:`button`,size:`xs`,variant:`ghost`,disabled:u||!r.canCancel,onClick:()=>void r.run(n,`cancel`),children:`Cancel`})]})]}):d?(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:d}):null,t[28]=u,t[29]=o,t[30]=n,t[31]=d,t[32]=f,t[33]=c,t[34]=r,t[35]=C):C=t[35];let w;return t[36]!==S||t[37]!==C?(w=(0,$.jsxs)(`div`,{className:`grid gap-2 border-t border-border pt-3`,children:[S,C]}),t[36]=S,t[37]=C,t[38]=w):w=t[38],w}function rn(e){let t=(0,Z.c)(8),{serverName:n,signIns:r,blocked:i}=e,a;t[0]===r?a=t[1]:(a=r.entries===null?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Checking providers…`}):r.entries.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No enabled provider here can sign in to MCP servers itself.`}):r.entries.map(e=>(0,$.jsx)(nn,{entry:e,signIns:r},`${e.instanceId}:${e.pending?.flowId??`idle`}`)),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n?(o=i>0?(0,$.jsxs)(`details`,{className:`text-xs text-muted-foreground`,children:[(0,$.jsxs)(`summary`,{className:`cursor-pointer`,children:[i,` other `,i===1?`provider`:`providers`,` unavailable`]}),(0,$.jsxs)(`p`,{className:`pt-2`,children:[`These providers need shared sign-in to use `,n,`.`]})]}):null,t[2]=i,t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}var an={"signed-in":{variant:`success`,label:`Signed in`},"needs-sign-in":{variant:`warning`,label:`Sign in needed`},unavailable:{variant:`secondary`,label:`Unavailable`}};function on(e){let t=(0,Z.c)(7),{plugin:n,projectLabel:r,projectOverride:i,onProjectOverride:a}=e,o;t[0]!==a||t[1]!==n||t[2]!==r||t[3]!==i?(o=r!==void 0&&a!==void 0?(0,$.jsx)(Fe,{title:`Project`,children:(0,$.jsx)(Me,{children:(0,$.jsx)(Xt,{projectLabel:r,override:i,inherited:n.enabled,onChange:a})})}):null,t[0]=a,t[1]=n,t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;return t[5]===o?s=t[6]:(s=(0,$.jsx)(`div`,{className:`grid gap-6`,children:o}),t[5]=o,t[6]=s),s}var sn=Gt;export{sn as component};
5
+ //# sourceMappingURL=settings.plugins-JB-_3lB3.js.map