decocms 4.519.0 → 4.520.0

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 (405) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-DpnSicPy.js → ActiveShapeUtils-a2DoNLsg.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-DBK8R4dI.js → AlertCircle-CePpxiVL.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CeMTC5TB.js → AreaChart-futTS77r.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BhYsdDhs.js → ArrowLeft-DPa6sZRI.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-B-samV76.js → ArrowUp-Bc6Es12Z.js} +1 -1
  6. package/dist/client/assets/{BarChart-D4vvVhNP.js → BarChart-CJBobvga.js} +1 -1
  7. package/dist/client/assets/{Building02-BVkscSyZ.js → Building02-BbEppJaI.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-D5TCh86n.js → CartesianChart-D2mofn_H.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-BlWkKGI4.js → CategoricalChart-1f5JjzPP.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-Bnnstx7h.js → CheckCircle-Dlz5XR1a.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-rEBuyaLs.js → ChevronSelectorVertical-BjvpkKQW.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-CBJitQaC.js → ChevronUp-CHckv_8T.js} +1 -1
  13. package/dist/client/assets/{Copy01-B-Kqql1v.js → Copy01-ynYolVGY.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-BuvGgoKU.js → CreditCard01-CJRwgkVP.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-kTicVrIf.js → DotsVertical-xGYJd_oZ.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-BUVr9l59.js → ErrorBarContext-Bu4h-9ud.js} +1 -1
  17. package/dist/client/assets/{Globe04-KYEPLfFL.js → Globe04-rKrlqbJ3.js} +1 -1
  18. package/dist/client/assets/{Image01-D5xmdMv9.js → Image01-J72Rm0Yr.js} +1 -1
  19. package/dist/client/assets/{Key01-egFT7DX9.js → Key01-GACmaKDe.js} +1 -1
  20. package/dist/client/assets/{Link01-DbW4kVwR.js → Link01-Dy_bSHLe.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-OntVHV0h.js → LinkBroken01-Dbb_PbFz.js} +1 -1
  22. package/dist/client/assets/{Minus-DN-1q402.js → Minus-cuNEQYA9.js} +1 -1
  23. package/dist/client/assets/{Monitor01-QBQW5XNf.js → Monitor01-CW3G0lSo.js} +1 -1
  24. package/dist/client/assets/{Play-COeyqncs.js → Play-RPF1C2F0.js} +1 -1
  25. package/dist/client/assets/{Plus-B4v3GkBC.js → Plus-DXIMcQkQ.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-5iYQv1Rq.js → ReferenceLine-CYgqeMqY.js} +1 -1
  27. package/dist/client/assets/{SearchMd-DWVKWjSh.js → SearchMd-DQ6xirDN.js} +1 -1
  28. package/dist/client/assets/{Sector-CExKcwxp.js → Sector-fbb2Py22.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-BhCtEuhY.js → ShoppingBag01-B81IcYcu.js} +1 -1
  30. package/dist/client/assets/{Sun-DXxrAWEA.js → Sun-Bd7hlMAK.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-ByDhQXb-.js → SwitchHorizontal01-QjLd4gai.js} +1 -1
  32. package/dist/client/assets/{Tool01-Bhwq8fKA.js → Tool01-D7eccoeh.js} +1 -1
  33. package/dist/client/assets/{Trash01-BJcybrX2.js → Trash01-CTrNlbT8.js} +1 -1
  34. package/dist/client/assets/{Upload01-D6z8pgdP.js → Upload01-B9oMCz-6.js} +1 -1
  35. package/dist/client/assets/{User01-BaPQvgQq.js → User01-BgWUolo8.js} +1 -1
  36. package/dist/client/assets/{UserSquare-BIGP81NS.js → UserSquare-CZXKi88L.js} +1 -1
  37. package/dist/client/assets/{Users01-OOPFNu5a.js → Users01-B7zAiC4m.js} +1 -1
  38. package/dist/client/assets/{XClose-DbFkM30N.js → XClose-C9XzQkao.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-CKf6RmrA.js → ZoomOut-DKNOmfuK.js} +1 -1
  40. package/dist/client/assets/{access-gate-Bp5g1mrg.js → access-gate-BBEga0hz.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-C3wKqrUu.js → add-connection-dialog-ldH4ynvN.js} +1 -1
  42. package/dist/client/assets/agent-analytics-CAeIvLpw.js +1 -0
  43. package/dist/client/assets/agent-app-BIZw6O6x.js +1 -0
  44. package/dist/client/assets/{agent-assets-CXlM6UQS.js → agent-assets-BTuYhb0x.js} +1 -1
  45. package/dist/client/assets/{agent-automation-C1KFlSjr.js → agent-automation-CPVX6Ssc.js} +1 -1
  46. package/dist/client/assets/{agent-automations-BXeaRV79.js → agent-automations-Depk4_IZ.js} +1 -1
  47. package/dist/client/assets/agent-calendar-rSYcBUhL.js +1 -0
  48. package/dist/client/assets/{agent-connect-sources-ByDR9dOm.js → agent-connect-sources-B_w_bZyW.js} +1 -1
  49. package/dist/client/assets/agent-deck-BdTe1uEF.js +1 -0
  50. package/dist/client/assets/{agent-e2e-BOVUEdNB.js → agent-e2e-BUjIk9_k.js} +1 -1
  51. package/dist/client/assets/agent-experiments-C9MFznl7.js +1 -0
  52. package/dist/client/assets/{agent-file-De8dU8yj.js → agent-file-CD0Yoa7I.js} +1 -1
  53. package/dist/client/assets/{agent-hosting-BJaMFlfC.js → agent-hosting-DZFLF8mA.js} +1 -1
  54. package/dist/client/assets/{agent-icon-B7E6q_wB.js → agent-icon-DtT3h4UX.js} +1 -1
  55. package/dist/client/assets/agent-library-ClrTwj50.js +1 -0
  56. package/dist/client/assets/agent-library-file-CAlMp336.js +1 -0
  57. package/dist/client/assets/agent-monitor-Bn4RTzzk.js +1 -0
  58. package/dist/client/assets/{agent-overview-CSyXy3g4.js → agent-overview-D3DqJ6Lq.js} +1 -1
  59. package/dist/client/assets/{agent-releases-srD8iHFc.js → agent-releases-JCAWDH6g.js} +1 -1
  60. package/dist/client/assets/agent-settings-DUBumxG4.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-C0gN8EWt.js → agent-site-editor-DmMopyU6.js} +1 -1
  62. package/dist/client/assets/agent-site-editor-code-CXdBuByv.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-xxngWBr2.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-DBUt1iNd.js +1 -0
  65. package/dist/client/assets/agent-view-BiUQ1gj5.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-IwJPeHon.js → agent-view-guard-MrJ6Jxxx.js} +1 -1
  67. package/dist/client/assets/{agents-list-kkn2potC.js → agents-list-6A96PYcg.js} +1 -1
  68. package/dist/client/assets/{ai-providers-B1i5Zd64.js → ai-providers-DLOQtpHm.js} +1 -1
  69. package/dist/client/assets/{alert-CfW38lSF.js → alert-BEazQOeN.js} +1 -1
  70. package/dist/client/assets/{alert-dialog-DOm8vTAh.js → alert-dialog-DdGCb0IF.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-BnQKN24n.js → analytics-sections-BO4YnAjA.js} +1 -1
  72. package/dist/client/assets/{analytics-tab-BPISXjrq.js → analytics-tab-DaOlRgMk.js} +1 -1
  73. package/dist/client/assets/{api-keys-B0NZlktL.js → api-keys-BJgy-lS2.js} +1 -1
  74. package/dist/client/assets/api-keys-bhSN63jL.js +1 -0
  75. package/dist/client/assets/{app-editor-Cl4XOhpA.js → app-editor-DLE8thcF.js} +1 -1
  76. package/dist/client/assets/{asset-utils-DE9emOC4.js → asset-utils-BCgXGBCC.js} +1 -1
  77. package/dist/client/assets/{auth-JXZLGOBb.js → auth-D6exVMlw.js} +1 -1
  78. package/dist/client/assets/{auth-catchall-DJ8C8A5P.js → auth-catchall-DvDQWdKb.js} +1 -1
  79. package/dist/client/assets/{auth-entry-CRJg2jV6.js → auth-entry-C86oFADV.js} +1 -1
  80. package/dist/client/assets/{auth-split-layout-Cb2N96wc.js → auth-split-layout-DyRJlWjB.js} +1 -1
  81. package/dist/client/assets/{authenticate-and-persist-oauth-Sm0OtDe1.js → authenticate-and-persist-oauth-ByNJ3IhY.js} +1 -1
  82. package/dist/client/assets/{automation-list-row-DLS7nqs1.js → automation-list-row-CX5dszCC.js} +1 -1
  83. package/dist/client/assets/{automation-runs-DGVHidy8.js → automation-runs-CHeG76Ew.js} +1 -1
  84. package/dist/client/assets/{automations-w7eRZ4NJ.js → automations-BpcPPmZL.js} +1 -1
  85. package/dist/client/assets/{autosend-YiZkI0k7.js → autosend-DJIOdR-h.js} +1 -1
  86. package/dist/client/assets/{avatar-BD2PDf8q.js → avatar-49aPXdv7.js} +1 -1
  87. package/dist/client/assets/{badge-CDeaoqCi.js → badge-Xi0bu-aJ.js} +1 -1
  88. package/dist/client/assets/{block-document-BleRxhvK.js → block-document-Cn8tlonv.js} +1 -1
  89. package/dist/client/assets/{blocks-preview-workspace-context-D22eN4p4.js → blocks-preview-workspace-context-QgOcURJH.js} +1 -1
  90. package/dist/client/assets/{blocks-tab-states-g8ibEmjD.js → blocks-tab-states-BG-MFk9Q.js} +1 -1
  91. package/dist/client/assets/{blog-schema-CrKFhIXz.js → blog-schema-BO9IdDkD.js} +1 -1
  92. package/dist/client/assets/{buckets-DRYNl_Gz.js → buckets-xqarwZ-o.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-C1y7z_kF.js → build-improve-prompt-doc-D7Pi_LQA.js} +1 -1
  94. package/dist/client/assets/{calendar-jrNp7aMz.js → calendar-HcE4WZuE.js} +1 -1
  95. package/dist/client/assets/{campaigns-view-BgZ9KvqV.js → campaigns-view-BLsQazTL.js} +1 -1
  96. package/dist/client/assets/{capability-load-error-tQkVlgGI.js → capability-load-error-BzCsh693.js} +1 -1
  97. package/dist/client/assets/{category-editor-CtUbDM-y.js → category-editor-Cwe6Gn4P.js} +1 -1
  98. package/dist/client/assets/{cdn-tab-wOWVfYEi.js → cdn-tab-tnk9RtCD.js} +1 -1
  99. package/dist/client/assets/{chart-BBE_aWjm.js → chart-BKCzQrbM.js} +1 -1
  100. package/dist/client/assets/{chat-context-C1JvjRtO.js → chat-context-CwxNIspy.js} +1 -1
  101. package/dist/client/assets/{chat-draft-B0O1aMg3.js → chat-draft-Czzd6Fgc.js} +1 -1
  102. package/dist/client/assets/{checkbox-BQV5rQq6.js → checkbox-IscGSBh9.js} +1 -1
  103. package/dist/client/assets/{choose-editor-Cco5iYhS.js → choose-editor-uAgHg51i.js} +1 -1
  104. package/dist/client/assets/{cli-auth-success-C0BkGk_m.js → cli-auth-success-BhFG_H4z.js} +1 -1
  105. package/dist/client/assets/{client-icons-CSB7_p4A.js → client-icons-CZ-ZSlxS.js} +1 -1
  106. package/dist/client/assets/cms-settings-editor-DVlUigtK.js +1 -0
  107. package/dist/client/assets/{collapsible-DyKYJwPy.js → collapsible-D314pUSB.js} +1 -1
  108. package/dist/client/assets/{collection-detail-BvgJ-RrS.js → collection-detail-CuIOpuSM.js} +1 -1
  109. package/dist/client/assets/{collection-display-button-IJ7oRZnA.js → collection-display-button-kbHHi0Kq.js} +1 -1
  110. package/dist/client/assets/{collection-search-DF8xKBAI.js → collection-search-DCYm5aP4.js} +1 -1
  111. package/dist/client/assets/{collection-table-wrapper-N4bJjHS6.js → collection-table-wrapper-DDG00R7J.js} +1 -1
  112. package/dist/client/assets/{collection-tabs-DUP2Wv2k.js → collection-tabs-CpRvK4aY.js} +1 -1
  113. package/dist/client/assets/{column-rules-CzVSaEJv.js → column-rules-yLNPamrN.js} +1 -1
  114. package/dist/client/assets/{combobox-DSv_uY1C.js → combobox-uDe7w0z0.js} +1 -1
  115. package/dist/client/assets/{command-C2RTsWLU.js → command-DcKOVszs.js} +1 -1
  116. package/dist/client/assets/{companion-mcps-section-Om4Xi1g-.js → companion-mcps-section-DZ2ioXzY.js} +1 -1
  117. package/dist/client/assets/{config-CnSMG0Cu.js → config-DlkgY7Jy.js} +1 -1
  118. package/dist/client/assets/{connect-layout-Zlm12dcn.js → connect-layout-DU417orE.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-DNnWnFk9.js → connect-source-dialog-B6k_6_M9.js} +1 -1
  120. package/dist/client/assets/{connect-Cyhyxw9Y.js → connect-wFJx1iR7.js} +1 -1
  121. package/dist/client/assets/{connection-CKGquOu0.js → connection-CLuVf0UF.js} +1 -1
  122. package/dist/client/assets/{connection-card-CeElSdkP.js → connection-card-BaWG41H0.js} +1 -1
  123. package/dist/client/assets/{connection-detail-XrFXQKQo.js → connection-detail-B8vzaLYN.js} +1 -1
  124. package/dist/client/assets/{connection-form-helpers-D5tlzOOb.js → connection-form-helpers-BWk506qj.js} +1 -1
  125. package/dist/client/assets/{connections-WO7Na7dg.js → connections-ajPWQmhT.js} +1 -1
  126. package/dist/client/assets/{content-tab-C3B5hAv_.js → content-tab-C9mWHRiZ.js} +3 -3
  127. package/dist/client/assets/{context-BojR4HN9.js → context-BZM48LEC.js} +1 -1
  128. package/dist/client/assets/{context-menu-22sCTgBs.js → context-menu-DuBXLH-0.js} +1 -1
  129. package/dist/client/assets/{context-shell-D1N7epOl.js → context-shell-DBFau4jR.js} +3 -3
  130. package/dist/client/assets/{core.esm-QVBuVFEZ.js → core.esm-r_1fOlla.js} +1 -1
  131. package/dist/client/assets/{create-organization-dialog-D6kuk20k.js → create-organization-dialog-DinRNNUe.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-CQHr9nNT.js → daily-pulse-DIrHsqZA.js} +1 -1
  133. package/dist/client/assets/{discover-C-_i2-PM.js → discover-fUj70D62.js} +1 -1
  134. package/dist/client/assets/{domain-settings-C-dCekXs.js → domain-settings-CLujyp1m.js} +1 -1
  135. package/dist/client/assets/{drawer-_y_lX-Yn.js → drawer-CyiQimHr.js} +1 -1
  136. package/dist/client/assets/{editor-D3dE1UTI.js → editor-BpL3QDOn.js} +1 -1
  137. package/dist/client/assets/{editor-classes-Bzr4sAFl.js → editor-classes-DA3QHiC-.js} +1 -1
  138. package/dist/client/assets/{empty-state-gsVYH7fP.js → empty-state-B0G_CGwR.js} +1 -1
  139. package/dist/client/assets/{empty-state-C-9cwlrp.js → empty-state-Bw4axBb5.js} +1 -1
  140. package/dist/client/assets/{experiments-tab-CeVz9r9-.js → experiments-tab-BkzMMdcP.js} +1 -1
  141. package/dist/client/assets/{experiments-tab-choice-2QAdfouX.js → experiments-tab-choice-BYO4Dw1S.js} +1 -1
  142. package/dist/client/assets/{extract-connection-data-CgXJmK0-.js → extract-connection-data-CwDf8Ns1.js} +1 -1
  143. package/dist/client/assets/{feature-gate-C5He1Jql.js → feature-gate-BxG3yqt8.js} +1 -1
  144. package/dist/client/assets/{feature-paywall-BKaJGna9.js → feature-paywall-BHK5XVuW.js} +1 -1
  145. package/dist/client/assets/{file-explorer-v9KulF9f.js → file-explorer-CPGV5tot.js} +1 -1
  146. package/dist/client/assets/{file-preview-BJJubHbu.js → file-preview-BdEwMhOt.js} +1 -1
  147. package/dist/client/assets/{file-share-button-Devx0UP5.js → file-share-button-C4MFpt4s.js} +1 -1
  148. package/dist/client/assets/{file-type-icon-CtKJHzOq.js → file-type-icon-BnEUVv2h.js} +1 -1
  149. package/dist/client/assets/{folder-icon-v_un8oBh.js → folder-icon-DOB3P9Vd.js} +1 -1
  150. package/dist/client/assets/{form-B4txFZ9_.js → form-CpnGThcL.js} +1 -1
  151. package/dist/client/assets/{general-D1PYsEPe.js → general-7WS5B97k.js} +1 -1
  152. package/dist/client/assets/{home-Ce58QfRL.js → home-CfcdGSri.js} +1 -1
  153. package/dist/client/assets/{icon-button-B2nkkF4s.js → icon-button-B1pb2_kW.js} +1 -1
  154. package/dist/client/assets/{index-DofgWNDj.js → index-B-nEUC-m.js} +1 -1
  155. package/dist/client/assets/{index-DAeJjOY-.js → index-B6fYZNK2.js} +1 -1
  156. package/dist/client/assets/{index-9zYu4OQI.js → index-BlsmUzy2.js} +1 -1
  157. package/dist/client/assets/{index-CHOolU-2.js → index-CDmfe_Ze.js} +1 -1
  158. package/dist/client/assets/{index-C_vsZdEs.js → index-CMKEBGKX.js} +36 -36
  159. package/dist/client/assets/{index-uj-2aD6g.js → index-CMr2QK3C.js} +1 -1
  160. package/dist/client/assets/{index-CYvWDMig.js → index-CXV4VJ6T.js} +1 -1
  161. package/dist/client/assets/{index-Bp5c1HaS.js → index-CZWqOlKo.js} +1 -1
  162. package/dist/client/assets/{index-ZeYytYg9.js → index-C_uum72U.js} +1 -1
  163. package/dist/client/assets/{index-DC_lXxHn.js → index-D2b1OQG0.js} +1 -1
  164. package/dist/client/assets/{index-CBPFaqzb.js → index-DwGMmQy3.js} +1 -1
  165. package/dist/client/assets/{index-CBITis32.js → index-Okf21u4l.js} +1 -1
  166. package/dist/client/assets/{index-BjNnHm9S.js → index-P7t2U4iN.js} +1 -1
  167. package/dist/client/assets/{index-redirect-Jch1OTL_.js → index-redirect-B2074CyX.js} +1 -1
  168. package/dist/client/assets/{index-DfK7_snd.js → index-tbca9DY7.js} +1 -1
  169. package/dist/client/assets/{index-AnCWAS83.js → index-uNmIis3_.js} +1 -1
  170. package/dist/client/assets/{infiniteQueryObserver-C2uEQLvN.js → infiniteQueryObserver-sZS50x9h.js} +1 -1
  171. package/dist/client/assets/{infra-billing-BI2rcYbR.js → infra-billing-Cf1YDWV8.js} +1 -1
  172. package/dist/client/assets/{input-nGqpK_4e.js → input-DlOSVkNE.js} +3 -3
  173. package/dist/client/assets/{input-DlfhLXVo.js → input-qA_oxMGt.js} +1 -1
  174. package/dist/client/assets/{integration-icon-CeG7h1x5.js → integration-icon-mkTLlJYZ.js} +1 -1
  175. package/dist/client/assets/{jira-icon-DLfJcRXS.js → jira-icon-C5lcBXYi.js} +1 -1
  176. package/dist/client/assets/{label-CCla7LnP.js → label-8_hsm0_y.js} +1 -1
  177. package/dist/client/assets/{layout-C9sg2y3c.js → layout-C4N_3p9u.js} +1 -1
  178. package/dist/client/assets/{legacy-agents-deep-BpXhG-Np.js → legacy-agents-deep-Zsw21wnc.js} +1 -1
  179. package/dist/client/assets/{legacy-main-redirect-CNUdNl6X.js → legacy-main-redirect-RzdE-Ynb.js} +1 -1
  180. package/dist/client/assets/library-CKihNjtp.js +1 -0
  181. package/dist/client/assets/{login-mhnZ1Cb9.js → login-B439_6KR.js} +1 -1
  182. package/dist/client/assets/{markdown-BDTHe610.js → markdown-yQLRhm2z.js} +1 -1
  183. package/dist/client/assets/{mcp-app-renderer-CMRuQe66.js → mcp-app-renderer-gJ1lyd1u.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-L6wgBjWx.js → mcp-oauth-B64tInkO.js} +1 -1
  185. package/dist/client/assets/{mcp-oauth-CIkq3Lwg.js → mcp-oauth-BFUDXDf6.js} +1 -1
  186. package/dist/client/assets/{members-V_RnUVXg.js → members-Beq92g_c.js} +1 -1
  187. package/dist/client/assets/{memory-CB8DHXY4.js → memory-BkOPkUkc.js} +1 -1
  188. package/dist/client/assets/{mini-report-page-DZhVo3A1.js → mini-report-page-BWPJGpfB.js} +1 -1
  189. package/dist/client/assets/{mock-board-Dy_pSyrX.js → mock-board-qTnFSOlt.js} +3 -3
  190. package/dist/client/assets/{monaco-editor-BzWTOVge.js → monaco-editor-C2ej8TCv.js} +1 -1
  191. package/dist/client/assets/{monitoring-UGiK-7BE.js → monitoring-BdT45NJd.js} +1 -1
  192. package/dist/client/assets/{monitoring-stats-row-BagVDHFD.js → monitoring-stats-row-QRt_yzIW.js} +1 -1
  193. package/dist/client/assets/{multi-select-CKLuefuY.js → multi-select-D4sL81eP.js} +1 -1
  194. package/dist/client/assets/{mustache-Co8KcLI0.js → mustache-3jnCJNSv.js} +1 -1
  195. package/dist/client/assets/{named-rule-uses-0L-mc_uD.js → named-rule-uses-u1am7LRC.js} +1 -1
  196. package/dist/client/assets/{named-rule-view-DZyPdsij.js → named-rule-view-B49ZuZC_.js} +1 -1
  197. package/dist/client/assets/{new-project-dialog-C5J4MWsO.js → new-project-dialog-DCNrhfVx.js} +1 -1
  198. package/dist/client/assets/{oauth-callback-DGdoi3wa.js → oauth-callback-D1lTLeuO.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-ai-provider-DID3n8T6.js → oauth-callback-ai-provider-uHk7H4_s.js} +1 -1
  200. package/dist/client/assets/{onboarding-D9ovXhj0.js → onboarding-Cqmu7Q1I.js} +1 -1
  201. package/dist/client/assets/{openai-conversation-CM0XUf2p.js → openai-conversation-D9oaPp7I.js} +1 -1
  202. package/dist/client/assets/{optimistic-project-sidebar-views-Bfc4VpR_.js → optimistic-project-sidebar-views-C2xkkt2n.js} +1 -1
  203. package/dist/client/assets/{order-monitor-day-DXxkF6qy.js → order-monitor-day-Bn2RftCy.js} +1 -1
  204. package/dist/client/assets/{organization-choice-BPMnBB4D.js → organization-choice-DbSR_Tq1.js} +1 -1
  205. package/dist/client/assets/{orgs-D8DaVl4f.js → orgs-Dv6ZMLaR.js} +1 -1
  206. package/dist/client/assets/{page-seo-form-BRaefSdh.js → page-seo-form-CYdB-eYU.js} +1 -1
  207. package/dist/client/assets/{pair-DO5ZeABu.js → pair-DIRyClgs.js} +1 -1
  208. package/dist/client/assets/{parse-sections-C4YcWg_N.js → parse-sections-CvCJ7mYl.js} +1 -1
  209. package/dist/client/assets/{plan-0xsoBIKI.js → plan-bTtLskYs.js} +1 -1
  210. package/dist/client/assets/{plan-ladder-RZlDrpyw.js → plan-ladder-DNfn-N6n.js} +1 -1
  211. package/dist/client/assets/{popover-CjjSJX-T.js → popover-n_tcLsd5.js} +1 -1
  212. package/dist/client/assets/{post-calendar-CMfQVQhR.js → post-calendar-DnSIZDH2.js} +1 -1
  213. package/dist/client/assets/{post-editor-DneZ_oYu.js → post-editor-Ds8VBbi2.js} +1 -1
  214. package/dist/client/assets/{preview-content-C045LLz9.js → preview-content-YpNvTcZt.js} +1 -1
  215. package/dist/client/assets/{preview-dialog-C5KMdNHK.js → preview-dialog-DJ8srmsM.js} +1 -1
  216. package/dist/client/assets/{preview-panel-DbAGt6c_.js → preview-panel-C7cA2AYG.js} +1 -1
  217. package/dist/client/assets/{preview-tab-BT-Dmpc3.js → preview-tab-lR6Zy9Kz.js} +3 -3
  218. package/dist/client/assets/{product-picker-dialog-BjUVIbA3.js → product-picker-dialog-BQZeexho.js} +1 -1
  219. package/dist/client/assets/{profile-nkfQjNS7.js → profile-D9pE1ZCt.js} +1 -1
  220. package/dist/client/assets/project-app-view-BJMSCiLQ.js +1 -0
  221. package/dist/client/assets/{project-apps-BNVRAEb2.js → project-apps-CKpWGbT4.js} +1 -1
  222. package/dist/client/assets/{project-feed-xXVaAcj7.js → project-feed-BFyTaEPY.js} +1 -1
  223. package/dist/client/assets/{project-icon-N-_cW8IV.js → project-icon-BozuiJlT.js} +1 -1
  224. package/dist/client/assets/project-reports-B6AQHucI.js +1 -0
  225. package/dist/client/assets/project-tasks-DFBfLTNl.js +1 -0
  226. package/dist/client/assets/{projects-iwaahBWW.js → projects-Bj8bu01s.js} +1 -1
  227. package/dist/client/assets/{projects-empty-state-zSj-H-15.js → projects-empty-state-Co0D5JhR.js} +1 -1
  228. package/dist/client/assets/{prompts-DHg6zTlM.js → prompts-CUYrqR6B.js} +1 -1
  229. package/dist/client/assets/record-editor-Dq4w4KU3.js +1 -0
  230. package/dist/client/assets/{redirect-editor-CUc3_Gjb.js → redirect-editor-tsiTjzIT.js} +1 -1
  231. package/dist/client/assets/{releases-api-FsFJ3Ao1.js → releases-api-DuhgreiH.js} +1 -1
  232. package/dist/client/assets/{reports-BfO4SPfx.js → reports-BG2If9Qe.js} +1 -1
  233. package/dist/client/assets/reports-DhdnjILE.js +1 -0
  234. package/dist/client/assets/{reports-onboarding-C51nw6GE.js → reports-onboarding-DMCkOYqe.js} +1 -1
  235. package/dist/client/assets/{reports-tab-D4zotKTH.js → reports-tab-LnruJoPA.js} +2 -2
  236. package/dist/client/assets/repositories-CBH2GIms.js +1 -0
  237. package/dist/client/assets/{repositories-ChqgU36Q.js → repositories-D-cEWI3N.js} +1 -1
  238. package/dist/client/assets/{repository-binding-DAOz6vJw.js → repository-binding-BBtZf2zz.js} +1 -1
  239. package/dist/client/assets/{repository-import-picker-BcrGb4sk.js → repository-import-picker-Dm0ES3Rv.js} +1 -1
  240. package/dist/client/assets/{repository-picker-BIZQUbzV.js → repository-picker-CPuj3bZ1.js} +1 -1
  241. package/dist/client/assets/{require-capability-CW24vDTN.js → require-capability-C24QIC4M.js} +1 -1
  242. package/dist/client/assets/{required-auth-layout-DZbUxfmT.js → required-auth-layout-PhuA3Ewp.js} +1 -1
  243. package/dist/client/assets/{reset-password-CGOBWPvy.js → reset-password-C8SdUbOh.js} +1 -1
  244. package/dist/client/assets/{resizable-CZKHd0We.js → resizable-miZzhQuc.js} +1 -1
  245. package/dist/client/assets/{resolve-tab-icon-kIr1F8om.js → resolve-tab-icon-CpfXvomr.js} +1 -1
  246. package/dist/client/assets/{review-settings-9IMzIRKU.js → review-settings-BrKUWarQ.js} +1 -1
  247. package/dist/client/assets/{roles-DZEPLtk9.js → roles-BlQqDK5V.js} +1 -1
  248. package/dist/client/assets/{route-lBtyO3bR.js → route-C1AFWDaT.js} +1 -1
  249. package/dist/client/assets/route-DSfRBjPS.js +1 -0
  250. package/dist/client/assets/{route-BRcGegjD.js → route-fvDFg13s.js} +1 -1
  251. package/dist/client/assets/{runnable-block-editor-DUtYxxN3.js → runnable-block-editor-Bn4b767r.js} +3 -3
  252. package/dist/client/assets/{sandbox-lifecycle-context-wjpGI-pF.js → sandbox-lifecycle-context-DR0GTBJX.js} +1 -1
  253. package/dist/client/assets/{schema-CeHPVV-x.js → schema-BRZOWw0d.js} +1 -1
  254. package/dist/client/assets/{schema-B-d5VC7M.js → schema-CylodOUQ.js} +1 -1
  255. package/dist/client/assets/{scroll-area-DpJwcaMZ.js → scroll-area-BH2Oy8PV.js} +1 -1
  256. package/dist/client/assets/{search-input-Dn_Mm6hP.js → search-input-RbNJNFgo.js} +1 -1
  257. package/dist/client/assets/{search-toggle-BlrCbEt-.js → search-toggle-BKYod6Wy.js} +1 -1
  258. package/dist/client/assets/{secret-ciphertext-x-rG3-SW.js → secret-ciphertext-IJ4Mey7K.js} +1 -1
  259. package/dist/client/assets/{secret-picker-BjSmxw0L.js → secret-picker-C-cbBnBP.js} +1 -1
  260. package/dist/client/assets/{secrets-BOaO2wUC.js → secrets-BvD9KlhJ.js} +1 -1
  261. package/dist/client/assets/{sections-B7NcoZr9.js → sections-C2rk7uX1.js} +1 -1
  262. package/dist/client/assets/{sections-editor-B65DWyde.js → sections-editor-DTbMqnxy.js} +1 -1
  263. package/dist/client/assets/{select-35KAqptX.js → select-B-vRTlp8.js} +1 -1
  264. package/dist/client/assets/{select-model-CRhm1POv.js → select-model-jzXUtlUA.js} +1 -1
  265. package/dist/client/assets/{seo-editor-BD4rsTCg.js → seo-editor-BqtZxWFt.js} +1 -1
  266. package/dist/client/assets/{separator-CN44jTdI.js → separator-DQdTCaJ6.js} +1 -1
  267. package/dist/client/assets/settings-tab-CPth5xHx.js +1 -0
  268. package/dist/client/assets/{sheet--x4K5vq7.js → sheet-DIT9lGlU.js} +1 -1
  269. package/dist/client/assets/{shell-layout-MuOSrWff.js → shell-layout-NV-fbXIm.js} +1 -1
  270. package/dist/client/assets/{site-draft-actions-C158kLWC.js → site-draft-actions-DpuJ9efE.js} +1 -1
  271. package/dist/client/assets/site-draft-view-D6YYVH6j.js +2 -0
  272. package/dist/client/assets/site-editor-CpNSE9w9.js +1 -0
  273. package/dist/client/assets/{site-editor-toast-S3ZDWqj4.js → site-editor-toast-hxv14akZ.js} +1 -1
  274. package/dist/client/assets/{skills-DLHcL6Ra.js → skills-Dmur65NR.js} +1 -1
  275. package/dist/client/assets/{slider-CB0MGtcs.js → slider-DL5ZrKD2.js} +1 -1
  276. package/dist/client/assets/{sortable.esm-CnslkyN-.js → sortable.esm-CmQjLRc-.js} +1 -1
  277. package/dist/client/assets/{sso-HY_2IIv9.js → sso-DJaANv0k.js} +1 -1
  278. package/dist/client/assets/{suggestion-DZQHNrRW.js → suggestion-Dp-vLwaS.js} +1 -1
  279. package/dist/client/assets/{switch-CUuF3Lbb.js → switch-CWqn4x2S.js} +1 -1
  280. package/dist/client/assets/{symbol-BF05cGJ-.js → symbol-9K-WFQbg.js} +1 -1
  281. package/dist/client/assets/{synced-repos-BSOSKhlb.js → synced-repos-C6pBMypP.js} +1 -1
  282. package/dist/client/assets/{tab-icon-glyph-CJIOp39A.js → tab-icon-glyph-CM3k-yhU.js} +1 -1
  283. package/dist/client/assets/{table-BlnsYBCM.js → table-Clkje7xI.js} +1 -1
  284. package/dist/client/assets/{tabs-6v8Cll9k.js → tabs-SpJ7v19a.js} +1 -1
  285. package/dist/client/assets/{task-assignee-avatar-C9Sk5bvn.js → task-assignee-avatar-D7x8Ztl2.js} +1 -1
  286. package/dist/client/assets/{task-board-Bt136szd.js → task-board-CEgpYip9.js} +1 -1
  287. package/dist/client/assets/{task-route-t6KGoxhC.js → task-route-0IGfE2Sp.js} +1 -1
  288. package/dist/client/assets/{task-status-DvsJuwH-.js → task-status-DxuW2r4d.js} +1 -1
  289. package/dist/client/assets/{taskboard-analytics-Dsx_nKwf.js → taskboard-analytics-D5efiDoG.js} +1 -1
  290. package/dist/client/assets/{tasks-B9wf25Tq.js → tasks-BOOTk53y.js} +1 -1
  291. package/dist/client/assets/tasks-DBKhuSFQ.js +1 -0
  292. package/dist/client/assets/{textarea-CzFPd8mY.js → textarea-DhtVYf8e.js} +1 -1
  293. package/dist/client/assets/{thread-analytics-BNsgRzDB.js → thread-analytics-WxV3T9V2.js} +1 -1
  294. package/dist/client/assets/{thread-intent-Dimk3aQq.js → thread-intent-BS7K-UuZ.js} +1 -1
  295. package/dist/client/assets/{thread-route-Dx9_u5Jd.js → thread-route-BZhEwUGV.js} +1 -1
  296. package/dist/client/assets/{thread-route-CBR-hVjV.js → thread-route-BkotEDA1.js} +1 -1
  297. package/dist/client/assets/{thread-sheet-body-BW-XRqLk.js → thread-sheet-body-F9Cd7VsI.js} +1 -1
  298. package/dist/client/assets/{time-range-picker-CmcQeC_-.js → time-range-picker-DgOYXLpU.js} +1 -1
  299. package/dist/client/assets/{toggle-group-o8h9w6Rw.js → toggle-group-errY3aOY.js} +1 -1
  300. package/dist/client/assets/{tool-namespace-BohpB6u5.js → tool-namespace-BVXAR9Sk.js} +1 -1
  301. package/dist/client/assets/{toolbar-icon-button-eoL5rlvV.js → toolbar-icon-button-Cq4ZT7sJ.js} +1 -1
  302. package/dist/client/assets/{tooltip-BKiQ2c4S.js → tooltip-WTx8RFDb.js} +1 -1
  303. package/dist/client/assets/{tooltipContext-BKUF9aS4.js → tooltipContext-Ccm0pmDN.js} +1 -1
  304. package/dist/client/assets/{track-BIe-Ry31.js → track-DGHY3NJe.js} +1 -1
  305. package/dist/client/assets/{types-CjXbKtgO.js → types-C2kyJgqF.js} +1 -1
  306. package/dist/client/assets/{url-slug-CKCta88_.js → url-slug-eBdSwuRg.js} +1 -1
  307. package/dist/client/assets/{usage-stats-CTkcwRGv.js → usage-stats-BCvxtMFR.js} +1 -1
  308. package/dist/client/assets/{use-ai-providers-De1swco5.js → use-ai-providers-BUYCLrsq.js} +1 -1
  309. package/dist/client/assets/{use-apply-named-rule-Yk2R4vGY.js → use-apply-named-rule-D8uSRmIc.js} +1 -1
  310. package/dist/client/assets/{use-automations-DOZ_ddWM.js → use-automations-BKnx1LOU.js} +1 -1
  311. package/dist/client/assets/{use-autosave-B8CxO0rS.js → use-autosave-C0kQXP3a.js} +1 -1
  312. package/dist/client/assets/{use-chat-layout-state-B0cKljGG.js → use-chat-layout-state-CoSgX-8p.js} +1 -1
  313. package/dist/client/assets/{use-clock-tick-DXHhIXGi.js → use-clock-tick-BVcS6c_m.js} +1 -1
  314. package/dist/client/assets/{use-connect-companion-CNjzI2Gb.js → use-connect-companion-Dfch6Pn5.js} +1 -1
  315. package/dist/client/assets/{use-connection-Bb5luwYC.js → use-connection-C2QTK4P4.js} +1 -1
  316. package/dist/client/assets/{use-content-sync-9gqPWQll.js → use-content-sync-cSja7hdH.js} +1 -1
  317. package/dist/client/assets/{use-copy-GYYhLXBY.js → use-copy-DedJIHzN.js} +1 -1
  318. package/dist/client/assets/{use-create-virtual-mcp-CcifdRil.js → use-create-virtual-mcp-JDXemb5m.js} +1 -1
  319. package/dist/client/assets/{use-date-fns-locale-CYgQL4Jo.js → use-date-fns-locale-ByEf5sEV.js} +1 -1
  320. package/dist/client/assets/{use-debounced-autosave-B9JjKQU0.js → use-debounced-autosave-C_RB3agc.js} +1 -1
  321. package/dist/client/assets/{use-debounced-value-BOYaK5vY.js → use-debounced-value-ELHlrW87.js} +1 -1
  322. package/dist/client/assets/{use-deco-credits-BOXZz3P1.js → use-deco-credits-D6gi2fbm.js} +1 -1
  323. package/dist/client/assets/{use-decopilot-events-DQQB-1qO.js → use-decopilot-events-CwR46UgN.js} +1 -1
  324. package/dist/client/assets/{use-delete-connection-DeeN5sak.js → use-delete-connection-BTgka6iQ.js} +1 -1
  325. package/dist/client/assets/{use-deployment-admin-Bz_unjS_.js → use-deployment-admin-BCN-ylik.js} +1 -1
  326. package/dist/client/assets/{use-fast-preview-draft-url-DL15tTpN.js → use-fast-preview-draft-url-CVZxF7Um.js} +1 -1
  327. package/dist/client/assets/{use-file-configs-Bs34_QXe.js → use-file-configs-Br5njpmm.js} +1 -1
  328. package/dist/client/assets/{use-inbox-feed-CPLQGzQu.js → use-inbox-feed-Dz2zKYVV.js} +1 -1
  329. package/dist/client/assets/{use-infinite-scroll-TKtAAXad.js → use-infinite-scroll-C3u8iypP.js} +1 -1
  330. package/dist/client/assets/{use-join-requests-Zw7OQ09c.js → use-join-requests-D2Wm3dTe.js} +1 -1
  331. package/dist/client/assets/{use-main-panel-tabs-w1hDvrxY.js → use-main-panel-tabs-CTK-I6l5.js} +1 -1
  332. package/dist/client/assets/{use-mcp-auth-status-DTPo2TCr.js → use-mcp-auth-status-BPhXIpD4.js} +1 -1
  333. package/dist/client/assets/{use-mcp-client-Q83YdvIg.js → use-mcp-client-COM3gP2O.js} +1 -1
  334. package/dist/client/assets/{use-mcp-prompts-BcqS4HpY.js → use-mcp-prompts-1pj8Mn9o.js} +1 -1
  335. package/dist/client/assets/{use-mcp-tools-CFBxGHgP.js → use-mcp-tools-DVMy4xzU.js} +1 -1
  336. package/dist/client/assets/{use-members-CMq0EOLQ.js → use-members-BXYZ5GWT.js} +1 -1
  337. package/dist/client/assets/{use-mobile-DHwXmnJW.js → use-mobile-Bq3CXRKG.js} +1 -1
  338. package/dist/client/assets/{use-move-blocks-BZQPOuio.js → use-move-blocks-BrZbG7eM.js} +1 -1
  339. package/dist/client/assets/{use-navigate-to-agent-CRetfCk1.js → use-navigate-to-agent-F9oDR6Aw.js} +1 -1
  340. package/dist/client/assets/{use-open-billing-url-BoLb6LTQ.js → use-open-billing-url-D4P9ija_.js} +1 -1
  341. package/dist/client/assets/{use-org-auth-client-Im4HAiDN.js → use-org-auth-client-C3gy1liR.js} +1 -1
  342. package/dist/client/assets/{use-org-fs-BkhssW-q.js → use-org-fs-BRfBBlvJ.js} +1 -1
  343. package/dist/client/assets/{use-org-repo-syncs-CQwCJbKx.js → use-org-repo-syncs-IArfEyUi.js} +1 -1
  344. package/dist/client/assets/{use-org-sso-ChZhVF-c.js → use-org-sso-ChkTjfH5.js} +1 -1
  345. package/dist/client/assets/{use-organization-roles-C3qIjIVy.js → use-organization-roles-Dx88n2m6.js} +1 -1
  346. package/dist/client/assets/{use-organization-settings-BKC0vqj5.js → use-organization-settings-dAOl4U_-.js} +1 -1
  347. package/dist/client/assets/{use-panel-navigate-D3V5oZgG.js → use-panel-navigate-CW6DUzf9.js} +1 -1
  348. package/dist/client/assets/{use-project-native-view-presence-BnccFS-g.js → use-project-native-view-presence-CTc7wMZF.js} +1 -1
  349. package/dist/client/assets/{use-project-scope-CXdLsOUx.js → use-project-scope-BFye4eeg.js} +1 -1
  350. package/dist/client/assets/{use-recent-apps-B5QclJaN.js → use-recent-apps-BU79Go-x.js} +1 -1
  351. package/dist/client/assets/{use-releases-BC3G5Pl0.js → use-releases-CfZAXBwl.js} +1 -1
  352. package/dist/client/assets/{use-reports-diagnostic-tcpLCmvm.js → use-reports-diagnostic-CJiI0aEe.js} +1 -1
  353. package/dist/client/assets/{use-sandbox-events-DvplhdO9.js → use-sandbox-events-Bryc2tH_.js} +1 -1
  354. package/dist/client/assets/{use-secrets-Bc11D92Z.js → use-secrets-BBwZJiLY.js} +1 -1
  355. package/dist/client/assets/{use-section-preview-base-Dnt4agkC.js → use-section-preview-base-B5gtsawP.js} +1 -1
  356. package/dist/client/assets/{use-session-runtime-C4oqymjC.js → use-session-runtime-C6i7UtWU.js} +1 -1
  357. package/dist/client/assets/{use-sidebar-collapsed-BwUTTLp4.js → use-sidebar-collapsed-CKSL9ORL.js} +1 -1
  358. package/dist/client/assets/{use-tags-BB1h7o3t.js → use-tags-C7NcCL7l.js} +1 -1
  359. package/dist/client/assets/{use-task-board-analytics-DGpoyTMw.js → use-task-board-analytics-CmTEpb8g.js} +1 -1
  360. package/dist/client/assets/{use-task-board-events-CavGFGcP.js → use-task-board-events-bChrXXDv.js} +1 -1
  361. package/dist/client/assets/{use-task-board-item-prs-DV_64vVH.js → use-task-board-item-prs-B5n2Imtn.js} +1 -1
  362. package/dist/client/assets/{use-task-metadata-HTLDRogK.js → use-task-metadata-CyLevNIC.js} +1 -1
  363. package/dist/client/assets/{use-thread-analytics-BpkGclpK.js → use-thread-analytics-BdSD31wi.js} +1 -1
  364. package/dist/client/assets/{use-thread-outputs-DTZGPUxN.js → use-thread-outputs-COl9UfXy.js} +1 -1
  365. package/dist/client/assets/useInfiniteQuery-EcJS-_aQ.js +1 -0
  366. package/dist/client/assets/{useQueries-jpAcc0Og.js → useQueries-Dgo1k5er.js} +1 -1
  367. package/dist/client/assets/useSuspenseInfiniteQuery-XLLgwpcB.js +1 -0
  368. package/dist/client/assets/{users-rDy84J0H.js → users-BOMrf4Fo.js} +1 -1
  369. package/dist/client/assets/{utils-Azo2Yo1D.js → utils-fsgeKe9W.js} +1 -1
  370. package/dist/client/assets/{variant-calendar-EbCPgcKt.js → variant-calendar-CGX7TiEA.js} +1 -1
  371. package/dist/client/assets/{variant-matcher-override-aUUxuYxP.js → variant-matcher-override-D3H0IPwr.js} +1 -1
  372. package/dist/client/assets/{virtual-mcp-DSXubdao.js → virtual-mcp-th0bGjq5.js} +1 -1
  373. package/dist/client/assets/{watch-sse-pool-BydfW6Wr.js → watch-sse-pool-9c6_Ze8B.js} +1 -1
  374. package/dist/client/index.html +1 -1
  375. package/dist/server/server.js +2 -2
  376. package/package.json +1 -1
  377. package/dist/client/assets/agent-analytics-ga8WG0DD.js +0 -1
  378. package/dist/client/assets/agent-app-D3wD7b8f.js +0 -1
  379. package/dist/client/assets/agent-calendar-B3oKpSw2.js +0 -1
  380. package/dist/client/assets/agent-deck-CXdYMYf4.js +0 -1
  381. package/dist/client/assets/agent-experiments-HQCEx4Fq.js +0 -1
  382. package/dist/client/assets/agent-library-CycM9_xW.js +0 -1
  383. package/dist/client/assets/agent-library-file-CQfHiAWz.js +0 -1
  384. package/dist/client/assets/agent-monitor-DZTUJG_q.js +0 -1
  385. package/dist/client/assets/agent-settings-BzozrOuP.js +0 -1
  386. package/dist/client/assets/agent-site-editor-code-CfhAFGbw.js +0 -2
  387. package/dist/client/assets/agent-site-editor-content-HSi2zAV9.js +0 -1
  388. package/dist/client/assets/agent-site-editor-preview--Eh8H0cH.js +0 -1
  389. package/dist/client/assets/agent-view-i5fuA9y0.js +0 -1
  390. package/dist/client/assets/api-keys-9XoxlxPv.js +0 -1
  391. package/dist/client/assets/cms-settings-editor-DzowXA1R.js +0 -1
  392. package/dist/client/assets/library-KPhgahQ-.js +0 -1
  393. package/dist/client/assets/project-app-view-bzcy9g1q.js +0 -1
  394. package/dist/client/assets/project-reports-CAf7P6Es.js +0 -1
  395. package/dist/client/assets/project-tasks-XqUcBopf.js +0 -1
  396. package/dist/client/assets/record-editor-hs79wE2U.js +0 -1
  397. package/dist/client/assets/reports-s1lwdSit.js +0 -1
  398. package/dist/client/assets/repositories-CGUqALW5.js +0 -1
  399. package/dist/client/assets/route-CYe3oAYd.js +0 -1
  400. package/dist/client/assets/settings-tab-BrPjDgOB.js +0 -1
  401. package/dist/client/assets/site-draft-view-cqx7I6xp.js +0 -2
  402. package/dist/client/assets/site-editor-Cepl1MM3.js +0 -1
  403. package/dist/client/assets/tasks-DUF77GAJ.js +0 -1
  404. package/dist/client/assets/useInfiniteQuery-XMmYWsXs.js +0 -1
  405. package/dist/client/assets/useSuspenseInfiniteQuery-BK6RRGGC.js +0 -1
