decocms 4.500.0 → 4.500.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-CHPU_j8T.js → ActiveShapeUtils-CeZzOoVf.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-CgfWDsMW.js → AlertCircle-D4iOZ3Bs.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CZuIkHuk.js → AreaChart-CUWmFHwI.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BkyozCr0.js → ArrowLeft-iygYSRbQ.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-C0O7U47F.js → ArrowUp-KCSPs-fi.js} +1 -1
  6. package/dist/client/assets/{BarChart-D_Vp8_nk.js → BarChart-gbo6r8aY.js} +1 -1
  7. package/dist/client/assets/{Building02-C5UvSZSt.js → Building02-EbX1A23K.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-CYT1jRTo.js → CategoricalChart-DbqLrstZ.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-B1cLRmIj.js → CheckCircle-CoJfU94i.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-bEeSv3mr.js → ChevronSelectorVertical-DqpRXMOM.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-D_qU7VrJ.js → ChevronUp-BSm7AtSf.js} +1 -1
  12. package/dist/client/assets/{Copy01-CT_cEqll.js → Copy01-DlA26aBh.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DFGzM4td.js → CreditCard01-CXGPcE51.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-CGu7Zbqo.js → DotsVertical-CTugBooH.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-BOQmu79L.js → ErrorBarContext-CJdWK23B.js} +1 -1
  16. package/dist/client/assets/{Globe04-DtoCZsmb.js → Globe04-DDiW2Onm.js} +1 -1
  17. package/dist/client/assets/{Image01-CyU1b2Nz.js → Image01-BjUHwjIr.js} +1 -1
  18. package/dist/client/assets/{Key01-CV4MPPMx.js → Key01-DMnhMxC3.js} +1 -1
  19. package/dist/client/assets/{Link01-BL0KHGWk.js → Link01-DKypA3Uf.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-CImL6HGl.js → LinkBroken01-Cjxu7rCw.js} +1 -1
  21. package/dist/client/assets/{Monitor01-jDiltU3l.js → Monitor01-CTL-UG2p.js} +1 -1
  22. package/dist/client/assets/{Play-HeD-LWQ6.js → Play-NZWCLDah.js} +1 -1
  23. package/dist/client/assets/{Plus-BzLmRH_e.js → Plus-DLTeBarI.js} +1 -1
  24. package/dist/client/assets/{SearchMd-X-m-ot0f.js → SearchMd-BsNWsFDv.js} +1 -1
  25. package/dist/client/assets/{Sector-Dk1WFIe-.js → Sector-BRgBibA6.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-C30WMfg1.js → ShoppingBag01-CWlRU3Ye.js} +1 -1
  27. package/dist/client/assets/{Sun-D5cuTnns.js → Sun-DhZMu2lN.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-iT36Ixqz.js → SwitchHorizontal01-DZEm8csq.js} +1 -1
  29. package/dist/client/assets/{Tool01-BLdqmAM-.js → Tool01-o_nJ7Y1x.js} +1 -1
  30. package/dist/client/assets/{Trash01-DkcAHDGj.js → Trash01-JZaZB0vu.js} +1 -1
  31. package/dist/client/assets/{Upload01-CJxfk4_B.js → Upload01-CpEePL13.js} +1 -1
  32. package/dist/client/assets/{User01-CuJbE_Yd.js → User01-BGOQS9vx.js} +1 -1
  33. package/dist/client/assets/{UserSquare-BlSFjBrQ.js → UserSquare-BFlEW2x5.js} +1 -1
  34. package/dist/client/assets/{Users01-CgCEjxiR.js → Users01-C9dOtgmV.js} +1 -1
  35. package/dist/client/assets/{XAxis-B6hTknR7.js → XAxis-4jP2_ps6.js} +1 -1
  36. package/dist/client/assets/{XClose-BcQlXPoY.js → XClose-DO008B8R.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-C_NtAfgt.js → ZoomOut-DA1sRe95.js} +1 -1
  38. package/dist/client/assets/{access-gate-0Qu33vtT.js → access-gate-DsVMqwjM.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-CmVGiYmi.js → add-connection-dialog-BTQ6Snbx.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-DbQCZ1PQ.js → agent-analytics-CpGEVH02.js} +1 -1
  41. package/dist/client/assets/agent-app-fS8AS09U.js +1 -0
  42. package/dist/client/assets/{agent-assets-B-t0qw5_.js → agent-assets-D1AunKzQ.js} +1 -1
  43. package/dist/client/assets/{agent-automation-AdWBGK9-.js → agent-automation-Ds-y1bNp.js} +1 -1
  44. package/dist/client/assets/{agent-automations-x2lM3jDX.js → agent-automations-Bhv6Y5Fg.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-DygiFIri.js → agent-connect-sources-BWYssaAs.js} +1 -1
  46. package/dist/client/assets/agent-deck-BSKZhX9C.js +1 -0
  47. package/dist/client/assets/{agent-e2e-CDURPj47.js → agent-e2e-mBRBGP-4.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-BIa2lB5Q.js → agent-experiments-aivx3wKk.js} +1 -1
  49. package/dist/client/assets/{agent-file-BKXQWZUy.js → agent-file-p8VPN5Ls.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-BYQZVYMZ.js → agent-hosting-BLydMzz1.js} +1 -1
  51. package/dist/client/assets/{agent-icon-CsQzAnP1.js → agent-icon-DDBSTxwl.js} +1 -1
  52. package/dist/client/assets/agent-library-BORVKAKi.js +1 -0
  53. package/dist/client/assets/agent-library-file-CQVtmhou.js +1 -0
  54. package/dist/client/assets/{agent-monitor-CCT32NKJ.js → agent-monitor-DwF-OeKx.js} +1 -1
  55. package/dist/client/assets/{agent-overview-dfgPX_7d.js → agent-overview-PzlD3Gdw.js} +1 -1
  56. package/dist/client/assets/agent-settings-CP8WaMNS.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-CG3fYjTa.js → agent-site-editor-BpVIjbEo.js} +1 -1
  58. package/dist/client/assets/agent-site-editor-code-DBqdRzpW.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content-5eCWHoNS.js → agent-site-editor-content-UkRK2sPZ.js} +3 -3
  60. package/dist/client/assets/{agent-site-editor-preview-uwuaRHqi.js → agent-site-editor-preview-CMWo8Jpl.js} +3 -3
  61. package/dist/client/assets/agent-view-BHgh3Lxp.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-e44iAytb.js → agent-view-guard-CNj-ECwU.js} +1 -1
  63. package/dist/client/assets/{agents-list-C2x26zj4.js → agents-list-DIvEheHR.js} +1 -1
  64. package/dist/client/assets/{ai-providers-DwXqL2iz.js → ai-providers-Bv4VnLS0.js} +1 -1
  65. package/dist/client/assets/{alert-DYD14Lxr.js → alert-DYBIxnQj.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-D2yDyccd.js → alert-dialog-DpmCpPBI.js} +1 -1
  67. package/dist/client/assets/{analytics-sections-CYXgA9AC.js → analytics-sections-Dv6tHtpt.js} +1 -1
  68. package/dist/client/assets/{api-keys-BtQl5Awe.js → api-keys-BpociG2u.js} +1 -1
  69. package/dist/client/assets/api-keys-DLMcrFXL.js +1 -0
  70. package/dist/client/assets/app-editor-CJc6hCJ6.js +1 -0
  71. package/dist/client/assets/{asset-utils-cuI-wo7N.js → asset-utils-BUihGB_o.js} +1 -1
  72. package/dist/client/assets/{auth-CsAAW7Ar.js → auth-D1PkW9Uj.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-CDMks_Rc.js → auth-catchall-xah8Rp3j.js} +1 -1
  74. package/dist/client/assets/{auth-entry-Cwn8f6E3.js → auth-entry-VLEYf8tT.js} +1 -1
  75. package/dist/client/assets/{auth-split-layout-DFsDNY_O.js → auth-split-layout-HBBBJTJB.js} +1 -1
  76. package/dist/client/assets/{authenticate-and-persist-oauth-HfpfV8ZS.js → authenticate-and-persist-oauth-BfNR0joU.js} +1 -1
  77. package/dist/client/assets/{automation-list-row-Bgtl2dei.js → automation-list-row-IGsRC78W.js} +1 -1
  78. package/dist/client/assets/{automation-runs-CBT3E_fm.js → automation-runs-C60W3bGo.js} +1 -1
  79. package/dist/client/assets/{automations-BSD8vInf.js → automations-CaS6shwH.js} +1 -1
  80. package/dist/client/assets/{autosend-8ZqTuUx9.js → autosend-D3KZZhDs.js} +1 -1
  81. package/dist/client/assets/{avatar-Da-P84-z.js → avatar-Brh_8d7a.js} +1 -1
  82. package/dist/client/assets/{badge-CJ5q8uJu.js → badge-Dp13ql_I.js} +1 -1
  83. package/dist/client/assets/{block-document-Drzpg_bb.js → block-document-Cxj1MUpK.js} +1 -1
  84. package/dist/client/assets/{blocks-preview-workspace-context-CJnlWxc-.js → blocks-preview-workspace-context-D7M7BwP7.js} +1 -1
  85. package/dist/client/assets/{blog-schema-WI1e8zgj.js → blog-schema-G4wBIdc6.js} +1 -1
  86. package/dist/client/assets/{board-analytics-Cla3ZHOc.js → board-analytics-DO-wkHdX.js} +1 -1
  87. package/dist/client/assets/{buckets-BO0Sw74J.js → buckets-C5bRLlmM.js} +1 -1
  88. package/dist/client/assets/{build-improve-prompt-doc-BWoapP6S.js → build-improve-prompt-doc-DHL2uEEa.js} +1 -1
  89. package/dist/client/assets/{calendar-DKYy6uOJ.js → calendar-DEB-AUfC.js} +1 -1
  90. package/dist/client/assets/{capability-load-error-DGJphxbe.js → capability-load-error-CR2FG7xy.js} +1 -1
  91. package/dist/client/assets/{category-editor-C6uMv0OA.js → category-editor-DfXKd-cd.js} +1 -1
  92. package/dist/client/assets/{chart-CUhY88so.js → chart-CXoR26LQ.js} +1 -1
  93. package/dist/client/assets/{chat-context-y8u3K9Tq.js → chat-context-BR-PmAJg.js} +1 -1
  94. package/dist/client/assets/{chat-draft-RqSOe2VX.js → chat-draft-CWFQi3-d.js} +1 -1
  95. package/dist/client/assets/{checkbox-cuQOxwwj.js → checkbox-CGTvhz0x.js} +1 -1
  96. package/dist/client/assets/{choose-editor-DVY0m-0N.js → choose-editor-DBCIeCbR.js} +1 -1
  97. package/dist/client/assets/{claim-phase-copy-kSJ81npa.js → claim-phase-copy-C0pvoElR.js} +1 -1
  98. package/dist/client/assets/{cli-auth-success-BNNiQ0ff.js → cli-auth-success-Nd2PZ9ox.js} +1 -1
  99. package/dist/client/assets/{client-icons-k3K_Wm7m.js → client-icons-BI4heyKD.js} +1 -1
  100. package/dist/client/assets/{collapsible-DEfXG6Ht.js → collapsible-Cq1aFrCg.js} +1 -1
  101. package/dist/client/assets/{collection-detail-CUR7b1nw.js → collection-detail-ClkMaErn.js} +1 -1
  102. package/dist/client/assets/{collection-display-button-Bii74DZw.js → collection-display-button-BjwUZtSd.js} +1 -1
  103. package/dist/client/assets/{collection-search-C-3HPALa.js → collection-search-Cp82h57b.js} +1 -1
  104. package/dist/client/assets/{collection-table-wrapper-BI9XAUwm.js → collection-table-wrapper-BmpUFI8T.js} +1 -1
  105. package/dist/client/assets/{collection-tabs-BNpEfqyd.js → collection-tabs-C6HP7d51.js} +1 -1
  106. package/dist/client/assets/{column-rules-B7pcw_Gh.js → column-rules-CJ4d_g8W.js} +1 -1
  107. package/dist/client/assets/{combobox-ylZ1_mxm.js → combobox-CF6B9Wmt.js} +1 -1
  108. package/dist/client/assets/{command-d2fvY4gQ.js → command-BfXTTBD9.js} +1 -1
  109. package/dist/client/assets/{companion-mcps-section--NCFPgCd.js → companion-mcps-section-BLJLcZpb.js} +1 -1
  110. package/dist/client/assets/{config-BDYRd6Wk.js → config-BZYNAwT6.js} +1 -1
  111. package/dist/client/assets/{connect-CKDAuMYC.js → connect-FZH1ks7l.js} +1 -1
  112. package/dist/client/assets/{connect-layout-Ca1Vr3vz.js → connect-layout-BbzklNPm.js} +1 -1
  113. package/dist/client/assets/{connection-DGqqVA7M.js → connection-BTT1rt_2.js} +1 -1
  114. package/dist/client/assets/{connection-card-gIhz0wdg.js → connection-card-CsIFgDe8.js} +1 -1
  115. package/dist/client/assets/{connection-detail-B9omyXwb.js → connection-detail-BSkgGFWF.js} +1 -1
  116. package/dist/client/assets/{connection-form-helpers-A2MriNrX.js → connection-form-helpers-Bg3g47y2.js} +1 -1
  117. package/dist/client/assets/{connections-Dh4JuodF.js → connections-BcHX4l-p.js} +1 -1
  118. package/dist/client/assets/{context-BnF04rBC.js → context-D9dob61q.js} +1 -1
  119. package/dist/client/assets/{context-menu-BD-010iM.js → context-menu-DPNtSYt0.js} +1 -1
  120. package/dist/client/assets/{core.esm-BH3HyyF2.js → core.esm-C90YQIGJ.js} +1 -1
  121. package/dist/client/assets/{create-organization-dialog-DjZlmVnS.js → create-organization-dialog-BoHINOyM.js} +1 -1
  122. package/dist/client/assets/{daily-pulse-BXDtpJQU.js → daily-pulse-tLPif3nO.js} +1 -1
  123. package/dist/client/assets/{device-hint-CN2khPPs.js → device-hint-ClxhQWtk.js} +1 -1
  124. package/dist/client/assets/{discover-C-mYnXQB.js → discover-BGUAZcdZ.js} +1 -1
  125. package/dist/client/assets/{domain-settings-BEwECWE8.js → domain-settings-C1KL1CIp.js} +1 -1
  126. package/dist/client/assets/{drawer-DybzZn1x.js → drawer-20Gv7XN0.js} +1 -1
  127. package/dist/client/assets/{editor-CBqQFFb9.js → editor-CklcmkgZ.js} +1 -1
  128. package/dist/client/assets/{empty-state-B4qRMioD.js → empty-state-BWSdqiOv.js} +1 -1
  129. package/dist/client/assets/{empty-state-b6tRqzU8.js → empty-state-CsVqjGqu.js} +1 -1
  130. package/dist/client/assets/{extract-connection-data-CIO9f-TD.js → extract-connection-data-C8Idk1Oj.js} +1 -1
  131. package/dist/client/assets/{feature-gate-ChDRcm7b.js → feature-gate-Brul-7Vc.js} +1 -1
  132. package/dist/client/assets/{feature-paywall-BN5FphJ8.js → feature-paywall-B1-Kq6zS.js} +1 -1
  133. package/dist/client/assets/{file-explorer-DCd1-8-d.js → file-explorer-0AwiXzsI.js} +1 -1
  134. package/dist/client/assets/{file-preview-CNp5DdHM.js → file-preview-BTrgY74n.js} +1 -1
  135. package/dist/client/assets/{file-share-button-DOQq6Wrq.js → file-share-button-kQh5APqr.js} +1 -1
  136. package/dist/client/assets/{file-type-icon-ClWl2ykw.js → file-type-icon-Dbuavq5L.js} +1 -1
  137. package/dist/client/assets/flat-project-YGEAxpJq.js +1 -0
  138. package/dist/client/assets/{folder-icon-BO5Hlc-b.js → folder-icon-D1xnfwm_.js} +1 -1
  139. package/dist/client/assets/{form-Dm1N7Fdz.js → form-BZ1i_2GJ.js} +1 -1
  140. package/dist/client/assets/{general-CszMiv7n.js → general-C8gjvVqx.js} +1 -1
  141. package/dist/client/assets/{home-DT4jq_ad.js → home-BnDlnEHu.js} +1 -1
  142. package/dist/client/assets/{icon-button-UzqZkmgc.js → icon-button-BDbIWVW3.js} +1 -1
  143. package/dist/client/assets/{index-D984WV3U.js → index-4XFLhK7S.js} +2 -2
  144. package/dist/client/assets/{index-B4rQ5Ej9.js → index-Bs_Ow9qj.js} +1 -1
  145. package/dist/client/assets/{index-BkaImz4P.js → index-C0n7mPS1.js} +1 -1
  146. package/dist/client/assets/{index-DXSiv_GM.js → index-C8VO6rJ2.js} +3 -3
  147. package/dist/client/assets/{index-z9lysifj.js → index-CN8TQhg6.js} +1 -1
  148. package/dist/client/assets/{index-ClN0hPjk.js → index-COd_qFje.js} +1 -1
  149. package/dist/client/assets/{index-QP5dyfS7.js → index-CWl9v4eu.js} +1 -1
  150. package/dist/client/assets/{index-Dq9ehfIf.js → index-D94af8m5.js} +1 -1
  151. package/dist/client/assets/{index-ba_EB2Zw.js → index-DVVx4F0i.js} +1 -1
  152. package/dist/client/assets/{index-DiGKvbHH.js → index-DlsOrQnt.js} +1 -1
  153. package/dist/client/assets/{index-BA22z-aT.js → index-DrIzKTur.js} +1 -1
  154. package/dist/client/assets/{index-ChAMt2d-.js → index-DujNp8wX.js} +1 -1
  155. package/dist/client/assets/{index-CeuDCj_w.js → index-pEr2eE8n.js} +1 -1
  156. package/dist/client/assets/{index-redirect-8HspsPDC.js → index-redirect-BQGkKPeS.js} +1 -1
  157. package/dist/client/assets/{infiniteQueryObserver-Bmwf-SCt.js → infiniteQueryObserver-DLzEnjM8.js} +1 -1
  158. package/dist/client/assets/{infra-billing-DlP3vLBN.js → infra-billing-Df_WNbOe.js} +1 -1
  159. package/dist/client/assets/{input-C_t2NUbp.js → input-BzdgO_dK.js} +3 -3
  160. package/dist/client/assets/{input-CG0PFhS0.js → input-DQtH0um6.js} +1 -1
  161. package/dist/client/assets/{integration-icon-B4EO_1fi.js → integration-icon-BqsHjS-b.js} +1 -1
  162. package/dist/client/assets/{jira-icon-DAy3a9S9.js → jira-icon-CG6W0SJT.js} +1 -1
  163. package/dist/client/assets/{label-BszVxI8j.js → label-ByKoWpTn.js} +1 -1
  164. package/dist/client/assets/{layout-BsHSUbxL.js → layout-Ih9F7QDG.js} +1 -1
  165. package/dist/client/assets/{legacy-agents-deep-DCBghYlF.js → legacy-agents-deep-D4aZSj1S.js} +1 -1
  166. package/dist/client/assets/{legacy-main-redirect-C_9Fyd8e.js → legacy-main-redirect-CawnT8bs.js} +1 -1
  167. package/dist/client/assets/library-BIKWwK0_.js +1 -0
  168. package/dist/client/assets/{library-tab-CZxlOQVR.js → library-tab-CWnL_FfR.js} +1 -1
  169. package/dist/client/assets/{login-CoP-xpgM.js → login-BV5vcG2Q.js} +1 -1
  170. package/dist/client/assets/{markdown-C8b2SRJt.js → markdown-BW2GJSHC.js} +1 -1
  171. package/dist/client/assets/{mcp-app-renderer-qrtR9Z1h.js → mcp-app-renderer-fDcax7T2.js} +1 -1
  172. package/dist/client/assets/{mcp-oauth--_7bIOac.js → mcp-oauth-BjHElKzR.js} +1 -1
  173. package/dist/client/assets/{mcp-oauth-BIr9y8Ow.js → mcp-oauth-CVI2AkSu.js} +1 -1
  174. package/dist/client/assets/{members-DX1jVu8f.js → members-f-Grp_Zc.js} +1 -1
  175. package/dist/client/assets/{memory-DGqh7MMN.js → memory-CYDtZWEC.js} +1 -1
  176. package/dist/client/assets/{mini-report-page-DeT726Qz.js → mini-report-page-BvYGpq5f.js} +1 -1
  177. package/dist/client/assets/{mock-board-DiXeO9l9.js → mock-board-hNRrDjvq.js} +1 -1
  178. package/dist/client/assets/{monaco-editor-BmtkWb9u.js → monaco-editor-DkahnDKS.js} +1 -1
  179. package/dist/client/assets/{monitoring-stats-row-CROD4XJo.js → monitoring-stats-row-Cx7S4sFz.js} +1 -1
  180. package/dist/client/assets/{multi-select-COcK2vp_.js → multi-select-BsYgOBGm.js} +1 -1
  181. package/dist/client/assets/{mustache-B3B0mlPh.js → mustache-D7UTScQH.js} +1 -1
  182. package/dist/client/assets/{new-project-dialog-CQomS8HX.js → new-project-dialog-DdG-RgMO.js} +1 -1
  183. package/dist/client/assets/{oauth-callback-BAjl2hrI.js → oauth-callback-GzdTg9VJ.js} +1 -1
  184. package/dist/client/assets/{oauth-callback-ai-provider-Dfitdf7t.js → oauth-callback-ai-provider-BANi9OcB.js} +1 -1
  185. package/dist/client/assets/{onboarding-DuW4ryZs.js → onboarding-w2z3NDRW.js} +1 -1
  186. package/dist/client/assets/{openai-conversation-klLH_0HC.js → openai-conversation-C7TUEjal.js} +1 -1
  187. package/dist/client/assets/{optimistic-project-sidebar-views-CaTvAXwY.js → optimistic-project-sidebar-views-7fDRNM1p.js} +1 -1
  188. package/dist/client/assets/{organization-choice-DtdFVbBZ.js → organization-choice-DRyD5yII.js} +1 -1
  189. package/dist/client/assets/{orgs-BBq2qsW_.js → orgs-EvyltNU-.js} +1 -1
  190. package/dist/client/assets/{page-seo-form-BJN0O5_N.js → page-seo-form-0-tAzxyW.js} +1 -1
  191. package/dist/client/assets/{pair-D3dg1naQ.js → pair-Cm6oR2ES.js} +1 -1
  192. package/dist/client/assets/{plan-ladder-DUQWM1mB.js → plan-ladder-D4-VvMwX.js} +1 -1
  193. package/dist/client/assets/{popover-9tPVAoH5.js → popover-DGVyEQ9q.js} +1 -1
  194. package/dist/client/assets/{post-calendar-D9oVrQhS.js → post-calendar-CGDOG4Ay.js} +1 -1
  195. package/dist/client/assets/{post-editor-C2tsxtV4.js → post-editor-BFSJ6I4d.js} +1 -1
  196. package/dist/client/assets/{preview-content-BIpDQXJu.js → preview-content-KcSZme5m.js} +1 -1
  197. package/dist/client/assets/{preview-dialog-CH8GibCu.js → preview-dialog-DHH8biYM.js} +1 -1
  198. package/dist/client/assets/{preview-panel-CCFjojUE.js → preview-panel-CMlsnFlv.js} +1 -1
  199. package/dist/client/assets/{product-picker-dialog-BoGvkEwe.js → product-picker-dialog-Bz7bVPFI.js} +1 -1
  200. package/dist/client/assets/{profile-BKpvrH_P.js → profile-be5NkG2U.js} +1 -1
  201. package/dist/client/assets/{project-app-view-0HH2t56F.js → project-app-view-BV4H0rEJ.js} +1 -1
  202. package/dist/client/assets/{project-feed-d2kKPzOq.js → project-feed-Dly67hgE.js} +1 -1
  203. package/dist/client/assets/{project-icon-DeUPWsC_.js → project-icon-CMe6LZd9.js} +1 -1
  204. package/dist/client/assets/project-reports-BqyykKm5.js +1 -0
  205. package/dist/client/assets/project-tasks-DHxi49Je.js +1 -0
  206. package/dist/client/assets/{projects-dI6btB5J.js → projects-CDscJwj7.js} +1 -1
  207. package/dist/client/assets/{projects-empty-state-DAa4wzAP.js → projects-empty-state-VFtNQKgJ.js} +1 -1
  208. package/dist/client/assets/{prompts-D3LKfm14.js → prompts-CG--DGsd.js} +1 -1
  209. package/dist/client/assets/record-editor-CQTy2--L.js +1 -0
  210. package/dist/client/assets/redirect-editor-Diq4Tlsx.js +1 -0
  211. package/dist/client/assets/reports-Bew0urwY.js +1 -0
  212. package/dist/client/assets/{reports-B5aLNQGc.js → reports-CODPKkJO.js} +1 -1
  213. package/dist/client/assets/{reports-onboarding-D7Nsv0TX.js → reports-onboarding-D0Irch0-.js} +1 -1
  214. package/dist/client/assets/{reports-tab-bgB5WodW.js → reports-tab-NvqzpdHL.js} +2 -2
  215. package/dist/client/assets/{repositories-Du_yi0rf.js → repositories-xZsmQvzi.js} +1 -1
  216. package/dist/client/assets/{repository-binding-CrIQbyJh.js → repository-binding-C_InVumU.js} +1 -1
  217. package/dist/client/assets/{repository-import-picker-n3EYoF9U.js → repository-import-picker-Bixi7zBc.js} +1 -1
  218. package/dist/client/assets/{repository-picker-CjDs0ici.js → repository-picker-BHgNNGrn.js} +1 -1
  219. package/dist/client/assets/{require-capability-BDLtPaM5.js → require-capability-D49j17CD.js} +1 -1
  220. package/dist/client/assets/{required-auth-layout-CTKRCLps.js → required-auth-layout-CxaLcttO.js} +1 -1
  221. package/dist/client/assets/{reset-password-XiFYESJ5.js → reset-password-Bg3-bOJi.js} +1 -1
  222. package/dist/client/assets/{resizable-C3INc4c7.js → resizable-sj2QiDEc.js} +1 -1
  223. package/dist/client/assets/{resolve-tab-icon-DuWtsFCw.js → resolve-tab-icon-Benn2iaL.js} +1 -1
  224. package/dist/client/assets/{review-settings-BCvIwiTZ.js → review-settings-DjIYcWCV.js} +1 -1
  225. package/dist/client/assets/{rich-text-link-control-B2KML_yp.js → rich-text-link-control-C2ryIXD3.js} +1 -1
  226. package/dist/client/assets/{roles-B5KIhtIL.js → roles-8gcvGZJw.js} +1 -1
  227. package/dist/client/assets/{route-BwivpFZQ.js → route-C0mgkpSg.js} +1 -1
  228. package/dist/client/assets/route-DQYAyMBI.js +1 -0
  229. package/dist/client/assets/{route-nHlGvnBX.js → route-DyDxvrHS.js} +1 -1
  230. package/dist/client/assets/{runnable-block-editor-v2diysES.js → runnable-block-editor-dTVVXX5v.js} +1 -1
  231. package/dist/client/assets/{sandbox-lifecycle-context-CtphXAh2.js → sandbox-lifecycle-context-DzcFvw1G.js} +1 -1
  232. package/dist/client/assets/{schema-BMqZTcjW.js → schema-DyLXU88M.js} +1 -1
  233. package/dist/client/assets/{scroll-area-B9YHNZjL.js → scroll-area-DYybJ63r.js} +1 -1
  234. package/dist/client/assets/{search-input-BJ-xb_6w.js → search-input-DJwYl_zW.js} +1 -1
  235. package/dist/client/assets/{search-toggle-DviE2KK7.js → search-toggle-DOVOYril.js} +1 -1
  236. package/dist/client/assets/{secret-picker-MDfAhcKZ.js → secret-picker-C40fL6uP.js} +1 -1
  237. package/dist/client/assets/{secrets-BWXZ9ADR.js → secrets-Kq6gwxOB.js} +1 -1
  238. package/dist/client/assets/{sections-editor-DRPdyBr7.js → sections-editor-5-gvD3vu.js} +1 -1
  239. package/dist/client/assets/{select-Cmhyur65.js → select-CEirlFRV.js} +1 -1
  240. package/dist/client/assets/{select-model-DlhjRyXh.js → select-model-5mFHKpuo.js} +1 -1
  241. package/dist/client/assets/{seo-editor-Cslo5GyR.js → seo-editor-DHTxrlCs.js} +1 -1
  242. package/dist/client/assets/{separator-XBrskDk1.js → separator-E-ZvgvRL.js} +1 -1
  243. package/dist/client/assets/{settings-tab-Bhjq-v1u.js → settings-tab-C9ihpTae.js} +1 -1
  244. package/dist/client/assets/{sheet-bMLuzpcl.js → sheet-Bs1jJD9o.js} +1 -1
  245. package/dist/client/assets/{shell-layout-CX2kb4As.js → shell-layout-DZBrJWAA.js} +1 -1
  246. package/dist/client/assets/{skills-smEsZOyf.js → skills-7xwa1ol9.js} +1 -1
  247. package/dist/client/assets/{slider-xDThp8gG.js → slider-ki239RUG.js} +1 -1
  248. package/dist/client/assets/{sortable.esm-C4yl7HRk.js → sortable.esm-Dvqn6rnz.js} +1 -1
  249. package/dist/client/assets/{sso-D5XcZRGg.js → sso-n5eUQ_Xy.js} +1 -1
  250. package/dist/client/assets/{suggestion-B9eDgKDC.js → suggestion-DHADwupQ.js} +1 -1
  251. package/dist/client/assets/{switch-D6SJRikA.js → switch-BD8_vvWq.js} +1 -1
  252. package/dist/client/assets/{symbol-8pL_EbyE.js → symbol-Dx-KpnN7.js} +1 -1
  253. package/dist/client/assets/{synced-repos-CvOi5sDr.js → synced-repos-B-5rRFwb.js} +1 -1
  254. package/dist/client/assets/{tab-icon-glyph-B5Fq5S50.js → tab-icon-glyph-B9KZAh18.js} +1 -1
  255. package/dist/client/assets/{table-BVuWDAYC.js → table-B1C2ctbL.js} +1 -1
  256. package/dist/client/assets/{tabs-CJiVz1UY.js → tabs-tkvg_YSq.js} +1 -1
  257. package/dist/client/assets/{task-board-BypYXBtD.js → task-board-DcolQ15W.js} +1 -1
  258. package/dist/client/assets/{task-route-CxLDxVTy.js → task-route-Dp4TtKUe.js} +1 -1
  259. package/dist/client/assets/{task-status-DR_ZGtmT.js → task-status-CF9KSEEA.js} +1 -1
  260. package/dist/client/assets/taskboard-analytics-C_zsZRzy.js +1 -0
  261. package/dist/client/assets/{tasks-pRlF9aKa.js → tasks-B6gqzeMQ.js} +1 -1
  262. package/dist/client/assets/tasks-O62NX5lN.js +1 -0
  263. package/dist/client/assets/{textarea-C3QvYVs6.js → textarea-BpBHfDQd.js} +1 -1
  264. package/dist/client/assets/{thread-analytics-CVYD56Lv.js → thread-analytics-DfV1z1-8.js} +1 -1
  265. package/dist/client/assets/{thread-button-Dnwv5gXz.js → thread-button-BNBHV_Wu.js} +1 -1
  266. package/dist/client/assets/{thread-intent-BouO_OhM.js → thread-intent-DqexYQAC.js} +1 -1
  267. package/dist/client/assets/{thread-route-Dp3ppEkH.js → thread-route-B-yx1tFW.js} +1 -1
  268. package/dist/client/assets/{thread-route-CzzxiajL.js → thread-route-BXR-ufCz.js} +1 -1
  269. package/dist/client/assets/{thread-sheet-body-Z8jKG5ht.js → thread-sheet-body-Bgp-QwJy.js} +1 -1
  270. package/dist/client/assets/{time-range-picker-DE7fkhif.js → time-range-picker-DILwkH82.js} +1 -1
  271. package/dist/client/assets/{toggle-group-BxPPN08u.js → toggle-group-SSpwI-zE.js} +1 -1
  272. package/dist/client/assets/{tool-namespace-C5Z8tVC2.js → tool-namespace-CsdkV2uo.js} +1 -1
  273. package/dist/client/assets/{toolbar-icon-button-539CZpjb.js → toolbar-icon-button-CIXm0pyl.js} +1 -1
  274. package/dist/client/assets/{tooltip-CfH7_UR9.js → tooltip-CUk78XFR.js} +1 -1
  275. package/dist/client/assets/{tooltipContext-Dt4926A5.js → tooltipContext-BY8Qgc3U.js} +1 -1
  276. package/dist/client/assets/{track-D8kXLyAV.js → track-DDd4x4-Y.js} +1 -1
  277. package/dist/client/assets/{types-PjheW3sm.js → types-DPbXDbOS.js} +1 -1
  278. package/dist/client/assets/{url-slug-D7hdnLPq.js → url-slug-CFKzH8Z4.js} +1 -1
  279. package/dist/client/assets/{usage-stats-BcmMK-YO.js → usage-stats-wClM7TZ-.js} +1 -1
  280. package/dist/client/assets/{use-ai-providers-CeHzBmwD.js → use-ai-providers-CAEoYJwC.js} +1 -1
  281. package/dist/client/assets/{use-automations-DLk4Zq7Y.js → use-automations-DXjaaH0T.js} +1 -1
  282. package/dist/client/assets/{use-autosave-5IDmaWA6.js → use-autosave-BOlmY_xu.js} +1 -1
  283. package/dist/client/assets/{use-chat-layout-state-C4y1ngrz.js → use-chat-layout-state-BYcPLpFV.js} +1 -1
  284. package/dist/client/assets/{use-chat-navigation-pwxRnoh5.js → use-chat-navigation-CKcbdotk.js} +1 -1
  285. package/dist/client/assets/{use-clock-tick-DcGl_y28.js → use-clock-tick-CwQv-OCe.js} +1 -1
  286. package/dist/client/assets/{use-connect-companion-DmQTaaXP.js → use-connect-companion-PBAraKBj.js} +1 -1
  287. package/dist/client/assets/{use-connection-B96BwbcD.js → use-connection-DldRXuvq.js} +1 -1
  288. package/dist/client/assets/{use-copy-COXbZ1Gm.js → use-copy-BC3Fmh27.js} +1 -1
  289. package/dist/client/assets/{use-create-virtual-mcp-BuymUE2O.js → use-create-virtual-mcp-D8P6CVcB.js} +1 -1
  290. package/dist/client/assets/{use-date-fns-locale-D2o3Y11s.js → use-date-fns-locale-DquxgLdE.js} +1 -1
  291. package/dist/client/assets/{use-debounced-autosave-Yq56G4iL.js → use-debounced-autosave-mYSK51JG.js} +1 -1
  292. package/dist/client/assets/{use-debounced-value-BZK5uiHm.js → use-debounced-value-CNkuXNOW.js} +1 -1
  293. package/dist/client/assets/{use-deco-credits-COvQvXnV.js → use-deco-credits-DKtKOwIN.js} +1 -1
  294. package/dist/client/assets/{use-decopilot-events-BDPMNEXz.js → use-decopilot-events-DH5jig6y.js} +1 -1
  295. package/dist/client/assets/{use-delete-connection-DT6vWhGX.js → use-delete-connection-Dzg9cQZm.js} +1 -1
  296. package/dist/client/assets/{use-deployment-admin-CoVHfZYT.js → use-deployment-admin-CyBWrUgL.js} +1 -1
  297. package/dist/client/assets/{use-ensure-project-folder-peTgVhMP.js → use-ensure-project-folder-CdHM_a-9.js} +1 -1
  298. package/dist/client/assets/{use-fast-preview-draft-url-BDHxUOYh.js → use-fast-preview-draft-url-Cuacxxyo.js} +1 -1
  299. package/dist/client/assets/{use-file-configs-DoW1VYTz.js → use-file-configs-DsMQGho1.js} +1 -1
  300. package/dist/client/assets/{use-infinite-scroll-1WuTfkvL.js → use-infinite-scroll-C0Ths8NM.js} +1 -1
  301. package/dist/client/assets/{use-join-requests-uEHIq-wW.js → use-join-requests-CoVXbvos.js} +1 -1
  302. package/dist/client/assets/{use-main-panel-tabs-eZgXms3O.js → use-main-panel-tabs-DlD2zr1g.js} +1 -1
  303. package/dist/client/assets/{use-mcp-auth-status-GSONXJ6Y.js → use-mcp-auth-status-B2t4xmcR.js} +1 -1
  304. package/dist/client/assets/{use-mcp-client-D8-rDWEf.js → use-mcp-client-C5uLw7Lc.js} +1 -1
  305. package/dist/client/assets/{use-mcp-prompts-9xOCFCVM.js → use-mcp-prompts-Dxu80Ack.js} +1 -1
  306. package/dist/client/assets/{use-mcp-tools-BYNW1IvH.js → use-mcp-tools-Cm9CvYn6.js} +1 -1
  307. package/dist/client/assets/{use-members-DuiAoVt0.js → use-members-C9_S9nP9.js} +1 -1
  308. package/dist/client/assets/{use-mobile-Cz-N6vVG.js → use-mobile-Buz9Esa_.js} +1 -1
  309. package/dist/client/assets/{use-navigate-to-agent-CWPsHr0w.js → use-navigate-to-agent-C41zpB_Z.js} +1 -1
  310. package/dist/client/assets/use-new-blocks-editor-DuP8uKZj.js +1 -0
  311. package/dist/client/assets/{use-open-billing-url-CHALVI7F.js → use-open-billing-url-C1VukQDg.js} +1 -1
  312. package/dist/client/assets/{use-org-auth-client-DQ6vSNUo.js → use-org-auth-client-DjRiIxwH.js} +1 -1
  313. package/dist/client/assets/{use-org-fs-UdNnQzcG.js → use-org-fs-DqhUUlbQ.js} +1 -1
  314. package/dist/client/assets/{use-org-repo-syncs-CE9Yx0AE.js → use-org-repo-syncs-cx9r2nZl.js} +1 -1
  315. package/dist/client/assets/{use-org-sso-BRZ2xqKg.js → use-org-sso-DVCQNBfN.js} +1 -1
  316. package/dist/client/assets/{use-organization-roles-5fHLGM-_.js → use-organization-roles-Bp0RCVOK.js} +1 -1
  317. package/dist/client/assets/{use-organization-settings-BEUCQxuY.js → use-organization-settings-B0rQmLIX.js} +1 -1
  318. package/dist/client/assets/{use-panel-navigate-B348HV-V.js → use-panel-navigate-DOyxnt44.js} +1 -1
  319. package/dist/client/assets/{use-project-scope-CJSvss5q.js → use-project-scope-DJTJDi3A.js} +1 -1
  320. package/dist/client/assets/{use-releases-DRDEblSZ.js → use-releases-BXUiPgUU.js} +1 -1
  321. package/dist/client/assets/{use-reports-diagnostic-BQoNp5Lt.js → use-reports-diagnostic-frCP_UW9.js} +1 -1
  322. package/dist/client/assets/{use-sandbox-events-afI4fSp9.js → use-sandbox-events-Clj9v6On.js} +1 -1
  323. package/dist/client/assets/{use-secrets-6NdpjMzr.js → use-secrets-CIfBnw6x.js} +1 -1
  324. package/dist/client/assets/{use-section-preview-base-Du6Z-MWu.js → use-section-preview-base-BYZSxM0z.js} +1 -1
  325. package/dist/client/assets/{use-tags-Dkeb0fZQ.js → use-tags-Blq5AODj.js} +1 -1
  326. package/dist/client/assets/{use-task-board-analytics-BsZ5fOsz.js → use-task-board-analytics-D09WT40p.js} +1 -1
  327. package/dist/client/assets/{use-task-board-events-BZPWVwkQ.js → use-task-board-events-Bx8_k4aV.js} +1 -1
  328. package/dist/client/assets/{use-task-board-item-prs-6pzJEXZH.js → use-task-board-item-prs-Bsgf-2Zm.js} +1 -1
  329. package/dist/client/assets/{use-task-board-items-DDExwWH5.js → use-task-board-items-CIYsbBEM.js} +1 -1
  330. package/dist/client/assets/{use-task-metadata-QX8Xm3F2.js → use-task-metadata-DDV_r81k.js} +1 -1
  331. package/dist/client/assets/{use-thread-analytics-4YJ0wSzW.js → use-thread-analytics-BuosijZj.js} +1 -1
  332. package/dist/client/assets/{use-thread-outputs-BaagK6yF.js → use-thread-outputs-D13C6fsy.js} +1 -1
  333. package/dist/client/assets/useInfiniteQuery-B3MUNCKJ.js +1 -0
  334. package/dist/client/assets/{useQueries-BeM3koNG.js → useQueries-DZMzH0ea.js} +1 -1
  335. package/dist/client/assets/useSuspenseInfiniteQuery-DPTWpcSJ.js +1 -0
  336. package/dist/client/assets/{users-DA2VVqSS.js → users-CE3WLjUJ.js} +1 -1
  337. package/dist/client/assets/{utils-DGIwcQET.js → utils-qUv9_Hyk.js} +1 -1
  338. package/dist/client/assets/{variant-calendar-B2z-zkHQ.js → variant-calendar-B604PCFx.js} +1 -1
  339. package/dist/client/assets/{variant-matcher-override-WuIO8MOW.js → variant-matcher-override-CgF3ujB9.js} +1 -1
  340. package/dist/client/assets/{view-mode-toggle-DA847UFd.js → view-mode-toggle-BaZ1kmhW.js} +1 -1
  341. package/dist/client/assets/{virtual-mcp-ySkvJvwZ.js → virtual-mcp-CWsV4-pi.js} +1 -1
  342. package/dist/client/assets/{watch-sse-pool-jwr9yBFo.js → watch-sse-pool-BjTl5yOD.js} +1 -1
  343. package/dist/client/index.html +1 -1
  344. package/dist/server/server.js +87 -87
  345. package/package.json +1 -1
  346. package/dist/client/assets/agent-app-BExNHlBs.js +0 -1
  347. package/dist/client/assets/agent-deck-GAA8uH06.js +0 -1
  348. package/dist/client/assets/agent-library-CJXihsv5.js +0 -1
  349. package/dist/client/assets/agent-library-file-Cnv04MVV.js +0 -1
  350. package/dist/client/assets/agent-settings-BTMD0j_l.js +0 -1
  351. package/dist/client/assets/agent-site-editor-code-Crxw0pRq.js +0 -2
  352. package/dist/client/assets/agent-view-DVbx7Not.js +0 -1
  353. package/dist/client/assets/api-keys-B_VU2t2_.js +0 -1
  354. package/dist/client/assets/app-editor-fWZMbht-.js +0 -1
  355. package/dist/client/assets/flat-project-DPnFbnmE.js +0 -1
  356. package/dist/client/assets/library-C2ZRDo2P.js +0 -1
  357. package/dist/client/assets/project-reports-7r3buXCO.js +0 -1
  358. package/dist/client/assets/project-tasks-Dp-gjCz7.js +0 -1
  359. package/dist/client/assets/record-editor-BDN9ztWf.js +0 -1
  360. package/dist/client/assets/redirect-editor-DBLjC8Z9.js +0 -1
  361. package/dist/client/assets/reports-CvKnRIKX.js +0 -1
  362. package/dist/client/assets/route-Fylk_TVt.js +0 -1
  363. package/dist/client/assets/taskboard-analytics-B5tiovFi.js +0 -1
  364. package/dist/client/assets/tasks-C5eWHl6J.js +0 -1
  365. package/dist/client/assets/use-new-blocks-editor-B5DYqQrS.js +0 -1
  366. package/dist/client/assets/useInfiniteQuery-BgN51nwo.js +0 -1
  367. package/dist/client/assets/useSuspenseInfiniteQuery-DnCmqaG2.js +0 -1
