decocms 3.76.1 → 3.77.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 (251) hide show
  1. package/dist/client/assets/{AlertCircle-CU38QLy6.js → AlertCircle-BYmwGQCf.js} +1 -1
  2. package/dist/client/assets/{ArrowRight-DxveGWk4.js → ArrowRight-CvF16wpP.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-ie9OiC1L.js → ArrowUpRight-DpeEXraR.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-JqmGicRO.js → CheckCircle-Bf3Z61R3.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-0fINXUkk.js → ChevronDown-DbkPHjH7.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-DOYNMC-e.js → ChevronLeft-7WikNK_I.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-B6XUFwET.js → ChevronRight-CUrrZIqG.js} +1 -1
  8. package/dist/client/assets/ChevronUp-BT7nyl6k.js +1 -0
  9. package/dist/client/assets/{DotsVertical-CWryBHtG.js → DotsVertical-BpkGXLrP.js} +1 -1
  10. package/dist/client/assets/{Eye-BxG-oJAF.js → Eye-D3915Vo9.js} +1 -1
  11. package/dist/client/assets/{FilterLines-C43ER7Pr.js → FilterLines-BDTdg3RE.js} +1 -1
  12. package/dist/client/assets/{Globe01-C0lWcJBb.js → Globe01-BxZmquSL.js} +1 -1
  13. package/dist/client/assets/{Globe04-CFiBZJOT.js → Globe04-CkBzX8xL.js} +1 -1
  14. package/dist/client/assets/{HardDrive-Ce7Xq_sJ.js → HardDrive-Cko4CWL8.js} +1 -1
  15. package/dist/client/assets/{Key01-CWpW_-Pr.js → Key01-CAY-Xxyp.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-DqymKk5q.js → LayoutLeft-CJuGELXN.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-BC9HiQgY.js → LinkExternal01-DluIM9mv.js} +1 -1
  18. package/dist/client/assets/{Monitor01-pVUVKdPN.js → Monitor01-bbyGUKmR.js} +1 -1
  19. package/dist/client/assets/{Palette-BwK1Ghgx.js → Palette-DLCudjOT.js} +1 -1
  20. package/dist/client/assets/{Play-LsXMa_ja.js → Play-I5x_JKdj.js} +1 -1
  21. package/dist/client/assets/{Plus-BqBWPPKf.js → Plus-DOSjIlBe.js} +1 -1
  22. package/dist/client/assets/{SearchMd-CUFv_rgs.js → SearchMd-q-mL98uP.js} +1 -1
  23. package/dist/client/assets/{Settings02-BFRtrqB4.js → Settings02-C0s-saqA.js} +1 -1
  24. package/dist/client/assets/{Shield01-Bd_FXtHh.js → Shield01-DA5SmW0P.js} +1 -1
  25. package/dist/client/assets/{Star01-ewA9GGVc.js → Star01-1ZF9aI5Y.js} +1 -1
  26. package/dist/client/assets/{Stars01-KZUmRNKW.js → Stars01-CWQtskKI.js} +1 -1
  27. package/dist/client/assets/{Stars02-DYAjCaf7.js → Stars02-DMdFpBOz.js} +1 -1
  28. package/dist/client/assets/{Sun-YkcktInM.js → Sun-CVp19c6p.js} +1 -1
  29. package/dist/client/assets/{SwitchHorizontal01-JVBtN5EN.js → SwitchHorizontal01-BMk8DM55.js} +1 -1
  30. package/dist/client/assets/{Tool01-B-ZIzcOP.js → Tool01-CHEQOI-w.js} +1 -1
  31. package/dist/client/assets/{Trash01-CDCJsikI.js → Trash01-jgpaQcTh.js} +1 -1
  32. package/dist/client/assets/{Upload01-BvNX7dwC.js → Upload01-DmPHnKxK.js} +1 -1
  33. package/dist/client/assets/{User01-DWxhvxAm.js → User01-CQqeHCY8.js} +1 -1
  34. package/dist/client/assets/{Users01-CcfwVwMB.js → Users01-3CAb_L9A.js} +1 -1
  35. package/dist/client/assets/{Users03-Bnzjqkr7.js → Users03-BtWBA-oP.js} +1 -1
  36. package/dist/client/assets/{X-Bmi_qRN4.js → X-BTPYHIvY.js} +1 -1
  37. package/dist/client/assets/{XCircle-DPmDQ715.js → XCircle-BODgW7sH.js} +1 -1
  38. package/dist/client/assets/{XClose-thceHO6y.js → XClose-qC8Lq_ms.js} +1 -1
  39. package/dist/client/assets/{Zap-BiorjSWt.js → Zap-CVq2f6J2.js} +1 -1
  40. package/dist/client/assets/{ZapSquare-BUu_lfxg.js → ZapSquare-C3NGLDu-.js} +1 -1
  41. package/dist/client/assets/{ZoomOut-DvgFp2BT.js → ZoomOut-CjZnoT-b.js} +1 -1
  42. package/dist/client/assets/{access-gate-WjXD0-_B.js → access-gate-CBINLd7U.js} +1 -1
  43. package/dist/client/assets/add-section-modal-A1TEpk88.js +1 -0
  44. package/dist/client/assets/agent-icon-s6bX_I9L.js +1 -0
  45. package/dist/client/assets/agents-list-yRMR0cF5.js +1 -0
  46. package/dist/client/assets/ai-providers-47bmrarJ.js +1 -0
  47. package/dist/client/assets/{alert-CveeSpYR.js → alert-CHc3FYZF.js} +1 -1
  48. package/dist/client/assets/{alert-dialog-BaufekhR.js → alert-dialog-D2GL5qBd.js} +1 -1
  49. package/dist/client/assets/app-editor-DjZhxnMe.js +1 -0
  50. package/dist/client/assets/{auth-BXPdjuWF.js → auth-BX6flE6a.js} +1 -1
  51. package/dist/client/assets/{auth-catchall-BPIlgrZN.js → auth-catchall-BpjOaSW9.js} +1 -1
  52. package/dist/client/assets/{auth-entry-C6zOnMW5.js → auth-entry-DfGml_TH.js} +1 -1
  53. package/dist/client/assets/{auth-split-layout-D86JKDEn.js → auth-split-layout-HWtMmGAh.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-aHfkNvIG.js → automation-list-row-CAkQUGBC.js} +1 -1
  55. package/dist/client/assets/{automation-runs-CJg4mnNP.js → automation-runs-BO1vGgx9.js} +1 -1
  56. package/dist/client/assets/automations-DQeUsmtv.js +1 -0
  57. package/dist/client/assets/{avatar-CSuVLmod.js → avatar-BS-jv_DR.js} +1 -1
  58. package/dist/client/assets/{badge-BS7vcv5t.js → badge-BcU0uhl8.js} +1 -1
  59. package/dist/client/assets/{block-document-BQOe9ocy.js → block-document-CF604YR_.js} +1 -1
  60. package/dist/client/assets/{brand-context-DcuFxecd.js → brand-context-2XxEjOnF.js} +1 -1
  61. package/dist/client/assets/buckets-DVC4Kohh.js +1 -0
  62. package/dist/client/assets/{calendar-DOU5eOAx.js → calendar-CbxSTdbI.js} +1 -1
  63. package/dist/client/assets/{capability-load-error-DMLAXOWw.js → capability-load-error-D-aRp7QN.js} +1 -1
  64. package/dist/client/assets/{card-Dlbea5c8.js → card-BIfVO_jW.js} +1 -1
  65. package/dist/client/assets/category-editor-BfrojdBX.js +1 -0
  66. package/dist/client/assets/{chat-context-CBpDhIU2.js → chat-context-EpSQJI2R.js} +1 -1
  67. package/dist/client/assets/checkbox-B76UlBUd.js +1 -0
  68. package/dist/client/assets/{cli-auth-success-BgUCdALe.js → cli-auth-success-BZa-itTp.js} +1 -1
  69. package/dist/client/assets/collection-detail-BNS2Iwl7.js +1 -0
  70. package/dist/client/assets/collection-display-button-BP4c4hrD.js +1 -0
  71. package/dist/client/assets/{collection-search-ZnbN2Oka.js → collection-search-DYVCc599.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-CI7K_OKd.js → collection-tabs-C0YJH8OQ.js} +1 -1
  73. package/dist/client/assets/{command-FVnvTkmT.js → command-Cx31xkYn.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-Bx2cQDUo.js +1 -0
  75. package/dist/client/assets/connect-desktop-dialog-C3zpTl9v.js +1 -0
  76. package/dist/client/assets/{connection-card-DuX9wPmQ.js → connection-card-C3_U3j25.js} +1 -1
  77. package/dist/client/assets/connection-detail-DttTci9g.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-BAad4_Oz.js → connection-form-helpers-QpFovVZo.js} +1 -1
  79. package/dist/client/assets/connections-4YYDTDW3.js +1 -0
  80. package/dist/client/assets/{context-menu-LUxIfqx1.js → context-menu-DX4dPYJO.js} +1 -1
  81. package/dist/client/assets/{decopilot-D0ubcUmg.js → decopilot-DaDKMLey.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-ByFi2-lw.js → decopilot-sse-pool-CcKrM-Xv.js} +1 -1
  83. package/dist/client/assets/{dialog-CLq1SghM.js → dialog-DGhL6eBy.js} +1 -1
  84. package/dist/client/assets/{domain-settings-BJdz6sAq.js → domain-settings-C1EU9nuj.js} +1 -1
  85. package/dist/client/assets/{drawer-C1zwk63J.js → drawer-B9Cs5iI_.js} +1 -1
  86. package/dist/client/assets/dropdown-menu-CiC9tTdb.js +1 -0
  87. package/dist/client/assets/{empty-state-QuiqZdc3.js → empty-state-yOW3dSH7.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-Dg9BZZhS.js → extract-connection-data-Cmd1hHZE.js} +1 -1
  89. package/dist/client/assets/file-explorer-CRI6MNvr.js +2 -0
  90. package/dist/client/assets/{file-type-icon-BUdJI6sA.js → file-type-icon-C0VVPUpN.js} +1 -1
  91. package/dist/client/assets/{files-feT_4u5f.js → files-BJZQ0FpY.js} +1 -1
  92. package/dist/client/assets/{form-BiL7tBo8.js → form-CaHcodeJ.js} +1 -1
  93. package/dist/client/assets/general-DvXPbO2X.js +1 -0
  94. package/dist/client/assets/{github-repo-picker-Bkke5mPs.js → github-repo-picker-CtfOBr8M.js} +1 -1
  95. package/dist/client/assets/{hooks-DuQsd6Bm.js → hooks-DX86YvO8.js} +1 -1
  96. package/dist/client/assets/image-field-D_fZia_E.js +1 -0
  97. package/dist/client/assets/{import-from-deco-dialog-BJTdqbDe.js → import-from-deco-dialog-Dn6_-blC.js} +1 -1
  98. package/dist/client/assets/{index-D2an7Gp7.js → index-BbdyUut8.js} +1 -1
  99. package/dist/client/assets/{index-0PKQPYj-.js → index-BdFUyuzp.js} +1 -1
  100. package/dist/client/assets/{index-BwwMI_z3.js → index-BiSv4wgs.js} +3 -3
  101. package/dist/client/assets/{index-Dx8Lr08E.js → index-Bzfd3S0P.js} +3 -3
  102. package/dist/client/assets/index-CAejfhLf.js +1 -0
  103. package/dist/client/assets/{index-CaI094MV.js → index-CQF6lVUo.js} +1 -1
  104. package/dist/client/assets/{index-BMvE__1e.js → index-CS96E1bw.js} +2 -2
  105. package/dist/client/assets/{index-BxhIMeWM.js → index-Cyq8kOmo.js} +1 -1
  106. package/dist/client/assets/{index-CKyFmB_U.js → index-D-jSeUPY.js} +1 -1
  107. package/dist/client/assets/{index-QeN7VcKq.js → index-DAfY2rvi.js} +4 -4
  108. package/dist/client/assets/{index-Dxv0Qdk7.js → index-DLBSEic_.js} +1 -1
  109. package/dist/client/assets/index-IC_7I4E3.js +1 -0
  110. package/dist/client/assets/{index-BlldpIQL.js → index-lWXyO72r.js} +1 -1
  111. package/dist/client/assets/{index-CNc7ZujZ.js → index-m_lmKMTo.js} +1 -1
  112. package/dist/client/assets/{index-redirect-D34lI4w0.js → index-redirect--cQpprvo.js} +1 -1
  113. package/dist/client/assets/{input-9-kTRwAW.js → input-Ta_Y1lvO.js} +1 -1
  114. package/dist/client/assets/{integration-icon-EI90wRK8.js → integration-icon-DDugmSqH.js} +1 -1
  115. package/dist/client/assets/{label-DQDXb8Iy.js → label-C8gqICzJ.js} +1 -1
  116. package/dist/client/assets/{login-_ioU-7z7.js → login-15LhOBnr.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-d5uIP20j.js → mcp-oauth-D0PDq8qp.js} +1 -1
  118. package/dist/client/assets/{members-B4-o1sPI.js → members-BCHlqZ_l.js} +2 -2
  119. package/dist/client/assets/{monaco-editor-CSc3_nGj.js → monaco-editor-B83AZ8GN.js} +1 -1
  120. package/dist/client/assets/{monitoring-stats-row-bB_yDQ1d.js → monitoring-stats-row-CH_Ju-wa.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-ai-provider-M2VH_xNw.js → oauth-callback-ai-provider-BB5BJd2l.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-BsRC3N8-.js → oauth-callback-ix708N30.js} +1 -1
  123. package/dist/client/assets/{onboarding-C7eKdLoo.js → onboarding-CMCNAluc.js} +1 -1
  124. package/dist/client/assets/{org-install-_P6DeAjW.js → org-install-DrK1M64X.js} +1 -1
  125. package/dist/client/assets/{org-layout-DCm7IxEI.js → org-layout-C6zhzHkR.js} +1 -1
  126. package/dist/client/assets/{organization-choice-RrOgT99H.js → organization-choice-B6-OJzO9.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-BQFbKmQP.js → page-seo-form-BzBYlYXK.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-BI1e3r-Y.js +1 -0
  129. package/dist/client/assets/{popover-C48maDID.js → popover-BlGotCa-.js} +1 -1
  130. package/dist/client/assets/post-editor-DayUNdZ0.js +1 -0
  131. package/dist/client/assets/preview-dialog-BTdQ1TvF.js +5 -0
  132. package/dist/client/assets/{primitives-BBY0CFqU.js → primitives-CKYU8UlB.js} +1 -1
  133. package/dist/client/assets/profile-B5aimk1S.js +1 -0
  134. package/dist/client/assets/project-app-view-Dnb_LmK_.js +1 -0
  135. package/dist/client/assets/record-editor-BY0yu0r9.js +1 -0
  136. package/dist/client/assets/registry-CcuEWwCn.js +2 -0
  137. package/dist/client/assets/{registry-layout-DCbpe-7M.js → registry-layout-DsXkT4KV.js} +2 -2
  138. package/dist/client/assets/{require-capability-DSFyWoVw.js → require-capability-XP_1zPNl.js} +1 -1
  139. package/dist/client/assets/{required-auth-layout-WiM3pjQr.js → required-auth-layout-qIDzSGtQ.js} +1 -1
  140. package/dist/client/assets/{reset-password-CyW_D8JQ.js → reset-password-RZU_bfNW.js} +1 -1
  141. package/dist/client/assets/roles-CT6FH28_.js +1 -0
  142. package/dist/client/assets/save-referenced-block-CMl5gaJM.js +1 -0
  143. package/dist/client/assets/save-status-Bwyidu0s.js +1 -0
  144. package/dist/client/assets/{schema-form-DsQqx-T1.js → schema-form-CTQz2kTF.js} +1 -1
  145. package/dist/client/assets/{scroll-area-DMoYJ3k8.js → scroll-area-iBbwLoaH.js} +1 -1
  146. package/dist/client/assets/{search-input-DnOeAwxM.js → search-input-CHOe8stk.js} +1 -1
  147. package/dist/client/assets/secrets-DqovOx3Q.js +1 -0
  148. package/dist/client/assets/{sections-editor-Cy3vokJh.js → sections-editor-PK5zsI1T.js} +2 -2
  149. package/dist/client/assets/select-D9WchHFw.js +1 -0
  150. package/dist/client/assets/{select-model-CP3J5XcK.js → select-model-D4uK7qW2.js} +1 -1
  151. package/dist/client/assets/seo-editor-Dwigxdky.js +1 -0
  152. package/dist/client/assets/{settings-layout-B1_sKCgZ.js → settings-layout-CtPsdD9d.js} +1 -1
  153. package/dist/client/assets/{settings-section-D9jClssB.js → settings-section-XLADU1Ft.js} +1 -1
  154. package/dist/client/assets/{sheet-augXQ0K7.js → sheet-DcscOrN-.js} +1 -1
  155. package/dist/client/assets/{shell-controls-B_MLdfQN.js → shell-controls-DCNtyoPf.js} +1 -1
  156. package/dist/client/assets/{shell-layout-BT2b3cNK.js → shell-layout-78V1nK9o.js} +1 -1
  157. package/dist/client/assets/{shell-route-loading-BS9UjtiE.js → shell-route-loading-Drp-Ml9n.js} +1 -1
  158. package/dist/client/assets/{sidebar-DXPYC1Hg.js → sidebar-BHU7Y-eK.js} +1 -1
  159. package/dist/client/assets/{skeleton-onJaQqBb.js → skeleton-DYsLWJ4s.js} +1 -1
  160. package/dist/client/assets/{sortable.esm-CaciG6GE.js → sortable.esm-DYnQaz_O.js} +1 -1
  161. package/dist/client/assets/sso-CUKcu8bh.js +1 -0
  162. package/dist/client/assets/{store-BToWUgCq.js → store-D0RG8VnF.js} +1 -1
  163. package/dist/client/assets/store-registry-l1zQEo3-.js +2 -0
  164. package/dist/client/assets/{studio-tools-B8VUUU-T.js → studio-tools-B6e1wIqk.js} +1 -1
  165. package/dist/client/assets/{switch-BPQwwUV8.js → switch-B0g5vIO8.js} +1 -1
  166. package/dist/client/assets/{table-CRHHLqz7.js → table-CuanbdKo.js} +1 -1
  167. package/dist/client/assets/{tabs-CdvhBRm_.js → tabs-DfpltS-P.js} +1 -1
  168. package/dist/client/assets/{task-status-UVFK-kXi.js → task-status-B9Z3_U-A.js} +1 -1
  169. package/dist/client/assets/{textarea-CWkbF3jO.js → textarea-ji5jId4g.js} +1 -1
  170. package/dist/client/assets/{toggle-group-BsdLNJ12.js → toggle-group-B5UDI72A.js} +1 -1
  171. package/dist/client/assets/{toolbar-BJeFrmdV.js → toolbar-BMWZipjQ.js} +1 -1
  172. package/dist/client/assets/{tooltip-CyNlJ2D3.js → tooltip-BIAup3vg.js} +1 -1
  173. package/dist/client/assets/{types-BAop8rwy.js → types-DmsJ1dgA.js} +1 -1
  174. package/dist/client/assets/{use-ai-providers-BYdj6_Kv.js → use-ai-providers-CSwg9ID-.js} +1 -1
  175. package/dist/client/assets/{use-automations-C40bqyM5.js → use-automations-Cm2EUHDJ.js} +1 -1
  176. package/dist/client/assets/{use-capability-BC9VFiK3.js → use-capability-jAHdTjWn.js} +1 -1
  177. package/dist/client/assets/{use-clock-tick-BwGvIB24.js → use-clock-tick-BH2ii9Ri.js} +1 -1
  178. package/dist/client/assets/{use-collections-yr9dnEMw.js → use-collections-DYVhZ6LZ.js} +1 -1
  179. package/dist/client/assets/{use-connection-DTZL15F4.js → use-connection-CYq4sTpp.js} +1 -1
  180. package/dist/client/assets/{use-copy-DFo7-jB5.js → use-copy-BL1Gi5Ma.js} +1 -1
  181. package/dist/client/assets/{use-create-virtual-mcp-CL5yn8nP.js → use-create-virtual-mcp-BbTDDIhz.js} +1 -1
  182. package/dist/client/assets/{use-debounced-autosave-BXUwU_2r.js → use-debounced-autosave-BWXIh3Xt.js} +1 -1
  183. package/dist/client/assets/use-deco-credits-CjVry_TJ.js +1 -0
  184. package/dist/client/assets/{use-delete-connection-YPzOIAD8.js → use-delete-connection-BP0n__7X.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-DqSldcFs.js → use-file-configs-3VHkoOl7.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-CuBVIy0d.js → use-infinite-scroll-CsW5GqEa.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-CSb3cFHt.js → use-join-requests-BtpSJ5cA.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-DvAPKq6Y.js → use-mcp-client-BcfXwx2l.js} +1 -1
  189. package/dist/client/assets/{use-mcp-prompts-C08ra20t.js → use-mcp-prompts-h_GWEUu_.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-BvNLlDVP.js → use-mcp-tools-DhZgsJaJ.js} +1 -1
  191. package/dist/client/assets/{use-members-CDiFYafh.js → use-members-K1wagpAk.js} +1 -1
  192. package/dist/client/assets/{use-navigate-to-agent--cfMzNid.js → use-navigate-to-agent-GOxU3Hpn.js} +1 -1
  193. package/dist/client/assets/{use-org-auth-client-POkuFZw3.js → use-org-auth-client-CMUSTibk.js} +1 -1
  194. package/dist/client/assets/{use-org-sso-D0AtHZwW.js → use-org-sso-BJNpFjMG.js} +1 -1
  195. package/dist/client/assets/{use-organization-roles-B9r7gSrc.js → use-organization-roles-CnWjq4nf.js} +1 -1
  196. package/dist/client/assets/{use-organization-settings-C6tDwGjc.js → use-organization-settings-CbMA9tyx.js} +1 -1
  197. package/dist/client/assets/{use-registry-connections-DSa_I7y4.js → use-registry-connections-CQIqYcvJ.js} +1 -1
  198. package/dist/client/assets/{use-secrets-DcZ7AQsJ.js → use-secrets-B69dGKd4.js} +1 -1
  199. package/dist/client/assets/{use-status-sounds-D1GhbJRz.js → use-status-sounds-B38RTJiB.js} +1 -1
  200. package/dist/client/assets/{use-view-mode-Jelm-Bs5.js → use-view-mode-DyryORIA.js} +1 -1
  201. package/dist/client/assets/{use-virtual-mcp-CoIXtDgU.js → use-virtual-mcp-B9JwuB8w.js} +1 -1
  202. package/dist/client/assets/useInfiniteQuery-nR5oOHHR.js +1 -0
  203. package/dist/client/assets/useSuspenseInfiniteQuery-mFFPqXZc.js +1 -0
  204. package/dist/client/assets/variant-calendar-CisCsFL5.js +1 -0
  205. package/dist/client/assets/{view-mode-toggle-DpYW1yVt.js → view-mode-toggle-Bt_jVM0U.js} +1 -1
  206. package/dist/client/index.html +1 -1
  207. package/dist/server/cli.js +344 -344
  208. package/dist/server/server.js +235 -235
  209. package/package.json +1 -1
  210. package/dist/client/assets/Check-BLeNHxJZ.js +0 -1
  211. package/dist/client/assets/ChevronUp-uM-ozZ5J.js +0 -1
  212. package/dist/client/assets/add-section-modal-D39KPQ1s.js +0 -1
  213. package/dist/client/assets/agent-icon-DBLutUdr.js +0 -1
  214. package/dist/client/assets/agents-list-BDmLqytH.js +0 -1
  215. package/dist/client/assets/ai-providers-CJDUqvc6.js +0 -1
  216. package/dist/client/assets/app-editor-CoUliEgJ.js +0 -1
  217. package/dist/client/assets/automations-zENxbilR.js +0 -1
  218. package/dist/client/assets/buckets-CgxhDoZh.js +0 -1
  219. package/dist/client/assets/category-editor-DNfPaYT5.js +0 -1
  220. package/dist/client/assets/checkbox-wpAqS3ku.js +0 -1
  221. package/dist/client/assets/collection-detail-B34YWmjR.js +0 -1
  222. package/dist/client/assets/collection-display-button-CSZsuDEp.js +0 -1
  223. package/dist/client/assets/commerce-onboarding-DMq1bIwD.js +0 -1
  224. package/dist/client/assets/connect-desktop-dialog-DJmqWrPH.js +0 -1
  225. package/dist/client/assets/connection-detail-CTpLzjcs.js +0 -1
  226. package/dist/client/assets/connections-BTl6It2w.js +0 -1
  227. package/dist/client/assets/dropdown-menu-EYUmANSx.js +0 -1
  228. package/dist/client/assets/file-explorer-DilO5CaV.js +0 -2
  229. package/dist/client/assets/general-t_xGh-0k.js +0 -1
  230. package/dist/client/assets/image-field-BPXDAjk4.js +0 -1
  231. package/dist/client/assets/index-B-GX2s0h.js +0 -1
  232. package/dist/client/assets/index-DpLRFWMx.js +0 -1
  233. package/dist/client/assets/page-seo-sheet-B1SXxpsG.js +0 -1
  234. package/dist/client/assets/post-editor-DSEtrqlM.js +0 -1
  235. package/dist/client/assets/preview-dialog-DL68uWz9.js +0 -5
  236. package/dist/client/assets/profile-BfQ-nwRV.js +0 -1
  237. package/dist/client/assets/project-app-view-B-fBz6xo.js +0 -1
  238. package/dist/client/assets/record-editor-Bu9CNLzK.js +0 -1
  239. package/dist/client/assets/registry-DEBhPfPr.js +0 -2
  240. package/dist/client/assets/roles-BYfXD5x1.js +0 -1
  241. package/dist/client/assets/save-referenced-block-yb-G98jf.js +0 -1
  242. package/dist/client/assets/save-status-Bsha5t5q.js +0 -1
  243. package/dist/client/assets/secrets-ByyoykgA.js +0 -1
  244. package/dist/client/assets/select-C_iDf6oN.js +0 -1
  245. package/dist/client/assets/seo-editor-Cw0s2Jen.js +0 -1
  246. package/dist/client/assets/sso-_zVzfqX4.js +0 -1
  247. package/dist/client/assets/store-registry-eaRlD2cI.js +0 -2
  248. package/dist/client/assets/use-deco-credits-C-w7pZL9.js +0 -1
  249. package/dist/client/assets/useInfiniteQuery-D5rCytza.js +0 -1
  250. package/dist/client/assets/useSuspenseInfiniteQuery-p_uY5FHN.js +0 -1
  251. package/dist/client/assets/variant-calendar-BlDoEgmA.js +0 -1
@@ -1 +0,0 @@
1
- import{c as se,j as s,B as Z,s as me,r as Y,p as v,t as de}from"./index-BwwMI_z3.js";import{c as k,b as ne,a as ee,D as te}from"./dropdown-menu-EYUmANSx.js";import{s as pe}from"./Star01-ewA9GGVc.js";import{a as fe}from"./Users03-Bnzjqkr7.js";import{a as ge,G as ue}from"./github-repo-picker-Bkke5mPs.js";import{S as he,u as xe,H as ie,W as oe,I as je}from"./import-from-deco-dialog-BJTdqbDe.js";import{u as _e,b as Ce,c as be}from"./use-virtual-mcp-CoIXtDgU.js";import{P as K}from"./index-CKyFmB_U.js";import{a as ye}from"./DotsVertical-CWryBHtG.js";import{a as Ne}from"./Settings02-BFRtrqB4.js";import{s as Se}from"./Trash01-CDCJsikI.js";import{A as De,al as ve}from"./agent-icon-DBLutUdr.js";import{m as Ae}from"./use-navigate-to-agent--cfMzNid.js";import{C as ke}from"./card-Dlbea5c8.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as we}from"./use-capability-BC9VFiK3.js";import{E as Te}from"./empty-state-QuiqZdc3.js";import{u as ze}from"./use-create-virtual-mcp-CL5yn8nP.js";import{c as Ie,b as Pe,d as He,A as Ee,e as Me,g as Oe,a as Be,f as Ge}from"./alert-dialog-BaufekhR.js";import{S as $e}from"./search-input-DnOeAwxM.js";import{s as le}from"./Plus-BqBWPPKf.js";import"./Check-BLeNHxJZ.js";import"./ChevronRight-B6XUFwET.js";import"./dialog-CLq1SghM.js";import"./X-Bmi_qRN4.js";import"./checkbox-wpAqS3ku.js";import"./collection-search-ZnbN2Oka.js";import"./SearchMd-CUFv_rgs.js";import"./use-connection-DTZL15F4.js";import"./use-collections-yr9dnEMw.js";import"./use-mcp-client-DvAPKq6Y.js";import"./auth-BXPdjuWF.js";import"./mcp-oauth-d5uIP20j.js";import"./use-mcp-tools-BvNLlDVP.js";import"./extract-connection-data-Dg9BZZhS.js";import"./sidebar-DXPYC1Hg.js";import"./LayoutLeft-DqymKk5q.js";import"./tooltip-CyNlJ2D3.js";import"./sheet-augXQ0K7.js";import"./AlertCircle-CU38QLy6.js";import"./Tool01-B-ZIzcOP.js";import"./SwitchHorizontal01-JVBtN5EN.js";import"./XCircle-DPmDQ715.js";import"./ArrowRight-DxveGWk4.js";import"./ArrowUpRight-ie9OiC1L.js";import"./ZapSquare-BUu_lfxg.js";import"./CheckCircle-JqmGicRO.js";import"./ChevronDown-0fINXUkk.js";import"./ChevronLeft-DOYNMC-e.js";import"./ChevronUp-uM-ozZ5J.js";import"./Stars02-DYAjCaf7.js";import"./Eye-BxG-oJAF.js";import"./ZoomOut-DvgFp2BT.js";import"./Globe01-C0lWcJBb.js";import"./FilterLines-C43ER7Pr.js";import"./Globe04-CFiBZJOT.js";import"./HardDrive-Ce7Xq_sJ.js";import"./Key01-CWpW_-Pr.js";import"./LinkExternal01-BC9HiQgY.js";import"./Monitor01-pVUVKdPN.js";import"./Sun-YkcktInM.js";import"./Palette-BwK1Ghgx.js";import"./Play-LsXMa_ja.js";import"./Shield01-Bd_FXtHh.js";import"./Stars01-KZUmRNKW.js";import"./Upload01-BvNX7dwC.js";import"./User01-DWxhvxAm.js";import"./Users01-CcfwVwMB.js";import"./XClose-thceHO6y.js";import"./Zap-BiorjSWt.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(k,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(k,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:he,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(k,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ge,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(k,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(k,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(k,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(k,{variant:"destructive",onClick:w=>{w.stopPropagation(),l(w)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(ke,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function ls(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=xe(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=we("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=K,A=K,w=K;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(K.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const q=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==w.Body||t[19]!==I||t[20]!==q?(P=s.jsxs(w.Body,{children:[I,q,J]}),t[17]=J,t[18]=w.Body,t[19]=I,t[20]=q,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(ue,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{ls as default};
@@ -1 +0,0 @@
1
- import{x as B,y as N,aB as ae,aD as le,aE as he,aC as xe,b5 as me,c as U,z as ge,C as be,r as O,j as s,ad as Ee,t as G,ac as ye,s as re,I as oe,d as J,K as Q,k as ve,l as ue,B as V,p as je,a2 as $e}from"./index-BwwMI_z3.js";import{i as Re}from"./AlertCircle-CU38QLy6.js";import{P as te}from"./index-CKyFmB_U.js";import{S as ne}from"./skeleton-onJaQqBb.js";import{b as _e,a as ce,S as de,c as Fe}from"./settings-section-D9jClssB.js";import{u as X,b as se,c as Se}from"./use-ai-providers-BYdj6_Kv.js";import{i as Oe}from"./CheckCircle-JqmGicRO.js";import{i as Me,j as Te,p as Ue,S as ze}from"./chat-context-CBpDhIU2.js";import{d as qe,e as Le}from"./use-organization-settings-C6tDwGjc.js";import{M as Ve}from"./select-model-CP3J5XcK.js";import{u as Be}from"./use-debounced-autosave-BXUwU_2r.js";import{I as ie}from"./input-9-kTRwAW.js";import{a as pe,T as Qe}from"./toggle-group-BsdLNJ12.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-BaufekhR.js";import{u as H}from"./studio-tools-B8VUUU-T.js";import{s as Ge}from"./Plus-BqBWPPKf.js";import{i as Ye}from"./Tool01-B-ZIzcOP.js";import{s as We}from"./Trash01-CDCJsikI.js";import{A as He}from"./avatar-CSuVLmod.js";import{O as Ke,P as Je,C as fe}from"./decopilot-D0ubcUmg.js";import{b as Xe}from"./Settings02-BFRtrqB4.js";import{s as Ze}from"./Eye-BxG-oJAF.js";import{e as et,D as tt,a as st,c as it,d as rt}from"./dialog-CLq1SghM.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-DSFyWoVw.js";import"./sidebar-DXPYC1Hg.js";import"./LayoutLeft-DqymKk5q.js";import"./tooltip-CyNlJ2D3.js";import"./sheet-augXQ0K7.js";import"./X-Bmi_qRN4.js";import"./card-Dlbea5c8.js";import"./ArrowUpRight-ie9OiC1L.js";import"./hooks-DuQsd6Bm.js";import"./use-mcp-client-DvAPKq6Y.js";import"./auth-BXPdjuWF.js";import"./decopilot-sse-pool-ByFi2-lw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CoIXtDgU.js";import"./use-collections-yr9dnEMw.js";import"./tab-id-BptcWVWa.js";import"./drawer-C1zwk63J.js";import"./connect-desktop-dialog-DJmqWrPH.js";import"./Check-BLeNHxJZ.js";import"./User01-DWxhvxAm.js";import"./checkbox-wpAqS3ku.js";import"./select-C_iDf6oN.js";import"./ChevronDown-0fINXUkk.js";import"./ChevronUp-uM-ozZ5J.js";import"./Key01-CWpW_-Pr.js";import"./SearchMd-CUFv_rgs.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-pVUVKdPN.js";import"./ChevronRight-B6XUFwET.js";import"./Stars01-KZUmRNKW.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-BC9VFiK3.js";import"./access-gate-WjXD0-_B.js";import"./capability-load-error-DMLAXOWw.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 p;t[7]!==i||t[8]!==u?.providerId?(p=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]=p):p=t[9];const k=p;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 R=y.keyId??m??"";S(R),a({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let f;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(f=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]=f):f=t[19],f}function pt(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 ft(){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),G.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:p}=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]!==p?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),$={};c?.id&&($[c.id]=j),u?.id&&($[u.id]=_),g?.id&&($[g.id]=p);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,$);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]=p,e[19]=h):h=e[19];const f=c?.id,y=u?.id,R=g?.id;let M;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==p||e[25]!==f||e[26]!==y||e[27]!==R?(M=[o,t,j,_,p,f,y,R],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=p,e[25]=f,e[26]=y,e[27]=R,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 F=b&&!d;let D;e[30]!==S||e[31]!==F?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(pt,{isPending:S,showSaved:F})]}),e[30]=S,e[31]=F,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:$}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{$.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:f}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return f},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(pe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(pe,{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(Qe,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let p;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(p=!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]=p):p=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]!==p||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:[_,p,k]})}),e[22]=_,e[23]=p,e[24]=k,e[25]=I):I=e[25],I}function bt(e){G.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:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.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=Q.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:p,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const f=p?.balanceCents!=null?p.balanceCents/100:null;let y;e[19]!==f?(y=f!=null?`$${f.toFixed(2)}`:"—",e[19]=f,e[20]=y):y=e[20];const R=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 F;e[23]!==c?(F=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]=F):F=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]!==f||e[33]!==R||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",f!=null&&vt(f)),children:R}),e[32]=f,e[33]=R,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 $=h&&"animate-spin";let P;e[39]!==$?(P=ue($),e[39]=$,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]!==F||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:[F,E,Y,Z]})})}),e[54]=F,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){G.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:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.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}),G.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:p}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async f=>{let y;f.apiKey?c?y=JSON.stringify({baseUrl:f.baseUrl||l||"",apiKey:f.apiKey}):y=f.apiKey:c&&f.baseUrl&&f.baseUrl!==l&&(y=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:f.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:Q.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:Q.aiProviders(S.id)}),G.success("Provider updated"),x()},onError:f=>G.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:j(f=>I(f)),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"}),p.label&&s.jsx("p",{className:"text-xs text-destructive",children:p.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=Q.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 p;return t[24]!==l||t[25]!==r||t[26]!==_?(p=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=p):p=t[27],p}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 p;t[5]!==i.id||t[6]!==l?(p=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=p):p=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:Q.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:Q.aiProviders(r.id)}),o.invalidateQueries({queryKey:Q.aiProviderModels(r.id,i.id)}),G.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]!==p||t[13]!==k?(I={mutationFn:p,onSuccess:k,onError:At},t[12]=p,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:f}=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 R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=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]=R):R=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 F;t[21]!==f?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:f,onClick:M,children:T})]}),t[21]=f,t[22]=F):F=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==F||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:F}),t[23]=_,t[24]=u,t[25]=F,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 $;t[38]!==E||t[39]!==w?($=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=$):$=t[40];let P;t[41]!==x||t[42]!==$?(P=s.jsx(Ae,{open:x,onOpenChange:S,children:$}),t[41]=x,t[42]=$,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 G.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(Rt).map(S).filter($t);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ge,{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 $t(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function Ft(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Re,{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 p;e[5]!==n?(p=s.jsx(Je,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=p):p=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let f;e[8]!==k||e[9]!==h?(f=s.jsx(fe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=f):f=e[10];let y;return e[11]!==p||e[12]!==f?(y=s.jsxs(s.Fragment,{children:[p,f]}),e[11]=p,e[12]=f,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(ft,{})}),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(fe,{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(Fe,{children:[t,s.jsx($e,{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(Ft,{error:t??new Error("Failed to load AI providers")})}function Qs(){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{Qs as default};
@@ -1 +0,0 @@
1
- import{c as gt,r as w,j as o,l as St,t as ut,i as yt}from"./index-BwwMI_z3.js";import{i as jt}from"./ChevronRight-B6XUFwET.js";import{S as kt}from"./scroll-area-DMoYJ3k8.js";import{AddSectionModal as _t}from"./add-section-modal-D39KPQ1s.js";import{ah as wt,ai as Bt,f as Nt,g as Rt,aj as At}from"./index-QeN7VcKq.js";import{c as Ct}from"./save-referenced-block-yb-G98jf.js";import{d as Et,b as Kt}from"./schema-form-DsQqx-T1.js";import{S as Ft}from"./save-status-Bsha5t5q.js";import"./agent-icon-DBLutUdr.js";import"./AlertCircle-CU38QLy6.js";import"./Tool01-B-ZIzcOP.js";import"./SwitchHorizontal01-JVBtN5EN.js";import"./Settings02-BFRtrqB4.js";import"./XCircle-DPmDQ715.js";import"./ArrowRight-DxveGWk4.js";import"./ArrowUpRight-ie9OiC1L.js";import"./ZapSquare-BUu_lfxg.js";import"./Users03-Bnzjqkr7.js";import"./CheckCircle-JqmGicRO.js";import"./Check-BLeNHxJZ.js";import"./ChevronDown-0fINXUkk.js";import"./ChevronLeft-DOYNMC-e.js";import"./ChevronUp-uM-ozZ5J.js";import"./DotsVertical-CWryBHtG.js";import"./Stars02-DYAjCaf7.js";import"./Eye-BxG-oJAF.js";import"./ZoomOut-DvgFp2BT.js";import"./Globe01-C0lWcJBb.js";import"./FilterLines-C43ER7Pr.js";import"./Star01-ewA9GGVc.js";import"./Globe04-CFiBZJOT.js";import"./HardDrive-Ce7Xq_sJ.js";import"./Key01-CWpW_-Pr.js";import"./LayoutLeft-DqymKk5q.js";import"./LinkExternal01-BC9HiQgY.js";import"./Monitor01-pVUVKdPN.js";import"./Sun-YkcktInM.js";import"./Palette-BwK1Ghgx.js";import"./Play-LsXMa_ja.js";import"./Plus-BqBWPPKf.js";import"./SearchMd-CUFv_rgs.js";import"./Shield01-Bd_FXtHh.js";import"./Stars01-KZUmRNKW.js";import"./Trash01-CDCJsikI.js";import"./Upload01-BvNX7dwC.js";import"./User01-DWxhvxAm.js";import"./Users01-CcfwVwMB.js";import"./XClose-thceHO6y.js";import"./X-Bmi_qRN4.js";import"./Zap-BiorjSWt.js";import"./use-clock-tick-BwGvIB24.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DFo7-jB5.js";import"./tooltip-CyNlJ2D3.js";import"./file-type-icon-BUdJI6sA.js";import"./dialog-CLq1SghM.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BAop8rwy.js";import"./use-mcp-client-DvAPKq6Y.js";import"./auth-BXPdjuWF.js";import"./chat-context-CBpDhIU2.js";import"./hooks-DuQsd6Bm.js";import"./decopilot-sse-pool-ByFi2-lw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CoIXtDgU.js";import"./use-collections-yr9dnEMw.js";import"./use-ai-providers-BYdj6_Kv.js";import"./studio-tools-B8VUUU-T.js";import"./use-organization-settings-C6tDwGjc.js";import"./shell-layout-BT2b3cNK.js";import"./avatar-CSuVLmod.js";import"./required-auth-layout-WiM3pjQr.js";import"./use-org-sso-D0AtHZwW.js";import"./sheet-augXQ0K7.js";import"./integration-icon-EI90wRK8.js";import"./use-navigate-to-agent--cfMzNid.js";import"./use-connection-DTZL15F4.js";import"./use-mcp-prompts-C08ra20t.js";import"./form-BiL7tBo8.js";import"./label-DQDXb8Iy.js";import"./input-9-kTRwAW.js";import"./select-C_iDf6oN.js";import"./index-BlldpIQL.js";import"./drawer-C1zwk63J.js";import"./collection-search-ZnbN2Oka.js";import"./tabs-CdvhBRm_.js";import"./toggle-group-BsdLNJ12.js";import"./use-deco-credits-C-w7pZL9.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DuX9wPmQ.js";import"./use-registry-connections-DSa_I7y4.js";import"./useInfiniteQuery-D5rCytza.js";import"./use-infinite-scroll-CuBVIy0d.js";import"./extract-connection-data-Dg9BZZhS.js";import"./card-Dlbea5c8.js";import"./collection-tabs-CI7K_OKd.js";import"./badge-BS7vcv5t.js";import"./textarea-CWkbF3jO.js";import"./connection-form-helpers-BAad4_Oz.js";import"./useSuspenseInfiniteQuery-p_uY5FHN.js";import"./mcp-oauth-d5uIP20j.js";import"./connect-desktop-dialog-DJmqWrPH.js";import"./decopilot-D0ubcUmg.js";import"./checkbox-wpAqS3ku.js";import"./skeleton-onJaQqBb.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D9jClssB.js";import"./popover-C48maDID.js";import"./command-FVnvTkmT.js";import"./index-Dxv0Qdk7.js";import"./dropdown-menu-EYUmANSx.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1GhbJRz.js";import"./empty-state-QuiqZdc3.js";import"./toolbar-BJeFrmdV.js";import"./preview-dialog-DL68uWz9.js";import"./index-D2an7Gp7.js";import"./use-mcp-tools-BvNLlDVP.js";import"./use-capability-BC9VFiK3.js";import"./shell-route-loading-BS9UjtiE.js";import"./index-BxhIMeWM.js";import"./alert-dialog-BaufekhR.js";import"./switch-BPQwwUV8.js";import"./use-debounced-autosave-BXUwU_2r.js";import"./index-CKyFmB_U.js";import"./sidebar-DXPYC1Hg.js";import"./search-input-DnOeAwxM.js";import"./github-repo-picker-Bkke5mPs.js";import"./use-secrets-DcZ7AQsJ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DpYW1yVt.js";import"./select-model-CP3J5XcK.js";import"./use-automations-C40bqyM5.js";import"./monaco-editor-CSc3_nGj.js";import"./automation-runs-CJg4mnNP.js";import"./table-CRHHLqz7.js";import"./use-members-CDiFYafh.js";import"./use-org-auth-client-POkuFZw3.js";import"./task-status-UVFK-kXi.js";import"./automation-list-row-aHfkNvIG.js";import"./calendar-DOU5eOAx.js";import"./sortable.esm-CaciG6GE.js";import"./image-field-BPXDAjk4.js";import"./use-file-configs-DqSldcFs.js";function yr(B){const t=gt.c(77),{orgSlug:d,virtualMcpId:f,branch:u,blockKey:i,block:p,meta:m,decofile:l,title:H,excludeFields:G,schemaPending:at,previewBaseUrl:nt}=B,J=at===void 0?!1:at,n=nt===void 0?null:nt,h=typeof p?.__resolveType=="string"?p.__resolveType:"";let A;t[0]!==G||t[1]!==m||t[2]!==h?(A=wt(h,m,G),t[0]=G,t[1]=m,t[2]=h,t[3]=A):A=t[3];const c=A;let C;t[4]!==c?(C=!!c&&Object.keys(c.properties??{}).length>0,t[4]=c,t[5]=C):C=t[5];const Q=C;let E;t[6]!==p||t[7]!==i||t[8]!==m||t[9]!==H?(E=H??(p?Bt(i,p,m):i),t[6]=p,t[7]=i,t[8]=m,t[9]=H,t[10]=E):E=t[10];const x=E;let K;t[11]!==u||t[12]!==d||t[13]!==f?(K={orgSlug:d,virtualMcpId:f,branch:u},t[11]=u,t[12]=d,t[13]=f,t[14]=K):K=t[14];const{save:v,flush:W,isPending:X}=Nt(K);let F;t[15]!==u||t[16]!==d||t[17]!==f?(F={orgSlug:d,virtualMcpId:f,branch:u},t[15]=u,t[16]=d,t[17]=f,t[18]=F):F=t[18];const Y=Rt(F);let $;t[19]!==v?($=Ct((e,r)=>v(e,r)),t[19]=v,t[20]=$):$=t[20];const Z=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=[],t[21]=P):P=t[21];const[s,ft]=w.useState(P),[ot,rt]=w.useState(!1),O=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let T;t[22]!==p?(T=p??{},t[22]=p,t[23]=T):T=t[23];const it=T;let b;t[24]!==tt?(b=tt??{},t[24]=tt,t[25]=b):b=t[25];let V;t[26]!==it||t[27]!==b?(V={...it,...b},t[26]=it,t[27]=b,t[28]=V):V=t[28];const mt=V;let I;t[29]!==i||t[30]!==h||t[31]!==v?(I=e=>{const r=e;ct(r),v(i,{...r,__resolveType:h})},t[29]=i,t[30]=h,t[31]=v,t[32]=I):I=t[32];const st=I;let L;t[33]===Symbol.for("react.memo_cache_sentinel")?(L=e=>{ft(e)},t[33]=L):L=t[33];const pt=L;let q;t[34]!==l||t[35]!==W||t[36]!==Y?(q=async(e,r)=>{try{const{blockKey:a,data:R}=At(e,l);await Y.mutateAsync({blockKey:a,data:R}),ut.success(`Created section "${a}"`),r({__resolveType:a}),W()}catch(a){const R=a,bt=R instanceof Error?R.message:"Could not add section";throw ut.error(bt),R}},t[34]=l,t[35]=W,t[36]=Y,t[37]=q):q=t[37];const g=q;let z;t[38]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{O.current=e.append,rt(!0)},t[38]=z):z=t[38];const vt=z;let M;t[39]!==g?(M=async e=>{const r=O.current;if(r)try{await g(e,a=>{r(a),rt(!1),O.current=null})}catch{}},t[39]=g,t[40]=M):M=t[40];const lt=M;let U;t[41]!==s||t[42]!==x?(U=s.length>0?[x,...s]:[],t[41]=s,t[42]=x,t[43]=U):U=t[43];const N=U;let S;t[44]!==s||t[45]!==N||t[46]!==x?(S=N.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:N.map((e,r)=>{const a=r===N.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Et(s,r)),dt($t)},title:e,className:St("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:x}),t[44]=s,t[45]=N,t[46]=x,t[47]=S):S=t[47];let y;t[48]!==X?(y=o.jsx(Ft,{isPending:X,isError:!1}),t[48]=X,t[49]=y):y=t[49];let j;t[50]!==S||t[51]!==y?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,y]}),t[50]=S,t[51]=y,t[52]=j):j=t[52];let k;t[53]!==i||t[54]!==s||t[55]!==l||t[56]!==mt||t[57]!==et||t[58]!==g||t[59]!==st||t[60]!==Q||t[61]!==m||t[62]!==n||t[63]!==Z||t[64]!==c||t[65]!==J?(k=o.jsx(kt,{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:Q?o.jsx(Kt,{schema:c,value:mt,onChange:st,basePath:"",breadcrumbPath:s,onBreadcrumbChange:pt,decofile:l,meta:m,onSaveReferencedBlock:Z,previewBaseUrl:n,onAddSectionItem:g,onRequestAddSection:vt},`${i}:${et}`):J?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(yt,{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."})})})}),t[53]=i,t[54]=s,t[55]=l,t[56]=mt,t[57]=et,t[58]=g,t[59]=st,t[60]=Q,t[61]=m,t[62]=n,t[63]=Z,t[64]=c,t[65]=J,t[66]=k):k=t[66];let _;t[67]!==ot||t[68]!==l||t[69]!==lt||t[70]!==m||t[71]!==n?(_=n&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(O.current=null)},meta:m,decofile:l,previewBaseUrl:n,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=l,t[69]=lt,t[70]=m,t[71]=n,t[72]=_):_=t[72];let D;return t[73]!==j||t[74]!==k||t[75]!==_?(D=o.jsxs("div",{className:"flex h-full flex-col",children:[j,k,_]}),t[73]=j,t[74]=k,t[75]=_,t[76]=D):D=t[76],D}function $t(B){return B+1}function Pt(B){return B+1}export{yr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as B,j as o,s as L,b as T,r as $,B as M,p as N}from"./index-BwwMI_z3.js";import{s as q}from"./Plus-BqBWPPKf.js";import{i as S}from"./Zap-BiorjSWt.js";import{S as D}from"./search-input-DnOeAwxM.js";import{P as l}from"./index-CKyFmB_U.js";import{E as b}from"./empty-state-QuiqZdc3.js";import{c as O}from"./use-automations-C40bqyM5.js";import{m as V}from"./use-navigate-to-agent--cfMzNid.js";import{A as F}from"./automation-list-row-aHfkNvIG.js";import{o as G}from"./use-mcp-client-DvAPKq6Y.js";import{u as H}from"./use-virtual-mcp-CoIXtDgU.js";import{R as J}from"./require-capability-DSFyWoVw.js";import"./SearchMd-CUFv_rgs.js";import"./sidebar-DXPYC1Hg.js";import"./LayoutLeft-DqymKk5q.js";import"./tooltip-CyNlJ2D3.js";import"./sheet-augXQ0K7.js";import"./X-Bmi_qRN4.js";import"./studio-tools-B8VUUU-T.js";import"./alert-dialog-BaufekhR.js";import"./dropdown-menu-EYUmANSx.js";import"./Check-BLeNHxJZ.js";import"./ChevronRight-B6XUFwET.js";import"./DotsVertical-CWryBHtG.js";import"./Stars02-DYAjCaf7.js";import"./Trash01-CDCJsikI.js";import"./agent-icon-DBLutUdr.js";import"./AlertCircle-CU38QLy6.js";import"./Tool01-B-ZIzcOP.js";import"./SwitchHorizontal01-JVBtN5EN.js";import"./Settings02-BFRtrqB4.js";import"./XCircle-DPmDQ715.js";import"./ArrowRight-DxveGWk4.js";import"./ArrowUpRight-ie9OiC1L.js";import"./ZapSquare-BUu_lfxg.js";import"./Users03-Bnzjqkr7.js";import"./CheckCircle-JqmGicRO.js";import"./ChevronDown-0fINXUkk.js";import"./ChevronLeft-DOYNMC-e.js";import"./ChevronUp-uM-ozZ5J.js";import"./Eye-BxG-oJAF.js";import"./ZoomOut-DvgFp2BT.js";import"./Globe01-C0lWcJBb.js";import"./FilterLines-C43ER7Pr.js";import"./Star01-ewA9GGVc.js";import"./Globe04-CFiBZJOT.js";import"./HardDrive-Ce7Xq_sJ.js";import"./Key01-CWpW_-Pr.js";import"./LinkExternal01-BC9HiQgY.js";import"./Monitor01-pVUVKdPN.js";import"./Sun-YkcktInM.js";import"./Palette-BwK1Ghgx.js";import"./Play-LsXMa_ja.js";import"./Shield01-Bd_FXtHh.js";import"./Stars01-KZUmRNKW.js";import"./Upload01-BvNX7dwC.js";import"./User01-DWxhvxAm.js";import"./Users01-CcfwVwMB.js";import"./XClose-thceHO6y.js";import"./auth-BXPdjuWF.js";import"./use-collections-yr9dnEMw.js";import"./use-capability-BC9VFiK3.js";import"./access-gate-WjXD0-_B.js";import"./capability-load-error-DMLAXOWw.js";function K(){const t=B.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(D,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(q,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function ro(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{ro as default};
@@ -1 +0,0 @@
1
- import{c as D,j as t,a2 as V,r as v,B as F,t as _}from"./index-BwwMI_z3.js";import{i as J}from"./AlertCircle-CU38QLy6.js";import{i as O}from"./HardDrive-Ce7Xq_sJ.js";import{s as L}from"./Plus-BqBWPPKf.js";import{s as Q}from"./Trash01-CDCJsikI.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-BaufekhR.js";import{d as ne,c as le,D as ae,a as oe,b as ce,e as de}from"./dialog-CLq1SghM.js";import{I as N}from"./input-9-kTRwAW.js";import{L as C}from"./label-DQDXb8Iy.js";import{d as me,b as ue,c as fe,S as pe,a as q}from"./select-C_iDf6oN.js";import{S as xe}from"./switch-BPQwwUV8.js";import{S as he}from"./skeleton-onJaQqBb.js";import{T as ge}from"./textarea-CWkbF3jO.js";import{P}from"./index-CKyFmB_U.js";import{c as je}from"./settings-section-D9jClssB.js";import{u as ye,a as be,b as ve}from"./use-file-configs-DqSldcFs.js";import{R as Se}from"./require-capability-DSFyWoVw.js";import"./X-Bmi_qRN4.js";import"./tooltip-CyNlJ2D3.js";import"./Check-BLeNHxJZ.js";import"./ChevronDown-0fINXUkk.js";import"./ChevronUp-uM-ozZ5J.js";import"./sidebar-DXPYC1Hg.js";import"./LayoutLeft-DqymKk5q.js";import"./sheet-augXQ0K7.js";import"./card-Dlbea5c8.js";import"./ArrowUpRight-ie9OiC1L.js";import"./studio-tools-B8VUUU-T.js";import"./use-capability-BC9VFiK3.js";import"./access-gate-WjXD0-_B.js";import"./capability-load-error-DMLAXOWw.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,$]=v.useState(""),w=be();function E(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),$("")}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(),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=>$(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(),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 ot(){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{ot as default};
@@ -1 +0,0 @@
1
- import{c as st,j as e,B as mt}from"./index-BwwMI_z3.js";import{i as pt}from"./ArrowRight-DxveGWk4.js";import{N as lt}from"./agent-icon-DBLutUdr.js";import{I as tt}from"./input-9-kTRwAW.js";import{L as et}from"./label-DQDXb8Iy.js";import{ak as at,al as nt,ar as ct,am as ft}from"./index-QeN7VcKq.js";import{u as dt,s as M,I as gt}from"./primitives-BBY0CFqU.js";import{S as ut}from"./save-status-Bsha5t5q.js";import{a as xt,B as ht,b as yt}from"./block-document-BQOe9ocy.js";import"./AlertCircle-CU38QLy6.js";import"./Tool01-B-ZIzcOP.js";import"./SwitchHorizontal01-JVBtN5EN.js";import"./Settings02-BFRtrqB4.js";import"./XCircle-DPmDQ715.js";import"./ArrowUpRight-ie9OiC1L.js";import"./ZapSquare-BUu_lfxg.js";import"./Users03-Bnzjqkr7.js";import"./CheckCircle-JqmGicRO.js";import"./Check-BLeNHxJZ.js";import"./ChevronDown-0fINXUkk.js";import"./ChevronLeft-DOYNMC-e.js";import"./ChevronRight-B6XUFwET.js";import"./ChevronUp-uM-ozZ5J.js";import"./DotsVertical-CWryBHtG.js";import"./Stars02-DYAjCaf7.js";import"./Eye-BxG-oJAF.js";import"./ZoomOut-DvgFp2BT.js";import"./Globe01-C0lWcJBb.js";import"./FilterLines-C43ER7Pr.js";import"./Star01-ewA9GGVc.js";import"./Globe04-CFiBZJOT.js";import"./HardDrive-Ce7Xq_sJ.js";import"./Key01-CWpW_-Pr.js";import"./LayoutLeft-DqymKk5q.js";import"./LinkExternal01-BC9HiQgY.js";import"./Monitor01-pVUVKdPN.js";import"./Sun-YkcktInM.js";import"./Palette-BwK1Ghgx.js";import"./Play-LsXMa_ja.js";import"./Plus-BqBWPPKf.js";import"./SearchMd-CUFv_rgs.js";import"./Shield01-Bd_FXtHh.js";import"./Stars01-KZUmRNKW.js";import"./Trash01-CDCJsikI.js";import"./Upload01-BvNX7dwC.js";import"./User01-DWxhvxAm.js";import"./Users01-CcfwVwMB.js";import"./XClose-thceHO6y.js";import"./X-Bmi_qRN4.js";import"./Zap-BiorjSWt.js";import"./index-BlldpIQL.js";import"./chat-context-CBpDhIU2.js";import"./hooks-DuQsd6Bm.js";import"./use-mcp-client-DvAPKq6Y.js";import"./auth-BXPdjuWF.js";import"./decopilot-sse-pool-ByFi2-lw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CoIXtDgU.js";import"./use-collections-yr9dnEMw.js";import"./use-ai-providers-BYdj6_Kv.js";import"./studio-tools-B8VUUU-T.js";import"./tab-id-BptcWVWa.js";import"./use-organization-settings-C6tDwGjc.js";import"./scroll-area-DMoYJ3k8.js";import"./use-clock-tick-BwGvIB24.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DFo7-jB5.js";import"./tooltip-CyNlJ2D3.js";import"./file-type-icon-BUdJI6sA.js";import"./dialog-CLq1SghM.js";import"./content-blocks-o63cs2vh.js";import"./types-BAop8rwy.js";import"./shell-layout-BT2b3cNK.js";import"./avatar-CSuVLmod.js";import"./required-auth-layout-WiM3pjQr.js";import"./use-org-sso-D0AtHZwW.js";import"./sheet-augXQ0K7.js";import"./integration-icon-EI90wRK8.js";import"./use-navigate-to-agent--cfMzNid.js";import"./use-connection-DTZL15F4.js";import"./use-mcp-prompts-C08ra20t.js";import"./form-BiL7tBo8.js";import"./select-C_iDf6oN.js";import"./drawer-C1zwk63J.js";import"./collection-search-ZnbN2Oka.js";import"./tabs-CdvhBRm_.js";import"./toggle-group-BsdLNJ12.js";import"./use-deco-credits-C-w7pZL9.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DuX9wPmQ.js";import"./use-registry-connections-DSa_I7y4.js";import"./useInfiniteQuery-D5rCytza.js";import"./use-infinite-scroll-CuBVIy0d.js";import"./extract-connection-data-Dg9BZZhS.js";import"./card-Dlbea5c8.js";import"./collection-tabs-CI7K_OKd.js";import"./badge-BS7vcv5t.js";import"./textarea-CWkbF3jO.js";import"./connection-form-helpers-BAad4_Oz.js";import"./useSuspenseInfiniteQuery-p_uY5FHN.js";import"./mcp-oauth-d5uIP20j.js";import"./connect-desktop-dialog-DJmqWrPH.js";import"./decopilot-D0ubcUmg.js";import"./checkbox-wpAqS3ku.js";import"./skeleton-onJaQqBb.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-D9jClssB.js";import"./popover-C48maDID.js";import"./command-FVnvTkmT.js";import"./index-Dxv0Qdk7.js";import"./dropdown-menu-EYUmANSx.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-D1GhbJRz.js";import"./empty-state-QuiqZdc3.js";import"./toolbar-BJeFrmdV.js";import"./preview-dialog-DL68uWz9.js";import"./index-D2an7Gp7.js";import"./use-mcp-tools-BvNLlDVP.js";import"./use-capability-BC9VFiK3.js";import"./shell-route-loading-BS9UjtiE.js";import"./index-BxhIMeWM.js";import"./alert-dialog-BaufekhR.js";import"./switch-BPQwwUV8.js";import"./use-debounced-autosave-BXUwU_2r.js";import"./index-CKyFmB_U.js";import"./sidebar-DXPYC1Hg.js";import"./search-input-DnOeAwxM.js";import"./github-repo-picker-Bkke5mPs.js";import"./use-secrets-DcZ7AQsJ.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-DpYW1yVt.js";import"./select-model-CP3J5XcK.js";import"./use-automations-C40bqyM5.js";import"./monaco-editor-CSc3_nGj.js";import"./automation-runs-CJg4mnNP.js";import"./table-CRHHLqz7.js";import"./use-members-CDiFYafh.js";import"./use-org-auth-client-POkuFZw3.js";import"./task-status-UVFK-kXi.js";import"./automation-list-row-aHfkNvIG.js";import"./sortable.esm-CaciG6GE.js";import"./schema-form-DsQqx-T1.js";import"./calendar-DOU5eOAx.js";import"./image-field-BPXDAjk4.js";import"./use-file-configs-DqSldcFs.js";function oo(it){const t=st.c(87),{orgSlug:p,virtualMcpId:l,branch:a,blockKey:z,block:G,decofile:H,meta:O,onManagePosts:Q}=it;let F;t[0]!==a||t[1]!==p||t[2]!==l?(F={orgSlug:p,virtualMcpId:l,branch:a},t[0]=a,t[1]=p,t[2]=l,t[3]=F):F=t[3];const m=at(F);let D;t[4]!==G?(D=nt(G,"categories"),t[4]=G,t[5]=D):D=t[5];const ot=D;let L;t[6]!==z||t[7]!==m?(L=o=>{m.mutate({blockKey:z,data:ft(z,"categories",o)})},t[6]=z,t[7]=m,t[8]=L):L=t[8];const[i,V]=dt(ot,L);let R;t[9]!==i||t[10]!==V?(R=(o,rt)=>V({...i,[o]:rt}),t[9]=i,t[10]=V,t[11]=R):R=t[11];const r=R;let s,T;t[12]!==i.slug||t[13]!==H?(s=M(i.slug),T=s?ct(H).filter(o=>o.categorySlugs.includes(s)).length:0,t[12]=i.slug,t[13]=H,t[14]=s,t[15]=T):(s=t[14],T=t[15]);const U=T;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(lt,{size:16,className:"shrink-0 text-muted-foreground"}),t[49]=J):J=t[49];const X=U===1?"post":"posts";let S;t[50]!==U||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:[U," ",X," in this category"]})]}),t[50]=U,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 k;t[53]!==Q||t[54]!==s?(k=()=>Q(s),t[53]=Q,t[54]=s,t[55]=k):k=t[55];let K;t[56]===Symbol.for("react.memo_cache_sentinel")?(K=e.jsx(pt,{size:14}),t[56]=K):K=t[56];let B;t[57]!==Y||t[58]!==Z||t[59]!==k?(B=e.jsxs(mt,{type:"button",variant:"outline",size:"sm",disabled:Y,title:Z,onClick:k,children:["Manage posts",K]}),t[57]=Y,t[58]=Z,t[59]=k,t[60]=B):B=t[60];let _;t[61]!==S||t[62]!==B?(_=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,B]}),t[61]=S,t[62]=B,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]!==p||t[84]!==I||t[85]!==l?(q=e.jsx(yt,{orgSlug:p,virtualMcpId:l,branch:a,children:I}),t[82]=a,t[83]=p,t[84]=I,t[85]=l,t[86]=q):q=t[86],q}export{oo as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as n,l as d,j as c,bF as l,bG as b}from"./index-BwwMI_z3.js";import{i as m}from"./Check-BLeNHxJZ.js";function u(o){const e=n.c(9);let r,i;e[0]!==o?({className:r,...i}=o,e[0]=o,e[1]=r,e[2]=i):(r=e[1],i=e[2]);let a;e[3]!==r?(a=d("peer border-foreground dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[2px] disabled:opacity-50",r),e[3]=r,e[4]=a):a=e[4];let t;e[5]===Symbol.for("react.memo_cache_sentinel")?(t=c.jsx(b,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-primary-foreground transition-none",children:c.jsx(m,{className:"size-3.5"})}),e[5]=t):t=e[5];let s;return e[6]!==i||e[7]!==a?(s=c.jsx(l,{"data-slot":"checkbox",className:a,...i,children:t}),e[6]=i,e[7]=a,e[8]=s):s=e[8],s}export{u as C};
@@ -1 +0,0 @@
1
- import{c as y,j as t,B as F,i as X,x as Ge,y as se,a2 as Pe,r as T,s as ie,C as Qe,l as V,be as Ye,u as Xe,w as G,t as Ze,e as ae,b0 as ke}from"./index-BwwMI_z3.js";import{E as Ae}from"./empty-state-QuiqZdc3.js";import{u as et,a as Ee}from"./use-collections-yr9dnEMw.js";import{u as ce}from"./use-mcp-client-DvAPKq6Y.js";import{F as ne,a as tt,b as de,d as me}from"./form-BiL7tBo8.js";import{I as ue}from"./input-9-kTRwAW.js";import{T as re}from"./textarea-CWkbF3jO.js";import{a as st,b as nt,V as xe,O as ot,M as lt}from"./index-0PKQPYj-.js";import{a9 as rt,x as it,_ as at,aa as ct,W as dt,ab as mt,M as be}from"./agent-icon-DBLutUdr.js";import{g as ut,M as xt,a as Ne}from"./types-BAop8rwy.js";import{A as pt,a as ft,b as ht}from"./alert-CveeSpYR.js";import{d as ve,b as Se,c as ye,S as we,a as oe}from"./select-C_iDf6oN.js";import{c as gt,b as Ce,T as Ie,a as $e}from"./tooltip-CyNlJ2D3.js";import{i as jt}from"./AlertCircle-CU38QLy6.js";import{s as bt}from"./Stars02-DYAjCaf7.js";import{a as Nt}from"./Eye-BxG-oJAF.js";import{i as vt}from"./Play-LsXMa_ja.js";import{i as St}from"./ChevronRight-B6XUFwET.js";import{g as yt}from"./connection-slug-eyAPH6o3.js";import{u as wt,T as Ct}from"./index-BxhIMeWM.js";import{a as Oe,u as Re}from"./use-connection-DTZL15F4.js";import{a as It}from"./use-mcp-tools-BvNLlDVP.js";import{c as $t}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-EI90wRK8.js";import{f as Tt,h as Pt}from"./chat-context-CBpDhIU2.js";import{b as kt}from"./shell-layout-BT2b3cNK.js";import{M as At}from"./monaco-editor-CSc3_nGj.js";import{n as Et}from"./XCircle-DPmDQ715.js";import"./auth-BXPdjuWF.js";import"./label-DQDXb8Iy.js";import"./index-CKyFmB_U.js";import"./sidebar-DXPYC1Hg.js";import"./LayoutLeft-DqymKk5q.js";import"./sheet-augXQ0K7.js";import"./X-Bmi_qRN4.js";import"./ZoomOut-DvgFp2BT.js";import"./Key01-CWpW_-Pr.js";import"./extract-connection-data-Dg9BZZhS.js";import"./use-registry-connections-DSa_I7y4.js";import"./use-organization-settings-C6tDwGjc.js";import"./studio-tools-B8VUUU-T.js";import"./Plus-BqBWPPKf.js";import"./index-CaI094MV.js";import"./index-Dxv0Qdk7.js";import"./popover-C48maDID.js";import"./use-virtual-mcp-CoIXtDgU.js";import"./Check-BLeNHxJZ.js";import"./SearchMd-CUFv_rgs.js";import"./Users03-Bnzjqkr7.js";import"./use-create-virtual-mcp-CL5yn8nP.js";import"./use-navigate-to-agent--cfMzNid.js";import"./Tool01-B-ZIzcOP.js";import"./SwitchHorizontal01-JVBtN5EN.js";import"./Settings02-BFRtrqB4.js";import"./ArrowRight-DxveGWk4.js";import"./ArrowUpRight-ie9OiC1L.js";import"./ZapSquare-BUu_lfxg.js";import"./CheckCircle-JqmGicRO.js";import"./ChevronDown-0fINXUkk.js";import"./ChevronLeft-DOYNMC-e.js";import"./ChevronUp-uM-ozZ5J.js";import"./DotsVertical-CWryBHtG.js";import"./Globe01-C0lWcJBb.js";import"./FilterLines-C43ER7Pr.js";import"./Star01-ewA9GGVc.js";import"./Globe04-CFiBZJOT.js";import"./HardDrive-Ce7Xq_sJ.js";import"./LinkExternal01-BC9HiQgY.js";import"./Monitor01-pVUVKdPN.js";import"./Sun-YkcktInM.js";import"./Palette-BwK1Ghgx.js";import"./Shield01-Bd_FXtHh.js";import"./Stars01-KZUmRNKW.js";import"./Trash01-CDCJsikI.js";import"./Upload01-BvNX7dwC.js";import"./User01-DWxhvxAm.js";import"./Users01-CcfwVwMB.js";import"./XClose-thceHO6y.js";import"./Zap-BiorjSWt.js";import"./mcp-oauth-d5uIP20j.js";import"./badge-BS7vcv5t.js";import"./hooks-DuQsd6Bm.js";import"./decopilot-sse-pool-ByFi2-lw.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BYdj6_Kv.js";import"./tab-id-BptcWVWa.js";import"./avatar-CSuVLmod.js";import"./dialog-CLq1SghM.js";import"./required-auth-layout-WiM3pjQr.js";import"./use-org-sso-D0AtHZwW.js";import"./index-D2an7Gp7.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:zt}),t.jsx(ne,{control:o.control,name:"description",render:Dt})]})]}),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 Dt(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 zt(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=Ee(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 E=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:E.title,description:E.description??null,body:le(E)})}),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(Ae,{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 A;e[18]!==i.description?(A=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]=A):A=e[19];let P;e[20]!==$||e[21]!==A?(P=t.jsx(nt,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[$,A]})}),e[20]=$,e[21]=A,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(Ae,{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 De(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),[A,P]=T.useState(!1),[b,w]=T.useState(null),{org:C}=ie(),k=Oe(e),N=Tt(),E=Pt(),{setChatOpen:U}=kt(),z=`${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"),[ze,Le]=T.useState(!1);O&&!ze&&(Z("ui"),Le(!0));const pe=j?.inputSchema?.properties,fe=pe?Object.keys(pe):[],H=fe.length>0,W={};if(H&&j?.inputSchema?.properties)for(const d of fe)W[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?{...W,...c}:(()=>{const D=u.trim();if(!D)return{};const B=JSON.parse(D);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(([D,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const je=Number(h[D]);Number.isNaN(je)||(h[D]=je)}});const v=await _.callTool({name:s,arguments:h}),K=v.structuredContent??v,He=performance.now(),We=Math.round(He-d);p(K),g(v),I(h);const Ke=JSON.stringify(K),ge=new TextEncoder().encode(Ke).length;w({duration:`${We}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 K=performance.now();w({duration:`${Math.round(K-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(De,{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]??"":W[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]??"":W[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:A?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=>E?.setAppContext(z,d),onTeardown:()=>E?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(At,{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 Wt(){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=Kt;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 Kt(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=Ee(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 A=$;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 E;s[18]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Y,{}),s[18]=E):E=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 z;s[24]!==k?(z=t.jsx(q,{children:t.jsx(De,{children:k})}),s[24]=k,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(_e,{children:t.jsxs(Me,{children:[N,E,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(w){let M;return s[30]!==w||s[31]!==c||s[32]!==A||s[33]!==r?(M=t.jsx(w,{itemId:r,onBack:c,onUpdate:A}),s[30]=w,s[31]=c,s[32]=A,s[33]=r,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Et,{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(Wt,{}),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 Dn(){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{Dn as default};
@@ -1 +0,0 @@
1
- import{c as B,j as s,l as M,B as V}from"./index-BwwMI_z3.js";import{c as z,a as _,b as $,D as E}from"./dropdown-menu-EYUmANSx.js";import{i as L,n as O,b as R,d as A,c as F}from"./SwitchHorizontal01-JVBtN5EN.js";import{i as S}from"./Check-BLeNHxJZ.js";import{T as I,a as K,c as P,b as W}from"./tooltip-CyNlJ2D3.js";import{V as q}from"./view-mode-toggle-DpYW1yVt.js";import{B as G}from"./badge-BS7vcv5t.js";function te(t){const e=B.c(31),{viewMode:r,onViewModeChange:m,sortKey:T,sortDirection:p,onSort:f,sortOptions:u,filters:h}=t;let g;e[0]!==u?(g=u===void 0?[]:u,e[0]=u,e[1]=g):g=e[1];const j=g;let b;e[2]!==h?(b=h===void 0?[]:h,e[2]=h,e[3]=b):b=e[3];const l=b;let v;e[4]!==l?(v=l.filter(J),e[4]=l,e[5]=v):v=e[5];const N=v.length;let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(R,{size:16}),e[6]=w):w=e[6];let i;e[7]!==N?(i=N>0&&s.jsx(G,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:N}),e[7]=N,e[8]=i):i=e[8];let o;e[9]!==i?(o=s.jsx(I,{asChild:!0,children:s.jsx(_,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"icon",className:"relative",children:[w,i]})})}),e[9]=i,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx(K,{children:"Display & filters"}),e[11]=C):C=e[11];let n;e[12]!==o?(n=s.jsx(P,{children:s.jsxs(W,{children:[o,C]})}),e[12]=o,e[13]=n):n=e[13];let a;e[14]!==m||e[15]!==r?(a=m&&r&&s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(q,{value:r,onValueChange:m,fullWidth:!0,options:[{value:"table",icon:s.jsx(A,{})},{value:"cards",icon:s.jsx(F,{})}]})}),e[14]=m,e[15]=r,e[16]=a):a=e[16];let c;e[17]!==f||e[18]!==p||e[19]!==T||e[20]!==j?(c=j.length>0&&f&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),j.map(y=>{const D=T===y.id;return s.jsx(z,{onClick:()=>f(y.id),className:M("h-8 px-2 py-0 cursor-pointer",D&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[D&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!D&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:y.label}),D&&p&&(p==="asc"?s.jsx(L,{size:16,className:"text-foreground shrink-0"}):s.jsx(O,{size:16,className:"text-foreground shrink-0"}))]})},y.id)})]}),e[17]=f,e[18]=p,e[19]=T,e[20]=j,e[21]=c):c=e[21];let d;e[22]!==l?(d=l.map(H),e[22]=l,e[23]=d):d=e[23];let x;e[24]!==a||e[25]!==c||e[26]!==d?(x=s.jsxs($,{align:"end",className:"w-[200px] p-0 gap-0",children:[a,c,d]}),e[24]=a,e[25]=c,e[26]=d,e[27]=x):x=e[27];let k;return e[28]!==n||e[29]!==x?(k=s.jsxs(E,{children:[n,x]}),e[28]=n,e[29]=x,e[30]=k):k=e[30],k}function H(t){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:t.label}),t.options.map(e=>{const r=t.value===e.id;return s.jsx(z,{onClick:()=>t.onChange(e.id),className:M("h-8 px-2 py-0 cursor-pointer",r&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[r&&s.jsx(S,{size:16,className:"text-foreground shrink-0"}),!r&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},t.label)}function J(t){return t.value!=="ALL"}export{te as C};
@@ -1 +0,0 @@
1
- import{c as E,j as t,u as Re,a as Ee,b as ye,m as Ne,r as L,d as Ce,i as be,n as _e,K as pe,k as he,B as le,L as ze}from"./index-BwwMI_z3.js";import{A as Te}from"./auth-entry-C6zOnMW5.js";import{A}from"./auth-split-layout-D86JKDEn.js";import{O as xe}from"./organization-choice-RrOgT99H.js";import{f as we}from"./tab-id-BptcWVWa.js";import{I as Oe}from"./input-9-kTRwAW.js";import{S as Ie,u as Pe,W as Ue,g as Le,C as Ae}from"./use-mcp-client-DvAPKq6Y.js";import{i as ve}from"./ArrowRight-DxveGWk4.js";import{i as $e}from"./Check-BLeNHxJZ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./avatar-CSuVLmod.js";import"./User01-DWxhvxAm.js";import"./auth-BXPdjuWF.js";const ke=/^[a-zA-Z][a-zA-Z\d+.-]*:/,Me=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//,De=/^[^\s/:?#]+\.[^\s/:?#]+:\d+(?:[/?#]|$)/,He=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/i;function je(l){const e=l.trim();if(!e)return{ok:!1,error:"Enter a website URL."};const i=ke.test(e),s=Me.test(e),a=De.test(e);if(i&&!s&&!a)return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const c=s?e:`https://${e}`;let n;try{n=new URL(c)}catch{return{ok:!1,error:"Enter a valid website URL."}}if(n.protocol!=="http:"&&n.protocol!=="https:")return{ok:!1,error:"Use an HTTP or HTTPS website URL."};const o=n.hostname.split(".");return o.length<2||o.some(m=>!m||!He.test(m))?{ok:!1,error:"Enter a valid website URL."}:(n.protocol="https:",{ok:!0,value:n.origin})}function mt(){const l=E.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(We,{}),l[0]=e):e=l[0],e}function We(){const l=E.c(6);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/commerce-onboarding"},l[0]=e):e=l[0];const i=Re(e),{org:s,siteUrl:a}=i,{data:c,isPending:n}=Ee.useSession();if(n){let m;return l[1]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(A,{children:t.jsx(Y,{label:"Preparing commerce onboarding..."})}),l[1]=m):m=l[1],m}if(!c){const m=typeof window>"u"?"/commerce-onboarding":`${window.location.pathname}${window.location.search}`;let g;return l[2]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(A,{children:t.jsx(Te,{callbackUrl:m,allowAutoLogin:!1})}),l[2]=g):g=l[2],g}let o;return l[3]!==s||l[4]!==a?(o=t.jsx(Fe,{requestedOrgSlug:s,siteUrl:a}),l[3]=s,l[4]=a,l[5]=o):o=l[5],o}function Fe(l){const e=E.c(40),{requestedOrgSlug:i,siteUrl:s}=l,a=ye(),c=Ne(),[n,o]=L.useState(null),[m,g]=L.useState(null),h=c.data?.map(Ve)??[];let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={mutationFn:qe,retry:!1,onSuccess:r=>{g(r)}},e[0]=p):p=e[0];const f=Ce(p);if(c.isPending){let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(A,{children:t.jsx(Y,{label:"Preparing commerce onboarding..."})}),e[1]=r):r=e[1],r}if(c.error){let r;return e[2]!==c?(r=t.jsx(re,{title:"We could not load your organizations",description:"Retry to continue commerce setup from this page.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[2]=c,e[3]=r):r=e[3],r}const S=i?h.find(r=>r.slug===i):null;if(S){let r;return e[4]!==S||e[5]!==s?(r=t.jsx(ne,{org:S,initialSiteUrl:s}),e[4]=S,e[5]=s,e[6]=r):r=e[6],r}if(i){let r;return e[7]!==c?(r=t.jsx(re,{title:"Organization not found",description:"We could not find that organization for your account.",actionLabel:"Retry",onRetry:()=>c.refetch()}),e[7]=c,e[8]=r):r=e[8],r}if(n){let r;return e[9]!==n||e[10]!==s?(r=t.jsx(ne,{org:n,initialSiteUrl:s}),e[9]=n,e[10]=s,e[11]=r):r=e[11],r}if(h.length===1&&h[0]){let r;return e[12]!==h[0]||e[13]!==s?(r=t.jsx(ne,{org:h[0],initialSiteUrl:s}),e[12]=h[0],e[13]=s,e[14]=r):r=e[14],r}if(h.length>1){let r;e[15]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(U,{title:"Choose an organization",description:"Select where commerce diagnostics should continue."}),e[15]=r):r=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x=v=>o(v),e[16]=x):x=e[16];let b;return e[17]!==h?(b=t.jsx(A,{children:t.jsxs("div",{className:"grid gap-10",children:[r,t.jsx("div",{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(xe,{organizations:h,selectLabel:"Continue",onSelected:x})})]})}),e[17]=h,e[18]=b):b=e[18],b}if(!m){let r;e[19]!==f?(r=()=>{f.reset(),f.mutate()},e[19]=f,e[20]=r):r=e[20];let x;return e[21]!==f||e[22]!==r?(x=t.jsx(Ye,{mutation:f,onRetry:r}),e[21]=f,e[22]=r,e[23]=x):x=e[23],x}const d=m;if(d?.success&&(d.status==="created"||d.status==="joined"||d.status==="already_has_organization")&&d.organization){let r;return e[24]!==d.organization||e[25]!==s?(r=t.jsx(ne,{org:d.organization,initialSiteUrl:s}),e[24]=d.organization,e[25]=s,e[26]=r):r=e[26],r}if(d?.status==="ambiguous"&&d.organizations&&d.organizations.length>0){let r;e[27]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(U,{title:"Choose an organization",description:"Your email can access more than one organization. Choose where commerce setup should continue."}),e[27]=r):r=e[27];const x=d.domain??void 0;let b;e[28]!==a||e[29]!==s?(b=($,z)=>{_e(),o({...$,slug:z}),a({to:"/commerce-onboarding",search:{org:z,siteUrl:s}})},e[28]=a,e[29]=s,e[30]=b):b=e[30];let v;return e[31]!==d.organizations||e[32]!==x||e[33]!==b?(v=t.jsx(A,{children:t.jsxs("div",{className:"grid gap-10",children:[r,t.jsx("div",{className:"-mx-1 max-h-[60vh] overflow-y-auto px-1",children:t.jsx(xe,{organizations:d.organizations,domain:x,onJoined:b})})]})}),e[31]=d.organizations,e[32]=x,e[33]=b,e[34]=v):v=e[34],v}const C=d?.error??"We could not determine a commerce organization for this account.";let N;e[35]!==f?(N=()=>{g(null),f.reset()},e[35]=f,e[36]=N):N=e[36];let O;return e[37]!==C||e[38]!==N?(O=t.jsx(re,{title:"Commerce onboarding needs support",description:C,actionLabel:"Try again",onRetry:N}),e[37]=C,e[38]=N,e[39]=O):O=e[39],O}async function qe(){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&&_e(),e}function Ve(l){return{id:l.id,name:l.name,slug:l.slug,logo:l.logo??null}}function Ye(l){const e=E.c(7),{mutation:i,onRetry:s}=l,a=L.useRef(!1);let c;e[0]!==i?(c=g=>{!g||a.current||(a.current=!0,i.mutate())},e[0]=i,e[1]=c):c=e[1];const n=c;if(i.error){let g;return e[2]!==s?(g=t.jsx(re,{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:s}),e[2]=s,e[3]=g):g=e[3],g}let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Y,{label:"Preparing your commerce workspace..."}),e[4]=o):o=e[4];let m;return e[5]!==n?(m=t.jsx(A,{children:t.jsx("div",{ref:n,children:o})}),e[5]=n,e[6]=m):m=e[6],m}function U(l){const e=E.c(9),{title:i,description:s}=l;let a,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),c=t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"}),e[0]=a,e[1]=c):(a=e[0],c=e[1]);let n;e[2]!==i?(n=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:i}),e[2]=i,e[3]=n):n=e[3];let o;e[4]!==s?(o=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:s}),e[4]=s,e[5]=o):o=e[5];let m;return e[6]!==n||e[7]!==o?(m=t.jsxs("div",{className:"grid gap-10",children:[a,c,t.jsxs("div",{className:"space-y-2",children:[n,o]})]}),e[6]=n,e[7]=o,e[8]=m):m=e[8],m}function Y(l){const e=E.c(3),{label:i}=l;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(be,{size:14,className:"animate-spin text-muted-foreground"}),e[0]=s):s=e[0];let a;return e[1]!==i?(a=t.jsxs("div",{className:"flex items-center gap-2 py-4",role:"status","aria-live":"polite",children:[s,t.jsx("span",{className:"text-sm text-muted-foreground",children:i})]}),e[1]=i,e[2]=a):a=e[2],a}function re(l){const e=E.c(9),{title:i,description:s,actionLabel:a,onRetry:c}=l;let n;e[0]!==s||e[1]!==i?(n=t.jsx(U,{title:i,description:s}),e[0]=s,e[1]=i,e[2]=n):n=e[2];let o;e[3]!==a||e[4]!==c?(o=t.jsx(le,{type:"button",size:"xl",className:"w-full",onClick:c,children:a}),e[3]=a,e[4]=c,e[5]=o):o=e[5];let m;return e[6]!==n||e[7]!==o?(m=t.jsx(A,{children:t.jsxs("div",{className:"grid gap-10",children:[n,o]})}),e[6]=n,e[7]=o,e[8]=m):m=e[8],m}function Ke(l){return l.content?.find(e=>e.text)?.text??"Commerce Discovery setup failed."}function fe(l){const e=l;if(e.isError)throw new Error(Ke(e));return e.structuredContent??l}function ne(l){const e=E.c(5),{org:i,initialSiteUrl:s}=l;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Y,{label:"Connecting workspace..."}),e[0]=a):a=e[0];const c=`${i.id}:${s??""}`;let n;return e[1]!==s||e[2]!==i||e[3]!==c?(n=t.jsx(A,{children:t.jsx(L.Suspense,{fallback:a,children:t.jsx(Qe,{org:i,initialSiteUrl:s},c)})}),e[1]=s,e[2]=i,e[3]=c,e[4]=n):n=e[4],n}function Qe(l){const e=E.c(100),{org:i,initialSiteUrl:s}=l,a=ye();let c;e[0]!==i.id||e[1]!==i.slug?(c={connectionId:Ie,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=c):c=e[2];const n=Pe(c),[o,m]=L.useState(s??""),[g,h]=L.useState(null),[p,f]=L.useState(null),S=L.useRef(!1),d=Ue.COMMERCE_DISCOVERY(i.id),C=Le(i.id),N=pe.commerceDiscoveryConnection(i.id,d);let O;e[3]!==d||e[4]!==n?(O=async()=>{const u=await n.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}});return fe(u)},e[3]=d,e[4]=n,e[5]=O):O=e[5];let r;e[6]!==N||e[7]!==O?(r={queryKey:N,queryFn:O,retry:!1},e[6]=N,e[7]=O,e[8]=r):r=e[8];const x=he(r),b=pe.commerceDiscoveryVirtualMcp(i.id,C);let v;e[9]!==n||e[10]!==C?(v=async()=>{const u=await n.callTool({name:"COLLECTION_VIRTUAL_MCP_GET",arguments:{id:C}});return fe(u)},e[9]=n,e[10]=C,e[11]=v):v=e[11];let $;e[12]!==b||e[13]!==v?($={queryKey:b,queryFn:v,retry:!1},e[12]=b,e[13]=v,e[14]=$):$=e[14];const z=he($);let k;e[15]!==n?(k=async u=>{const j=await n.callTool({name:"COMMERCE_DISCOVERY_SETUP",arguments:{siteUrl:u}});return fe(j)},e[15]=n,e[16]=k):k=e[16];let M;e[17]!==x||e[18]!==z?(M=u=>{h(u),f(null),x.refetch(),z.refetch()},e[17]=x,e[18]=z,e[19]=M):M=e[19];let K;e[20]===Symbol.for("react.memo_cache_sentinel")?(K=u=>{f(u instanceof Error?u.message:"Commerce Discovery setup failed.")},e[20]=K):K=e[20];let Q;e[21]!==k||e[22]!==M?(Q={mutationFn:k,retry:!1,onSuccess:M,onError:K},e[21]=k,e[22]=M,e[23]=Q):Q=e[23];const T=Ce(Q),B=x.isPending||z.isPending,ae=x.error??z.error,Z=!!x.data?.item&&!!z.data?.item;let G;e[24]!==T?(G=u=>{const j=je(u);if(!j.ok){f(j.error);return}f(null),T.mutate(j.value)},e[24]=T,e[25]=G):G=e[25];const D=G;let J;e[26]!==s||e[27]!==D||e[28]!==B||e[29]!==Z?(J=u=>{!u||S.current||B||Z||!s||(S.current=!0,D(s))},e[26]=s,e[27]=D,e[28]=B,e[29]=Z,e[30]=J):J=e[30];const ce=J;let X;e[31]!==D||e[32]!==o?(X=u=>{u.preventDefault(),D(o)},e[31]=D,e[32]=o,e[33]=X):X=e[33];const I=X;let ee;e[34]!==d||e[35]!==g?.reportApp||e[36]!==C?(ee=g?.reportApp??{connectionId:d,virtualMcpId:C,toolName:Ae},e[34]=d,e[35]=g?.reportApp,e[36]=C,e[37]=ee):ee=e[37];const w=ee;let te;e[38]!==a||e[39]!==i.slug||e[40]!==w.connectionId||e[41]!==w.toolName||e[42]!==w.virtualMcpId?(te=()=>{localStorage.setItem(ze.sidebarOpen(),JSON.stringify(!1)),a({to:"/$org/$taskId",params:{org:i.slug,taskId:crypto.randomUUID()},search:{virtualmcpid:w.virtualMcpId,main:we(w.connectionId,w.toolName),chat:0}})},e[38]=a,e[39]=i.slug,e[40]=w.connectionId,e[41]=w.toolName,e[42]=w.virtualMcpId,e[43]=te):te=e[43];const me=te;if(B){const u=`Commerce setup will continue for ${i.name}.`;let j;e[44]!==u?(j=t.jsx(U,{title:"Commerce diagnostics",description:u}),e[44]=u,e[45]=j):j=e[45];let _;e[46]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Y,{label:"Checking Commerce Discovery setup..."}),e[46]=_):_=e[46];let y;return e[47]!==j?(y=t.jsxs("div",{className:"grid gap-10",children:[j,_]}),e[47]=j,e[48]=y):y=e[48],y}if(ae){const u=ae instanceof Error?ae.message:"We could not check Commerce Discovery setup.",j=`Commerce setup will continue for ${i.name}.`;let _;e[49]!==j?(_=t.jsx(U,{title:"Commerce diagnostics",description:j}),e[49]=j,e[50]=_):_=e[50];let y;e[51]!==u?(y=t.jsx(oe,{message:u}),e[51]=u,e[52]=y):y=e[52];let R;e[53]!==x||e[54]!==z?(R=t.jsx(le,{type:"button",size:"xl",className:"w-full",onClick:()=>{x.refetch(),z.refetch()},children:"Retry"}),e[53]=x,e[54]=z,e[55]=R):R=e[55];let P;return e[56]!==_||e[57]!==y||e[58]!==R?(P=t.jsxs("div",{className:"grid gap-10",children:[_,y,R]}),e[56]=_,e[57]=y,e[58]=R,e[59]=P):P=e[59],P}if(Z){let u;return e[60]!==me||e[61]!==i||e[62]!==w?(u=t.jsx(Be,{org:i,reportApp:w,onOpenReport:me}),e[60]=me,e[61]=i,e[62]=w,e[63]=u):u=e[63],u}if(s){let u;e[64]!==s?(u=je(s),e[64]=s,e[65]=u):u=e[65];const j=u;if(!j.ok){const de=`Commerce setup will continue for ${i.name}.`;let F;e[66]!==de?(F=t.jsx(U,{title:"Commerce diagnostics",description:de}),e[66]=de,e[67]=F):F=e[67];let q;e[68]!==j.error?(q=t.jsx(oe,{message:j.error}),e[68]=j.error,e[69]=q):q=e[69];let V;e[70]!==I||e[71]!==p||e[72]!==T.isPending||e[73]!==o?(V=t.jsx(ge,{siteUrl:o,error:p,isSubmitting:T.isPending,onSiteUrlChange:m,onSubmit:I}),e[70]=I,e[71]=p,e[72]=T.isPending,e[73]=o,e[74]=V):V=e[74];let ie;return e[75]!==F||e[76]!==q||e[77]!==V?(ie=t.jsxs("div",{className:"grid gap-10",children:[F,q,V]}),e[75]=F,e[76]=q,e[77]=V,e[78]=ie):ie=e[78],ie}const _=`Commerce Discovery is being prepared for ${j.value}.`;let y;e[79]!==_?(y=t.jsx(U,{title:"Commerce diagnostics",description:_}),e[79]=_,e[80]=y):y=e[80];let R;e[81]!==I||e[82]!==p||e[83]!==T||e[84]!==o?(R=p?t.jsxs(t.Fragment,{children:[t.jsx(oe,{message:p}),t.jsx(ge,{siteUrl:o,error:null,isSubmitting:T.isPending,onSiteUrlChange:m,onSubmit:I})]}):t.jsx(Y,{label:"Setting up Commerce Discovery..."}),e[81]=I,e[82]=p,e[83]=T,e[84]=o,e[85]=R):R=e[85];let P;return e[86]!==y||e[87]!==R||e[88]!==ce?(P=t.jsxs("div",{ref:ce,className:"grid gap-10",children:[y,R]}),e[86]=y,e[87]=R,e[88]=ce,e[89]=P):P=e[89],P}const ue=`Commerce setup will continue for ${i.name}.`;let H;e[90]!==ue?(H=t.jsx(U,{title:"Commerce diagnostics",description:ue}),e[90]=ue,e[91]=H):H=e[91];let W;e[92]!==I||e[93]!==p||e[94]!==T.isPending||e[95]!==o?(W=t.jsx(ge,{siteUrl:o,error:p,isSubmitting:T.isPending,onSiteUrlChange:m,onSubmit:I}),e[92]=I,e[93]=p,e[94]=T.isPending,e[95]=o,e[96]=W):W=e[96];let se;return e[97]!==H||e[98]!==W?(se=t.jsxs("div",{className:"grid gap-10",children:[H,W]}),e[97]=H,e[98]=W,e[99]=se):se=e[99],se}function ge(l){const e=E.c(22),{siteUrl:i,error:s,isSubmitting:a,onSiteUrlChange:c,onSubmit:n}=l;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("label",{className:"text-sm font-medium",htmlFor:"commerce-site-url",children:"Website URL"}),e[0]=o):o=e[0];let m;e[1]!==c?(m=N=>c(N.target.value),e[1]=c,e[2]=m):m=e[2];const g=!!s;let h;e[3]!==a||e[4]!==i||e[5]!==m||e[6]!==g?(h=t.jsx(Oe,{id:"commerce-site-url",type:"text",inputMode:"url",value:i,onChange:m,placeholder:"https://example.com","aria-invalid":g,disabled:a}),e[3]=a,e[4]=i,e[5]=m,e[6]=g,e[7]=h):h=e[7];let p;e[8]!==s?(p=s?t.jsx(oe,{message:s}):null,e[8]=s,e[9]=p):p=e[9];let f;e[10]!==h||e[11]!==p?(f=t.jsxs("div",{className:"grid gap-2",children:[o,h,p]}),e[10]=h,e[11]=p,e[12]=f):f=e[12];let S;e[13]!==a?(S=a?t.jsxs(t.Fragment,{children:[t.jsx(be,{size:14,className:"animate-spin"}),"Setting up"]}):t.jsxs(t.Fragment,{children:["Continue",t.jsx(ve,{size:16})]}),e[13]=a,e[14]=S):S=e[14];let d;e[15]!==a||e[16]!==S?(d=t.jsx(le,{type:"submit",size:"xl",className:"w-full",disabled:a,children:S}),e[15]=a,e[16]=S,e[17]=d):d=e[17];let C;return e[18]!==n||e[19]!==f||e[20]!==d?(C=t.jsxs("form",{className:"grid gap-4",onSubmit:n,children:[f,d]}),e[18]=n,e[19]=f,e[20]=d,e[21]=C):C=e[21],C}function Be(l){const e=E.c(12),{org:i,reportApp:s,onOpenReport:a}=l,c=`Commerce Discovery is connected for ${i.name}.`;let n;e[0]!==c?(n=t.jsx(U,{title:"Commerce Discovery",description:c}),e[0]=c,e[1]=n):n=e[1];let o,m;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Se,{title:"Commerce Discovery MCP",description:"Report generation and commerce diagnostics are connected."}),m=t.jsx(Se,{title:"Commerce Discovery agent",description:"The report workspace is ready for this organization."}),e[2]=o,e[3]=m):(o=e[2],m=e[3]);let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs("div",{className:"grid gap-3",children:[o,m,t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4",children:[t.jsx("p",{className:"text-sm font-medium",children:"Companion MCPs"}),t.jsx("p",{className:"mt-1 text-sm text-muted-foreground leading-5",children:"Commerce Discovery requires platform integrations such as VTEX. These companion MCP requirements will be available soon."})]})]}),e[4]=g):g=e[4];const h=!s.virtualMcpId;let p;e[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ve,{size:16}),e[5]=p):p=e[5];let f;e[6]!==a||e[7]!==h?(f=t.jsxs(le,{type:"button",size:"xl",className:"w-full",onClick:a,disabled:h,children:["See full report",p]}),e[6]=a,e[7]=h,e[8]=f):f=e[8];let S;return e[9]!==n||e[10]!==f?(S=t.jsxs("div",{className:"grid gap-10",children:[n,g,f]}),e[9]=n,e[10]=f,e[11]=S):S=e[11],S}function Se(l){const e=E.c(8),{title:i,description:s}=l;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("span",{className:"mt-0.5 inline-flex size-5 shrink-0 items-center justify-center rounded-full bg-success text-success-foreground",children:t.jsx($e,{size:12})}),e[0]=a):a=e[0];let c;e[1]!==i?(c=t.jsx("p",{className:"text-sm font-medium",children:i}),e[1]=i,e[2]=c):c=e[2];let n;e[3]!==s?(n=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground leading-5",children:s}),e[3]=s,e[4]=n):n=e[4];let o;return e[5]!==c||e[6]!==n?(o=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 p-4 flex gap-3",children:[a,t.jsxs("div",{className:"min-w-0",children:[c,n]})]}),e[5]=c,e[6]=n,e[7]=o):o=e[7],o}function oe(l){const e=E.c(2),{message:i}=l;let s;return e[0]!==i?(s=t.jsx("p",{className:"text-sm leading-5 text-destructive",role:"alert",children:i}),e[0]=i,e[1]=s):s=e[1],s}export{mt as default};
@@ -1 +0,0 @@
1
- import{c as b,s as k,K as w,k as z,j as s,r as M,B as T,l as v}from"./index-BwwMI_z3.js";import{a as I,b as S,D,c as E,d as R}from"./dialog-CLq1SghM.js";import{S as _}from"./chat-context-CBpDhIU2.js";import{i as $}from"./Check-BLeNHxJZ.js";import{a as A}from"./Eye-BxG-oJAF.js";import{u as B}from"./studio-tools-B8VUUU-T.js";const L={online:!1,capabilities:[],ready:!1};function F(){const i=b.c(7),{org:e}=k(),l=B();let o;i[0]!==e.id?(o=w.currentLink(e.id),i[0]=e.id,i[1]=o):o=i[1];let t;i[2]!==l?(t=async()=>{const f=await l.call("LINK_CURRENT_GET",{});return f?{...f,ready:!0}:{...L,ready:!0}},i[2]=l,i[3]=t):t=i[3];let n;i[4]!==o||i[5]!==t?(n={queryKey:o,queryFn:t,staleTime:4e3,refetchInterval:5e3,refetchOnWindowFocus:!0},i[4]=o,i[5]=t,i[6]=n):n=i[6];const{data:p}=z(n);return p??L}function K(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}function O(i){const e=b.c(3),{size:l}=i,o=l===void 0?16:l;let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=t):t=e[0];let n;return e[1]!==o?(n=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:o,height:o,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:t}),e[1]=o,e[2]=n):n=e[2],n}const y="bunx decocms@latest link",N=[{capability:"claude-code",label:"Claude Code",description:"Runs through the Claude Code CLI",icon:s.jsx(K,{size:18})},{capability:"codex",label:"Codex",description:"Runs through the Codex CLI",icon:s.jsx(O,{size:18})}];function Q(i){return N.filter(e=>i.includes(e.capability)).map(e=>e.label)}function U(i){const e=b.c(21),{open:l,onOpenChange:o}=i,t=F(),[n,p]=M.useState(!1),f=t.hostname??t.machineId??"Your desktop",j=t.online?`Connected to ${f}`:"Connect your desktop";let a;e[0]!==j?(a=s.jsx(I,{children:j}),e[0]=j,e[1]=a):a=e[1];const C=t.online?"This machine provides the following local agents.":"Run this command in your desktop terminal. The dialog will close once your desktop is online.";let r;e[2]!==C?(r=s.jsx(S,{children:C}),e[2]=C,e[3]=r):r=e[3];let c;e[4]!==a||e[5]!==r?(c=s.jsxs(D,{children:[a,r]}),e[4]=a,e[5]=r,e[6]=c):c=e[6];let d;e[7]!==n||e[8]!==t.online?(d=!t.online&&s.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted px-3 py-2 font-mono text-sm",children:[s.jsx("span",{className:"flex-1",children:y}),s.jsx(T,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>{navigator.clipboard.writeText(y),p(!0),setTimeout(()=>p(!1),1500)},children:n?s.jsx($,{size:14}):s.jsx(A,{size:14})})]}),e[7]=n,e[8]=t.online,e[9]=d):d=e[9];let u;e[10]!==t.capabilities||e[11]!==t.online?(u=t.online?s.jsx("div",{className:"flex flex-col gap-3 text-sm",children:s.jsx("div",{className:"flex flex-col gap-2",children:N.map(x=>{const g=t.capabilities.includes(x.capability);return s.jsxs("div",{className:v("flex items-center gap-3 rounded-md border px-3 py-2",g?"border-border bg-background text-foreground":"border-border/60 bg-muted/40 text-muted-foreground"),children:[s.jsx("div",{className:v("flex size-6 items-center justify-center",g?"text-foreground":"text-muted-foreground"),children:x.icon}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:x.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:g?x.description:"Not detected"})]}),s.jsx("span",{className:v("size-2 rounded-full",g?"bg-success":"bg-muted-foreground/30")})]},x.capability)})})}):s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(_,{size:"sm"}),"Waiting for desktop…"]}),e[10]=t.capabilities,e[11]=t.online,e[12]=u):u=e[12];let m;e[13]!==c||e[14]!==d||e[15]!==u?(m=s.jsxs(E,{className:"sm:max-w-md",children:[c,d,u]}),e[13]=c,e[14]=d,e[15]=u,e[16]=m):m=e[16];let h;return e[17]!==o||e[18]!==l||e[19]!==m?(h=s.jsx(R,{open:l,onOpenChange:o,children:m}),e[17]=o,e[18]=l,e[19]=m,e[20]=h):h=e[20],h}export{U as C,K as a,O as b,F as u,Q as v};
@@ -1 +0,0 @@
1
- import{x as fe,aD as Ie,b5 as Ae,y as le,aB as De,c as P,j as t,i as ge,B as E,r as q,l as je,s as J,a5 as $e,K as ne,b as Y,a9 as ce,o as Pe,b6 as Oe,a2 as ze,e as Me,b7 as Ve,I as Ee,C as Ue,z as Fe,t as G,b8 as Re}from"./index-BwwMI_z3.js";import{g as Le}from"./extract-connection-data-Dg9BZZhS.js";import{E as ve}from"./empty-state-QuiqZdc3.js";import{E as Be,c as He,r as We,b as Xe,d as Ge}from"./connection-form-helpers-BAad4_Oz.js";import{c as qe,S as Ke,V as Qe}from"./index-0PKQPYj-.js";import{u as be,T as Je}from"./index-BxhIMeWM.js";import{u as Ye}from"./use-members-CDiFYafh.js";import{A as Ze}from"./avatar-CSuVLmod.js";import{a as Ne,b as ye,u as et}from"./use-connection-DTZL15F4.js";import{u as _e}from"./use-mcp-client-DvAPKq6Y.js";import{a as tt}from"./use-mcp-tools-BvNLlDVP.js";import{a as st}from"./use-mcp-prompts-C08ra20t.js";import{i as nt,a as ot}from"./mcp-oauth-d5uIP20j.js";import{I as oe}from"./integration-icon-EI90wRK8.js";import{s as it}from"./Plus-BqBWPPKf.js";import{z as at,C as rt,a8 as lt,Z as ct}from"./agent-icon-DBLutUdr.js";import{a as Ce,s as dt}from"./Settings02-BFRtrqB4.js";import{s as ae}from"./Trash01-CDCJsikI.js";import{d as mt,c as ut,b as xt,S as pt,a as ht}from"./sheet-augXQ0K7.js";import{F as L,b as B,c as H,d as V,f as W,e as ft,a as gt}from"./form-BiL7tBo8.js";import{I as X}from"./input-9-kTRwAW.js";import{u as jt,D as vt}from"./use-delete-connection-YPzOIAD8.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-bB_yDQ1d.js";import{u as kt}from"./studio-tools-B8VUUU-T.js";import{u as Tt}from"./use-virtual-mcp-CoIXtDgU.js";import{i as Se}from"./ChevronRight-B6XUFwET.js";import{a as we}from"./Users03-Bnzjqkr7.js";import{T as ee,a as It,b as te,c as At}from"./tabs-CdvhBRm_.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as Dt}from"./ZapSquare-BUu_lfxg.js";import{b as $t}from"./Tool01-B-ZIzcOP.js";import{g as re,M as Pt}from"./types-BAop8rwy.js";import{C as Ot}from"./collection-search-ZnbN2Oka.js";import{C as zt}from"./card-Dlbea5c8.js";import{B as Mt}from"./badge-BS7vcv5t.js";import{D as Vt,a as Et,b as Ut,c as de}from"./dropdown-menu-EYUmANSx.js";import{d as me,b as ue,c as xe,S as pe,a as R}from"./select-C_iDf6oN.js";import{i as Ft}from"./CheckCircle-JqmGicRO.js";import{t as Rt}from"./ChevronDown-0fINXUkk.js";import{n as Lt}from"./XCircle-DPmDQ715.js";import{s as se}from"./Star01-ewA9GGVc.js";import{s as Bt}from"./XClose-thceHO6y.js";import"./index-CKyFmB_U.js";import"./sidebar-DXPYC1Hg.js";import"./LayoutLeft-DqymKk5q.js";import"./tooltip-CyNlJ2D3.js";import"./ZoomOut-DvgFp2BT.js";import"./Key01-CWpW_-Pr.js";import"./auth-BXPdjuWF.js";import"./use-registry-connections-DSa_I7y4.js";import"./use-organization-settings-C6tDwGjc.js";import"./index-CaI094MV.js";import"./index-Dxv0Qdk7.js";import"./popover-C48maDID.js";import"./Check-BLeNHxJZ.js";import"./SearchMd-CUFv_rgs.js";import"./use-create-virtual-mcp-CL5yn8nP.js";import"./use-navigate-to-agent--cfMzNid.js";import"./Eye-BxG-oJAF.js";import"./use-org-auth-client-POkuFZw3.js";import"./User01-DWxhvxAm.js";import"./use-collections-yr9dnEMw.js";import"./AlertCircle-CU38QLy6.js";import"./SwitchHorizontal01-JVBtN5EN.js";import"./ArrowRight-DxveGWk4.js";import"./ArrowUpRight-ie9OiC1L.js";import"./ChevronLeft-DOYNMC-e.js";import"./ChevronUp-uM-ozZ5J.js";import"./DotsVertical-CWryBHtG.js";import"./Stars02-DYAjCaf7.js";import"./Globe01-C0lWcJBb.js";import"./FilterLines-C43ER7Pr.js";import"./Globe04-CFiBZJOT.js";import"./HardDrive-Ce7Xq_sJ.js";import"./LinkExternal01-BC9HiQgY.js";import"./Monitor01-pVUVKdPN.js";import"./Sun-YkcktInM.js";import"./Palette-BwK1Ghgx.js";import"./Play-LsXMa_ja.js";import"./Shield01-Bd_FXtHh.js";import"./Stars01-KZUmRNKW.js";import"./Upload01-BvNX7dwC.js";import"./Users01-CcfwVwMB.js";import"./X-Bmi_qRN4.js";import"./Zap-BiorjSWt.js";import"./label-DQDXb8Iy.js";import"./alert-dialog-BaufekhR.js";const Ht=fe({scopes:De(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:fe({}),outputSchema:Ht}];function Xt(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 f;e[2]!==d?(f=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",d),e[2]=d,e[3]=f):f=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(E,{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(E,{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(E,{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(E,{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(E,{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 h;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(h=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]=h):h=e[40];let w;return e[41]!==h||e[42]!==f||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:f,children:[g,j,h]}),e[41]=h,e[42]=f,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Gt(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(E,{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(E,{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 f;e[8]!==x||e[9]!==d?(f=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]=f):f=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(Gt,{instance:N,onConfigure:a}),children:t.jsx(Xt,{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]!==f||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,v]}),e[24]=f,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,f]=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(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.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=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=C):C=e[21],e[22]!==d?(j=t.jsx(Ot,{value:d,onChange:f,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(h=>{const w=re(h._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:h},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:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.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 f;e[4]!==d||e[5]!==o?(f=d?ke(d):o,e[4]=d,e[5]=o,e[6]=f):f=e[6];const g=f;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 h;e[29]!==C?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=h):h=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]!==h||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,h,w,O,M]})}),e[44]=k,e[45]=h,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(V,{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:f})=>t.jsx(B,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...f,value:f.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(V,{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(W,{})]})}),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(V,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field: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(V,{children:t.jsx(X,{placeholder:"node, bun, python...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),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(V,{children:t.jsx(X,{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(W,{})]})})]}),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(V,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(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(V,{children:t.jsx(Be,{value:d.value??[],onChange:d.onChange})}),t.jsx(W,{})]})}),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(Vt,{children:[t.jsx(Et,{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(V,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ft,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function ps(s){return s.command==="npx"}function hs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function fs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(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=We(a.envVars);if(ps(a)){const i=hs(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=fs(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=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Ge(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=Ee(),x=ye(),{org:p}=J(),d=jt({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=q.useState(null),[v,b]=q.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=f??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=qe(k,Wt),h=Ue({resolver:Fe(He),values:he(f??s)}),w=h.formState.isDirty,z=async()=>{if(!await h.trigger())return;const D=h.getValues(),$=gs(D),F=f?.id??e;await x.update.mutateAsync({id:F,data:$}),h.reset(D)},O=()=>{h.reset(he(f??s))},A=async m=>{const{token:D,tokenInfo:$,error:F}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!D){G.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()}),G.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();G.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)}),G.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),G.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...d}),t.jsx(mt,{open:f!==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:f?.title??s.title}),t.jsx(ht,{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,{...h,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:h.control,name:"title",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(xs,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:U}),t.jsx(Ke,{connection:f??s,form:h,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(E,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(E,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(E,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=f??s;g(null),d.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},f?.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}}),G.success(D==="active"?"Connection enabled":"Connection disabled")}catch{G.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 f;s[4]!==i.id||s[5]!==i.slug||s[6]!==d?(f={connectionId:d,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=d,s[7]=f):f=s[7];const g=_e(f);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}=Ve(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 h;s[23]!==I?.resources?(h=I?.resources??[],s[23]=I?.resources,s[24]=h):h=s[24];let w;s[25]!==h?(w=h.map(bs),s[25]=h,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(E,{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 ro(){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{ro as default};