decocms 3.86.0 → 3.87.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 (238) hide show
  1. package/dist/client/assets/{AlertCircle-qY5ngKLr.js → AlertCircle-DCaILIxy.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-C7uYzZ0Z.js → ArrowUpRight-X5amVRyC.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-CNYYpNQm.js → CheckCircle-CbsNhQn0.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BVJUps1_.js → ChevronDown-CVjUKz-z.js} +1 -1
  5. package/dist/client/assets/{ChevronLeft-CCp89cqe.js → ChevronLeft-D1-Kt_O_.js} +1 -1
  6. package/dist/client/assets/{ChevronRight-MnjJHQHy.js → ChevronRight-B5vIIazE.js} +1 -1
  7. package/dist/client/assets/{ChevronUp-CKICjFfX.js → ChevronUp-BVstlWuJ.js} +1 -1
  8. package/dist/client/assets/{DotsVertical-Bl5GcKp2.js → DotsVertical-jXbP9E3i.js} +1 -1
  9. package/dist/client/assets/{Eye-C6daRddp.js → Eye-CZMmu7ZU.js} +1 -1
  10. package/dist/client/assets/{FilterLines-B_0u5HAa.js → FilterLines-PGGfujeb.js} +1 -1
  11. package/dist/client/assets/Form-otBZ0aYe.js +26 -0
  12. package/dist/client/assets/{Globe01-CgHdNpOL.js → Globe01-Dkk22t5V.js} +1 -1
  13. package/dist/client/assets/{Globe04-DEangwXD.js → Globe04-DqCAznfy.js} +1 -1
  14. package/dist/client/assets/{HardDrive-V1dbAXdv.js → HardDrive-Dm-8T9iU.js} +1 -1
  15. package/dist/client/assets/{Key01-B0h1bFlR.js → Key01-BNThvF9O.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-BsVzrTOG.js → LayoutLeft-IEoSRkSV.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-B9RsD2Us.js → LinkExternal01-AFpRcUMN.js} +1 -1
  18. package/dist/client/assets/{Monitor01-DAM-u2R2.js → Monitor01-ge-8I-dx.js} +1 -1
  19. package/dist/client/assets/{Palette-DT8p7ZEl.js → Palette-DOfcM3Kq.js} +1 -1
  20. package/dist/client/assets/{Play-Blum-MoR.js → Play-BpkgKRX8.js} +1 -1
  21. package/dist/client/assets/{Plus-DfIcHYEj.js → Plus-BAnxALLT.js} +1 -1
  22. package/dist/client/assets/{SearchMd-B6GaXN7Q.js → SearchMd-D72ymOya.js} +1 -1
  23. package/dist/client/assets/{Settings02-Dd9sO-oW.js → Settings02-BYzbH49L.js} +1 -1
  24. package/dist/client/assets/{Shield01-DLANpVD0.js → Shield01-DzzrgcSm.js} +1 -1
  25. package/dist/client/assets/{Star01-Be_MjtDZ.js → Star01-CfUlqnJc.js} +1 -1
  26. package/dist/client/assets/{Stars01-D3ha2IeY.js → Stars01-DOOJ-cpD.js} +1 -1
  27. package/dist/client/assets/{Stars02-DHcW8N80.js → Stars02-BcDfq8PM.js} +1 -1
  28. package/dist/client/assets/{Sun-DO_Gt4P2.js → Sun-r3rOsIIR.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-CrHLIeRP.js → SwitchHorizontal01-D3QmyK-N.js} +1 -1
  30. package/dist/client/assets/{Tool01-hxrY31T7.js → Tool01-Bahn8UbK.js} +1 -1
  31. package/dist/client/assets/{Trash01-DGJ-LjB-.js → Trash01-BNbAqaqW.js} +1 -1
  32. package/dist/client/assets/{Upload01-CzOJ3UuD.js → Upload01-4k3hmRFX.js} +1 -1
  33. package/dist/client/assets/{User01-DR_UC5XH.js → User01-_ttgUTw7.js} +1 -1
  34. package/dist/client/assets/{Users01-cxH39exM.js → Users01-BwX0Mh9G.js} +1 -1
  35. package/dist/client/assets/{Users03-BZYHqQGQ.js → Users03-Bp6iF_8k.js} +1 -1
  36. package/dist/client/assets/{X-CXRx6PGX.js → X-D-dT8MOl.js} +1 -1
  37. package/dist/client/assets/{XCircle-BLfqcVud.js → XCircle-BGPqJ1Ro.js} +1 -1
  38. package/dist/client/assets/{XClose-4ak3u3qT.js → XClose-CNxbnD3N.js} +1 -1
  39. package/dist/client/assets/{Zap-DVtX-UPi.js → Zap-CxIlaYID.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-iu6ldaYZ.js → ZapSquare-BDFHxBEC.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-6aWLXLSs.js → ZoomOut-Bw1ZSU5L.js} +1 -1
  42. package/dist/client/assets/{access-gate-B_rz72ZQ.js → access-gate-CCJp4m8K.js} +1 -1
  43. package/dist/client/assets/{add-section-modal-ExcCDC5z.js → add-section-modal-BgrC9Ld1.js} +1 -1
  44. package/dist/client/assets/{agent-icon-CKGTD-zQ.js → agent-icon-DLeN3d18.js} +1 -1
  45. package/dist/client/assets/{agents-list-DKD78ho4.js → agents-list-Q3tDYSwW.js} +1 -1
  46. package/dist/client/assets/ai-providers-BqFV0dkm.js +1 -0
  47. package/dist/client/assets/{alert-DIaLGkVq.js → alert-Dry1jh9V.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-D5KOx-3H.js → alert-dialog-BRxMo-sj.js} +1 -1
  49. package/dist/client/assets/app-editor-CmSP6n2r.js +1 -0
  50. package/dist/client/assets/{auth-B4fF5n_6.js → auth-BmpBXuc6.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-DS1LbQ8-.js → auth-catchall-C2f_hrTA.js} +1 -1
  52. package/dist/client/assets/{auth-entry-BVyaHjaQ.js → auth-entry-Dc0ISy_Q.js} +1 -1
  53. package/dist/client/assets/auth-split-layout-vIU-YxKv.js +1 -0
  54. package/dist/client/assets/{authenticate-and-persist-oauth-D2tM_mGL.js → authenticate-and-persist-oauth-Ch8j6yff.js} +1 -1
  55. package/dist/client/assets/{automation-list-row-BKx-xx1i.js → automation-list-row-DuiEBMt2.js} +1 -1
  56. package/dist/client/assets/{automation-runs-_FCeac3K.js → automation-runs-Cdam9_64.js} +1 -1
  57. package/dist/client/assets/{automations-BQ894D8d.js → automations-CdkAIVKM.js} +1 -1
  58. package/dist/client/assets/{avatar-3b85MUU5.js → avatar-ByeXDTC_.js} +1 -1
  59. package/dist/client/assets/{badge-CBy4Rm2Q.js → badge-DUd6QA6I.js} +1 -1
  60. package/dist/client/assets/{block-document-BFMWdkuR.js → block-document-CC_dKbbH.js} +1 -1
  61. package/dist/client/assets/{brand-context-DQ3HUqVS.js → brand-context-EyJOR9fi.js} +1 -1
  62. package/dist/client/assets/buckets-Du6WAmVO.js +1 -0
  63. package/dist/client/assets/{capability-load-error-DmenvLwh.js → capability-load-error-hf3qlFQ9.js} +1 -1
  64. package/dist/client/assets/{card-D0ElZuSJ.js → card-BL8IT_Xq.js} +1 -1
  65. package/dist/client/assets/category-editor-BkcL4gtt.js +1 -0
  66. package/dist/client/assets/{chat-context-SWJ_FDEf.js → chat-context-8aInoVVs.js} +1 -1
  67. package/dist/client/assets/{checkbox-UCOb4UyX.js → checkbox-BvC4eja3.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-DYcgRZGE.js → cli-auth-success-BzKwknZh.js} +1 -1
  69. package/dist/client/assets/collection-detail-DGACG0zf.js +1 -0
  70. package/dist/client/assets/{collection-display-button-DY7UIm0_.js → collection-display-button-CWZcD7VW.js} +1 -1
  71. package/dist/client/assets/{collection-search-B-ZTg2tB.js → collection-search-xJgITIyC.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-7m5XLASC.js → collection-tabs-rwQ7O1FC.js} +1 -1
  73. package/dist/client/assets/{command-CKe7nBfr.js → command-DrqBy6cr.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-PAEJK5wr.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-JUjDMHMz.js → connect-desktop-dialog-CN-nGv3X.js} +1 -1
  76. package/dist/client/assets/{connection-card-By0LggNB.js → connection-card-_vJp-QnB.js} +1 -1
  77. package/dist/client/assets/connection-detail-ja-xrIwZ.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-DeSC5iva.js → connection-form-helpers-I0PYYuLM.js} +1 -1
  79. package/dist/client/assets/connections-B1jNaws1.js +1 -0
  80. package/dist/client/assets/{context-menu-BXRYPu2v.js → context-menu-HarJm6y_.js} +1 -1
  81. package/dist/client/assets/{decopilot-DBiOjpCq.js → decopilot-DlerL3TD.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-Cd7s5cwH.js → decopilot-sse-pool-D0qyyVP7.js} +1 -1
  83. package/dist/client/assets/{dialog-CwfeALzq.js → dialog-BuyMoIGd.js} +1 -1
  84. package/dist/client/assets/{domain-settings-DYoOK4LM.js → domain-settings-DKI84wPN.js} +1 -1
  85. package/dist/client/assets/{drawer-_RQmWfAo.js → drawer-R83GIfSJ.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-CppAWsT_.js → dropdown-menu-6KXvVkGj.js} +1 -1
  87. package/dist/client/assets/{empty-state-CfAeMInj.js → empty-state-8wIqOHhT.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-qW230rJb.js → extract-connection-data-BlAuqFCc.js} +1 -1
  89. package/dist/client/assets/file-explorer-Xu0RpKKj.js +2 -0
  90. package/dist/client/assets/{file-type-icon-CdZyaTKH.js → file-type-icon-CvUBwDjL.js} +1 -1
  91. package/dist/client/assets/{files-BagYqqvX.js → files-aEPuOJ77.js} +1 -1
  92. package/dist/client/assets/{form-xYXw--Kt.js → form-DrdYYSH7.js} +1 -1
  93. package/dist/client/assets/general-ItE-Caya.js +1 -0
  94. package/dist/client/assets/{github-repo-picker-B1nNLNvt.js → github-repo-picker-B9itq1xr.js} +1 -1
  95. package/dist/client/assets/{hooks-CLt3SUb8.js → hooks-B2hm8dgB.js} +1 -1
  96. package/dist/client/assets/{import-from-deco-dialog-DhVDGeAO.js → import-from-deco-dialog-LpeKak-8.js} +1 -1
  97. package/dist/client/assets/{index-Benu0NlA.js → index-01iYleW9.js} +1 -1
  98. package/dist/client/assets/index-8j69uwRU.js +1 -0
  99. package/dist/client/assets/{index-DkOvgjMe.js → index-B0KuFfZg.js} +2 -2
  100. package/dist/client/assets/index-B6DoI6qf.css +1 -0
  101. package/dist/client/assets/{index-uKLTzwtC.js → index-BD-GJSKU.js} +1 -1
  102. package/dist/client/assets/index-BP-ioQEj.js +1 -0
  103. package/dist/client/assets/index-BdQq_4o_.js +1 -0
  104. package/dist/client/assets/{index-CLz5uOtD.js → index-BneU-diW.js} +1 -1
  105. package/dist/client/assets/index-BpzEWYcj.js +1 -0
  106. package/dist/client/assets/{index-D7pI5IpD.js → index-C4Pfm5Oe.js} +1 -1
  107. package/dist/client/assets/{index-CCbaPbk-.js → index-C5jRpoWd.js} +1 -1
  108. package/dist/client/assets/index-CDSjl7Ui.js +1 -0
  109. package/dist/client/assets/{index-B7l76Ktp.js → index-CZObCZGR.js} +1 -1
  110. package/dist/client/assets/{index-Yqaph2kh.js → index-CdH9ADyr.js} +10 -10
  111. package/dist/client/assets/{index-DILk6pqr.js → index-DP_mpTaG.js} +4 -4
  112. package/dist/client/assets/{index-U2AV4b0H.js → index-oY9SWynr.js} +1 -1
  113. package/dist/client/assets/{index-redirect-Bmnv-CEe.js → index-redirect-CLJSuvD8.js} +1 -1
  114. package/dist/client/assets/{input-DntqEqec.js → input-BIu7fT2w.js} +1 -1
  115. package/dist/client/assets/{integration-icon-CxxjWIPp.js → integration-icon-DM5W4vtE.js} +1 -1
  116. package/dist/client/assets/{label-NJtv9Xrj.js → label-DPhUzMw-.js} +1 -1
  117. package/dist/client/assets/{login-_rldC1vQ.js → login-c1Klklse.js} +1 -1
  118. package/dist/client/assets/{mcp-oauth-BTUV7ht5.js → mcp-oauth-CzalxeD0.js} +1 -1
  119. package/dist/client/assets/{members-DNPmSt7U.js → members-B3SDcfGH.js} +2 -2
  120. package/dist/client/assets/{monaco-editor-BS1tOSHv.js → monaco-editor-OzwRuboT.js} +1 -1
  121. package/dist/client/assets/{monitoring-stats-row-Bly7CEZA.js → monitoring-stats-row-CZFGN_Ar.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-DX668UtX.js → oauth-callback-ai-provider-Zibshrw4.js} +1 -1
  123. package/dist/client/assets/{oauth-callback-Brn-4X2e.js → oauth-callback-rILtKGBx.js} +1 -1
  124. package/dist/client/assets/{onboarding-h3gvqE97.js → onboarding-Ba1_LMfh.js} +1 -1
  125. package/dist/client/assets/{org-install-devOK14U.js → org-install-B3ClN2KG.js} +1 -1
  126. package/dist/client/assets/{org-layout-C6RX2zdp.js → org-layout-BIcSmhzR.js} +1 -1
  127. package/dist/client/assets/{organization-choice-DFUlgHk4.js → organization-choice-Djr2j4p7.js} +1 -1
  128. package/dist/client/assets/{page-seo-form-DIlFQufm.js → page-seo-form-Cygtl0_G.js} +1 -1
  129. package/dist/client/assets/page-seo-sheet-Ca_ed5x4.js +1 -0
  130. package/dist/client/assets/{popover-DmLzbFpk.js → popover-CoSr2FBy.js} +1 -1
  131. package/dist/client/assets/post-editor-DlBTWEb0.js +1 -0
  132. package/dist/client/assets/{preview-dialog-XKGBZobL.js → preview-dialog-Ew97vZX-.js} +1 -1
  133. package/dist/client/assets/{primitives-pW0ukQfP.js → primitives-Y5zOyEze.js} +1 -1
  134. package/dist/client/assets/profile-Bv93_4sd.js +1 -0
  135. package/dist/client/assets/project-app-view-B-FRjb71.js +1 -0
  136. package/dist/client/assets/record-editor-CnrRrpeQ.js +1 -0
  137. package/dist/client/assets/registry-DXqXIJ3q.js +2 -0
  138. package/dist/client/assets/{registry-layout-CQVApMRy.js → registry-layout-DJX2uyJL.js} +2 -2
  139. package/dist/client/assets/{require-capability-BlqPTqxe.js → require-capability-CaEtxlmL.js} +1 -1
  140. package/dist/client/assets/{required-auth-layout-DdFOKjMd.js → required-auth-layout-DaTmuUAT.js} +1 -1
  141. package/dist/client/assets/{reset-password-C7ldICgc.js → reset-password-DOCud_M1.js} +1 -1
  142. package/dist/client/assets/{roles-DqqpBRsM.js → roles-CxxJGu2W.js} +1 -1
  143. package/dist/client/assets/{save-status-DIZcxleS.js → save-status-CzIIhKYY.js} +1 -1
  144. package/dist/client/assets/{scroll-area-CN3_YfBC.js → scroll-area-DqRON9QZ.js} +1 -1
  145. package/dist/client/assets/{search-input-SieA9wsp.js → search-input-CBG595Ow.js} +1 -1
  146. package/dist/client/assets/secrets-CI45M6t4.js +1 -0
  147. package/dist/client/assets/{sections-editor-B8F8gKNp.js → sections-editor-DGK7CeFk.js} +2 -2
  148. package/dist/client/assets/select-Cr3vICrM.js +1 -0
  149. package/dist/client/assets/{select-model-DmLcnpxY.js → select-model-Bg44O4qj.js} +1 -1
  150. package/dist/client/assets/seo-editor-BnPhYxBs.js +1 -0
  151. package/dist/client/assets/{settings-layout-DStO9uhp.js → settings-layout-B3cOf57A.js} +1 -1
  152. package/dist/client/assets/{settings-section-BXkrjyua.js → settings-section-C9C9TZId.js} +1 -1
  153. package/dist/client/assets/{sheet-CgvO6KT7.js → sheet-CTaEFOuN.js} +1 -1
  154. package/dist/client/assets/{shell-controls-BlCSLJCZ.js → shell-controls-DTok3_fO.js} +1 -1
  155. package/dist/client/assets/{shell-layout-DAyf8ZZZ.js → shell-layout-BAiMOktM.js} +1 -1
  156. package/dist/client/assets/{shell-route-loading-44H3A_LH.js → shell-route-loading-s4EoOI9P.js} +1 -1
  157. package/dist/client/assets/{sidebar-D5TdEONj.js → sidebar-BSjkOAEq.js} +1 -1
  158. package/dist/client/assets/{skeleton-DUdp3Kvb.js → skeleton-DBbnbGFm.js} +1 -1
  159. package/dist/client/assets/{sortable.esm-DdDX2lbe.js → sortable.esm-DW_CXYvf.js} +1 -1
  160. package/dist/client/assets/sso-B0FMpGZK.js +1 -0
  161. package/dist/client/assets/{store-CrUgJduQ.js → store-DmCUraJs.js} +1 -1
  162. package/dist/client/assets/store-registry-DWQAV-zh.js +2 -0
  163. package/dist/client/assets/{studio-tools-DWzikkvB.js → studio-tools-D3_SJ0_N.js} +1 -1
  164. package/dist/client/assets/{switch-ZSF60LRT.js → switch-BSnmwd67.js} +1 -1
  165. package/dist/client/assets/{table-CAdy-hg6.js → table-B4QqlN52.js} +1 -1
  166. package/dist/client/assets/{tabs-CVnN0f33.js → tabs-B7KtNlAY.js} +1 -1
  167. package/dist/client/assets/{task-status-CtOjrZ5U.js → task-status-CN8kElP5.js} +1 -1
  168. package/dist/client/assets/{textarea-Fs50NfWG.js → textarea-B5r3kbSQ.js} +1 -1
  169. package/dist/client/assets/{toggle-group-C7SpEcqz.js → toggle-group-BoZF2OOS.js} +1 -1
  170. package/dist/client/assets/{toolbar-Dp05iiiH.js → toolbar-D_dUXYk3.js} +1 -1
  171. package/dist/client/assets/tools-list-Bw8CpHV0.js +1 -0
  172. package/dist/client/assets/{tooltip-DNJ6cRlV.js → tooltip-CYe5fPCQ.js} +1 -1
  173. package/dist/client/assets/{types-CsHe6BgD.js → types-CJgIJauG.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-CVKwKs8r.js → use-ai-providers-BQTrck2T.js} +1 -1
  175. package/dist/client/assets/{use-automations-Ca6VluJ_.js → use-automations-aeYDYpbz.js} +1 -1
  176. package/dist/client/assets/{use-capability-OLvFRh1U.js → use-capability-DhoZz-If.js} +1 -1
  177. package/dist/client/assets/{use-clock-tick-CWHp6nCX.js → use-clock-tick-BlJ7-hRX.js} +1 -1
  178. package/dist/client/assets/{use-collections-D0HN84Lz.js → use-collections-CSCQtjHx.js} +1 -1
  179. package/dist/client/assets/{use-connection-Bj1m8ynL.js → use-connection-CCWvfaxs.js} +1 -1
  180. package/dist/client/assets/{use-copy-CuQAt0Vj.js → use-copy-DJR4tQ3-.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-Cxqyw0Tn.js → use-create-virtual-mcp-CCvXLRxb.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-OpSLLz7d.js → use-debounced-autosave-C4Qmf5qO.js} +1 -1
  183. package/dist/client/assets/{use-delete-connection-ARKHDNqJ.js → use-delete-connection-gqYfcWeD.js} +1 -1
  184. package/dist/client/assets/{use-file-configs-aDA6u1U_.js → use-file-configs-B7ZdH4sp.js} +1 -1
  185. package/dist/client/assets/{use-infinite-scroll-CCIuAqs7.js → use-infinite-scroll-CU-J9rqm.js} +1 -1
  186. package/dist/client/assets/{use-join-requests-CyAP3Yln.js → use-join-requests-DrugHR3B.js} +1 -1
  187. package/dist/client/assets/{use-mcp-client-BdmHrvF5.js → use-mcp-client-B_wvxVvi.js} +1 -1
  188. package/dist/client/assets/{use-mcp-prompts-BwQLmLZi.js → use-mcp-prompts-B5ITx1M8.js} +1 -1
  189. package/dist/client/assets/{use-mcp-tools-ChlFTYss.js → use-mcp-tools--Zcng6MU.js} +1 -1
  190. package/dist/client/assets/{use-members-9pMsaLP9.js → use-members-DRYUtb_4.js} +1 -1
  191. package/dist/client/assets/{use-navigate-to-agent-Qyyx-mm9.js → use-navigate-to-agent-VYoT0How.js} +1 -1
  192. package/dist/client/assets/{use-org-auth-client-CtaccGLo.js → use-org-auth-client-p32QdZVr.js} +1 -1
  193. package/dist/client/assets/{use-org-sso-DvlbibgX.js → use-org-sso-DuGGcbA7.js} +1 -1
  194. package/dist/client/assets/{use-organization-roles-CYiD53yX.js → use-organization-roles-DshdakDm.js} +1 -1
  195. package/dist/client/assets/{use-organization-settings-a8PuTrsa.js → use-organization-settings-DNzEj3SY.js} +1 -1
  196. package/dist/client/assets/{use-registry-connections-DZ1G13oh.js → use-registry-connections-t5X0dgE2.js} +1 -1
  197. package/dist/client/assets/{use-secrets-GRgGPWUb.js → use-secrets-CdtjD3HA.js} +1 -1
  198. package/dist/client/assets/{use-status-sounds-DMne2oqE.js → use-status-sounds-SmT5_iKp.js} +1 -1
  199. package/dist/client/assets/{use-view-mode-CslUtkLV.js → use-view-mode-BCaeLPRd.js} +1 -1
  200. package/dist/client/assets/{use-virtual-mcp-OPb4DVO0.js → use-virtual-mcp-DTNF-w70.js} +1 -1
  201. package/dist/client/assets/useInfiniteQuery-Bziqv5Nz.js +1 -0
  202. package/dist/client/assets/{useQueries-BD3bwl6B.js → useQueries-B88iFaFv.js} +1 -1
  203. package/dist/client/assets/useSuspenseInfiniteQuery-Dx7jl2bl.js +1 -0
  204. package/dist/client/assets/variant-calendar-zBAnpIIP.js +1 -0
  205. package/dist/client/assets/{view-mode-toggle-k-q_tsqg.js → view-mode-toggle-dKl9f2N6.js} +1 -1
  206. package/dist/client/index.html +2 -2
  207. package/dist/server/cli.js +253 -206
  208. package/package.json +1 -1
  209. package/dist/client/assets/ai-providers-shPNJ0G8.js +0 -1
  210. package/dist/client/assets/app-editor-CASRPS-o.js +0 -1
  211. package/dist/client/assets/auth-split-layout-BO9g4lYZ.js +0 -1
  212. package/dist/client/assets/buckets-BJOevXCK.js +0 -1
  213. package/dist/client/assets/category-editor-Ci2DnrkV.js +0 -1
  214. package/dist/client/assets/collection-detail-BLwVko_9.js +0 -1
  215. package/dist/client/assets/commerce-onboarding-DpB8M1dk.js +0 -1
  216. package/dist/client/assets/connection-detail-BEiO-h95.js +0 -1
  217. package/dist/client/assets/connections-DJCB8L8S.js +0 -1
  218. package/dist/client/assets/file-explorer-DZMbkqJ0.js +0 -2
  219. package/dist/client/assets/general-C27Cwywq.js +0 -1
  220. package/dist/client/assets/index-BSzVFCV6.js +0 -26
  221. package/dist/client/assets/index-C6ZVo7HH.js +0 -1
  222. package/dist/client/assets/index-Cey8outX.js +0 -1
  223. package/dist/client/assets/index-D9MBRSbh.js +0 -1
  224. package/dist/client/assets/index-fHHzFvHF.css +0 -1
  225. package/dist/client/assets/page-seo-sheet-BsYTh7m4.js +0 -1
  226. package/dist/client/assets/post-editor-msU8kMVE.js +0 -1
  227. package/dist/client/assets/profile-Cq_Bww2z.js +0 -1
  228. package/dist/client/assets/project-app-view-DjSLRXjX.js +0 -1
  229. package/dist/client/assets/record-editor-SpOTRD39.js +0 -1
  230. package/dist/client/assets/registry-BYRguUOn.js +0 -2
  231. package/dist/client/assets/secrets-B2XOt0uB.js +0 -1
  232. package/dist/client/assets/select-DeFnLWdd.js +0 -1
  233. package/dist/client/assets/seo-editor-nfDAcvV7.js +0 -1
  234. package/dist/client/assets/sso-DFI00-8p.js +0 -1
  235. package/dist/client/assets/store-registry-DOL4KgkC.js +0 -2
  236. package/dist/client/assets/useInfiniteQuery-D-pnegbi.js +0 -1
  237. package/dist/client/assets/useSuspenseInfiniteQuery-_rNdlYkE.js +0 -1
  238. package/dist/client/assets/variant-calendar-DAwCBXUq.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "3.86.0",