@@ -1 +1 @@
1
- import{aD as ve,cX as Oe,cV as Me,aE as de,bU as Ee,c as U,b as F,j as t,h as Ne,B,r as Q,l as Se,a2 as te,aa as ze,R as me,K as ee,d as se,x as ye,at as _e,ff as Re,b2 as Ue,n as Ve,fE as ue,$ as Fe,I as J,X as Le,T as Be,V as qe,U as xe,H as Ge,f as He,fN as Xe,o as Ke,aC as Qe,aB as We,t as Y}from"./index-D984WV3U.js";import{g as Ye}from"./extract-connection-data-CIO9f-TD.js";import{E as Ce}from"./empty-state-b6tRqzU8.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-A2MriNrX.js";import{c as nt,S as it,D as ot}from"./index-ClN0hPjk.js";import{u as we,T as at}from"./use-mcp-auth-status-GSONXJ6Y.js";import{a as lt}from"./use-members-DuiAoVt0.js";import{A as rt}from"./avatar-Da-P84-z.js";import{a as ct}from"./mcp-oauth--_7bIOac.js";import{I as ae}from"./integration-icon-B4EO_1fi.js";import{s as dt}from"./Plus-BzLmRH_e.js";import{bd as mt,ay as ut,au as xt,u as ne}from"./agent-icon-CsQzAnP1.js";import{a as ke,e as pt,s as ft}from"./Tool01-BLdqmAM-.js";import{s as re}from"./Trash01-DkcAHDGj.js";import{b as ht,a as gt,c as jt,S as bt,d as vt}from"./sheet-bMLuzpcl.js";import{F as G,b as H,c as X,d as L,f as K,e as Nt,a as St}from"./form-Dm1N7Fdz.js";import{a as Ie,b as Te,u as yt}from"./use-connection-B96BwbcD.js";import{u as Ae}from"./use-mcp-client-D8-rDWEf.js";import{u as _t}from"./use-mcp-tools-BYNW1IvH.js";import{a as Ct}from"./use-mcp-prompts-9xOCFCVM.js";import{i as wt}from"./mcp-oauth-BIr9y8Ow.js";import{u as kt,D as It}from"./use-delete-connection-DT6vWhGX.js";import{c as Tt}from"./monitoring-stats-row-CROD4XJo.js";import{d as At,C as Pt,a as Dt}from"./chart-CUhY88so.js";import{B as $t,a as Ot}from"./BarChart-D_Vp8_nk.js";import{C as Mt}from"./tooltipContext-Dt4926A5.js";import{b as Et}from"./repository-binding-CrIQbyJh.js";import{T as ie,a as zt,c as oe,b as Rt}from"./tabs-CJiVz1UY.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-C30WMfg1.js";import{g as ce}from"./types-PjheW3sm.js";import{M as Vt}from"./mcp-app-renderer-qrtR9Z1h.js";import{C as Ft}from"./collection-search-C-3HPALa.js";import{B as Lt}from"./badge-CJ5q8uJu.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-Cmhyur65.js";import{i as Bt}from"./CheckCircle-B1cLRmIj.js";import{t as qt}from"./ChevronUp-D_qU7VrJ.js";import{n as Gt}from"./LinkBroken01-CImL6HGl.js";import{c as Ht}from"./UserSquare-BlSFjBrQ.js";import{s as Xt}from"./XClose-BcQlXPoY.js";import{p as Kt,i as Qt}from"./connection-DGqqVA7M.js";import"./metadata-D72DunRR.js";import"./Key01-CV4MPPMx.js";import"./auth-CsAAW7Ar.js";import"./index-BA22z-aT.js";import"./index-z9lysifj.js";import"./index-BdQq_4o_.js";import"./index-ba_EB2Zw.js";import"./popover-9tPVAoH5.js";import"./tooltip-CfH7_UR9.js";import"./index-ChAMt2d-.js";import"./SearchMd-X-m-ot0f.js";import"./use-mobile-Cz-N6vVG.js";import"./use-create-virtual-mcp-BuymUE2O.js";import"./use-navigate-to-agent-CWPsHr0w.js";import"./thread-intent-BouO_OhM.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-jwr9yBFo.js";import"./task-board-BypYXBtD.js";import"./schema-BMqZTcjW.js";import"./slugify-CEUa2lfQ.js";import"./Image01-CyU1b2Nz.js";import"./use-org-auth-client-DQ6vSNUo.js";import"./User01-CuJbE_Yd.js";import"./AlertCircle-CgfWDsMW.js";import"./ArrowUp-C0O7U47F.js";import"./ArrowLeft-BkyozCr0.js";import"./ZoomOut-C_NtAfgt.js";import"./Building02-C5UvSZSt.js";import"./ChevronSelectorVertical-bEeSv3mr.js";import"./Copy01-CT_cEqll.js";import"./CreditCard01-DFGzM4td.js";import"./DotsVertical-CGu7Zbqo.js";import"./Globe04-DtoCZsmb.js";import"./SwitchHorizontal01-iT36Ixqz.js";import"./Link01-BL0KHGWk.js";import"./Monitor01-jDiltU3l.js";import"./Sun-D5cuTnns.js";import"./Play-HeD-LWQ6.js";import"./Upload01-CJxfk4_B.js";import"./Users01-CgCEjxiR.js";import"./label-BszVxI8j.js";import"./alert-dialog-D2yDyccd.js";import"./AreaChart-CZuIkHuk.js";import"./CategoricalChart-CYT1jRTo.js";import"./XAxis-B6hTknR7.js";import"./symbol-8pL_EbyE.js";import"./ActiveShapeUtils-CHPU_j8T.js";import"./Sector-Dk1WFIe-.js";import"./ErrorBarContext-BOQmu79L.js";import"./url-slug-D7hdnLPq.js";const Wt=ve({scopes:Ee(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=F();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{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 j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ut,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==T||e[48]!==S||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:E}),e[47]=T,e[48]=S,e[49]=b,e[50]=z):z=e[50];let M;e[51]!==P||e[52]!==z||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,z]}),e[51]=P,e[52]=z,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=F();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=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]=l):l=e[4];let a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,d=F();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(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 is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=F(),l=ze(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],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:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),f?t.jsxs("div",{children:[t.jsx(At,{config:is,className:"h-16 w-full",children:t.jsxs($t,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx(Ot,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.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:i("details.connectionActivity.noActivityInThisPeriod")})}),m.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:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:m.map(as)})]})]})}function as(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 ls(s,e){return t.jsx(Mt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.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 ds(s){const e=U.c(22),{connectionId:n}=s,c=F(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==a||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=F(),{org:o}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Et(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(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:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=F(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Vt,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})})}),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:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=F();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=F(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let V;e[18]!==I?(V=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=V):V=e[19];let W;return e[20]!==k||e[21]!==V?(W=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,V]}),e[20]=k,e[21]=V,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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:()=>g(v.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(pt,{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:De(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(E=N&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=N,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==a?(z=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=z):z=e[55];let M;e[56]!==z?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==E||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[T,b,E,M,R]})}),e[62]=T,e[63]=b,e[64]=E,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}function gs(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(xt,{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 js(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(Ut,{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:De(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 bs(s){return ce(s._meta)}function vs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Ve.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=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]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=F(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(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:i("details.connectionSidebar.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(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{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(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(K,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Le,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Xt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(Nt,{children:[i("details.connectionSidebar.createAPatAt")," ",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(K,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(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"&&Qt(s.connection_headers)){const c=s.connection_headers,o=et(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=_s(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:o}}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 Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=st(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token!==null&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=F(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=kt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=we({connectionId:e}),{data:y}=lt(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=nt(P,Yt),S=Qe({resolver:We(Ze),values:be(h??s)}),b=S.formState.isDirty,E=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},z=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:V}=await ct({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(V||!k){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(It,{...m}),t.jsx(ht,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(gt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(jt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(bt,{className:"text-base",children:h?.title??s.title}),t.jsx(vt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(rt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(St,{...S,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(G,{control:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,V=Ye("conn");await x.create.mutateAsync({id:V,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),Z=await wt({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(V)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),e=F();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=He(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=yt(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=_t(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=Ct(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let E;s[16]!==b?(E=b.map(Is),s[16]=b,s[17]=E):E=s[17];const z=E;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==z||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:z,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=z,s[41]=u,s[42]=M):M=s[42],M}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function vi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{vi as default};
1
+ import{aD as ve,cX as Oe,cV as Me,aE as de,bU as Ee,c as U,b as F,j as t,h as Ne,B,r as Q,l as Se,a2 as te,aa as ze,R as me,K as ee,d as se,x as ye,at as _e,ff as Re,b2 as Ue,n as Ve,fE as ue,$ as Fe,I as J,X as Le,T as Be,V as qe,U as xe,H as Ge,f as He,fN as Xe,o as Ke,aC as Qe,aB as We,t as Y}from"./index-4XFLhK7S.js";import{g as Ye}from"./extract-connection-data-C8Idk1Oj.js";import{E as Ce}from"./empty-state-CsVqjGqu.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-Bg3g47y2.js";import{c as nt,S as it,D as ot}from"./index-COd_qFje.js";import{u as we,T as at}from"./use-mcp-auth-status-B2t4xmcR.js";import{a as lt}from"./use-members-C9_S9nP9.js";import{A as rt}from"./avatar-Brh_8d7a.js";import{a as ct}from"./mcp-oauth-BjHElKzR.js";import{I as ae}from"./integration-icon-BqsHjS-b.js";import{s as dt}from"./Plus-DLTeBarI.js";import{bd as mt,ay as ut,au as xt,u as ne}from"./agent-icon-DDBSTxwl.js";import{a as ke,e as pt,s as ft}from"./Tool01-o_nJ7Y1x.js";import{s as re}from"./Trash01-JZaZB0vu.js";import{b as ht,a as gt,c as jt,S as bt,d as vt}from"./sheet-Bs1jJD9o.js";import{F as G,b as H,c as X,d as L,f as K,e as Nt,a as St}from"./form-BZ1i_2GJ.js";import{a as Ie,b as Te,u as yt}from"./use-connection-DldRXuvq.js";import{u as Ae}from"./use-mcp-client-C5uLw7Lc.js";import{u as _t}from"./use-mcp-tools-Cm9CvYn6.js";import{a as Ct}from"./use-mcp-prompts-Dxu80Ack.js";import{i as wt}from"./mcp-oauth-CVI2AkSu.js";import{u as kt,D as It}from"./use-delete-connection-Dzg9cQZm.js";import{c as Tt}from"./monitoring-stats-row-Cx7S4sFz.js";import{d as At,C as Pt,a as Dt}from"./chart-CXoR26LQ.js";import{B as $t,a as Ot}from"./BarChart-gbo6r8aY.js";import{C as Mt}from"./tooltipContext-BY8Qgc3U.js";import{b as Et}from"./repository-binding-C_InVumU.js";import{T as ie,a as zt,c as oe,b as Rt}from"./tabs-tkvg_YSq.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-CWlRU3Ye.js";import{g as ce}from"./types-DPbXDbOS.js";import{M as Vt}from"./mcp-app-renderer-fDcax7T2.js";import{C as Ft}from"./collection-search-Cp82h57b.js";import{B as Lt}from"./badge-Dp13ql_I.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-CEirlFRV.js";import{i as Bt}from"./CheckCircle-CoJfU94i.js";import{t as qt}from"./ChevronUp-BSm7AtSf.js";import{n as Gt}from"./LinkBroken01-Cjxu7rCw.js";import{c as Ht}from"./UserSquare-BFlEW2x5.js";import{s as Xt}from"./XClose-DO008B8R.js";import{p as Kt,i as Qt}from"./connection-BTT1rt_2.js";import"./metadata-D72DunRR.js";import"./Key01-DMnhMxC3.js";import"./auth-D1PkW9Uj.js";import"./index-DrIzKTur.js";import"./index-CN8TQhg6.js";import"./index-BdQq_4o_.js";import"./index-DVVx4F0i.js";import"./popover-DGVyEQ9q.js";import"./tooltip-CUk78XFR.js";import"./index-DujNp8wX.js";import"./SearchMd-BsNWsFDv.js";import"./use-mobile-Buz9Esa_.js";import"./use-create-virtual-mcp-D8P6CVcB.js";import"./use-navigate-to-agent-C41zpB_Z.js";import"./thread-intent-DqexYQAC.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BjTl5yOD.js";import"./task-board-DcolQ15W.js";import"./schema-DyLXU88M.js";import"./slugify-CEUa2lfQ.js";import"./Image01-BjUHwjIr.js";import"./use-org-auth-client-DjRiIxwH.js";import"./User01-BGOQS9vx.js";import"./AlertCircle-D4iOZ3Bs.js";import"./ArrowUp-KCSPs-fi.js";import"./ArrowLeft-iygYSRbQ.js";import"./ZoomOut-DA1sRe95.js";import"./Building02-EbX1A23K.js";import"./ChevronSelectorVertical-DqpRXMOM.js";import"./Copy01-DlA26aBh.js";import"./CreditCard01-CXGPcE51.js";import"./DotsVertical-CTugBooH.js";import"./Globe04-DDiW2Onm.js";import"./SwitchHorizontal01-DZEm8csq.js";import"./Link01-DKypA3Uf.js";import"./Monitor01-CTL-UG2p.js";import"./Sun-DhZMu2lN.js";import"./Play-NZWCLDah.js";import"./Upload01-CpEePL13.js";import"./Users01-C9dOtgmV.js";import"./label-ByKoWpTn.js";import"./alert-dialog-DpmCpPBI.js";import"./AreaChart-CUWmFHwI.js";import"./CategoricalChart-DbqLrstZ.js";import"./XAxis-4jP2_ps6.js";import"./symbol-Dx-KpnN7.js";import"./ActiveShapeUtils-CeZzOoVf.js";import"./Sector-BRgBibA6.js";import"./ErrorBarContext-CJdWK23B.js";import"./url-slug-CFKzH8Z4.js";const Wt=ve({scopes:Ee(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=F();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{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 j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(mt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(ut,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==T||e[48]!==S||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:E}),e[47]=T,e[48]=S,e[49]=b,e[50]=z):z=e[50];let M;e[51]!==P||e[52]!==z||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,z]}),e[51]=P,e[52]=z,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=F();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=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]=l):l=e[4];let a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,d=F();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(dt,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(Q.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(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 is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:o}=s,i=F(),l=ze(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],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:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),f?t.jsxs("div",{children:[t.jsx(At,{config:is,className:"h-16 w-full",children:t.jsxs($t,{data:x,barCategoryGap:"4%",children:[t.jsx(Pt,{content:t.jsx(Dt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx(Ot,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.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:i("details.connectionActivity.noActivityInThisPeriod")})}),m.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:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:m.map(as)})]})]})}function as(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 ls(s,e){return t.jsx(Mt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.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 ds(s){const e=U.c(22),{connectionId:n}=s,c=F(),[o,i]=Q.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(Q.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(_e,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==a||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=F(),{org:o}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Et(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(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:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=F(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=Q.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Q.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Vt,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})})}),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:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=F();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=F(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let V;e[18]!==I?(V=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=V):V=e[19];let W;return e[20]!==k||e[21]!==V?(W=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,V]}),e[20]=k,e[21]=V,e[22]=W):W=e[22],W}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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:()=>g(v.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(pt,{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:De(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(E=N&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=N,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==a?(z=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=z):z=e[55];let M;e[56]!==z?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==E||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[T,b,E,M,R]})}),e[62]=T,e[63]=b,e[64]=E,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}function gs(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(xt,{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 js(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(Ut,{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:De(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 bs(s){return ce(s._meta)}function vs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Ve.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=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]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=F(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(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:i("details.connectionSidebar.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(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsxs(fe,{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(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:m.value,onValueChange:m.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(K,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(K,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Le,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(ft,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Xt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(Nt,{children:[i("details.connectionSidebar.createAPatAt")," ",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(K,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(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"&&Qt(s.connection_headers)){const c=s.connection_headers,o=et(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:o}}const i=_s(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:o}}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 Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=st(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token!==null&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=F(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=kt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Q.useState(null),[j,N]=Q.useState(!1),_=we({connectionId:e}),{data:y}=lt(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=nt(P,Yt),S=Qe({resolver:We(Ze),values:be(h??s)}),b=S.formState.isDirty,E=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},z=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:V}=await ct({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(V||!k){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const W=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(W.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(It,{...m}),t.jsx(ht,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(gt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(jt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(bt,{className:"text-base",children:h?.title??s.title}),t.jsx(vt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(rt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(St,{...S,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(G,{control:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(K,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,V=Ye("conn");await x.create.mutateAsync({id:V,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const W=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),Z=await wt({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(V)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),e=F();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=He(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=yt(d),[x,f]=Q.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=_t(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=Ct(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Xe($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let E;s[16]!==b?(E=b.map(Is),s[16]=b,s[17]=E):E=s[17];const z=E;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==z||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:z,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=z,s[41]=u,s[42]=M):M=s[42],M}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ks,{})})}),s[0]=e):e=s[0],e}function vi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{vi as default};
@@ -1 +1 @@
1
- import{aD as R,cX as A,cV as I,aE as o,bU as j,bT as z,c as L,j as u,I as C,B as H}from"./index-D984WV3U.js";import{s as W}from"./Plus-BzLmRH_e.js";import{s as U}from"./Trash01-DkcAHDGj.js";const q=R({key:o().min(1,"Key is required"),value:o()}),B=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(q).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).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"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function K(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 G(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:s,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=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 N=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 y=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 g=P;let T;e[9]!==r||e[10]!==t?(T=(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]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(C,{placeholder:m,value:p.key,onChange:c=>g(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(C,{type:K(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(i),children:u.jsx(U,{size:16})})]},i),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==N?(d=u.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function M(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(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 D(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 a=e.slice(1).find(s=>!s.startsWith("-"));return a?{packageName:a}:null}function F(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("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 Y(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>S(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function J(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Q(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(a.envVars=s),a}export{G as E,Y as a,J as b,B as c,Q as d,F as i,D as p,M as r};
1
+ import{aD as R,cX as A,cV as I,aE as o,bU as j,bT as z,c as L,j as u,I as C,B as H}from"./index-4XFLhK7S.js";import{s as W}from"./Plus-DLTeBarI.js";import{s as U}from"./Trash01-JZaZB0vu.js";const q=R({key:o().min(1,"Key is required"),value:o()}),B=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(q).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).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"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function K(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 G(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:s,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=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 N=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 y=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 g=P;let T;e[9]!==r||e[10]!==t?(T=(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]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(C,{placeholder:m,value:p.key,onChange:c=>g(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(C,{type:K(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(H,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(i),children:u.jsx(U,{size:16})})]},i),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==N?(d=u.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function M(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(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 D(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 a=e.slice(1).find(s=>!s.startsWith("-"));return a?{packageName:a}:null}function F(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("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 Y(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>S(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function J(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Q(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(a.envVars=s),a}export{G as E,Y as a,J as b,B as c,Q as d,F as i,D as p,M as r};
@@ -1 +1 @@
1
- import{r as z,c as W,b as te,j as t,B as E,h as de,l as he,U as ie,v as ke,aK as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as Ge,H as Qe,a2 as Me,d as $e,u as qe,a as Oe,$ as Je,am as ye,a0 as Ye,a1 as Ze,aC as et,aB as tt,n as pe,I as se,y as ee,o as nt,aa as st,t as R,b6 as ot,K as it}from"./index-D984WV3U.js";import{a as Fe,g as ct,e as lt}from"./extract-connection-data-CIO9f-TD.js";import{C as rt}from"./collection-display-button-Bii74DZw.js";import{S as at}from"./search-input-BJ-xb_6w.js";import{C as dt}from"./collection-tabs-BNpEfqyd.js";import{C as Ce,u as Ue,g as ut}from"./connection-card-gIhz0wdg.js";import{E as gt}from"./empty-state-b6tRqzU8.js";import{u as mt,D as pt}from"./use-delete-connection-DT6vWhGX.js";import{u as ft}from"./use-infinite-scroll-1WuTfkvL.js";import{u as Ve}from"./use-mobile-Cz-N6vVG.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as ht,a as xt,b as jt,c as St,g as yt,d as Ct,e as vt,f as bt}from"./alert-dialog-D2yDyccd.js";import{n as xe}from"./LinkBroken01-CImL6HGl.js";import{g as _t,a as Nt}from"./metadata-D72DunRR.js";import{D as Dt,a as kt,d as Tt,b as wt,e as At,f as It,g as Pt}from"./drawer-DybzZn1x.js";import{F as Q,b as q,c as J,d as Y,f as Z,a as Ne}from"./form-Dm1N7Fdz.js";import{S as Mt,b as $t,a as Ot,d as Ft,c as re}from"./select-Cmhyur65.js";import{T as Ut}from"./textarea-C3QvYVs6.js";import{b as ze,u as Vt}from"./use-connection-B96BwbcD.js";import{m as zt}from"./use-mcp-client-D8-rDWEf.js";import{b as Lt}from"./repository-binding-CrIQbyJh.js";import{g as Et}from"./types-PjheW3sm.js";import{A as Bt,bA as Kt,ay as Ht,bd as Rt,u as Se}from"./agent-icon-CsQzAnP1.js";import{s as Le}from"./Plus-BzLmRH_e.js";import{c as Wt}from"./UserSquare-BlSFjBrQ.js";import{s as Ee}from"./XClose-BcQlXPoY.js";import{s as Xt}from"./use-project-scope-CJSvss5q.js";import{i as fe,a as De,E as Gt,c as Qt,p as qt,b as Jt,d as Yt}from"./connection-form-helpers-A2MriNrX.js";import{a as Zt}from"./authenticate-and-persist-oauth-HfpfV8ZS.js";import{I as en}from"./integration-icon-B4EO_1fi.js";import{C as Be}from"./checkbox-cuQOxwwj.js";import{i as tn}from"./DotsVertical-CGu7Zbqo.js";import{s as Ke}from"./Image01-CyU1b2Nz.js";import{s as He}from"./Trash01-DkcAHDGj.js";import"./connection-DGqqVA7M.js";import"./url-slug-D7hdnLPq.js";import"./ArrowUp-C0O7U47F.js";import"./SwitchHorizontal01-iT36Ixqz.js";import"./tooltip-CfH7_UR9.js";import"./index-ChAMt2d-.js";import"./view-mode-toggle-DA847UFd.js";import"./badge-CJ5q8uJu.js";import"./SearchMd-X-m-ot0f.js";import"./useInfiniteQuery-BgN51nwo.js";import"./infiniteQueryObserver-Bmwf-SCt.js";import"./slugify-CEUa2lfQ.js";import"./label-BszVxI8j.js";import"./index-BdQq_4o_.js";import"./ChevronUp-D_qU7VrJ.js";import"./auth-CsAAW7Ar.js";import"./AlertCircle-CgfWDsMW.js";import"./Tool01-BLdqmAM-.js";import"./ArrowLeft-BkyozCr0.js";import"./ShoppingBag01-C30WMfg1.js";import"./ZoomOut-C_NtAfgt.js";import"./Building02-C5UvSZSt.js";import"./CheckCircle-B1cLRmIj.js";import"./ChevronSelectorVertical-bEeSv3mr.js";import"./Copy01-CT_cEqll.js";import"./CreditCard01-DFGzM4td.js";import"./Globe04-DtoCZsmb.js";import"./Key01-CV4MPPMx.js";import"./Link01-BL0KHGWk.js";import"./Monitor01-jDiltU3l.js";import"./Sun-D5cuTnns.js";import"./Play-HeD-LWQ6.js";import"./Upload01-CJxfk4_B.js";import"./User01-CuJbE_Yd.js";import"./Users01-CgCEjxiR.js";import"./mcp-oauth--_7bIOac.js";import"./mcp-oauth-BIr9y8Ow.js";function nn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(s){const e=W.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function on(s,e){const n=W.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=j=>{p(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,x;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},x=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=x):(a=n[7],x=n[8]),z.useEffect(a,x);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function cn(s){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,x]=nn(u),f=`studio-${g}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let h;e[4]!==S||e[5]!==c?(h=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=h):h=e[6];const A=h,[T,w]=on(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==x||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:x,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=x,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function ln(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=te(),r=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==r?(d=l(r,{count:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=d):d=e[3];let p;e[4]!==d?(p=t.jsx(ht,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(xt,{children:u}),e[9]=u,e[10]=a):a=e[10];let x;e[11]!==p||e[12]!==a?(x=t.jsxs(jt,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=x):x=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(St,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==o||e[19]!==l||e[20]!==S?(C=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(yt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(Ct,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==x?(h=t.jsxs(vt,{children:[x,c]}),e[28]=c,e[29]=x,e[30]=h):h=e[30];let A;return e[31]!==g||e[32]!==n||e[33]!==h?(A=t.jsx(bt,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=A):A=e[34],A}function rn(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=te();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let x;e[4]!==n._meta?(x=_t(n._meta),e[4]=n._meta,e[5]=x):x=e[5];const f=x,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==o||e[10]!==m){let V;e[12]!==m?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===m,e[12]=m,e[13]=V):V=e[13],c=o.filter(V),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,A=a||g;let T,w;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=h[0];V&&r(V);return}w()},w=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function an(s){return s?.length?{appToolName:s.find(n=>!!Et(n._meta))?.name??null}:null}const dn=3;function un(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function gn(s){const e=W.c(21),{projects:n}=s,g=te();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let o,i,l;if(e[4]!==n){const u=n.slice(0,dn);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(mn),e[4]=n,e[5]=o,e[6]=i,e[7]=l}else o=e[5],i=e[6],l=e[7];let r;e[8]!==o||e[9]!==i?(r=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function mn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Bt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=W.c(8),{selectionMode:n,children:g}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=he("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fn,children:t.jsx(tn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:pn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function pn(s){return s.stopPropagation()}function fn(s){return s.stopPropagation()}function hn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],m=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)p?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const x=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==g||e[23]!==o||e[24]!==x?(y=()=>o?x():g(),e[22]=g,e[23]=o,e[24]=x,e[25]=y):y=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let A;e[26]!==h||e[27]!==c?(A=he(c,h),e[26]=h,e[27]=c,e[28]=A):A=e[28];const T=o?p?!0:u&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==x?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:x}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=r,e[35]=x,e[36]=M):M=e[36];let I;e[37]!==g?(I=N=>{N.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==o||e[46]!==D?($=t.jsx(Re,{selectionMode:o,children:D}),e[45]=o,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function xn(s){const e=W.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=s,u=te();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:jn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=o,e[3]=u,e[4]=a):a=e[4];let x;e[5]!==d?(x=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=x):x=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==u?(j=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=j):j=e[9];let S;e[10]!==x||e[11]!==j?(S=t.jsxs(ie,{onClick:x,children:[f,j]}),e[10]=x,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(C=(i||l)&&t.jsxs(ie,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Kt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==o||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[S,C,y,c]}),e[27]=o,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=h):h=e[32];let A;return e[33]!==a||e[34]!==h?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=A):A=e[35],A}function jn(s){return s.stopPropagation()}function Sn(s){const e=W.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,a=te();if(n===0)return null;let x;e[0]!==n||e[1]!==a?(x=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=x):x=e[2];let f;e[3]!==x?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:x}),e[3]=x,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(j=n<g?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==p||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(C=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=m,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==u?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(h=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:[f,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=h):h=e[28],h}function yn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=te(),[r,d]=z.useState(null);let p;e[0]!==g?(p=D=>{D||d(null),g(D)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(ke,{children:u}),e[4]=u,e[5]=a):a=e[5];let x;e[6]!==l?(x=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=x):x=e[7];let f;e[8]!==x?(f=t.jsx(Te,{children:x}),e[8]=x,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(we,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==o||e[14]!==r||e[15]!==l?(S=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(en,{icon:D.icon,name:D.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:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==m?(y=()=>m(!1),e[19]=m,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==y?(h=t.jsx(E,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=h):h=e[25];const A=!r;let T;e[26]!==m||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(E,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(Ae,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function Cn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=te(),{org:i}=Me(),l=nt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=Vt(s),u=mt(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,h]=z.useState(!1),[A,T]=z.useState(null),w=Lt(),M=un(Xt(w)),I=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),O=ut(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ue(s.searchTerm),V=$.items,b=ft($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),U=s.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Fe(_);if(v&&N.has(v))return!1}return!0}):[],G=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=lt(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",K=!!v.connection_url,H=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const ve=await p.create.mutateAsync(v),{id:oe}=ve,ce=await Zt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:it.isMCPAuthenticated(le.href,null)}),F(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(zt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=an((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(o("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ue=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;F(),R.success(o("orgs.connections.deletedConnections",{count:B})),D()},je=async(_,v)=>{try{await p.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(o(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const K=(await Promise.allSettled(v.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;F(),R.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),D()},ne=async _=>{const v=w.find(H=>H.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...K]}}),ot(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:v.title})),D()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(pt,{...u}),t.jsx(ln,{open:C,onOpenChange:y,count:f.size,onConfirm:ue}),t.jsx(yn,{open:c,onOpenChange:h,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(hn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(Ce,{connection:v,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(gn,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(xn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:x,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onToggleStatus:K=>je(v.id,K),onDelete:()=>u.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(rn,{item:_,canManage:a,allConnections:m,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(Sn,{count:f.size,total:I.length,canManage:a,canManageAgents:x,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>h(!0),onToggleStatus:ge,onCancel:D})]})}function vn(){const s=te(),{org:e}=Me(),n=$e(),g=qe({strict:!1}),{data:o}=Oe.useSession(),{stdioEnabled:i}=Je(),l=Ve(),{granted:r}=ye("connections:manage"),d=cn({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=Ye(Ze.connectionsTab(e.slug),b=>g.tab==="all"||g.tab==="connected"?g.tab:b??"all"),[a,x]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ue(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=fe({uiType:h,connectionUrl:A??"",npxPackage:T??""})??De({uiType:h,connectionUrl:A??"",registryItems:C}),M=r&&g.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Jt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Yt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=ct("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await p.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(ne=>ne.key)),ge=F.envVarKeys.filter(ne=>!je.has(ne));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(fe({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(fe({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}h==="NPX"&&k(fe({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const b=s("orgs.connections.createConnection"),N=s("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs(Mt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx($t,{children:t.jsx(Ot,{})})}),t.jsxs(Ft,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Wt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Gt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ut,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Dt,{open:G,onOpenChange:D,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Tt,{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(wt,{children:b}),t.jsx(At,{className:"mt-1",children:N})]}),t.jsx(It,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Pt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:D,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:b}),t.jsx(Te,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Ae,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>D(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:V,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(at,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(rt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:a,onChange:b=>x(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:f,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]}]})]})}),t.jsx(dt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:b=>{const N=b;N!==m&&ee("connections_page_tab_changed",{to_tab:N}),u(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(Cn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Ls(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),s[0]=e):e=s[0],e}export{Ls as default};
1
+ import{r as z,c as W,b as te,j as t,B as E,h as de,l as he,U as ie,v as ke,aK as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as Ge,H as Qe,a2 as Me,d as $e,u as qe,a as Oe,$ as Je,am as ye,a0 as Ye,a1 as Ze,aC as et,aB as tt,n as pe,I as se,y as ee,o as nt,aa as st,t as R,b6 as ot,K as it}from"./index-4XFLhK7S.js";import{a as Fe,g as ct,e as lt}from"./extract-connection-data-C8Idk1Oj.js";import{C as rt}from"./collection-display-button-BjwUZtSd.js";import{S as at}from"./search-input-DJwYl_zW.js";import{C as dt}from"./collection-tabs-C6HP7d51.js";import{C as Ce,u as Ue,g as ut}from"./connection-card-CsIFgDe8.js";import{E as gt}from"./empty-state-CsVqjGqu.js";import{u as mt,D as pt}from"./use-delete-connection-Dzg9cQZm.js";import{u as ft}from"./use-infinite-scroll-C0Ths8NM.js";import{u as Ve}from"./use-mobile-Buz9Esa_.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as ht,a as xt,b as jt,c as St,g as yt,d as Ct,e as vt,f as bt}from"./alert-dialog-DpmCpPBI.js";import{n as xe}from"./LinkBroken01-Cjxu7rCw.js";import{g as _t,a as Nt}from"./metadata-D72DunRR.js";import{D as Dt,a as kt,d as Tt,b as wt,e as At,f as It,g as Pt}from"./drawer-20Gv7XN0.js";import{F as Q,b as q,c as J,d as Y,f as Z,a as Ne}from"./form-BZ1i_2GJ.js";import{S as Mt,b as $t,a as Ot,d as Ft,c as re}from"./select-CEirlFRV.js";import{T as Ut}from"./textarea-BpBHfDQd.js";import{b as ze,u as Vt}from"./use-connection-DldRXuvq.js";import{m as zt}from"./use-mcp-client-C5uLw7Lc.js";import{b as Lt}from"./repository-binding-C_InVumU.js";import{g as Et}from"./types-DPbXDbOS.js";import{A as Bt,bA as Kt,ay as Ht,bd as Rt,u as Se}from"./agent-icon-DDBSTxwl.js";import{s as Le}from"./Plus-DLTeBarI.js";import{c as Wt}from"./UserSquare-BFlEW2x5.js";import{s as Ee}from"./XClose-DO008B8R.js";import{s as Xt}from"./use-project-scope-DJTJDi3A.js";import{i as fe,a as De,E as Gt,c as Qt,p as qt,b as Jt,d as Yt}from"./connection-form-helpers-Bg3g47y2.js";import{a as Zt}from"./authenticate-and-persist-oauth-BfNR0joU.js";import{I as en}from"./integration-icon-BqsHjS-b.js";import{C as Be}from"./checkbox-CGTvhz0x.js";import{i as tn}from"./DotsVertical-CTugBooH.js";import{s as Ke}from"./Image01-BjUHwjIr.js";import{s as He}from"./Trash01-JZaZB0vu.js";import"./connection-BTT1rt_2.js";import"./url-slug-CFKzH8Z4.js";import"./ArrowUp-KCSPs-fi.js";import"./SwitchHorizontal01-DZEm8csq.js";import"./tooltip-CUk78XFR.js";import"./index-DujNp8wX.js";import"./view-mode-toggle-BaZ1kmhW.js";import"./badge-Dp13ql_I.js";import"./SearchMd-BsNWsFDv.js";import"./useInfiniteQuery-B3MUNCKJ.js";import"./infiniteQueryObserver-DLzEnjM8.js";import"./slugify-CEUa2lfQ.js";import"./label-ByKoWpTn.js";import"./index-BdQq_4o_.js";import"./ChevronUp-BSm7AtSf.js";import"./auth-D1PkW9Uj.js";import"./AlertCircle-D4iOZ3Bs.js";import"./Tool01-o_nJ7Y1x.js";import"./ArrowLeft-iygYSRbQ.js";import"./ShoppingBag01-CWlRU3Ye.js";import"./ZoomOut-DA1sRe95.js";import"./Building02-EbX1A23K.js";import"./CheckCircle-CoJfU94i.js";import"./ChevronSelectorVertical-DqpRXMOM.js";import"./Copy01-DlA26aBh.js";import"./CreditCard01-CXGPcE51.js";import"./Globe04-DDiW2Onm.js";import"./Key01-DMnhMxC3.js";import"./Link01-DKypA3Uf.js";import"./Monitor01-CTL-UG2p.js";import"./Sun-DhZMu2lN.js";import"./Play-NZWCLDah.js";import"./Upload01-CpEePL13.js";import"./User01-BGOQS9vx.js";import"./Users01-C9dOtgmV.js";import"./mcp-oauth-BjHElKzR.js";import"./mcp-oauth-CVI2AkSu.js";function nn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(s){const e=W.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function on(s,e){const n=W.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=j=>{p(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,x;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},x=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=x):(a=n[7],x=n[8]),z.useEffect(a,x);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function cn(s){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,x]=nn(u),f=`studio-${g}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let h;e[4]!==S||e[5]!==c?(h=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=h):h=e[6];const A=h,[T,w]=on(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==x||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:x,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=x,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function ln(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=te(),r=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==r?(d=l(r,{count:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=d):d=e[3];let p;e[4]!==d?(p=t.jsx(ht,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(xt,{children:u}),e[9]=u,e[10]=a):a=e[10];let x;e[11]!==p||e[12]!==a?(x=t.jsxs(jt,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=x):x=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(St,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==o||e[19]!==l||e[20]!==S?(C=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(yt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(Ct,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==x?(h=t.jsxs(vt,{children:[x,c]}),e[28]=c,e[29]=x,e[30]=h):h=e[30];let A;return e[31]!==g||e[32]!==n||e[33]!==h?(A=t.jsx(bt,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=A):A=e[34],A}function rn(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=te();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let x;e[4]!==n._meta?(x=_t(n._meta),e[4]=n._meta,e[5]=x):x=e[5];const f=x,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==o||e[10]!==m){let V;e[12]!==m?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===m,e[12]=m,e[13]=V):V=e[13],c=o.filter(V),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,A=a||g;let T,w;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=h[0];V&&r(V);return}w()},w=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function an(s){return s?.length?{appToolName:s.find(n=>!!Et(n._meta))?.name??null}:null}const dn=3;function un(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function gn(s){const e=W.c(21),{projects:n}=s,g=te();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let o,i,l;if(e[4]!==n){const u=n.slice(0,dn);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(mn),e[4]=n,e[5]=o,e[6]=i,e[7]=l}else o=e[5],i=e[6],l=e[7];let r;e[8]!==o||e[9]!==i?(r=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function mn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Bt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=W.c(8),{selectionMode:n,children:g}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=he("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fn,children:t.jsx(tn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(Xe,{children:[l,t.jsx(Ge,{align:"end",onClick:pn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function pn(s){return s.stopPropagation()}function fn(s){return s.stopPropagation()}function hn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],m=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)p?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const x=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==g||e[23]!==o||e[24]!==x?(y=()=>o?x():g(),e[22]=g,e[23]=o,e[24]=x,e[25]=y):y=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let A;e[26]!==h||e[27]!==c?(A=he(c,h),e[26]=h,e[27]=c,e[28]=A):A=e[28];const T=o?p?!0:u&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==x?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:x}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=r,e[35]=x,e[36]=M):M=e[36];let I;e[37]!==g?(I=N=>{N.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==o||e[46]!==D?($=t.jsx(Re,{selectionMode:o,children:D}),e[45]=o,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function xn(s){const e=W.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=s,u=te();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:jn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=o,e[3]=u,e[4]=a):a=e[4];let x;e[5]!==d?(x=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=x):x=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==u?(j=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=j):j=e[9];let S;e[10]!==x||e[11]!==j?(S=t.jsxs(ie,{onClick:x,children:[f,j]}),e[10]=x,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(C=(i||l)&&t.jsxs(ie,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Kt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==o||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[S,C,y,c]}),e[27]=o,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=h):h=e[32];let A;return e[33]!==a||e[34]!==h?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=A):A=e[35],A}function jn(s){return s.stopPropagation()}function Sn(s){const e=W.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,a=te();if(n===0)return null;let x;e[0]!==n||e[1]!==a?(x=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=x):x=e[2];let f;e[3]!==x?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:x}),e[3]=x,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(j=n<g?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==p||e[13]!==a?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Le,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(C=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=m,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ee,{size:13}),e[20]=y):y=e[20];let c;e[21]!==u?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(h=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:[f,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=h):h=e[28],h}function yn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=te(),[r,d]=z.useState(null);let p;e[0]!==g?(p=D=>{D||d(null),g(D)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(ke,{children:u}),e[4]=u,e[5]=a):a=e[5];let x;e[6]!==l?(x=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=x):x=e[7];let f;e[8]!==x?(f=t.jsx(Te,{children:x}),e[8]=x,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(we,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==o||e[14]!==r||e[15]!==l?(S=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(en,{icon:D.icon,name:D.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:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==m?(y=()=>m(!1),e[19]=m,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==y?(h=t.jsx(E,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=h):h=e[25];const A=!r;let T;e[26]!==m||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(E,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(Ae,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function Cn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=te(),{org:i}=Me(),l=nt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=Vt(s),u=mt(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,h]=z.useState(!1),[A,T]=z.useState(null),w=Lt(),M=un(Xt(w)),I=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),O=ut(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ue(s.searchTerm),V=$.items,b=ft($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),U=s.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Fe(_);if(v&&N.has(v))return!1}return!0}):[],G=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=lt(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",K=!!v.connection_url,H=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const ve=await p.create.mutateAsync(v),{id:oe}=ve,ce=await Zt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:it.isMCPAuthenticated(le.href,null)}),F(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(zt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=an((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(o("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},L=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ue=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>L.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;F(),R.success(o("orgs.connections.deletedConnections",{count:B})),D()},je=async(_,v)=>{try{await p.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(o(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const K=(await Promise.allSettled(v.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;F(),R.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),D()},ne=async _=>{const v=w.find(H=>H.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await L.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...K]}}),ot(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:v.title})),D()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(pt,{...u}),t.jsx(ln,{open:C,onOpenChange:y,count:f.size,onConfirm:ue}),t.jsx(yn,{open:c,onOpenChange:h,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[G.map(_=>{if(_.type==="group")return t.jsx(hn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(Ce,{connection:v,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(gn,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(xn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:x,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onToggleStatus:K=>je(v.id,K),onDelete:()=>u.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(rn,{item:_,canManage:a,allConnections:m,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(Sn,{count:f.size,total:I.length,canManage:a,canManageAgents:x,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>h(!0),onToggleStatus:ge,onCancel:D})]})}function vn(){const s=te(),{org:e}=Me(),n=$e(),g=qe({strict:!1}),{data:o}=Oe.useSession(),{stdioEnabled:i}=Je(),l=Ve(),{granted:r}=ye("connections:manage"),d=cn({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=Ye(Ze.connectionsTab(e.slug),b=>g.tab==="all"||g.tab==="connected"?g.tab:b??"all"),[a,x]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ue(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(Qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=fe({uiType:h,connectionUrl:A??"",npxPackage:T??""})??De({uiType:h,connectionUrl:A??"",registryItems:C}),M=r&&g.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,G=null;b.ui_type==="NPX"?(N="STDIO",U="",G=Jt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",G=Yt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=ct("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await p.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:G,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,G=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!G&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(ne=>ne.key)),ge=F.envVarKeys.filter(ne=>!je.has(ne));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},L=qt(N);if(L&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",L.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(fe({uiType:"NPX",npxPackage:L.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(fe({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}h==="NPX"&&k(fe({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const b=s("orgs.connections.createConnection"),N=s("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs(Mt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx($t,{children:t.jsx(Ot,{})})}),t.jsxs(Ft,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Wt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="NPX"&&t.jsx(Q,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(Q,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Gt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:L=>{const F=L.clipboardData.getData("text");F&&(L.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:L=>{$(L.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(Q,{control:c.control,name:"title",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(Q,{control:c.control,name:"description",render:({field:k})=>t.jsxs(q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ut,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),G=M;return l?t.jsx(Dt,{open:G,onOpenChange:D,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Tt,{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(wt,{children:b}),t.jsx(At,{className:"mt-1",children:N})]}),t.jsx(It,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Pt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Pe,{open:G,onOpenChange:D,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:b}),t.jsx(Te,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Ae,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>D(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:V,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(at,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(rt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:a,onChange:b=>x(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:f,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]}]})]})}),t.jsx(dt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:b=>{const N=b;N!==m&&ee("connections_page_tab_changed",{to_tab:N}),u(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(Cn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Ls(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Qe,{children:t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),s[0]=e):e=s[0],e}export{Ls as default};