@@ -1 +1 @@
1
- import{aG as be,cZ as Oe,cX as Me,aH as de,bX as ze,c as U,b as V,j as t,h as Ne,B,r as Q,l as Se,a2 as te,an as Ee,R as me,K as ee,d as se,x as ye,av as _e,f0 as Re,b2 as Ue,n as Fe,fK as ue,a1 as Ve,I as J,X as Le,T as Be,V as Ge,U as xe,H as He,f as Xe,fW as qe,o as Ke,aF as Qe,aE as We,t as Y}from"./index-C_vsZdEs.js";import{g as Ye}from"./extract-connection-data-CgXJmK0-.js";import{E as Ce}from"./empty-state-gsVYH7fP.js";import{E as Je,r as Ze,b as et,c as tt}from"./connection-form-helpers-D5tlzOOb.js";import{c as st,S as nt,D as it}from"./index-CHOolU-2.js";import{u as we,T as ot}from"./use-mcp-auth-status-DTPo2TCr.js";import{a as at}from"./use-members-CMq0EOLQ.js";import{A as lt}from"./avatar-BD2PDf8q.js";import{a as rt}from"./mcp-oauth-L6wgBjWx.js";import{I as ae}from"./integration-icon-CeG7h1x5.js";import{s as ct}from"./Plus-B4v3GkBC.js";import{bi as dt,aD as mt,az as ut,v as ne}from"./agent-icon-B7E6q_wB.js";import{a as Ie,d as xt,s as pt}from"./Tool01-Bhwq8fKA.js";import{s as re}from"./Trash01-BJcybrX2.js";import{b as ft,a as ht,c as gt,S as jt,d as vt}from"./sheet--x4K5vq7.js";import{F as H,b as X,c as q,d as L,f as K,e as bt,a as Nt}from"./form-B4txFZ9_.js";import{a as ke,b as Te,u as St}from"./use-connection-Bb5luwYC.js";import{u as Ae}from"./use-mcp-client-Q83YdvIg.js";import{u as yt}from"./use-mcp-tools-CFBxGHgP.js";import{a as _t}from"./use-mcp-prompts-BcqS4HpY.js";import{i as Ct}from"./mcp-oauth-CIkq3Lwg.js";import{u as wt,D as It}from"./use-delete-connection-DeeN5sak.js";import{c as kt}from"./monitoring-stats-row-BagVDHFD.js";import{b as Tt,C as At,a as Pt}from"./chart-BBE_aWjm.js";import{a as Dt,B as $t}from"./BarChart-D4vvVhNP.js";import{C as Ot}from"./tooltipContext-BKUF9aS4.js";import{b as Mt}from"./repository-binding-DAOz6vJw.js";import{T as ie,a as zt,b as oe,c as Et}from"./tabs-6v8Cll9k.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Rt}from"./ShoppingBag01-BhCtEuhY.js";import{g as ce}from"./types-CjXbKtgO.js";import{M as Ut}from"./mcp-app-renderer-CMRuQe66.js";import{C as Ft}from"./collection-search-DF8xKBAI.js";import{B as Vt}from"./badge-CDeaoqCi.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-35KAqptX.js";import{i as Lt}from"./CheckCircle-Bnnstx7h.js";import{t as Bt}from"./ChevronUp-CBJitQaC.js";import{n as Gt}from"./LinkBroken01-OntVHV0h.js";import{c as Ht}from"./UserSquare-BIGP81NS.js";import{s as Xt}from"./XClose-DbFkM30N.js";import{p as qt,i as Kt}from"./connection-CKGquOu0.js";import{c as Qt}from"./schema-CeHPVV-x.js";import"./metadata-D72DunRR.js";import"./Key01-egFT7DX9.js";import"./auth-JXZLGOBb.js";import"./index-DC_lXxHn.js";import"./index-DAeJjOY-.js";import"./index-BdQq_4o_.js";import"./index-Bp5c1HaS.js";import"./popover-CjjSJX-T.js";import"./tooltip-BKiQ2c4S.js";import"./index-CBPFaqzb.js";import"./SearchMd-DWVKWjSh.js";import"./use-mobile-DHwXmnJW.js";import"./use-create-virtual-mcp-CcifdRil.js";import"./use-navigate-to-agent-CRetfCk1.js";import"./thread-intent-Dimk3aQq.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BydfW6Wr.js";import"./task-board-Bt136szd.js";import"./schema-B-d5VC7M.js";import"./slugify-CEUa2lfQ.js";import"./Image01-D5xmdMv9.js";import"./use-org-auth-client-Im4HAiDN.js";import"./User01-BaPQvgQq.js";import"./AlertCircle-DBK8R4dI.js";import"./ArrowUp-B-samV76.js";import"./ArrowLeft-BhYsdDhs.js";import"./ZoomOut-CKf6RmrA.js";import"./Building02-BVkscSyZ.js";import"./ChevronSelectorVertical-rEBuyaLs.js";import"./Copy01-B-Kqql1v.js";import"./CreditCard01-BuvGgoKU.js";import"./DotsVertical-kTicVrIf.js";import"./Globe04-KYEPLfFL.js";import"./SwitchHorizontal01-ByDhQXb-.js";import"./Link01-DbW4kVwR.js";import"./Minus-DN-1q402.js";import"./Monitor01-QBQW5XNf.js";import"./Sun-DXxrAWEA.js";import"./Play-COeyqncs.js";import"./Upload01-D6z8pgdP.js";import"./Users01-OOPFNu5a.js";import"./label-CCla7LnP.js";import"./alert-dialog-DOm8vTAh.js";import"./CartesianChart-D5TCh86n.js";import"./CategoricalChart-BlWkKGI4.js";import"./AreaChart-CeMTC5TB.js";import"./symbol-BF05cGJ-.js";import"./ActiveShapeUtils-DpnSicPy.js";import"./Sector-CExKcwxp.js";import"./ErrorBarContext-BUVr9l59.js";import"./active-indicator-CCMhAsc_.js";import"./url-slug-CKCta88_.js";const Wt=be({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=V();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",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:"gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(dt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(mt,{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(Ie,{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-sm",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 v;e[44]!==a?(v=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=v):v=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(re,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==v?(E=t.jsx(B,{variant:"ghost-destructive",size:"icon-sm",onClick:T,title:S,"aria-label":v,children:z}),e[47]=T,e[48]=S,e[49]=v,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,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=V();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(Ie,{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-sm",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=V();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(ct,{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:"gap-1.5",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:"surface 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=V(),l=Ee(),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=kt(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(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:x,barCategoryGap:"4%",children:[t.jsx(At,{content:t.jsx(Pt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{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-2xs text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-2xs 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(Ot,{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=V(),[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-card text-foreground shadow-edge":"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:"surface 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-accent 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=V(),{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=Mt(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:"surface 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=V(),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=ke(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(v=>v.name.toLowerCase().includes(w)||v.description&&v.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=v=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(v.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=v=>{v.key==="Escape"&&(h(""),v.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(v=>{const z=ce(v._meta);return t.jsxs(Re,{size:"flush",className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(v),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(Ut,{resourceURI:z,toolInfo:{tool:v},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:v.annotations?.title??v.name}),t.jsx(ot,{annotations:v.annotations,_meta:v._meta})]}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:v.description})]})]},v.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=V();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=V(),u=se(),x=ke(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(I){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(I)}})},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(vs),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 b;e[12]!==d?(b=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=b):b=e[13];let I;e[14]!==b?(I=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:b}),e[14]=b,e[15]=I):I=e[15];let k;e[16]!==d?(k=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=k):k=e[17];let F;e[18]!==k?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:k}),e[18]=k,e[19]=F):F=e[19];let W;return e[20]!==I||e[21]!==F?(W=t.jsxs("div",{className:"surface p-5",children:[I,F]}),e[20]=I,e[21]=F,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(b=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-accent transition-colors cursor-pointer",onClick:()=>g(b.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(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:De(b.name)}),b.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:b.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},b.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let v;e[47]!==S?(v=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=v):v=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=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]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,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]!==v||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"surface overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,v,z,M,R]})}),e[62]=T,e[63]=v,e[64]=z,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(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: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(Rt,{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 vs(s){return ce(s._meta)}function bs(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(Fe.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=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ve(),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?qt(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(H,{control:s.control,name:"ui_type",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(H,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(X,{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(G,{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(G,{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(G,{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(G,{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(G,{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(H,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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"})}),t.jsx(K,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(H,{control:s.control,name:"stdio_command",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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"})}),t.jsx(K,{})]})}),t.jsx(H,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(H,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(H,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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(H,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(Ge,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(pt,{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-accent 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"})}),d&&t.jsxs(bt,{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 ve(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"&&Kt(s.connection_headers)){const c=s.connection_headers,o=Ze(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=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=tt(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=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=wt({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}=at(),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=st(P,Yt),S=Qe({resolver:We(Qt),values:ve(h??s)}),v=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const b=S.getValues(),I=Cs(b),k=h?.id??e;await x.update.mutateAsync({id:k,data:I}),S.reset(b)},E=()=>{S.reset(ve(h??s))},M=async p=>{const b=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:I,tokenInfo:k,error:F}=await rt({connectionId:p,orgSlug:f.slug,...b?{scope:b}:{}});if(F||!I){Y.error(r("details.connection.authFailed",{error:F??""}));return}if(k)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:k.accessToken,refreshToken:k.refreshToken,expiresIn:k.expiresIn,scope:k.scope,clientId:k.clientId,clientSecret:k.clientSecret,tokenEndpoint:k.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:I}});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:I}})}else await x.update.mutateAsync({id:p,data:{connection_token:I}});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 I=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:I}));return}const b=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(b.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(ft,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(ht,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(gt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(jt,{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(lt,{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(Nt,{...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(H,{control:S.control,name:"title",render:({field:p})=>t.jsxs(X,{children:[t.jsx(q,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(H,{control:S.control,name:"description",render:({field:p})=>t.jsxs(X,{children:[t.jsx(q,{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(nt,{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:z,disabled:!v||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),v&&t.jsx(B,{variant:"outline",onClick:E,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-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(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{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,b)=>{try{await x.update.mutateAsync({id:p.id,data:{status:b}}),Y.success(r(b==="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,b=p.title.replace(/\s*\(\d+\)\s*$/,""),I=a.length+1,k=`${b} (${I})`,F=Ye("conn");await x.create.mutateAsync({id:F,title:k,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/${F}`,window.location.origin),Z=await Ct({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}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 Is(){const s=U.c(43),e=V();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}=Xe(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=St(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}=yt(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 b of u){const I=b.id===h?_:p(b.tools);for(const k of I)A.has(k.name)||(A.add(k.name),R.push(k))}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}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=qe($);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 v;s[14]!==O?.resources?(v=O?.resources??[],s[14]=O?.resources,s[15]=v):v=s[15];let z;s[16]!==v?(z=v.map(ks),s[16]=v,s[17]=z):z=s[17];const E=z;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 b;s[25]!==e?(b=e("details.connection.backButton"),s[25]=e,s[26]=b):b=s[26];let I;s[27]!==p||s[28]!==b?(I=t.jsx(B,{variant:"outline",onClick:p,children:b}),s[27]=p,s[28]=b,s[29]=I):I=s[29];let k;return s[30]!==A||s[31]!==R||s[32]!==I?(k=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:I})}),s[30]=A,s[31]=R,s[32]=I,s[33]=k):k=s[33],k}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]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,s[41]=u,s[42]=M):M=s[42],M}function ks(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(He,{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(Is,{})})}),s[0]=e):e=s[0],e}function yi(){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{yi as default};
1
+ import{aG as be,cZ as Oe,cX as Me,aH as de,bX as ze,c as U,b as V,j as t,h as Ne,B,r as Q,l as Se,a2 as te,an as Ee,R as me,K as ee,d as se,x as ye,av as _e,f0 as Re,b2 as Ue,n as Fe,fK as ue,a1 as Ve,I as J,X as Le,T as Be,V as Ge,U as xe,H as He,f as Xe,fW as qe,o as Ke,aF as Qe,aE as We,t as Y}from"./index-CMKEBGKX.js";import{g as Ye}from"./extract-connection-data-CwDf8Ns1.js";import{E as Ce}from"./empty-state-B0G_CGwR.js";import{E as Je,r as Ze,b as et,c as tt}from"./connection-form-helpers-BWk506qj.js";import{c as st,S as nt,D as it}from"./index-CDmfe_Ze.js";import{u as we,T as ot}from"./use-mcp-auth-status-BPhXIpD4.js";import{a as at}from"./use-members-BXYZ5GWT.js";import{A as lt}from"./avatar-49aPXdv7.js";import{a as rt}from"./mcp-oauth-B64tInkO.js";import{I as ae}from"./integration-icon-mkTLlJYZ.js";import{s as ct}from"./Plus-DXIMcQkQ.js";import{bi as dt,aD as mt,az as ut,v as ne}from"./agent-icon-DtT3h4UX.js";import{a as Ie,d as xt,s as pt}from"./Tool01-D7eccoeh.js";import{s as re}from"./Trash01-CTrNlbT8.js";import{b as ft,a as ht,c as gt,S as jt,d as vt}from"./sheet-DIT9lGlU.js";import{F as H,b as X,c as q,d as L,f as K,e as bt,a as Nt}from"./form-CpnGThcL.js";import{a as ke,b as Te,u as St}from"./use-connection-C2QTK4P4.js";import{u as Ae}from"./use-mcp-client-COM3gP2O.js";import{u as yt}from"./use-mcp-tools-DVMy4xzU.js";import{a as _t}from"./use-mcp-prompts-1pj8Mn9o.js";import{i as Ct}from"./mcp-oauth-BFUDXDf6.js";import{u as wt,D as It}from"./use-delete-connection-BTgka6iQ.js";import{c as kt}from"./monitoring-stats-row-QRt_yzIW.js";import{b as Tt,C as At,a as Pt}from"./chart-BKCzQrbM.js";import{a as Dt,B as $t}from"./BarChart-CJBobvga.js";import{C as Ot}from"./tooltipContext-Ccm0pmDN.js";import{b as Mt}from"./repository-binding-BBtZf2zz.js";import{T as ie,a as zt,b as oe,c as Et}from"./tabs-SpJ7v19a.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Rt}from"./ShoppingBag01-B81IcYcu.js";import{g as ce}from"./types-C2kyJgqF.js";import{M as Ut}from"./mcp-app-renderer-gJ1lyd1u.js";import{C as Ft}from"./collection-search-DCYm5aP4.js";import{B as Vt}from"./badge-Xi0bu-aJ.js";import{S as pe,b as fe,a as he,d as ge,c as G}from"./select-B-vRTlp8.js";import{i as Lt}from"./CheckCircle-Dlz5XR1a.js";import{t as Bt}from"./ChevronUp-CHckv_8T.js";import{n as Gt}from"./LinkBroken01-Dbb_PbFz.js";import{c as Ht}from"./UserSquare-CZXKi88L.js";import{s as Xt}from"./XClose-C9XzQkao.js";import{p as qt,i as Kt}from"./connection-CLuVf0UF.js";import{c as Qt}from"./schema-BRZOWw0d.js";import"./metadata-D72DunRR.js";import"./Key01-GACmaKDe.js";import"./auth-D6exVMlw.js";import"./index-D2b1OQG0.js";import"./index-B6fYZNK2.js";import"./index-BdQq_4o_.js";import"./index-CZWqOlKo.js";import"./popover-n_tcLsd5.js";import"./tooltip-WTx8RFDb.js";import"./index-DwGMmQy3.js";import"./SearchMd-DQ6xirDN.js";import"./use-mobile-Bq3CXRKG.js";import"./use-create-virtual-mcp-JDXemb5m.js";import"./use-navigate-to-agent-F9oDR6Aw.js";import"./thread-intent-BS7K-UuZ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-9c6_Ze8B.js";import"./task-board-CEgpYip9.js";import"./schema-CylodOUQ.js";import"./slugify-CEUa2lfQ.js";import"./Image01-J72Rm0Yr.js";import"./use-org-auth-client-C3gy1liR.js";import"./User01-BgWUolo8.js";import"./AlertCircle-CePpxiVL.js";import"./ArrowUp-Bc6Es12Z.js";import"./ArrowLeft-DPa6sZRI.js";import"./ZoomOut-DKNOmfuK.js";import"./Building02-BbEppJaI.js";import"./ChevronSelectorVertical-BjvpkKQW.js";import"./Copy01-ynYolVGY.js";import"./CreditCard01-CJRwgkVP.js";import"./DotsVertical-xGYJd_oZ.js";import"./Globe04-rKrlqbJ3.js";import"./SwitchHorizontal01-QjLd4gai.js";import"./Link01-Dy_bSHLe.js";import"./Minus-cuNEQYA9.js";import"./Monitor01-CW3G0lSo.js";import"./Sun-Bd7hlMAK.js";import"./Play-RPF1C2F0.js";import"./Upload01-B9oMCz-6.js";import"./Users01-B7zAiC4m.js";import"./label-8_hsm0_y.js";import"./alert-dialog-DdGCb0IF.js";import"./CartesianChart-D2mofn_H.js";import"./CategoricalChart-1f5JjzPP.js";import"./AreaChart-futTS77r.js";import"./symbol-9K-WFQbg.js";import"./ActiveShapeUtils-a2DoNLsg.js";import"./Sector-fbb2Py22.js";import"./ErrorBarContext-Bu4h-9ud.js";import"./active-indicator-CCMhAsc_.js";import"./url-slug-eBdSwuRg.js";const Wt=be({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=V();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",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:"gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(dt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(mt,{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(Ie,{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-sm",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 v;e[44]!==a?(v=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=v):v=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(re,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==v?(E=t.jsx(B,{variant:"ghost-destructive",size:"icon-sm",onClick:T,title:S,"aria-label":v,children:z}),e[47]=T,e[48]=S,e[49]=v,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,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=V();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(Ie,{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-sm",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=V();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(ct,{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:"gap-1.5",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:"surface 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=V(),l=Ee(),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=kt(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(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:x,barCategoryGap:"4%",children:[t.jsx(At,{content:t.jsx(Pt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{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-2xs text-muted-foreground",children:x[0]?.label}),t.jsx("span",{className:"text-2xs 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(Ot,{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=V(),[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-card text-foreground shadow-edge":"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:"surface 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-accent 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=V(),{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=Mt(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:"surface 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=V(),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=ke(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(v=>v.name.toLowerCase().includes(w)||v.description&&v.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=v=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(v.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=v=>{v.key==="Escape"&&(h(""),v.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(v=>{const z=ce(v._meta);return t.jsxs(Re,{size:"flush",className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(v),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(Ut,{resourceURI:z,toolInfo:{tool:v},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:v.annotations?.title??v.name}),t.jsx(ot,{annotations:v.annotations,_meta:v._meta})]}),v.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:v.description})]})]},v.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=V();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=V(),u=se(),x=ke(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(I){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(I)}})},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(vs),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 b;e[12]!==d?(b=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=b):b=e[13];let I;e[14]!==b?(I=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:b}),e[14]=b,e[15]=I):I=e[15];let k;e[16]!==d?(k=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=k):k=e[17];let F;e[18]!==k?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:k}),e[18]=k,e[19]=F):F=e[19];let W;return e[20]!==I||e[21]!==F?(W=t.jsxs("div",{className:"surface p-5",children:[I,F]}),e[20]=I,e[21]=F,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(b=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-accent transition-colors cursor-pointer",onClick:()=>g(b.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(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:De(b.name)}),b.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:b.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},b.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let v;e[47]!==S?(v=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=v):v=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=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]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,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]!==v||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"surface overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,v,z,M,R]})}),e[62]=T,e[63]=v,e[64]=z,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(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: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(Rt,{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 vs(s){return ce(s._meta)}function bs(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(Fe.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=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ve(),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?qt(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(H,{control:s.control,name:"ui_type",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(H,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(X,{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(G,{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(G,{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(G,{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(G,{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(G,{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(H,{control:s.control,name:"npx_package",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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"})}),t.jsx(K,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(H,{control:s.control,name:"stdio_command",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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"})}),t.jsx(K,{})]})}),t.jsx(H,{control:s.control,name:"stdio_args",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(K,{})]})})]}),t.jsx(H,{control:s.control,name:"stdio_cwd",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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"})}),t.jsx(K,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(H,{control:s.control,name:"env_vars",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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(H,{control:s.control,name:"connection_token",render:({field:m})=>t.jsxs(X,{className:"flex flex-col gap-3",children:[t.jsx(q,{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(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(Ge,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(pt,{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-accent 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"})}),d&&t.jsxs(bt,{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 ve(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"&&Kt(s.connection_headers)){const c=s.connection_headers,o=Ze(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=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=tt(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=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),x=Te(),{org:f}=te(),m=wt({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}=at(),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=st(P,Yt),S=Qe({resolver:We(Qt),values:ve(h??s)}),v=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const b=S.getValues(),I=Cs(b),k=h?.id??e;await x.update.mutateAsync({id:k,data:I}),S.reset(b)},E=()=>{S.reset(ve(h??s))},M=async p=>{const b=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:I,tokenInfo:k,error:F}=await rt({connectionId:p,orgSlug:f.slug,...b?{scope:b}:{}});if(F||!I){Y.error(r("details.connection.authFailed",{error:F??""}));return}if(k)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:k.accessToken,refreshToken:k.refreshToken,expiresIn:k.expiresIn,scope:k.scope,clientId:k.clientId,clientSecret:k.clientSecret,tokenEndpoint:k.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:I}});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:I}})}else await x.update.mutateAsync({id:p,data:{connection_token:I}});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 I=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:I}));return}const b=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(b.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(ft,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(ht,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(gt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(jt,{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(lt,{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(Nt,{...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(H,{control:S.control,name:"title",render:({field:p})=>t.jsxs(X,{children:[t.jsx(q,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(K,{})]})}),t.jsx(H,{control:S.control,name:"description",render:({field:p})=>t.jsxs(X,{children:[t.jsx(q,{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(nt,{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:z,disabled:!v||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),v&&t.jsx(B,{variant:"outline",onClick:E,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-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(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{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,b)=>{try{await x.update.mutateAsync({id:p.id,data:{status:b}}),Y.success(r(b==="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,b=p.title.replace(/\s*\(\d+\)\s*$/,""),I=a.length+1,k=`${b} (${I})`,F=Ye("conn");await x.create.mutateAsync({id:F,title:k,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/${F}`,window.location.origin),Z=await Ct({url:W.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}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 Is(){const s=U.c(43),e=V();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}=Xe(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=St(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}=yt(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 b of u){const I=b.id===h?_:p(b.tools);for(const k of I)A.has(k.name)||(A.add(k.name),R.push(k))}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}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=qe($);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 v;s[14]!==O?.resources?(v=O?.resources??[],s[14]=O?.resources,s[15]=v):v=s[15];let z;s[16]!==v?(z=v.map(ks),s[16]=v,s[17]=z):z=s[17];const E=z;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 b;s[25]!==e?(b=e("details.connection.backButton"),s[25]=e,s[26]=b):b=s[26];let I;s[27]!==p||s[28]!==b?(I=t.jsx(B,{variant:"outline",onClick:p,children:b}),s[27]=p,s[28]=b,s[29]=I):I=s[29];let k;return s[30]!==A||s[31]!==R||s[32]!==I?(k=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:I})}),s[30]=A,s[31]=R,s[32]=I,s[33]=k):k=s[33],k}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]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,s[41]=u,s[42]=M):M=s[42],M}function ks(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(He,{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(Is,{})})}),s[0]=e):e=s[0],e}function yi(){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{yi as default};
@@ -1 +1 @@
1
- import{c as z,j as c,I as T,B as N}from"./index-C_vsZdEs.js";import{s as A}from"./Plus-B4v3GkBC.js";import{s as H}from"./Trash01-BJcybrX2.js";function S(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 $(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:k}=n,p=o===void 0?"VARIABLE_NAME":o,h=s===void 0?"value...":s;let _;e[0]!==r||e[1]!==t?(_=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=_):_=e[2];const C=_;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((u,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let b;e[6]!==r||e[7]!==t?(b=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:u,value:a.value},r(i))},e[6]=r,e[7]=t,e[8]=b):b=e[8];const v=b;let P;e[9]!==r||e[10]!==t?(P=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:a.key,value:u},r(i))},e[9]=r,e[10]=t,e[11]=P):P=e[11];const g=P;let f;if(e[12]!==v||e[13]!==y||e[14]!==g||e[15]!==p||e[16]!==t||e[17]!==h){let l;e[19]!==v||e[20]!==y||e[21]!==g||e[22]!==p||e[23]!==h?(l=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(T,{placeholder:p,value:u.key,onChange:a=>v(i,a.target.value),className:"h-10 flex-1 font-mono"}),c.jsx(T,{type:S(u.key)?"password":"text",placeholder:h,value:u.value,onChange:a=>g(i,a.target.value),className:"h-10 flex-1"}),c.jsx(N,{type:"button",variant:"ghost-destructive",size:"icon",className:"size-10 shrink-0",onClick:()=>y(i),children:c.jsx(H,{size:16})})]},i),e[19]=v,e[20]=y,e[21]=g,e[22]=p,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=v,e[13]=y,e[14]=g,e[15]=p,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=c.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let m;e[26]!==C?(m=c.jsxs(N,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:C,children:[w,"Add Environment Variable"]}),e[26]=C,e[27]=m):m=e[27];let d;e[28]!==f||e[29]!==m?(d=c.jsxs("div",{className:"flex flex-col gap-2",children:[f,m]}),e[28]=f,e[29]=m,e[30]=d):d=e[30];let E;return e[31]!==k||e[32]!==d?(E=c.jsx("div",{className:k,children:d}),e[31]=k,e[32]=d,e[33]=E):E=e[33],E}function R(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function K(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function j(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 W(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function B(n){const{uiType:e}=n,t=j(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===j("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 G(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=j(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(p=>j(p.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function U(n,e){const t={command:"npx",args:["-y",n]},r=R(e);return Object.keys(r).length>0&&(t.envVars=r),t}function M(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=R(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{$ as E,G as a,U as b,M as c,B as i,W as p,K as r};
1
+ import{c as z,j as c,I as T,B as N}from"./index-CMKEBGKX.js";import{s as A}from"./Plus-DXIMcQkQ.js";import{s as H}from"./Trash01-CTrNlbT8.js";function S(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 $(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:k}=n,p=o===void 0?"VARIABLE_NAME":o,h=s===void 0?"value...":s;let _;e[0]!==r||e[1]!==t?(_=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=_):_=e[2];const C=_;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((u,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let b;e[6]!==r||e[7]!==t?(b=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:u,value:a.value},r(i))},e[6]=r,e[7]=t,e[8]=b):b=e[8];const v=b;let P;e[9]!==r||e[10]!==t?(P=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:a.key,value:u},r(i))},e[9]=r,e[10]=t,e[11]=P):P=e[11];const g=P;let f;if(e[12]!==v||e[13]!==y||e[14]!==g||e[15]!==p||e[16]!==t||e[17]!==h){let l;e[19]!==v||e[20]!==y||e[21]!==g||e[22]!==p||e[23]!==h?(l=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(T,{placeholder:p,value:u.key,onChange:a=>v(i,a.target.value),className:"h-10 flex-1 font-mono"}),c.jsx(T,{type:S(u.key)?"password":"text",placeholder:h,value:u.value,onChange:a=>g(i,a.target.value),className:"h-10 flex-1"}),c.jsx(N,{type:"button",variant:"ghost-destructive",size:"icon",className:"size-10 shrink-0",onClick:()=>y(i),children:c.jsx(H,{size:16})})]},i),e[19]=v,e[20]=y,e[21]=g,e[22]=p,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=v,e[13]=y,e[14]=g,e[15]=p,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=c.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let m;e[26]!==C?(m=c.jsxs(N,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:C,children:[w,"Add Environment Variable"]}),e[26]=C,e[27]=m):m=e[27];let d;e[28]!==f||e[29]!==m?(d=c.jsxs("div",{className:"flex flex-col gap-2",children:[f,m]}),e[28]=f,e[29]=m,e[30]=d):d=e[30];let E;return e[31]!==k||e[32]!==d?(E=c.jsx("div",{className:k,children:d}),e[31]=k,e[32]=d,e[33]=E):E=e[33],E}function R(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function K(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function j(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 W(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function B(n){const{uiType:e}=n,t=j(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===j("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 G(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=j(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(p=>j(p.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function U(n,e){const t={command:"npx",args:["-y",n]},r=R(e);return Object.keys(r).length>0&&(t.envVars=r),t}function M(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=R(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{$ as E,G as a,U as b,M as c,B as i,W as p,K as r};
@@ -1 +1 @@
1
- import{r as z,c as G,b as se,j as t,B as L,h as ge,l as he,U as ce,v as ke,aN 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 Fe,u as qe,a as $e,a1 as Je,am as ye,aa as Ye,au as Ze,aw as et,aF as tt,aE as nt,n as ae,I as oe,y as ne,o as st,an as ot,t as X,db as it,K as ct,eI as lt}from"./index-C_vsZdEs.js";import{a as Oe,g as rt,e as at}from"./extract-connection-data-CgXJmK0-.js";import{C as dt}from"./collection-display-button-IJ7oRZnA.js";import{S as ut}from"./search-input-Dn_Mm6hP.js";import{S as gt}from"./search-toggle-BlrCbEt-.js";import{C as mt}from"./collection-tabs-DUP2Wv2k.js";import{C as ve,u as Ue,g as pt}from"./connection-card-CeElSdkP.js";import{E as ft}from"./empty-state-gsVYH7fP.js";import{u as ht,D as xt}from"./use-delete-connection-DeeN5sak.js";import{u as jt}from"./use-infinite-scroll-TKtAAXad.js";import{u as Ve}from"./use-mobile-DHwXmnJW.js";import{g as ue}from"./connection-slug-CITJ0kGN.js";import{A as St,a as yt,b as vt,c as Ct,g as bt,d as _t,e as Dt,f as Nt}from"./alert-dialog-DOm8vTAh.js";import{n as xe}from"./LinkBroken01-OntVHV0h.js";import{g as kt,a as Tt}from"./metadata-D72DunRR.js";import{D as wt,a as At,d as It,b as Pt,e as Mt,f as Ft,g as $t}from"./drawer-_y_lX-Yn.js";import{F as q,b as J,c as Y,d as Z,f as ee,a as De}from"./form-B4txFZ9_.js";import{S as Ot,b as Ut,a as Vt,d as zt,c as de}from"./select-35KAqptX.js";import{T as Lt}from"./textarea-CzFPd8mY.js";import{b as ze,u as Et}from"./use-connection-Bb5luwYC.js";import{m as Bt}from"./use-mcp-client-Q83YdvIg.js";import{b as Kt}from"./repository-binding-DAOz6vJw.js";import{g as Ht}from"./types-CjXbKtgO.js";import{A as Rt,bL as Wt,aD as Xt,bi as Gt,v as Se}from"./agent-icon-B7E6q_wB.js";import{s as Le}from"./Plus-B4v3GkBC.js";import{c as Qt}from"./UserSquare-BIGP81NS.js";import{s as Ee}from"./XClose-DbFkM30N.js";import{s as qt}from"./use-project-scope-CXdLsOUx.js";import{c as Jt}from"./schema-CeHPVV-x.js";import{i as fe,a as Ne,E as Yt,p as Zt,b as en,c as tn}from"./connection-form-helpers-D5tlzOOb.js";import{a as nn}from"./authenticate-and-persist-oauth-Sm0OtDe1.js";import{I as sn}from"./integration-icon-CeG7h1x5.js";import{C as Be}from"./checkbox-BQV5rQq6.js";import{i as on}from"./DotsVertical-kTicVrIf.js";import{s as Ke}from"./Image01-D5xmdMv9.js";import{s as He}from"./Trash01-BJcybrX2.js";import"./connection-CKGquOu0.js";import"./url-slug-CKCta88_.js";import"./ArrowUp-B-samV76.js";import"./SwitchHorizontal01-ByDhQXb-.js";import"./tooltip-BKiQ2c4S.js";import"./index-CBPFaqzb.js";import"./toggle-group-o8h9w6Rw.js";import"./active-indicator-CCMhAsc_.js";import"./badge-CDeaoqCi.js";import"./SearchMd-DWVKWjSh.js";import"./icon-button-B2nkkF4s.js";import"./useInfiniteQuery-XMmYWsXs.js";import"./infiniteQueryObserver-C2uEQLvN.js";import"./slugify-CEUa2lfQ.js";import"./label-CCla7LnP.js";import"./index-BdQq_4o_.js";import"./ChevronUp-CBJitQaC.js";import"./auth-JXZLGOBb.js";import"./AlertCircle-DBK8R4dI.js";import"./Tool01-Bhwq8fKA.js";import"./ArrowLeft-BhYsdDhs.js";import"./ShoppingBag01-BhCtEuhY.js";import"./ZoomOut-CKf6RmrA.js";import"./Building02-BVkscSyZ.js";import"./CheckCircle-Bnnstx7h.js";import"./ChevronSelectorVertical-rEBuyaLs.js";import"./Copy01-B-Kqql1v.js";import"./CreditCard01-BuvGgoKU.js";import"./Globe04-KYEPLfFL.js";import"./Key01-egFT7DX9.js";import"./Link01-DbW4kVwR.js";import"./Minus-DN-1q402.js";import"./Monitor01-QBQW5XNf.js";import"./Sun-DXxrAWEA.js";import"./Play-COeyqncs.js";import"./Upload01-D6z8pgdP.js";import"./User01-BaPQvgQq.js";import"./Users01-OOPFNu5a.js";import"./mcp-oauth-L6wgBjWx.js";import"./mcp-oauth-CIkq3Lwg.js";function cn(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(c){console.error("Failed to save filters:",c)}}]}function ln(s){const e=G.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let c;e[0]!==o||e[1]!==n?(c=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]=c):c=e[2];const a=c;let r;return e[3]!==a||e[4]!==o||e[5]!==n?(r={sortKey:n,sortDirection:o,handleSort:a},e[3]=a,e[4]=o,e[5]=n,e[6]=r):r=e[6],r}function rn(s,e){const n=G.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),c=s?`deco-view-mode-${s}`:"deco-view-mode";let a;n[0]!==g||n[1]!==c?(a=()=>{const x=globalThis.localStorage?.getItem(c);return x==="cards"||x==="table"?x:g},n[0]=g,n[1]=c,n[2]=a):a=n[2];const[r,p]=z.useState(a);let m;n[3]!==c?(m=x=>{p(x),globalThis.localStorage?.setItem(c,x)},n[3]=c,n[4]=m):m=n[4];const u=m;let d,f;n[5]!==o||n[6]!==r?(d=()=>{!i.current&&o&&r==="table"&&p("cards"),i.current=o},f=[o,r],n[5]=o,n[6]=r,n[7]=d,n[8]=f):(d=n[7],f=n[8]),z.useEffect(d,f);let h;return n[9]!==u||n[10]!==r?(h=[r,u],n[9]=u,n[10]=r,n[11]=h):h=n[11],h}function an(s){const e=G.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,c=o===void 0?"title":o,a=i===void 0?"table":i,[r,p]=z.useState(""),m=z.useDeferredValue(r),u=`${n}-${g}`,[d,f]=cn(u),h=`studio-${g}-filter-visible-${n}`;let x;e[0]!==h?(x=()=>globalThis.localStorage?.getItem(h)==="true",e[0]=h,e[1]=x):x=e[1];const[j,b]=z.useState(x);let v;e[2]!==h?(v=M=>{b(M),globalThis.localStorage?.setItem(h,String(M))},e[2]=h,e[3]=v):v=e[3];const S=v;let l;e[4]!==j||e[5]!==S?(l=()=>{S(!j)},e[4]=j,e[5]=S,e[6]=l):l=e[6];const D=l,[T,I]=rn(`studio-${g}-${n}`,a),{sortKey:A,sortDirection:w,handleSort:$}=ln(c),P=A;let k;return e[7]!==j||e[8]!==d||e[9]!==$||e[10]!==r||e[11]!==m||e[12]!==S||e[13]!==f||e[14]!==I||e[15]!==w||e[16]!==P||e[17]!==D||e[18]!==T?(k={search:r,searchTerm:m,setSearch:p,filters:d,setFilters:f,filterBarVisible:j,setFilterBarVisible:S,toggleFilterBar:D,viewMode:T,setViewMode:I,sortKey:P,sortDirection:w,handleSort:$},e[7]=j,e[8]=d,e[9]=$,e[10]=r,e[11]=m,e[12]=S,e[13]=f,e[14]=I,e[15]=w,e[16]=P,e[17]=D,e[18]=T,e[19]=k):k=e[19],k}function dn(s){const e=G.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,c=se(),a=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let r;e[0]!==o||e[1]!==c||e[2]!==a?(r=c(a,{count:o}),e[0]=o,e[1]=c,e[2]=a,e[3]=r):r=e[3];let p;e[4]!==r?(p=t.jsx(St,{children:r}),e[4]=r,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==m?(u=c(m),e[6]=c,e[7]=m,e[8]=u):u=e[8];let d;e[9]!==u?(d=t.jsx(yt,{children:u}),e[9]=u,e[10]=d):d=e[10];let f;e[11]!==p||e[12]!==d?(f=t.jsxs(vt,{children:[p,d]}),e[11]=p,e[12]=d,e[13]=f):f=e[13];let h;e[14]!==c?(h=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=h):h=e[15];let x;e[16]!==h?(x=t.jsx(Ct,{children:h}),e[16]=h,e[17]=x):x=e[17];const j=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let b;e[18]!==o||e[19]!==c||e[20]!==j?(b=c(j,{count:o}),e[18]=o,e[19]=c,e[20]=j,e[21]=b):b=e[21];let v;e[22]!==i||e[23]!==b?(v=t.jsx(bt,{onClick:i,variant:"destructive",children:b}),e[22]=i,e[23]=b,e[24]=v):v=e[24];let S;e[25]!==v||e[26]!==x?(S=t.jsxs(_t,{children:[x,v]}),e[25]=v,e[26]=x,e[27]=S):S=e[27];let l;e[28]!==S||e[29]!==f?(l=t.jsxs(Dt,{children:[f,S]}),e[28]=S,e[29]=f,e[30]=l):l=e[30];let D;return e[31]!==g||e[32]!==n||e[33]!==l?(D=t.jsx(Nt,{open:n,onOpenChange:g,children:l}),e[31]=g,e[32]=n,e[33]=l,e[34]=D):D=e[34],D}function un(s){const e=G.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:c,onNavigateConnected:a,onConnect:r}=s,p=se();let m,u;e[0]!==i||e[1]!==n?(m=Oe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const d=u;let f;e[4]!==n._meta?(f=kt(n._meta),e[4]=n._meta,e[5]=f):f=e[5];const h=f,x=h?.friendlyName||h?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",j=n.server?.description||n.description||null;let b;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(b=n.server?.icons?.[0]?.src||Tt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=b):b=e[8];const v=b;let S;if(e[9]!==o||e[10]!==m){let O;e[12]!==m?(O=R=>R.connection_type!=="VIRTUAL"&&R.app_name===m,e[12]=m,e[13]=O):O=e[13],S=o.filter(O),e[9]=o,e[10]=m,e[11]=S}else S=e[11];const l=S,D=d||g;let T,I;e[14]!==l||e[15]!==d||e[16]!==n||e[17]!==r||e[18]!==a?(T=()=>{if(d){const O=l[0];O&&a(O);return}I()},I=()=>r(n),e[14]=l,e[15]=d,e[16]=n,e[17]=r,e[18]=a,e[19]=T,e[20]=I):(T=e[19],I=e[20]);let A;e[21]!==j||e[22]!==v||e[23]!==x?(A={title:x,description:j,icon:v},e[21]=j,e[22]=v,e[23]=x,e[24]=A):A=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[25]=w):w=e[25];const $=D?T:void 0;let P;e[26]!==g||e[27]!==c||e[28]!==I||e[29]!==d||e[30]!==n.id||e[31]!==p?(P=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(L,{variant:"outline",size:"sm",disabled:c!==null,onClick:O=>{O.stopPropagation(),I()},children:c===n.id?t.jsx(ge,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=c,e[28]=I,e[29]=d,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let k;e[33]!==P?(k=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=k):k=e[34];let M;return e[35]!==A||e[36]!==$||e[37]!==k?(M=t.jsx(ve,{connection:A,fallbackIcon:w,onClick:$,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=A,e[36]=$,e[37]=k,e[38]=M):M=e[38],M}function gn(s){return s?.length?{appToolName:s.find(n=>!!Ht(n._meta))?.name??null}:null}const mn=3;function pn(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 fn(s){const e=G.c(21),{projects:n}=s,g=se();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let d;return e[2]!==u?(d=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=d):d=e[3],d}let o,i,c;if(e[4]!==n){const u=n.slice(0,mn);c="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(hn),e[4]=n,e[5]=o,e[6]=i,e[7]=c}else o=e[5],i=e[6],c=e[7];let a;e[8]!==o||e[9]!==i?(a=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=a):a=e[10];let r;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(r=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]=r):r=e[14];let p;e[15]!==r?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r}),e[15]=r,e[16]=p):p=e[16];let m;return e[17]!==c||e[18]!==a||e[19]!==p?(m=t.jsxs("div",{className:c,children:[a,p]}),e[17]=c,e[18]=a,e[19]=p,e[20]=m):m=e[20],m}function hn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Rt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=G.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 c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(We,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",onClick:jn,children:t.jsx(on,{size:20})})}),e[2]=c):c=e[2];let a;e[3]!==g?(a=t.jsxs(Xe,{children:[c,t.jsx(Ge,{align:"end",onClick:xn,children:g})]}),e[3]=g,e[4]=a):a=e[4];let r;return e[5]!==i||e[6]!==a?(r=t.jsx("div",{className:i,children:a}),e[5]=i,e[6]=a,e[7]=r):r=e[7],r}function xn(s){return s.stopPropagation()}function jn(s){return s.stopPropagation()}function Sn(s){const e=G.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:c}=s,a=se();let r;if(e[0]!==n.connections||e[1]!==i){let U;e[3]!==i?(U=y=>i.has(y.id),e[3]=i,e[4]=U):U=e[4],r=n.connections.every(U),e[0]=n.connections,e[1]=i,e[2]=r}else r=e[2];const p=r;let m;if(e[5]!==n.connections||e[6]!==i){let U;e[8]!==i?(U=y=>i.has(y.id),e[8]=i,e[9]=U):U=e[9],m=n.connections.some(U),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let d;e[10]!==p||e[11]!==n.connections||e[12]!==c||e[13]!==i?(d=()=>{for(const U of n.connections)p?i.has(U.id)&&c(U.id):i.has(U.id)||c(U.id)},e[10]=p,e[11]=n.connections,e[12]=c,e[13]=i,e[14]=d):d=e[14];const f=d,h=n.title,x=n.icon;let j;e[15]!==n.connections.length||e[16]!==a?(j=a("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=a,e[17]=j):j=e[17];let b;e[18]!==n.icon||e[19]!==n.title||e[20]!==j?(b={title:h,icon:x,description:j},e[18]=n.icon,e[19]=n.title,e[20]=j,e[21]=b):b=e[21];let v;e[22]!==g||e[23]!==o||e[24]!==f?(v=()=>o?f():g(),e[22]=g,e[23]=o,e[24]=f,e[25]=v):v=e[25];const S=o&&p&&"ring-2 ring-primary",l=o&&u&&!p&&"ring-1 ring-primary/50";let D;e[26]!==l||e[27]!==S?(D=he(S,l),e[26]=l,e[27]=S,e[28]=D):D=e[28];const T=o?p?!0:u&&"mixed":void 0;let I;e[29]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[29]=I):I=e[29];let A;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==a||e[35]!==f?(A=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:f}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("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]=a,e[35]=f,e[36]=A):A=e[36];let w;e[37]!==g?(w=U=>{U.stopPropagation(),g()},e[37]=g,e[38]=w):w=e[38];let $;e[39]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Ke,{size:16}),e[39]=$):$=e[39];let P;e[40]!==a?(P=a("orgs.connectionSelectionUi.open"),e[40]=a,e[41]=P):P=e[41];let k;e[42]!==w||e[43]!==P?(k=t.jsxs(ce,{onClick:w,children:[$,P]}),e[42]=w,e[43]=P,e[44]=k):k=e[44];let M;e[45]!==o||e[46]!==k?(M=t.jsx(Re,{selectionMode:o,children:k}),e[45]=o,e[46]=k,e[47]=M):M=e[47];let O;e[48]!==A||e[49]!==M?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[A,M]}),e[48]=A,e[49]=M,e[50]=O):O=e[50];let R;return e[51]!==D||e[52]!==T||e[53]!==O||e[54]!==b||e[55]!==v?(R=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:b,onClick:v,className:D,selected:T,fallbackIcon:I,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=D,e[52]=T,e[53]=O,e[54]=b,e[55]=v,e[56]=R):R=e[56],R}function yn(s){const e=G.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:c,onToggleSelect:a,onOpen:r,onToggleStatus:p,onDelete:m}=s,u=se();let d;e[0]!==g||e[1]!==a||e[2]!==o||e[3]!==u?(d=o?t.jsx(Be,{checked:g,onCheckedChange:a,onClick:vn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=a,e[2]=o,e[3]=u,e[4]=d):d=e[4];let f;e[5]!==r?(f=T=>{T.stopPropagation(),r()},e[5]=r,e[6]=f):f=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Ke,{size:16}),e[7]=h):h=e[7];let x;e[8]!==u?(x=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=x):x=e[9];let j;e[10]!==f||e[11]!==x?(j=t.jsxs(ce,{onClick:f,children:[h,x]}),e[10]=f,e[11]=x,e[12]=j):j=e[12];let b;e[13]!==i||e[14]!==c||e[15]!==a||e[16]!==u?(b=(i||c)&&t.jsxs(ce,{onClick:T=>{T.stopPropagation(),a()},children:[t.jsx(Wt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=c,e[15]=a,e[16]=u,e[17]=b):b=e[17];let v;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(v=i&&(n.status==="active"?t.jsxs(ce,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Xt,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Gt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=v):v=e[22];let S;e[23]!==i||e[24]!==m||e[25]!==u?(S=i&&t.jsxs(ce,{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]=S):S=e[26];let l;e[27]!==o||e[28]!==j||e[29]!==b||e[30]!==v||e[31]!==S?(l=t.jsxs(Re,{selectionMode:o,children:[j,b,v,S]}),e[27]=o,e[28]=j,e[29]=b,e[30]=v,e[31]=S,e[32]=l):l=e[32];let D;return e[33]!==d||e[34]!==l?(D=t.jsxs("div",{className:"flex items-center gap-1",children:[d,l]}),e[33]=d,e[34]=l,e[35]=D):D=e[35],D}function vn(s){return s.stopPropagation()}function Cn(s){const e=G.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:c,onDeselectAll:a,onDelete:r,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,d=se();if(n===0)return null;let f;e[0]!==n||e[1]!==d?(f=d("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=d,e[2]=f):f=e[2];let h;e[3]!==f?(h=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:f}),e[3]=f,e[4]=h):h=e[4];let x;e[5]!==n||e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==g?(x=n<g?t.jsx(L,{variant:"outline",size:"sm",onClick:c,children:d("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",onClick:a,children:d("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=a,e[7]=c,e[8]=d,e[9]=g,e[10]=x):x=e[10];let j;e[11]!==i||e[12]!==p||e[13]!==d?(j=i&&t.jsxs(L,{variant:"outline",size:"sm",onClick:p,children:[t.jsx(Le,{size:13}),d("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=d,e[14]=j):j=e[14];let b;e[15]!==o||e[16]!==r||e[17]!==m||e[18]!==d?(b=o&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("active"),children:d("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("inactive"),children:d("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",onClick:r,children:[t.jsx(He,{size:13}),d("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=r,e[17]=m,e[18]=d,e[19]=b):b=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ee,{size:13}),e[20]=v):v=e[20];let S;e[21]!==u?(S=t.jsx(L,{variant:"ghost",size:"sm",onClick:u,children:v}),e[21]=u,e[22]=S):S=e[22];let l;return e[23]!==h||e[24]!==x||e[25]!==j||e[26]!==b||e[27]!==S?(l=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl glass px-3 py-2 flex items-center gap-2",children:[h,x,j,b,S]})}),e[23]=h,e[24]=x,e[25]=j,e[26]=b,e[27]=S,e[28]=l):l=e[28],l}function bn(s){const e=G.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,c=se(),[a,r]=z.useState(null);let p;e[0]!==g?(p=k=>{k||r(null),g(k)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==c?(u=c("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=c,e[3]=u):u=e[3];let d;e[4]!==u?(d=t.jsx(ke,{children:u}),e[4]=u,e[5]=d):d=e[5];let f;e[6]!==c?(f=c("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=c,e[7]=f):f=e[7];let h;e[8]!==f?(h=t.jsx(Te,{children:f}),e[8]=f,e[9]=h):h=e[9];let x;e[10]!==d||e[11]!==h?(x=t.jsxs(we,{children:[d,h]}),e[10]=d,e[11]=h,e[12]=x):x=e[12];let j;e[13]!==o||e[14]!==a||e[15]!==c?(j=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):o.map(k=>t.jsxs("button",{type:"button",onClick:()=>r(k.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",a===k.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-accent"),children:[t.jsx(sn,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[13]=o,e[14]=a,e[15]=c,e[16]=j):j=e[16];let b;e[17]!==j?(b=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[17]=j,e[18]=b):b=e[18];let v;e[19]!==m?(v=()=>m(!1),e[19]=m,e[20]=v):v=e[20];let S;e[21]!==c?(S=c("orgs.connectionSelectionUi.cancel"),e[21]=c,e[22]=S):S=e[22];let l;e[23]!==S||e[24]!==v?(l=t.jsx(L,{variant:"outline",onClick:v,children:S}),e[23]=S,e[24]=v,e[25]=l):l=e[25];const D=!a;let T;e[26]!==m||e[27]!==i||e[28]!==a?(T=()=>{a&&(i(a),m(!1))},e[26]=m,e[27]=i,e[28]=a,e[29]=T):T=e[29];let I;e[30]!==c?(I=c("orgs.connectionSelectionUi.add"),e[30]=c,e[31]=I):I=e[31];let A;e[32]!==D||e[33]!==T||e[34]!==I?(A=t.jsx(L,{disabled:D,onClick:T,children:I}),e[32]=D,e[33]=T,e[34]=I,e[35]=A):A=e[35];let w;e[36]!==l||e[37]!==A?(w=t.jsxs(Ae,{children:[l,A]}),e[36]=l,e[37]=A,e[38]=w):w=e[38];let $;e[39]!==w||e[40]!==x||e[41]!==b?($=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[x,b,w]}),e[39]=w,e[40]=x,e[41]=b,e[42]=$):$=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==$?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:$}),e[43]=m,e[44]=n,e[45]=$,e[46]=P):P=e[46],P}function _n({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=se(),{org:i}=Me(),c=st(),a=Fe(),{data:r}=$e.useSession(),p=ze(),m=Et(s),u=ht(),{granted:d}=ye("connections:manage"),{granted:f}=ye("agents:manage"),[h,x]=z.useState(new Set),j=h.size>0,[b,v]=z.useState(!1),[S,l]=z.useState(!1),[D,T]=z.useState(null),I=Kt(),A=pn(qt(I)),w=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),$=pt(w),P=_=>{x(C=>{const B=new Set(C);return B.has(_)?B.delete(_):B.add(_),B})},k=()=>{x(new Set)},M=Ue(s.searchTerm),O=M.items,R=jt(M.loadMore,M.hasMore,M.isLoadingMore),U=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),y=s.search.length>0,F=e==="all"||y?O.filter(_=>{if(y){const C=Oe(_);if(C&&U.has(C))return!1}return!0}):[],W=e==="connected"||y?$:[],te=async _=>{if(!(!i||!r?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const C=at(_,i.id,r.user.id,{remoteIndex:0}),B=C.connection_type==="STDIO",K=!!C.connection_url,H=B&&C.connection_headers&&typeof C.connection_headers=="object"&&"command"in C.connection_headers;if(!K&&!H){X.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const Ce=await p.create.mutateAsync(C),{id:ie}=Ce,le=await nn({connectionId:ie,orgId:i.id,orgSlug:i.slug,persistFallback:re=>p.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){ne("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),X.error(o("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ne("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${i.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ct.isMCPAuthenticated(re.href,null)}),N(),X.success(o("orgs.connections.authenticationSuccessful"))}let pe=null;try{const re=await c.fetchQuery(Bt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=gn((await re.listTools()).tools)}catch{}const be=ue(Ce),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;X.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>a(_e)}}:void 0)}catch(C){X.error(o("orgs.connections.failedToConnect",{error:C instanceof Error?C.message:String(C)}))}finally{T(null)}}},Q=ot(),N=()=>{lt(c,i.id)},E=async()=>{v(!1);const _=[...h];ne("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>Q.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),X.success(o("orgs.connections.deletedConnections",{count:B})),k()},V=async(_,C)=>{try{await p.update.mutateAsync({id:_,data:{status:C}}),N(),X.success(o(C==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{X.error(o("orgs.connections.failedToUpdateConnection"))}},me=async _=>{const C=[...h];ne("connections_bulk_status_toggled",{count:C.length,to_status:_});const K=(await Promise.allSettled(C.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;N(),X.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),k()},je=async _=>{const C=I.find(H=>H.id===_);if(!C)return;ne("connections_bulk_add_to_agent",{agent_id:_,count:h.size});const B=new Set(C.connections.map(H=>H.connection_id)),K=[...h].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){X.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await Q.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...C.connections,...K]}}),it(c,i.id),X.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:C.title})),k()}catch{X.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(xt,{...u}),t.jsx(dn,{open:b,onOpenChange:v,count:h.size,onConfirm:E}),t.jsx(bn,{open:S,onOpenChange:l,agents:I,onConfirm:je}),M.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(y?F.length===0&&w.length===0:e==="all"?F.length===0:w.length===0)?t.jsx(ft,{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(d?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[W.map(_=>{if(_.type==="group")return t.jsx(Sn,{group:_,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:j,selectedIds:h,onToggleSelect:P},_.key);const C=_.connection,B=h.has(C.id);return t.jsx(ve,{connection:C,fallbackIcon:t.jsx(xe,{}),onClick:()=>j?P(C.id):a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:j?B:void 0,footer:t.jsx(fn,{projects:A.get(C.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(yn,{connection:C,isSelected:B,selectionMode:j,canManage:d,canManageAgents:f,onToggleSelect:()=>P(C.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),onToggleStatus:K=>V(C.id,K),onDelete:()=>u.requestDelete(C)})},C.id)}),F.map(_=>t.jsx(un,{item:_,canManage:d,allConnections:m,connectedAppNames:U,connectingItemId:D,onNavigateConnected:C=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),onConnect:te},_.id)),(e==="all"||y)&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||y)&&M.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ge,{className:"size-6 text-muted-foreground"})})]})}),j&&t.jsx(Cn,{count:h.size,total:w.length,canManage:d,canManageAgents:f,onSelectAll:()=>{x(new Set(w.map(_=>_.id)))},onDeselectAll:()=>x(new Set),onDelete:()=>v(!0),onAddToAgent:()=>l(!0),onToggleStatus:me,onCancel:k})]})}function Dn(){const s=se(),{org:e}=Me(),n=Fe(),g=qe({strict:!1}),{data:o}=$e.useSession(),{stdioEnabled:i}=Je(),c=Ve(),{granted:a}=ye("connections:manage"),r=an({namespace:e.slug,resource:"connections"}),p=ze(),m=Ye(),[u,d]=Ze(et.connectionsTab(e.slug),y=>g.tab==="all"||g.tab==="connected"?g.tab:y??"all"),[f,h]=z.useState("ALL"),[x,j]=z.useState("ALL"),v=Ue(r.searchTerm).items,S=r.search!==r.searchTerm,l=tt({resolver:nt(Jt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=l.watch("ui_type"),T=l.watch("connection_url"),I=l.watch("npx_package"),A=fe({uiType:D,connectionUrl:T??"",npxPackage:I??""})??Ne({uiType:D,connectionUrl:T??"",registryItems:v}),w=a&&g.action==="create",$=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),n({to:".",search:y=>({...y,action:"create"})})},P=()=>{n({to:".",search:y=>({...y,action:void 0})})},k=async y=>{let F,W=null,te=null,Q=null;y.ui_type==="NPX"?(F="STDIO",W="",Q=en(y.npx_package||"",y.env_vars||[])):y.ui_type==="STDIO"?(F="STDIO",W="",Q=tn(y.stdio_command||"",y.stdio_args||"",y.stdio_cwd,y.env_vars||[])):(F=y.ui_type,W=y.connection_url||"",te=y.connection_token||null);const N=rt("conn");ne("connection_custom_created",{connection_type:F,ui_type:y.ui_type}),await p.create.mutateAsync({id:N,title:y.title,description:y.description||null,connection_type:F,connection_url:W,connection_token:te,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:y.icon??null,app_name:null,app_id:null,connection_headers:Q,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),P(),l.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ue({app_name:null,connection_url:W,title:y.title,id:N})}})},M=y=>{y||(w&&P(),l.reset())},O=y=>{const F=y.trim();if(!F)return;const W=!!l.formState.dirtyFields.title,te=!!l.formState.dirtyFields.description,Q=!!l.formState.dirtyFields.env_vars,N=V=>{if(V&&(!W&&!l.getValues("title").trim()&&V.title&&l.setValue("title",V.title,{shouldDirty:!1}),!te&&!(l.getValues("description")??"").trim()&&V.description&&l.setValue("description",V.description,{shouldDirty:!1}),!Q&&V.envVarKeys?.length)){const me=l.getValues("env_vars")??[],je=new Set(me.map(C=>C.key)),_=V.envVarKeys.filter(C=>!je.has(C));_.length>0&&l.setValue("env_vars",[...me,..._.map(C=>({key:C,value:""}))],{shouldDirty:!0})}},E=Zt(F);if(E&&i){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",E.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),N(fe({uiType:"NPX",npxPackage:E.packageName}));return}if(F.startsWith("http://")||F.startsWith("https://")){const V=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";l.setValue("ui_type",V,{shouldDirty:!0}),l.setValue("connection_url",F,{shouldDirty:!0}),N(fe({uiType:V,connectionUrl:F})??Ne({uiType:V,connectionUrl:F,registryItems:v}));return}D==="NPX"&&N(fe({uiType:"NPX",npxPackage:F}))},R=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:"sm",variant:"default",onClick:$,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null,U=t.jsx(dt,{sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.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:f,onChange:y=>h(y||"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:x,onChange:y=>j(y||"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")}]}]});return t.jsx(t.Fragment,{children:t.jsxs(ae,{children:[(()=>{const y=s("orgs.connections.createConnection"),F=s("orgs.connections.createConnectionDescription"),W=l.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),te=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:l.control,name:"ui_type",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(Z,{children:t.jsx(Ut,{children:t.jsx(Vt,{})})}),t.jsxs(zt,{children:[t.jsx(de,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(de,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(de,{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(de,{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(de,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Qt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(q,{control:l.control,name:"npx_package",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.npmPackage")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:E=>{const V=E.clipboardData.getData("text");V&&(E.preventDefault(),l.setValue("npx_package",V.trim(),{shouldDirty:!0}),O(V))},onBlur:E=>{O(E.target.value),N.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:l.control,name:"stdio_command",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.command")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"stdio_args",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.arguments")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(q,{control:l.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.workingDirectory")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(q,{control:l.control,name:"env_vars",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.environmentVariables")}),t.jsx(Z,{children:t.jsx(Yt,{value:N.value??[],onChange:N.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:l.control,name:"connection_url",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.url")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:E=>{const V=E.clipboardData.getData("text");V&&(E.preventDefault(),l.setValue("connection_url",V.trim(),{shouldDirty:!0}),O(V))},onBlur:E=>{O(E.target.value),N.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"connection_token",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...N,value:N.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.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(ee,{})]})})]}),t.jsx(q,{control:l.control,name:"title",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.name")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.namePlaceholder"),...N})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"description",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.description")}),t.jsx(Z,{children:t.jsx(Lt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(ee,{})]})})]}),Q=w;return c?t.jsx(wt,{open:Q,onOpenChange:M,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(It,{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(Pt,{children:y}),t.jsx(Mt,{className:"mt-1",children:F})]}),t.jsx(Ft,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(De,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(k),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:te}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:W})})]})})]})}):t.jsx(Pe,{open:Q,onOpenChange:M,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:y}),t.jsx(Te,{children:F})]}),t.jsx(De,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(k),children:[t.jsx("div",{className:"py-4",children:te}),t.jsxs(Ae,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>M(!1),children:s("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:W})]})]})})]})})})(),t.jsx(ae.Content,{children:t.jsx(ae.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[m?t.jsx(ae.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(gt,{value:r.search,onChange:r.setSearch,label:s("library.context.search"),placeholder:s("orgs.connections.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),U]}),children:R}):t.jsx(ae.Title,{actions:R,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!m&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{value:r.search,onChange:r.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:y=>{y.key==="Escape"&&(r.setSearch(""),y.target.blur())}}),U]})}),t.jsx(mt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:u,onTabChange:y=>{const F=y;F!==u&&ne("connections_page_tab_changed",{to_tab:F}),d(F)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:S?.5:1,transition:S?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:S?"none":"auto"},children:t.jsx(_n,{listState:r,activeTab:u,typeFilter:f,statusFilter:x})})})]})})})]})})}function Gs(){const s=G.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(ge,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Dn,{})})}),s[0]=e):e=s[0],e}export{Gs as default};
1
+ import{r as z,c as G,b as se,j as t,B as L,h as ge,l as he,U as ce,v as ke,aN 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 Fe,u as qe,a as $e,a1 as Je,am as ye,aa as Ye,au as Ze,aw as et,aF as tt,aE as nt,n as ae,I as oe,y as ne,o as st,an as ot,t as X,db as it,K as ct,eI as lt}from"./index-CMKEBGKX.js";import{a as Oe,g as rt,e as at}from"./extract-connection-data-CwDf8Ns1.js";import{C as dt}from"./collection-display-button-kbHHi0Kq.js";import{S as ut}from"./search-input-RbNJNFgo.js";import{S as gt}from"./search-toggle-BKYod6Wy.js";import{C as mt}from"./collection-tabs-CpRvK4aY.js";import{C as ve,u as Ue,g as pt}from"./connection-card-BaWG41H0.js";import{E as ft}from"./empty-state-B0G_CGwR.js";import{u as ht,D as xt}from"./use-delete-connection-BTgka6iQ.js";import{u as jt}from"./use-infinite-scroll-C3u8iypP.js";import{u as Ve}from"./use-mobile-Bq3CXRKG.js";import{g as ue}from"./connection-slug-CITJ0kGN.js";import{A as St,a as yt,b as vt,c as Ct,g as bt,d as _t,e as Dt,f as Nt}from"./alert-dialog-DdGCb0IF.js";import{n as xe}from"./LinkBroken01-Dbb_PbFz.js";import{g as kt,a as Tt}from"./metadata-D72DunRR.js";import{D as wt,a as At,d as It,b as Pt,e as Mt,f as Ft,g as $t}from"./drawer-CyiQimHr.js";import{F as q,b as J,c as Y,d as Z,f as ee,a as De}from"./form-CpnGThcL.js";import{S as Ot,b as Ut,a as Vt,d as zt,c as de}from"./select-B-vRTlp8.js";import{T as Lt}from"./textarea-DhtVYf8e.js";import{b as ze,u as Et}from"./use-connection-C2QTK4P4.js";import{m as Bt}from"./use-mcp-client-COM3gP2O.js";import{b as Kt}from"./repository-binding-BBtZf2zz.js";import{g as Ht}from"./types-C2kyJgqF.js";import{A as Rt,bL as Wt,aD as Xt,bi as Gt,v as Se}from"./agent-icon-DtT3h4UX.js";import{s as Le}from"./Plus-DXIMcQkQ.js";import{c as Qt}from"./UserSquare-CZXKi88L.js";import{s as Ee}from"./XClose-C9XzQkao.js";import{s as qt}from"./use-project-scope-BFye4eeg.js";import{c as Jt}from"./schema-BRZOWw0d.js";import{i as fe,a as Ne,E as Yt,p as Zt,b as en,c as tn}from"./connection-form-helpers-BWk506qj.js";import{a as nn}from"./authenticate-and-persist-oauth-ByNJ3IhY.js";import{I as sn}from"./integration-icon-mkTLlJYZ.js";import{C as Be}from"./checkbox-IscGSBh9.js";import{i as on}from"./DotsVertical-xGYJd_oZ.js";import{s as Ke}from"./Image01-J72Rm0Yr.js";import{s as He}from"./Trash01-CTrNlbT8.js";import"./connection-CLuVf0UF.js";import"./url-slug-eBdSwuRg.js";import"./ArrowUp-Bc6Es12Z.js";import"./SwitchHorizontal01-QjLd4gai.js";import"./tooltip-WTx8RFDb.js";import"./index-DwGMmQy3.js";import"./toggle-group-errY3aOY.js";import"./active-indicator-CCMhAsc_.js";import"./badge-Xi0bu-aJ.js";import"./SearchMd-DQ6xirDN.js";import"./icon-button-B1pb2_kW.js";import"./useInfiniteQuery-EcJS-_aQ.js";import"./infiniteQueryObserver-sZS50x9h.js";import"./slugify-CEUa2lfQ.js";import"./label-8_hsm0_y.js";import"./index-BdQq_4o_.js";import"./ChevronUp-CHckv_8T.js";import"./auth-D6exVMlw.js";import"./AlertCircle-CePpxiVL.js";import"./Tool01-D7eccoeh.js";import"./ArrowLeft-DPa6sZRI.js";import"./ShoppingBag01-B81IcYcu.js";import"./ZoomOut-DKNOmfuK.js";import"./Building02-BbEppJaI.js";import"./CheckCircle-Dlz5XR1a.js";import"./ChevronSelectorVertical-BjvpkKQW.js";import"./Copy01-ynYolVGY.js";import"./CreditCard01-CJRwgkVP.js";import"./Globe04-rKrlqbJ3.js";import"./Key01-GACmaKDe.js";import"./Link01-Dy_bSHLe.js";import"./Minus-cuNEQYA9.js";import"./Monitor01-CW3G0lSo.js";import"./Sun-Bd7hlMAK.js";import"./Play-RPF1C2F0.js";import"./Upload01-B9oMCz-6.js";import"./User01-BgWUolo8.js";import"./Users01-B7zAiC4m.js";import"./mcp-oauth-B64tInkO.js";import"./mcp-oauth-BFUDXDf6.js";function cn(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(c){console.error("Failed to save filters:",c)}}]}function ln(s){const e=G.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let c;e[0]!==o||e[1]!==n?(c=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]=c):c=e[2];const a=c;let r;return e[3]!==a||e[4]!==o||e[5]!==n?(r={sortKey:n,sortDirection:o,handleSort:a},e[3]=a,e[4]=o,e[5]=n,e[6]=r):r=e[6],r}function rn(s,e){const n=G.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),c=s?`deco-view-mode-${s}`:"deco-view-mode";let a;n[0]!==g||n[1]!==c?(a=()=>{const x=globalThis.localStorage?.getItem(c);return x==="cards"||x==="table"?x:g},n[0]=g,n[1]=c,n[2]=a):a=n[2];const[r,p]=z.useState(a);let m;n[3]!==c?(m=x=>{p(x),globalThis.localStorage?.setItem(c,x)},n[3]=c,n[4]=m):m=n[4];const u=m;let d,f;n[5]!==o||n[6]!==r?(d=()=>{!i.current&&o&&r==="table"&&p("cards"),i.current=o},f=[o,r],n[5]=o,n[6]=r,n[7]=d,n[8]=f):(d=n[7],f=n[8]),z.useEffect(d,f);let h;return n[9]!==u||n[10]!==r?(h=[r,u],n[9]=u,n[10]=r,n[11]=h):h=n[11],h}function an(s){const e=G.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,c=o===void 0?"title":o,a=i===void 0?"table":i,[r,p]=z.useState(""),m=z.useDeferredValue(r),u=`${n}-${g}`,[d,f]=cn(u),h=`studio-${g}-filter-visible-${n}`;let x;e[0]!==h?(x=()=>globalThis.localStorage?.getItem(h)==="true",e[0]=h,e[1]=x):x=e[1];const[j,b]=z.useState(x);let v;e[2]!==h?(v=M=>{b(M),globalThis.localStorage?.setItem(h,String(M))},e[2]=h,e[3]=v):v=e[3];const S=v;let l;e[4]!==j||e[5]!==S?(l=()=>{S(!j)},e[4]=j,e[5]=S,e[6]=l):l=e[6];const D=l,[T,I]=rn(`studio-${g}-${n}`,a),{sortKey:A,sortDirection:w,handleSort:$}=ln(c),P=A;let k;return e[7]!==j||e[8]!==d||e[9]!==$||e[10]!==r||e[11]!==m||e[12]!==S||e[13]!==f||e[14]!==I||e[15]!==w||e[16]!==P||e[17]!==D||e[18]!==T?(k={search:r,searchTerm:m,setSearch:p,filters:d,setFilters:f,filterBarVisible:j,setFilterBarVisible:S,toggleFilterBar:D,viewMode:T,setViewMode:I,sortKey:P,sortDirection:w,handleSort:$},e[7]=j,e[8]=d,e[9]=$,e[10]=r,e[11]=m,e[12]=S,e[13]=f,e[14]=I,e[15]=w,e[16]=P,e[17]=D,e[18]=T,e[19]=k):k=e[19],k}function dn(s){const e=G.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,c=se(),a=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let r;e[0]!==o||e[1]!==c||e[2]!==a?(r=c(a,{count:o}),e[0]=o,e[1]=c,e[2]=a,e[3]=r):r=e[3];let p;e[4]!==r?(p=t.jsx(St,{children:r}),e[4]=r,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==m?(u=c(m),e[6]=c,e[7]=m,e[8]=u):u=e[8];let d;e[9]!==u?(d=t.jsx(yt,{children:u}),e[9]=u,e[10]=d):d=e[10];let f;e[11]!==p||e[12]!==d?(f=t.jsxs(vt,{children:[p,d]}),e[11]=p,e[12]=d,e[13]=f):f=e[13];let h;e[14]!==c?(h=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=h):h=e[15];let x;e[16]!==h?(x=t.jsx(Ct,{children:h}),e[16]=h,e[17]=x):x=e[17];const j=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let b;e[18]!==o||e[19]!==c||e[20]!==j?(b=c(j,{count:o}),e[18]=o,e[19]=c,e[20]=j,e[21]=b):b=e[21];let v;e[22]!==i||e[23]!==b?(v=t.jsx(bt,{onClick:i,variant:"destructive",children:b}),e[22]=i,e[23]=b,e[24]=v):v=e[24];let S;e[25]!==v||e[26]!==x?(S=t.jsxs(_t,{children:[x,v]}),e[25]=v,e[26]=x,e[27]=S):S=e[27];let l;e[28]!==S||e[29]!==f?(l=t.jsxs(Dt,{children:[f,S]}),e[28]=S,e[29]=f,e[30]=l):l=e[30];let D;return e[31]!==g||e[32]!==n||e[33]!==l?(D=t.jsx(Nt,{open:n,onOpenChange:g,children:l}),e[31]=g,e[32]=n,e[33]=l,e[34]=D):D=e[34],D}function un(s){const e=G.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:c,onNavigateConnected:a,onConnect:r}=s,p=se();let m,u;e[0]!==i||e[1]!==n?(m=Oe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const d=u;let f;e[4]!==n._meta?(f=kt(n._meta),e[4]=n._meta,e[5]=f):f=e[5];const h=f,x=h?.friendlyName||h?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",j=n.server?.description||n.description||null;let b;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(b=n.server?.icons?.[0]?.src||Tt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=b):b=e[8];const v=b;let S;if(e[9]!==o||e[10]!==m){let O;e[12]!==m?(O=R=>R.connection_type!=="VIRTUAL"&&R.app_name===m,e[12]=m,e[13]=O):O=e[13],S=o.filter(O),e[9]=o,e[10]=m,e[11]=S}else S=e[11];const l=S,D=d||g;let T,I;e[14]!==l||e[15]!==d||e[16]!==n||e[17]!==r||e[18]!==a?(T=()=>{if(d){const O=l[0];O&&a(O);return}I()},I=()=>r(n),e[14]=l,e[15]=d,e[16]=n,e[17]=r,e[18]=a,e[19]=T,e[20]=I):(T=e[19],I=e[20]);let A;e[21]!==j||e[22]!==v||e[23]!==x?(A={title:x,description:j,icon:v},e[21]=j,e[22]=v,e[23]=x,e[24]=A):A=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[25]=w):w=e[25];const $=D?T:void 0;let P;e[26]!==g||e[27]!==c||e[28]!==I||e[29]!==d||e[30]!==n.id||e[31]!==p?(P=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(L,{variant:"outline",size:"sm",disabled:c!==null,onClick:O=>{O.stopPropagation(),I()},children:c===n.id?t.jsx(ge,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=c,e[28]=I,e[29]=d,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let k;e[33]!==P?(k=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=k):k=e[34];let M;return e[35]!==A||e[36]!==$||e[37]!==k?(M=t.jsx(ve,{connection:A,fallbackIcon:w,onClick:$,headerActionsAlwaysVisible:!0,headerActions:k}),e[35]=A,e[36]=$,e[37]=k,e[38]=M):M=e[38],M}function gn(s){return s?.length?{appToolName:s.find(n=>!!Ht(n._meta))?.name??null}:null}const mn=3;function pn(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 fn(s){const e=G.c(21),{projects:n}=s,g=se();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let d;return e[2]!==u?(d=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=d):d=e[3],d}let o,i,c;if(e[4]!==n){const u=n.slice(0,mn);c="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(hn),e[4]=n,e[5]=o,e[6]=i,e[7]=c}else o=e[5],i=e[6],c=e[7];let a;e[8]!==o||e[9]!==i?(a=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=a):a=e[10];let r;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(r=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]=r):r=e[14];let p;e[15]!==r?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r}),e[15]=r,e[16]=p):p=e[16];let m;return e[17]!==c||e[18]!==a||e[19]!==p?(m=t.jsxs("div",{className:c,children:[a,p]}),e[17]=c,e[18]=a,e[19]=p,e[20]=m):m=e[20],m}function hn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Rt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=G.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 c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(We,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",onClick:jn,children:t.jsx(on,{size:20})})}),e[2]=c):c=e[2];let a;e[3]!==g?(a=t.jsxs(Xe,{children:[c,t.jsx(Ge,{align:"end",onClick:xn,children:g})]}),e[3]=g,e[4]=a):a=e[4];let r;return e[5]!==i||e[6]!==a?(r=t.jsx("div",{className:i,children:a}),e[5]=i,e[6]=a,e[7]=r):r=e[7],r}function xn(s){return s.stopPropagation()}function jn(s){return s.stopPropagation()}function Sn(s){const e=G.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:c}=s,a=se();let r;if(e[0]!==n.connections||e[1]!==i){let U;e[3]!==i?(U=y=>i.has(y.id),e[3]=i,e[4]=U):U=e[4],r=n.connections.every(U),e[0]=n.connections,e[1]=i,e[2]=r}else r=e[2];const p=r;let m;if(e[5]!==n.connections||e[6]!==i){let U;e[8]!==i?(U=y=>i.has(y.id),e[8]=i,e[9]=U):U=e[9],m=n.connections.some(U),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let d;e[10]!==p||e[11]!==n.connections||e[12]!==c||e[13]!==i?(d=()=>{for(const U of n.connections)p?i.has(U.id)&&c(U.id):i.has(U.id)||c(U.id)},e[10]=p,e[11]=n.connections,e[12]=c,e[13]=i,e[14]=d):d=e[14];const f=d,h=n.title,x=n.icon;let j;e[15]!==n.connections.length||e[16]!==a?(j=a("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=a,e[17]=j):j=e[17];let b;e[18]!==n.icon||e[19]!==n.title||e[20]!==j?(b={title:h,icon:x,description:j},e[18]=n.icon,e[19]=n.title,e[20]=j,e[21]=b):b=e[21];let v;e[22]!==g||e[23]!==o||e[24]!==f?(v=()=>o?f():g(),e[22]=g,e[23]=o,e[24]=f,e[25]=v):v=e[25];const S=o&&p&&"ring-2 ring-primary",l=o&&u&&!p&&"ring-1 ring-primary/50";let D;e[26]!==l||e[27]!==S?(D=he(S,l),e[26]=l,e[27]=S,e[28]=D):D=e[28];const T=o?p?!0:u&&"mixed":void 0;let I;e[29]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[29]=I):I=e[29];let A;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==a||e[35]!==f?(A=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:f}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("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]=a,e[35]=f,e[36]=A):A=e[36];let w;e[37]!==g?(w=U=>{U.stopPropagation(),g()},e[37]=g,e[38]=w):w=e[38];let $;e[39]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Ke,{size:16}),e[39]=$):$=e[39];let P;e[40]!==a?(P=a("orgs.connectionSelectionUi.open"),e[40]=a,e[41]=P):P=e[41];let k;e[42]!==w||e[43]!==P?(k=t.jsxs(ce,{onClick:w,children:[$,P]}),e[42]=w,e[43]=P,e[44]=k):k=e[44];let M;e[45]!==o||e[46]!==k?(M=t.jsx(Re,{selectionMode:o,children:k}),e[45]=o,e[46]=k,e[47]=M):M=e[47];let O;e[48]!==A||e[49]!==M?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[A,M]}),e[48]=A,e[49]=M,e[50]=O):O=e[50];let R;return e[51]!==D||e[52]!==T||e[53]!==O||e[54]!==b||e[55]!==v?(R=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:b,onClick:v,className:D,selected:T,fallbackIcon:I,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=D,e[52]=T,e[53]=O,e[54]=b,e[55]=v,e[56]=R):R=e[56],R}function yn(s){const e=G.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:c,onToggleSelect:a,onOpen:r,onToggleStatus:p,onDelete:m}=s,u=se();let d;e[0]!==g||e[1]!==a||e[2]!==o||e[3]!==u?(d=o?t.jsx(Be,{checked:g,onCheckedChange:a,onClick:vn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=a,e[2]=o,e[3]=u,e[4]=d):d=e[4];let f;e[5]!==r?(f=T=>{T.stopPropagation(),r()},e[5]=r,e[6]=f):f=e[6];let h;e[7]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Ke,{size:16}),e[7]=h):h=e[7];let x;e[8]!==u?(x=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=x):x=e[9];let j;e[10]!==f||e[11]!==x?(j=t.jsxs(ce,{onClick:f,children:[h,x]}),e[10]=f,e[11]=x,e[12]=j):j=e[12];let b;e[13]!==i||e[14]!==c||e[15]!==a||e[16]!==u?(b=(i||c)&&t.jsxs(ce,{onClick:T=>{T.stopPropagation(),a()},children:[t.jsx(Wt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=c,e[15]=a,e[16]=u,e[17]=b):b=e[17];let v;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(v=i&&(n.status==="active"?t.jsxs(ce,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Xt,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Gt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=v):v=e[22];let S;e[23]!==i||e[24]!==m||e[25]!==u?(S=i&&t.jsxs(ce,{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]=S):S=e[26];let l;e[27]!==o||e[28]!==j||e[29]!==b||e[30]!==v||e[31]!==S?(l=t.jsxs(Re,{selectionMode:o,children:[j,b,v,S]}),e[27]=o,e[28]=j,e[29]=b,e[30]=v,e[31]=S,e[32]=l):l=e[32];let D;return e[33]!==d||e[34]!==l?(D=t.jsxs("div",{className:"flex items-center gap-1",children:[d,l]}),e[33]=d,e[34]=l,e[35]=D):D=e[35],D}function vn(s){return s.stopPropagation()}function Cn(s){const e=G.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:c,onDeselectAll:a,onDelete:r,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,d=se();if(n===0)return null;let f;e[0]!==n||e[1]!==d?(f=d("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=d,e[2]=f):f=e[2];let h;e[3]!==f?(h=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:f}),e[3]=f,e[4]=h):h=e[4];let x;e[5]!==n||e[6]!==a||e[7]!==c||e[8]!==d||e[9]!==g?(x=n<g?t.jsx(L,{variant:"outline",size:"sm",onClick:c,children:d("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",onClick:a,children:d("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=a,e[7]=c,e[8]=d,e[9]=g,e[10]=x):x=e[10];let j;e[11]!==i||e[12]!==p||e[13]!==d?(j=i&&t.jsxs(L,{variant:"outline",size:"sm",onClick:p,children:[t.jsx(Le,{size:13}),d("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=d,e[14]=j):j=e[14];let b;e[15]!==o||e[16]!==r||e[17]!==m||e[18]!==d?(b=o&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("active"),children:d("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",onClick:()=>m("inactive"),children:d("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",onClick:r,children:[t.jsx(He,{size:13}),d("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=r,e[17]=m,e[18]=d,e[19]=b):b=e[19];let v;e[20]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Ee,{size:13}),e[20]=v):v=e[20];let S;e[21]!==u?(S=t.jsx(L,{variant:"ghost",size:"sm",onClick:u,children:v}),e[21]=u,e[22]=S):S=e[22];let l;return e[23]!==h||e[24]!==x||e[25]!==j||e[26]!==b||e[27]!==S?(l=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl glass px-3 py-2 flex items-center gap-2",children:[h,x,j,b,S]})}),e[23]=h,e[24]=x,e[25]=j,e[26]=b,e[27]=S,e[28]=l):l=e[28],l}function bn(s){const e=G.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,c=se(),[a,r]=z.useState(null);let p;e[0]!==g?(p=k=>{k||r(null),g(k)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==c?(u=c("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=c,e[3]=u):u=e[3];let d;e[4]!==u?(d=t.jsx(ke,{children:u}),e[4]=u,e[5]=d):d=e[5];let f;e[6]!==c?(f=c("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=c,e[7]=f):f=e[7];let h;e[8]!==f?(h=t.jsx(Te,{children:f}),e[8]=f,e[9]=h):h=e[9];let x;e[10]!==d||e[11]!==h?(x=t.jsxs(we,{children:[d,h]}),e[10]=d,e[11]=h,e[12]=x):x=e[12];let j;e[13]!==o||e[14]!==a||e[15]!==c?(j=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):o.map(k=>t.jsxs("button",{type:"button",onClick:()=>r(k.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",a===k.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-accent"),children:[t.jsx(sn,{icon:k.icon,name:k.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:k.title}),k.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.description})]})]},k.id)),e[13]=o,e[14]=a,e[15]=c,e[16]=j):j=e[16];let b;e[17]!==j?(b=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[17]=j,e[18]=b):b=e[18];let v;e[19]!==m?(v=()=>m(!1),e[19]=m,e[20]=v):v=e[20];let S;e[21]!==c?(S=c("orgs.connectionSelectionUi.cancel"),e[21]=c,e[22]=S):S=e[22];let l;e[23]!==S||e[24]!==v?(l=t.jsx(L,{variant:"outline",onClick:v,children:S}),e[23]=S,e[24]=v,e[25]=l):l=e[25];const D=!a;let T;e[26]!==m||e[27]!==i||e[28]!==a?(T=()=>{a&&(i(a),m(!1))},e[26]=m,e[27]=i,e[28]=a,e[29]=T):T=e[29];let I;e[30]!==c?(I=c("orgs.connectionSelectionUi.add"),e[30]=c,e[31]=I):I=e[31];let A;e[32]!==D||e[33]!==T||e[34]!==I?(A=t.jsx(L,{disabled:D,onClick:T,children:I}),e[32]=D,e[33]=T,e[34]=I,e[35]=A):A=e[35];let w;e[36]!==l||e[37]!==A?(w=t.jsxs(Ae,{children:[l,A]}),e[36]=l,e[37]=A,e[38]=w):w=e[38];let $;e[39]!==w||e[40]!==x||e[41]!==b?($=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[x,b,w]}),e[39]=w,e[40]=x,e[41]=b,e[42]=$):$=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==$?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:$}),e[43]=m,e[44]=n,e[45]=$,e[46]=P):P=e[46],P}function _n({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=se(),{org:i}=Me(),c=st(),a=Fe(),{data:r}=$e.useSession(),p=ze(),m=Et(s),u=ht(),{granted:d}=ye("connections:manage"),{granted:f}=ye("agents:manage"),[h,x]=z.useState(new Set),j=h.size>0,[b,v]=z.useState(!1),[S,l]=z.useState(!1),[D,T]=z.useState(null),I=Kt(),A=pn(qt(I)),w=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),$=pt(w),P=_=>{x(C=>{const B=new Set(C);return B.has(_)?B.delete(_):B.add(_),B})},k=()=>{x(new Set)},M=Ue(s.searchTerm),O=M.items,R=jt(M.loadMore,M.hasMore,M.isLoadingMore),U=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),y=s.search.length>0,F=e==="all"||y?O.filter(_=>{if(y){const C=Oe(_);if(C&&U.has(C))return!1}return!0}):[],W=e==="connected"||y?$:[],te=async _=>{if(!(!i||!r?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const C=at(_,i.id,r.user.id,{remoteIndex:0}),B=C.connection_type==="STDIO",K=!!C.connection_url,H=B&&C.connection_headers&&typeof C.connection_headers=="object"&&"command"in C.connection_headers;if(!K&&!H){X.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const Ce=await p.create.mutateAsync(C),{id:ie}=Ce,le=await nn({connectionId:ie,orgId:i.id,orgSlug:i.slug,persistFallback:re=>p.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){ne("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),X.error(o("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){ne("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${i.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ct.isMCPAuthenticated(re.href,null)}),N(),X.success(o("orgs.connections.authenticationSuccessful"))}let pe=null;try{const re=await c.fetchQuery(Bt({connectionId:ie,orgId:i.id,orgSlug:i.slug}));pe=gn((await re.listTools()).tools)}catch{}const be=ue(Ce),_e=pe?pe.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(pe.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;X.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>a(_e)}}:void 0)}catch(C){X.error(o("orgs.connections.failedToConnect",{error:C instanceof Error?C.message:String(C)}))}finally{T(null)}}},Q=ot(),N=()=>{lt(c,i.id)},E=async()=>{v(!1);const _=[...h];ne("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>Q.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),X.success(o("orgs.connections.deletedConnections",{count:B})),k()},V=async(_,C)=>{try{await p.update.mutateAsync({id:_,data:{status:C}}),N(),X.success(o(C==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{X.error(o("orgs.connections.failedToUpdateConnection"))}},me=async _=>{const C=[...h];ne("connections_bulk_status_toggled",{count:C.length,to_status:_});const K=(await Promise.allSettled(C.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;N(),X.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),k()},je=async _=>{const C=I.find(H=>H.id===_);if(!C)return;ne("connections_bulk_add_to_agent",{agent_id:_,count:h.size});const B=new Set(C.connections.map(H=>H.connection_id)),K=[...h].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){X.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await Q.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...C.connections,...K]}}),it(c,i.id),X.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:C.title})),k()}catch{X.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(xt,{...u}),t.jsx(dn,{open:b,onOpenChange:v,count:h.size,onConfirm:E}),t.jsx(bn,{open:S,onOpenChange:l,agents:I,onConfirm:je}),M.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(y?F.length===0&&w.length===0:e==="all"?F.length===0:w.length===0)?t.jsx(ft,{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(d?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[W.map(_=>{if(_.type==="group")return t.jsx(Sn,{group:_,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:j,selectedIds:h,onToggleSelect:P},_.key);const C=_.connection,B=h.has(C.id);return t.jsx(ve,{connection:C,fallbackIcon:t.jsx(xe,{}),onClick:()=>j?P(C.id):a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:j?B:void 0,footer:t.jsx(fn,{projects:A.get(C.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(yn,{connection:C,isSelected:B,selectionMode:j,canManage:d,canManageAgents:f,onToggleSelect:()=>P(C.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),onToggleStatus:K=>V(C.id,K),onDelete:()=>u.requestDelete(C)})},C.id)}),F.map(_=>t.jsx(un,{item:_,canManage:d,allConnections:m,connectedAppNames:U,connectingItemId:D,onNavigateConnected:C=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ue(C)}}),onConnect:te},_.id)),(e==="all"||y)&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||y)&&M.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ge,{className:"size-6 text-muted-foreground"})})]})}),j&&t.jsx(Cn,{count:h.size,total:w.length,canManage:d,canManageAgents:f,onSelectAll:()=>{x(new Set(w.map(_=>_.id)))},onDeselectAll:()=>x(new Set),onDelete:()=>v(!0),onAddToAgent:()=>l(!0),onToggleStatus:me,onCancel:k})]})}function Dn(){const s=se(),{org:e}=Me(),n=Fe(),g=qe({strict:!1}),{data:o}=$e.useSession(),{stdioEnabled:i}=Je(),c=Ve(),{granted:a}=ye("connections:manage"),r=an({namespace:e.slug,resource:"connections"}),p=ze(),m=Ye(),[u,d]=Ze(et.connectionsTab(e.slug),y=>g.tab==="all"||g.tab==="connected"?g.tab:y??"all"),[f,h]=z.useState("ALL"),[x,j]=z.useState("ALL"),v=Ue(r.searchTerm).items,S=r.search!==r.searchTerm,l=tt({resolver:nt(Jt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=l.watch("ui_type"),T=l.watch("connection_url"),I=l.watch("npx_package"),A=fe({uiType:D,connectionUrl:T??"",npxPackage:I??""})??Ne({uiType:D,connectionUrl:T??"",registryItems:v}),w=a&&g.action==="create",$=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),n({to:".",search:y=>({...y,action:"create"})})},P=()=>{n({to:".",search:y=>({...y,action:void 0})})},k=async y=>{let F,W=null,te=null,Q=null;y.ui_type==="NPX"?(F="STDIO",W="",Q=en(y.npx_package||"",y.env_vars||[])):y.ui_type==="STDIO"?(F="STDIO",W="",Q=tn(y.stdio_command||"",y.stdio_args||"",y.stdio_cwd,y.env_vars||[])):(F=y.ui_type,W=y.connection_url||"",te=y.connection_token||null);const N=rt("conn");ne("connection_custom_created",{connection_type:F,ui_type:y.ui_type}),await p.create.mutateAsync({id:N,title:y.title,description:y.description||null,connection_type:F,connection_url:W,connection_token:te,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:y.icon??null,app_name:null,app_id:null,connection_headers:Q,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),P(),l.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ue({app_name:null,connection_url:W,title:y.title,id:N})}})},M=y=>{y||(w&&P(),l.reset())},O=y=>{const F=y.trim();if(!F)return;const W=!!l.formState.dirtyFields.title,te=!!l.formState.dirtyFields.description,Q=!!l.formState.dirtyFields.env_vars,N=V=>{if(V&&(!W&&!l.getValues("title").trim()&&V.title&&l.setValue("title",V.title,{shouldDirty:!1}),!te&&!(l.getValues("description")??"").trim()&&V.description&&l.setValue("description",V.description,{shouldDirty:!1}),!Q&&V.envVarKeys?.length)){const me=l.getValues("env_vars")??[],je=new Set(me.map(C=>C.key)),_=V.envVarKeys.filter(C=>!je.has(C));_.length>0&&l.setValue("env_vars",[...me,..._.map(C=>({key:C,value:""}))],{shouldDirty:!0})}},E=Zt(F);if(E&&i){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",E.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),N(fe({uiType:"NPX",npxPackage:E.packageName}));return}if(F.startsWith("http://")||F.startsWith("https://")){const V=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";l.setValue("ui_type",V,{shouldDirty:!0}),l.setValue("connection_url",F,{shouldDirty:!0}),N(fe({uiType:V,connectionUrl:F})??Ne({uiType:V,connectionUrl:F,registryItems:v}));return}D==="NPX"&&N(fe({uiType:"NPX",npxPackage:F}))},R=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:"sm",variant:"default",onClick:$,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null,U=t.jsx(dt,{sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.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:f,onChange:y=>h(y||"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:x,onChange:y=>j(y||"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")}]}]});return t.jsx(t.Fragment,{children:t.jsxs(ae,{children:[(()=>{const y=s("orgs.connections.createConnection"),F=s("orgs.connections.createConnectionDescription"),W=l.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),te=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:l.control,name:"ui_type",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(Z,{children:t.jsx(Ut,{children:t.jsx(Vt,{})})}),t.jsxs(zt,{children:[t.jsx(de,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(de,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(de,{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(de,{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(de,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Qt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(q,{control:l.control,name:"npx_package",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.npmPackage")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:E=>{const V=E.clipboardData.getData("text");V&&(E.preventDefault(),l.setValue("npx_package",V.trim(),{shouldDirty:!0}),O(V))},onBlur:E=>{O(E.target.value),N.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:l.control,name:"stdio_command",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.command")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"stdio_args",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.arguments")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(q,{control:l.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.workingDirectory")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(q,{control:l.control,name:"env_vars",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.environmentVariables")}),t.jsx(Z,{children:t.jsx(Yt,{value:N.value??[],onChange:N.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:l.control,name:"connection_url",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.url")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:E=>{const V=E.clipboardData.getData("text");V&&(E.preventDefault(),l.setValue("connection_url",V.trim(),{shouldDirty:!0}),O(V))},onBlur:E=>{O(E.target.value),N.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"connection_token",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...N,value:N.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.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(ee,{})]})})]}),t.jsx(q,{control:l.control,name:"title",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.name")}),t.jsx(Z,{children:t.jsx(oe,{placeholder:s("orgs.connections.namePlaceholder"),...N})}),t.jsx(ee,{})]})}),t.jsx(q,{control:l.control,name:"description",render:({field:N})=>t.jsxs(J,{children:[t.jsx(Y,{children:s("orgs.connections.description")}),t.jsx(Z,{children:t.jsx(Lt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(ee,{})]})})]}),Q=w;return c?t.jsx(wt,{open:Q,onOpenChange:M,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(It,{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(Pt,{children:y}),t.jsx(Mt,{className:"mt-1",children:F})]}),t.jsx(Ft,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Ee,{size:16})})})]})}),t.jsx(De,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(k),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:te}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:W})})]})})]})}):t.jsx(Pe,{open:Q,onOpenChange:M,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:y}),t.jsx(Te,{children:F})]}),t.jsx(De,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(k),children:[t.jsx("div",{className:"py-4",children:te}),t.jsxs(Ae,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>M(!1),children:s("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:W})]})]})})]})})})(),t.jsx(ae.Content,{children:t.jsx(ae.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[m?t.jsx(ae.Actions,{secondary:t.jsxs(t.Fragment,{children:[t.jsx(gt,{value:r.search,onChange:r.setSearch,label:s("library.context.search"),placeholder:s("orgs.connections.searchPlaceholder"),clearLabel:s("library.library.clearSearch")}),U]}),children:R}):t.jsx(ae.Title,{actions:R,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 empty:hidden",children:!m&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{value:r.search,onChange:r.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:y=>{y.key==="Escape"&&(r.setSearch(""),y.target.blur())}}),U]})}),t.jsx(mt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:u,onTabChange:y=>{const F=y;F!==u&&ne("connections_page_tab_changed",{to_tab:F}),d(F)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ge,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:S?.5:1,transition:S?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:S?"none":"auto"},children:t.jsx(_n,{listState:r,activeTab:u,typeFilter:f,statusFilter:x})})})]})})})]})})}function Gs(){const s=G.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(ge,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Dn,{})})}),s[0]=e):e=s[0],e}export{Gs as default};