3
+ "version": "3.87.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{z as B,C as N,aC as ae,aE as le,aF as he,aD as xe,b6 as me,c as U,F as ge,G as be,r as O,j as s,ae as Ee,t as Q,ad as ye,w as re,m as oe,d as J,K as G,k as ve,l as ue,B as V,s as je,E as Fe}from"./index-DILk6pqr.js";import{i as $e}from"./AlertCircle-qY5ngKLr.js";import{P as te}from"./index-D7pI5IpD.js";import{S as ne}from"./skeleton-DUdp3Kvb.js";import{b as _e,a as ce,S as de,c as Re}from"./settings-section-BXkrjyua.js";import{u as X,b as se,c as Se}from"./use-ai-providers-CVKwKs8r.js";import{i as Oe}from"./CheckCircle-CNYYpNQm.js";import{i as Me,j as Te,p as Ue,S as ze}from"./chat-context-SWJ_FDEf.js";import{d as qe,e as Le}from"./use-organization-settings-a8PuTrsa.js";import{M as Ve}from"./select-model-DmLcnpxY.js";import{u as Be}from"./use-debounced-autosave-OpSLLz7d.js";import{I as ie}from"./input-DntqEqec.js";import{a as fe,T as Ge}from"./toggle-group-C7SpEcqz.js";import{b as ke,c as Ie,d as Ce,A as Ne,a as Pe,e as we,g as De,f as Ae}from"./alert-dialog-D5KOx-3H.js";import{u as H}from"./studio-tools-DWzikkvB.js";import{s as Qe}from"./Plus-DfIcHYEj.js";import{b as Ye}from"./Tool01-hxrY31T7.js";import{s as We}from"./Trash01-DGJ-LjB-.js";import{A as He}from"./avatar-3b85MUU5.js";import{O as Ke,P as Je,C as pe}from"./decopilot-DBiOjpCq.js";import{b as Xe}from"./Settings02-Dd9sO-oW.js";import{s as Ze}from"./Eye-C6daRddp.js";import{e as et,D as tt,a as st,c as it,d as rt}from"./dialog-CwfeALzq.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-BlqPTqxe.js";import"./sidebar-D5TdEONj.js";import"./LayoutLeft-BsVzrTOG.js";import"./tooltip-DNJ6cRlV.js";import"./sheet-CgvO6KT7.js";import"./X-CXRx6PGX.js";import"./card-D0ElZuSJ.js";import"./ArrowUpRight-C7uYzZ0Z.js";import"./hooks-CLt3SUb8.js";import"./use-mcp-client-BdmHrvF5.js";import"./auth-B4fF5n_6.js";import"./decopilot-sse-pool-Cd7s5cwH.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-OPb4DVO0.js";import"./use-collections-D0HN84Lz.js";import"./tab-id-BptcWVWa.js";import"./drawer-_RQmWfAo.js";import"./connect-desktop-dialog-JUjDMHMz.js";import"./ChevronUp-CKICjFfX.js";import"./User01-DR_UC5XH.js";import"./checkbox-UCOb4UyX.js";import"./select-DeFnLWdd.js";import"./ChevronDown-BVJUps1_.js";import"./Key01-B0h1bFlR.js";import"./SearchMd-B6GaXN7Q.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-DAM-u2R2.js";import"./ChevronRight-MnjJHQHy.js";import"./Stars01-D3ha2IeY.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-OLvFRh1U.js";import"./access-gate-B_rz72ZQ.js";import"./capability-load-error-DmenvLwh.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Me(e),dt=e=>Te(e),mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],O.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=f):f=t[9];const k=f;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const $=y.keyId??m??"";S($),a({keyId:$,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(p=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function ft(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function pt(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Be(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==f?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),F={};c?.id&&(F[c.id]=j),u?.id&&(F[u.id]=_),g?.id&&(F[g.id]=f);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,F);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,$=g?.id;let M;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==$?(M=[o,t,j,_,f,p,y,$],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=f,e[25]=p,e[26]=y,e[27]=$,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const R=b&&!d;let D;e[30]!==S||e[31]!==R?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(ft,{isPending:S,showSaved:R})]}),e[30]=S,e[31]=R,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:F}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:F.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{F.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=O.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:yt,onError:bt}),[o,x]=O.useState(""),[S,b]=O.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(f=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,f,k]})}),e[22]=_,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=O.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const $=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let R;e[23]!==c?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=R):R=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[D,s.jsxs(we,{children:[A,s.jsx(De,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ae,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==p||e[33]!==$||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&&vt(p)),children:$}),e[32]=p,e[33]=$,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const F=h&&"animate-spin";let P;e[39]!==F?(P=ue(F),e[39]=F,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==R||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,E,Y,Z]})})}),e[54]=R,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:f}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:G.aiProviders(S.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:j(p=>I(p)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let f;return t[24]!==l||t[25]!==r||t[26]!==_?(f=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=f):f=t[27],f}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=O.useState(!1),[b,d]=O.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:G.aiProviders(r.id)}),o.invalidateQueries({queryKey:G.aiProviderModels(r.id,i.id)}),Q.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:At},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let $;t[18]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ye,{size:14})}),t[18]=$):$=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(!0),T=s.jsx(We,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let R;t[21]!==p?(R=s.jsxs("div",{className:"flex items-center gap-0.5",children:[$,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=R):R=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==R||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:R}),t[23]=_,t[24]=u,t[25]=R,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ne,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[v,s.jsx(De,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let F;t[38]!==E||t[39]!==w?(F=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=F):F=t[40];let P;t[41]!==x||t[42]!==F?(P=s.jsx(Ae,{open:x,onOpenChange:S,children:F}),t[41]=x,t[42]=F,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter($t).map(S).filter(Ft);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Qe,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function Ft(e){return e.provider!==void 0}function $t(e){return e.providerId!=="deco"}function Rt(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx($e,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Ot(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Mt),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=O.useState(!1),[x,S]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let f;e[5]!==n?(f=s.jsx(Je,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=$=>{$||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Mt(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Re,{children:[t,s.jsx(Fe,{fallback:Ut,children:s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Ot,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Rt,{error:t??new Error("Failed to load AI providers")})}function Bs(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Bs as default};
@@ -1 +0,0 @@
1
- import{c as ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-DILk6pqr.js";import{i as je}from"./ChevronRight-MnjJHQHy.js";import{S as ke}from"./scroll-area-CN3_YfBC.js";import{A as _e}from"./add-section-modal-ExcCDC5z.js";import{ao as Be,ap as we,aq as Ae,j as Ne,k as Re,ar as Ce,U as Ee,ab as Ke}from"./index-Yqaph2kh.js";import{S as Te}from"./save-status-DIZcxleS.js";import"./agent-icon-CKGTD-zQ.js";import"./AlertCircle-qY5ngKLr.js";import"./Tool01-hxrY31T7.js";import"./SwitchHorizontal01-CrHLIeRP.js";import"./Settings02-Dd9sO-oW.js";import"./XCircle-BLfqcVud.js";import"./ArrowUpRight-C7uYzZ0Z.js";import"./ZapSquare-iu6ldaYZ.js";import"./Users03-BZYHqQGQ.js";import"./CheckCircle-CNYYpNQm.js";import"./ChevronUp-CKICjFfX.js";import"./ChevronDown-BVJUps1_.js";import"./ChevronLeft-CCp89cqe.js";import"./DotsVertical-Bl5GcKp2.js";import"./Stars02-DHcW8N80.js";import"./Eye-C6daRddp.js";import"./ZoomOut-6aWLXLSs.js";import"./Globe01-CgHdNpOL.js";import"./FilterLines-B_0u5HAa.js";import"./Star01-Be_MjtDZ.js";import"./Globe04-DEangwXD.js";import"./HardDrive-V1dbAXdv.js";import"./Key01-B0h1bFlR.js";import"./LayoutLeft-BsVzrTOG.js";import"./LinkExternal01-B9RsD2Us.js";import"./Monitor01-DAM-u2R2.js";import"./Sun-DO_Gt4P2.js";import"./Palette-DT8p7ZEl.js";import"./Play-Blum-MoR.js";import"./Plus-DfIcHYEj.js";import"./SearchMd-B6GaXN7Q.js";import"./Shield01-DLANpVD0.js";import"./Stars01-D3ha2IeY.js";import"./Trash01-DGJ-LjB-.js";import"./Upload01-CzOJ3UuD.js";import"./User01-DR_UC5XH.js";import"./Users01-cxH39exM.js";import"./XClose-4ak3u3qT.js";import"./X-CXRx6PGX.js";import"./Zap-DVtX-UPi.js";import"./use-clock-tick-CWHp6nCX.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CuQAt0Vj.js";import"./tooltip-DNJ6cRlV.js";import"./file-type-icon-CdZyaTKH.js";import"./dialog-CwfeALzq.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CsHe6BgD.js";import"./use-mcp-client-BdmHrvF5.js";import"./auth-B4fF5n_6.js";import"./chat-context-SWJ_FDEf.js";import"./hooks-CLt3SUb8.js";import"./decopilot-sse-pool-Cd7s5cwH.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-OPb4DVO0.js";import"./use-collections-D0HN84Lz.js";import"./use-ai-providers-CVKwKs8r.js";import"./studio-tools-DWzikkvB.js";import"./use-organization-settings-a8PuTrsa.js";import"./shell-layout-DAyf8ZZZ.js";import"./avatar-3b85MUU5.js";import"./required-auth-layout-DdFOKjMd.js";import"./use-org-sso-DvlbibgX.js";import"./sheet-CgvO6KT7.js";import"./integration-icon-CxxjWIPp.js";import"./use-navigate-to-agent-Qyyx-mm9.js";import"./use-connection-Bj1m8ynL.js";import"./use-mcp-prompts-BwQLmLZi.js";import"./form-xYXw--Kt.js";import"./label-NJtv9Xrj.js";import"./input-DntqEqec.js";import"./select-DeFnLWdd.js";import"./index-CCbaPbk-.js";import"./drawer-_RQmWfAo.js";import"./collection-search-B-ZTg2tB.js";import"./tabs-CVnN0f33.js";import"./toggle-group-C7SpEcqz.js";import"./sortable.esm-DdDX2lbe.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-By0LggNB.js";import"./use-registry-connections-DZ1G13oh.js";import"./useInfiniteQuery-D-pnegbi.js";import"./use-infinite-scroll-CCIuAqs7.js";import"./extract-connection-data-qW230rJb.js";import"./card-D0ElZuSJ.js";import"./collection-tabs-7m5XLASC.js";import"./badge-CBy4Rm2Q.js";import"./textarea-Fs50NfWG.js";import"./connection-form-helpers-DeSC5iva.js";import"./authenticate-and-persist-oauth-D2tM_mGL.js";import"./mcp-oauth-BTUV7ht5.js";import"./useSuspenseInfiniteQuery-_rNdlYkE.js";import"./connect-desktop-dialog-JUjDMHMz.js";import"./decopilot-DBiOjpCq.js";import"./checkbox-UCOb4UyX.js";import"./skeleton-DUdp3Kvb.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BXkrjyua.js";import"./popover-DmLzbFpk.js";import"./command-CKe7nBfr.js";import"./index-Benu0NlA.js";import"./dropdown-menu-CppAWsT_.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DMne2oqE.js";import"./empty-state-CfAeMInj.js";import"./toolbar-Dp05iiiH.js";import"./preview-dialog-XKGBZobL.js";import"./index-uKLTzwtC.js";import"./use-mcp-tools-ChlFTYss.js";import"./use-capability-OLvFRh1U.js";import"./shell-route-loading-44H3A_LH.js";import"./index-C6ZVo7HH.js";import"./alert-dialog-D5KOx-3H.js";import"./switch-ZSF60LRT.js";import"./use-debounced-autosave-OpSLLz7d.js";import"./index-D7pI5IpD.js";import"./sidebar-D5TdEONj.js";import"./search-input-SieA9wsp.js";import"./github-repo-picker-B1nNLNvt.js";import"./use-secrets-GRgGPWUb.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-k-q_tsqg.js";import"./automation-runs-_FCeac3K.js";import"./table-CAdy-hg6.js";import"./use-members-9pMsaLP9.js";import"./use-org-auth-client-CtaccGLo.js";import"./task-status-CtOjrZ5U.js";import"./use-automations-Ca6VluJ_.js";import"./use-file-configs-aDA6u1U_.js";import"./monaco-editor-BS1tOSHv.js";import"./select-model-DmLcnpxY.js";import"./automation-list-row-BKx-xx1i.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function xr(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,G=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const J=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:Q,isPending:W}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const X=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const Y=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let U;e[34]!==c||e[35]!==Q||e[36]!==X?(U=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await X.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=Q,e[36]=X,e[37]=U):U=e[37];const y=U;let V;e[38]===Symbol.for("react.memo_cache_sentinel")?(V=t=>{P.current=t.append,re(!0)},e[38]=V):V=e[38];const ve=V;let I;e[39]!==y?(I=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=I):I=e[40];const le=I;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let j;e[48]!==W?(j=o.jsx(Te,{isPending:W,isError:!1}),e[48]=W,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==J||e[61]!==s||e[62]!==u||e[63]!==Y||e[64]!==h||e[65]!==G?(_=o.jsx(ke,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ke,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=J,e[61]=s,e[62]=u,e[63]=Y,e[64]=h,e[65]=G,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{xr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as o,j as i}from"./index-DILk6pqr.js";function f(r){const e=o.c(9),{children:c,visual:n}=r;let l;e[0]!==c?(l=i.jsx("section",{className:"flex flex-1 items-center justify-center bg-sidebar p-6 md:p-10",children:i.jsx("div",{className:"w-full max-w-[440px]",children:c})}),e[0]=c,e[1]=l):l=e[1];let s;e[2]!==n?(s=n??i.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[2]=n,e[3]=s):s=e[3];let t;e[4]!==s?(t=i.jsx("aside",{className:"relative hidden md:flex flex-1 overflow-hidden bg-muted",children:s}),e[4]=s,e[5]=t):t=e[5];let a;return e[6]!==l||e[7]!==t?(a=i.jsxs("main",{className:"flex min-h-screen w-full",children:[l,t]}),e[6]=l,e[7]=t,e[8]=a):a=e[8],a}export{f as A};
@@ -1 +0,0 @@
1
- import{c as D,j as t,E as V,r as v,B as F,t as _}from"./index-DILk6pqr.js";import{i as J}from"./AlertCircle-qY5ngKLr.js";import{i as O}from"./HardDrive-V1dbAXdv.js";import{s as L}from"./Plus-DfIcHYEj.js";import{s as Q}from"./Trash01-DGJ-LjB-.js";import{A as X,g as Y,c as Z,b as ee,d as te,e as se,a as ie,f as re}from"./alert-dialog-D5KOx-3H.js";import{d as ne,c as le,D as ae,a as oe,b as ce,e as de}from"./dialog-CwfeALzq.js";import{I as N}from"./input-DntqEqec.js";import{L as C}from"./label-NJtv9Xrj.js";import{d as me,b as ue,c as fe,S as pe,a as q}from"./select-DeFnLWdd.js";import{S as xe}from"./switch-ZSF60LRT.js";import{S as he}from"./skeleton-DUdp3Kvb.js";import{T as ge}from"./textarea-Fs50NfWG.js";import{P}from"./index-D7pI5IpD.js";import{c as je}from"./settings-section-BXkrjyua.js";import{u as ye,b as be,c as ve}from"./use-file-configs-aDA6u1U_.js";import{R as Se}from"./require-capability-BlqPTqxe.js";import"./X-CXRx6PGX.js";import"./tooltip-DNJ6cRlV.js";import"./ChevronUp-CKICjFfX.js";import"./ChevronDown-BVJUps1_.js";import"./sidebar-D5TdEONj.js";import"./LayoutLeft-BsVzrTOG.js";import"./sheet-CgvO6KT7.js";import"./card-D0ElZuSJ.js";import"./ArrowUpRight-C7uYzZ0Z.js";import"./studio-tools-DWzikkvB.js";import"./use-capability-OLvFRh1U.js";import"./access-gate-B_rz72ZQ.js";import"./capability-load-error-DmenvLwh.js";function Ce(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function ke(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(J,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function Ne(s){const e=D.c(44),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx(O,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.credentialType?(o=i.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):i.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"Managed"}):null,e[3]=i.credentialType,e[4]=o):o=e[4];let g;e[5]!==i.bucket||e[6]!==i.region?(g=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[5]=i.bucket,e[6]=i.region,e[7]=g):g=e[7];let c;e[8]!==l||e[9]!==o||e[10]!==g?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o,g]}),e[8]=l,e[9]=o,e[10]=g,e[11]=c):c=e[11];let b;e[12]!==i.description?(b=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[12]=i.description,e[13]=b):b=e[13];let j;e[14]!==i.endpoint||e[15]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[14]=i.endpoint,e[15]=i.forcePathStyle,e[16]=j):j=e[16];let d;e[17]!==i.prefix?(d=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[17]=i.prefix,e[18]=d):d=e[18];let m;e[19]!==i.publicUrlBase?(m=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[19]=i.publicUrlBase,e[20]=m):m=e[20];let y;e[21]!==c||e[22]!==b||e[23]!==j||e[24]!==d||e[25]!==m?(y=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[c,b,j,d,m]})]}),e[21]=c,e[22]=b,e[23]=j,e[24]=d,e[25]=m,e[26]=y):y=e[26];let f;e[27]!==i.createdAt?(f=new Date(i.createdAt).toLocaleDateString(),e[27]=i.createdAt,e[28]=f):f=e[28];let u;e[29]!==f?(u=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[29]=f,e[30]=u):u=e[30];let p;e[31]!==i||e[32]!==n?(p=()=>n(i),e[31]=i,e[32]=n,e[33]=p):p=e[33];const x=`Delete ${i.name}`;let h;e[34]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Q,{size:14}),e[34]=h):h=e[34];let k;e[35]!==p||e[36]!==x?(k=t.jsx(F,{variant:"ghost",size:"sm",onClick:p,"aria-label":x,children:h}),e[35]=p,e[36]=x,e[37]=k):k=e[37];let S;e[38]!==u||e[39]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,k]}),e[38]=u,e[39]=k,e[40]=S):S=e[40];let A;return e[41]!==y||e[42]!==S?(A=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[y,S]}),e[41]=y,e[42]=S,e[43]=A):A=e[43],A}function Ae(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx(O,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(L,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[n,r,t.jsxs(F,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function K({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,g]=v.useState(""),[c,b]=v.useState(""),[j,d]=v.useState(""),[m,y]=v.useState(!1),[f,u]=v.useState(""),[p,x]=v.useState(""),[h,k]=v.useState("static"),[S,A]=v.useState(""),[R,I]=v.useState(""),[T,U]=v.useState(""),[B,E]=v.useState(""),w=be();function $(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),E("")}const z=h==="sts-session"?!!(T.trim()&&B.trim()):!!(S&&R);async function M(a){if(a.preventDefault(),!i.trim()||!o.trim()||!c.trim()||!z)return;const W=h==="sts-session"?{credentialType:"sts-session",refreshUrl:T.trim(),apiKey:B.trim()}:{credentialType:"static",accessKeyId:S,secretAccessKey:R};try{await w.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:c.trim(),endpoint:j.trim()||void 0,forcePathStyle:m,prefix:f.trim()||void 0,publicUrlBase:p.trim()||void 0,...W}),_.success(`Bucket "${i.trim()}" added`),$(),e(!1)}catch(H){_.error(Ce(H,"Failed to add bucket"))}}const G=w.isPending||!i.trim()||!o.trim()||!c.trim()||!z;return t.jsx(ne,{open:s,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(ae,{children:[t.jsx(oe,{children:"Add S3 bucket"}),t.jsx(ce,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:M,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:a=>n(a.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:a=>g(a.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:c,onChange:a=>b(a.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:j,onChange:a=>d(a.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(C,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(xe,{id:"file-config-path-style",checked:m,onCheckedChange:y})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:f,onChange:a=>u(a.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:p,onChange:a=>x(a.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-credential-type",children:"Credentials"}),t.jsxs(me,{value:h,onValueChange:a=>k(a),children:[t.jsx(ue,{id:"file-config-credential-type",className:"w-full",children:t.jsx(fe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:"Static key pair (long-lived)"}),t.jsx(q,{value:"sts-session",children:"Temporary session (STS, auto-refreshed)"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:h==="sts-session"?"Stores only a refresh endpoint + API key; short-lived credentials are fetched on demand and refreshed automatically.":"A long-lived access key ID and secret, used as-is."})]}),h==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:S,onChange:a=>A(a.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:R,onChange:a=>I(a.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-refresh-url",children:"Refresh URL"}),t.jsx(N,{id:"file-config-refresh-url",type:"url",value:T,onChange:a=>U(a.target.value),placeholder:"https://admin.example.com/api/acme/s3-credentials",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Endpoint POSTed (with the API key below) to vend temporary credentials. Must return accessKeyId, secretAccessKey, sessionToken, and expiration."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-api-key",children:"API key"}),t.jsx(N,{id:"file-config-api-key",type:"password",value:B,onChange:a=>E(a.target.value),autoComplete:"new-password",required:!0}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent as the ",t.jsx("code",{children:"x-api-key"})," header on each refresh call."]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(ge,{id:"file-config-description",value:r,onChange:a=>l(a.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(de,{children:[t.jsx(F,{type:"button",variant:"outline",onClick:()=>{$(),e(!1)},disabled:w.isPending,children:"Cancel"}),t.jsx(F,{type:"submit",disabled:G,children:w.isPending?"Adding…":"Add bucket"})]})]})]})})}function De(s){const e=D.c(25),{config:i,onClose:n}=s,r=ve();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),_.success(`Bucket "${i.name}" removed`),n()}catch(k){const S=k;_.error(S instanceof Error?S.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,g=i!==null;let c;e[4]!==n?(c=h=>!h&&n(),e[4]=n,e[5]=c):c=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Z,{children:"Remove bucket configuration?"}),e[6]=b):b=e[6];const j=i?.name;let d;e[7]!==j?(d=t.jsxs(ee,{children:[b,t.jsxs(te,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:j}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=j,e[8]=d):d=e[8];let m;e[9]!==r.isPending?(m=t.jsx(X,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=m):m=e[10];const y=r.isPending?"Removing…":"Remove";let f;e[11]!==r.isPending||e[12]!==o||e[13]!==y?(f=t.jsx(Y,{onClick:o,disabled:r.isPending,children:y}),e[11]=r.isPending,e[12]=o,e[13]=y,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=t.jsxs(se,{children:[m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let p;e[18]!==u||e[19]!==d?(p=t.jsxs(ie,{children:[d,u]}),e[18]=u,e[19]=d,e[20]=p):p=e[20];let x;return e[21]!==p||e[22]!==g||e[23]!==c?(x=t.jsx(re,{open:g,onOpenChange:c,children:p}),e[21]=p,e[22]=g,e[23]=c,e[24]=x):x=e[24],x}function Fe(){const s=D.c(25),e=ye(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let x;s[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ae,{onCreate:()=>n(!0)}),s[0]=x):x=s[0];let h;return s[1]!==i?(h=t.jsxs(t.Fragment,{children:[x,t.jsx(K,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=h):h=s[2],h}const o=e.length===1?"":"s";let g;s[3]!==e.length||s[4]!==o?(g=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=g):g=s[5];let c;s[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n(!0),s[6]=c):c=s[6];let b;s[7]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(F,{onClick:c,size:"sm",children:[t.jsx(L,{size:14}),"Add bucket"]}),s[7]=b):b=s[7];let j;s[8]!==g?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[g,b]}),s[8]=g,s[9]=j):j=s[9];let d;if(s[10]!==e){let x;s[12]===Symbol.for("react.memo_cache_sentinel")?(x=h=>t.jsx(Ne,{config:h,onDelete:l},h.id),s[12]=x):x=s[12],d=e.map(x),s[10]=e,s[11]=d}else d=s[11];let m;s[13]!==d?(m=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:d})}),s[13]=d,s[14]=m):m=s[14];let y;s[15]!==i?(y=t.jsx(K,{open:i,onOpenChange:n}),s[15]=i,s[16]=y):y=s[16];let f;s[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),s[17]=f):f=s[17];let u;s[18]!==r?(u=t.jsx(De,{config:r,onClose:f}),s[18]=r,s[19]=u):u=s[19];let p;return s[20]!==j||s[21]!==m||s[22]!==y||s[23]!==u?(p=t.jsxs(t.Fragment,{children:[j,m,y,u]}),s[20]=j,s[21]=m,s[22]=y,s[23]=u,s[24]=p):p=s[24],p}function we(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(P.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(P,{children:t.jsx(P.Content,{children:t.jsx(P.Body,{children:t.jsxs(je,{children:[e,t.jsx(V,{fallback:Pe,children:t.jsx(v.Suspense,{fallback:t.jsx(he,{className:"h-32 w-full"}),children:t.jsx(Fe,{})})})]})})})}),s[1]=i):i=s[1],i}function Pe(s){const{error:e}=s;return t.jsx(ke,{error:e??new Error("Failed to load file configs")})}function at(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Se,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),s[0]=e):e=s[0],e}export{at as default};
@@ -1 +0,0 @@
1
- import{c as st,j as e,B as mt}from"./index-DILk6pqr.js";import{i as lt}from"./XCircle-BLfqcVud.js";import{U as pt}from"./agent-icon-CKGTD-zQ.js";import{I as tt}from"./input-DntqEqec.js";import{L as et}from"./label-NJtv9Xrj.js";import{as as at,at as nt,aB as ct,au as ft}from"./index-Yqaph2kh.js";import{u as dt,s as M,I as gt}from"./primitives-pW0ukQfP.js";import{S as ut}from"./save-status-DIZcxleS.js";import{a as xt,B as ht,b as yt}from"./block-document-BFMWdkuR.js";import"./AlertCircle-qY5ngKLr.js";import"./Tool01-hxrY31T7.js";import"./SwitchHorizontal01-CrHLIeRP.js";import"./Settings02-Dd9sO-oW.js";import"./ArrowUpRight-C7uYzZ0Z.js";import"./ZapSquare-iu6ldaYZ.js";import"./Users03-BZYHqQGQ.js";import"./CheckCircle-CNYYpNQm.js";import"./ChevronUp-CKICjFfX.js";import"./ChevronDown-BVJUps1_.js";import"./ChevronLeft-CCp89cqe.js";import"./ChevronRight-MnjJHQHy.js";import"./DotsVertical-Bl5GcKp2.js";import"./Stars02-DHcW8N80.js";import"./Eye-C6daRddp.js";import"./ZoomOut-6aWLXLSs.js";import"./Globe01-CgHdNpOL.js";import"./FilterLines-B_0u5HAa.js";import"./Star01-Be_MjtDZ.js";import"./Globe04-DEangwXD.js";import"./HardDrive-V1dbAXdv.js";import"./Key01-B0h1bFlR.js";import"./LayoutLeft-BsVzrTOG.js";import"./LinkExternal01-B9RsD2Us.js";import"./Monitor01-DAM-u2R2.js";import"./Sun-DO_Gt4P2.js";import"./Palette-DT8p7ZEl.js";import"./Play-Blum-MoR.js";import"./Plus-DfIcHYEj.js";import"./SearchMd-B6GaXN7Q.js";import"./Shield01-DLANpVD0.js";import"./Stars01-D3ha2IeY.js";import"./Trash01-DGJ-LjB-.js";import"./Upload01-CzOJ3UuD.js";import"./User01-DR_UC5XH.js";import"./Users01-cxH39exM.js";import"./XClose-4ak3u3qT.js";import"./X-CXRx6PGX.js";import"./Zap-DVtX-UPi.js";import"./index-CCbaPbk-.js";import"./chat-context-SWJ_FDEf.js";import"./hooks-CLt3SUb8.js";import"./use-mcp-client-BdmHrvF5.js";import"./auth-B4fF5n_6.js";import"./decopilot-sse-pool-Cd7s5cwH.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-OPb4DVO0.js";import"./use-collections-D0HN84Lz.js";import"./use-ai-providers-CVKwKs8r.js";import"./studio-tools-DWzikkvB.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-a8PuTrsa.js";import"./scroll-area-CN3_YfBC.js";import"./use-clock-tick-CWHp6nCX.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CuQAt0Vj.js";import"./tooltip-DNJ6cRlV.js";import"./file-type-icon-CdZyaTKH.js";import"./dialog-CwfeALzq.js";import"./content-blocks-o63cs2vh.js";import"./types-CsHe6BgD.js";import"./shell-layout-DAyf8ZZZ.js";import"./avatar-3b85MUU5.js";import"./required-auth-layout-DdFOKjMd.js";import"./use-org-sso-DvlbibgX.js";import"./sheet-CgvO6KT7.js";import"./integration-icon-CxxjWIPp.js";import"./use-navigate-to-agent-Qyyx-mm9.js";import"./use-connection-Bj1m8ynL.js";import"./use-mcp-prompts-BwQLmLZi.js";import"./form-xYXw--Kt.js";import"./select-DeFnLWdd.js";import"./drawer-_RQmWfAo.js";import"./collection-search-B-ZTg2tB.js";import"./tabs-CVnN0f33.js";import"./toggle-group-C7SpEcqz.js";import"./sortable.esm-DdDX2lbe.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-By0LggNB.js";import"./use-registry-connections-DZ1G13oh.js";import"./useInfiniteQuery-D-pnegbi.js";import"./use-infinite-scroll-CCIuAqs7.js";import"./extract-connection-data-qW230rJb.js";import"./card-D0ElZuSJ.js";import"./collection-tabs-7m5XLASC.js";import"./badge-CBy4Rm2Q.js";import"./textarea-Fs50NfWG.js";import"./connection-form-helpers-DeSC5iva.js";import"./authenticate-and-persist-oauth-D2tM_mGL.js";import"./mcp-oauth-BTUV7ht5.js";import"./useSuspenseInfiniteQuery-_rNdlYkE.js";import"./connect-desktop-dialog-JUjDMHMz.js";import"./decopilot-DBiOjpCq.js";import"./checkbox-UCOb4UyX.js";import"./skeleton-DUdp3Kvb.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BXkrjyua.js";import"./popover-DmLzbFpk.js";import"./command-CKe7nBfr.js";import"./index-Benu0NlA.js";import"./dropdown-menu-CppAWsT_.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-DMne2oqE.js";import"./empty-state-CfAeMInj.js";import"./toolbar-Dp05iiiH.js";import"./preview-dialog-XKGBZobL.js";import"./index-uKLTzwtC.js";import"./use-mcp-tools-ChlFTYss.js";import"./use-capability-OLvFRh1U.js";import"./shell-route-loading-44H3A_LH.js";import"./index-C6ZVo7HH.js";import"./alert-dialog-D5KOx-3H.js";import"./switch-ZSF60LRT.js";import"./use-debounced-autosave-OpSLLz7d.js";import"./index-D7pI5IpD.js";import"./sidebar-D5TdEONj.js";import"./search-input-SieA9wsp.js";import"./github-repo-picker-B1nNLNvt.js";import"./use-secrets-GRgGPWUb.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-k-q_tsqg.js";import"./automation-runs-_FCeac3K.js";import"./table-CAdy-hg6.js";import"./use-members-9pMsaLP9.js";import"./use-org-auth-client-CtaccGLo.js";import"./task-status-CtOjrZ5U.js";import"./use-automations-Ca6VluJ_.js";import"./use-file-configs-aDA6u1U_.js";import"./monaco-editor-BS1tOSHv.js";import"./select-model-DmLcnpxY.js";import"./automation-list-row-BKx-xx1i.js";function Yi(it){const t=st.c(87),{orgSlug:l,virtualMcpId:p,branch:a,blockKey:z,block:G,decofile:H,meta:O,onManagePosts:Q}=it;let F;t[0]!==a||t[1]!==l||t[2]!==p?(F={orgSlug:l,virtualMcpId:p,branch:a},t[0]=a,t[1]=l,t[2]=p,t[3]=F):F=t[3];const m=at(F);let U;t[4]!==G?(U=nt(G,"categories"),t[4]=G,t[5]=U):U=t[5];const ot=U;let D;t[6]!==z||t[7]!==m?(D=o=>{m.mutate({blockKey:z,data:ft(z,"categories",o)})},t[6]=z,t[7]=m,t[8]=D):D=t[8];const[i,V]=dt(ot,D);let L;t[9]!==i||t[10]!==V?(L=(o,rt)=>V({...i,[o]:rt}),t[9]=i,t[10]=V,t[11]=L):L=t[11];const r=L;let s,R;t[12]!==i.slug||t[13]!==H?(s=M(i.slug),R=s?ct(H).filter(o=>o.categorySlugs.includes(s)).length:0,t[12]=i.slug,t[13]=H,t[14]=s,t[15]=R):(s=t[14],R=t[15]);const T=R;let n;t[16]!==i.name?(n=M(i.name)||"Untitled category",t[16]=i.name,t[17]=n):n=t[17];let c;t[18]!==n?(c=e.jsx("span",{className:"truncate text-sm font-medium",children:n}),t[18]=n,t[19]=c):c=t[19];let f;t[20]!==m.isError||t[21]!==m.isPending?(f=e.jsx(ut,{isPending:m.isPending,isError:m.isError}),t[20]=m.isError,t[21]=m.isPending,t[22]=f):f=t[22];let d;t[23]!==c||t[24]!==f?(d=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[c,f]}),t[23]=c,t[24]=f,t[25]=d):d=t[25];let g;t[26]!==i.name?(g=M(i.name),t[26]=i.name,t[27]=g):g=t[27];let u;t[28]!==r?(u=o=>r("name",o),t[28]=r,t[29]=u):u=t[29];let x;t[30]!==g||t[31]!==u?(x=e.jsx(gt,{value:g,onChange:u,placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t[30]=g,t[31]=u,t[32]=x):x=t[32];let $;t[33]===Symbol.for("react.memo_cache_sentinel")?($=e.jsx(et,{htmlFor:"category-slug",children:"Slug"}),t[33]=$):$=t[33];let h;t[34]!==i.slug?(h=M(i.slug),t[34]=i.slug,t[35]=h):h=t[35];let y;t[36]!==r?(y=o=>r("slug",o.target.value),t[36]=r,t[37]=y):y=t[37];let j;t[38]!==h||t[39]!==y?(j=e.jsxs("div",{className:"mt-4 space-y-2",children:[$,e.jsx(tt,{id:"category-slug",value:h,onChange:y,placeholder:"my-category",className:"h-10"})]}),t[38]=h,t[39]=y,t[40]=j):j=t[40];let A;t[41]===Symbol.for("react.memo_cache_sentinel")?(A=e.jsx(et,{htmlFor:"category-description",children:"Description"}),t[41]=A):A=t[41];let b;t[42]!==i.description?(b=M(i.description),t[42]=i.description,t[43]=b):b=t[43];let v;t[44]!==r?(v=o=>r("description",o.target.value),t[44]=r,t[45]=v):v=t[45];let N;t[46]!==b||t[47]!==v?(N=e.jsxs("div",{className:"mt-4 space-y-2",children:[A,e.jsx(tt,{id:"category-description",value:b,onChange:v,placeholder:"Short description for this category",className:"h-10"})]}),t[46]=b,t[47]=v,t[48]=N):N=t[48];let J;t[49]===Symbol.for("react.memo_cache_sentinel")?(J=e.jsx(pt,{size:16,className:"shrink-0 text-muted-foreground"}),t[49]=J):J=t[49];const X=T===1?"post":"posts";let S;t[50]!==T||t[51]!==X?(S=e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[J,e.jsxs("span",{className:"text-sm",children:[T," ",X," in this category"]})]}),t[50]=T,t[51]=X,t[52]=S):S=t[52];const Y=!s,Z=s?"Jump to the posts list filtered by this category":"Set a slug to manage this category's posts";let B;t[53]!==Q||t[54]!==s?(B=()=>Q(s),t[53]=Q,t[54]=s,t[55]=B):B=t[55];let K;t[56]===Symbol.for("react.memo_cache_sentinel")?(K=e.jsx(lt,{size:14}),t[56]=K):K=t[56];let k;t[57]!==Y||t[58]!==Z||t[59]!==B?(k=e.jsxs(mt,{type:"button",variant:"outline",size:"sm",disabled:Y,title:Z,onClick:B,children:["Manage posts",K]}),t[57]=Y,t[58]=Z,t[59]=B,t[60]=k):k=t[60];let _;t[61]!==S||t[62]!==k?(_=e.jsxs("div",{className:"mt-6 flex items-center justify-between gap-3 rounded-lg border bg-muted/30 px-4 py-3",children:[S,k]}),t[61]=S,t[62]=k,t[63]=_):_=t[63];let W;t[64]===Symbol.for("react.memo_cache_sentinel")?(W=e.jsx("div",{className:"mt-6 border-t"}),t[64]=W):W=t[64];let C;t[65]!==i.sections?(C=xt(i.sections),t[65]=i.sections,t[66]=C):C=t[66];let P;t[67]!==r?(P=o=>r("sections",o),t[67]=r,t[68]=P):P=t[68];let E;t[69]!==O||t[70]!==C||t[71]!==P?(E=e.jsx(ht,{value:C,onChange:P,meta:O,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."}),t[69]=O,t[70]=C,t[71]=P,t[72]=E):E=t[72];let w;t[73]!==x||t[74]!==j||t[75]!==N||t[76]!==_||t[77]!==E?(w=e.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-3xl px-8 py-8",children:[x,j,N,_,W,E]})}),t[73]=x,t[74]=j,t[75]=N,t[76]=_,t[77]=E,t[78]=w):w=t[78];let I;t[79]!==w||t[80]!==d?(I=e.jsxs("div",{className:"flex h-full flex-col",children:[d,w]}),t[79]=w,t[80]=d,t[81]=I):I=t[81];let q;return t[82]!==a||t[83]!==l||t[84]!==I||t[85]!==p?(q=e.jsx(yt,{orgSlug:l,virtualMcpId:p,branch:a,children:I}),t[82]=a,t[83]=l,t[84]=I,t[85]=p,t[86]=q):q=t[86],q}export{Yi as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as y,j as t,B as F,i as X,z as Ge,C as se,E as Pe,r as T,w as ie,G as Qe,l as V,bf as Ye,u as Xe,y as G,t as Ze,e as ae,b1 as ke}from"./index-DILk6pqr.js";import{E as Ee}from"./empty-state-CfAeMInj.js";import{u as et,a as Ae}from"./use-collections-D0HN84Lz.js";import{u as ce}from"./use-mcp-client-BdmHrvF5.js";import{F as ne,a as tt,b as de,d as me}from"./form-xYXw--Kt.js";import{I as ue}from"./input-DntqEqec.js";import{T as re}from"./textarea-Fs50NfWG.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-BSzVFCV6.js";import{ag as rt,x as it,a5 as at,ah as ct,a1 as dt,ai as mt,M as be}from"./agent-icon-CKGTD-zQ.js";import{g as ut,M as xt,a as Ne}from"./types-CsHe6BgD.js";import{A as pt,a as ft,b as ht}from"./alert-DIaLGkVq.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-DeFnLWdd.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-DNJ6cRlV.js";import{i as jt}from"./AlertCircle-qY5ngKLr.js";import{s as bt}from"./Stars02-DHcW8N80.js";import{a as Nt}from"./Eye-C6daRddp.js";import{i as vt}from"./Play-Blum-MoR.js";import{i as St}from"./ChevronRight-MnjJHQHy.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-C6ZVo7HH.js";import{a as Oe,u as Re}from"./use-connection-Bj1m8ynL.js";import{a as It}from"./use-mcp-tools-ChlFTYss.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-CxxjWIPp.js";import{f as Tt,h as Pt}from"./chat-context-SWJ_FDEf.js";import{b as kt}from"./shell-layout-DAyf8ZZZ.js";import{M as Et}from"./monaco-editor-BS1tOSHv.js";import{n as At}from"./XCircle-BLfqcVud.js";import"./auth-B4fF5n_6.js";import"./label-NJtv9Xrj.js";import"./index-D7pI5IpD.js";import"./sidebar-D5TdEONj.js";import"./LayoutLeft-BsVzrTOG.js";import"./sheet-CgvO6KT7.js";import"./X-CXRx6PGX.js";import"./ZoomOut-6aWLXLSs.js";import"./Key01-B0h1bFlR.js";import"./extract-connection-data-qW230rJb.js";import"./use-registry-connections-DZ1G13oh.js";import"./use-organization-settings-a8PuTrsa.js";import"./studio-tools-DWzikkvB.js";import"./Plus-DfIcHYEj.js";import"./index-CLz5uOtD.js";import"./index-Benu0NlA.js";import"./popover-DmLzbFpk.js";import"./use-virtual-mcp-OPb4DVO0.js";import"./ChevronUp-CKICjFfX.js";import"./SearchMd-B6GaXN7Q.js";import"./Users03-BZYHqQGQ.js";import"./use-create-virtual-mcp-Cxqyw0Tn.js";import"./use-navigate-to-agent-Qyyx-mm9.js";import"./Tool01-hxrY31T7.js";import"./SwitchHorizontal01-CrHLIeRP.js";import"./Settings02-Dd9sO-oW.js";import"./ArrowUpRight-C7uYzZ0Z.js";import"./ZapSquare-iu6ldaYZ.js";import"./CheckCircle-CNYYpNQm.js";import"./ChevronDown-BVJUps1_.js";import"./ChevronLeft-CCp89cqe.js";import"./DotsVertical-Bl5GcKp2.js";import"./Globe01-CgHdNpOL.js";import"./FilterLines-B_0u5HAa.js";import"./Star01-Be_MjtDZ.js";import"./Globe04-DEangwXD.js";import"./HardDrive-V1dbAXdv.js";import"./LinkExternal01-B9RsD2Us.js";import"./Monitor01-DAM-u2R2.js";import"./Sun-DO_Gt4P2.js";import"./Palette-DT8p7ZEl.js";import"./Shield01-DLANpVD0.js";import"./Stars01-D3ha2IeY.js";import"./Trash01-DGJ-LjB-.js";import"./Upload01-CzOJ3UuD.js";import"./User01-DR_UC5XH.js";import"./Users01-cxH39exM.js";import"./XClose-4ak3u3qT.js";import"./Zap-DVtX-UPi.js";import"./mcp-oauth-BTUV7ht5.js";import"./badge-CBy4Rm2Q.js";import"./hooks-CLt3SUb8.js";import"./decopilot-sse-pool-Cd7s5cwH.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CVKwKs8r.js";import"./tab-id-BptcWVWa.js";import"./avatar-3b85MUU5.js";import"./dialog-CwfeALzq.js";import"./required-auth-layout-DdFOKjMd.js";import"./use-org-sso-DvlbibgX.js";import"./index-uKLTzwtC.js";function Ot(s){const e=y.c(15),{onSave:o,onUndo:n,isDirty:l,isSaving:r,saveLabel:a,undoLabel:c}=s,i=a===void 0?"Save":a,u=c===void 0?"Undo":c;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rt,{size:14}),e[0]=x):x=e[0];let m;e[1]!==r||e[2]!==n||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:n,disabled:r,"aria-label":u,children:[x,u]}),e[1]=r,e[2]=n,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(X,{size:14,className:"animate-spin"}):t.jsx(it,{size:14}),e[5]=r,e[6]=p):p=e[6];let f;e[7]!==r||e[8]!==o||e[9]!==i||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:o,disabled:r,"aria-label":i,children:[p,i]}),e[7]=r,e[8]=o,e[9]=i,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:se().min(1),description:se().nullable(),body:se()});function le(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Rt(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(n=>n==="mcps"),o=e>=0?s[e+1]:void 0;return o?decodeURIComponent(o):void 0}function _t(s){const e=y.c(13),{form:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=n):n=e[0];let l;e[1]!==o.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[n,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(ne,{control:o.control,name:"title",render:Dt}),t.jsx(ne,{control:o.control,name:"description",render:zt})]})]}),e[1]=o.control,e[2]=l):l=e[2];let r,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),a=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=r,e[4]=a):(r=e[3],a=e[4]);let c;e[5]!==o.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[r,a,t.jsx(ne,{control:o.control,name:"body",render:Mt})]}),e[5]=o.control,e[6]=c):c=e[6];let i;e[7]!==l||e[8]!==c?(i=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,c]}),e[7]=l,e[8]=c,e[9]=i):i=e[9];let u;return e[10]!==o||e[11]!==i?(u=t.jsx(tt,{...o,children:i}),e[10]=o,e[11]=i,e[12]=u):u=e[12],u}function Mt(s){const{field:e}=s;return t.jsx(de,{children:t.jsx(me,{children:t.jsx(re,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function zt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(me,{children:t.jsx(ue,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(de,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(me,{children:t.jsx(ue,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Lt(s){const e=y.c(36),{providerId:o,promptId:n}=s,{org:l}=ie(),r=o||null;let a;e[0]!==l.id||e[1]!==l.slug||e[2]!==r?(a={connectionId:r,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=r,e[3]=a):a=e[3];const c=ce(a),i=et(o,"PROMPT",n,c),u=Ae(o,"PROMPT",c),x=u.update.isPending;let m;e[4]!==i?(m=i?{title:i.title,description:i.description??null,body:le(i)}:void 0,e[4]=i,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==i?(g=()=>{i&&f.reset({title:i.title,description:i.description??null,body:le(i)})},e[8]=f,e[9]=i,e[10]=g):g=e[10];const S=g;let I;e[11]!==u.update||e[12]!==f||e[13]!==n?(I=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:n,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:le(A)})}),e[11]=u.update,e[12]=f,e[13]=n,e[14]=I):I=e[14];const R=I;if(!i){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let $;e[16]!==i.title?($=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[16]=i.title,e[17]=$):$=e[17];let E;e[18]!==i.description?(E=i.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:i.description})]}):null,e[18]=i.description,e[19]=E):E=e[19];let P;e[20]!==$||e[21]!==E?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,E]})}),e[20]=$,e[21]=E,e[22]=P):P=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let w;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(w=t.jsx(st,{children:t.jsx(Ot,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=w):w=e[29];let C;e[30]!==f?(C=t.jsx("div",{className:"h-full",children:t.jsx(_t,{form:f})}),e[30]=f,e[31]=C):C=e[31];let k;return e[32]!==w||e[33]!==C||e[34]!==P?(k=t.jsxs(xe,{children:[P,w,C]}),e[32]=w,e[33]=C,e[34]=P,e[35]=k):k=e[35],k}function Ut(s){const e=y.c(4),{itemId:o}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Rt(),e[0]=n):n=e[0];const l=n;if(!l){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let r;return e[2]!==o?(r=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:null,children:t.jsx(Lt,{providerId:l,promptId:o})})}),e[2]=o,e[3]=r):r=e[3],r}function _e(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("min-w-0 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Me(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("ol",{"data-slot":"breadcrumb-list",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function q(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("inline-flex items-center gap-1.5 min-w-0",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("li",{"data-slot":"breadcrumb-item",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Q(s){const e=y.c(10);let o,n,l;e[0]!==s?({asChild:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);const r=o?Ye:"a";let a;e[4]!==n?(a=V("hover:text-foreground transition-colors truncate",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==a?(c=t.jsx(r,{"data-slot":"breadcrumb-link",className:a,...l}),e[6]=r,e[7]=l,e[8]=a,e[9]=c):c=e[9],c}function ze(s){const e=y.c(8);let o,n;e[0]!==s?({className:o,...n}=s,e[0]=s,e[1]=o,e[2]=n):(o=e[1],n=e[2]);let l;e[3]!==o?(l=V("text-foreground font-medium truncate",o),e[3]=o,e[4]=l):l=e[4];let r;return e[5]!==n||e[6]!==l?(r=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l,...n}),e[5]=n,e[6]=l,e[7]=r):r=e[7],r}function Y(s){const e=y.c(12);let o,n,l;e[0]!==s?({children:o,className:n,...l}=s,e[0]=s,e[1]=o,e[2]=n,e[3]=l):(o=e[1],n=e[2],l=e[3]);let r;e[4]!==n?(r=V("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",n),e[4]=n,e[5]=r):r=e[5];let a;e[6]!==o?(a=o??t.jsx(St,{}),e[6]=o,e[7]=a):a=e[7];let c;return e[8]!==l||e[9]!==r||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:r,...l,children:a}),e[8]=l,e[9]=r,e[10]=a,e[11]=c):c=e[11],c}const Bt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ft(s){const e=y.c(11),{toolName:o,connectionId:n,siblings:l,onSelectInstance:r,onBack:a}=s;let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const i=wt(c);if(!i.isAuthenticated){let m;return e[2]!==i.supportsOAuth||e[3]!==a?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:i.supportsOAuth?t.jsx(ot,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(lt,{hasReadme:!1})}),e[2]=i.supportsOAuth,e[3]=a,e[4]=m):m=e[4],m}const u=`${n}:${o}`;let x;return e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==u||e[9]!==o?(x=t.jsx(Vt,{toolName:o,connectionId:n,siblings:l,onSelectInstance:r},u),e[5]=n,e[6]=r,e[7]=l,e[8]=u,e[9]=o,e[10]=x):x=e[10],x}function Vt({toolName:s,connectionId:e,siblings:o,onSelectInstance:n}){const{replayId:l}=Xe({strict:!1}),r=(()=>{if(!l)return null;const d=`replay-${l}`,h=sessionStorage.getItem(d);if(!h)return null;sessionStorage.removeItem(d);try{return JSON.parse(h)}catch{return null}})(),a=(()=>{if(!r)return null;const d={};for(const[h,v]of Object.entries(r))v!==null&&typeof v=="object"?d[h]=JSON.stringify(v,null,2):d[h]=v;return d})(),[c,i]=T.useState(a??{}),[u,x]=T.useState(r?JSON.stringify(r,null,2):"{}"),[m,p]=T.useState(null),[f,g]=T.useState(null),[S,I]=T.useState(null),[R,$]=T.useState(null),[E,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),A=Pt(),{setChatOpen:U}=kt(),D=`${e}:${s}`,_=ce({connectionId:e,orgId:C.id,orgSlug:C.slug}),L=It({client:_}),j=L.data?.tools?.find(d=>d.name===s),O=ut(j?._meta),J=d=>{if(!N)return;const h=$t(d.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[M,Z]=T.useState("json"),[De,Le]=T.useState(!1);O&&!De&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,K={};if(H&&j?.inputSchema?.properties)for(const d of fe)K[d]=j.inputSchema.required?.includes(d)?"":void 0;const ee=d=>Object.prototype.hasOwnProperty.call(c,d),Ue=async()=>{P(!0),$(null),p(null),g(null),I(null),w(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=H?{...K,...c}:(()=>{const z=u.trim();if(!z)return{};const B=JSON.parse(z);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();H&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([z,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[z]=="string")try{h[z]=JSON.parse(h[z])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[z]=="string"&&h[z]!==""){const je=Number(h[z]);Number.isNaN(je)||(h[z]=je)}});const v=await _.callTool({name:s,arguments:h}),W=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-d);p(W),g(v),I(h);const We=JSON.stringify(W),ge=new TextEncoder().encode(We).length;w({duration:`${Ke}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);$(v||"Unknown error occurred");const W=performance.now();w({duration:`${Math.round(W-d)}ms`})}finally{P(!1)}},te=(d,h)=>{i(v=>({...v,[d]:h}))},Be=()=>{p(null),g(null),I(null),$(null),w(null)},Fe=j?.name??Bt(s),Ve=t.jsx(_e,{children:t.jsxs(Me,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:C.slug},children:"Connections"})})}),t.jsx(Y,{}),k&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:C.slug,appSlug:yt(k)},search:{tab:"tools"},children:k.title})})}),t.jsx(Y,{})]}),t.jsx(q,{children:t.jsx(ze,{children:Fe})})]})}),he=o.length>1&&t.jsxs(ve,{value:e,onValueChange:n,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:o.map(d=>t.jsx(oe,{value:d.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:d.icon,name:d.title,size:"xs",className:"shrink-0"}),d.title]})},d.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:H&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([d,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[d,j.inputSchema?.required?.includes(d)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:ee(d)?String(c[d]??""):"",onValueChange:v=>te(d,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:ee(d)?c[d]??"":K[d]??"",onChange:v=>te(d,v.target.value),placeholder:`Enter ${d}...`})]},d)):j?.inputSchema&&!H?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(re,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:d=>x(d.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:E?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(at,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(vt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(bt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(dt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),O&&t.jsx(gt,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(mt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(pt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(jt,{className:"h-4 w-4"}),t.jsx(ft,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ht,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:O&&M==="ui"&&_?t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(xt,{resourceURI:O,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:J,onUpdateModelContext:d=>A?.setAppContext(D,d),onTeardown:()=>A?.clearAppContext(D),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Et,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(Nt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(xe,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:k?.icon||null,name:k?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(X,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(Ct,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:he})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),o.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),he]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Jt(s){const e=y.c(10),{itemId:o,siblings:n,onBack:l}=s,[r,a]=T.useState(n[0]?.id??"");let c;e[0]!==r||e[1]!==n?(c=n.find(p=>p.id===r)?.id??n[0]?.id??"",e[0]=r,e[1]=n,e[2]=c):c=e[2];const i=c;if(!Oe(i||void 0)||!i){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==i||e[6]!==l||e[7]!==n||e[8]!==o?(m=t.jsx(T.Suspense,{fallback:x,children:t.jsx(Ft,{toolName:o,connectionId:i,siblings:n,onSelectInstance:a,onBack:l})}),e[5]=i,e[6]=l,e[7]=n,e[8]=o,e[9]=m):m=e[9],m}function qt(s){const e=y.c(21),{icon:o,illustration:n,title:l,description:r,buttonProps:a,buttonComponent:c,className:i,children:u}=s;let x;e[0]!==i?(x=V("flex flex-col items-center justify-center py-16 text-center",i),e[0]=i,e[1]=x):x=e[1];let m;e[2]!==o||e[3]!==n?(m=n?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:n}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=n,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==r?(f=r&&t.jsx("div",{className:"text-sm text-muted-foreground",children:r}),e[7]=r,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==c||e[13]!==a?(S=(c??a)&&t.jsx("div",{className:"mt-4",children:c??(a&&t.jsx(F,{size:"sm",className:V(a?.className),...a}))}),e[12]=c,e[13]=a,e[14]=S):S=e[14];let I;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(I=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=I):I=e[20],I}const Ht={prompt:Ut};function Kt(){const s=y.c(9),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.itemId);let r;s[1]!==n.appSlug?(r={slug:n.appSlug},s[1]=n.appSlug,s[2]=r):r=s[2];const a=Re(r);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const i=c,u=Wt;let x;return s[5]!==i||s[6]!==l||s[7]!==a?(x=t.jsx(Jt,{itemId:l,siblings:a,onBack:i,onUpdate:u}),s[5]=i,s[6]=l,s[7]=a,s[8]=x):x=s[8],x}async function Wt(s){return Promise.resolve()}function Gt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Qt(){const s=y.c(41),e=ke();let o;s[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=o):o=s[0];const n=ae(o),l=decodeURIComponent(n.collectionName),r=decodeURIComponent(n.itemId);let a;s[1]!==e.history?(a=()=>{e.history.back()},s[1]=e.history,s[2]=a):a=s[2];const c=a,{org:i}=ie();let u;s[3]!==n.appSlug?(u={slug:n.appSlug},s[3]=n.appSlug,s[4]=u):u=s[4];const m=Re(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==i.id||s[6]!==i.slug||s[7]!==g?(S={connectionId:g,orgId:i.id,orgSlug:i.slug},s[5]=i.id,s[6]=i.slug,s[7]=g,s[8]=S):S=s[8];const I=ce(S),R=Ae(f,l,I);let $;s[9]!==R||s[10]!==r?($=async M=>{r&&await R.update.mutateAsync({id:r,data:M})},s[9]=R,s[10]=r,s[11]=$):$=s[11];const E=$;let P;s[12]!==l?(P=l?.toLowerCase(),s[12]=l,s[13]=P):P=s[13];const b=P,w=b&&Ht[b];let C;s[14]!==l?(C=Gt(l),s[14]=l,s[15]=C):C=s[15];const k=C;let N;s[16]!==i.slug?(N=t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:i.slug},children:"Connections"})})}),s[16]=i.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Y,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==i.slug||s[22]!==n.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(q,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:n.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Y,{})]}),s[19]=l,s[20]=m,s[21]=i.slug,s[22]=n.appSlug,s[23]=U):U=s[23];let D;s[24]!==k?(D=t.jsx(q,{children:t.jsx(ze,{children:k})}),s[24]=k,s[25]=D):D=s[25];let _;s[26]!==U||s[27]!==D||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,A,U,D]})}),s[26]=U,s[27]=D,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==E||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:E}),s[30]=w,s[31]=c,s[32]=E,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(At,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let O;s[36]!==c?(O=t.jsx(qt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=O):O=s[37];let J;return s[38]!==L||s[39]!==O?(J=t.jsx(xe,{breadcrumb:L,children:O}),s[38]=L,s[39]=O,s[40]=J):J=s[40],J}function Yt(){const s=y.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const o=ae(e);if(decodeURIComponent(o.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Kt,{}),s[1]=a):a=s[1],a}let r;return s[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Qt,{}),s[2]=r):r=s[2],r}function _n(){const s=y.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(T.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(X,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{_n as default};
@@ -1 +0,0 @@
1
- import{c as _,r as z,l as J,j as s,B as oe,i as Ne,K as M,k as ce,m as Ke,a as we,u as qe,b as Ie,n as Be,d as Ee,o as Te,Q as He,E as Fe,p as ve,L as Qe}from"./index-DILk6pqr.js";import{A as We}from"./auth-entry-BVyaHjaQ.js";import{A as L}from"./auth-split-layout-BO9g4lYZ.js";import{O as _e}from"./organization-choice-DFUlgHk4.js";import{f as Ge}from"./tab-id-BptcWVWa.js";import{I as Ye}from"./input-DntqEqec.js";import{u as je,W as ke,S as Re,g as Ve,C as Ze}from"./use-mcp-client-BdmHrvF5.js";import{i as Oe}from"./XCircle-BLfqcVud.js";import{I as Je}from"./integration-icon-CxxjWIPp.js";import{i as ze}from"./CheckCircle-CNYYpNQm.js";import{g as Xe,c as et,e as tt}from"./extract-connection-data-qW230rJb.js";import{u as nt}from"./useQueries-BD3bwl6B.js";import{a as st}from"./authenticate-and-persist-oauth-D2tM_mGL.js";import{i as Le}from"./ArrowUpRight-C7uYzZ0Z.js";import{s as $e}from"./User01-DR_UC5XH.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-3b85MUU5.js";import"./auth-B4fF5n_6.js";import"./agent-icon-CKGTD-zQ.js";import"./AlertCircle-qY5ngKLr.js";import"./Tool01-hxrY31T7.js";import"./SwitchHorizontal01-CrHLIeRP.js";import"./Settings02-Dd9sO-oW.js";import"./ZapSquare-iu6ldaYZ.js";import"./Users03-BZYHqQGQ.js";import"./ChevronUp-CKICjFfX.js";import"./ChevronDown-BVJUps1_.js";import"./ChevronLeft-CCp89cqe.js";import"./ChevronRight-MnjJHQHy.js";import"./DotsVertical-Bl5GcKp2.js";import"./Stars02-DHcW8N80.js";import"./Eye-C6daRddp.js";import"./ZoomOut-6aWLXLSs.js";import"./Globe01-CgHdNpOL.js";import"./FilterLines-B_0u5HAa.js";import"./Star01-Be_MjtDZ.js";import"./Globe04-DEangwXD.js";import"./HardDrive-V1dbAXdv.js";import"./Key01-B0h1bFlR.js";import"./LayoutLeft-BsVzrTOG.js";import"./LinkExternal01-B9RsD2Us.js";import"./Monitor01-DAM-u2R2.js";import"./Sun-DO_Gt4P2.js";import"./Palette-DT8p7ZEl.js";import"./Play-Blum-MoR.js";import"./Plus-DfIcHYEj.js";import"./SearchMd-B6GaXN7Q.js";import"./Shield01-DLANpVD0.js";import"./Stars01-D3ha2IeY.js";import"./Trash01-DGJ-LjB-.js";import"./Upload01-CzOJ3UuD.js";import"./Users01-cxH39exM.js";import"./XClose-4ak3u3qT.js";import"./X-CXRx6PGX.js";import"./Zap-DVtX-UPi.js";import"./mcp-oauth-BTUV7ht5.js";const ot=/^[a-zA-Z][a-zA-Z\d+.-]*:/,it=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,rt=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,lt=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function xe(o){const e=o.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const t=ot.test(e),n=it.test(e),i=rt.test(e);if(t&&!n&&!i)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const a=n?e:`https://${e}`;let l;try{l=new URL(a)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(l.protocol!=="http:"&&l.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const r=l.hostname.split(".");return r.length<2||r.some(c=>!c||!lt.test(c))?{ok:!1,error:"Enter a valid website URL."}:(l.protocol="https:",{ok:!0,value:l.origin})}function ye(o){const e=_.c(14),{children:t,className:n,wrapperClassName:i}=o,[a,l]=z.useState(!0);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=x=>{if(!x)return;const b=()=>{const d=x.scrollHeight-x.scrollTop-x.clientHeight<8;l(d)};b(),x.addEventListener("scroll",b,{passive:!0});const C=new ResizeObserver(b);C.observe(x);for(const d of Array.from(x.children))C.observe(d);return()=>{x.removeEventListener("scroll",b),C.disconnect()}},e[0]=r):r=e[0];const c=r;let m;e[1]!==i?(m=J("relative",i),e[1]=i,e[2]=m):m=e[2];let f;e[3]!==t||e[4]!==n?(f=s.jsx("div",{ref:c,className:n,children:t}),e[3]=t,e[4]=n,e[5]=f):f=e[5];const u=a?"opacity-0":"opacity-100";let p;e[6]!==u?(p=J("pointer-events-none absolute inset-x-0 -bottom-px h-[213px]","bg-gradient-to-t from-sidebar from-[6px] to-transparent","backdrop-blur-[2px] [mask-image:linear-gradient(to_top,black_6px,transparent)]","transition-opacity duration-200",u),e[6]=u,e[7]=p):p=e[7];let h;e[8]!==p?(h=s.jsx("div",{"aria-hidden":!0,className:p}),e[8]=p,e[9]=h):h=e[9];let g;return e[10]!==m||e[11]!==f||e[12]!==h?(g=s.jsxs("div",{className:m,children:[f,h]}),e[10]=m,e[11]=f,e[12]=h,e[13]=g):g=e[13],g}function at(){const o=_.c(3);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"size-12 shrink-0 animate-pulse rounded-lg bg-muted/60"}),s.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-muted/60"}),s.jsx("div",{className:"ml-auto h-8 w-20 animate-pulse rounded-lg bg-muted/60"})]}),o[0]=e):e=o[0];let t;o[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-40 animate-pulse rounded bg-muted/60"})}),o[1]=t):t=o[1];let n;return o[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[t,s.jsx("div",{className:"p-1",children:s.jsx("div",{className:"h-5 w-56 animate-pulse rounded bg-muted/60"})})]})]}),o[2]=n):n=o[2],n}function be(o){const e=_.c(3),{children:t}=o;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ze,{size:14,className:"shrink-0 text-blue-500"}),e[0]=n):n=e[0];let i;return e[1]!==t?(i=s.jsxs("div",{className:"flex items-center gap-2 p-1",children:[n,s.jsx("p",{className:"text-sm text-foreground",children:t})]}),e[1]=t,e[2]=i):i=e[2],i}function ct(o){const e=_.c(33),{card:t,connecting:n,disabled:i,onConnect:a}=o;let l;e[0]!==t.icon||e[1]!==t.title?(l=s.jsx(Je,{icon:t.icon,name:t.title,size:"md",fit:"contain",className:"p-2"}),e[0]=t.icon,e[1]=t.title,e[2]=l):l=e[2];let r;e[3]!==t.title?(r=s.jsx("p",{className:"flex-1 text-sm text-foreground",children:t.title}),e[3]=t.title,e[4]=r):r=e[4];let c;e[5]!==t.satisfied||e[6]!==t.title||e[7]!==n||e[8]!==i||e[9]!==a?(c=t.satisfied?s.jsxs("div",{className:"flex h-8 items-center gap-2 px-3 text-sm text-muted-foreground",children:[s.jsx(ze,{size:16})," Connected"]}):s.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:i||n,onClick:a,"aria-label":`Connect ${t.title}`,children:n?s.jsx(Ne,{size:16,className:"animate-spin"}):"Connect"}),e[5]=t.satisfied,e[6]=t.title,e[7]=n,e[8]=i,e[9]=a,e[10]=c):c=e[10];let m;e[11]!==l||e[12]!==r||e[13]!==c?(m=s.jsxs("div",{className:"flex items-center gap-2",children:[l,r,c]}),e[11]=l,e[12]=r,e[13]=c,e[14]=m):m=e[14];let f;e[15]!==t.checks?(f=t.checks!==null&&s.jsxs(be,{children:["+ ",t.checks," checks"]}),e[15]=t.checks,e[16]=f):f=e[16];let u;e[17]!==t.headline?(u=t.headline&&s.jsx(be,{children:t.headline}),e[17]=t.headline,e[18]=u):u=e[18];let p;e[19]!==t.bullets?(p=t.bullets.map(dt),e[19]=t.bullets,e[20]=p):p=e[20];let h;e[21]!==t.candidateConnectionId||e[22]!==t.satisfied||e[23]!==t.title?(h=!t.satisfied&&t.candidateConnectionId&&s.jsxs("p",{className:"px-1 text-xs text-muted-foreground",children:["Using your existing ",t.title]}),e[21]=t.candidateConnectionId,e[22]=t.satisfied,e[23]=t.title,e[24]=h):h=e[24];let g;e[25]!==f||e[26]!==u||e[27]!==p||e[28]!==h?(g=s.jsxs("div",{className:"flex flex-col gap-1 px-1 py-2",children:[f,u,p,h]}),e[25]=f,e[26]=u,e[27]=p,e[28]=h,e[29]=g):g=e[29];let x;return e[30]!==m||e[31]!==g?(x=s.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border border-border bg-card p-4",children:[m,g]}),e[30]=m,e[31]=g,e[32]=x):x=e[32],x}function dt(o){return s.jsx(be,{children:o},o)}const Ce={vtex:{registryAppId:"deco/vtex",checks:49,headline:"Out-of-stock, thin PDPs & attribute gaps across every SKU"},"google-analytics":{registryAppId:"deco/google-analytics",checks:49,headline:"Where revenue leaks between product view and checkout"},"google-search-console":{registryAppId:"deco/google-search-console",checks:49,headline:"Search visibility & indexing gaps across your catalog"}};function mt(o){const e=o.properties;if(!e)return[];const t=[];for(const[n,i]of Object.entries(e)){const r=i?.properties?.__type?.const;typeof r=="string"&&r.length>0&&t.push({fieldKey:n,bindingType:r})}return t}function ut(o,e){const t=[];if(o.length&&t.push({field:["id"],operator:"in",value:o}),e.length&&t.push({field:["name"],operator:"in",value:e}),t.length!==0)return t.length===1?t[0]:{operator:"or",conditions:t}}function Z(o){const e=o;if(e.isError)throw new Error(e.content?.find(t=>t.text)?.text??"Tool call failed");return e.structuredContent??o}function ft(o,e,t,n){return{...o??{},[e]:{__type:t,value:n}}}function pt(o,e,t){const n=o.filter(i=>i.app_name===e||!!t&&i.app_id===t);return n.length===0?null:(n.sort((i,a)=>{const l=r=>r.status==="active"?0:1;return l(i)!==l(a)?l(i)-l(a):(a.updated_at??"").localeCompare(i.updated_at??"")}),n[0].id)}function gt(o){return o.server?.icons?.[0]?.src??Xe(o.server?.repository)??null}function ht(o,e){const t=o._meta?.["mcp.mesh"];return t?.friendlyName||t?.friendly_name||o.title||o.server?.title||o.server?.name||e}function xt(o){const e=[],t=new Set(o.connections.map(n=>n.id));for(const n of o.requirements){const i=o.curated[n.bindingType],a=i?o.itemsById[i.registryAppId]:o.itemsByName[n.bindingType];if(!a)continue;const l=o.configurationState?.[n.fieldKey]?.value,r=!!l&&t.has(l),c=r?o.connectionReadiness?.[l]!==!1:!1,m=r&&c;e.push({fieldKey:n.fieldKey,bindingType:n.bindingType,registryItem:a,title:ht(a,n.bindingType),icon:gt(a),headline:i?.headline??a._meta?.["mcp.mesh"]?.short_description??null,checks:i?.checks??null,bullets:i?.bullets??[],satisfied:m,candidateConnectionId:m?null:r?l:pt(o.connections,n.bindingType,i?.registryAppId)})}return e}function yt(o){const e=_.c(39),{selfClient:t,org:n,cdConnectionId:i}=o;let a;e[0]!==i||e[1]!==n.id||e[2]!==n.slug?(a={connectionId:i,orgId:n.id,orgSlug:n.slug},e[0]=i,e[1]=n.id,e[2]=n.slug,e[3]=a):a=e[3];const l=je(a);let r;e[4]!==i||e[5]!==n.id?(r=M.commerceDiscoveryCompanionSchema(n.id,i),e[4]=i,e[5]=n.id,e[6]=r):r=e[6];let c;e[7]!==l?(c=async()=>{const y=await l.callTool({name:"MCP_CONFIGURATION",arguments:{}});return Z(y)},e[7]=l,e[8]=c):c=e[8];let m;e[9]!==r||e[10]!==c?(m={queryKey:r,queryFn:c},e[9]=r,e[10]=c,e[11]=m):m=e[11];const f=ce(m),u=mt(f.data?.stateSchema??{properties:{}}),p=u.map(wt),h=u.map(Nt).filter(St),g=u.filter(_t).map(vt),x=[...h,...g].sort().join(",");let b;e[12]!==i||e[13]!==n.id?(b=M.commerceDiscoveryConnection(n.id,i),e[12]=i,e[13]=n.id,e[14]=b):b=e[14];let C;e[15]!==i||e[16]!==t?(C=async()=>{const y=await t.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:i}});return Z(y)},e[15]=i,e[16]=t,e[17]=C):C=e[17];let d;e[18]!==b||e[19]!==C?(d={queryKey:b,queryFn:C},e[18]=b,e[19]=C,e[20]=d):d=e[20];const j=ce(d),v=j.data?.item?.configuration_state??null;let N;e[21]!==v?(N=y=>v?.[y.fieldKey]?.value,e[21]=v,e[22]=N):N=e[22];const E=u.map(N).filter(Ct),w=ce({queryKey:M.commerceDiscoveryCompanionConnections(n.id),enabled:u.length>0,queryFn:async()=>{const y=[{field:["app_name"],operator:"in",value:p},{field:["app_id"],operator:"in",value:h}];E.length>0&&y.push({field:["id"],operator:"in",value:E});const R=await t.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{where:{operator:"or",conditions:y},limit:1e3}});return Z(R)}}),O=w.data?.items??[],I=new Set(E),Q=O.filter(y=>I.has(y.id)),W=Q.filter(jt);let T;e[23]!==n.id||e[24]!==n.slug?(T=y=>({queryKey:M.commerceDiscoveryCompanionOAuthStatus(n.id,y.id),queryFn:async()=>{const R=await fetch(`/api/${encodeURIComponent(n.slug)}/connections/${encodeURIComponent(y.id)}/oauth-token/status`,{credentials:"include"});return R.ok?{hasToken:(await R.json()).hasToken===!0}:{hasToken:!1}},retry:!1}),e[23]=n.id,e[24]=n.slug,e[25]=T):T=e[25];const P=nt({queries:W.map(T)});let A;e[26]!==P?(A=(y,R)=>[y.id,P[R]?.data?.hasToken===!0],e[26]=P,e[27]=A):A=e[27];const K=new Map(W.map(A)),G={};for(const y of Q)G[y.id]=!y.oauth_config||!!y.connection_token||K.get(y.id)===!0;const D=ce({queryKey:M.commerceDiscoveryCompanionRegistry(n.id,x),enabled:u.length>0,queryFn:async()=>{const y=ut(h,g),R=await et(ke.REGISTRY(n.id),n.id,n.slug,"COLLECTION_REGISTRY_APP_LIST",{...y?{where:y}:{},limit:1e3});return Z(R)}}),Y={},$={};for(const y of D.data?.items??[])Y[y.id]=y,y.server?.name&&($[y.server.name]=y);const q=xt({requirements:u,itemsById:Y,itemsByName:$,connections:O,connectionReadiness:G,configurationState:v,curated:Ce});let k;e[28]!==j||e[29]!==w||e[30]!==P||e[31]!==D||e[32]!==u||e[33]!==f.isPending?(k=f.isPending||j.isPending||u.length>0&&(w.isPending||D.isPending||P.some(bt)),e[28]=j,e[29]=w,e[30]=P,e[31]=D,e[32]=u,e[33]=f.isPending,e[34]=k):k=e[34];const B=k,V=f.error??j.error??w.error??D.error??null;let H;return e[35]!==q||e[36]!==V||e[37]!==B?(H={cards:q,isLoading:B,error:V},e[35]=q,e[36]=V,e[37]=B,e[38]=H):H=e[38],H}function bt(o){return o.isPending}function jt(o){return o.oauth_config&&!o.connection_token}function Ct(o){return typeof o=="string"&&o.length>0}function vt(o){return o.bindingType}function _t(o){return!Ce[o.bindingType]}function St(o){return!!o}function Nt(o){return Ce[o.bindingType]?.registryAppId}function wt(o){return o.bindingType}function It({selfClient:o,org:e,userId:t,cdConnectionId:n}){const i=Ke(),[a,l]=z.useState(null),[r,c]=z.useState(null),m=async(u,p)=>{const h=await o.callTool({name:"COLLECTION_CONNECTIONS_UPDATE",arguments:{id:u,data:p}});return Z(h)};async function f(u){l(u.fieldKey),c(null);try{let p=u.candidateConnectionId;if(!p){const d=tt(u.registryItem,e.id,t,{remoteIndex:0}),j=d.connection_type==="STDIO",v=!!d.connection_url,N=j&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!v&&!N){c(`${u.title} cannot be connected: no connection method available`);return}const E=await o.callTool({name:"COLLECTION_CONNECTIONS_CREATE",arguments:{data:d}});p=Z(E).item.id}const h=p,g=await st({connectionId:h,orgId:e.id,orgSlug:e.slug,persistFallback:d=>m(h,{connection_token:d}).then(()=>{})});if(!g.ok){c(`Couldn't sign in to ${u.title}: ${g.error}`);return}const x=await o.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:n}}),b=Z(x).item?.configuration_state??null,C=ft(b,u.fieldKey,u.bindingType,h);await m(n,{configuration_state:C}),await i.invalidateQueries({queryKey:M.commerceDiscoveryConnection(e.id,n)}),await i.invalidateQueries({queryKey:M.commerceDiscoveryCompanionConnections(e.id)})}catch(p){c(p instanceof Error?p.message:String(p))}finally{l(null)}}return{connect:f,connectingFieldKey:a,error:r}}function Et(o){const e=_.c(30),{org:t,cdConnectionId:n,reportDisabled:i,onOpenReport:a}=o,{data:l}=we.useSession(),r=l?.user?.id??"";let c;e[0]!==t.id||e[1]!==t.slug?(c={connectionId:Re,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=c):c=e[2];const m=je(c);let f;e[3]!==n||e[4]!==t||e[5]!==m?(f={selfClient:m,org:t,cdConnectionId:n},e[3]=n,e[4]=t,e[5]=m,e[6]=f):f=e[6];const{cards:u,isLoading:p,error:h}=yt(f);let g;e[7]!==n||e[8]!==t||e[9]!==m||e[10]!==r?(g={selfClient:m,org:t,userId:r,cdConnectionId:n},e[7]=n,e[8]=t,e[9]=m,e[10]=r,e[11]=g):g=e[11];const{connect:x,connectingFieldKey:b,error:C}=It(g);let d;e[12]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Oe,{size:16}),e[12]=d):d=e[12];let j;e[13]!==a||e[14]!==i?(j=s.jsxs(oe,{type:"button",size:"xl",className:"w-full",onClick:a,disabled:i,children:["See full report",d]}),e[13]=a,e[14]=i,e[15]=j):j=e[15];const v=j;if(!p&&!h&&u.length===0){let I;return e[16]!==v?(I=s.jsx("div",{className:"flex min-h-0 flex-1 flex-col justify-end gap-10 md:grid md:flex-none",children:v}),e[16]=v,e[17]=I):I=e[17],I}const N=b!==null;let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsxs("div",{className:"grid gap-1.5",children:[s.jsx("p",{className:"text-2xl font-medium text-foreground",children:"Unlock your full diagnostic"}),s.jsx("p",{className:"text-base text-muted-foreground",children:"Connect your tools to unlock 100+ checks across your funnel."})]}),e[18]=E):E=e[18];let w;e[19]!==N||e[20]!==u||e[21]!==x||e[22]!==C||e[23]!==b||e[24]!==h||e[25]!==p?(w=h?s.jsxs("div",{role:"alert",className:"rounded-2xl border border-border bg-card p-4",children:[s.jsx("p",{className:"text-sm text-foreground",children:"Couldn't load companion integrations."}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reload the page to try again."})]}):p?s.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4",children:[0,1,2].map(Tt)}):s.jsx(ye,{wrapperClassName:"flex min-h-0 flex-1 flex-col md:block",className:"-mx-1 min-h-0 flex-1 overflow-y-auto px-1 md:max-h-[45vh] md:flex-none",children:s.jsxs("div",{className:"grid gap-4",children:[C&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:C}),u.map(I=>s.jsx(ct,{card:I,connecting:b===I.fieldKey,disabled:N&&b!==I.fieldKey,onConnect:()=>{x(I)}},I.fieldKey))]})}),e[19]=N,e[20]=u,e[21]=x,e[22]=C,e[23]=b,e[24]=h,e[25]=p,e[26]=w):w=e[26];let O;return e[27]!==v||e[28]!==w?(O=s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 md:grid md:flex-none",children:[E,w,v]}),e[27]=v,e[28]=w,e[29]=O):O=e[29],O}function Tt(o){return s.jsx(at,{},o)}function Pe(o){const e=_.c(16),{label:t,iconSize:n,className:i,iconClassName:a,labelClassName:l}=o,r=n===void 0?14:n;let c;e[0]!==i?(c=J("inline-flex items-center gap-2",i),e[0]=i,e[1]=c):c=e[1];let m;e[2]!==a?(m=J("shrink-0 animate-spin",a),e[2]=a,e[3]=m):m=e[3];let f;e[4]!==r||e[5]!==m?(f=s.jsx(Ne,{size:r,className:m}),e[4]=r,e[5]=m,e[6]=f):f=e[6];let u;e[7]!==l?(u=J("text-sm",l),e[7]=l,e[8]=u):u=e[8];let p;e[9]!==t||e[10]!==u?(p=s.jsx("span",{className:u,children:t}),e[9]=t,e[10]=u,e[11]=p):p=e[11];let h;return e[12]!==c||e[13]!==f||e[14]!==p?(h=s.jsxs("span",{className:c,children:[f,p]}),e[12]=c,e[13]=f,e[14]=p,e[15]=h):h=e[15],h}const Ue="https://decocms-tanstack.deco-cx.workers.dev/agendar",kt="Rather have us walk you through it?",Rt="Book a 20-minute call and we'll run the diagnostic with you, live.";function Ot(o){const e=_.c(6),{size:t,className:n}=o,i=t===void 0?"lg":t;let a;e[0]!==n?(a=J("w-full",n),e[0]=n,e[1]=a):a=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("a",{href:Ue,target:"_blank",rel:"noreferrer",children:["Schedule a meeting",s.jsx(Le,{size:16})]}),e[2]=l):l=e[2];let r;return e[3]!==i||e[4]!==a?(r=s.jsx(oe,{asChild:!0,variant:"outline",size:i,className:a,children:l}),e[3]=i,e[4]=a,e[5]=r):r=e[5],r}function Se(o){const e=_.c(2),{children:t}=o;let n;return e[0]!==t?(n=s.jsx("div",{className:"relative z-10 flex h-12 w-12 items-center justify-center rounded-full border border-border bg-card card-shadow",children:t}),e[0]=t,e[1]=n):n=e[1],n}function zt(){const o=_.c(4);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Se,{children:s.jsx($e,{size:20,className:"text-muted-foreground"})}),o[0]=e):e=o[0];let t;o[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("div",{className:"relative mx-4 h-px flex-1 bg-border",children:s.jsx("span",{className:"absolute top-1/2 h-1.5 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-foreground animate-connection-travel","aria-hidden":!0})}),o[1]=t):t=o[1];let n;o[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("span",{className:"absolute inset-0 rounded-full border border-foreground/40 animate-connection-arrive","aria-hidden":!0}),o[2]=n):n=o[2];let i;return o[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"flex items-center justify-between rounded-2xl border border-border/60 bg-muted/40 px-7 py-7",children:[e,t,s.jsxs("div",{className:"relative",children:[n,s.jsxs(Se,{children:[s.jsx("img",{src:"/logos/deco logo.svg",alt:"deco",className:"h-6 w-6 dark:hidden"}),s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"deco",className:"hidden h-6 w-6 dark:block"})]})]})]}),o[3]=i):i=o[3],i}function Lt(){const o=_.c(2);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(zt,{}),o[0]=e):e=o[0];let t;return o[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("div",{className:"relative flex h-full w-full items-center justify-center p-10",children:s.jsxs("div",{className:"flex w-full max-w-[380px] flex-col gap-6 rounded-3xl border border-border bg-card p-8 card-shadow",children:[e,s.jsxs("div",{className:"grid gap-2",children:[s.jsx("h2",{className:"text-xl font-medium leading-7 text-foreground",children:kt}),s.jsx("p",{className:"text-base leading-6 text-muted-foreground",children:Rt})]}),s.jsx(Ot,{size:"xl"})]})}),o[1]=t):t=o[1],t}function $t(o){const e=_.c(7),{className:t}=o;let n;e[0]!==t?(n=J("flex items-center gap-4 rounded-2xl border border-border bg-card p-5 card-shadow transition-colors hover:bg-accent",t),e[0]=t,e[1]=n):n=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:s.jsx($e,{size:20})}),e[2]=i):i=e[2];let a,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("span",{className:"flex flex-1 flex-col gap-0.5",children:[s.jsx("span",{className:"text-base font-medium leading-5 text-foreground",children:"Prefer to talk to a human?"}),s.jsx("span",{className:"text-sm leading-5 text-muted-foreground",children:"Book a call and we'll run the diagnostic with you."})]}),l=s.jsx(Le,{size:18,className:"shrink-0 text-muted-foreground"}),e[3]=a,e[4]=l):(a=e[3],l=e[4]);let r;return e[5]!==n?(r=s.jsxs("a",{href:Ue,target:"_blank",rel:"noreferrer",className:n,children:[i,a,l]}),e[5]=n,e[6]=r):r=e[6],r}function Ae(o){const e=_.c(10),{host:t}=o,n=`https://www.google.com/s2/favicons?domain=${t}&sz=128`;let i,a,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-7 w-7 dark:hidden"}),a=s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-7 w-7 hidden dark:block"}),l=s.jsx("div",{className:"h-6 w-px rotate-12 bg-border","aria-hidden":"true"}),e[0]=i,e[1]=a,e[2]=l):(i=e[0],a=e[1],l=e[2]);let r;e[3]!==n?(r=s.jsx("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-border bg-white",children:s.jsx("img",{src:n,alt:"",className:"h-5 w-5",loading:"lazy"})}),e[3]=n,e[4]=r):r=e[4];let c;e[5]!==t?(c=s.jsx("span",{className:"text-lg font-medium text-foreground",children:t}),e[5]=t,e[6]=c):c=e[6];let m;return e[7]!==r||e[8]!==c?(m=s.jsxs("div",{className:"flex items-center gap-3",children:[i,a,l,r,c]}),e[7]=r,e[8]=c,e[9]=m):m=e[9],m}function Zn(){const o=_.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ut,{}),o[0]=e):e=o[0],e}const De=z.createContext(null),Me=()=>z.useContext(De);function Pt(o){if(!o)return null;const e=xe(o);return e.ok?new URL(e.value).hostname:null}function Ut(){const o=_.c(9);let e;o[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},o[0]=e):e=o[0];const t=qe(e),{org:n,siteUrl:i}=t;let a;o[1]!==i?(a=Pt(i),o[1]=i,o[2]=a):a=o[2];const l=a;let r;o[3]!==n||o[4]!==i?(r=s.jsx(At,{requestedOrgSlug:n,siteUrl:i}),o[3]=n,o[4]=i,o[5]=r):r=o[5];let c;return o[6]!==l||o[7]!==r?(c=s.jsx(De.Provider,{value:l,children:r}),o[6]=l,o[7]=r,o[8]=c):c=o[8],c}function At(o){const e=_.c(8),{requestedOrgSlug:t,siteUrl:n}=o,{data:i,isPending:a}=we.useSession(),l=Me();if(a){let c;return e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(L,{children:s.jsx(re,{label:"Preparing commerce onboarding..."})}),e[0]=c):c=e[0],c}if(!i){const c=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let m;e[1]!==l?(m=l?s.jsx(Ae,{host:l}):void 0,e[1]=l,e[2]=m):m=e[2];let f;return e[3]!==m?(f=s.jsx(L,{children:s.jsx(We,{callbackUrl:c,allowAutoLogin:!1,title:"Unlock your full diagnostic",subtitle:null,brand:m})}),e[3]=m,e[4]=f):f=e[4],f}let r;return e[5]!==t||e[6]!==n?(r=s.jsx(Dt,{requestedOrgSlug:t,siteUrl:n}),e[5]=t,e[6]=n,e[7]=r):r=e[7],r}function Dt(o){const e=_.c(40),{requestedOrgSlug:t,siteUrl:n}=o,i=Ie(),a=Be(),[l,r]=z.useState(null),[c,m]=z.useState(null),f=a.data?.map(Kt)??[];let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={mutationFn:Mt,retry:!1,onSuccess:d=>{m(d)}},e[0]=u):u=e[0];const p=Ee(u);if(a.isPending){let d;return e[1]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(L,{children:s.jsx(re,{label:"Preparing commerce onboarding..."})}),e[1]=d):d=e[1],d}if(a.error){let d;return e[2]!==a?(d=s.jsx(me,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[2]=a,e[3]=d):d=e[3],d}const h=t?f.find(d=>d.slug===t):null;if(h){let d;return e[4]!==h||e[5]!==n?(d=s.jsx(de,{org:h,initialSiteUrl:n}),e[4]=h,e[5]=n,e[6]=d):d=e[6],d}if(t){let d;return e[7]!==a?(d=s.jsx(me,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>a.refetch()}),e[7]=a,e[8]=d):d=e[8],d}if(l){let d;return e[9]!==l||e[10]!==n?(d=s.jsx(de,{org:l,initialSiteUrl:n}),e[9]=l,e[10]=n,e[11]=d):d=e[11],d}if(f.length===1&&f[0]){let d;return e[12]!==f[0]||e[13]!==n?(d=s.jsx(de,{org:f[0],initialSiteUrl:n}),e[12]=f[0],e[13]=n,e[14]=d):d=e[14],d}if(f.length>1){let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(F,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=d):d=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j=N=>r(N),e[16]=j):j=e[16];let v;return e[17]!==f?(v=s.jsx(L,{children:s.jsxs("div",{className:"grid gap-10",children:[d,s.jsx(ye,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(_e,{organizations:f,selectLabel:"Continue",onSelected:j})})]})}),e[17]=f,e[18]=v):v=e[18],v}if(!c){let d;e[19]!==p?(d=()=>{p.reset(),p.mutate()},e[19]=p,e[20]=d):d=e[20];let j;return e[21]!==p||e[22]!==d?(j=s.jsx(qt,{mutation:p,onRetry:d}),e[21]=p,e[22]=d,e[23]=j):j=e[23],j}const g=c;if(g?.success&&(g.status==="created"||g.status==="joined"||g.status==="already_has_organization")&&g.organization){let d;return e[24]!==g.organization||e[25]!==n?(d=s.jsx(de,{org:g.organization,initialSiteUrl:n}),e[24]=g.organization,e[25]=n,e[26]=d):d=e[26],d}if(g?.status==="ambiguous"&&g.organizations&&g.organizations.length>0){let d;e[27]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(F,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=d):d=e[27];const j=g.domain??void 0;let v;e[28]!==i||e[29]!==n?(v=(E,w)=>{Te(),r({...E,slug:w}),i({to:"/commerce-onboarding",search:{org:w,siteUrl:n}})},e[28]=i,e[29]=n,e[30]=v):v=e[30];let N;return e[31]!==g.organizations||e[32]!==j||e[33]!==v?(N=s.jsx(L,{children:s.jsxs("div",{className:"grid gap-10",children:[d,s.jsx(ye,{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:s.jsx(_e,{organizations:g.organizations,domain:j,onJoined:v})})]})}),e[31]=g.organizations,e[32]=j,e[33]=v,e[34]=N):N=e[34],N}const x=g?.error??"We could not determine a commerce organization for this account.";let b;e[35]!==p?(b=()=>{m(null),p.reset()},e[35]=p,e[36]=b):b=e[36];let C;return e[37]!==x||e[38]!==b?(C=s.jsx(me,{title:"Commerce onboarding needs support",description:x,actionLabel:"Try again",onRetry:b}),e[37]=x,e[38]=b,e[39]=C):C=e[39],C}async function Mt(){const e=await(await fetch("/api/auth/custom/ensure-organization",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}})).json();return e.success&&(e.status==="created"||e.status==="joined"||e.status==="already_has_organization")&&e.organization&&Te(),e}function Kt(o){return{id:o.id,name:o.name,slug:o.slug,logo:o.logo??null}}function qt(o){const e=_.c(7),{mutation:t,onRetry:n}=o,i=z.useRef(!1);let a;e[0]!==t?(a=m=>{!m||i.current||(i.current=!0,t.mutate())},e[0]=t,e[1]=a):a=e[1];const l=a;if(t.error){let m;return e[2]!==n?(m=s.jsx(me,{title:"Commerce onboarding is unavailable",description:"We could not prepare an organization for commerce setup. Retry from this page or contact support.",actionLabel:"Retry",onRetry:n}),e[2]=n,e[3]=m):m=e[3],m}let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(re,{label:"Preparing your commerce workspace..."}),e[4]=r):r=e[4];let c;return e[5]!==l?(c=s.jsx(L,{children:s.jsx("div",{ref:l,children:r})}),e[5]=l,e[6]=c):c=e[6],c}function F(o){const e=_.c(8),{title:t,description:n}=o,i=Me();let a;e[0]!==i?(a=i?s.jsx(Ae,{host:i}):s.jsxs("div",{children:[s.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),s.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e[0]=i,e[1]=a):a=e[1];let l;e[2]!==n||e[3]!==t?(l=(t||n)&&s.jsxs("div",{className:"space-y-2",children:[t&&s.jsx("h1",{className:"text-2xl font-medium leading-8",children:t}),n&&s.jsx("p",{className:"text-base text-muted-foreground leading-6",children:n})]}),e[2]=n,e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=s.jsxs("div",{className:"grid gap-10",children:[a,l]}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}function re(o){const e=_.c(2),{label:t}=o;let n;return e[0]!==t?(n=s.jsx("div",{className:"py-4",role:"status","aria-live":"polite",children:s.jsx(Pe,{label:t,className:"text-muted-foreground"})}),e[0]=t,e[1]=n):n=e[1],n}function me(o){const e=_.c(9),{title:t,description:n,actionLabel:i,onRetry:a}=o;let l;e[0]!==n||e[1]!==t?(l=s.jsx(F,{title:t,description:n}),e[0]=n,e[1]=t,e[2]=l):l=e[2];let r;e[3]!==i||e[4]!==a?(r=s.jsx(oe,{type:"button",size:"xl",className:"w-full",onClick:a,children:i}),e[3]=i,e[4]=a,e[5]=r):r=e[5];let c;return e[6]!==l||e[7]!==r?(c=s.jsx(L,{children:s.jsxs("div",{className:"grid gap-10",children:[l,r]})}),e[6]=l,e[7]=r,e[8]=c):c=e[8],c}function Bt(o){return o.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function ge(o){const e=o;if(e.isError)throw new Error(Bt(e));return e.structuredContent??o}function de(o){const e=_.c(3),{org:t,initialSiteUrl:n}=o;let i;return e[0]!==n||e[1]!==t?(i=s.jsx(He,{children:a=>{const{reset:l}=a;return s.jsx(Fe,{fallback:r=>{const{error:c,resetError:m}=r;return s.jsx(L,{children:s.jsx(Ht,{orgName:t.name,message:c instanceof Error?c.message:"We could not check Commerce Discovery setup.",onRetry:()=>{l(),m()}})})},children:s.jsx(z.Suspense,{fallback:s.jsx(L,{children:s.jsx(re,{label:"Connecting workspace..."})}),children:s.jsx(Ft,{org:t,initialSiteUrl:n},`${t.id}:${n??""}`)})})}}),e[0]=n,e[1]=t,e[2]=i):i=e[2],i}function Ht(o){const e=_.c(10),{orgName:t,message:n,onRetry:i}=o,a=`Commerce setup will continue for ${t}.`;let l;e[0]!==a?(l=s.jsx(F,{title:"Commerce diagnostics",description:a}),e[0]=a,e[1]=l):l=e[1];let r;e[2]!==n?(r=s.jsx(ue,{message:n}),e[2]=n,e[3]=r):r=e[3];let c;e[4]!==i?(c=s.jsx(oe,{type:"button",size:"xl",className:"w-full",onClick:i,children:"Retry"}),e[4]=i,e[5]=c):c=e[5];let m;return e[6]!==l||e[7]!==r||e[8]!==c?(m=s.jsxs("div",{className:"grid gap-10",children:[l,r,c]}),e[6]=l,e[7]=r,e[8]=c,e[9]=m):m=e[9],m}function Ft(o){const e=_.c(83),{org:t,initialSiteUrl:n}=o,i=Ie();let a;e[0]!==t.id||e[1]!==t.slug?(a={connectionId:Re,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=a):a=e[2];const l=je(a),[r,c]=z.useState(n??""),[m,f]=z.useState(null),[u,p]=z.useState(null),h=z.useRef(!1),g=ke.COMMERCE_DISCOVERY(t.id),x=Ve(t.id),b=M.commerceDiscoveryConnection(t.id,g);let C;e[3]!==g||e[4]!==l?(C=async()=>{const S=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:g}});return ge(S)},e[3]=g,e[4]=l,e[5]=C):C=e[5];let d;e[6]!==b||e[7]!==C?(d={queryKey:b,queryFn:C,retry:!1},e[6]=b,e[7]=C,e[8]=d):d=e[8];const j=ve(d),v=M.commerceDiscoveryVirtualMcp(t.id,x);let N;e[9]!==l||e[10]!==x?(N=async()=>{const S=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:x}});return ge(S)},e[9]=l,e[10]=x,e[11]=N):N=e[11];let E;e[12]!==v||e[13]!==N?(E={queryKey:v,queryFn:N,retry:!1},e[12]=v,e[13]=N,e[14]=E):E=e[14];const w=ve(E);let O;e[15]!==l?(O=async S=>{const U=await l.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:S}});return ge(U)},e[15]=l,e[16]=O):O=e[16];let I;e[17]!==j||e[18]!==w?(I=S=>{f(S),p(null),j.refetch(),w.refetch()},e[17]=j,e[18]=w,e[19]=I):I=e[19];let Q;e[20]===Symbol.for("react.memo_cache_sentinel")?(Q=S=>{p(S instanceof Error?S.message:"Commerce Discovery setup failed.")},e[20]=Q):Q=e[20];let W;e[21]!==O||e[22]!==I?(W={mutationFn:O,retry:!1,onSuccess:I,onError:Q},e[21]=O,e[22]=I,e[23]=W):W=e[23];const T=Ee(W),P=!!j.data.item&&!!w.data.item;let A;e[24]!==T?(A=S=>{const U=xe(S);if(!U.ok){p(U.error);return}p(null),T.mutate(U.value)},e[24]=T,e[25]=A):A=e[25];const K=A;let G;e[26]!==n||e[27]!==K||e[28]!==P?(G=S=>{!S||h.current||P||!n||(h.current=!0,K(n))},e[26]=n,e[27]=K,e[28]=P,e[29]=G):G=e[29];const D=G;let Y;e[30]!==K||e[31]!==r?(Y=S=>{S.preventDefault(),K(r)},e[30]=K,e[31]=r,e[32]=Y):Y=e[32];const $=Y;let q;e[33]!==g||e[34]!==m?.reportApp||e[35]!==x?(q=m?.reportApp??{connectionId:g,virtualMcpId:x,toolName:Ze},e[33]=g,e[34]=m?.reportApp,e[35]=x,e[36]=q):q=e[36];const k=q;let B;e[37]!==i||e[38]!==t.slug||e[39]!==k.connectionId||e[40]!==k.toolName||e[41]!==k.virtualMcpId?(B=()=>{localStorage.setItem(Qe.sidebarOpen(),JSON.stringify(!1)),i({to:"/$org/$taskId",params:{org:t.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:k.virtualMcpId,main:Ge(k.connectionId,k.toolName),chat:0}})},e[37]=i,e[38]=t.slug,e[39]=k.connectionId,e[40]=k.toolName,e[41]=k.virtualMcpId,e[42]=B):B=e[42];const V=B;if(P){let S;return e[43]!==V||e[44]!==t||e[45]!==k?(S=s.jsx(Qt,{org:t,reportApp:k,onOpenReport:V}),e[43]=V,e[44]=t,e[45]=k,e[46]=S):S=e[46],S}if(n){let S;e[47]!==n?(S=xe(n),e[47]=n,e[48]=S):S=e[48];const U=S;if(!U.ok){const pe=`Commerce setup will continue for ${t.name}.`;let te;e[49]!==pe?(te=s.jsx(F,{title:"Commerce diagnostics",description:pe}),e[49]=pe,e[50]=te):te=e[50];let ne;e[51]!==U.error?(ne=s.jsx(ue,{message:U.error}),e[51]=U.error,e[52]=ne):ne=e[52];let se;e[53]!==$||e[54]!==u||e[55]!==T.isPending||e[56]!==r?(se=s.jsx(he,{siteUrl:r,error:u,isSubmitting:T.isPending,onSiteUrlChange:c,onSubmit:$}),e[53]=$,e[54]=u,e[55]=T.isPending,e[56]=r,e[57]=se):se=e[57];let ae;return e[58]!==te||e[59]!==ne||e[60]!==se?(ae=s.jsx(L,{children:s.jsxs("div",{className:"grid gap-10",children:[te,ne,se]})}),e[58]=te,e[59]=ne,e[60]=se,e[61]=ae):ae=e[61],ae}const fe=`Commerce Discovery is being prepared for ${U.value}.`;let X;e[62]!==fe?(X=s.jsx(F,{title:"Commerce diagnostics",description:fe}),e[62]=fe,e[63]=X):X=e[63];let ee;e[64]!==$||e[65]!==u||e[66]!==T||e[67]!==r?(ee=u?s.jsxs(s.Fragment,{children:[s.jsx(ue,{message:u}),s.jsx(he,{siteUrl:r,error:null,isSubmitting:T.isPending,onSiteUrlChange:c,onSubmit:$})]}):s.jsx(re,{label:"Setting up Commerce Discovery..."}),e[64]=$,e[65]=u,e[66]=T,e[67]=r,e[68]=ee):ee=e[68];let le;return e[69]!==X||e[70]!==ee||e[71]!==D?(le=s.jsx(L,{children:s.jsxs("div",{ref:D,className:"grid gap-10",children:[X,ee]})}),e[69]=X,e[70]=ee,e[71]=D,e[72]=le):le=e[72],le}const H=`Commerce setup will continue for ${t.name}.`;let y;e[73]!==H?(y=s.jsx(F,{title:"Commerce diagnostics",description:H}),e[73]=H,e[74]=y):y=e[74];let R;e[75]!==$||e[76]!==u||e[77]!==T.isPending||e[78]!==r?(R=s.jsx(he,{siteUrl:r,error:u,isSubmitting:T.isPending,onSiteUrlChange:c,onSubmit:$}),e[75]=$,e[76]=u,e[77]=T.isPending,e[78]=r,e[79]=R):R=e[79];let ie;return e[80]!==y||e[81]!==R?(ie=s.jsx(L,{children:s.jsxs("div",{className:"grid gap-10",children:[y,R]})}),e[80]=y,e[81]=R,e[82]=ie):ie=e[82],ie}function he(o){const e=_.c(22),{siteUrl:t,error:n,isSubmitting:i,onSiteUrlChange:a,onSubmit:l}=o;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=r):r=e[0];let c;e[1]!==a?(c=b=>a(b.target.value),e[1]=a,e[2]=c):c=e[2];const m=!!n;let f;e[3]!==i||e[4]!==t||e[5]!==c||e[6]!==m?(f=s.jsx(Ye,{id:"commerce-site-url",type:"text",inputMode:"url",value:t,onChange:c,placeholder:"https://example.com","aria-invalid":m,disabled:i}),e[3]=i,e[4]=t,e[5]=c,e[6]=m,e[7]=f):f=e[7];let u;e[8]!==n?(u=n?s.jsx(ue,{message:n}):null,e[8]=n,e[9]=u):u=e[9];let p;e[10]!==f||e[11]!==u?(p=s.jsxs("div",{className:"grid gap-2",children:[r,f,u]}),e[10]=f,e[11]=u,e[12]=p):p=e[12];let h;e[13]!==i?(h=i?s.jsx(Pe,{label:"Setting up"}):s.jsxs(s.Fragment,{children:["Continue",s.jsx(Oe,{size:16})]}),e[13]=i,e[14]=h):h=e[14];let g;e[15]!==i||e[16]!==h?(g=s.jsx(oe,{type:"submit",size:"xl",className:"w-full",disabled:i,children:h}),e[15]=i,e[16]=h,e[17]=g):g=e[17];let x;return e[18]!==l||e[19]!==p||e[20]!==g?(x=s.jsxs("form",{className:"grid gap-4",onSubmit:l,children:[p,g]}),e[18]=l,e[19]=p,e[20]=g,e[21]=x):x=e[21],x}function Qt(o){const e=_.c(10),{org:t,reportApp:n,onOpenReport:i}=o;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Lt,{}),e[0]=a):a=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(F,{}),e[1]=l):l=e[1];const r=!n.virtualMcpId;let c;e[2]!==i||e[3]!==t||e[4]!==n.connectionId||e[5]!==r?(c=s.jsx(Et,{org:t,cdConnectionId:n.connectionId,reportDisabled:r,onOpenReport:i}),e[2]=i,e[3]=t,e[4]=n.connectionId,e[5]=r,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx($t,{className:"md:hidden"}),e[7]=m):m=e[7];let f;return e[8]!==c?(f=s.jsx(L,{visual:a,children:s.jsxs("div",{className:"flex h-[calc(100dvh-3rem)] flex-col gap-10 md:grid md:h-auto",children:[l,c,m]})}),e[8]=c,e[9]=f):f=e[9],f}function ue(o){const e=_.c(2),{message:t}=o;let n;return e[0]!==t?(n=s.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:t}),e[0]=t,e[1]=n):n=e[1],n}export{Zn as default};
@@ -1 +0,0 @@
1
- import{z as he,aE as Ie,b6 as Ae,C as le,aC as De,c as P,j as t,i as ge,B as V,r as q,l as je,w as J,p as $e,K as ne,b as Y,aa as ce,q as Pe,b7 as Oe,E as ze,e as Me,b8 as Ee,m as Ve,G as Ue,F as Fe,t as X,b9 as Re}from"./index-DILk6pqr.js";import{a as Le}from"./extract-connection-data-qW230rJb.js";import{E as ve}from"./empty-state-CfAeMInj.js";import{E as Be,c as He,r as Ge,b as We,d as Xe}from"./connection-form-helpers-DeSC5iva.js";import{c as qe,S as Ke,V as Qe}from"./index-BSzVFCV6.js";import{u as be,T as Je}from"./index-C6ZVo7HH.js";import{u as Ye}from"./use-members-9pMsaLP9.js";import{A as Ze}from"./avatar-3b85MUU5.js";import{a as Ne,b as ye,u as et}from"./use-connection-Bj1m8ynL.js";import{u as _e}from"./use-mcp-client-BdmHrvF5.js";import{a as tt}from"./use-mcp-tools-ChlFTYss.js";import{a as st}from"./use-mcp-prompts-BwQLmLZi.js";import{i as nt,a as ot}from"./mcp-oauth-BTUV7ht5.js";import{I as oe}from"./integration-icon-CxxjWIPp.js";import{s as it}from"./Plus-DfIcHYEj.js";import{z as at,C as rt,af as lt,a4 as ct}from"./agent-icon-CKGTD-zQ.js";import{a as Ce,s as dt}from"./Settings02-Dd9sO-oW.js";import{s as ae}from"./Trash01-DGJ-LjB-.js";import{d as mt,c as ut,b as xt,S as pt,a as ft}from"./sheet-CgvO6KT7.js";import{F as L,b as B,c as H,d as E,f as G,e as ht,a as gt}from"./form-xYXw--Kt.js";import{I as W}from"./input-DntqEqec.js";import{u as jt,D as vt}from"./use-delete-connection-ARKHDNqJ.js";import{c as bt,C as Nt,B as yt,a as _t,b as Ct,d as St,e as wt}from"./monitoring-stats-row-Bly7CEZA.js";import{u as kt}from"./studio-tools-DWzikkvB.js";import{u as Tt}from"./use-virtual-mcp-OPb4DVO0.js";import{i as Se}from"./ChevronRight-MnjJHQHy.js";import{a as we}from"./Users03-BZYHqQGQ.js";import{T as ee,a as It,b as te,c as At}from"./tabs-CVnN0f33.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as Dt}from"./ZapSquare-iu6ldaYZ.js";import{c as $t}from"./Tool01-hxrY31T7.js";import{g as re,M as Pt}from"./types-CsHe6BgD.js";import{C as Ot}from"./collection-search-B-ZTg2tB.js";import{C as zt}from"./card-D0ElZuSJ.js";import{B as Mt}from"./badge-CBy4Rm2Q.js";import{D as Et,a as Vt,b as Ut,c as de}from"./dropdown-menu-CppAWsT_.js";import{d as me,b as ue,c as xe,S as pe,a as R}from"./select-DeFnLWdd.js";import{i as Ft}from"./CheckCircle-CNYYpNQm.js";import{t as Rt}from"./ChevronDown-BVJUps1_.js";import{n as Lt}from"./XCircle-BLfqcVud.js";import{s as se}from"./Star01-Be_MjtDZ.js";import{s as Bt}from"./XClose-4ak3u3qT.js";import"./index-D7pI5IpD.js";import"./sidebar-D5TdEONj.js";import"./LayoutLeft-BsVzrTOG.js";import"./tooltip-DNJ6cRlV.js";import"./ZoomOut-6aWLXLSs.js";import"./Key01-B0h1bFlR.js";import"./auth-B4fF5n_6.js";import"./use-registry-connections-DZ1G13oh.js";import"./use-organization-settings-a8PuTrsa.js";import"./index-CLz5uOtD.js";import"./index-Benu0NlA.js";import"./popover-DmLzbFpk.js";import"./ChevronUp-CKICjFfX.js";import"./SearchMd-B6GaXN7Q.js";import"./use-create-virtual-mcp-Cxqyw0Tn.js";import"./use-navigate-to-agent-Qyyx-mm9.js";import"./Eye-C6daRddp.js";import"./use-org-auth-client-CtaccGLo.js";import"./User01-DR_UC5XH.js";import"./use-collections-D0HN84Lz.js";import"./AlertCircle-qY5ngKLr.js";import"./SwitchHorizontal01-CrHLIeRP.js";import"./ArrowUpRight-C7uYzZ0Z.js";import"./ChevronLeft-CCp89cqe.js";import"./DotsVertical-Bl5GcKp2.js";import"./Stars02-DHcW8N80.js";import"./Globe01-CgHdNpOL.js";import"./FilterLines-B_0u5HAa.js";import"./Globe04-DEangwXD.js";import"./HardDrive-V1dbAXdv.js";import"./LinkExternal01-B9RsD2Us.js";import"./Monitor01-DAM-u2R2.js";import"./Sun-DO_Gt4P2.js";import"./Palette-DT8p7ZEl.js";import"./Play-Blum-MoR.js";import"./Shield01-DLANpVD0.js";import"./Stars01-D3ha2IeY.js";import"./Upload01-CzOJ3UuD.js";import"./Users01-cxH39exM.js";import"./X-CXRx6PGX.js";import"./Zap-DVtX-UPi.js";import"./label-NJtv9Xrj.js";import"./alert-dialog-D5KOx-3H.js";const Ht=he({scopes:De(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Gt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Ht}];function Wt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const l=be(c),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",d=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==d?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",d),e[2]=d,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(at,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(rt,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==a?(S=()=>a(n),e[24]=n,e[25]=a,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ae,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let f;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Xt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ce,{size:13}),e[8]=c):c=e[8];let l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:c})}),e[9]=i,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function qt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:c,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let d;e[4]!==l||e[5]!==c||e[6]!==p?(d=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=c,e[6]=p,e[7]=d):d=e[7];let h;e[8]!==x||e[9]!==d?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,d]}),e[8]=x,e[9]=d,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(q.Suspense,{fallback:t.jsx(Xt,{instance:N,onConfigure:a}),children:t.jsx(Wt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(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 Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(1),{connectionId:n,orgId:a,timeframe:r}=s,o=kt(),i=Qt(r),{data:c}=$e({queryKey:ne.connectionActivity(n,r,a),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:i.startDate.toISOString(),endDate:i.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=bt(c?.logs??[],i),u=l.data,x=l.totalCalls>0;let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=p):p=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),p]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(Nt,{config:Jt,className:"h-16 w-full",children:t.jsxs(yt,{data:u,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(Ct,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Zt(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ss(s){const e=P.c(13),{connectionId:n}=s,[a,r]=q.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let c;e[1]!==a?(c=Kt.map(d=>t.jsx("button",{type:"button",onClick:()=>r(d.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===d.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:d.label},d.value)),e[1]=a,e[2]=c):c=e[2];let l;e[3]!==c?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ts,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==a?(x=t.jsx(q.Suspense,{fallback:u,children:t.jsx(Yt,{connectionId:n,orgId:o.id,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=a,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==c||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,l,u]}),e[11]=o,e[12]=c,e[13]=l,e[14]=x):x=e[14],x}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=c=>t.jsx(ns,{virtualMcp:c,org:a},c.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let l;return e[4]!==a.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let c;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const l=_e(c),u=Ne(a);let x;e[4]!==u||e[5]!==a?(x=u?ke(u):a,e[4]=u,e[5]=a,e[6]=x):x=e[6];const p=x,[d,h]=q.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==d||e[12]!==n){const S=(n??[]).filter(rs),y=d.toLowerCase().trim(),I=y?S.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=C):C=e[21],e[22]!==d?(j=t.jsx(Ot,{value:d,onChange:h,placeholder:"Search apps...",onKeyDown:C}),e[22]=d,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=re(f._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.name}),t.jsx(Je,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=d,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const l=c;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),d=Ne(o??"");let h;e[4]!==d||e[5]!==o?(h=d?ke(d):o,e[4]=d,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let f;e[29]!==C?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let z;e[36]!==l?(z=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=z):z=e[37];let O;e[38]!==z?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[38]=z,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(cs):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let M;e[42]!==A?(M=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=M):M=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==M?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,M]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=M,e[49]=U):U=e[49],U}function cs(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(lt,{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 ds(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(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(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 ms(s){return re(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=i):i=e[4];let c;e[5]!==n.description?(c=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]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),i=ce({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const d=new URL(i);return d.hostname==="api.githubcopilot.com"&&d.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(B,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(G,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(W,{placeholder:"node, bun, python...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(G,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(Be,{value:d.value??[],onChange:d.onChange})}),t.jsx(G,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Mt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),"Authenticated via OAuth",t.jsx(Rt,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:a,children:[t.jsx(dt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(ae,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&d.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:()=>d.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Bt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(W,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ht,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(G,{})]})})]})}function ps(s){return s.command==="npx"}function fs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function hs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Re(s.connection_headers)){const a=s.connection_headers,r=Ge(a.envVars);if(ps(a)){const i=fs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=hs(a);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=We(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:c}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),d=jt({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=q.useState(null),[v,b]=q.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=h??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=qe(k,Gt),f=Ue({resolver:Fe(He),values:fe(h??s)}),w=f.formState.isDirty,z=async()=>{if(!await f.trigger())return;const D=f.getValues(),$=gs(D),F=h?.id??e;await x.update.mutateAsync({id:F,data:$}),f.reset(D)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:D,tokenInfo:$,error:F}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!D){X.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:D}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:D}})}else await x.update.mutateAsync({id:m,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),X.success("Authentication successful")},M=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const $=await m.text();X.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),X.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),X.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...d}),t.jsx(mt,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ut,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(xt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(pt,{className:"text-base",children:h?.title??s.title}),t.jsx(ft,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(gt,{...f,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Name"}),t.jsx(E,{children:t.jsx(W,{...m})}),t.jsx(G,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(E,{children:t.jsx(W,{...m,value:m.value||""})}),t.jsx(G,{})]})})]}),t.jsx(xs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:M,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),d.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(qt,{instances:c,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>d.requestDelete(m),onToggleStatus:async(m,D)=>{try{await x.update.mutateAsync({id:m.id,data:{status:D}}),X.success(D==="active"?"Connection enabled":"Connection disabled")}catch{X.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=c[0]??s,D=m.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,F=`${D} (${$})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:F,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await nt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:r,org:o}=Me(a),{org:i}=J(),c=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",d=p||null;let h;s[4]!==i.id||s[5]!==i.slug||s[6]!==d?(h={connectionId:d,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=d,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(Ss):(x?.tools??[]).map(Cs);e:{if(u.length<=1){j=A;break e}const M=new Set,U=[],m=ys;for(const D of u){const $=D.id===p?A:m(D.tools);for(const F of $)M.has(F.name)||(M.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=st(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const C=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(bs),s[25]=f,s[26]=w):w=s[26];const z=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==c.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==z||s[37]!==u?(O=t.jsx(js,{org:o,connection:x,connectionId:p,isUpdating:c.update.isPending,tools:N,prompts:C,resources:z,siblings:u}),s[30]=c.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=z,s[37]=u,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(q.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function io(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{io as default};