decocms 4.76.21 → 4.76.22

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 (236) hide show
  1. package/dist/client/assets/{AlertCircle-C1GWea3g.js → AlertCircle-Ba3c7JHB.js} +1 -1
  2. package/dist/client/assets/{AreaChart-By8VwQKr.js → AreaChart-Wl_lEpL_.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-CrsEOKL0.js → ArrowUp-B9i6YuOr.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-BFE32M8x.js → ArrowUpRight-D8zE8fPc.js} +1 -1
  5. package/dist/client/assets/{Check-D3QzDfcC.js → Check-krbQ-_pD.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-C9gth70N.js → CheckCircle-B3JOb8lC.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-DWdTNLqC.js → ChevronDown-CzXAXUWE.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-CBEAiKvJ.js → ChevronRight-B0Wrcl1e.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-y0wG2Tib.js → ChevronUp-ekVqOFP-.js} +1 -1
  10. package/dist/client/assets/{Circle-Dg3_FK-S.js → Circle-D64gi-Ot.js} +1 -1
  11. package/dist/client/assets/{Copy01-d2YEyZlI.js → Copy01-BDms6R2f.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-U8G9WPXn.js → DotsVertical-B-uNGH8a.js} +1 -1
  13. package/dist/client/assets/{Eye-Bu_QlODi.js → Eye-BjWSdfn1.js} +1 -1
  14. package/dist/client/assets/{FilterLines-CA0ZuIcY.js → FilterLines-CInh51lN.js} +1 -1
  15. package/dist/client/assets/{Flag01-DZd_cLin.js → Flag01-BeG6GFrw.js} +1 -1
  16. package/dist/client/assets/{Globe01-DqMXikgi.js → Globe01-bhv6dFqn.js} +1 -1
  17. package/dist/client/assets/{Globe04-Dp0R_7A5.js → Globe04-Cicmwu1o.js} +1 -1
  18. package/dist/client/assets/{HardDrive-C1QEdUAn.js → HardDrive-Dp9mS0wd.js} +1 -1
  19. package/dist/client/assets/{Key01-DHS9P8tV.js → Key01-CBG7J6l-.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-BuEgvV5z.js → LayoutLeft-JLpLL6LG.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-CMoytEgO.js → LinkExternal01-Bjap4Eu6.js} +1 -1
  22. package/dist/client/assets/{List-ivEG8aQS.js → List-C6FA27q6.js} +1 -1
  23. package/dist/client/assets/{Monitor01-aKW_uVh4.js → Monitor01-Cntu_ktP.js} +1 -1
  24. package/dist/client/assets/{Package-EtmOU9uK.js → Package-KYb5lcD-.js} +1 -1
  25. package/dist/client/assets/{Palette-DN1Y1W7E.js → Palette-BVrYfdzw.js} +1 -1
  26. package/dist/client/assets/{Play-BB41a0SG.js → Play-CtwXW2JJ.js} +1 -1
  27. package/dist/client/assets/{Plus-BrR3Av2A.js → Plus-K3EL_nHp.js} +1 -1
  28. package/dist/client/assets/{SearchLg-C3K-Q-3p.js → SearchLg-DNs33kkT.js} +1 -1
  29. package/dist/client/assets/{SearchMd-Dr-hT58P.js → SearchMd-EkIWmAPK.js} +1 -1
  30. package/dist/client/assets/{Settings02-Er9Bietw.js → Settings02-Dd7RAl0e.js} +1 -1
  31. package/dist/client/assets/{Shield01-CtU64mpj.js → Shield01-0S-JnvhD.js} +1 -1
  32. package/dist/client/assets/{Star01-BWkrwZIa.js → Star01-E-YkSpp4.js} +1 -1
  33. package/dist/client/assets/{Stars01-rl_C4RbD.js → Stars01-COCb3Tum.js} +1 -1
  34. package/dist/client/assets/{Stars02-DXvB532v.js → Stars02-BDFYmZtx.js} +1 -1
  35. package/dist/client/assets/{Sun-CQphmXHM.js → Sun-HHowie3P.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-Vs0R2MDl.js → SwitchHorizontal01-DrCHSgJD.js} +1 -1
  37. package/dist/client/assets/{Tool01-CwvQIBFt.js → Tool01-CGe37PJt.js} +1 -1
  38. package/dist/client/assets/{Tool02-aNh7sCME.js → Tool02-BECpzWBI.js} +1 -1
  39. package/dist/client/assets/{Trash01-BqhB-O11.js → Trash01-DzHOHwQ2.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-C4AtiIJQ.js → TrendUp01-DWX-OssO.js} +1 -1
  41. package/dist/client/assets/{Upload01-BfIxJiRz.js → Upload01-DB3SrbfL.js} +1 -1
  42. package/dist/client/assets/{User01-BRzdOu17.js → User01-ClVxkfVI.js} +1 -1
  43. package/dist/client/assets/{UserPlus01-EzQRa59t.js → UserPlus01-IHvZUfSv.js} +1 -1
  44. package/dist/client/assets/{Users01-CIkfXuyD.js → Users01-CWvTMraW.js} +1 -1
  45. package/dist/client/assets/{Users03-WK3fLY6t.js → Users03-BJ5zhGVY.js} +1 -1
  46. package/dist/client/assets/{X-BZ0tLech.js → X-DSvEfRUU.js} +1 -1
  47. package/dist/client/assets/{XCircle-D209pndg.js → XCircle-DqFVb6hP.js} +1 -1
  48. package/dist/client/assets/{XClose-nEPYBToW.js → XClose-BXm2RFVk.js} +1 -1
  49. package/dist/client/assets/{Zap-CbdyJMW4.js → Zap-Cmxbl2bf.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-S2EGOBml.js → ZapSquare-CbWzSUJ1.js} +1 -1
  51. package/dist/client/assets/{ZoomOut-Dc_YjNmb.js → ZoomOut-B2yLjdFS.js} +1 -1
  52. package/dist/client/assets/{access-gate-C8EtSb0N.js → access-gate-n8TWgVSc.js} +1 -1
  53. package/dist/client/assets/{add-section-modal-BGboku5D.js → add-section-modal-BzI7MqY0.js} +1 -1
  54. package/dist/client/assets/{agent-icon-DAdIwNpK.js → agent-icon-Cw3mD2cs.js} +1 -1
  55. package/dist/client/assets/{agents-list-DPIb1rUj.js → agents-list-CTmDPrKo.js} +1 -1
  56. package/dist/client/assets/{ai-providers-Dt2EFWUg.js → ai-providers-CHcNx8pJ.js} +1 -1
  57. package/dist/client/assets/{alert-BYRWwlIq.js → alert-DcpCSzCO.js} +1 -1
  58. package/dist/client/assets/{alert-dialog-DI6_t0lp.js → alert-dialog-DWhtFKkd.js} +1 -1
  59. package/dist/client/assets/app-editor-BzoS159A.js +1 -0
  60. package/dist/client/assets/{auth-D7AG0zD9.js → auth-c43VL_Mm.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-BdrzKPz6.js → auth-catchall-BYSoYFaD.js} +1 -1
  62. package/dist/client/assets/{auth-entry-CE-C3T_O.js → auth-entry-D1dh6ONs.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-Bp6Yg_da.js → auth-split-layout-Bvj4SjAg.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-DjXlaiAX.js → authenticate-and-persist-oauth-Bto5puML.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-Dkh-4Tp3.js → automation-list-row-BGa9Kx1g.js} +1 -1
  66. package/dist/client/assets/{automation-runs-B4bxEOV7.js → automation-runs-BODA-g1L.js} +2 -2
  67. package/dist/client/assets/automations-FZ6Il-Si.js +1 -0
  68. package/dist/client/assets/{autosend-CsrEpzf3.js → autosend-BhyLTrx3.js} +1 -1
  69. package/dist/client/assets/{avatar-C2CtwT3l.js → avatar-DGFWXayl.js} +1 -1
  70. package/dist/client/assets/{badge-CGF_bDaz.js → badge-Cgaxqrxm.js} +1 -1
  71. package/dist/client/assets/{block-document-C31VNvJd.js → block-document-CeoKNkal.js} +1 -1
  72. package/dist/client/assets/{brand-context-BrCmFwEB.js → brand-context-CnFprUaO.js} +1 -1
  73. package/dist/client/assets/{buckets-ChnMUWwE.js → buckets-CB0Uxcqm.js} +1 -1
  74. package/dist/client/assets/{bulk-category-panel-DJC4PvvT.js → bulk-category-panel-uXxdA6fs.js} +1 -1
  75. package/dist/client/assets/{calendar-D4-iK4tw.js → calendar-DSSrgtHJ.js} +1 -1
  76. package/dist/client/assets/{capability-load-error-CytmW_EY.js → capability-load-error-DV2C-gNg.js} +1 -1
  77. package/dist/client/assets/{card-BhPXcpLW.js → card-D3N3kXXP.js} +1 -1
  78. package/dist/client/assets/{category-editor-DJN572Rl.js → category-editor-C5iaK2Bt.js} +1 -1
  79. package/dist/client/assets/{chat-context-BziNvp0Z.js → chat-context-CKVHbWHv.js} +1 -1
  80. package/dist/client/assets/{checkbox-D5f8qS2g.js → checkbox-BxPo8mir.js} +1 -1
  81. package/dist/client/assets/{cli-auth-success-DndHeZ_g.js → cli-auth-success-DX9iodQ2.js} +1 -1
  82. package/dist/client/assets/{collection-detail-DZzffOMn.js → collection-detail-DxgzMQWf.js} +1 -1
  83. package/dist/client/assets/{collection-display-button-DsEvrSDY.js → collection-display-button-Z_D5ko_v.js} +1 -1
  84. package/dist/client/assets/{collection-search-ZPQkg3hk.js → collection-search-CV4YVGrV.js} +1 -1
  85. package/dist/client/assets/{collection-table-wrapper-CN_nNbCH.js → collection-table-wrapper-DrO9ONcL.js} +1 -1
  86. package/dist/client/assets/{collection-tabs-DaYVqp7M.js → collection-tabs-C0rdvsMX.js} +1 -1
  87. package/dist/client/assets/{command-Bq4rhMq3.js → command-DahSesqP.js} +1 -1
  88. package/dist/client/assets/{commerce-onboarding-BMzVXC99.js → commerce-onboarding-DPR6DnkV.js} +1 -1
  89. package/dist/client/assets/{companions-core-BasGkH1W.js → companions-core-DTWz4ucN.js} +1 -1
  90. package/dist/client/assets/{connect-desktop-dialog-Fmmw34JT.js → connect-desktop-dialog-Ds7NhT73.js} +1 -1
  91. package/dist/client/assets/{connection-card-B1xAe_y9.js → connection-card-DlC9exu_.js} +1 -1
  92. package/dist/client/assets/{connection-detail-tGknx-J9.js → connection-detail-B_5VMSLc.js} +1 -1
  93. package/dist/client/assets/{connection-form-helpers-DbYBcFlF.js → connection-form-helpers-CQnpGSmm.js} +1 -1
  94. package/dist/client/assets/{connections-E3sopHjS.js → connections-D-WenmQ7.js} +1 -1
  95. package/dist/client/assets/{decopilot-sse-pool-OrB4bMjO.js → decopilot-sse-pool-DeRCouiP.js} +1 -1
  96. package/dist/client/assets/{dialog-GJ_l_G1c.js → dialog-BVSdiefE.js} +1 -1
  97. package/dist/client/assets/{domain-settings-DotW_9Al.js → domain-settings-CkVy1qOb.js} +1 -1
  98. package/dist/client/assets/{drawer-8l0A_gUU.js → drawer-BYD34zis.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-CN7hEuhV.js → dropdown-menu-BBS65Nqo.js} +1 -1
  100. package/dist/client/assets/{empty-state-Cky8ctqW.js → empty-state-DUgIo0nQ.js} +1 -1
  101. package/dist/client/assets/{extract-connection-data-C1Z-x4Nd.js → extract-connection-data-B-pGdegm.js} +1 -1
  102. package/dist/client/assets/{file-explorer-TOOC88AB.js → file-explorer-CT-teJ_-.js} +1 -1
  103. package/dist/client/assets/{file-type-icon-CMpcgwB8.js → file-type-icon-BVK8vwp-.js} +1 -1
  104. package/dist/client/assets/{files-b3vvw1zj.js → files-D0YM0BoU.js} +1 -1
  105. package/dist/client/assets/{form-dqfX7zGL.js → form-B14YU4P0.js} +1 -1
  106. package/dist/client/assets/{general-DQs7YdPs.js → general-XVb0Bqfn.js} +1 -1
  107. package/dist/client/assets/{github-repo-picker-CsYLhPXe.js → github-repo-picker-CbNeKVnU.js} +1 -1
  108. package/dist/client/assets/{hooks-Cg7YFJ5M.js → hooks-Co77tPex.js} +1 -1
  109. package/dist/client/assets/{index-B-QG2O8D.js → index-B5_rBPEp.js} +1 -1
  110. package/dist/client/assets/{index-DPcDa2z3.js → index-BR4P-wVE.js} +1 -1
  111. package/dist/client/assets/{index-PIn4wYpP.js → index-Bgl72ciD.js} +1 -1
  112. package/dist/client/assets/{index-CmJxU2AT.js → index-Bm9gq0rK.js} +1 -1
  113. package/dist/client/assets/{index-B9Nr_BJd.js → index-CQUtxKMm.js} +1 -1
  114. package/dist/client/assets/{index-6_iVrVKP.js → index-CSgLVjz5.js} +2 -2
  115. package/dist/client/assets/{index-wImJLO31.js → index-CXZla8cS.js} +1 -1
  116. package/dist/client/assets/{index-CDXMMPBw.js → index-CYqcqjrE.js} +1 -1
  117. package/dist/client/assets/{index-DL5vsVUe.js → index-CqN5z92N.js} +1 -1
  118. package/dist/client/assets/index-CtGI3P9a.css +1 -0
  119. package/dist/client/assets/{index-DuWg-VVK.js → index-DBTTGF30.js} +1 -1
  120. package/dist/client/assets/{index-B7TWFZI6.js → index-DC8xDfR_.js} +5 -5
  121. package/dist/client/assets/{index-Q21TbxfA.js → index-DEmA32m1.js} +1 -1
  122. package/dist/client/assets/{index-B86A8RMC.js → index-VAFj6NMG.js} +3 -3
  123. package/dist/client/assets/{index-bf_1nemr.js → index-akGK__8f.js} +1 -1
  124. package/dist/client/assets/{index-redirect-_PcPPGiF.js → index-redirect-js2Z8CGh.js} +1 -1
  125. package/dist/client/assets/{input-B78a8UAt.js → input-NzmYBxBD.js} +1 -1
  126. package/dist/client/assets/{integration-icon-BNutPnhO.js → integration-icon-C1Vke8mE.js} +1 -1
  127. package/dist/client/assets/{invite-member-dialog-CHOlAu7C.js → invite-member-dialog-UMW1f4eQ.js} +1 -1
  128. package/dist/client/assets/{label-mkWuXcLp.js → label-DDbhULpF.js} +1 -1
  129. package/dist/client/assets/{layout-Pz3JVic7.js → layout-CBKQCLj6.js} +1 -1
  130. package/dist/client/assets/{login-DUYtOdIi.js → login-R74_fe4o.js} +1 -1
  131. package/dist/client/assets/{mcp-oauth-BHqY5qvf.js → mcp-oauth-gJL6-NLJ.js} +1 -1
  132. package/dist/client/assets/{members-DtX36bTt.js → members-CqwFutTR.js} +1 -1
  133. package/dist/client/assets/{monaco-editor-BGCu3xQY.js → monaco-editor-CDBmI29U.js} +1 -1
  134. package/dist/client/assets/{monitoring-stats-row-Cu5wWkak.js → monitoring-stats-row-CWLc_0cD.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-DFjOGUnI.js → oauth-callback-DPPtEjTM.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-ai-provider-V6TFtVOt.js → oauth-callback-ai-provider-CtP_a2Bi.js} +1 -1
  137. package/dist/client/assets/{onboarding-Cw1NKAy2.js → onboarding-Bu3dF563.js} +1 -1
  138. package/dist/client/assets/{org-install-HsTXOFTx.js → org-install-DFaP8IvK.js} +1 -1
  139. package/dist/client/assets/{org-layout-Cio4Rx0n.js → org-layout-9mkibxKf.js} +1 -1
  140. package/dist/client/assets/{organization-choice-BBq9MA19.js → organization-choice-BzBqg__N.js} +1 -1
  141. package/dist/client/assets/{orgs-DGDfyUu8.js → orgs-B9W5YAsZ.js} +1 -1
  142. package/dist/client/assets/{page-seo-form-DBSqjzVY.js → page-seo-form-Dsw6SRw5.js} +1 -1
  143. package/dist/client/assets/page-seo-sheet-C6OA3HLT.js +1 -0
  144. package/dist/client/assets/{popover-D8hdnbd9.js → popover-BkyEtH0B.js} +1 -1
  145. package/dist/client/assets/{post-editor-BUwig-90.js → post-editor-BzeWIGYN.js} +1 -1
  146. package/dist/client/assets/{primitives-hjJ07hcW.js → primitives-CyAbmUgz.js} +1 -1
  147. package/dist/client/assets/{profile-BxurePGe.js → profile-YBG2xS_a.js} +1 -1
  148. package/dist/client/assets/project-app-view-04xrA-r0.js +1 -0
  149. package/dist/client/assets/record-editor-Brkyd5Lu.js +1 -0
  150. package/dist/client/assets/redirect-editor-CNfHnCdU.js +1 -0
  151. package/dist/client/assets/registry-CiPBdVxf.js +2 -0
  152. package/dist/client/assets/{registry-layout-CSi3_E6B.js → registry-layout-D-V38YgJ.js} +2 -2
  153. package/dist/client/assets/{reports-RlGYi26n.js → reports-DwHwribU.js} +1 -1
  154. package/dist/client/assets/{require-capability-TEBx91nK.js → require-capability-kQOjcA9d.js} +1 -1
  155. package/dist/client/assets/{required-auth-layout-Bsp8XNzw.js → required-auth-layout-D-vqfOd0.js} +1 -1
  156. package/dist/client/assets/{reset-password-CTYeSh5Y.js → reset-password-P7-rUERt.js} +1 -1
  157. package/dist/client/assets/{roles-DC9nLcU3.js → roles-BItVgGlH.js} +1 -1
  158. package/dist/client/assets/{search-input-DzgetVLh.js → search-input-KFBMvTPM.js} +1 -1
  159. package/dist/client/assets/{secrets-HupcHWtZ.js → secrets-BHxRlX-K.js} +1 -1
  160. package/dist/client/assets/{sections-editor-DGDllJdC.js → sections-editor-CYE-9mi3.js} +1 -1
  161. package/dist/client/assets/{select-B_ap1Nsx.js → select-BsOR8fqY.js} +1 -1
  162. package/dist/client/assets/{select-model-Bqw0Nz5f.js → select-model-Byf5Whq4.js} +1 -1
  163. package/dist/client/assets/{self-tool-result-B5_z8_Ri.js → self-tool-result-CtmkBui9.js} +1 -1
  164. package/dist/client/assets/{seo-editor-UUntZeAU.js → seo-editor-C8WrbuHu.js} +1 -1
  165. package/dist/client/assets/{settings-layout-BYDvbPfF.js → settings-layout-CRGLP_JO.js} +1 -1
  166. package/dist/client/assets/{settings-section-B3om2Qoq.js → settings-section-OlqS--Jc.js} +1 -1
  167. package/dist/client/assets/{shell-controls-fO2-DLE6.js → shell-controls-Cefme9ch.js} +1 -1
  168. package/dist/client/assets/{shell-layout-BY1WNqMj.js → shell-layout-CTvCxVwI.js} +1 -1
  169. package/dist/client/assets/{sidebar-CnCBNVm2.js → sidebar-DOOKmpGK.js} +1 -1
  170. package/dist/client/assets/{skeleton-DFYUH8Yv.js → skeleton-CRKjewVb.js} +1 -1
  171. package/dist/client/assets/{sso-D4rOBUVO.js → sso-QQsPM_46.js} +1 -1
  172. package/dist/client/assets/{store-1UqfWnVB.js → store-0GBG86Fl.js} +1 -1
  173. package/dist/client/assets/store-registry-DhRNheGV.js +2 -0
  174. package/dist/client/assets/{studio-tools-CH7YpsSd.js → studio-tools-DfX0BJjU.js} +1 -1
  175. package/dist/client/assets/{switch-DgcShKoc.js → switch-yZTvz9u_.js} +1 -1
  176. package/dist/client/assets/{table-C52JhAxi.js → table-pFXNsR6s.js} +1 -1
  177. package/dist/client/assets/{tabs-D4P3fbFb.js → tabs-BNuCpyzF.js} +1 -1
  178. package/dist/client/assets/{textarea-BJrSNwBl.js → textarea-C3SwwqsD.js} +1 -1
  179. package/dist/client/assets/{toggle-group-DBjmdoYu.js → toggle-group-BtVfHIxl.js} +1 -1
  180. package/dist/client/assets/{toolbar-DZtb1exb.js → toolbar-DZfBN8Zo.js} +1 -1
  181. package/dist/client/assets/{toolbar-icon-button-Cq0nJuf9.js → toolbar-icon-button-Cd_TTlvm.js} +1 -1
  182. package/dist/client/assets/{tools-list-D5qsWfei.js → tools-list-BJ_jFFip.js} +1 -1
  183. package/dist/client/assets/{tooltip-BLeEiX8T.js → tooltip-BgDNGB0l.js} +1 -1
  184. package/dist/client/assets/{use-ai-providers-Cwf6KNhh.js → use-ai-providers-BsNZwury.js} +1 -1
  185. package/dist/client/assets/{use-automations-DnworJLI.js → use-automations-BSlI0_fV.js} +1 -1
  186. package/dist/client/assets/{use-autosave-BSeFCJcE.js → use-autosave-XxienLH2.js} +1 -1
  187. package/dist/client/assets/{use-capability-D22Ywp8d.js → use-capability-tVEQ1w7_.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-DoSiF2qc.js → use-clock-tick-DEDj5fXa.js} +1 -1
  189. package/dist/client/assets/{use-collections-J3Ak_sAG.js → use-collections-CSHtkRjT.js} +1 -1
  190. package/dist/client/assets/{use-connection-Bg4ZDKnh.js → use-connection-Bk4XRvd-.js} +1 -1
  191. package/dist/client/assets/{use-copy-vkzTSE-S.js → use-copy-ffK8WNX1.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-D2eJRIjG.js → use-create-virtual-mcp-DcNowspY.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-CkwcjvIV.js → use-debounced-autosave-DMOBh82E.js} +1 -1
  194. package/dist/client/assets/{use-debounced-value-CzvEG8Xl.js → use-debounced-value-_bqtnC16.js} +1 -1
  195. package/dist/client/assets/{use-deco-credits-DeHL5ath.js → use-deco-credits-Bu0FE_9G.js} +1 -1
  196. package/dist/client/assets/{use-decopilot-events-C7fULJ-f.js → use-decopilot-events-B4b-nbFc.js} +1 -1
  197. package/dist/client/assets/{use-delete-connection-CeoEsweA.js → use-delete-connection-zQCoh2uQ.js} +1 -1
  198. package/dist/client/assets/{use-deployment-admin-D6slj-l7.js → use-deployment-admin-BON-_5LT.js} +1 -1
  199. package/dist/client/assets/{use-file-configs-B1nH12iv.js → use-file-configs-CgVU6tAx.js} +1 -1
  200. package/dist/client/assets/{use-infinite-scroll-BSKZnrVa.js → use-infinite-scroll-CJLQ-k2u.js} +1 -1
  201. package/dist/client/assets/{use-join-requests-wP8LYlhN.js → use-join-requests-uEQRpfmD.js} +1 -1
  202. package/dist/client/assets/{use-mcp-client-lWRRCaEk.js → use-mcp-client-BCL0dZx5.js} +1 -1
  203. package/dist/client/assets/{use-mcp-tools-eEiVOCwe.js → use-mcp-tools-B3a-bMRx.js} +1 -1
  204. package/dist/client/assets/{use-members-Dz7pQAPC.js → use-members-DiEwKLGu.js} +1 -1
  205. package/dist/client/assets/{use-mobile-DsMgW76z.js → use-mobile-BlJgM9iz.js} +1 -1
  206. package/dist/client/assets/{use-navigate-to-agent-CngZ9GJd.js → use-navigate-to-agent-pAAaXmeF.js} +1 -1
  207. package/dist/client/assets/{use-org-auth-client-B0aD_tpS.js → use-org-auth-client-a2pitZ0Y.js} +1 -1
  208. package/dist/client/assets/{use-org-sso-CA0t0DGp.js → use-org-sso-Co9Rc7WB.js} +1 -1
  209. package/dist/client/assets/{use-organization-roles-BM3FnorC.js → use-organization-roles-D9ABwg8a.js} +1 -1
  210. package/dist/client/assets/{use-organization-settings-_uxupuAn.js → use-organization-settings--_OPTEpK.js} +1 -1
  211. package/dist/client/assets/{use-registry-connections-GJkSYegv.js → use-registry-connections-CIxGE0Gs.js} +1 -1
  212. package/dist/client/assets/{use-secrets-BKQydTq8.js → use-secrets-DVTfCNgq.js} +1 -1
  213. package/dist/client/assets/{use-status-sounds-C_WRXJJP.js → use-status-sounds-ChaOvM0a.js} +1 -1
  214. package/dist/client/assets/{use-view-mode-zJVSejC4.js → use-view-mode-DGmIodvN.js} +1 -1
  215. package/dist/client/assets/{use-virtual-mcp-pxIhWzgZ.js → use-virtual-mcp-C_XGXqtN.js} +1 -1
  216. package/dist/client/assets/useInfiniteQuery-DVgb_nFQ.js +1 -0
  217. package/dist/client/assets/{useRouterState-TEilEZcp.js → useRouterState-C4Wt8ceN.js} +1 -1
  218. package/dist/client/assets/useSuspenseInfiniteQuery-BmrkHnr6.js +1 -0
  219. package/dist/client/assets/{users-CdM5oolc.js → users-Cf4N9wNM.js} +1 -1
  220. package/dist/client/assets/{variant-calendar-DRyLqk76.js → variant-calendar-BSALF_9h.js} +1 -1
  221. package/dist/client/assets/{view-mode-toggle-Dy8bJjdz.js → view-mode-toggle-5b92WcfH.js} +1 -1
  222. package/dist/client/index.html +2 -2
  223. package/dist/server/cli.js +1 -1
  224. package/dist/server/server.js +1 -1
  225. package/package.json +1 -1
  226. package/dist/client/assets/app-editor-GDF9RylP.js +0 -1
  227. package/dist/client/assets/automations-cdY3EXup.js +0 -1
  228. package/dist/client/assets/index-B0LpMhBo.css +0 -1
  229. package/dist/client/assets/page-seo-sheet-DYXan91p.js +0 -1
  230. package/dist/client/assets/project-app-view-B4VqCo3a.js +0 -1
  231. package/dist/client/assets/record-editor-St7_lbH4.js +0 -1
  232. package/dist/client/assets/redirect-editor-BMGZds22.js +0 -1
  233. package/dist/client/assets/registry-BEU4OTwS.js +0 -2
  234. package/dist/client/assets/store-registry-s6mM6nT-.js +0 -2
  235. package/dist/client/assets/useInfiniteQuery-CU3StuYB.js +0 -1
  236. package/dist/client/assets/useSuspenseInfiniteQuery-2NZ4CcJ6.js +0 -1
