decocms 4.82.13 → 4.82.14

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 (276) hide show
  1. package/dist/client/assets/{AlertCircle-B6AELEdc.js → AlertCircle-DvPByT3s.js} +1 -1
  2. package/dist/client/assets/{AreaChart-fCNs67j_.js → AreaChart-BtYig8Ye.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-YK2fJPgi.js → ArrowUp-Dh74oxmM.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-BKVLcZTe.js → ArrowUpRight-DC6Yb9Jn.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-BfxYbuVE.js → CheckCircle-Be2POQuF.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-CQLSXgt3.js → ChevronDown-BE7JvSpD.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-Fgy0rUS_.js → ChevronRight-4-DNv2jL.js} +1 -1
  8. package/dist/client/assets/ChevronUp-Bwx_DvAp.js +1 -0
  9. package/dist/client/assets/{Copy01-B0CQRE_5.js → Copy01-CaaZXEMR.js} +1 -1
  10. package/dist/client/assets/DotsVertical-hH1ie9LK.js +1 -0
  11. package/dist/client/assets/{Eye-CLtdCpUf.js → Eye-s3MCo34O.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DeiGsRZY.js → FilterLines-B8M_kRrg.js} +1 -1
  13. package/dist/client/assets/{Globe01-B52VKYy7.js → Globe01-BNvAFZ7t.js} +1 -1
  14. package/dist/client/assets/{Globe04-B0las6Jv.js → Globe04-B8fLlHyp.js} +1 -1
  15. package/dist/client/assets/{HardDrive-CU-vvmKE.js → HardDrive-DDRUuRUd.js} +1 -1
  16. package/dist/client/assets/{Image01-B-FQwXx8.js → Image01-DxLV4xvs.js} +1 -1
  17. package/dist/client/assets/{Key01-myvTSA8u.js → Key01-Cq8uChmI.js} +1 -1
  18. package/dist/client/assets/{LayoutLeft-C0g0LezP.js → LayoutLeft-riUBpORF.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-d9EixhiS.js → LinkExternal01-DU3CPyqq.js} +1 -1
  20. package/dist/client/assets/{Monitor01-BkDBzdlH.js → Monitor01-0ngeB4wd.js} +1 -1
  21. package/dist/client/assets/{Package-eNacrLmv.js → Package-BrNfAbz_.js} +1 -1
  22. package/dist/client/assets/{Palette-BiKqXWvc.js → Palette-CtgW-PAY.js} +1 -1
  23. package/dist/client/assets/{Play-CdkPhmTs.js → Play-CdZJWvJx.js} +1 -1
  24. package/dist/client/assets/{Plus-DWjKZ2wj.js → Plus-Ca4hMAKt.js} +1 -1
  25. package/dist/client/assets/{SearchLg-DBOWvxyl.js → SearchLg-BGyV5Bz4.js} +1 -1
  26. package/dist/client/assets/{SearchMd-CKteZWzZ.js → SearchMd-CFTyyPmA.js} +1 -1
  27. package/dist/client/assets/{Settings02-CM0Uzs0U.js → Settings02-BIuCsH3l.js} +1 -1
  28. package/dist/client/assets/{Shield01-aDvWVv5Z.js → Shield01-DdJSxLoT.js} +1 -1
  29. package/dist/client/assets/{Star01-B-8espqJ.js → Star01-Dg6BZrlI.js} +1 -1
  30. package/dist/client/assets/{Stars01-DsfblQf3.js → Stars01-wVvTShj4.js} +1 -1
  31. package/dist/client/assets/{Stars02-DBH33Ez2.js → Stars02-BF8YOJhr.js} +1 -1
  32. package/dist/client/assets/{Sun-MvOAGgKN.js → Sun-Cd6pfpZ3.js} +1 -1
  33. package/dist/client/assets/{SwitchHorizontal01-DUrn8gXV.js → SwitchHorizontal01-T7cYMNoP.js} +1 -1
  34. package/dist/client/assets/{Tool01-4pit7qOS.js → Tool01-BDwVCBnM.js} +1 -1
  35. package/dist/client/assets/{Tool02-tJKj7JcW.js → Tool02-DjIBln53.js} +1 -1
  36. package/dist/client/assets/{Trash01-DEWgFvvg.js → Trash01-CxvmthNE.js} +1 -1
  37. package/dist/client/assets/TrendUp01-DdL0oR_B.js +1 -0
  38. package/dist/client/assets/{Upload01-C8RP0Fvq.js → Upload01-w4HjmReL.js} +1 -1
  39. package/dist/client/assets/{User01-v0Bqr3nA.js → User01-0Zd0134v.js} +1 -1
  40. package/dist/client/assets/{Users01-CPNZ7uMu.js → Users01-j-t-q-sR.js} +1 -1
  41. package/dist/client/assets/{Users03-WVYBBENu.js → Users03-BpRSYTYN.js} +1 -1
  42. package/dist/client/assets/{X-Dm6kY_ek.js → X--0kJVtau.js} +1 -1
  43. package/dist/client/assets/{XCircle-cwYbcP7y.js → XCircle-CWZBOndb.js} +1 -1
  44. package/dist/client/assets/{XClose-DnNyN9T-.js → XClose-CFj_hbve.js} +1 -1
  45. package/dist/client/assets/{Zap-CNRURtEh.js → Zap-BfGgAuT1.js} +1 -1
  46. package/dist/client/assets/{ZapSquare-Dj8pa8Fg.js → ZapSquare-CS1YImRf.js} +1 -1
  47. package/dist/client/assets/{ZoomOut-_psBJlXD.js → ZoomOut-DBunTdui.js} +1 -1
  48. package/dist/client/assets/{access-gate-CPecvlS5.js → access-gate-C3Jf69ZD.js} +1 -1
  49. package/dist/client/assets/{add-section-modal-CcLBxmBX.js → add-section-modal-Ca2kfOel.js} +1 -1
  50. package/dist/client/assets/agent-icon-BdMdPyH8.js +1 -0
  51. package/dist/client/assets/agents-list-s5b3COYS.js +1 -0
  52. package/dist/client/assets/ai-providers-DAXq9GNP.js +1 -0
  53. package/dist/client/assets/{alert-dialog-3VMQ65hF.js → alert-dialog-BjP2s6Nc.js} +1 -1
  54. package/dist/client/assets/{alert-XkDwazoe.js → alert-sYi6c8L0.js} +1 -1
  55. package/dist/client/assets/app-editor-lqTV057s.js +1 -0
  56. package/dist/client/assets/{auth-dSVlMQ86.js → auth-DWUY37QO.js} +1 -1
  57. package/dist/client/assets/{auth-catchall-BVp4zpOf.js → auth-catchall-4BdHIsfs.js} +1 -1
  58. package/dist/client/assets/{auth-entry-C48ylSC_.js → auth-entry-CbO-WTGZ.js} +1 -1
  59. package/dist/client/assets/{auth-split-layout-dbrXw6Uq.js → auth-split-layout-Cunbbv7Y.js} +1 -1
  60. package/dist/client/assets/{authenticate-and-persist-oauth-BHT9Kp62.js → authenticate-and-persist-oauth-tVxGkZPI.js} +1 -1
  61. package/dist/client/assets/{automation-list-row-PkSpkeID.js → automation-list-row-Bx2czjnJ.js} +1 -1
  62. package/dist/client/assets/automation-runs-CvOQZBIo.js +87 -0
  63. package/dist/client/assets/automations-ZGK89zV_.js +1 -0
  64. package/dist/client/assets/{autosend-D_-616qs.js → autosend-BLRimjZ_.js} +1 -1
  65. package/dist/client/assets/{avatar-UXZ4R5Yb.js → avatar-BVfPlbpm.js} +1 -1
  66. package/dist/client/assets/{badge-CfAmvo-h.js → badge-DNxr1fi7.js} +1 -1
  67. package/dist/client/assets/{block-document-DbCz5f9N.js → block-document-z1ZnryZ2.js} +2 -2
  68. package/dist/client/assets/{brand-context-G_6bLd5F.js → brand-context-CLHvlJV7.js} +1 -1
  69. package/dist/client/assets/buckets-BTIuBcJT.js +1 -0
  70. package/dist/client/assets/bulk-category-panel-BgK98tsF.js +1 -0
  71. package/dist/client/assets/calendar-VVDY0smi.js +102 -0
  72. package/dist/client/assets/{capability-load-error-B9xkkNBq.js → capability-load-error-2OJTaAO-.js} +1 -1
  73. package/dist/client/assets/{card-dLLzWD0r.js → card-CRilZAuB.js} +1 -1
  74. package/dist/client/assets/category-editor-D_whkLw0.js +1 -0
  75. package/dist/client/assets/{chat-context-CyCuyn4t.js → chat-context-BI8_Nmou.js} +13 -11
  76. package/dist/client/assets/checkbox-CcBhppQn.js +1 -0
  77. package/dist/client/assets/{cli-auth-success-zoB4TWhQ.js → cli-auth-success-DEIP-V25.js} +1 -1
  78. package/dist/client/assets/collection-detail-1c1ACTcR.js +1 -0
  79. package/dist/client/assets/collection-display-button-DXJEmTV8.js +1 -0
  80. package/dist/client/assets/{collection-search-C4jDpdZf.js → collection-search-COKgSE9f.js} +1 -1
  81. package/dist/client/assets/{collection-table-wrapper-DIkftYUF.js → collection-table-wrapper-Bkw9b8hk.js} +1 -1
  82. package/dist/client/assets/{collection-tabs-DvvibY6H.js → collection-tabs-ttDF8X2o.js} +1 -1
  83. package/dist/client/assets/{command-EQNrbniG.js → command-vkOcTid-.js} +1 -1
  84. package/dist/client/assets/commerce-onboarding-bjzg6F_h.js +1 -0
  85. package/dist/client/assets/{companions-core-fc2Z_sCB.js → companions-core-B9YYDQ4A.js} +1 -1
  86. package/dist/client/assets/connect-desktop-dialog-D7YkwfUU.js +1 -0
  87. package/dist/client/assets/{connection-card-CtY9PRIw.js → connection-card-DU81gKdu.js} +1 -1
  88. package/dist/client/assets/connection-detail-DABVCpPE.js +1 -0
  89. package/dist/client/assets/{connection-form-helpers-TGmycj7X.js → connection-form-helpers-Dyl58fX0.js} +1 -1
  90. package/dist/client/assets/connections-bXxskjsO.js +1 -0
  91. package/dist/client/assets/{decopilot-sse-pool-DHojW3EC.js → decopilot-sse-pool-B7Q1Pjne.js} +1 -1
  92. package/dist/client/assets/{dialog-CmXDzme5.js → dialog-B1V0iUXV.js} +1 -1
  93. package/dist/client/assets/{domain-settings-GxKzcerZ.js → domain-settings-B1ZyfdYW.js} +1 -1
  94. package/dist/client/assets/{drawer-Ds-r7525.js → drawer-9Bvsh1k7.js} +1 -1
  95. package/dist/client/assets/dropdown-menu-Bel6DI3v.js +1 -0
  96. package/dist/client/assets/{empty-state-CdKwtMyP.js → empty-state-BHQtYUSO.js} +1 -1
  97. package/dist/client/assets/{extract-connection-data-CK9iLAoG.js → extract-connection-data-BZuABMOr.js} +1 -1
  98. package/dist/client/assets/file-explorer-PgVeGy2E.js +2 -0
  99. package/dist/client/assets/{file-type-icon-DjNFZnTs.js → file-type-icon-CGkU8X5K.js} +1 -1
  100. package/dist/client/assets/{files-CQYyuV1E.js → files-DZ3SJjR-.js} +1 -1
  101. package/dist/client/assets/{form-x0k-kdB2.js → form-C9jBxN8G.js} +1 -1
  102. package/dist/client/assets/general-CuHItqTO.js +1 -0
  103. package/dist/client/assets/{github-repo-picker-C-tZ-Bba.js → github-repo-picker-DPwCOiEB.js} +1 -1
  104. package/dist/client/assets/{hooks-QHrmNjJQ.js → hooks-DtDviOax.js} +1 -1
  105. package/dist/client/assets/index-B3GkLwEh.js +2 -0
  106. package/dist/client/assets/{index-cG8paP3z.js → index-BRH7yHcF.js} +1 -1
  107. package/dist/client/assets/{index-Czi2ZhJ5.js → index-BcgykEG5.js} +1 -1
  108. package/dist/client/assets/{index-C-B6S6Q9.js → index-CHJYXQSS.js} +1 -1
  109. package/dist/client/assets/{index-DF3zg-P1.js → index-CMuj1duV.js} +3 -3
  110. package/dist/client/assets/{index-T-oY3h3t.js → index-Clopj9KU.js} +1 -1
  111. package/dist/client/assets/{index-CUVgjm02.js → index-CwggL_PJ.js} +1 -1
  112. package/dist/client/assets/{index-CeqD0RVV.js → index-DVJqB6A6.js} +1 -1
  113. package/dist/client/assets/{index-BcWQMJI4.js → index-Df10o6gn.js} +3 -3
  114. package/dist/client/assets/index-Dj5WILcq.css +1 -0
  115. package/dist/client/assets/{index-DonY639O.js → index-Dp8SB-ud.js} +29 -29
  116. package/dist/client/assets/index-DxeK__BQ.js +1 -0
  117. package/dist/client/assets/{index-BCiDnhhX.js → index-gAU-Arvb.js} +4 -4
  118. package/dist/client/assets/{index-BjO8A-VO.js → index-jm5YycYM.js} +1 -1
  119. package/dist/client/assets/{index-redirect-_hpy7g8S.js → index-redirect-CecfnhiM.js} +1 -1
  120. package/dist/client/assets/{index-CzMEWsZX.js → index-z2UBv_6H.js} +1 -1
  121. package/dist/client/assets/{input-BZTiU0ds.js → input-qdMTAJH4.js} +1 -1
  122. package/dist/client/assets/{integration-icon-BfKWLZT4.js → integration-icon-ByqyfRpT.js} +1 -1
  123. package/dist/client/assets/{invite-member-dialog-fPpySKy7.js → invite-member-dialog-cnQXBieX.js} +1 -1
  124. package/dist/client/assets/{label-B1OfKy2N.js → label-CnEhHuVP.js} +1 -1
  125. package/dist/client/assets/{layout-BzlkAZij.js → layout-ofNqb8rV.js} +1 -1
  126. package/dist/client/assets/{login-CfYNPvDo.js → login-knndhvVF.js} +1 -1
  127. package/dist/client/assets/{mcp-oauth-CoKzxQiz.js → mcp-oauth-CAUkOKji.js} +1 -1
  128. package/dist/client/assets/members-Bb6cqv3N.js +1 -0
  129. package/dist/client/assets/{monaco-editor-BzdwB2U8.js → monaco-editor-4EWxCivt.js} +1 -1
  130. package/dist/client/assets/{monitoring-stats-row-C0-lT8X-.js → monitoring-stats-row-CYRhMPF6.js} +1 -1
  131. package/dist/client/assets/{multi-select-BYFsBcLx.js → multi-select-DGg7VcY7.js} +1 -1
  132. package/dist/client/assets/{oauth-callback-D6L6RroV.js → oauth-callback-Txh_HZU1.js} +1 -1
  133. package/dist/client/assets/{oauth-callback-ai-provider-NS24Yhk_.js → oauth-callback-ai-provider-gZcF7GFt.js} +1 -1
  134. package/dist/client/assets/{onboarding-CXfWXP3L.js → onboarding-BNd98v9F.js} +1 -1
  135. package/dist/client/assets/{org-install-CFASOU4_.js → org-install-s29fSk6T.js} +1 -1
  136. package/dist/client/assets/{org-layout-gngtZKVa.js → org-layout-pC6WuH2d.js} +1 -1
  137. package/dist/client/assets/{organization-choice-DB-AR__E.js → organization-choice-Cvpg9cyR.js} +1 -1
  138. package/dist/client/assets/orgs-BH4zqSW4.js +1 -0
  139. package/dist/client/assets/{page-seo-form-DsaBxdUW.js → page-seo-form-DpJbL5qC.js} +1 -1
  140. package/dist/client/assets/page-seo-sheet-BViE3vmf.js +1 -0
  141. package/dist/client/assets/{popover-BzHpXFL_.js → popover-BXXrlEXA.js} +1 -1
  142. package/dist/client/assets/post-editor-DgVq5HAq.js +1 -0
  143. package/dist/client/assets/{primitives-BxBoeZTE.js → primitives-C0YiE9Dl.js} +1 -1
  144. package/dist/client/assets/profile-CdQoqyRv.js +1 -0
  145. package/dist/client/assets/project-app-view-DORLMZaj.js +1 -0
  146. package/dist/client/assets/record-editor-D2PAFmR-.js +1 -0
  147. package/dist/client/assets/redirect-editor-ClaSMwyP.js +1 -0
  148. package/dist/client/assets/registry-DqKNpXHC.js +2 -0
  149. package/dist/client/assets/{registry-layout-B8iHO94t.js → registry-layout-CFETb4kQ.js} +2 -2
  150. package/dist/client/assets/{reports-DFt5o5JU.js → reports-Bd4Konjf.js} +2 -2
  151. package/dist/client/assets/{require-capability-CEBGt_Ot.js → require-capability-D0uXhAfv.js} +1 -1
  152. package/dist/client/assets/{required-auth-layout-vPZ2d-Yx.js → required-auth-layout-uUQ9Dfyr.js} +1 -1
  153. package/dist/client/assets/{reset-password-l6ffdCqx.js → reset-password-InhP_QJS.js} +1 -1
  154. package/dist/client/assets/roles-C8MjshKP.js +1 -0
  155. package/dist/client/assets/{search-input-ByuB0YyC.js → search-input-Bhg65axQ.js} +1 -1
  156. package/dist/client/assets/secrets-CoTCTnY9.js +1 -0
  157. package/dist/client/assets/sections-editor-P9NnL9uS.js +2 -0
  158. package/dist/client/assets/select-Bhj7LCuD.js +1 -0
  159. package/dist/client/assets/{select-model-CebmAt-C.js → select-model-BkLoUhWB.js} +1 -1
  160. package/dist/client/assets/self-tool-result-DdS1heyV.js +1 -0
  161. package/dist/client/assets/seo-editor-5nf9jCaQ.js +1 -0
  162. package/dist/client/assets/{settings-layout-DUpflFya.js → settings-layout-Ct-vBxnm.js} +1 -1
  163. package/dist/client/assets/{settings-section-DS6otYn7.js → settings-section-D-A3Bfgf.js} +1 -1
  164. package/dist/client/assets/{shell-controls-B9xMPAfw.js → shell-controls-DCy9Peje.js} +1 -1
  165. package/dist/client/assets/{shell-layout-Bo6QxW8m.js → shell-layout-DDCV5qM0.js} +1 -1
  166. package/dist/client/assets/{sidebar-BFdShy9x.js → sidebar-DeWKCtxp.js} +1 -1
  167. package/dist/client/assets/{skeleton-BGZh750P.js → skeleton-BbGF1H7-.js} +1 -1
  168. package/dist/client/assets/sso-D7TxlrMn.js +1 -0
  169. package/dist/client/assets/{store-ioH_J-rE.js → store-0pluQIHD.js} +1 -1
  170. package/dist/client/assets/store-registry-CO9GrEkA.js +2 -0
  171. package/dist/client/assets/{studio-tools-bThaob6p.js → studio-tools-CE7lpCkl.js} +1 -1
  172. package/dist/client/assets/{switch-C2KH_TaK.js → switch-BNLG1jmU.js} +1 -1
  173. package/dist/client/assets/{table-XKbQ5Wjx.js → table-ByQcTCqP.js} +1 -1
  174. package/dist/client/assets/{tabs-D-6eQ0wE.js → tabs-CXMTix3U.js} +1 -1
  175. package/dist/client/assets/{textarea-PYu4eHQV.js → textarea-BPWk2Ywn.js} +1 -1
  176. package/dist/client/assets/{toggle-group-BcxqPGrf.js → toggle-group-DPBmxHrX.js} +1 -1
  177. package/dist/client/assets/{toolbar-D90MFc80.js → toolbar-CpK88Wot.js} +1 -1
  178. package/dist/client/assets/{toolbar-icon-button-D3m9VnTI.js → toolbar-icon-button--NaDqMEF.js} +1 -1
  179. package/dist/client/assets/{tooltip-O3iHy7-o.js → tooltip-B8wnTm17.js} +1 -1
  180. package/dist/client/assets/{use-ai-providers-B4nhSJlr.js → use-ai-providers-BO2D28v4.js} +1 -1
  181. package/dist/client/assets/{use-automations-C01orYPa.js → use-automations-CvhBPwX5.js} +1 -1
  182. package/dist/client/assets/{use-autosave-BhfvFfoI.js → use-autosave-DUdpa8zB.js} +1 -1
  183. package/dist/client/assets/{use-capability--WeMT0KP.js → use-capability-B2zRKwHf.js} +1 -1
  184. package/dist/client/assets/use-clock-tick-BfNa5AcO.js +1 -0
  185. package/dist/client/assets/{use-collections-K1HyCAfG.js → use-collections-tP6FM68N.js} +1 -1
  186. package/dist/client/assets/{use-connection-twfWXxwG.js → use-connection-Bubfkk8k.js} +1 -1
  187. package/dist/client/assets/{use-copy-DQ4y4418.js → use-copy-3Mpuxl0p.js} +1 -1
  188. package/dist/client/assets/{use-create-virtual-mcp-NwJ9x5Kd.js → use-create-virtual-mcp-BhfqxX9Z.js} +1 -1
  189. package/dist/client/assets/{use-debounced-autosave-BdWGMbok.js → use-debounced-autosave-B1u8xEPK.js} +1 -1
  190. package/dist/client/assets/{use-debounced-value-xN0eyoO9.js → use-debounced-value-ToigCZRD.js} +1 -1
  191. package/dist/client/assets/use-deco-credits-We_pqPUY.js +1 -0
  192. package/dist/client/assets/{use-decopilot-events-BEOY-_n2.js → use-decopilot-events-DDSe_K7D.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-BlzYSB_f.js → use-delete-connection-veOzeP_-.js} +1 -1
  194. package/dist/client/assets/{use-deployment-admin-DYO-CLsy.js → use-deployment-admin-uwYQkYfr.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-Bs9N4w-Z.js → use-file-configs-DxQ_uwCG.js} +1 -1
  196. package/dist/client/assets/{use-infinite-scroll-Dt7gLdpr.js → use-infinite-scroll-0uWHf52y.js} +1 -1
  197. package/dist/client/assets/{use-join-requests-D0z99IAk.js → use-join-requests-FGCBDSYD.js} +1 -1
  198. package/dist/client/assets/{use-mcp-auth-status-C7G9bAkb.js → use-mcp-auth-status-CFgkpOhb.js} +1 -1
  199. package/dist/client/assets/{use-mcp-client-DrROXOcH.js → use-mcp-client-D2BCR1MH.js} +1 -1
  200. package/dist/client/assets/{use-mcp-tools-D28ox9dJ.js → use-mcp-tools-DadUkegG.js} +1 -1
  201. package/dist/client/assets/{use-members-mvfsRjey.js → use-members-X6Ssb-cK.js} +1 -1
  202. package/dist/client/assets/{use-mobile-nauPjzo2.js → use-mobile-Cd6_A-wv.js} +1 -1
  203. package/dist/client/assets/{use-navigate-to-agent-BJC_x779.js → use-navigate-to-agent-rb-KJLb8.js} +1 -1
  204. package/dist/client/assets/{use-org-auth-client-jU0nDPT-.js → use-org-auth-client-Bw3VIyYp.js} +1 -1
  205. package/dist/client/assets/{use-org-sso-j8hZyqdO.js → use-org-sso-DBoYR181.js} +1 -1
  206. package/dist/client/assets/{use-organization-roles-thqey2Pm.js → use-organization-roles-B2nz6Y2V.js} +1 -1
  207. package/dist/client/assets/{use-organization-settings-BJ1bjHsL.js → use-organization-settings-B7BUH-ed.js} +1 -1
  208. package/dist/client/assets/{use-registry-app-CeyrXTI4.js → use-registry-app-DnzAi61_.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-D94L7VqK.js → use-registry-connections-dW2A6Cn6.js} +1 -1
  210. package/dist/client/assets/{use-secrets-C1Fme0Ya.js → use-secrets-BDm4jx5-.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-B1YKt2sD.js → use-status-sounds-Bf8VuMQs.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-gP4n4GFH.js → use-view-mode-Rpx9lr2S.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-C964oRwj.js → use-virtual-mcp-BIj51zng.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-B2tGgvl5.js +1 -0
  215. package/dist/client/assets/{useRouterState-Bi7YKwTw.js → useRouterState-DPwhq9G0.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-BYVVsI1f.js +1 -0
  217. package/dist/client/assets/{users-BiDYlXA2.js → users-DAp0zXfL.js} +1 -1
  218. package/dist/client/assets/variant-calendar-ByIjiAPe.js +1 -0
  219. package/dist/client/assets/{view-mode-toggle-kFlOpvCC.js → view-mode-toggle-BbtMRSS5.js} +1 -1
  220. package/dist/client/index.html +2 -2
  221. package/dist/server/cli.js +1 -1
  222. package/dist/server/server.js +1 -1
  223. package/package.json +1 -1
  224. package/dist/client/assets/Check-BF3t7WWi.js +0 -1
  225. package/dist/client/assets/ChevronUp-Y-IpPAUR.js +0 -1
  226. package/dist/client/assets/Circle-0HId1SV6.js +0 -1
  227. package/dist/client/assets/DotsVertical-CYU3Mae1.js +0 -1
  228. package/dist/client/assets/Flag01-B_AKNFoc.js +0 -1
  229. package/dist/client/assets/List-DZAsltZv.js +0 -1
  230. package/dist/client/assets/TrendUp01-7N_6K3-X.js +0 -1
  231. package/dist/client/assets/UserPlus01-D2pAl0t2.js +0 -1
  232. package/dist/client/assets/agent-icon-DmIJ53uv.js +0 -1
  233. package/dist/client/assets/agents-list-GFWV8fSw.js +0 -1
  234. package/dist/client/assets/ai-providers-C93Uux8H.js +0 -1
  235. package/dist/client/assets/app-editor-GnwEYs2F.js +0 -1
  236. package/dist/client/assets/automation-runs-yMzfgCqo.js +0 -188
  237. package/dist/client/assets/automations-Db9v_2wu.js +0 -1
  238. package/dist/client/assets/buckets-Bkz3itxJ.js +0 -1
  239. package/dist/client/assets/bulk-category-panel-EjjgUKdU.js +0 -1
  240. package/dist/client/assets/calendar-BdMqQsTv.js +0 -1
  241. package/dist/client/assets/category-editor-l1ImzDA-.js +0 -1
  242. package/dist/client/assets/checkbox-CxV2vfbv.js +0 -1
  243. package/dist/client/assets/collection-detail-ByPPxvaR.js +0 -1
  244. package/dist/client/assets/collection-display-button-BBHublq2.js +0 -1
  245. package/dist/client/assets/commerce-onboarding-Dgs4FWfH.js +0 -1
  246. package/dist/client/assets/connect-desktop-dialog-CPSwwSyz.js +0 -1
  247. package/dist/client/assets/connection-detail-DuvF3pbE.js +0 -1
  248. package/dist/client/assets/connections-CE66Octw.js +0 -1
  249. package/dist/client/assets/dropdown-menu-BgNr7tM1.js +0 -1
  250. package/dist/client/assets/file-explorer-nG37TAVQ.js +0 -2
  251. package/dist/client/assets/general-c3hgsq_x.js +0 -1
  252. package/dist/client/assets/index-DKadkG06.js +0 -4
  253. package/dist/client/assets/index-DpLPq5a_.css +0 -1
  254. package/dist/client/assets/index-bj26_8KX.js +0 -1
  255. package/dist/client/assets/members-CrKGCoFu.js +0 -1
  256. package/dist/client/assets/orgs-jcqywdGM.js +0 -1
  257. package/dist/client/assets/page-seo-sheet-BF2mpJ0B.js +0 -1
  258. package/dist/client/assets/post-editor-JD3fSSO7.js +0 -1
  259. package/dist/client/assets/profile-CZ9vM3_S.js +0 -1
  260. package/dist/client/assets/project-app-view-40EQ9ogm.js +0 -1
  261. package/dist/client/assets/record-editor-BmGDR-eB.js +0 -1
  262. package/dist/client/assets/redirect-editor-0M8-Neu7.js +0 -1
  263. package/dist/client/assets/registry-CwTOcwuV.js +0 -2
  264. package/dist/client/assets/roles-Bo-eSbrf.js +0 -1
  265. package/dist/client/assets/secrets-C_1Jcs02.js +0 -1
  266. package/dist/client/assets/sections-editor-gaZ0BvyI.js +0 -2
  267. package/dist/client/assets/select-B6GE4jHJ.js +0 -1
  268. package/dist/client/assets/self-tool-result-DJIiUu6Z.js +0 -1
  269. package/dist/client/assets/seo-editor-DNUmLmzw.js +0 -1
  270. package/dist/client/assets/sso-D7EYt-G3.js +0 -1
  271. package/dist/client/assets/store-registry-s8bkhEBH.js +0 -2
  272. package/dist/client/assets/use-clock-tick-DboEo7Cc.js +0 -1
  273. package/dist/client/assets/use-deco-credits-Bm-VH5Hm.js +0 -1
  274. package/dist/client/assets/useInfiniteQuery-DKhJHTs2.js +0 -1
  275. package/dist/client/assets/useSuspenseInfiniteQuery-DAAXTkZt.js +0 -1
  276. package/dist/client/assets/variant-calendar-m6XjJ2dx.js +0 -1
@@ -0,0 +1 @@
1
+ import{H as he,af as Ie,b3 as Ae,I as le,ad as $e,c as P,j as t,i as ge,B as V,r as G,l as je,C as J,v as De,K as ne,b as Y,aI as ce,z as Pe,b4 as Oe,E as Me,e as ze,b5 as Ee,n as Ve,M as Ue,J as Re,t as q,b6 as Fe}from"./index-CMuj1duV.js";import{g as Le}from"./extract-connection-data-BZuABMOr.js";import{E as ve}from"./empty-state-BHQtYUSO.js";import{E as He,c as Be,r as We,b as Xe,d as qe}from"./connection-form-helpers-Dyl58fX0.js";import{c as Ge,S as Ke,V as Qe}from"./index-Clopj9KU.js";import{u as be,T as Je}from"./use-mcp-auth-status-CFgkpOhb.js";import{u as Ye}from"./use-members-X6Ssb-cK.js";import{A as Ze}from"./avatar-BVfPlbpm.js";import{a as Ne,b as ye,u as et}from"./use-connection-Bubfkk8k.js";import{u as _e}from"./use-mcp-client-D2BCR1MH.js";import{a as tt}from"./use-mcp-tools-DadUkegG.js";import{c as st,C as nt,a as ot,d as it}from"./AreaChart-BtYig8Ye.js";import{i as rt,a as at}from"./mcp-oauth-CAUkOKji.js";import{I as oe}from"./integration-icon-ByqyfRpT.js";import{s as lt}from"./Plus-Ca4hMAKt.js";import{M as ct,N as dt,aw as mt,am as ut}from"./agent-icon-BdMdPyH8.js";import{a as Ce,s as xt}from"./Settings02-BIuCsH3l.js";import{s as re}from"./Trash01-CxvmthNE.js";import{q as pt,p as ft,o as ht,m as gt,n as jt}from"./sidebar-DeWKCtxp.js";import{F as L,b as H,c as B,d as E,f as W,e as vt,a as bt}from"./form-C9jBxN8G.js";import{I as X}from"./input-qdMTAJH4.js";import{u as Nt,D as yt}from"./use-delete-connection-veOzeP_-.js";import{c as _t,B as Ct,a as St,C as wt}from"./monitoring-stats-row-CYRhMPF6.js";import{u as kt}from"./studio-tools-CE7lpCkl.js";import{u as Tt}from"./use-virtual-mcp-BIj51zng.js";import{i as Se}from"./ChevronRight-4-DNv2jL.js";import{a as we}from"./Users03-BpRSYTYN.js";import{b as ee,c as It,T as te,a as At}from"./tabs-CXMTix3U.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-CS1YImRf.js";import{c as Dt}from"./Tool01-BDwVCBnM.js";import{g as ae,M as Pt}from"./index-jm5YycYM.js";import{C as Ot}from"./collection-search-COKgSE9f.js";import{C as Mt}from"./card-CRilZAuB.js";import{B as zt}from"./badge-DNxr1fi7.js";import{D as Et,a as Vt,c as Ut,d as de}from"./dropdown-menu-Bel6DI3v.js";import{S as me,a as ue,b as xe,c as pe,d as F}from"./select-Bhj7LCuD.js";import{i as Rt}from"./CheckCircle-Be2POQuF.js";import{t as Ft}from"./ChevronDown-BE7JvSpD.js";import{n as Lt}from"./Tool02-DjIBln53.js";import{s as se}from"./Star01-Dg6BZrlI.js";import{s as Ht}from"./XClose-CFj_hbve.js";import"./constants-BHDe7bIw.js";import"./index-DVJqB6A6.js";import"./ZoomOut-DBunTdui.js";import"./Key01-Cq8uChmI.js";import"./auth-DWUY37QO.js";import"./use-registry-connections-dW2A6Cn6.js";import"./use-organization-settings-B7BUH-ed.js";import"./index-CHJYXQSS.js";import"./index-CwggL_PJ.js";import"./popover-BXXrlEXA.js";import"./tooltip-B8wnTm17.js";import"./ChevronUp-Bwx_DvAp.js";import"./SearchMd-CFTyyPmA.js";import"./use-mobile-Cd6_A-wv.js";import"./use-create-virtual-mcp-BhfqxX9Z.js";import"./use-navigate-to-agent-rb-KJLb8.js";import"./hooks-DtDviOax.js";import"./decopilot-sse-pool-B7Q1Pjne.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-s3MCo34O.js";import"./use-org-auth-client-Bw3VIyYp.js";import"./User01-0Zd0134v.js";import"./use-collections-tP6FM68N.js";import"./AlertCircle-DvPByT3s.js";import"./ArrowUp-Dh74oxmM.js";import"./XCircle-CWZBOndb.js";import"./ArrowUpRight-DC6Yb9Jn.js";import"./TrendUp01-DdL0oR_B.js";import"./DotsVertical-hH1ie9LK.js";import"./Stars02-BF8YOJhr.js";import"./Copy01-CaaZXEMR.js";import"./Globe01-BNvAFZ7t.js";import"./FilterLines-B8M_kRrg.js";import"./Globe04-B8fLlHyp.js";import"./SwitchHorizontal01-T7cYMNoP.js";import"./HardDrive-DDRUuRUd.js";import"./Image01-DxLV4xvs.js";import"./LayoutLeft-riUBpORF.js";import"./LinkExternal01-DU3CPyqq.js";import"./Monitor01-0ngeB4wd.js";import"./Sun-Cd6pfpZ3.js";import"./Package-BrNfAbz_.js";import"./Palette-CtgW-PAY.js";import"./Play-CdZJWvJx.js";import"./SearchLg-BGyV5Bz4.js";import"./Shield01-DdJSxLoT.js";import"./Stars01-wVvTShj4.js";import"./Upload01-w4HjmReL.js";import"./Users01-j-t-q-sR.js";import"./X--0kJVtau.js";import"./Zap-BfGgAuT1.js";import"./label-CnEhHuVP.js";import"./alert-dialog-BjP2s6Nc.js";const Bt=he({scopes:$e(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Xt(s){const e=P.c(46),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=be(d),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==a?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>a(n,"active"),children:[t.jsx(ct,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>a(n,"inactive"),title:"Disable",children:t.jsx(dt,{size:13})}),e[20]=n,e[21]=p,e[22]=a,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==i?(S=()=>i(n),e[24]=n,e[25]=i,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(re,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let f;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function qt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let a;e[5]!==n||e[6]!==i?(a=()=>i(n),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:13}),e[8]=d):d=e[8];let l;e[9]!==a?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:"Configure",children:d})}),e[9]=a,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function Gt(s){const e=P.c(27),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a,onAdd:d,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(lt,{size:13}),e[2]=l,e[3]=p):p=e[3];let c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==x||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,c]}),e[8]=x,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a){let j;e[17]!==r||e[18]!==i||e[19]!==o||e[20]!==a?(j=N=>t.jsx(G.Suspense,{fallback:t.jsx(qt,{instance:N,onConfigure:i}),children:t.jsx(Xt,{instance:N,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a})},N.id),e[17]=r,e[18]=i,e[19]=o,e[20]=a,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}function Kt(s,e=3){const n=new Map;for(const i of s){if(!i.isError)continue;const r=(i.errorMessage??"").trim()||"Unknown error";n.set(r,(n.get(r)??0)+1)}return[...n.entries()].map(([i,r])=>({message:i,count:r})).sort((i,r)=>r.count-i.count).slice(0,e)}const Qt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Jt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Yt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Zt(s){const e=P.c(1),{connectionId:n,orgId:i,timeframe:r}=s,o=kt(),a=Jt(r),{data:d}=De({queryKey:ne.connectionActivity(n,r,i),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=_t(d?.logs??[],a),u=l.data,x=l.totalCalls>0,p=Kt(d?.logs??[]),c=l.totalCalls>0?Math.round(l.totalErrors/l.totalCalls*100):0;let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=h):h=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),h]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(st,{config:Yt,className:"h-16 w-full",children:t.jsxs(Ct,{data:u,barCategoryGap:"4%",children:[t.jsx(nt,{content:t.jsx(ot,{labelFormatter:ss}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(ts)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})}),p.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:["Top errors",c>0?` · ${c}% of calls failed`:""]}),t.jsx("ul",{className:"space-y-1.5",children:p.map(es)})]})]})}function es(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ts(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ss(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ns(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function os(s){const e=P.c(13),{connectionId:n}=s,[i,r]=G.useState("14d"),{org:o}=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=Qt.map(c=>t.jsx("button",{type:"button",onClick:()=>r(c.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=i,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[a,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ns,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==i?(x=t.jsx(G.Suspense,{fallback:u,children:t.jsx(Zt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function is(s){const e=P.c(15),{virtualMcp:n,org:i}=s,r=Y();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{size:16}),e[4]=a):a=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==d||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,l,u]}),e[11]=o,e[12]=d,e[13]=l,e[14]=x):x=e[14],x}function rs(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let a;e[3]!==i?(a=d=>t.jsx(is,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=a):a=e[4],r=n.map(a),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function as(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==i.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(rs,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=l):l=e[6],l}function ls(s){const e=P.c(31),{tools:n,connectionId:i,org:r}=s,o=Y(),{org:a}=J();let d;e[0]!==i||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:i,orgId:a.id,orgSlug:a.slug},e[0]=i,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const l=_e(d),u=Ne(i);let x;e[4]!==u||e[5]!==i?(x=u?ke(u):i,e[4]=u,e[5]=i,e[6]=x):x=e[6];const p=x,[c,h]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n){const S=(n??[]).filter(cs),y=c.toLowerCase().trim(),I=y?S.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=C):C=e[21],e[22]!==c?(j=t.jsx(Ot,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:C}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:c?"No apps found":"No apps available",description:c?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=ae(f._meta);return t.jsxs(Mt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.name}),t.jsx(Je,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=c,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function cs(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=a=>a.charAt(0).toUpperCase()+a.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function ds(s){const e=P.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:a}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const l=d;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),c=Ne(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==a?(v=function($){!o||!a||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=a,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==a||e[14]!==n?(j=o&&a&&n.some(xs),e[12]=o,e[13]=a,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let f;e[29]!==C?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==a||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ls,{tools:n,connectionId:o,org:a})}),e[31]=o,e[32]=N,e[33]=a,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(us):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(ms):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function ms(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(mt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function us(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function xs(s){return ae(s._meta)}function ps(s){const e=P.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let a;e[3]!==r?(a=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=a):a=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,d]}),e[7]=a,e[8]=d,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function fs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),a=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof a!="string"||!a)return!1;try{const c=new URL(a);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=d||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(X,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:c.value??[],onChange:c.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Rt,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(xt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>c.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(vt,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function hs(s){return s.command==="npx"}function gs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function js(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const i=s.connection_headers,r=We(i.envVars);if(hs(i)){const a=gs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=js(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function vs(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function bs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:a,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),c=Nt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=G.useState(null),[v,b]=G.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=h??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=Ge(k,Wt),f=Ue({resolver:Re(Be),values:fe(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const $=f.getValues(),D=vs($),R=h?.id??e;await x.update.mutateAsync({id:R,data:D}),f.reset($)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:$,tokenInfo:D,error:R}=await at({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(R||!$){q.error(`Authentication failed: ${R}`);return}if(D)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:$}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:$}})}else await x.update.mutateAsync({id:m,data:{connection_token:$}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),q.success("Authentication successful")},z=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const D=await m.text();q.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...c}),t.jsx(pt,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ft,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ht,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(gt,{className:"text-base",children:h?.title??s.title}),t.jsx(jt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(bt,{...f,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(fs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||i,className:"flex-1",children:i?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),c.requestDelete(m)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ps,{connection:s,displayTitle:(()=>{const m=d[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(os,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:d,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>c.requestDelete(m),onToggleStatus:async(m,$)=>{try{await x.update.mutateAsync({id:m.id,data:{status:$}}),q.success($==="active"?"Connection enabled":"Connection disabled")}catch{q.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=d[0]??s,$=m.title.replace(/\s*\(\d+\)\s*$/,""),D=d.length+1,R=`${$} (${D})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:R,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await rt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(as,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ds,{tools:r,prompts:o,resources:a,connectionId:e,org:n})})]})})]})})]})}function Ns(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=ze(i),{org:a}=J(),d=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",c=p||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==c?(h={connectionId:c,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=c,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(ks):(x?.tools??[]).map(ws);e:{if(u.length<=1){j=A;break e}const z=new Set,U=[],m=Cs;for(const $ of u){const D=$.id===p?A:m($.tools);for(const R of D)z.has(R.name)||(z.add(R.name),U.push(R))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=it(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(_s),s[21]=_,s[22]=k):k=s[22];const C=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(ys),s[25]=f,s[26]=w):w=s[26];const M=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==M||s[37]!==u?(O=t.jsx(bs,{org:o,connection:x,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:C,resources:M,siblings:u}),s[30]=d.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=M,s[37]=u,s[38]=O):O=s[38],O}function ys(s){return{name:s.name,description:s.description,uri:s.uri}}function _s(s){return{name:s.name,description:s.description}}function Cs(s){return(s??[]).map(Ss)}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ks(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ns,{})})}),s[0]=e):e=s[0],e}function bo(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ts,{}),s[0]=e):e=s[0],e}export{bo as default};
@@ -1 +1 @@
1
- import{H as R,af as V,b3 as A,I as a,ad as j,ae as z,c as L,j as u,B as C}from"./index-DF3zg-P1.js";import{I as H}from"./input-BZTiU0ds.js";import{s as W}from"./Plus-DWjKZ2wj.js";import{s as q}from"./Trash01-DEWgFvvg.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
1
+ import{H as R,af as V,b3 as A,I as a,ad as j,ae as z,c as L,j as u,B as C}from"./index-CMuj1duV.js";import{I as H}from"./input-qdMTAJH4.js";import{s as W}from"./Plus-Ca4hMAKt.js";import{s as q}from"./Trash01-CxvmthNE.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:V(a(),A()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function I(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=I(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=I(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
@@ -0,0 +1 @@
1
+ import{r as V,c as ne,j as t,B as K,i as ae,p as te,l as ge,E as Ge,C as be,b as _e,u as Qe,a as Ne,z as Je,G as Ye,D as Ze,M as et,J as tt,n as nt,t as R,K as st}from"./index-CMuj1duV.js";import{a as De,b as ot,g as it,e as rt}from"./extract-connection-data-BZuABMOr.js";import{C as lt}from"./collection-display-button-DXJEmTV8.js";import{S as ct}from"./search-input-Bhg65axQ.js";import{C as at}from"./collection-tabs-ttDF8X2o.js";import{C as Ce,u as dt,a as ke,g as mt}from"./connection-card-DU81gKdu.js";import{E as ut}from"./empty-state-BHQtYUSO.js";import{P as me}from"./index-DVJqB6A6.js";import{u as pt,D as gt}from"./use-delete-connection-veOzeP_-.js";import{u as ye}from"./use-capability-B2zRKwHf.js";import{u as ht}from"./use-infinite-scroll-0uWHf52y.js";import{u as xt}from"./use-view-mode-Rpx9lr2S.js";import{g as pe}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as Te,b as we,A as Ie,e as Pe,g as $e,a as Oe,f as Le}from"./alert-dialog-BjP2s6Nc.js";import{n as he}from"./Tool02-DjIBln53.js";import{D as Me,a as Fe,h as ze,c as Ve,d as Ee,e as Be}from"./dialog-B1V0iUXV.js";import{D as ft,a as jt,c as yt,b as Ct,d as vt,e as St,f as bt}from"./drawer-9Bvsh1k7.js";import{u as _t}from"./use-mobile-Cd6_A-wv.js";import{F as Q,b as J,c as Y,d as Z,f as ee,a as ve}from"./form-C9jBxN8G.js";import{I as ie}from"./input-qdMTAJH4.js";import{S as Nt,a as Dt,b as kt,c as At,d as ce}from"./select-Bhj7LCuD.js";import{T as Tt}from"./textarea-BPWk2Ywn.js";import{b as Ke,u as wt}from"./use-connection-Bubfkk8k.js";import{u as It}from"./use-virtual-mcp-BIj51zng.js";import{u as Pt}from"./studio-tools-CE7lpCkl.js";import{s as je}from"./Star01-Dg6BZrlI.js";import{s as He}from"./Plus-Ca4hMAKt.js";import{N as $t,M as Ot,av as Lt,am as Mt}from"./agent-icon-BdMdPyH8.js";import{s as Ue}from"./XClose-CFj_hbve.js";import{i as ue,a as Se,E as Ft,c as zt,p as Vt,b as Et,d as Bt}from"./connection-form-helpers-Dyl58fX0.js";import{a as Kt}from"./authenticate-and-persist-oauth-tVxGkZPI.js";import{I as Ht}from"./integration-icon-ByqyfRpT.js";import{C as Re}from"./checkbox-CcBhppQn.js";import{d as re,a as Ut,D as Rt,c as Wt}from"./dropdown-menu-Bel6DI3v.js";import{i as Xt}from"./DotsVertical-hH1ie9LK.js";import{s as We}from"./Eye-s3MCo34O.js";import{s as Xe}from"./Trash01-CxvmthNE.js";import"./use-mcp-client-D2BCR1MH.js";import"./constants-BHDe7bIw.js";import"./auth-DWUY37QO.js";import"./ArrowUp-Dh74oxmM.js";import"./ChevronUp-Bwx_DvAp.js";import"./SwitchHorizontal01-T7cYMNoP.js";import"./tooltip-B8wnTm17.js";import"./view-mode-toggle-BbtMRSS5.js";import"./badge-DNxr1fi7.js";import"./SearchMd-CFTyyPmA.js";import"./use-registry-connections-dW2A6Cn6.js";import"./use-organization-settings-B7BUH-ed.js";import"./useInfiniteQuery-B2tGgvl5.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./card-CRilZAuB.js";import"./sidebar-DeWKCtxp.js";import"./LayoutLeft-riUBpORF.js";import"./X--0kJVtau.js";import"./label-CnEhHuVP.js";import"./ChevronDown-BE7JvSpD.js";import"./use-collections-tP6FM68N.js";import"./AlertCircle-DvPByT3s.js";import"./Tool01-BDwVCBnM.js";import"./Settings02-BIuCsH3l.js";import"./XCircle-CWZBOndb.js";import"./ArrowUpRight-DC6Yb9Jn.js";import"./TrendUp01-DdL0oR_B.js";import"./ZapSquare-CS1YImRf.js";import"./ZoomOut-DBunTdui.js";import"./Users03-BpRSYTYN.js";import"./CheckCircle-Be2POQuF.js";import"./ChevronRight-4-DNv2jL.js";import"./Stars02-BF8YOJhr.js";import"./Copy01-CaaZXEMR.js";import"./Globe01-BNvAFZ7t.js";import"./FilterLines-B8M_kRrg.js";import"./Globe04-B8fLlHyp.js";import"./HardDrive-DDRUuRUd.js";import"./Image01-DxLV4xvs.js";import"./Key01-Cq8uChmI.js";import"./LinkExternal01-DU3CPyqq.js";import"./Monitor01-0ngeB4wd.js";import"./Sun-Cd6pfpZ3.js";import"./Package-BrNfAbz_.js";import"./Palette-CtgW-PAY.js";import"./Play-CdZJWvJx.js";import"./SearchLg-BGyV5Bz4.js";import"./Shield01-DdJSxLoT.js";import"./Stars01-wVvTShj4.js";import"./Upload01-w4HjmReL.js";import"./User01-0Zd0134v.js";import"./Users01-j-t-q-sR.js";import"./Zap-BfGgAuT1.js";import"./mcp-oauth-CAUkOKji.js";function qt(f){const e=`deco-filters-${f}`,[n,a]=V.useState(()=>{try{const s=globalThis.localStorage?.getItem(e);if(s)return JSON.parse(s)}catch(s){console.error("Failed to parse stored filters:",s)}return[]});return[n,s=>{a(s);try{globalThis.localStorage?.setItem(e,JSON.stringify(s))}catch(i){console.error("Failed to save filters:",i)}}]}function Gt(f){const e=ne.c(7),[n,a]=V.useState(f),[o,s]=V.useState(f?"desc":null);let i;e[0]!==o||e[1]!==n?(i=j=>{n!==j?(a(j),s("asc")):o==="asc"?s("desc"):o==="desc"&&(a(void 0),s(null))},e[0]=o,e[1]=n,e[2]=i):i=e[2];const l=i;let d;return e[3]!==l||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:l},e[3]=l,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function Qt(f){const e=ne.c(20),{namespace:n,resource:a,defaultSortKey:o,defaultViewMode:s}=f,i=o===void 0?"title":o,l=s===void 0?"table":s,[d,j]=V.useState(""),y=V.useDeferredValue(d),C=`${n}-${a}`,[v,u]=qt(C),p=`mesh-${a}-filter-visible-${n}`;let c;e[0]!==p?(c=()=>globalThis.localStorage?.getItem(p)==="true",e[0]=p,e[1]=c):c=e[1];const[S,_]=V.useState(c);let b;e[2]!==p?(b=F=>{_(F),globalThis.localStorage?.setItem(p,String(F))},e[2]=p,e[3]=b):b=e[3];const w=b;let D;e[4]!==S||e[5]!==w?(D=()=>{w(!S)},e[4]=S,e[5]=w,e[6]=D):D=e[6];const r=D,[I,$]=xt(`mesh-${a}-${n}`,l),{sortKey:L,sortDirection:T,handleSort:O}=Gt(i),k=L;let M;return e[7]!==S||e[8]!==v||e[9]!==O||e[10]!==d||e[11]!==y||e[12]!==w||e[13]!==u||e[14]!==$||e[15]!==T||e[16]!==k||e[17]!==r||e[18]!==I?(M={search:d,searchTerm:y,setSearch:j,filters:v,setFilters:u,filterBarVisible:S,setFilterBarVisible:w,toggleFilterBar:r,viewMode:I,setViewMode:$,sortKey:k,sortDirection:T,handleSort:O},e[7]=S,e[8]=v,e[9]=O,e[10]=d,e[11]=y,e[12]=w,e[13]=u,e[14]=$,e[15]=T,e[16]=k,e[17]=r,e[18]=I,e[19]=M):M=e[19],M}function Jt(f){const e=ne.c(20),{open:n,onOpenChange:a,count:o,onConfirm:s}=f,i=o!==1?"s":"";let l;e[0]!==o||e[1]!==i?(l=t.jsxs(Ae,{children:["Delete ",o," connection",i,"?"]}),e[0]=o,e[1]=i,e[2]=l):l=e[2];const d=o!==1?"s":"";let j;e[3]!==d?(j=t.jsxs(Te,{children:["This will permanently delete the selected connection",d,". This action cannot be undone."]}),e[3]=d,e[4]=j):j=e[4];let y;e[5]!==l||e[6]!==j?(y=t.jsxs(we,{children:[l,j]}),e[5]=l,e[6]=j,e[7]=y):y=e[7];let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Ie,{children:"Cancel"}),e[8]=C):C=e[8];const v=o!==1?"s":"";let u;e[9]!==o||e[10]!==s||e[11]!==v?(u=t.jsxs(Pe,{children:[C,t.jsxs($e,{onClick:s,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",o," connection",v]})]}),e[9]=o,e[10]=s,e[11]=v,e[12]=u):u=e[12];let p;e[13]!==y||e[14]!==u?(p=t.jsxs(Oe,{children:[y,u]}),e[13]=y,e[14]=u,e[15]=p):p=e[15];let c;return e[16]!==a||e[17]!==n||e[18]!==p?(c=t.jsx(Le,{open:n,onOpenChange:a,children:p}),e[16]=a,e[17]=n,e[18]=p,e[19]=c):c=e[19],c}function Yt(f){return f._registryId?.includes("community-registry")===!0}function Zt(f){const e=ne.c(58),{item:n,canManage:a,allConnections:o,connectedAppNames:s,connectingItemId:i,onNavigateConnected:l,onConnect:d}=f,[j,y]=V.useState(!1),[C,v]=V.useState(null);let u,p;e[0]!==s||e[1]!==n?(u=De(n)??"",p=s.has(u),e[0]=s,e[1]=n,e[2]=u,e[3]=p):(u=e[2],p=e[3]);const c=p,S=n._meta?.["mcp.mesh"],_=S?.friendlyName||S?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let w;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(w=n.server?.icons?.[0]?.src||ot(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=w):w=e[6];const D=w;let r;if(e[7]!==o||e[8]!==u){let A;e[10]!==u?(A=oe=>oe.connection_type!=="VIRTUAL"&&oe.app_name===u,e[10]=u,e[11]=A):A=e[11],r=o.filter(A),e[7]=o,e[8]=u,e[9]=r}else r=e[9];const I=r;let $;e[12]!==n?($=Yt(n),e[12]=n,e[13]=$):$=e[13];const L=$;let T,O;e[14]!==I||e[15]!==a||e[16]!==L||e[17]!==c||e[18]!==n||e[19]!==d||e[20]!==l?(T=()=>{if(c){const A=I[0];A&&l(A);return}a&&O()},O=()=>{L?(v("connect"),y(!0)):d(n)},e[14]=I,e[15]=a,e[16]=L,e[17]=c,e[18]=n,e[19]=d,e[20]=l,e[21]=T,e[22]=O):(T=e[21],O=e[22]);let k;e[23]!==n||e[24]!==d||e[25]!==C?(k=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),C==="connect"&&d(n),v(null)},e[23]=n,e[24]=d,e[25]=C,e[26]=k):k=e[26];const M=k;let F;e[27]!==b||e[28]!==D||e[29]!==_?(F={title:_,description:b,icon:D},e[27]=b,e[28]=D,e[29]=_,e[30]=F):F=e[30];let q;e[31]===Symbol.for("react.memo_cache_sentinel")?(q=t.jsx(he,{}),e[31]=q):q=e[31];let U;e[32]!==L||e[33]!==n._sourceIcon?(U=L&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=L,e[33]=n._sourceIcon,e[34]=U):U=e[34];let W;e[35]!==a||e[36]!==i||e[37]!==O||e[38]!==c||e[39]!==n.id?(W=c?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):a&&t.jsx(K,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:A=>{A.stopPropagation(),O()},children:i===n.id?t.jsx(ae,{size:14,className:"animate-spin"}):"Connect"}),e[35]=a,e[36]=i,e[37]=O,e[38]=c,e[39]=n.id,e[40]=W):W=e[40];let g;e[41]!==U||e[42]!==W?(g=t.jsxs("div",{className:"flex items-center gap-2",children:[U,W]}),e[41]=U,e[42]=W,e[43]=g):g=e[43];let N;e[44]!==T||e[45]!==g||e[46]!==F?(N=t.jsx(Ce,{connection:F,fallbackIcon:q,onClick:T,headerActionsAlwaysVisible:!0,headerActions:g}),e[44]=T,e[45]=g,e[46]=F,e[47]=N):N=e[47];let z;e[48]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs(we,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(Te,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=z):z=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Ie,{children:"Cancel"}),e[49]=H):H=e[49];let E;e[50]!==M?(E=t.jsxs(Oe,{children:[z,t.jsxs(Pe,{children:[H,t.jsx($e,{onClick:M,children:"Continue"})]})]}),e[50]=M,e[51]=E):E=e[51];let h;e[52]!==j||e[53]!==E?(h=t.jsx(Le,{open:j,onOpenChange:y,children:E}),e[52]=j,e[53]=E,e[54]=h):h=e[54];let P;return e[55]!==N||e[56]!==h?(P=t.jsxs(t.Fragment,{children:[N,h]}),e[55]=N,e[56]=h,e[57]=P):P=e[57],P}function qe(f){const e=ne.c(8),{selectionMode:n,children:a}=f,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[0]!==o?(s=ge("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Ut,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:tn,children:t.jsx(Xt,{size:20})})}),e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsxs(Rt,{children:[i,t.jsx(Wt,{align:"end",onClick:en,children:a})]}),e[3]=a,e[4]=l):l=e[4];let d;return e[5]!==s||e[6]!==l?(d=t.jsx("div",{className:s,children:l}),e[5]=s,e[6]=l,e[7]=d):d=e[7],d}function en(f){return f.stopPropagation()}function tn(f){return f.stopPropagation()}function nn(f){const e=ne.c(49),{group:n,onOpen:a,selectionMode:o,selectedIds:s,onToggleSelect:i}=f;let l;if(e[0]!==n.connections||e[1]!==s){let k;e[3]!==s?(k=M=>s.has(M.id),e[3]=s,e[4]=k):k=e[4],l=n.connections.every(k),e[0]=n.connections,e[1]=s,e[2]=l}else l=e[2];const d=l;let j;if(e[5]!==n.connections||e[6]!==s){let k;e[8]!==s?(k=M=>s.has(M.id),e[8]=s,e[9]=k):k=e[9],j=n.connections.some(k),e[5]=n.connections,e[6]=s,e[7]=j}else j=e[7];const y=j;let C;e[10]!==d||e[11]!==n.connections||e[12]!==i||e[13]!==s?(C=()=>{for(const k of n.connections)d?s.has(k.id)&&i(k.id):s.has(k.id)||i(k.id)},e[10]=d,e[11]=n.connections,e[12]=i,e[13]=s,e[14]=C):C=e[14];const v=C,u=`${n.connections.length} instances`;let p;e[15]!==n.icon||e[16]!==n.title||e[17]!==u?(p={title:n.title,icon:n.icon,description:u},e[15]=n.icon,e[16]=n.title,e[17]=u,e[18]=p):p=e[18];let c;e[19]!==a||e[20]!==o||e[21]!==v?(c=()=>o?v():a(),e[19]=a,e[20]=o,e[21]=v,e[22]=c):c=e[22];const S=o&&d&&"ring-2 ring-primary",_=o&&y&&!d&&"ring-1 ring-primary/50";let b;e[23]!==S||e[24]!==_?(b=ge(S,_),e[23]=S,e[24]=_,e[25]=b):b=e[25];let w;e[26]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(he,{}),e[26]=w):w=e[26];let D;e[27]!==d||e[28]!==n.connections.length||e[29]!==o||e[30]!==y||e[31]!==v?(D=o?t.jsx(Re,{checked:d?!0:y?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[27]=d,e[28]=n.connections.length,e[29]=o,e[30]=y,e[31]=v,e[32]=D):D=e[32];let r;e[33]!==a?(r=k=>{k.stopPropagation(),a()},e[33]=a,e[34]=r):r=e[34];let I;e[35]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(We,{size:16}),e[35]=I):I=e[35];let $;e[36]!==r?($=t.jsxs(re,{onClick:r,children:[I,"Open"]}),e[36]=r,e[37]=$):$=e[37];let L;e[38]!==o||e[39]!==$?(L=t.jsx(qe,{selectionMode:o,children:$}),e[38]=o,e[39]=$,e[40]=L):L=e[40];let T;e[41]!==D||e[42]!==L?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[D,L]}),e[41]=D,e[42]=L,e[43]=T):T=e[43];let O;return e[44]!==T||e[45]!==p||e[46]!==c||e[47]!==b?(O=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:p,onClick:c,className:b,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:T})}),e[44]=T,e[45]=p,e[46]=c,e[47]=b,e[48]=O):O=e[48],O}function sn(f){const e=ne.c(29),{connection:n,isSelected:a,selectionMode:o,canManage:s,canManageAgents:i,onToggleSelect:l,onOpen:d,onToggleStatus:j,onDelete:y}=f;let C;e[0]!==a||e[1]!==l||e[2]!==o?(C=o?t.jsx(Re,{checked:a,onCheckedChange:l,onClick:on}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),e[0]=a,e[1]=l,e[2]=o,e[3]=C):C=e[3];let v;e[4]!==d?(v=D=>{D.stopPropagation(),d()},e[4]=d,e[5]=v):v=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(We,{size:16}),e[6]=u):u=e[6];let p;e[7]!==v?(p=t.jsxs(re,{onClick:v,children:[u,"Open"]}),e[7]=v,e[8]=p):p=e[8];let c;e[9]!==s||e[10]!==i||e[11]!==l?(c=(s||i)&&t.jsxs(re,{onClick:D=>{D.stopPropagation(),l()},children:[t.jsx(Lt,{size:16}),"Select"]}),e[9]=s,e[10]=i,e[11]=l,e[12]=c):c=e[12];let S;e[13]!==s||e[14]!==n||e[15]!==j?(S=s&&(n.status==="active"?t.jsxs(re,{onClick:D=>{D.stopPropagation(),j("inactive")},children:[t.jsx($t,{size:16}),"Disable"]}):t.jsxs(re,{onClick:D=>{D.stopPropagation(),j("active")},children:[t.jsx(Ot,{size:16}),"Enable"]})),e[13]=s,e[14]=n,e[15]=j,e[16]=S):S=e[16];let _;e[17]!==s||e[18]!==y?(_=s&&t.jsxs(re,{variant:"destructive",onClick:D=>{D.stopPropagation(),y()},children:[t.jsx(Xe,{size:16}),"Delete"]}),e[17]=s,e[18]=y,e[19]=_):_=e[19];let b;e[20]!==o||e[21]!==p||e[22]!==c||e[23]!==S||e[24]!==_?(b=t.jsxs(qe,{selectionMode:o,children:[p,c,S,_]}),e[20]=o,e[21]=p,e[22]=c,e[23]=S,e[24]=_,e[25]=b):b=e[25];let w;return e[26]!==C||e[27]!==b?(w=t.jsxs("div",{className:"flex items-center gap-1",children:[C,b]}),e[26]=C,e[27]=b,e[28]=w):w=e[28],w}function on(f){return f.stopPropagation()}function rn(f){const e=ne.c(23),{count:n,total:a,canManage:o,canManageAgents:s,onSelectAll:i,onDeselectAll:l,onDelete:d,onAddToAgent:j,onToggleStatus:y,onCancel:C}=f;if(n===0)return null;let v;e[0]!==n?(v=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=v):v=e[1];let u;e[2]!==n||e[3]!==l||e[4]!==i||e[5]!==a?(u=n<a?t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",a,")"]}):t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:"Clear selection"}),e[2]=n,e[3]=l,e[4]=i,e[5]=a,e[6]=u):u=e[6];let p;e[7]!==s||e[8]!==j?(p=s&&t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(He,{size:13}),"Add to Agent"]}),e[7]=s,e[8]=j,e[9]=p):p=e[9];let c;e[10]!==o||e[11]!==d||e[12]!==y?(c=o&&t.jsxs(t.Fragment,{children:[t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(K,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(K,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Xe,{size:13}),"Delete"]})]}),e[10]=o,e[11]=d,e[12]=y,e[13]=c):c=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Ue,{size:13}),e[14]=S):S=e[14];let _;e[15]!==C?(_=t.jsx(K,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:C,children:S}),e[15]=C,e[16]=_):_=e[16];let b;return e[17]!==v||e[18]!==u||e[19]!==p||e[20]!==c||e[21]!==_?(b=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[v,u,p,c,_]})}),e[17]=v,e[18]=u,e[19]=p,e[20]=c,e[21]=_,e[22]=b):b=e[22],b}function ln(f){const e=ne.c(25),{open:n,onOpenChange:a,agents:o,onConfirm:s}=f,[i,l]=V.useState(null);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsxs(Me,{children:[t.jsx(Fe,{children:"Add to Agent"}),t.jsx(ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=d):d=e[0];let j;e[1]!==o||e[2]!==i?(j=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):o.map(b=>t.jsxs("button",{type:"button",onClick:()=>l(b.id),className:ge("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===b.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ht,{icon:b.icon,name:b.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:b.title}),b.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:b.description})]})]},b.id)),e[1]=o,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let C;e[6]!==a?(C=t.jsx(K,{variant:"outline",onClick:()=>a(!1),children:"Cancel"}),e[6]=a,e[7]=C):C=e[7];const v=!i;let u;e[8]!==s||e[9]!==a||e[10]!==i?(u=()=>{i&&(s(i),a(!1),l(null))},e[8]=s,e[9]=a,e[10]=i,e[11]=u):u=e[11];let p;e[12]!==v||e[13]!==u?(p=t.jsx(K,{disabled:v,onClick:u,children:"Add"}),e[12]=v,e[13]=u,e[14]=p):p=e[14];let c;e[15]!==C||e[16]!==p?(c=t.jsxs(Ve,{children:[C,p]}),e[15]=C,e[16]=p,e[17]=c):c=e[17];let S;e[18]!==y||e[19]!==c?(S=t.jsxs(Ee,{className:"sm:max-w-[400px]",children:[d,y,c]}),e[18]=y,e[19]=c,e[20]=S):S=e[20];let _;return e[21]!==a||e[22]!==n||e[23]!==S?(_=t.jsx(Be,{open:n,onOpenChange:a,children:S}),e[21]=a,e[22]=n,e[23]=S,e[24]=_):_=e[24],_}function cn({listState:f,activeTab:e,typeFilter:n,statusFilter:a,registryFilter:o,enabledRegistries:s}){const{org:i}=be(),l=nt(),d=_e(),{data:j}=Ne.useSession(),y=Ke(),C=wt(f),v=pt(),{granted:u}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[c,S]=V.useState(new Set),_=c.size>0,[b,w]=V.useState(!1),[D,r]=V.useState(!1),[I,$]=V.useState(null),L=It(),T=C.filter(m=>!(n!=="ALL"&&m.connection_type!==n||a!=="ALL"&&m.status!==a)),O=mt(T),k=m=>{S(x=>{const B=new Set(x);return B.has(m)?B.delete(m):B.add(m),B})},M=()=>{S(new Set)},F=ke(s,f.searchTerm),q=F.items,U=ht(F.loadMore,F.hasMore,F.isLoadingMore),W=new Set(C.filter(m=>m.app_name).map(m=>m.app_name)),g=o==="ALL"||s.some(m=>m.id===o)?o:"ALL",N=f.search.length>0,z=e==="all"||N?q.filter(m=>{if(g!=="ALL"&&m._registryId!==g)return!1;if(N){const x=De(m);if(x&&W.has(x))return!1}return!0}):[],H=e==="connected"||N?O:[],E=async m=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),$(m.id);try{const x=rt(m,i.id,j.user.id,{remoteIndex:0}),B=x.connection_type==="STDIO",G=!!x.connection_url,X=B&&x.connection_headers&&typeof x.connection_headers=="object"&&"command"in x.connection_headers;if(!G&&!X){R.error("This MCP Server cannot be connected: no connection method available"),$(null);return}const{id:se}=await y.create.mutateAsync(x),le=await Kt({connectionId:se,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:se,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:se,flow:"connections_page_connect",error:le.error??"no_token"}),R.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:se,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${se}`,window.location.origin);await l.invalidateQueries({queryKey:st.isMCPAuthenticated(fe.href,null)}),P(),R.success("Authentication successful")}R.success("Connected successfully")}catch(x){R.error(`Failed to connect: ${x instanceof Error?x.message:String(x)}`)}finally{$(null)}}},h=Pt(),P=()=>{l.invalidateQueries({predicate:m=>{const x=m.queryKey;return x[1]===i.id&&x[3]==="collection"&&x[4]==="CONNECTIONS"}})},A=async()=>{w(!1);const m=[...c];te("connections_bulk_delete",{count:m.length});let x=0;for(const B of m)try{await h.call("COLLECTION_CONNECTIONS_DELETE",{id:B,force:!0}),x++}catch{}P(),R.success(`Deleted ${x} connection${x!==1?"s":""}`),M()},oe=async(m,x)=>{try{await y.update.mutateAsync({id:m,data:{status:x}}),P(),R.success(x==="active"?"Connection enabled":"Connection disabled")}catch{R.error("Failed to update connection")}},xe=async m=>{const x=[...c];te("connections_bulk_status_toggled",{count:x.length,to_status:m});let B=0;for(const G of x)try{await y.update.mutateAsync({id:G,data:{status:m}}),B++}catch{}P(),R.success(`${m==="active"?"Enabled":"Disabled"} ${B} connection${B!==1?"s":""}`),M()},de=async m=>{const x=L.find(X=>X.id===m);if(!x)return;te("connections_bulk_add_to_agent",{agent_id:m,count:c.size});const B=new Set(x.connections.map(X=>X.connection_id)),G=[...c].filter(X=>!B.has(X)).map(X=>({connection_id:X,selected_tools:null,selected_resources:null,selected_prompts:null}));if(G.length===0){R.info("All selected connections are already in that agent");return}try{await h.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...x.connections,...G]}}),l.invalidateQueries({predicate:X=>{const se=X.queryKey;return se[1]===i.id&&se[3]==="collection"&&se[4]==="VIRTUAL_MCP"}}),R.success(`Added ${G.length} connection${G.length!==1?"s":""} to "${x.title}"`),M()}catch{R.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...v}),t.jsx(Jt,{open:b,onOpenChange:w,count:c.size,onConfirm:A}),t.jsx(ln,{open:D,onOpenChange:r,agents:L,onConfirm:de}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(N?z.length===0&&T.length===0:e==="all"?z.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:f.search?`No Connections match "${f.search}"`:u?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(m=>{if(m.type==="group")return t.jsx(nn,{group:m,onOpen:()=>{d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:m.key}})},selectionMode:_,selectedIds:c,onToggleSelect:k},m.key);const x=m.connection,B=c.has(x.id);return t.jsx(Ce,{connection:x,fallbackIcon:t.jsx(he,{}),onClick:()=>_?k(x.id):d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),className:ge(B&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsx(sn,{connection:x,isSelected:B,selectionMode:_,canManage:u,canManageAgents:p,onToggleSelect:()=>k(x.id),onOpen:()=>d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),onToggleStatus:G=>oe(x.id,G),onDelete:()=>v.requestDelete(x)})},x.id)}),z.map(m=>t.jsx(Zt,{item:m,canManage:u,allConnections:C,connectedAppNames:W,connectingItemId:I,onNavigateConnected:x=>d({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:pe(x)}}),onConnect:E},`catalog-${m._registryId}:${m.id}`)),(e==="all"||N)&&s.length>0&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||N)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ae,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(rn,{count:c.size,total:T.length,canManage:u,canManageAgents:p,onSelectAll:()=>{S(new Set(T.map(m=>m.id)))},onDeselectAll:()=>S(new Set),onDelete:()=>w(!0),onAddToAgent:()=>r(!0),onToggleStatus:xe,onCancel:M})]})}function an(){const{org:f}=be(),e=_e(),n=Qe({strict:!1}),{data:a}=Ne.useSession(),{stdioEnabled:o}=Je(),s=_t(),{granted:i}=ye("connections:manage"),l=Qt({namespace:f.slug,resource:"connections"}),d=Ke(),[j,y]=Ye(Ze.connectionsTab(f.slug),g=>n.tab==="all"||n.tab==="connected"?n.tab:g??"all"),[C,v]=V.useState("ALL"),[u,p]=V.useState("ALL"),[c,S]=V.useState("ALL"),_=dt(),w=ke(_,l.searchTerm).items,D=l.search!==l.searchTerm,r=et({resolver:tt(zt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),I=r.watch("ui_type"),$=r.watch("connection_url"),L=r.watch("npx_package"),T=ue({uiType:I,connectionUrl:$??"",npxPackage:L??""})??Se({uiType:I,connectionUrl:$??"",registryItems:w}),O=i&&n.action==="create",k=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},M=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},F=async g=>{let N,z=null,H=null,E=null;g.ui_type==="NPX"?(N="STDIO",z="",E=Et(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(N="STDIO",z="",E=Bt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(N=g.ui_type,z=g.connection_url||"",H=g.connection_token||null);const h=it("conn");te("connection_custom_created",{connection_type:N,ui_type:g.ui_type}),await d.create.mutateAsync({id:h,title:g.title,description:g.description||null,connection_type:N,connection_url:z,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:a?.user?.id||"system",organization_id:f.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),M(),r.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:f.slug,appSlug:pe({app_name:null,connection_url:z,title:g.title,id:h})}})},q=g=>{g||(O&&M(),r.reset())},U=g=>{const N=g.trim();if(!N)return;const z=!!r.formState.dirtyFields.title,H=!!r.formState.dirtyFields.description,E=!!r.formState.dirtyFields.env_vars,h=A=>{if(A&&(!z&&!r.getValues("title").trim()&&A.title&&r.setValue("title",A.title,{shouldDirty:!1}),!H&&!(r.getValues("description")??"").trim()&&A.description&&r.setValue("description",A.description,{shouldDirty:!1}),!E&&A.envVarKeys?.length)){const oe=r.getValues("env_vars")??[],xe=new Set(oe.map(m=>m.key)),de=A.envVarKeys.filter(m=>!xe.has(m));de.length>0&&r.setValue("env_vars",[...oe,...de.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},P=Vt(N);if(P&&o){r.setValue("ui_type","NPX",{shouldDirty:!0}),r.setValue("npx_package",P.packageName,{shouldDirty:!0}),r.setValue("connection_url","",{shouldDirty:!0}),r.setValue("connection_token",null,{shouldDirty:!0}),h(ue({uiType:"NPX",npxPackage:P.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const A=I==="HTTP"||I==="SSE"||I==="Websocket"?I:"HTTP";r.setValue("ui_type",A,{shouldDirty:!0}),r.setValue("connection_url",N,{shouldDirty:!0}),h(ue({uiType:A,connectionUrl:N})??Se({uiType:A,connectionUrl:N,registryItems:w}));return}I==="NPX"&&h(ue({uiType:"NPX",npxPackage:N}))},W=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(K,{variant:"outline",onClick:k,children:[t.jsx(He,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(me,{children:[(()=>{const g="Create Connection",N="Create a custom connection in your organization. Fill in the details below.",z=r.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:r.control,name:"ui_type",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(Nt,{value:h.value,onValueChange:h.onChange,children:[t.jsx(Z,{children:t.jsx(Dt,{children:t.jsx(kt,{})})}),t.jsxs(At,{children:[t.jsx(ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),o&&t.jsxs(t.Fragment,{children:[t.jsx(ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),I==="NPX"&&t.jsx(Q,{control:r.control,name:"npx_package",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...h,value:h.value??"",onPaste:P=>{const A=P.clipboardData.getData("text");A&&(P.preventDefault(),r.setValue("npx_package",A.trim(),{shouldDirty:!0}),U(A))},onBlur:P=>{U(P.target.value),h.onBlur()}})}),t.jsx(ee,{})]})}),I==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:r.control,name:"stdio_command",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...h,value:h.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:r.control,name:"stdio_args",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...h,value:h.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:r.control,name:"stdio_cwd",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...h,value:h.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(I==="NPX"||I==="STDIO")&&t.jsx(Q,{control:r.control,name:"env_vars",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Ft,{value:h.value??[],onChange:h.onChange})}),t.jsx(ee,{})]})}),I!=="NPX"&&I!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:r.control,name:"connection_url",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...h,value:h.value??"",onPaste:P=>{const A=P.clipboardData.getData("text");A&&(P.preventDefault(),r.setValue("connection_url",A.trim(),{shouldDirty:!0}),U(A))},onBlur:P=>{U(P.target.value),h.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:r.control,name:"connection_token",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:T?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:T?.token?.placeholder??"Bearer token or API key",...h,value:h.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:"Open GitHub PAT settings"})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:r.control,name:"title",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...h})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:r.control,name:"description",render:({field:h})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx(Tt,{placeholder:"A brief description of this connection",rows:3,...h,value:h.value??""})}),t.jsx(ee,{})]})})]}),E=O;return s?t.jsx(ft,{open:E,onOpenChange:q,children:t.jsxs(jt,{className:"max-h-[90vh]",children:[t.jsx(yt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Ct,{children:g}),t.jsx(vt,{className:"mt-1",children:N})]}),t.jsx(St,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Ue,{size:16})})})]})}),t.jsx(ve,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(F),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(bt,{children:t.jsx(K,{type:"submit",disabled:r.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(Be,{open:E,onOpenChange:q,children:t.jsxs(Ee,{className:"sm:max-w-[525px]",children:[t.jsxs(Me,{children:[t.jsx(Fe,{children:g}),t.jsx(ze,{children:N})]}),t.jsx(ve,{...r,children:t.jsxs("form",{onSubmit:r.handleSubmit(F),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ve,{children:[t.jsx(K,{type:"button",variant:"outline",onClick:()=>q(!1),children:"Cancel"}),t.jsx(K,{type:"submit",disabled:r.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(me.Content,{children:t.jsx(me.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(me.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ct,{value:l.search,onChange:l.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(l.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:l.sortKey,sortDirection:l.sortDirection,onSort:l.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:C,onChange:g=>v(g||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:u,onChange:g=>p(g||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:c,onChange:g=>S(g||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(g=>({id:g.id,label:g.id.includes("community-registry")?"Community MCP Registry":g.title}))]}]:[]]})]}),W]}),t.jsx(at,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:g=>{const N=g;N!==j&&te("connections_page_tab_changed",{to_tab:N}),y(N)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:D?.5:1,transition:D?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:D?"none":"auto"},children:t.jsx(cn,{listState:l,activeTab:j,typeFilter:C,statusFilter:u,registryFilter:c,enabledRegistries:_})})})]})})})]})})}function Gs(){const f=ne.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ae,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(an,{})})}),f[0]=e):e=f[0],e}export{Gs as default};
@@ -1 +1 @@
1
- import"./index-DF3zg-P1.js";import{e as k}from"./backoff-CrEUbyZT.js";const v={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},h=Object.values(v),R="super-agent",S="task-board.item.updated",b="task-board.item.deleted",N=3e4,g=1e3;function O(n){const{buildUrl:d,eventTypes:u,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function p(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(d(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(p(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of u)t.addEventListener(r,s)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=k(N,g,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function L(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function w(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&p(e)}function D(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>w(s,c.data),s.channel=r}return L(s),s}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=D(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&y(r))}}}}function A(n,d){const u=new Set(d);return{subscribe(a,f,o){const i=l=>{u.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const _=[...h,S,b],M=_,P=_,C=O({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${M.join(",")}`,eventTypes:P,crossTab:!0}),H=A(C,[...h]),U=A(C,[S,b]),V=H;export{v as D,R as S,b as T,V as d,U as t};
1
+ import"./index-CMuj1duV.js";import{e as k}from"./backoff-CrEUbyZT.js";const v={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},h=Object.values(v),R="super-agent",S="task-board.item.updated",b="task-board.item.deleted",N=3e4,g=1e3;function O(n){const{buildUrl:d,eventTypes:u,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function p(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(d(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(p(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of u)t.addEventListener(r,s)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=k(N,g,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function L(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function w(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&p(e)}function D(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>w(s,c.data),s.channel=r}return L(s),s}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=D(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&y(r))}}}}function A(n,d){const u=new Set(d);return{subscribe(a,f,o){const i=l=>{u.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const _=[...h,S,b],M=_,P=_,C=O({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${M.join(",")}`,eventTypes:P,crossTab:!0}),H=A(C,[...h]),U=A(C,[S,b]),V=H;export{v as D,R as S,b as T,V as d,U as t};
@@ -1 +1 @@
1
- import{c as n,j as i,cM as u,l as c,F as m,cL as x,cN as j,cO as N,cQ as b,cZ as D,cP as g}from"./index-DF3zg-P1.js";import{i as h}from"./X-Dm6kY_ek.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=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/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{O as D,R as a,k as b,P as c,T as d,z as e,y as f,v as g,B as h,w as i};
1
+ import{c as n,j as i,cM as u,l as c,F as m,cL as x,cN as j,cO as N,cQ as b,cZ as D,cP as g}from"./index-CMuj1duV.js";import{i as h}from"./X--0kJVtau.js";function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=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/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function P(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{O as D,R as a,k as b,P as c,T as d,z as e,y as f,v as g,B as h,w as i};
@@ -1 +1 @@
1
- import{c as X,C as H,n as U,r as W,K as J,m as ee,d as Z,p as te,t as p,j as i,B as $}from"./index-DF3zg-P1.js";import{u as ie}from"./studio-tools-bThaob6p.js";import{b as se,S as ne,a as oe}from"./settings-section-DS6otYn7.js";import{B as Q}from"./badge-CfAmvo-h.js";import{I as ae}from"./input-BZTiU0ds.js";import{S as re,a as le,b as ce,c as de,d as me}from"./select-B6GE4jHJ.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let R;e[15]!==N||e[16]!==v?(R={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=R):R=e[17];const h=Z(R);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let V;e[22]!==S||e[23]!==y?(V={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=V):V=e[24];const P=Z(V);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let k;e[29]!==_||e[30]!==A?(k={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=k):k=e[31];const D=Z(k);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==P||e[44]!==D){let o;e[46]!==E||e[47]!==P||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>P.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=P,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=P,e[44]=D,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let w;e[59]!==T||e[60]!==C||e[61]!==L?(w=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=w):w=e[62];let F;e[63]!==M||e[64]!==w?(F=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,w]}),e[63]=M,e[64]=w,e[65]=F):F=e[65];let G;return e[66]!==O||e[67]!==F?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,F]})}),e[66]=O,e[67]=F,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
1
+ import{c as X,C as H,n as U,r as W,K as J,m as ee,d as Z,p as te,t as p,j as i,B as $}from"./index-CMuj1duV.js";import{u as ie}from"./studio-tools-CE7lpCkl.js";import{b as se,S as ne,a as oe}from"./settings-section-D-A3Bfgf.js";import{B as Q}from"./badge-DNxr1fi7.js";import{I as ae}from"./input-qdMTAJH4.js";import{S as re,a as le,b as ce,c as de,d as me}from"./select-Bhj7LCuD.js";const ue={off:"Off",auto:"Auto-join",request:"Require approval"};function fe(e,t){switch(e){case"auto":return`Anyone with a verified @${t} email joins automatically.`;case"request":return`People with a verified @${t} email can request to join; an admin approves.`;default:return"Not discoverable — no one can find or join through this domain."}}function be(){const e=X.c(69),{org:t}=H(),u=U(),s=ie(),[l,x]=W.useState("");let r;e[0]!==t.id?(r=J.organizationDomains(t.id),e[0]=t.id,e[1]=r):r=e[1];let c;e[2]!==s?(c=()=>s.call("ORGANIZATION_DOMAIN_LIST",{}),e[2]=s,e[3]=c):c=e[3];let d;e[4]!==r||e[5]!==c?(d={queryKey:r,queryFn:c},e[4]=r,e[5]=c,e[6]=d):d=e[6];const{data:f,isPending:j}=ee(d);let m;e[7]!==t.id||e[8]!==u?(m=()=>u.invalidateQueries({queryKey:J.organizationDomains(t.id)}),e[7]=t.id,e[8]=u,e[9]=m):m=e[9];const n=m;let N;e[10]!==s?(N=o=>s.call("ORGANIZATION_DOMAIN_ADD",{domain:o}),e[10]=s,e[11]=N):N=e[11];let v;e[12]!==n||e[13]!==t.id?(v=()=>{te("organization_domain_added",{organization_id:t.id}),x(""),n(),p.success("Domain added")},e[12]=n,e[13]=t.id,e[14]=v):v=e[14];let R;e[15]!==N||e[16]!==v?(R={mutationFn:N,onSuccess:v,onError:je},e[15]=N,e[16]=v,e[17]=R):R=e[17];const h=Z(R);let S;e[18]!==s?(S=o=>{const{id:a,joinMode:g}=o;return s.call("ORGANIZATION_DOMAIN_UPDATE",{id:a,joinMode:g})},e[18]=s,e[19]=S):S=e[19];let y;e[20]!==n?(y=()=>{n(),p.success("Join mode updated")},e[20]=n,e[21]=y):y=e[21];let V;e[22]!==S||e[23]!==y?(V={mutationFn:S,onSuccess:y,onError:ge},e[22]=S,e[23]=y,e[24]=V):V=e[24];const P=Z(V);let _;e[25]!==s?(_=o=>s.call("ORGANIZATION_DOMAIN_VERIFY",{id:o}),e[25]=s,e[26]=_):_=e[26];let A;e[27]!==n?(A=o=>{n(),o.verified?p.success("Domain verified"):p.error("TXT record not found yet — DNS can take a few minutes.")},e[27]=n,e[28]=A):A=e[28];let k;e[29]!==_||e[30]!==A?(k={mutationFn:_,onSuccess:A,onError:he},e[29]=_,e[30]=A,e[31]=k):k=e[31];const D=Z(k);let I;e[32]!==s?(I=o=>s.call("ORGANIZATION_DOMAIN_REMOVE",{id:o}),e[32]=s,e[33]=I):I=e[33];let b;e[34]!==n?(b=()=>{n(),p.success("Domain removed")},e[34]=n,e[35]=b):b=e[35];let q;e[36]!==I||e[37]!==b?(q={mutationFn:I,onSuccess:b,onError:xe},e[36]=I,e[37]=b,e[38]=q):q=e[38];const E=Z(q);if(j)return null;let z;e[39]!==f?.domains?(z=f?.domains??[],e[39]=f?.domains,e[40]=z):z=e[40];const K=z;let O;if(e[41]!==K||e[42]!==E||e[43]!==P||e[44]!==D){let o;e[46]!==E||e[47]!==P||e[48]!==D?(o=a=>{const g=a.verificationStatus==="verified";return i.jsx(se,{title:i.jsxs("span",{className:"flex items-center gap-2",children:[a.domain,g?i.jsx(Q,{variant:"secondary",children:"Verified"}):i.jsx(Q,{variant:"outline",children:"Pending"})]}),description:g?fe(a.joinMode,a.domain):"Add the DNS record below, then verify.",action:i.jsxs("div",{className:"flex items-center gap-2",children:[g&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:"Join mode"}),i.jsxs(re,{value:a.joinMode,onValueChange:Y=>P.mutate({id:a.id,joinMode:Y}),children:[i.jsx(le,{className:"w-44",size:"sm",children:i.jsx(ce,{})}),i.jsx(de,{children:["off","auto","request"].map(pe)})]})]}),!g&&i.jsx($,{size:"sm",variant:"outline",onClick:()=>D.mutate(a.id),disabled:D.isPending,children:"Verify"}),i.jsx($,{size:"sm",variant:"ghost",onClick:()=>E.mutate(a.id),disabled:E.isPending,children:"Remove"})]}),children:!g&&a.recordName&&a.recordValue&&i.jsx(Ne,{recordName:a.recordName,recordValue:a.recordValue})},a.id)},e[46]=E,e[47]=P,e[48]=D,e[49]=o):o=e[49],O=K.map(o),e[41]=K,e[42]=E,e[43]=P,e[44]=D,e[45]=O}else O=e[45];let B;e[50]===Symbol.for("react.memo_cache_sentinel")?(B=o=>x(o.target.value),e[50]=B):B=e[50];let M;e[51]!==l?(M=i.jsx(ae,{value:l,onChange:B,placeholder:"acme.com",className:"max-w-xs"}),e[51]=l,e[52]=M):M=e[52];let T;e[53]!==h||e[54]!==l?(T=()=>h.mutate(l.trim()),e[53]=h,e[54]=l,e[55]=T):T=e[55];let C;e[56]!==h.isPending||e[57]!==l?(C=!l.trim()||h.isPending,e[56]=h.isPending,e[57]=l,e[58]=C):C=e[58];const L=h.isPending?"Adding…":"Add domain";let w;e[59]!==T||e[60]!==C||e[61]!==L?(w=i.jsx($,{size:"sm",onClick:T,disabled:C,children:L}),e[59]=T,e[60]=C,e[61]=L,e[62]=w):w=e[62];let F;e[63]!==M||e[64]!==w?(F=i.jsxs("div",{className:"flex items-center gap-2 p-4",children:[M,w]}),e[63]=M,e[64]=w,e[65]=F):F=e[65];let G;return e[66]!==O||e[67]!==F?(G=i.jsx(ne,{title:"Email domains",description:"Let people with a matching email domain discover and join this organization.",children:i.jsxs(oe,{children:[O,F]})}),e[66]=O,e[67]=F,e[68]=G):G=e[68],G}function pe(e){return i.jsx(me,{value:e,children:ue[e]},e)}function xe(e){return p.error(e instanceof Error?e.message:"Failed to remove")}function he(e){return p.error(e instanceof Error?e.message:"Failed to verify")}function ge(e){return p.error(e instanceof Error?e.message:"Failed to update")}function je(e){return p.error(e instanceof Error?e.message:"Failed to add domain")}function Ne(e){const t=X.c(16),{recordName:u,recordValue:s}=e,l=ve;let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx("p",{className:"text-muted-foreground",children:"Add this TXT record at your DNS provider, then click Verify:"}),t[0]=x):x=t[0];let r;t[1]!==u?(r=()=>l(u),t[1]=u,t[2]=r):r=t[2];let c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("span",{className:"text-muted-foreground",children:"TXT "}),t[3]=c):c=t[3];let d;t[4]!==u||t[5]!==r?(d=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:r,children:[c,u]}),t[4]=u,t[5]=r,t[6]=d):d=t[6];let f;t[7]!==s?(f=()=>l(s),t[7]=s,t[8]=f):f=t[8];let j;t[9]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx("span",{className:"text-muted-foreground",children:"value "}),t[9]=j):j=t[9];let m;t[10]!==s||t[11]!==f?(m=i.jsxs("button",{type:"button",className:"text-left font-mono break-all hover:underline",onClick:f,children:[j,s]}),t[10]=s,t[11]=f,t[12]=m):m=t[12];let n;return t[13]!==d||t[14]!==m?(n=i.jsxs("div",{className:"mt-3 rounded-lg border border-border bg-muted/40 p-3 text-xs space-y-2",children:[x,i.jsxs("div",{className:"grid gap-1",children:[d,m]})]}),t[13]=d,t[14]=m,t[15]=n):n=t[15],n}function ve(e){navigator.clipboard?.writeText(e),p.success("Copied")}export{be as D};
@@ -1 +1 @@
1
- import{c as d,j as s,cr as i,l as c}from"./index-DF3zg-P1.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-CMuj1duV.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};
@@ -0,0 +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-CMuj1duV.js";import{i as $}from"./ChevronUp-Bwx_DvAp.js";import{i as D}from"./ChevronRight-4-DNv2jL.js";import{a as M}from"./DotsVertical-hH1ie9LK.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-DF3zg-P1.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-center 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-CMuj1duV.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-center 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-DF3zg-P1.js";import{c as O}from"./use-mcp-client-DrROXOcH.js";import{W as T}from"./constants-BHDe7bIw.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 D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function L(t){return t?D[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 Y="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?.[Y],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",C=r?.description||null,R=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,k=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,w=o?.configuration_state,A=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??[],S=a?.packageIndex??0,v=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[S]:null,l=y?null:g[v];let u,f,_=null;if(c){const h=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=L(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const M=g.length>1,N=p.length>1;let d="";c&&N?d=` (${W(c)})`:l&&M&&(d=` (${V(l)})`);const E=I+d;return{id:j("conn"),title:E,description:C,icon:R,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:_,oauth_config:k,configuration_state:w??null,configuration_scopes:A??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-CMuj1duV.js";import{c as O}from"./use-mcp-client-D2BCR1MH.js";import{W as T}from"./constants-BHDe7bIw.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 D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function L(t){return t?D[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 Y="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?.[Y],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||t.title||r?.title||r?.name||"Unnamed MCP Server",C=r?.description||null,R=r?.icons?.[0]?.src||U(r?.repository)||null,i=o?.oauth_config,k=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,w=o?.configuration_state,A=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??[],S=a?.packageIndex??0,v=a?.remoteIndex??0,y=p.length>0&&(a?.packageIndex!==void 0||g.length===0),c=y?p[S]:null,l=y?null:g[v];let u,f,_=null;if(c){const h=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=L(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const M=g.length>1,N=p.length>1;let d="";c&&N?d=` (${W(c)})`:l&&M&&(d=` (${V(l)})`);const E=I+d;return{id:j("conn"),title:E,description:C,icon:R,app_name:K(t),app_id:o?.id||t.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:_,oauth_config:k,configuration_state:w??null,configuration_scopes:A??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};
@@ -0,0 +1,2 @@
1
+ import{c as J,r as u,j as r,i as oe,B as pe,d$ as jt,aO as Nt,aU as re,e0 as St,e1 as Mt,e2 as Dt,e3 as Rt,bL as Pt,e4 as Et,e5 as Be,aQ as kt,e6 as Tt,e7 as Ot,e8 as At,e9 as Lt,ea as Ft,eb as $t,ec as It,ed as _t,ee as zt,l as ie,n as Gt,t as Q,K as Le}from"./index-CMuj1duV.js";import{F as Kt,l as Bt}from"./index-BRH7yHcF.js";import{e as Vt,aJ as Ut,aK as Wt}from"./agent-icon-BdMdPyH8.js";import{s as Qt}from"./XClose-CFj_hbve.js";import{m as qt}from"./automation-runs-CvOQZBIo.js";import{b as Fe,T as $e,a as Ie}from"./tooltip-B8wnTm17.js";import{b as Ht}from"./chat-context-BI8_Nmou.js";import{u as Xt}from"./shell-layout-DDCV5qM0.js";import{s as de,a as _e,f as Jt}from"./index-Dp8SB-ud.js";import{a as Yt,h as Zt,D as en,c as tn,d as nn,e as rn}from"./dialog-B1V0iUXV.js";import{I as ze}from"./input-qdMTAJH4.js";import{c as on,d as an,b as sn,A as ln,g as cn,e as dn,a as un,f as fn}from"./alert-dialog-BjP2s6Nc.js";import{t as mn}from"./ChevronDown-BE7JvSpD.js";import{i as pn}from"./ChevronRight-4-DNv2jL.js";import{a as xn}from"./ZoomOut-DBunTdui.js";import{v as hn,E as gn,w as Ge,x as ve,y as vn,z as Cn,A as yn,C as H,D as ue,G as wn,g as Ce,I as ye,J as bn,K as jn,M as we,N as fe,O as be,P as Nn,Q as Sn}from"./index-gAU-Arvb.js";import"./AlertCircle-DvPByT3s.js";import"./Tool01-BDwVCBnM.js";import"./ArrowUp-Dh74oxmM.js";import"./Settings02-BIuCsH3l.js";import"./Tool02-DjIBln53.js";import"./XCircle-CWZBOndb.js";import"./ArrowUpRight-DC6Yb9Jn.js";import"./TrendUp01-DdL0oR_B.js";import"./ZapSquare-CS1YImRf.js";import"./Users03-BpRSYTYN.js";import"./CheckCircle-Be2POQuF.js";import"./ChevronUp-Bwx_DvAp.js";import"./DotsVertical-hH1ie9LK.js";import"./Stars02-BF8YOJhr.js";import"./Copy01-CaaZXEMR.js";import"./Globe01-BNvAFZ7t.js";import"./Eye-s3MCo34O.js";import"./FilterLines-B8M_kRrg.js";import"./Star01-Dg6BZrlI.js";import"./Globe04-B8fLlHyp.js";import"./SwitchHorizontal01-T7cYMNoP.js";import"./HardDrive-DDRUuRUd.js";import"./Image01-DxLV4xvs.js";import"./Key01-Cq8uChmI.js";import"./LayoutLeft-riUBpORF.js";import"./LinkExternal01-DU3CPyqq.js";import"./Monitor01-0ngeB4wd.js";import"./Sun-Cd6pfpZ3.js";import"./Package-BrNfAbz_.js";import"./Palette-CtgW-PAY.js";import"./Play-CdZJWvJx.js";import"./Plus-Ca4hMAKt.js";import"./SearchLg-BGyV5Bz4.js";import"./SearchMd-CFTyyPmA.js";import"./Shield01-DdJSxLoT.js";import"./Stars01-wVvTShj4.js";import"./Trash01-CxvmthNE.js";import"./Upload01-w4HjmReL.js";import"./User01-0Zd0134v.js";import"./Users01-j-t-q-sR.js";import"./X--0kJVtau.js";import"./Zap-BfGgAuT1.js";import"./select-Bhj7LCuD.js";import"./useInfiniteQuery-B2tGgvl5.js";import"./use-infinite-scroll-0uWHf52y.js";import"./use-connection-Bubfkk8k.js";import"./use-collections-tP6FM68N.js";import"./use-mcp-client-D2BCR1MH.js";import"./constants-BHDe7bIw.js";import"./auth-DWUY37QO.js";import"./use-virtual-mcp-BIj51zng.js";import"./card-CRilZAuB.js";import"./sidebar-DeWKCtxp.js";import"./use-mobile-Cd6_A-wv.js";import"./table-ByQcTCqP.js";import"./empty-state-BHQtYUSO.js";import"./use-members-X6Ssb-cK.js";import"./use-org-auth-client-Bw3VIyYp.js";import"./use-clock-tick-BfNa5AcO.js";import"./use-automations-CvhBPwX5.js";import"./studio-tools-CE7lpCkl.js";import"./useSuspenseInfiniteQuery-BYVVsI1f.js";import"./avatar-BVfPlbpm.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-3Mpuxl0p.js";import"./file-type-icon-CGkU8X5K.js";import"./tab-id-BijBBRwE.js";import"./hooks-DtDviOax.js";import"./decopilot-sse-pool-B7Q1Pjne.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./monaco-editor-4EWxCivt.js";import"./index-jm5YycYM.js";import"./calendar-VVDY0smi.js";import"./integration-icon-ByqyfRpT.js";import"./use-navigate-to-agent-rb-KJLb8.js";import"./reusable-new-chat-CouMjkYR.js";import"./AreaChart-BtYig8Ye.js";import"./form-C9jBxN8G.js";import"./label-CnEhHuVP.js";import"./autosend-BLRimjZ_.js";import"./use-ai-providers-BO2D28v4.js";import"./location-BpLtHjTZ.js";import"./use-decopilot-events-DDSe_K7D.js";import"./use-organization-settings-B7BUH-ed.js";import"./required-auth-layout-uUQ9Dfyr.js";import"./use-org-sso-DBoYR181.js";import"./drawer-9Bvsh1k7.js";import"./collection-search-COKgSE9f.js";import"./index-B3GkLwEh.js";import"./get-initials-D-f_fDFw.js";import"./use-registry-app-DnzAi61_.js";import"./use-mcp-tools-DadUkegG.js";import"./github-repo-scope-DjMZbiKa.js";import"./authenticate-and-persist-oauth-tVxGkZPI.js";import"./mcp-oauth-CAUkOKji.js";import"./extract-connection-data-BZuABMOr.js";import"./dropdown-menu-Bel6DI3v.js";import"./popover-BXXrlEXA.js";import"./command-vkOcTid-.js";import"./index-CwggL_PJ.js";import"./tabs-CXMTix3U.js";import"./toggle-group-DPBmxHrX.js";import"./use-deco-credits-We_pqPUY.js";import"./connection-card-DU81gKdu.js";import"./use-registry-connections-dW2A6Cn6.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BPWk2Ywn.js";import"./connection-form-helpers-Dyl58fX0.js";import"./collection-tabs-ttDF8X2o.js";import"./badge-DNxr1fi7.js";import"./connect-desktop-dialog-D7YkwfUU.js";import"./select-model-BkLoUhWB.js";import"./checkbox-CcBhppQn.js";import"./skeleton-BbGF1H7-.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D-A3Bfgf.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bf8VuMQs.js";import"./toolbar-CpK88Wot.js";import"./use-capability-B2zRKwHf.js";import"./toolbar-icon-button--NaDqMEF.js";import"./use-debounced-autosave-B1u8xEPK.js";import"./index-DVJqB6A6.js";import"./search-input-Bhg65axQ.js";import"./use-mcp-auth-status-CFgkpOhb.js";import"./switch-BNLG1jmU.js";import"./github-repo-picker-DPwCOiEB.js";import"./use-debounced-value-ToigCZRD.js";import"./provision-repo-scoped-github-connection-2iDn-wQ1.js";import"./use-secrets-BDm4jx5-.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./companions-core-B9YYDQ4A.js";import"./use-file-configs-DxQ_uwCG.js";import"./automation-list-row-Bx2czjnJ.js";const Mn={"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 Dn(s){const e=J.c(51),{open:i,mode:a,initialName:c,parentLabel:f,isPending:h,onSubmit:p,onOpenChange:v}=s,C=c===void 0?"":c,d=h===void 0?!1:h,[x,y]=u.useState(C),[D,k]=u.useState(i),g=Mn[a];i!==D&&(k(i),i&&y(C));let b;e[0]!==d||e[1]!==v?(b=V=>{!V&&!d&&v(!1)},e[0]=d,e[1]=v,e[2]=b):b=e[2];const U=b;let T;e[3]!==d||e[4]!==x||e[5]!==p?(T=async V=>{V.preventDefault();const q=x.trim();!q||d||await p(q)},e[3]=d,e[4]=x,e[5]=p,e[6]=T):T=e[6];const O=T;let j;e[7]!==g.title?(j=r.jsx(Yt,{children:g.title}),e[7]=g.title,e[8]=j):j=e[8];let w;e[9]!==g.description?(w=r.jsx(Zt,{children:g.description}),e[9]=g.description,e[10]=w):w=e[10];let A;e[11]!==j||e[12]!==w?(A=r.jsxs(en,{children:[j,w]}),e[11]=j,e[12]=w,e[13]=A):A=e[13];let L;e[14]!==f?(L=f&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(ze,{value:f,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=f,e[15]=L):L=e[15];let G;e[16]===Symbol.for("react.memo_cache_sentinel")?(G=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=G):G=e[16];let $;e[17]===Symbol.for("react.memo_cache_sentinel")?($=V=>y(V.target.value),e[17]=$):$=e[17];let I;e[18]!==g.placeholder||e[19]!==d||e[20]!==x?(I=r.jsxs("div",{className:"space-y-1.5",children:[G,r.jsx(ze,{id:"file-explorer-name",value:x,onChange:$,placeholder:g.placeholder,autoFocus:!0,disabled:d})]}),e[18]=g.placeholder,e[19]=d,e[20]=x,e[21]=I):I=e[21];let R;e[22]!==I||e[23]!==L?(R=r.jsxs("div",{className:"space-y-4 py-4",children:[L,I]}),e[22]=I,e[23]=L,e[24]=R):R=e[24];let P;e[25]!==v?(P=()=>v(!1),e[25]=v,e[26]=P):P=e[26];let _;e[27]!==d||e[28]!==P?(_=r.jsx(pe,{type:"button",variant:"outline",onClick:P,disabled:d,children:"Cancel"}),e[27]=d,e[28]=P,e[29]=_):_=e[29];let z;e[30]!==d||e[31]!==x?(z=!x.trim()||d,e[30]=d,e[31]=x,e[32]=z):z=e[32];let N;e[33]!==g.submit||e[34]!==d?(N=d?r.jsxs(r.Fragment,{children:[r.jsx(oe,{size:14,className:"animate-spin"}),"Saving…"]}):g.submit,e[33]=g.submit,e[34]=d,e[35]=N):N=e[35];let K;e[36]!==z||e[37]!==N?(K=r.jsx(pe,{type:"submit",disabled:z,children:N}),e[36]=z,e[37]=N,e[38]=K):K=e[38];let S;e[39]!==_||e[40]!==K?(S=r.jsxs(tn,{children:[_,K]}),e[39]=_,e[40]=K,e[41]=S):S=e[41];let E;e[42]!==O||e[43]!==R||e[44]!==S||e[45]!==A?(E=r.jsx(nn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:O,children:[A,R,S]})}),e[42]=O,e[43]=R,e[44]=S,e[45]=A,e[46]=E):E=e[46];let W;return e[47]!==U||e[48]!==i||e[49]!==E?(W=r.jsx(rn,{open:i,onOpenChange:U,children:E}),e[47]=U,e[48]=i,e[49]=E,e[50]=W):W=e[50],W}function Rn(s){const e=J.c(31),{deleteTarget:i,deleteDirtyPaths:a,fsActionPending:c,onOpenChange:f,onConfirm:h}=s,p=i!==null,v=i?.kind==="directory"?"folder":"file";let C;e[0]!==v?(C=r.jsxs(on,{children:["Delete ",v,"?"]}),e[0]=v,e[1]=C):C=e[1];const d=i?.name;let x;e[2]!==d?(x=r.jsx("span",{className:"font-mono",children:d}),e[2]=d,e[3]=x):x=e[3];const y=i?.kind==="directory"?" and everything inside it.":".";let D;e[4]!==a.length?(D=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?"One open file has unsaved changes that will be lost.":`${a.length} open files have unsaved changes that will be lost.`]}),e[4]=a.length,e[5]=D):D=e[5];let k;e[6]!==x||e[7]!==y||e[8]!==D?(k=r.jsxs(an,{children:["This will permanently delete"," ",x,y,D]}),e[6]=x,e[7]=y,e[8]=D,e[9]=k):k=e[9];let g;e[10]!==C||e[11]!==k?(g=r.jsxs(sn,{children:[C,k]}),e[10]=C,e[11]=k,e[12]=g):g=e[12];let b;e[13]!==c?(b=r.jsx(ln,{disabled:c,children:"Cancel"}),e[13]=c,e[14]=b):b=e[14];const U=c||!i;let T;e[15]!==i||e[16]!==h?(T=L=>{L.preventDefault(),i&&h(i)},e[15]=i,e[16]=h,e[17]=T):T=e[17];let O;e[18]!==U||e[19]!==T?(O=r.jsx(cn,{disabled:U,onClick:T,children:"Delete"}),e[18]=U,e[19]=T,e[20]=O):O=e[20];let j;e[21]!==b||e[22]!==O?(j=r.jsxs(dn,{children:[b,O]}),e[21]=b,e[22]=O,e[23]=j):j=e[23];let w;e[24]!==j||e[25]!==g?(w=r.jsxs(un,{children:[g,j]}),e[24]=j,e[25]=g,e[26]=w):w=e[26];let A;return e[27]!==f||e[28]!==p||e[29]!==w?(A=r.jsx(fn,{open:p,onOpenChange:f,children:w}),e[27]=f,e[28]=p,e[29]=w,e[30]=A):A=e[30],A}var je="ContextMenu",[Pn]=kt(je,[Be]),B=Be(),[En,Ve]=Pn(je),Ue=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:f=!0}=s,[h,p]=u.useState(!1),v=B(e),C=Pt(a),d=u.useCallback(x=>{p(x),C(x)},[C]);return r.jsx(En,{scope:e,open:h,onOpenChange:d,modal:f,children:r.jsx(Et,{...v,dir:c,open:h,onOpenChange:d,modal:f,children:i})})};Ue.displayName=je;var We="ContextMenuTrigger",Qe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,f=Ve(We,i),h=B(i),p=u.useRef({x:0,y:0}),v=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),C=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(C.current),[]),x=y=>{p.current={x:y.clientX,y:y.clientY},f.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(jt,{...h,virtualRef:v}),r.jsx(Nt.span,{"data-state":f.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:re(s.onContextMenu,y=>{d(),x(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:re(s.onPointerDown,me(y=>{d(),C.current=window.setTimeout(()=>x(y),700)})),onPointerMove:a?s.onPointerMove:re(s.onPointerMove,me(d)),onPointerCancel:a?s.onPointerCancel:re(s.onPointerCancel,me(d)),onPointerUp:a?s.onPointerUp:re(s.onPointerUp,me(d))})]})});Qe.displayName=We;var kn="ContextMenuPortal",qe=s=>{const{__scopeContextMenu:e,...i}=s,a=B(e);return r.jsx(Dt,{...a,...i})};qe.displayName=kn;var He="ContextMenuContent",Xe=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Ve(He,i),f=B(i),h=u.useRef(!1);return r.jsx(Rt,{...f,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&h.current&&p.preventDefault(),h.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(h.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)"}})});Xe.displayName=He;var Tn="ContextMenuGroup",On=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Tt,{...c,...a,ref:e})});On.displayName=Tn;var An="ContextMenuLabel",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ot,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuItem",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(St,{...c,...a,ref:e})});Je.displayName=Fn;var $n="ContextMenuCheckboxItem",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(At,{...c,...a,ref:e})});In.displayName=$n;var _n="ContextMenuRadioGroup",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Lt,{...c,...a,ref:e})});zn.displayName=_n;var Gn="ContextMenuRadioItem",Kn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Ft,{...c,...a,ref:e})});Kn.displayName=Gn;var Bn="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx($t,{...c,...a,ref:e})});Vn.displayName=Bn;var Un="ContextMenuSeparator",Ye=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(Mt,{...c,...a,ref:e})});Ye.displayName=Un;var Wn="ContextMenuArrow",Qn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(It,{...c,...a,ref:e})});Qn.displayName=Wn;var qn="ContextMenuSubTrigger",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(_t,{...c,...a,ref:e})});Hn.displayName=qn;var Xn="ContextMenuSubContent",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=B(i);return r.jsx(zt,{...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)"}})});Jn.displayName=Xn;function me(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var Yn=Ue,Zn=Qe,er=qe,tr=Xe,nr=Je,rr=Ye;function or(s){const e=J.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(Yn,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ir(s){const e=J.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(Zn,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=J.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=ie("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 f;return e[5]!==a||e[6]!==c?(f=r.jsx(er,{children:r.jsx(tr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}function ee(s){const e=J.c(12);let i,a,c,f;e[0]!==s?({className:i,inset:a,variant:f,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=f):(i=e[1],a=e[2],c=e[3],f=e[4]);const h=f===void 0?"default":f;let p;e[5]!==i?(p=ie("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 v;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==h?(v=r.jsx(nr,{"data-slot":"context-menu-item","data-inset":a,"data-variant":h,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=h,e[11]=v):v=e[11],v}function Ke(s){const e=J.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=ie("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let f;return e[5]!==a||e[6]!==c?(f=r.jsx(rr,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=f):f=e[7],f}const sr="#d9a441";function lr(s){const e=J.c(45),{node:i,depth:a,isExpanded:c,isSelected:f,isLoading:h,fileVisual:p,onOpen:v,onSelect:C,onNewFile:d,onNewFolder:x,onCopyPath:y,onCopyRelativePath:D,onRename:k,onDelete:g}=s,b=h===void 0?!1:h,U=i.kind==="directory",{Icon:T,color:O}=p,j=f&&"bg-accent";let w;e[0]!==j?(w=ie("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",j),e[0]=j,e[1]=w):w=e[1];const A=`${a*14+8}px`;let L;e[2]!==A?(L={paddingLeft:A},e[2]=A,e[3]=L):L=e[3];let G;e[4]!==v||e[5]!==C?(G=()=>{C(),v()},e[4]=v,e[5]=C,e[6]=G):G=e[6];let $;e[7]!==T||e[8]!==O||e[9]!==U||e[10]!==c||e[11]!==b?($=U?r.jsxs(r.Fragment,{children:[b?r.jsx(oe,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(mn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(pn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(xn,{size:16,className:"shrink-0",style:{color:sr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(T,{size:16,className:"shrink-0",style:{color:O}})]}),e[7]=T,e[8]=O,e[9]=U,e[10]=c,e[11]=b,e[12]=$):$=e[12];let I;e[13]!==i.name?(I=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=I):I=e[14];let R;e[15]!==w||e[16]!==L||e[17]!==G||e[18]!==$||e[19]!==I?(R=r.jsx(ir,{asChild:!0,children:r.jsxs("button",{type:"button",className:w,style:L,onClick:G,children:[$,I]})}),e[15]=w,e[16]=L,e[17]=G,e[18]=$,e[19]=I,e[20]=R):R=e[20];let P;e[21]!==d?(P=r.jsx(ee,{onSelect:d,children:"New File"}),e[21]=d,e[22]=P):P=e[22];let _;e[23]!==x?(_=r.jsx(ee,{onSelect:x,children:"New Folder"}),e[23]=x,e[24]=_):_=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=r.jsx(Ke,{}),e[25]=z):z=e[25];let N;e[26]!==y?(N=r.jsx(ee,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=N):N=e[27];let K;e[28]!==D?(K=r.jsx(ee,{onSelect:D,children:"Copy Relative Path"}),e[28]=D,e[29]=K):K=e[29];let S;e[30]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(Ke,{}),e[30]=S):S=e[30];let E;e[31]!==k?(E=r.jsx(ee,{onSelect:k,children:"Rename"}),e[31]=k,e[32]=E):E=e[32];let W;e[33]!==g?(W=r.jsx(ee,{variant:"destructive",onSelect:g,children:"Delete"}),e[33]=g,e[34]=W):W=e[34];let V;e[35]!==P||e[36]!==_||e[37]!==N||e[38]!==K||e[39]!==E||e[40]!==W?(V=r.jsxs(ar,{className:"w-52",children:[P,_,z,N,K,S,E,W]}),e[35]=P,e[36]=_,e[37]=N,e[38]=K,e[39]=E,e[40]=W,e[41]=V):V=e[41];let q;return e[42]!==V||e[43]!==R?(q=r.jsxs(or,{children:[R,V]}),e[42]=V,e[43]=R,e[44]=q):q=e[44],q}Bt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function cr(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function na({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,f]=u.useState({files:[],directories:[],truncated:!1}),{files:h,directories:p}=c,[v,C]=u.useState(new Set),[d,x]=u.useState(null),[y,D]=u.useState(null),[k,g]=u.useState([]),[b,U]=u.useState(""),[T,O]=u.useState(!1),[j,w]=u.useState(!1),[,A]=u.useState(new Set),[L,G]=u.useState(new Set),$=u.useRef(0),I=u.useRef(null),R=u.useRef(new Set),P=u.useRef(new Map);function _(t){A(n=>{const o=typeof t=="function"?t(n):t;return R.current=o,o})}const[z,N]=u.useState(new Map),K=u.useRef(null),[S,E]=u.useState(null),{sendMessage:W}=Ht(),{openSidePanel:V}=Xt(),q=Gt(),[F,X]=u.useState(null),[xe,he]=u.useState(null),[ae,se]=u.useState(!1);async function Y(t,n){const o=await fetch(cr(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 le(){q.invalidateQueries({queryKey:_e(s,e,i)})}function Ne(t,n){navigator.clipboard.writeText(n).then(()=>Q.success(`${t} copied`),()=>Q.error(`Failed to copy ${t.toLowerCase()}`))}function Ze(t){const n=Nn(t);if(!n)return;const o=`${s}/${e}/${i}`;q.setQueryData(Le.decofile(o),l=>{if(!l)return l;const{[n]:m,...M}=l;return M}),q.invalidateQueries({queryKey:Le.liveMeta(s,e,i)})}function et(t){const n=t.kind==="file"?[t.path]:h.filter(o=>o.startsWith(".deco/blocks/")).map(o=>ue(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)Ze(o)}function tt(t){const n=ue(t);return k.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=z.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Se(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),x(n=>n&&t(n)),N(n=>{const o=new Map;for(const[l,m]of n){const M=t(l);M&&o.set(M,m)}return o}),D(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 nt(t){const n=ue(t);D(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Se(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function rt(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);await Y("write",{path:H(n),content:""}),await te(),await le(),X(null),ge(n)}async function ot(t){if(!F)return;const n=fe(F.parentDir,t);if(be(n,h,p))throw new Error(`"${t}" already exists`);const o=H(n);await Y("mkdir",{path:o}),f(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await te(),await le(),X(null),C(l=>{const m=new Set(l);for(const M of ve(n))m.add(M);return m.add(n),m}),D({name:t,path:n,kind:"directory",children:[]})}async function it(t){if(!F)return;const n=F.node.path,o=we(n),l=fe(o,t);if(l===n){X(null);return}if(be(l,h,p))throw new Error(`"${t}" already exists`);await Y("rename",{from:H(n),to:H(l)}),Se(m=>m===n?l:m.startsWith(`${n}/`)?fe(l,m.slice(n.length+1)):m),await te(),await le(),X(null)}async function at(t){se(!0);try{await Y("unlink",{path:H(t.path),recursive:t.kind==="directory"}),et(t),nt(t.path),await te(),await le(),he(null),Q.success(`Deleted "${t.name}"`)}catch(n){Q.error(n instanceof Error?n.message:"Delete failed")}finally{se(!1)}}async function st(t){const n=jn(t);if(n){Q.error(n);return}se(!0);try{F?.mode==="new-file"?(await rt(t),Q.success(`Created "${t}"`)):F?.mode==="new-folder"?(await ot(t),Q.success(`Created folder "${t}"`)):F?.mode==="rename"&&(await it(t),Q.success(`Renamed to "${t}"`))}catch(o){Q.error(o instanceof Error?o.message:"Operation failed")}finally{se(!1)}}const Me=u.useRef(!1);Me.current||(Me.current=!0,I.current=te());const[lt,ct]=u.useState(null);if(a&&a!==lt){ct(a);const t=a;queueMicrotask(()=>{hn(t)&&ge(t).catch(n=>{Q.error(n instanceof Error?n.message:"Failed to open file")})})}async function De(t){const n=await Y("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Re(t,n,o){if(o!==$.current)return!1;let l=!1;return f(m=>{const M=n?Sn(m.files,m.directories,t,m.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!M.truncated,{files:M.files,directories:M.directories,truncated:l}}),l&&Q.warning("File list truncated — some files may be hidden"),l}async function dt(t){const n=P.current.get(t);if(n)return n;const o=$.current,l=(async()=>{const m=await De({pattern:"**/*",path:H(t),limit:Ge}),M=Re(m,!0,o);return!M&&o===$.current&&_(ne=>{const ce=new Set(ne);return ce.add(t),ce}),M})();P.current.set(t,l);try{return await l}finally{P.current.delete(t)}}async function Pe(t){if(!ye(t,R.current))return!1;G(n=>new Set(n).add(t));try{return await dt(t)}finally{G(n=>{const o=new Set(n);return o.delete(t),o})}}async function ut(t){const n=new Set(R.current);for(const o of ve(t)){if(!ye(o,n))continue;if(await Pe(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function te(){const t=++$.current;P.current.clear(),O(!0),_(new Set),C(new Set),G(new Set);try{const n=await De({pattern:"**/*",limit:Ge,maxDepth:gn});Re(n,!1,t),w(!0)}catch{j&&Q.error("Failed to refresh file tree")}finally{O(!1)}}async function Ee(t){if(!z.get(t)?.loaded){N(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await Y("read",{path:H(t),full:!0}),l=bn(o.content??"");N(m=>{const M=new Map(m);return M.set(t,{savedContent:l,editorValue:l,loaded:!0}),M})}catch{}}}async function ft(t,n){try{await Y("write",{path:H(t),content:n}),de("file saved via sandbox /write",{path:t}),q.invalidateQueries({queryKey:_e(s,e,i)});try{const o=await Jt(s,e,i);de("git status after save",o)}catch(o){de("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}N(o=>{const l=new Map(o),m=l.get(t);return m&&l.set(t,{...m,savedContent:n}),l})}catch(o){de("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function mt(t){x(t),D({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),E(null),k.includes(t)||g(n=>[...n,t]),Ee(t)}function pt(t){g(n=>{const o=n.filter(l=>l!==t);return d===t&&x(o[o.length-1]??null),o}),N(n=>{const o=new Map(n);return o.delete(t),o})}function ke(t){C(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function xt(t){if(ye(t,R.current))try{if(await Pe(t))return}catch(n){Q.error(n instanceof Error?n.message:"Failed to load folder");return}ke(t)}async function ht(t,n){if(n){ke(t);return}await xt(t)}async function ge(t){await I.current,await ut(t);const n=ve(t);C(o=>{const l=new Set(o);for(const m of n)l.add(m);return l}),mt(t)}function gt(){return y?.kind==="directory"?y.path:y?.kind==="file"?we(y.path):d?we(d):"/"}function Te(t){const n=gt();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const vt=vn(h,p),Oe=Cn(vt,v),Ae=b?Oe.filter(t=>t.node.name.toLowerCase().includes(b.toLowerCase())):Oe,Z=d?z.get(d):null,Ct=Z?.loaded&&Z.editorValue!==Z.savedContent,yt=xe?tt(xe.path):[],wt=(t,n)=>{K.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ft(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const m=l.getValueInRange(o);E({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:m})})};function bt(t){if(!S)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${S.filePath}\``,`**Lines:** ${S.lineStart}–${S.lineEnd}`];if(S.selectedCode){const o=Ce(S.filePath),l=S.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),V("chat"),W({parts:[{type:"text",text:n.join(`
2
+ `)}]}),E(null)}return T&&!j?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{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(Vt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:b,onChange:t=>U(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(Fe,{children:[r.jsx($e,{asChild:!0,children:r.jsx(pe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Te("new-file"),children:r.jsx(Ut,{size:14})})}),r.jsx(Ie,{side:"bottom",children:"New file"})]}),r.jsxs(Fe,{children:[r.jsx($e,{asChild:!0,children:r.jsx(pe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Te("new-folder"),children:r.jsx(Wt,{size:14})})}),r.jsx(Ie,{side:"bottom",children:"New folder"})]})]}),r.jsx(qt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ae.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",m=v.has(n.path),M=y?.path===n.path,ne=yn(n.path,n.kind),ce=l&&L.has(n.path);return r.jsx(lr,{node:n,depth:o,isExpanded:m,isSelected:M,isLoading:ce,fileVisual:wn(n.name),onSelect:()=>D(n),onOpen:()=>{l?ht(n.path,m):ge(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:ne}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:ne}),onCopyPath:()=>Ne("Path",ue(n.path)),onCopyRelativePath:()=>Ne("Relative path",H(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:ne}),onDelete:()=>he(n)},n.path)}),j&&Ae.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:b?`No files match "${b}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[k.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:k.map(t=>{const n=z.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,m=t.split("/").pop()??t;return r.jsxs("div",{className:ie("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:()=>{x(t),Ee(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:m}),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:M=>{M.stopPropagation(),pt(t)},children:r.jsx(Qt,{size:12})})]},t)})}),S&&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()&&bt(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"&&E(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&&Z?.loaded?r.jsx(Kt,{language:Ce(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:d,onChange:t=>{const n=d;n&&N(o=>{const l=new Map(o),m=l.get(n);return m&&l.set(n,{...m,editorValue:t??""}),l})},onMount:wt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{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&&!Z?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(oe,{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:[Ct?"Modified":"Saved"," ·"," ",Ce(d)]})]})]}),r.jsx(Dn,{open:F!==null,mode:F?.mode??"new-file",initialName:F?.mode==="rename"?F.node.name:"",parentLabel:F&&F.mode!=="rename"?F.parentDir==="/"?"/":H(F.parentDir):void 0,isPending:ae,onSubmit:st,onOpenChange:t=>{!t&&!ae&&X(null)}}),r.jsx(Rn,{deleteTarget:xe,deleteDirtyPaths:yt,fsActionPending:ae,onOpenChange:t=>{!t&&!ae&&he(null)},onConfirm:t=>{at(t)}})]})}export{na as FileExplorer};