@@ -1 +1 @@
1
- import{c as d,j as s,cr as i,l as c}from"./index-B86A8RMC.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
1
+ import{c as d,j as s,cr as i,l as c}from"./index-VAFj6NMG.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{x as D,g as a,D as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{c,j as i,dN as f,dO as m,l as u,dP as g,dQ as x,dR as v,dS as b,dT as h,dU as w,dV as j,dW as N,dX as z,dY as _,dZ as y,d_ as p}from"./index-B86A8RMC.js";import{i as $}from"./Check-D3QzDfcC.js";import{i as D}from"./ChevronRight-CBEAiKvJ.js";import{i as M}from"./Circle-Dg3_FK-S.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function O(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function E(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function G(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function L(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,Q as b,O as c,E as d,V as e,W as f,X as g,L as h,P as i,U as j,G as k};
1
+ import{c,j as i,dN as f,dO as m,l as u,dP as g,dQ as x,dR as v,dS as b,dT as h,dU as w,dV as j,dW as N,dX as z,dY as _,dZ as y,d_ as p}from"./index-VAFj6NMG.js";import{i as $}from"./Check-krbQ-_pD.js";import{i as D}from"./ChevronRight-B0Wrcl1e.js";import{i as M}from"./Circle-D64gi-Ot.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function O(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function E(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function G(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function L(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,Q as b,O as c,E as d,V as e,W as f,X as g,L as h,P as i,U as j,G as k};
@@ -1 +1 @@
1
- import{c as v,l as N,j as t}from"./index-B86A8RMC.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{c as v,l as N,j as t}from"./index-VAFj6NMG.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import"./index-B86A8RMC.js";import{c as O}from"./use-mcp-client-lWRRCaEk.js";import{W as T}from"./constants-D_FQAPnt.js";function x(t){if(!t)return null;const e=typeof t=="string"?t:t.url;if(!e)return null;const n=e.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(t){const e=x(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function B(t,e){return H(t,e)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function J(t){if(!t)return[];const e=[];for(const n of t){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}e.push(...a)}return e}const L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(t){return t?L[t]??t.toUpperCase():null}function Q(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function X(t,e,n,a,r){const o=await O({connectionId:t,orgId:e,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=G[n[t]&63];return e};function j(t){return`${t}_${$()}`}function K(t){return t._meta?.["mcp.mesh"]?.appName||t.server?.name||null}function V(t){if(!t?.url)return"Unknown";try{return new URL(t.url).hostname}catch{return t.url}}function W(t){const e=t?.identifier||t?.name;return e?e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Z(t,e,n,a){const r=t.server,o=t._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],g=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[v]:null,l=y?null:g[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=g.length>1,M=p.length>1;let d="";c&&M?d=` (${W(c)})`:l&&N&&(d=` (${V(l)})`);const E=I+d;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:t.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:e,tools:null,bindings:null,status:"inactive"}}export{K as a,U as b,X as c,Q as d,Z as e,J as f,j as g,B as i};
1
+ import"./index-VAFj6NMG.js";import{c as O}from"./use-mcp-client-BCL0dZx5.js";import{W as T}from"./constants-D_FQAPnt.js";function x(t){if(!t)return null;const e=typeof t=="string"?t:t.url;if(!e)return null;const n=e.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function U(t){const e=x(t);if(!e)return null;const n=`https://github.com/${e.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function H(t,e){return t===T.REGISTRY(e)||t===T.COMMUNITY_REGISTRY(e)}function B(t,e){return H(t,e)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function J(t){if(!t)return[];const e=[];for(const n of t){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}e.push(...a)}return e}const L={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function Y(t){return t?L[t]??t.toUpperCase():null}function Q(t){if(!t)return[];if(Array.isArray(t))return t;if(typeof t=="object"&&t!==null){const e=Object.keys(t).find(n=>Array.isArray(t[n]));if(e)return t[e]}return[]}async function X(t,e,n,a,r){const o=await O({connectionId:t,orgId:e,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}const D="mcp.mesh";let G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=G[n[t]&63];return e};function j(t){return`${t}_${$()}`}function K(t){return t._meta?.["mcp.mesh"]?.appName||t.server?.name||null}function V(t){if(!t?.url)return"Unknown";try{return new URL(t.url).hostname}catch{return t.url}}function W(t){const e=t?.identifier||t?.name;return e?e.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Z(t,e,n,a){const r=t.server,o=t._meta?.[D],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",R=r?.description||null,k=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,w=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,A=o?.configuration_state,C=o?.configuration_scopes,P=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],g=r?.remotes??[],v=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[v]:null,l=y?null:g[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=Y(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=g.length>1,M=p.length>1;let d="";c&&M?d=` (${W(c)})`:l&&N&&(d=` (${V(l)})`);const E=I+d;return{id:j("conn"),title:E,description:R,icon:k,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:w,configuration_state:A??null,configuration_scopes:C??null,metadata:{source:"store",registry_item_id:t.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:P},created_at:s,updated_at:s,created_by:n,organization_id:e,tools:null,bindings:null,status:"inactive"}}export{K as a,U as b,X as c,Q as d,Z as e,J as f,j as g,B as i};
@@ -1,2 +1,2 @@
1
- import{c as Z,r as u,j as r,i as se,B as he,d$ as Mt,aO as Dt,aU as ie,e0 as Rt,e1 as Pt,e2 as Et,e3 as kt,bO as Ot,e4 as Tt,e5 as qe,aQ as At,e6 as Lt,e7 as Ft,e8 as It,e9 as $t,ea as _t,eb as zt,ec as Wt,ed as Gt,ee as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-B86A8RMC.js";import{F as Ut,l as Vt}from"./index-DPcDa2z3.js";import{d as qt,ay as Qt,az as Ht,aA as ue,aB as Xt,a7 as _e}from"./agent-icon-DAdIwNpK.js";import{a as Jt}from"./Tool01-CwvQIBFt.js";import{s as Yt}from"./XClose-nEPYBToW.js";import{A as Zt}from"./automation-runs-B4bxEOV7.js";import{b as ze,T as We,a as Ge}from"./tooltip-BLeEiX8T.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-DI6_t0lp.js";import{b as cn}from"./chat-context-BziNvp0Z.js";import{u as dn}from"./shell-layout-BY1WNqMj.js";import{s as fe,a as Ke,f as un}from"./index-B7TWFZI6.js";import{a as fn,h as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-GJ_l_G1c.js";import{I as Be}from"./input-B78a8UAt.js";import{t as vn}from"./ChevronDown-DWdTNLqC.js";import{i as yn}from"./ChevronRight-CBEAiKvJ.js";import{a as wn}from"./ZoomOut-Dc_YjNmb.js";import{E as Cn,v as Ue,w as we,x as bn,y as jn,z as Nn,A as U,C as me,g as Ce,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-DL5vsVUe.js";import"./AlertCircle-C1GWea3g.js";import"./UserPlus01-EzQRa59t.js";import"./ArrowUp-CrsEOKL0.js";import"./Settings02-Er9Bietw.js";import"./Tool02-aNh7sCME.js";import"./XCircle-D209pndg.js";import"./ArrowUpRight-BFE32M8x.js";import"./TrendUp01-C4AtiIJQ.js";import"./ZapSquare-S2EGOBml.js";import"./Users03-WK3fLY6t.js";import"./CheckCircle-C9gth70N.js";import"./Check-D3QzDfcC.js";import"./ChevronUp-y0wG2Tib.js";import"./Circle-Dg3_FK-S.js";import"./Stars02-DXvB532v.js";import"./Copy01-d2YEyZlI.js";import"./DotsVertical-U8G9WPXn.js";import"./Globe01-DqMXikgi.js";import"./Eye-Bu_QlODi.js";import"./FilterLines-CA0ZuIcY.js";import"./Flag01-DZd_cLin.js";import"./Star01-BWkrwZIa.js";import"./Globe04-Dp0R_7A5.js";import"./SwitchHorizontal01-Vs0R2MDl.js";import"./HardDrive-C1QEdUAn.js";import"./Key01-DHS9P8tV.js";import"./LayoutLeft-BuEgvV5z.js";import"./LinkExternal01-CMoytEgO.js";import"./List-ivEG8aQS.js";import"./Monitor01-aKW_uVh4.js";import"./Sun-CQphmXHM.js";import"./Package-EtmOU9uK.js";import"./Palette-DN1Y1W7E.js";import"./Play-BB41a0SG.js";import"./Plus-BrR3Av2A.js";import"./SearchLg-C3K-Q-3p.js";import"./SearchMd-Dr-hT58P.js";import"./Shield01-CtU64mpj.js";import"./Stars01-rl_C4RbD.js";import"./Trash01-BqhB-O11.js";import"./Upload01-BfIxJiRz.js";import"./User01-BRzdOu17.js";import"./Users01-CIkfXuyD.js";import"./X-BZ0tLech.js";import"./Zap-CbdyJMW4.js";import"./select-B_ap1Nsx.js";import"./useInfiniteQuery-CU3StuYB.js";import"./use-infinite-scroll-BSKZnrVa.js";import"./use-connection-Bg4ZDKnh.js";import"./use-collections-J3Ak_sAG.js";import"./use-mcp-client-lWRRCaEk.js";import"./constants-D_FQAPnt.js";import"./auth-D7AG0zD9.js";import"./use-virtual-mcp-pxIhWzgZ.js";import"./card-BhPXcpLW.js";import"./sidebar-CnCBNVm2.js";import"./use-mobile-DsMgW76z.js";import"./table-C52JhAxi.js";import"./empty-state-Cky8ctqW.js";import"./use-members-Dz7pQAPC.js";import"./use-org-auth-client-B0aD_tpS.js";import"./use-clock-tick-DoSiF2qc.js";import"./use-automations-DnworJLI.js";import"./studio-tools-CH7YpsSd.js";import"./useSuspenseInfiniteQuery-2NZ4CcJ6.js";import"./badge-CGF_bDaz.js";import"./checkbox-D5f8qS2g.js";import"./command-Bq4rhMq3.js";import"./index-CDXMMPBw.js";import"./popover-D8hdnbd9.js";import"./avatar-C2CtwT3l.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-vkzTSE-S.js";import"./file-type-icon-CMpcgwB8.js";import"./tab-id-BijBBRwE.js";import"./monaco-editor-BGCu3xQY.js";import"./delay-CnY5UFtP.js";import"./index-B9Nr_BJd.js";import"./hooks-Cg7YFJ5M.js";import"./decopilot-sse-pool-OrB4bMjO.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-BNutPnhO.js";import"./use-navigate-to-agent-CngZ9GJd.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-By8VwQKr.js";import"./form-dqfX7zGL.js";import"./label-mkWuXcLp.js";import"./autosend-CsrEpzf3.js";import"./use-ai-providers-Cwf6KNhh.js";import"./use-decopilot-events-C7fULJ-f.js";import"./use-organization-settings-_uxupuAn.js";import"./required-auth-layout-Bsp8XNzw.js";import"./use-org-sso-CA0t0DGp.js";import"./drawer-8l0A_gUU.js";import"./collection-search-ZPQkg3hk.js";import"./tabs-D4P3fbFb.js";import"./toggle-group-DBjmdoYu.js";import"./use-deco-credits-DeHL5ath.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B1xAe_y9.js";import"./use-registry-connections-GJkSYegv.js";import"./extract-connection-data-C1Z-x4Nd.js";import"./collection-tabs-DaYVqp7M.js";import"./textarea-BJrSNwBl.js";import"./connection-form-helpers-DbYBcFlF.js";import"./authenticate-and-persist-oauth-DjXlaiAX.js";import"./mcp-oauth-BHqY5qvf.js";import"./connect-desktop-dialog-Fmmw34JT.js";import"./select-model-Bqw0Nz5f.js";import"./skeleton-DFYUH8Yv.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B3om2Qoq.js";import"./dropdown-menu-CN7hEuhV.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-C_WRXJJP.js";import"./toolbar-DZtb1exb.js";import"./use-mcp-tools-eEiVOCwe.js";import"./use-capability-D22Ywp8d.js";import"./tools-list-D5qsWfei.js";import"./switch-DgcShKoc.js";import"./use-debounced-autosave-CkwcjvIV.js";import"./index-DuWg-VVK.js";import"./search-input-DzgetVLh.js";import"./github-repo-picker-CsYLhPXe.js";import"./use-debounced-value-CzvEG8Xl.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-BKQydTq8.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-BasGkH1W.js";import"./index-6_iVrVKP.js";import"./get-initials-D-f_fDFw.js";import"./calendar-D4-iK4tw.js";import"./toolbar-icon-button-Cq0nJuf9.js";import"./use-file-configs-B1nH12iv.js";import"./automation-list-row-Dkh-4Tp3.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,V]=u.useState(i),w=Pn[a];i!==B&&(V(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==w.title?($=r.jsx(fn,{children:w.title}),e[7]=w.title,e[8]=$):$=e[8];let O;e[9]!==w.description?(O=r.jsx(mn,{children:w.description}),e[9]=w.description,e[10]=O):O=e[10];let G;e[11]!==$||e[12]!==O?(G=r.jsxs(pn,{children:[$,O]}),e[11]=$,e[12]=O,e[13]=G):G=e[13];let T;e[14]!==m?(T=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=T):T=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==w.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:w.placeholder,autoFocus:!0,disabled:d})]}),e[18]=w.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==T?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[T,P]}),e[22]=P,e[23]=T,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let C;e[33]!==w.submit||e[34]!==d?(C=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):w.submit,e[33]=w.submit,e[34]=d,e[35]=C):C=e[35];let L;e[36]!==k||e[37]!==C?(L=r.jsx(he,{type:"submit",disabled:k,children:C}),e[36]=k,e[37]=C,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[On,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Ot(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(On,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Tt,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var Tn="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=Tn;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Un="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Vn.displayName=Un;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ve(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:V,onDelete:w}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let O;e[0]!==$?(O=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=O):O=e[1];const G=`${a*14+8}px`;let T;e[2]!==G?(T={paddingLeft:G},e[2]=G,e[3]=T):T=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(wn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==O||e[16]!==T||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:O,style:T,onClick:A,children:[R,P]})}),e[15]=O,e[16]=T,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ve,{}),e[25]=k):k=e[25];let C;e[26]!==y?(C=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=C):C=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ve,{}),e[30]=b):b=e[30];let S;e[31]!==V?(S=r.jsx(te,{onSelect:V,children:"Rename"}),e[31]=V,e[32]=S):S=e[32];let z;e[33]!==w?(z=r.jsx(te,{variant:"destructive",onSelect:w,children:"Delete"}),e[33]=w,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==C||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,C,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=C,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Vt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=U(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function ss({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[V,w]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,O]=u.useState(!1),[,G]=u.useState(new Set),[T,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,C]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return V.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){w(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),C(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:U(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=U(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of we(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:U(n),to:U(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:U(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:U(t),limit:Ue}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Oe(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of we(t)){if(!be(o,n))continue;if(await Oe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ue,maxDepth:Cn});ke(n,!1,t),O(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Te(t){if(!k.get(t)?.loaded){C(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");C(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}C(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),V.includes(t)||w(n=>[...n,t]),Te(t)}function vt(t){w(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),C(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Oe(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function wt(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=we(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function Ct(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=Ct();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=Ce(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
1
+ import{c as Z,r as u,j as r,i as se,B as he,d$ as Mt,aO as Dt,aU as ie,e0 as Rt,e1 as Pt,e2 as Et,e3 as kt,bO as Ot,e4 as Tt,e5 as qe,aQ as At,e6 as Lt,e7 as Ft,e8 as It,e9 as $t,ea as _t,eb as zt,ec as Wt,ed as Gt,ee as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-VAFj6NMG.js";import{F as Ut,l as Vt}from"./index-BR4P-wVE.js";import{d as qt,ay as Qt,az as Ht,aA as ue,aB as Xt,a7 as _e}from"./agent-icon-Cw3mD2cs.js";import{a as Jt}from"./Tool01-CGe37PJt.js";import{s as Yt}from"./XClose-BXm2RFVk.js";import{A as Zt}from"./automation-runs-BODA-g1L.js";import{b as ze,T as We,a as Ge}from"./tooltip-BgDNGB0l.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-DWhtFKkd.js";import{b as cn}from"./chat-context-CKVHbWHv.js";import{u as dn}from"./shell-layout-CTvCxVwI.js";import{s as fe,a as Ke,f as un}from"./index-DC8xDfR_.js";import{a as fn,h as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-BVSdiefE.js";import{I as Be}from"./input-NzmYBxBD.js";import{t as vn}from"./ChevronDown-CzXAXUWE.js";import{i as yn}from"./ChevronRight-B0Wrcl1e.js";import{a as wn}from"./ZoomOut-B2yLjdFS.js";import{E as Cn,v as Ue,w as we,x as bn,y as jn,z as Nn,A as U,C as me,g as Ce,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-CqN5z92N.js";import"./AlertCircle-Ba3c7JHB.js";import"./UserPlus01-IHvZUfSv.js";import"./ArrowUp-B9i6YuOr.js";import"./Settings02-Dd7RAl0e.js";import"./Tool02-BECpzWBI.js";import"./XCircle-DqFVb6hP.js";import"./ArrowUpRight-D8zE8fPc.js";import"./TrendUp01-DWX-OssO.js";import"./ZapSquare-CbWzSUJ1.js";import"./Users03-BJ5zhGVY.js";import"./CheckCircle-B3JOb8lC.js";import"./Check-krbQ-_pD.js";import"./ChevronUp-ekVqOFP-.js";import"./Circle-D64gi-Ot.js";import"./Stars02-BDFYmZtx.js";import"./Copy01-BDms6R2f.js";import"./DotsVertical-B-uNGH8a.js";import"./Globe01-bhv6dFqn.js";import"./Eye-BjWSdfn1.js";import"./FilterLines-CInh51lN.js";import"./Flag01-BeG6GFrw.js";import"./Star01-E-YkSpp4.js";import"./Globe04-Cicmwu1o.js";import"./SwitchHorizontal01-DrCHSgJD.js";import"./HardDrive-Dp9mS0wd.js";import"./Key01-CBG7J6l-.js";import"./LayoutLeft-JLpLL6LG.js";import"./LinkExternal01-Bjap4Eu6.js";import"./List-C6FA27q6.js";import"./Monitor01-Cntu_ktP.js";import"./Sun-HHowie3P.js";import"./Package-KYb5lcD-.js";import"./Palette-BVrYfdzw.js";import"./Play-CtwXW2JJ.js";import"./Plus-K3EL_nHp.js";import"./SearchLg-DNs33kkT.js";import"./SearchMd-EkIWmAPK.js";import"./Shield01-0S-JnvhD.js";import"./Stars01-COCb3Tum.js";import"./Trash01-DzHOHwQ2.js";import"./Upload01-DB3SrbfL.js";import"./User01-ClVxkfVI.js";import"./Users01-CWvTMraW.js";import"./X-DSvEfRUU.js";import"./Zap-Cmxbl2bf.js";import"./select-BsOR8fqY.js";import"./useInfiniteQuery-DVgb_nFQ.js";import"./use-infinite-scroll-CJLQ-k2u.js";import"./use-connection-Bk4XRvd-.js";import"./use-collections-CSHtkRjT.js";import"./use-mcp-client-BCL0dZx5.js";import"./constants-D_FQAPnt.js";import"./auth-c43VL_Mm.js";import"./use-virtual-mcp-C_XGXqtN.js";import"./card-D3N3kXXP.js";import"./sidebar-DOOKmpGK.js";import"./use-mobile-BlJgM9iz.js";import"./table-pFXNsR6s.js";import"./empty-state-DUgIo0nQ.js";import"./use-members-DiEwKLGu.js";import"./use-org-auth-client-a2pitZ0Y.js";import"./use-clock-tick-DEDj5fXa.js";import"./use-automations-BSlI0_fV.js";import"./studio-tools-DfX0BJjU.js";import"./useSuspenseInfiniteQuery-BmrkHnr6.js";import"./badge-Cgaxqrxm.js";import"./checkbox-BxPo8mir.js";import"./command-DahSesqP.js";import"./index-CYqcqjrE.js";import"./popover-BkyEtH0B.js";import"./avatar-DGFWXayl.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-ffK8WNX1.js";import"./file-type-icon-BVK8vwp-.js";import"./tab-id-BijBBRwE.js";import"./monaco-editor-CDBmI29U.js";import"./delay-CnY5UFtP.js";import"./index-CQUtxKMm.js";import"./hooks-Co77tPex.js";import"./decopilot-sse-pool-DeRCouiP.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-C1Vke8mE.js";import"./use-navigate-to-agent-pAAaXmeF.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-Wl_lEpL_.js";import"./form-B14YU4P0.js";import"./label-DDbhULpF.js";import"./autosend-BhyLTrx3.js";import"./use-ai-providers-BsNZwury.js";import"./use-decopilot-events-B4b-nbFc.js";import"./use-organization-settings--_OPTEpK.js";import"./required-auth-layout-D-vqfOd0.js";import"./use-org-sso-Co9Rc7WB.js";import"./drawer-BYD34zis.js";import"./collection-search-CV4YVGrV.js";import"./tabs-BNuCpyzF.js";import"./toggle-group-BtVfHIxl.js";import"./use-deco-credits-Bu0FE_9G.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DlC9exu_.js";import"./use-registry-connections-CIxGE0Gs.js";import"./extract-connection-data-B-pGdegm.js";import"./collection-tabs-C0rdvsMX.js";import"./textarea-C3SwwqsD.js";import"./connection-form-helpers-CQnpGSmm.js";import"./authenticate-and-persist-oauth-Bto5puML.js";import"./mcp-oauth-gJL6-NLJ.js";import"./connect-desktop-dialog-Ds7NhT73.js";import"./select-model-Byf5Whq4.js";import"./skeleton-CRKjewVb.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-OlqS--Jc.js";import"./dropdown-menu-BBS65Nqo.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-ChaOvM0a.js";import"./toolbar-DZfBN8Zo.js";import"./use-mcp-tools-B3a-bMRx.js";import"./use-capability-tVEQ1w7_.js";import"./tools-list-BJ_jFFip.js";import"./switch-yZTvz9u_.js";import"./use-debounced-autosave-DMOBh82E.js";import"./index-DBTTGF30.js";import"./search-input-KFBMvTPM.js";import"./github-repo-picker-CbNeKVnU.js";import"./use-debounced-value-_bqtnC16.js";import"./provision-repo-scoped-github-connection-CB4ICKHq.js";import"./use-secrets-DVTfCNgq.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-DTWz4ucN.js";import"./index-CSgLVjz5.js";import"./get-initials-D-f_fDFw.js";import"./calendar-DSSrgtHJ.js";import"./toolbar-icon-button-Cd_TTlvm.js";import"./use-file-configs-CgVU6tAx.js";import"./automation-list-row-BGa9Kx1g.js";const Pn={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function En(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,V]=u.useState(i),w=Pn[a];i!==B&&(V(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==w.title?($=r.jsx(fn,{children:w.title}),e[7]=w.title,e[8]=$):$=e[8];let O;e[9]!==w.description?(O=r.jsx(mn,{children:w.description}),e[9]=w.description,e[10]=O):O=e[10];let G;e[11]!==$||e[12]!==O?(G=r.jsxs(pn,{children:[$,O]}),e[11]=$,e[12]=O,e[13]=G):G=e[13];let T;e[14]!==m?(T=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=T):T=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==w.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:w.placeholder,autoFocus:!0,disabled:d})]}),e[18]=w.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==T?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[T,P]}),e[22]=P,e[23]=T,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let C;e[33]!==w.submit||e[34]!==d?(C=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):w.submit,e[33]=w.submit,e[34]=d,e[35]=C):C=e[35];let L;e[36]!==k||e[37]!==C?(L=r.jsx(he,{type:"submit",disabled:k,children:C}),e[36]=k,e[37]=C,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[On,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Ot(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(On,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Tt,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var Tn="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=Tn;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Un="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Vn.displayName=Un;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ve(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:V,onDelete:w}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let O;e[0]!==$?(O=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=O):O=e[1];const G=`${a*14+8}px`;let T;e[2]!==G?(T={paddingLeft:G},e[2]=G,e[3]=T):T=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(wn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==O||e[16]!==T||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:O,style:T,onClick:A,children:[R,P]})}),e[15]=O,e[16]=T,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ve,{}),e[25]=k):k=e[25];let C;e[26]!==y?(C=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=C):C=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ve,{}),e[30]=b):b=e[30];let S;e[31]!==V?(S=r.jsx(te,{onSelect:V,children:"Rename"}),e[31]=V,e[32]=S):S=e[32];let z;e[33]!==w?(z=r.jsx(te,{variant:"destructive",onSelect:w,children:"Delete"}),e[33]=w,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==C||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,C,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=C,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Vt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=U(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function ss({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[V,w]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,O]=u.useState(!1),[,G]=u.useState(new Set),[T,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,C]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return V.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){w(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),C(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:U(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=U(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of we(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:U(n),to:U(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:U(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:U(t),limit:Ue}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Oe(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of we(t)){if(!be(o,n))continue;if(await Oe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ue,maxDepth:Cn});ke(n,!1,t),O(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Te(t){if(!k.get(t)?.loaded){C(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");C(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}C(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),V.includes(t)||w(n=>[...n,t]),Te(t)}function vt(t){w(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),C(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Oe(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function wt(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=we(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function Ct(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=Ct();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=Ce(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
2
2
  `)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&T.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?wt(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",U(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[V.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:V.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Te(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&S(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Ut,{language:Ce(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&C(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",Ce(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":U(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{ss as FileExplorer};
@@ -1,4 +1,4 @@
1
- import{bx as zl,j as q,aM as lt,bP as zn,r as Ve,F as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-B86A8RMC.js";import{i as zb}from"./Check-D3QzDfcC.js";import{a as jb}from"./Copy01-d2YEyZlI.js";import{e as S0,g as y0,f as A0,a as _0}from"./dialog-GJ_l_G1c.js";import{n as I0}from"./Globe01-DqMXikgi.js";import{h as k0,n as R0}from"./ZoomOut-Dc_YjNmb.js";import{u as N0}from"./use-mobile-DsMgW76z.js";import{h as C0}from"./tab-id-BijBBRwE.js";function jl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=jl();function Vb(e){Nt=e}var ln={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},v0=/^(?:[ \t]*(?:\n|$))+/,w0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vl=/(?:[*+-]|\d{1,9}[.)])/,Yb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wb=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L0=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D0=/^[^\n]+/,Wl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,M0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),P0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kl).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),B0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),Xl={blockquote:B0,code:w0,def:M0,fences:x0,heading:O0,hr:_n,html:F0,lheading:Wb,list:P0,newline:v0,paragraph:Kb,table:ln,text:D0},Mc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),U0={...Xl,lheading:L0,table:Mc,paragraph:le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},H0={...Xl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ln,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Yl).replace("hr",_n).replace("heading",` *#{1,6} *[^
1
+ import{bx as zl,j as q,aM as lt,bP as zn,r as Ve,F as b0,l as Gb,c as Ke,b as E0,e as T0,B as $b}from"./index-VAFj6NMG.js";import{i as zb}from"./Check-krbQ-_pD.js";import{a as jb}from"./Copy01-BDms6R2f.js";import{e as S0,g as y0,f as A0,a as _0}from"./dialog-BVSdiefE.js";import{n as I0}from"./Globe01-bhv6dFqn.js";import{h as k0,n as R0}from"./ZoomOut-B2yLjdFS.js";import{u as N0}from"./use-mobile-BlJgM9iz.js";import{h as C0}from"./tab-id-BijBBRwE.js";function jl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nt=jl();function Vb(e){Nt=e}var ln={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},v0=/^(?:[ \t]*(?:\n|$))+/,w0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,x0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,O0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vl=/(?:[*+-]|\d{1,9}[.)])/,Yb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Wb=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),L0=le(Yb).replace(/bull/g,Vl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,D0=/^[^\n]+/,Wl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,M0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Wl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),P0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vl).getRegex(),er="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Kl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Kl).replace("tag",er).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),B0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),Xl={blockquote:B0,code:w0,def:M0,fences:x0,heading:O0,hr:_n,html:F0,lheading:Wb,list:P0,newline:v0,paragraph:Kb,table:ln,text:D0},Mc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex(),U0={...Xl,lheading:L0,table:Mc,paragraph:le(Yl).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",er).getRegex()},H0={...Xl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Kl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ln,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Yl).replace("hr",_n).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",Wb).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},q0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,G0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xb=/^( {2,}|\\)\n(?!\s*$)/,$0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,tr=/[\p{P}\p{S}]/u,Zl=/[\s\p{P}\p{S}]/u,Zb=/[^\s\p{P}\p{S}]/u,z0=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zl).getRegex(),Qb=/(?!~)[\p{P}\p{S}]/u,j0=/(?!~)[\s\p{P}\p{S}]/u,V0=/(?:[^\s\p{P}\p{S}]|~)/u,Y0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Jb=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,W0=le(Jb,"u").replace(/punct/g,tr).getRegex(),K0=le(Jb,"u").replace(/punct/g,Qb).getRegex(),eE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",X0=le(eE,"gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),Z0=le(eE,"gu").replace(/notPunctSpace/g,V0).replace(/punctSpace/g,j0).replace(/punct/g,Qb).getRegex(),Q0=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zb).replace(/punctSpace/g,Zl).replace(/punct/g,tr).getRegex(),J0=le(/\\(punct)/,"gu").replace(/punct/g,tr).getRegex(),eS=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tS=le(Kl).replace("(?:-->|$)","-->").getRegex(),nS=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tS).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),jn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,rS=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",jn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tE=le(/^!?\[(label)\]\[(ref)\]/).replace("label",jn).replace("ref",Wl).getRegex(),nE=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Wl).getRegex(),aS=le("reflink|nolink(?!\\()","g").replace("reflink",tE).replace("nolink",nE).getRegex(),Ql={_backpedal:ln,anyPunctuation:J0,autolink:eS,blockSkip:Y0,br:Xb,code:G0,del:ln,emStrongLDelim:W0,emStrongRDelimAst:X0,emStrongRDelimUnd:Q0,escape:q0,link:rS,nolink:nE,punctuation:z0,reflink:tE,reflinkSearch:aS,tag:nS,text:$0,url:ln},iS={...Ql,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",jn).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",jn).getRegex()},_l={...Ql,emStrongRDelimAst:Z0,emStrongLDelim:K0,url:le(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oS={..._l,br:le(Xb).replace("{2,}","*").getRegex(),text:le(_l.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xn={normal:Xl,gfm:U0,pedantic:H0},Jt={normal:Ql,gfm:_l,breaks:oS,pedantic:iS},sS={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Pc=e=>sS[e];function Je(e,t){if(t){if(xe.escapeTest.test(e))return e.replace(xe.escapeReplace,Pc)}else if(xe.escapeTestNoEncode.test(e))return e.replace(xe.escapeReplaceNoEncode,Pc);return e}function Fc(e){try{e=encodeURI(e).replace(xe.percentDecode,"%")}catch{return null}return e}function Bc(e,t){const n=e.replace(xe.findPipe,(i,o,s)=>{let u=!1,l=o;for(;--l>=0&&s[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(xe.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(xe.slashPipe,"|");return r}function en(e,t,n){const r=e.length;if(r===0)return"";let a=0;for(;a<r&&e.charAt(r-a-1)===t;)a++;return e.slice(0,r-a)}function uS(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Uc(e,t,n,r,a){const i=t.href,o=t.title||null,s=e[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,u}function lS(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const a=r[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(n.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
4
4
  `)}var Vn=class{options;rules;lexer;constructor(e){this.options=e||Nt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:en(n,`
@@ -1 +1 @@
1
- import{c as a,e as o,j as i,N as l}from"./index-B86A8RMC.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
1
+ import{c as a,e as o,j as i,N as l}from"./index-VAFj6NMG.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
@@ -1 +1 @@
1
- import{dE as C,c as d,j as c,ah as j,r as f,l as p,bd as b,dF as h,dG as v}from"./index-B86A8RMC.js";import{L as N}from"./label-mkWuXcLp.js";const D=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=h();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=v(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function w(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,D as a,w as b,L as c,P as d,y as e,R as f};
1
+ import{dE as C,c as d,j as c,ah as j,r as f,l as p,bd as b,dF as h,dG as v}from"./index-VAFj6NMG.js";import{L as N}from"./label-DDbhULpF.js";const D=C,g=f.createContext({}),M=t=>{const e=d.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=d.c(13),e=f.useContext(g),s=f.useContext($),{getFieldState:o}=h();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=v(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=f.createContext({});function w(t){const e=d.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=f.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=d.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=d.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=d.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,D as a,w as b,L as c,P as d,y as e,R as f};
@@ -1 +1 @@
1
- import{b as K,C as V,n as M,M as Q,J as Z,d as U,p as F,t as w,K as L,j as n,ah as $,H,I as T,c as D,r as B,B as Y,D as q,s as J}from"./index-B86A8RMC.js";import{P as k}from"./index-DuWg-VVK.js";import{u as W}from"./use-org-auth-client-B0aD_tpS.js";import{u as X}from"./use-debounced-autosave-CkwcjvIV.js";import{A as ee}from"./avatar-C2CtwT3l.js";import{I as G}from"./input-B78a8UAt.js";import{S as P,a as I,b as _,c as te}from"./settings-section-B3om2Qoq.js";import{D as ne}from"./domain-settings-DotW_9Al.js";import{S as ae}from"./switch-DgcShKoc.js";import{c as se,f as oe}from"./use-organization-settings-_uxupuAn.js";import{u as ie}from"./studio-tools-CH7YpsSd.js";import{c as re,b as le,d as ce,A as de,e as ue,g as me,a as ge,f as fe}from"./alert-dialog-DI6_t0lp.js";import{R as pe}from"./require-capability-TEBx91nK.js";import"./sidebar-CnCBNVm2.js";import"./LayoutLeft-BuEgvV5z.js";import"./use-mobile-DsMgW76z.js";import"./X-BZ0tLech.js";import"./tooltip-BLeEiX8T.js";import"./User01-BRzdOu17.js";import"./card-BhPXcpLW.js";import"./ArrowUpRight-BFE32M8x.js";import"./badge-CGF_bDaz.js";import"./select-B_ap1Nsx.js";import"./Check-D3QzDfcC.js";import"./ChevronDown-DWdTNLqC.js";import"./ChevronUp-y0wG2Tib.js";import"./constants-D_FQAPnt.js";import"./use-capability-D22Ywp8d.js";import"./access-gate-C8EtSb0N.js";import"./capability-load-error-CytmW_EY.js";const he=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function xe(e){return typeof e=="string"&&he.has(e.trim().toLowerCase())}const je=H({name:T().min(1,"Name is required").max(255,"Name is too long"),slug:T().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!xe(e),"This organization URL is reserved by Studio"),logo:T().optional()});function be(e){const t=D.c(13),{value:f,onChange:d,name:s,disabled:l}=e,u=B.useRef(null);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>u.current?.click(),t[0]=c):c=t[0];const r=c;let m;t[1]!==d?(m=j=>{const b=j.target.files?.[0];if(!b)return;if(b.size>2097152){w.error("Image must be smaller than 2MB");return}const g=new FileReader;g.onerror=ye,g.onloadend=()=>{g.result&&d(g.result),u.current&&(u.current.value="")},g.readAsDataURL(b)},t[1]=d,t[2]=m):m=t[2];const a=m;let o;t[3]!==l||t[4]!==a?(o=n.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:l}),t[3]=l,t[4]=a,t[5]=o):o=t[5];const i=f||void 0,x=s??"?";let p;t[6]!==i||t[7]!==x?(p=n.jsx(ee,{url:i,fallback:x,shape:"square",size:"base"}),t[6]=i,t[7]=x,t[8]=p):p=t[8];let h;return t[9]!==l||t[10]!==o||t[11]!==p?(h=n.jsxs("button",{type:"button",onClick:r,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,p]}),t[9]=l,t[10]=o,t[11]=p,t[12]=h):h=t[12],h}function ye(){return w.error("Failed to read image")}function ve(){const e=K(),{org:t}=V(),f=W(),d=M(),s=Q({resolver:Z(je),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),l=U({mutationFn:async a=>{const o={name:a.name,slug:a.slug};a.logo&&(o.logo=a.logo);const i=await f.organization.update({data:o});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,o)=>{F("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),d.invalidateQueries({queryKey:L.organizations()}),d.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,o)=>{F("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:u,flush:c}=X({save:async()=>{const a=s.control._formState.dirtyFields;if(Object.keys(a).length===0||!await s.trigger())return;const i=s.getValues(),x=s.control._defaultValues;s.reset(i,{keepValues:!0});try{await l.mutateAsync(i)}catch{s.reset(x,{keepValues:!0})}}}),r=s.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(P,{children:n.jsxs(I,{children:[n.jsx(_,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(be,{value:s.watch("logo"),onChange:a=>{s.setValue("logo",a??"",{shouldDirty:!0}),c()},name:s.watch("name")})}),n.jsx(_,{title:"Name",action:n.jsx($,{control:s.control,name:"name",render:({field:a})=>n.jsx(G,{id:"org-name",...a,onChange:o=>{a.onChange(o),u()},onBlur:()=>{a.onBlur(),c()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(_,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[m&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),n.jsx($,{control:s.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const i=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");s.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),u()},onBlur:()=>{a.onBlur(),c()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Se(){const e=D.c(6),t=se(),{mutate:f,isPending:d}=oe();let s;e[0]!==f?(s=u=>f(u),e[0]=f,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==d||e[4]!==s?(l=n.jsx(P,{title:"Task board",description:"A board for tracking org tasks by status, priority, and assignee.",children:n.jsx(I,{children:n.jsx(_,{title:"Enable task board",description:"Adds a Board entry to the sidebar for this organization.",action:n.jsx(ae,{checked:t,disabled:d,onCheckedChange:s})})})}),e[2]=t,e[3]=d,e[4]=s,e[5]=l):l=e[5],l}function ze(){const e=D.c(42),{org:t}=V(),[f,d]=B.useState(!1),[s,l]=B.useState(""),u=ie();let c;e[0]!==t.id||e[1]!==u?(c=async()=>{await u.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=u,e[2]=c):c=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{F("organization_deleted",{organization_id:t.id}),localStorage.getItem(q.lastOrgSlug())===t.slug&&localStorage.removeItem(q.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let m;e[6]!==c||e[7]!==r?(m={mutationFn:c,onSuccess:r,onError:Ce},e[6]=c,e[7]=r,e[8]=m):m=e[8];const a=U(m);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>d(!0),e[9]=o):o=e[9];let i;e[10]!==a.isPending?(i=n.jsx(P,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(I,{className:"border-destructive/40",children:n.jsx(_,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Y,{variant:"destructive",size:"sm",onClick:o,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=N=>{d(N),N||l("")},e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(re,{children:"Delete Organization?"}),e[13]=p):p=e[13];let h;e[14]!==t.name?(h=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=h):h=e[15];let j;e[16]!==t.name?(j=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=j):j=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=N=>l(N.target.value),e[18]=b):b=e[18];let g;e[19]!==s||e[20]!==t.name?(g=n.jsx(G,{value:s,onChange:b,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=g):g=e[21];let y;e[22]!==g||e[23]!==h||e[24]!==j?(y=n.jsxs(le,{children:[p,n.jsx(ce,{asChild:!0,children:n.jsxs("div",{children:[h,j,g]})})]}),e[22]=g,e[23]=h,e[24]=j,e[25]=y):y=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(de,{children:"Cancel"}),e[26]=O):O=e[26];let v;e[27]!==a?(v=()=>a.mutate(),e[27]=a,e[28]=v):v=e[28];const E=s!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==v||e[30]!==E||e[31]!==R?(S=n.jsxs(ue,{children:[O,n.jsx(me,{onClick:v,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=v,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ge,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==f||e[37]!==z?(C=n.jsx(fe,{open:f,onOpenChange:x,children:z}),e[36]=f,e[37]=z,e[38]=C):C=e[38];let A;return e[39]!==C||e[40]!==i?(A=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=A):A=e[41],A}function Ce(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function we(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(k,{children:n.jsx(k.Content,{children:n.jsx(k.Body,{children:n.jsxs(te,{children:[n.jsx(k.Title,{children:"Organization"}),n.jsx(ve,{}),n.jsx(ne,{}),n.jsx(Se,{}),n.jsx(ze,{})]})})})}),e[0]=t):t=e[0],t}function nt(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(pe,{capability:"org:manage",area:"general settings",children:n.jsx(we,{})}),e[0]=t):t=e[0],t}export{nt as default};
1
+ import{b as K,C as V,n as M,M as Q,J as Z,d as U,p as F,t as w,K as L,j as n,ah as $,H,I as T,c as D,r as B,B as Y,D as q,s as J}from"./index-VAFj6NMG.js";import{P as k}from"./index-DBTTGF30.js";import{u as W}from"./use-org-auth-client-a2pitZ0Y.js";import{u as X}from"./use-debounced-autosave-DMOBh82E.js";import{A as ee}from"./avatar-DGFWXayl.js";import{I as G}from"./input-NzmYBxBD.js";import{S as P,a as I,b as _,c as te}from"./settings-section-OlqS--Jc.js";import{D as ne}from"./domain-settings-CkVy1qOb.js";import{S as ae}from"./switch-yZTvz9u_.js";import{c as se,f as oe}from"./use-organization-settings--_OPTEpK.js";import{u as ie}from"./studio-tools-DfX0BJjU.js";import{c as re,b as le,d as ce,A as de,e as ue,g as me,a as ge,f as fe}from"./alert-dialog-DWhtFKkd.js";import{R as pe}from"./require-capability-kQOjcA9d.js";import"./sidebar-DOOKmpGK.js";import"./LayoutLeft-JLpLL6LG.js";import"./use-mobile-BlJgM9iz.js";import"./X-DSvEfRUU.js";import"./tooltip-BgDNGB0l.js";import"./User01-ClVxkfVI.js";import"./card-D3N3kXXP.js";import"./ArrowUpRight-D8zE8fPc.js";import"./badge-Cgaxqrxm.js";import"./select-BsOR8fqY.js";import"./Check-krbQ-_pD.js";import"./ChevronDown-CzXAXUWE.js";import"./ChevronUp-ekVqOFP-.js";import"./constants-D_FQAPnt.js";import"./use-capability-tVEQ1w7_.js";import"./access-gate-n8TWgVSc.js";import"./capability-load-error-DV2C-gNg.js";const he=new Set([".well-known","_admin","api","auth","cli","commerce-onboarding","dbos-queue-depth","health","hosted-run-pending","login","mcp","metrics","oauth","oauth-proxy","onboarding","org","report","reset-password"]);function xe(e){return typeof e=="string"&&he.has(e.trim().toLowerCase())}const je=H({name:T().min(1,"Name is required").max(255,"Name is too long"),slug:T().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens").refine(e=>!xe(e),"This organization URL is reserved by Studio"),logo:T().optional()});function be(e){const t=D.c(13),{value:f,onChange:d,name:s,disabled:l}=e,u=B.useRef(null);let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>u.current?.click(),t[0]=c):c=t[0];const r=c;let m;t[1]!==d?(m=j=>{const b=j.target.files?.[0];if(!b)return;if(b.size>2097152){w.error("Image must be smaller than 2MB");return}const g=new FileReader;g.onerror=ye,g.onloadend=()=>{g.result&&d(g.result),u.current&&(u.current.value="")},g.readAsDataURL(b)},t[1]=d,t[2]=m):m=t[2];const a=m;let o;t[3]!==l||t[4]!==a?(o=n.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:l}),t[3]=l,t[4]=a,t[5]=o):o=t[5];const i=f||void 0,x=s??"?";let p;t[6]!==i||t[7]!==x?(p=n.jsx(ee,{url:i,fallback:x,shape:"square",size:"base"}),t[6]=i,t[7]=x,t[8]=p):p=t[8];let h;return t[9]!==l||t[10]!==o||t[11]!==p?(h=n.jsxs("button",{type:"button",onClick:r,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[o,p]}),t[9]=l,t[10]=o,t[11]=p,t[12]=h):h=t[12],h}function ye(){return w.error("Failed to read image")}function ve(){const e=K(),{org:t}=V(),f=W(),d=M(),s=Q({resolver:Z(je),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),l=U({mutationFn:async a=>{const o={name:a.name,slug:a.slug};a.logo&&(o.logo=a.logo);const i=await f.organization.update({data:o});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,o)=>{F("organization_settings_updated",{organization_id:t.id,fields:Object.keys(o)}),d.invalidateQueries({queryKey:L.organizations()}),d.invalidateQueries({queryKey:L.activeOrganization(t.slug)}),w.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,o)=>{F("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(o),error:a instanceof Error?a.message:String(a)}),w.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:u,flush:c}=X({save:async()=>{const a=s.control._formState.dirtyFields;if(Object.keys(a).length===0||!await s.trigger())return;const i=s.getValues(),x=s.control._defaultValues;s.reset(i,{keepValues:!0});try{await l.mutateAsync(i)}catch{s.reset(x,{keepValues:!0})}}}),r=s.formState.errors,m=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(P,{children:n.jsxs(I,{children:[n.jsx(_,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(be,{value:s.watch("logo"),onChange:a=>{s.setValue("logo",a??"",{shouldDirty:!0}),c()},name:s.watch("name")})}),n.jsx(_,{title:"Name",action:n.jsx($,{control:s.control,name:"name",render:({field:a})=>n.jsx(G,{id:"org-name",...a,onChange:o=>{a.onChange(o),u()},onBlur:()=>{a.onBlur(),c()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(_,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[m&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:m}),n.jsx($,{control:s.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:o=>{const i=o.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");s.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),u()},onBlur:()=>{a.onBlur(),c()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function Se(){const e=D.c(6),t=se(),{mutate:f,isPending:d}=oe();let s;e[0]!==f?(s=u=>f(u),e[0]=f,e[1]=s):s=e[1];let l;return e[2]!==t||e[3]!==d||e[4]!==s?(l=n.jsx(P,{title:"Task board",description:"A board for tracking org tasks by status, priority, and assignee.",children:n.jsx(I,{children:n.jsx(_,{title:"Enable task board",description:"Adds a Board entry to the sidebar for this organization.",action:n.jsx(ae,{checked:t,disabled:d,onCheckedChange:s})})})}),e[2]=t,e[3]=d,e[4]=s,e[5]=l):l=e[5],l}function ze(){const e=D.c(42),{org:t}=V(),[f,d]=B.useState(!1),[s,l]=B.useState(""),u=ie();let c;e[0]!==t.id||e[1]!==u?(c=async()=>{await u.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=u,e[2]=c):c=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{F("organization_deleted",{organization_id:t.id}),localStorage.getItem(q.lastOrgSlug())===t.slug&&localStorage.removeItem(q.lastOrgSlug()),J(),w.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let m;e[6]!==c||e[7]!==r?(m={mutationFn:c,onSuccess:r,onError:Ce},e[6]=c,e[7]=r,e[8]=m):m=e[8];const a=U(m);let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=()=>d(!0),e[9]=o):o=e[9];let i;e[10]!==a.isPending?(i=n.jsx(P,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(I,{className:"border-destructive/40",children:n.jsx(_,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Y,{variant:"destructive",size:"sm",onClick:o,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=N=>{d(N),N||l("")},e[12]=x):x=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx(re,{children:"Delete Organization?"}),e[13]=p):p=e[13];let h;e[14]!==t.name?(h=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=h):h=e[15];let j;e[16]!==t.name?(j=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=j):j=e[17];let b;e[18]===Symbol.for("react.memo_cache_sentinel")?(b=N=>l(N.target.value),e[18]=b):b=e[18];let g;e[19]!==s||e[20]!==t.name?(g=n.jsx(G,{value:s,onChange:b,placeholder:t.name,autoFocus:!0}),e[19]=s,e[20]=t.name,e[21]=g):g=e[21];let y;e[22]!==g||e[23]!==h||e[24]!==j?(y=n.jsxs(le,{children:[p,n.jsx(ce,{asChild:!0,children:n.jsxs("div",{children:[h,j,g]})})]}),e[22]=g,e[23]=h,e[24]=j,e[25]=y):y=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=n.jsx(de,{children:"Cancel"}),e[26]=O):O=e[26];let v;e[27]!==a?(v=()=>a.mutate(),e[27]=a,e[28]=v):v=e[28];const E=s!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==v||e[30]!==E||e[31]!==R?(S=n.jsxs(ue,{children:[O,n.jsx(me,{onClick:v,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=v,e[30]=E,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ge,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==f||e[37]!==z?(C=n.jsx(fe,{open:f,onOpenChange:x,children:z}),e[36]=f,e[37]=z,e[38]=C):C=e[38];let A;return e[39]!==C||e[40]!==i?(A=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=A):A=e[41],A}function Ce(e){w.error(e instanceof Error?e.message:"Failed to delete organization")}function we(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(k,{children:n.jsx(k.Content,{children:n.jsx(k.Body,{children:n.jsxs(te,{children:[n.jsx(k.Title,{children:"Organization"}),n.jsx(ve,{}),n.jsx(ne,{}),n.jsx(Se,{}),n.jsx(ze,{})]})})})}),e[0]=t):t=e[0],t}function nt(){const e=D.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(pe,{capability:"org:manage",area:"general settings",children:n.jsx(we,{})}),e[0]=t):t=e[0],t}export{nt as default};
@@ -1 +1 @@
1
- import{c as A,j as t,C as F,a as Y,n as M,r as T,ac as H,i as z,d as B,t as U,dH as W,K as R,m as X,B as Z,l as D,v as ee,w as te}from"./index-B86A8RMC.js";import{D as ne,a as se,d as oe,e as ie}from"./dialog-GJ_l_G1c.js";import{C as le}from"./collection-search-ZPQkg3hk.js";import{u as re}from"./use-debounced-value-CzvEG8Xl.js";import{b as Q,u as ae}from"./use-connection-Bg4ZDKnh.js";import{u as L}from"./use-mcp-client-lWRRCaEk.js";import{W as ce,S as V}from"./constants-D_FQAPnt.js";import{a as K}from"./authenticate-and-persist-oauth-DjXlaiAX.js";import{b as J}from"./Settings02-Er9Bietw.js";import{I as ue}from"./agent-icon-DAdIwNpK.js";import{u as de}from"./use-mcp-tools-eEiVOCwe.js";import{e as me}from"./extract-connection-data-C1Z-x4Nd.js";import{c as fe}from"./use-navigate-to-agent-CngZ9GJd.js";import{g as xe,p as q,f as ge}from"./provision-repo-scoped-github-connection-CB4ICKHq.js";function G(y){const e=A.c(4),{size:n,className:i}=y;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=h):h=e[0];let r;return e[1]!==i||e[2]!==n?(r=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:i,children:h}),e[1]=i,e[2]=n,e[3]=r):r=e[3],r}function he(y,e){const n=A.c(12),{org:i}=F();let h;n[0]!==i.id?(h=ce.REGISTRY(i.id),n[0]=i.id,n[1]=h):h=n[1];const r=h;let o;n[2]!==i.id||n[3]!==i.slug||n[4]!==r?(o={connectionId:r,orgId:i.id,orgSlug:i.slug},n[2]=i.id,n[3]=i.slug,n[4]=r,n[5]=o):o=n[5];const p=L(o);let c;n[6]!==y?(c={name:y},n[6]=y,n[7]=c):c=n[7];const b=e?.enabled??!0;let C;return n[8]!==p||n[9]!==c||n[10]!==b?(C={client:p,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:c,enabled:b,staleTime:3e5,select:pe},n[8]=p,n[9]=c,n[10]=b,n[11]=C):C=n[11],de(C)}function pe(y){return y.structuredContent?.item??null}const be="deco/mcp-github";function ye(y){const{org:e}=F(),{data:n}=Y.useSession(),i=Q(),h=M(),[r,o]=T.useState("idle"),[p,c]=T.useState(null),[b,C]=T.useState(null),{data:j,isLoading:u}=he(be,{enabled:y.enabled}),l=T.useRef(!1);y.enabled&&j&&!u&&!l.current&&n?.user?.id&&r==="idle"&&(l.current=!0,d());async function d(){if(!(!j||!n?.user?.id||!e))try{o("installing"),c(null);const a=me(j,e.id,n.user.id,{remoteIndex:0});if(!a.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:N}=await i.create.mutateAsync(a);o("authenticating");const x=await K({connectionId:N,orgId:e.id,orgSlug:e.slug,persistFallback:s=>i.update.mutateAsync({id:N,data:{connection_token:s}}).then(()=>{})});if(x.ran&&!x.ok){try{await i.delete.mutateAsync(N)}catch{}throw new Error(x.error&&x.error!=="no token received"?x.error:"No token received from GitHub")}H(h,e.id),C(a),o("ready")}catch(a){c(a instanceof Error?a.message:String(a)),o("error")}}function m(){o("idle"),c(null),C(null),l.current=!1}return y.enabled&&u&&r==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:r,error:p,connection:b,retry:m}}function De(y){const e=A.c(22),{open:n,onOpenChange:i,title:h,onImportComplete:r,mode:o}=y,p=o===void 0?"agent":o,c=h??(p==="connection"?"Add repo":"Import from GitHub"),[b,C]=T.useState(null);let j;e[0]!==c?(j=t.jsx(ne,{className:"sr-only",children:t.jsx(se,{children:c})}),e[0]=c,e[1]=j):j=e[1];let u;e[2]!==c||e[3]!==b?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:b?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(J,{size:16})}),t.jsx("img",{src:b.avatarUrl,alt:b.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:b.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(G,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:c})]})}),e[2]=c,e[3]=b,e[4]=u):u=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=l):l=e[5];let d;e[6]!==i?(d=()=>i(!1),e[6]=i,e[7]=d):d=e[7];let m;e[8]!==p||e[9]!==r||e[10]!==n||e[11]!==b||e[12]!==d?(m=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:l,children:t.jsx(je,{open:n,onComplete:d,selectedInstallation:b,onSelectInstallation:C,onImportComplete:r,mode:p})})}),e[8]=p,e[9]=r,e[10]=n,e[11]=b,e[12]=d,e[13]=m):m=e[13];let a;e[14]!==j||e[15]!==u||e[16]!==m?(a=t.jsxs(oe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,m]}),e[14]=j,e[15]=u,e[16]=m,e[17]=a):a=e[17];let f;return e[18]!==i||e[19]!==n||e[20]!==a?(f=t.jsx(ie,{open:n,onOpenChange:i,children:a}),e[18]=i,e[19]=n,e[20]=a,e[21]=f):f=e[21],f}function je({open:y,onComplete:e,selectedInstallation:n,onSelectInstallation:i,onImportComplete:h,mode:r="agent"}){const{org:o}=F(),p=M(),c=fe(),[b,C]=T.useState(null),j=ae({slug:"mcp-github"}),u=xe(j),l=ye({enabled:y&&u.length===0}),d=u.length===1?u[0]??null:b,m=L({connectionId:d?.id??"",orgId:o.id,orgSlug:o.slug}),a=L({connectionId:V,orgId:o.id,orgSlug:o.slug}),f=async(s,v)=>{try{const _=await m.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:v}});if(_.isError)return null;const I=_.content?.find(g=>g.type==="resource")?.resource?.text;if(!I)return null;try{const g=JSON.parse(I);return typeof g=="string"?g:JSON.stringify(g)}catch{return I}}catch{return null}},N=(s,v)=>{Promise.all([f(v,"AGENTS.md"),f(v,"CLAUDE.md")]).then(async([S,_])=>{const w=S??_??null;w&&(await a.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:w}}}}),H(p,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},x=B({mutationFn:async s=>{if(!d||!n)throw new Error("No GitHub connection or installation");const v=n.installationId;if(r==="connection"){const{childConnectionId:w}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:I=>m.callTool(I),selfCallTool:I=>a.callTool(I),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:w,item:null}}const{childConnectionId:S}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:w=>m.callTool(w),selfCallTool:w=>a.callTool(w)});let _=null;try{const w=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s.name,description:s.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:s.owner,name:s.name,url:s.url,installationId:v,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),I=w.structuredContent??w,g=I.item?.id;if(!I.item||!g)throw new Error("Failed to create the imported agent");return _=g,{virtualMcpId:g,repo:s,connectionId:S,item:I.item}}catch(w){throw _&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:_}}).catch(()=>{}),await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),w}},onSuccess:({virtualMcpId:s,repo:v,connectionId:S,item:_})=>{if(r==="connection"||!s||!_){H(p,o.id),W(p,o.id),U.success(`Added ${v.name}`),e();return}if(p.setQueryData(R.collectionItem(a,o.id,"","VIRTUAL_MCP",s),{item:_}),H(p,o.id),N(s,v),h){h({virtualMcpId:s,repo:v,connectionId:S});return}U.success(`Imported ${v.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(s)},onError:s=>{U.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return l.status==="installing"||l.status==="authenticating"?t.jsx($,{status:l.status,error:null,retry:l.retry}):l.status==="error"?t.jsx($,{status:"error",error:l.error,retry:l.retry}):u.length===0&&l.status==="idle"?t.jsx($,{status:"installing",error:null,retry:l.retry}):u.length>1&&!d?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(s=>t.jsxs("button",{type:"button",onClick:()=>C(s),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?t.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(G,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}):d?n?t.jsx(we,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>x.mutate(s),isSaving:x.isPending}):t.jsx(Ne,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,onSelect:i,showBackButton:u.length>1,onBack:()=>C(null)}):null}function Ne(y){const e=A.c(47),{connectionId:n,orgId:i,orgSlug:h,onSelect:r,showBackButton:o,onBack:p}=y;let c;e[0]!==i||e[1]!==h?(c={connectionId:V,orgId:i,orgSlug:h},e[0]=i,e[1]=h,e[2]=c):c=e[2];const b=L(c),C=M(),j=Q();let u;e[3]!==n||e[4]!==i?(u=R.githubUserOrgs(i,n),e[3]=n,e[4]=i,e[5]=u):u=e[5];let l;e[6]!==n||e[7]!==b?(l=()=>ge(g=>b.callTool(g),n),e[6]=n,e[7]=b,e[8]=l):l=e[8];let d;e[9]!==u||e[10]!==l?(d={queryKey:u,queryFn:l},e[9]=u,e[10]=l,e[11]=d):d=e[11];const m=X(d);let a;e[12]!==j||e[13]!==n||e[14]!==m||e[15]!==i||e[16]!==h||e[17]!==C?(a={mutationFn:async()=>{const g=await K({connectionId:n,orgId:i,orgSlug:h,persistFallback:E=>j.update.mutateAsync({id:n,data:{connection_token:E}}).then(Ce)});if(g.ran&&!g.ok)throw new Error(g.error??"no token received");const k=new URL(`/api/${h}/mcp/${n}`,window.location.origin);await C.invalidateQueries({queryKey:R.isMCPAuthenticated(k.href,null)}),await C.invalidateQueries({queryKey:R.mcpClientPrefix()}),await m.refetch()},onError:ve},e[12]=j,e[13]=n,e[14]=m,e[15]=i,e[16]=h,e[17]=C,e[18]=a):a=e[18];const f=B(a);if(m.isLoading){let g;return e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=g):g=e[19],g}if(m.isError){let g,k;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),k=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=g,e[21]=k):(g=e[20],k=e[21]);let E;e[22]!==f?(E=()=>f.mutate(),e[22]=f,e[23]=E):E=e[23];let P;e[24]!==f.isPending?(P=f.isPending?t.jsx(z,{size:14,className:"animate-spin"}):t.jsx(G,{className:"size-3.5"}),e[24]=f.isPending,e[25]=P):P=e[25];let O;return e[26]!==f.isPending||e[27]!==E||e[28]!==P?(O=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[g,k,t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:E,disabled:f.isPending,children:[P,"Reconnect GitHub"]})]}),e[26]=f.isPending,e[27]=E,e[28]=P,e[29]=O):O=e[29],O}const N=m.data;if(!N)return null;let x;e[30]!==p||e[31]!==o?(x=o&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:p,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(J,{size:12}),"Change connection"]})}),e[30]=p,e[31]=o,e[32]=x):x=e[32];let s;if(e[33]!==N.installations||e[34]!==r){let g;e[36]!==r?(g=k=>t.jsxs("button",{type:"button",onClick:()=>r(k),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:k.avatarUrl,alt:k.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:k.login}),k.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},k.installationId),e[36]=r,e[37]=g):g=e[37],s=N.installations.map(g),e[33]=N.installations,e[34]=r,e[35]=s}else s=e[35];let v;e[38]!==s?(v=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=v):v=e[39];const S=N.appSlug?`https://github.com/apps/${N.appSlug}/installations/new`:"https://github.com/settings/installations";let _;e[40]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=_):_=e[40];let w;e[41]!==S?(w=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",_]})}),e[41]=S,e[42]=w):w=e[42];let I;return e[43]!==w||e[44]!==x||e[45]!==v?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x,v,w]}),e[43]=w,e[44]=x,e[45]=v,e[46]=I):I=e[46],I}function ve(y){U.error("Failed to reconnect GitHub: "+(y instanceof Error?y.message:"Unknown error"))}function Ce(){}function we(y){const e=A.c(20),{connectionId:n,orgId:i,orgSlug:h,installation:r,onSelectRepo:o,isSaving:p}=y,[c,b]=T.useState(""),C=re(c,300),j=T.useDeferredValue(C),u=c!==j;let l;e[0]!==u||e[1]!==c?(l=t.jsx(le,{placeholder:"Search repositories...",value:c,onChange:b,isSearching:u}),e[0]=u,e[1]=c,e[2]=l):l=e[2];const d=u?"opacity-40":"opacity-100";let m;e[3]!==d?(m=D("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",d),e[3]=d,e[4]=m):m=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=a):a=e[5];let f;e[6]!==n||e[7]!==j||e[8]!==r||e[9]!==p||e[10]!==o||e[11]!==i||e[12]!==h?(f=t.jsx(T.Suspense,{fallback:a,children:t.jsx(Se,{connectionId:n,orgId:i,orgSlug:h,installation:r,query:j,onSelectRepo:o,isSaving:p})}),e[6]=n,e[7]=j,e[8]=r,e[9]=p,e[10]=o,e[11]=i,e[12]=h,e[13]=f):f=e[13];let N;e[14]!==m||e[15]!==f?(N=t.jsx("div",{className:m,children:f}),e[14]=m,e[15]=f,e[16]=N):N=e[16];let x;return e[17]!==l||e[18]!==N?(x=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l,N]}),e[17]=l,e[18]=N,e[19]=x):x=e[19],x}function Se(y){const e=A.c(29),{connectionId:n,orgId:i,orgSlug:h,installation:r,query:o,onSelectRepo:p,isSaving:c}=y;let b;e[0]!==n||e[1]!==i||e[2]!==h?(b={connectionId:n,orgId:i,orgSlug:h},e[0]=n,e[1]=i,e[2]=h,e[3]=b):b=e[3];const C=L(b),j=r.type==="User"?"user":"org",u=o?`${j}:${r.login} ${o} in:name`:`${j}:${r.login}`;let l;e[4]!==n||e[5]!==r.login||e[6]!==i||e[7]!==o?(l=R.githubOrgRepos(i,n,r.login,o),e[4]=n,e[5]=r.login,e[6]=i,e[7]=o,e[8]=l):l=e[8];let d;e[9]!==C||e[10]!==u?(d=async x=>{const{signal:s}=x,S=(await C.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:30}},void 0,{signal:s})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(Ie)},e[9]=C,e[10]=u,e[11]=d):d=e[11];let m;e[12]!==l||e[13]!==d?(m={queryKey:l,queryFn:d},e[12]=l,e[13]=d,e[14]=m):m=e[14];const{data:a}=ee(m);if(a.length===0){let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=x):x=e[15];let s;e[16]!==o?(s=o&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=o,e[17]=s):s=e[17];let v;return e[18]!==s?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[x,s]}),e[18]=s,e[19]=v):v=e[19],v}let f;if(e[20]!==c||e[21]!==p||e[22]!==a){let x;e[24]!==c||e[25]!==p?(x=s=>t.jsxs("button",{type:"button",onClick:()=>p(s),disabled:c,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(G,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:s.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[s.private?t.jsx(te,{size:10}):t.jsx(ue,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=c,e[25]=p,e[26]=x):x=e[26],f=a.map(x),e[20]=c,e[21]=p,e[22]=a,e[23]=f}else f=e[23];let N;return e[27]!==f?(N=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:f}),e[27]=f,e[28]=N):N=e[28],N}function Ie(y){return{name:y.name,fullName:y.full_name,owner:y.full_name.split("/")[0]??"",url:y.html_url,private:y.private,description:y.description,updatedAt:y.updated_at}}function $(y){const e=A.c(33),{status:n,error:i,retry:h}=y;if(n==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=_):_=e[1];const w=i??"Something went wrong while connecting to GitHub.";let I;e[2]!==w?(I=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[_,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:w})]}),e[2]=w,e[3]=I):I=e[3];let g;e[4]!==h?(g=t.jsx("button",{type:"button",onClick:h,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=h,e[5]=g):g=e[5];let k;return e[6]!==I||e[7]!==g?(k=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,I,g]}),e[6]=I,e[7]=g,e[8]=k):k=e[8],k}const r=n==="authenticating";let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-foreground"})}),e[9]=o):o=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=p):p=e[10];const c=r?"Authenticating with GitHub":"Setting up GitHub";let b;e[11]!==c?(b=t.jsx("p",{className:"text-sm font-medium",children:c}),e[11]=c,e[12]=b):b=e[12];const C=r?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==C?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:C}),e[13]=C,e[14]=j):j=e[14];let u;e[15]!==b||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[b,j]}),e[15]=b,e[16]=j,e[17]=u):u=e[17];const l=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let d;e[18]!==l?(d=D("size-1.5 rounded-full",l),e[18]=l,e[19]=d):d=e[19];let m;e[20]!==d?(m=t.jsx("span",{className:d}),e[20]=d,e[21]=m):m=e[21];const a=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let f;e[22]!==a?(f=D("size-1.5 rounded-full",a),e[22]=a,e[23]=f):f=e[23];let N;e[24]!==f?(N=t.jsx("span",{className:f}),e[24]=f,e[25]=N):N=e[25];let x;e[26]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=x):x=e[26];let s;e[27]!==m||e[28]!==N?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[m,N,x]}),e[27]=m,e[28]=N,e[29]=s):s=e[29];let v;return e[30]!==s||e[31]!==u?(v=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[p,u,s]}),e[30]=s,e[31]=u,e[32]=v):v=e[32],v}export{De as G,G as a,ye as b,he as u};
1
+ import{c as A,j as t,C as F,a as Y,n as M,r as T,ac as H,i as z,d as B,t as U,dH as W,K as R,m as X,B as Z,l as D,v as ee,w as te}from"./index-VAFj6NMG.js";import{D as ne,a as se,d as oe,e as ie}from"./dialog-BVSdiefE.js";import{C as le}from"./collection-search-CV4YVGrV.js";import{u as re}from"./use-debounced-value-_bqtnC16.js";import{b as Q,u as ae}from"./use-connection-Bk4XRvd-.js";import{u as L}from"./use-mcp-client-BCL0dZx5.js";import{W as ce,S as V}from"./constants-D_FQAPnt.js";import{a as K}from"./authenticate-and-persist-oauth-Bto5puML.js";import{b as J}from"./Settings02-Dd7RAl0e.js";import{I as ue}from"./agent-icon-Cw3mD2cs.js";import{u as de}from"./use-mcp-tools-B3a-bMRx.js";import{e as me}from"./extract-connection-data-B-pGdegm.js";import{c as fe}from"./use-navigate-to-agent-pAAaXmeF.js";import{g as xe,p as q,f as ge}from"./provision-repo-scoped-github-connection-CB4ICKHq.js";function G(y){const e=A.c(4),{size:n,className:i}=y;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=h):h=e[0];let r;return e[1]!==i||e[2]!==n?(r=t.jsx("svg",{width:n,height:n,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:i,children:h}),e[1]=i,e[2]=n,e[3]=r):r=e[3],r}function he(y,e){const n=A.c(12),{org:i}=F();let h;n[0]!==i.id?(h=ce.REGISTRY(i.id),n[0]=i.id,n[1]=h):h=n[1];const r=h;let o;n[2]!==i.id||n[3]!==i.slug||n[4]!==r?(o={connectionId:r,orgId:i.id,orgSlug:i.slug},n[2]=i.id,n[3]=i.slug,n[4]=r,n[5]=o):o=n[5];const p=L(o);let c;n[6]!==y?(c={name:y},n[6]=y,n[7]=c):c=n[7];const b=e?.enabled??!0;let C;return n[8]!==p||n[9]!==c||n[10]!==b?(C={client:p,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:c,enabled:b,staleTime:3e5,select:pe},n[8]=p,n[9]=c,n[10]=b,n[11]=C):C=n[11],de(C)}function pe(y){return y.structuredContent?.item??null}const be="deco/mcp-github";function ye(y){const{org:e}=F(),{data:n}=Y.useSession(),i=Q(),h=M(),[r,o]=T.useState("idle"),[p,c]=T.useState(null),[b,C]=T.useState(null),{data:j,isLoading:u}=he(be,{enabled:y.enabled}),l=T.useRef(!1);y.enabled&&j&&!u&&!l.current&&n?.user?.id&&r==="idle"&&(l.current=!0,d());async function d(){if(!(!j||!n?.user?.id||!e))try{o("installing"),c(null);const a=me(j,e.id,n.user.id,{remoteIndex:0});if(!a.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:N}=await i.create.mutateAsync(a);o("authenticating");const x=await K({connectionId:N,orgId:e.id,orgSlug:e.slug,persistFallback:s=>i.update.mutateAsync({id:N,data:{connection_token:s}}).then(()=>{})});if(x.ran&&!x.ok){try{await i.delete.mutateAsync(N)}catch{}throw new Error(x.error&&x.error!=="no token received"?x.error:"No token received from GitHub")}H(h,e.id),C(a),o("ready")}catch(a){c(a instanceof Error?a.message:String(a)),o("error")}}function m(){o("idle"),c(null),C(null),l.current=!1}return y.enabled&&u&&r==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:r,error:p,connection:b,retry:m}}function De(y){const e=A.c(22),{open:n,onOpenChange:i,title:h,onImportComplete:r,mode:o}=y,p=o===void 0?"agent":o,c=h??(p==="connection"?"Add repo":"Import from GitHub"),[b,C]=T.useState(null);let j;e[0]!==c?(j=t.jsx(ne,{className:"sr-only",children:t.jsx(se,{children:c})}),e[0]=c,e[1]=j):j=e[1];let u;e[2]!==c||e[3]!==b?(u=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:b?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>C(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Back to accounts",children:t.jsx(J,{size:16})}),t.jsx("img",{src:b.avatarUrl,alt:b.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:b.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(G,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:c})]})}),e[2]=c,e[3]=b,e[4]=u):u=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=l):l=e[5];let d;e[6]!==i?(d=()=>i(!1),e[6]=i,e[7]=d):d=e[7];let m;e[8]!==p||e[9]!==r||e[10]!==n||e[11]!==b||e[12]!==d?(m=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(T.Suspense,{fallback:l,children:t.jsx(je,{open:n,onComplete:d,selectedInstallation:b,onSelectInstallation:C,onImportComplete:r,mode:p})})}),e[8]=p,e[9]=r,e[10]=n,e[11]=b,e[12]=d,e[13]=m):m=e[13];let a;e[14]!==j||e[15]!==u||e[16]!==m?(a=t.jsxs(oe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[j,u,m]}),e[14]=j,e[15]=u,e[16]=m,e[17]=a):a=e[17];let f;return e[18]!==i||e[19]!==n||e[20]!==a?(f=t.jsx(ie,{open:n,onOpenChange:i,children:a}),e[18]=i,e[19]=n,e[20]=a,e[21]=f):f=e[21],f}function je({open:y,onComplete:e,selectedInstallation:n,onSelectInstallation:i,onImportComplete:h,mode:r="agent"}){const{org:o}=F(),p=M(),c=fe(),[b,C]=T.useState(null),j=ae({slug:"mcp-github"}),u=xe(j),l=ye({enabled:y&&u.length===0}),d=u.length===1?u[0]??null:b,m=L({connectionId:d?.id??"",orgId:o.id,orgSlug:o.slug}),a=L({connectionId:V,orgId:o.id,orgSlug:o.slug}),f=async(s,v)=>{try{const _=await m.callTool({name:"get_file_contents",arguments:{owner:s.owner,repo:s.name,path:v}});if(_.isError)return null;const I=_.content?.find(g=>g.type==="resource")?.resource?.text;if(!I)return null;try{const g=JSON.parse(I);return typeof g=="string"?g:JSON.stringify(g)}catch{return I}}catch{return null}},N=(s,v)=>{Promise.all([f(v,"AGENTS.md"),f(v,"CLAUDE.md")]).then(async([S,_])=>{const w=S??_??null;w&&(await a.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{metadata:{instructions:w}}}}),H(p,o.id))}).catch(S=>{console.error("GitHub instructions fetch failed:",S)})},x=B({mutationFn:async s=>{if(!d||!n)throw new Error("No GitHub connection or installation");const v=n.installationId;if(r==="connection"){const{childConnectionId:w}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:I=>m.callTool(I),selfCallTool:I=>a.callTool(I),orgShared:!0});return{virtualMcpId:null,repo:s,connectionId:w,item:null}}const{childConnectionId:S}=await q({orgSlug:o.slug,sourceConnection:d,installationId:v,owner:s.owner,repo:s.name,githubCallTool:w=>m.callTool(w),selfCallTool:w=>a.callTool(w)});let _=null;try{const w=await a.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:s.name,description:s.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:s.owner,name:s.name,url:s.url,installationId:v,connectionId:S},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:S}]}}}),I=w.structuredContent??w,g=I.item?.id;if(!I.item||!g)throw new Error("Failed to create the imported agent");return _=g,{virtualMcpId:g,repo:s,connectionId:S,item:I.item}}catch(w){throw _&&await a.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:_}}).catch(()=>{}),await a.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:S,force:!0}}).catch(()=>{}),w}},onSuccess:({virtualMcpId:s,repo:v,connectionId:S,item:_})=>{if(r==="connection"||!s||!_){H(p,o.id),W(p,o.id),U.success(`Added ${v.name}`),e();return}if(p.setQueryData(R.collectionItem(a,o.id,"","VIRTUAL_MCP",s),{item:_}),H(p,o.id),N(s,v),h){h({virtualMcpId:s,repo:v,connectionId:S});return}U.success(`Imported ${v.name} from GitHub`),e(),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(s)},onError:s=>{U.error("Failed to import repo: "+(s instanceof Error?s.message:"Unknown error"))}});return l.status==="installing"||l.status==="authenticating"?t.jsx($,{status:l.status,error:null,retry:l.retry}):l.status==="error"?t.jsx($,{status:"error",error:l.error,retry:l.retry}):u.length===0&&l.status==="idle"?t.jsx($,{status:"installing",error:null,retry:l.retry}):u.length>1&&!d?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a connection"})}),u.map(s=>t.jsxs("button",{type:"button",onClick:()=>C(s),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[s.icon?t.jsx("img",{src:s.icon,alt:s.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(G,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:s.title})]},s.id))]}):d?n?t.jsx(we,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,installation:n,onSelectRepo:s=>x.mutate(s),isSaving:x.isPending}):t.jsx(Ne,{connectionId:d.id,orgId:o.id,orgSlug:o.slug,onSelect:i,showBackButton:u.length>1,onBack:()=>C(null)}):null}function Ne(y){const e=A.c(47),{connectionId:n,orgId:i,orgSlug:h,onSelect:r,showBackButton:o,onBack:p}=y;let c;e[0]!==i||e[1]!==h?(c={connectionId:V,orgId:i,orgSlug:h},e[0]=i,e[1]=h,e[2]=c):c=e[2];const b=L(c),C=M(),j=Q();let u;e[3]!==n||e[4]!==i?(u=R.githubUserOrgs(i,n),e[3]=n,e[4]=i,e[5]=u):u=e[5];let l;e[6]!==n||e[7]!==b?(l=()=>ge(g=>b.callTool(g),n),e[6]=n,e[7]=b,e[8]=l):l=e[8];let d;e[9]!==u||e[10]!==l?(d={queryKey:u,queryFn:l},e[9]=u,e[10]=l,e[11]=d):d=e[11];const m=X(d);let a;e[12]!==j||e[13]!==n||e[14]!==m||e[15]!==i||e[16]!==h||e[17]!==C?(a={mutationFn:async()=>{const g=await K({connectionId:n,orgId:i,orgSlug:h,persistFallback:E=>j.update.mutateAsync({id:n,data:{connection_token:E}}).then(Ce)});if(g.ran&&!g.ok)throw new Error(g.error??"no token received");const k=new URL(`/api/${h}/mcp/${n}`,window.location.origin);await C.invalidateQueries({queryKey:R.isMCPAuthenticated(k.href,null)}),await C.invalidateQueries({queryKey:R.mcpClientPrefix()}),await m.refetch()},onError:ve},e[12]=j,e[13]=n,e[14]=m,e[15]=i,e[16]=h,e[17]=C,e[18]=a):a=e[18];const f=B(a);if(m.isLoading){let g;return e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[19]=g):g=e[19],g}if(m.isError){let g,k;e[20]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("p",{className:"text-sm text-destructive",children:"Failed to load GitHub accounts"}),k=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:"Your GitHub connection may have expired. Reconnect to restore access."}),e[20]=g,e[21]=k):(g=e[20],k=e[21]);let E;e[22]!==f?(E=()=>f.mutate(),e[22]=f,e[23]=E):E=e[23];let P;e[24]!==f.isPending?(P=f.isPending?t.jsx(z,{size:14,className:"animate-spin"}):t.jsx(G,{className:"size-3.5"}),e[24]=f.isPending,e[25]=P):P=e[25];let O;return e[26]!==f.isPending||e[27]!==E||e[28]!==P?(O=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[g,k,t.jsxs(Z,{type:"button",variant:"outline",size:"sm",onClick:E,disabled:f.isPending,children:[P,"Reconnect GitHub"]})]}),e[26]=f.isPending,e[27]=E,e[28]=P,e[29]=O):O=e[29],O}const N=m.data;if(!N)return null;let x;e[30]!==p||e[31]!==o?(x=o&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:p,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(J,{size:12}),"Change connection"]})}),e[30]=p,e[31]=o,e[32]=x):x=e[32];let s;if(e[33]!==N.installations||e[34]!==r){let g;e[36]!==r?(g=k=>t.jsxs("button",{type:"button",onClick:()=>r(k),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:k.avatarUrl,alt:k.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:k.login}),k.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"Personal account"})]}),t.jsx("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:"Select →"})]},k.installationId),e[36]=r,e[37]=g):g=e[37],s=N.installations.map(g),e[33]=N.installations,e[34]=r,e[35]=s}else s=e[35];let v;e[38]!==s?(v=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:s}),e[38]=s,e[39]=v):v=e[39];const S=N.appSlug?`https://github.com/apps/${N.appSlug}/installations/new`:"https://github.com/settings/installations";let _;e[40]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("span",{className:"underline underline-offset-2",children:"Install the GitHub App"}),e[40]=_):_=e[40];let w;e[41]!==S?(w=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:S,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:["Account not listed?"," ",_]})}),e[41]=S,e[42]=w):w=e[42];let I;return e[43]!==w||e[44]!==x||e[45]!==v?(I=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x,v,w]}),e[43]=w,e[44]=x,e[45]=v,e[46]=I):I=e[46],I}function ve(y){U.error("Failed to reconnect GitHub: "+(y instanceof Error?y.message:"Unknown error"))}function Ce(){}function we(y){const e=A.c(20),{connectionId:n,orgId:i,orgSlug:h,installation:r,onSelectRepo:o,isSaving:p}=y,[c,b]=T.useState(""),C=re(c,300),j=T.useDeferredValue(C),u=c!==j;let l;e[0]!==u||e[1]!==c?(l=t.jsx(le,{placeholder:"Search repositories...",value:c,onChange:b,isSearching:u}),e[0]=u,e[1]=c,e[2]=l):l=e[2];const d=u?"opacity-40":"opacity-100";let m;e[3]!==d?(m=D("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",d),e[3]=d,e[4]=m):m=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(z,{size:18,className:"animate-spin text-muted-foreground"})}),e[5]=a):a=e[5];let f;e[6]!==n||e[7]!==j||e[8]!==r||e[9]!==p||e[10]!==o||e[11]!==i||e[12]!==h?(f=t.jsx(T.Suspense,{fallback:a,children:t.jsx(Se,{connectionId:n,orgId:i,orgSlug:h,installation:r,query:j,onSelectRepo:o,isSaving:p})}),e[6]=n,e[7]=j,e[8]=r,e[9]=p,e[10]=o,e[11]=i,e[12]=h,e[13]=f):f=e[13];let N;e[14]!==m||e[15]!==f?(N=t.jsx("div",{className:m,children:f}),e[14]=m,e[15]=f,e[16]=N):N=e[16];let x;return e[17]!==l||e[18]!==N?(x=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[l,N]}),e[17]=l,e[18]=N,e[19]=x):x=e[19],x}function Se(y){const e=A.c(29),{connectionId:n,orgId:i,orgSlug:h,installation:r,query:o,onSelectRepo:p,isSaving:c}=y;let b;e[0]!==n||e[1]!==i||e[2]!==h?(b={connectionId:n,orgId:i,orgSlug:h},e[0]=n,e[1]=i,e[2]=h,e[3]=b):b=e[3];const C=L(b),j=r.type==="User"?"user":"org",u=o?`${j}:${r.login} ${o} in:name`:`${j}:${r.login}`;let l;e[4]!==n||e[5]!==r.login||e[6]!==i||e[7]!==o?(l=R.githubOrgRepos(i,n,r.login,o),e[4]=n,e[5]=r.login,e[6]=i,e[7]=o,e[8]=l):l=e[8];let d;e[9]!==C||e[10]!==u?(d=async x=>{const{signal:s}=x,S=(await C.callTool({name:"search_repositories",arguments:{query:u,page:1,perPage:30}},void 0,{signal:s})).content?.[0]?.text;if(!S)throw new Error("No response from search_repositories");return(JSON.parse(S).items??[]).map(Ie)},e[9]=C,e[10]=u,e[11]=d):d=e[11];let m;e[12]!==l||e[13]!==d?(m={queryKey:l,queryFn:d},e[12]=l,e[13]=d,e[14]=m):m=e[14];const{data:a}=ee(m);if(a.length===0){let x;e[15]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("p",{className:"text-sm text-muted-foreground",children:"No repositories found"}),e[15]=x):x=e[15];let s;e[16]!==o?(s=o&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:"Try a different search term"}),e[16]=o,e[17]=s):s=e[17];let v;return e[18]!==s?(v=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[x,s]}),e[18]=s,e[19]=v):v=e[19],v}let f;if(e[20]!==c||e[21]!==p||e[22]!==a){let x;e[24]!==c||e[25]!==p?(x=s=>t.jsxs("button",{type:"button",onClick:()=>p(s),disabled:c,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(G,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsx("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:t.jsx("span",{className:"text-sm font-medium truncate",children:s.name})}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[s.private?t.jsx(te,{size:10}):t.jsx(ue,{size:10}),s.private?"Private":"Public"]})]},s.fullName),e[24]=c,e[25]=p,e[26]=x):x=e[26],f=a.map(x),e[20]=c,e[21]=p,e[22]=a,e[23]=f}else f=e[23];let N;return e[27]!==f?(N=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:f}),e[27]=f,e[28]=N):N=e[28],N}function Ie(y){return{name:y.name,fullName:y.full_name,owner:y.full_name.split("/")[0]??"",url:y.html_url,private:y.private,description:y.description,updatedAt:y.updated_at}}function $(y){const e=A.c(33),{status:n,error:i,retry:h}=y;if(n==="error"){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-destructive"})}),e[0]=S):S=e[0];let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("p",{className:"text-sm font-medium",children:"Connection failed"}),e[1]=_):_=e[1];const w=i??"Something went wrong while connecting to GitHub.";let I;e[2]!==w?(I=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[_,t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:w})]}),e[2]=w,e[3]=I):I=e[3];let g;e[4]!==h?(g=t.jsx("button",{type:"button",onClick:h,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:"Try again"}),e[4]=h,e[5]=g):g=e[5];let k;return e[6]!==I||e[7]!==g?(k=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[S,I,g]}),e[6]=I,e[7]=g,e[8]=k):k=e[8],k}const r=n==="authenticating";let o;e[9]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(G,{className:"size-5 text-foreground"})}),e[9]=o):o=e[9];let p;e[10]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(z,{size:12,className:"animate-spin text-muted-foreground"})})]}),e[10]=p):p=e[10];const c=r?"Authenticating with GitHub":"Setting up GitHub";let b;e[11]!==c?(b=t.jsx("p",{className:"text-sm font-medium",children:c}),e[11]=c,e[12]=b):b=e[12];const C=r?"Complete the OAuth flow in your browser":"Installing the GitHub connection...";let j;e[13]!==C?(j=t.jsx("p",{className:"text-xs text-muted-foreground",children:C}),e[13]=C,e[14]=j):j=e[14];let u;e[15]!==b||e[16]!==j?(u=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[b,j]}),e[15]=b,e[16]=j,e[17]=u):u=e[17];const l=r?"bg-muted-foreground/30":"bg-foreground animate-pulse";let d;e[18]!==l?(d=D("size-1.5 rounded-full",l),e[18]=l,e[19]=d):d=e[19];let m;e[20]!==d?(m=t.jsx("span",{className:d}),e[20]=d,e[21]=m):m=e[21];const a=r?"bg-foreground animate-pulse":"bg-muted-foreground/30";let f;e[22]!==a?(f=D("size-1.5 rounded-full",a),e[22]=a,e[23]=f):f=e[23];let N;e[24]!==f?(N=t.jsx("span",{className:f}),e[24]=f,e[25]=N):N=e[25];let x;e[26]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[26]=x):x=e[26];let s;e[27]!==m||e[28]!==N?(s=t.jsxs("div",{className:"flex items-center gap-1.5",children:[m,N,x]}),e[27]=m,e[28]=N,e[29]=s):s=e[29];let v;return e[30]!==s||e[31]!==u?(v=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[p,u,s]}),e[30]=s,e[31]=u,e[32]=v):v=e[32],v}export{De as G,G as a,ye as b,he as u};