decocms 3.34.3 → 3.35.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 (268) hide show
  1. package/dist/client/assets/{AlertCircle-B5QG7wg7.js → AlertCircle-DfCrgvbm.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-Ce95HJs8.js → ArrowUpRight-BZPL9Pks.js} +1 -1
  3. package/dist/client/assets/{Check-CV74Rqqs.js → Check-CQSOJf1l.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-BiLWpS6e.js → CheckCircle-oP-mqP5v.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-XKMoQgX6.js → ChevronDown-DaBswAjS.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-rORK5a-Y.js → ChevronLeft-BGAK4Zdv.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-Betyx6_9.js → ChevronRight-Bwn2E0SF.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-CGfhqWp1.js → ChevronUp-BiGhh8Mf.js} +1 -1
  9. package/dist/client/assets/{Container-Byi81M5N.js → Container-C7dE1uq6.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CuchmOf0.js → DotsVertical-Ddm9sNM7.js} +1 -1
  11. package/dist/client/assets/{Eye-RSaOlPZv.js → Eye-CJqEY9Bp.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DuHSJmFt.js → FilterLines-B_l1Wkux.js} +1 -1
  13. package/dist/client/assets/{Globe01-Ds0ZgQYM.js → Globe01-CZ8FVUUU.js} +1 -1
  14. package/dist/client/assets/{HardDrive-C0JdZ_DO.js → HardDrive-CsWNNss4.js} +1 -1
  15. package/dist/client/assets/{Key01-CStdo5WX.js → Key01-CuoD3w0e.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-BdQI12mG.js → LayoutLeft-DkBHny3R.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-D7swM7zC.js → LinkExternal01-j7-s92dF.js} +1 -1
  18. package/dist/client/assets/{Monitor01-CaSeRueL.js → Monitor01-BKcboobL.js} +1 -1
  19. package/dist/client/assets/{Palette-gIYgJ3Wn.js → Palette-DX6Dwn47.js} +1 -1
  20. package/dist/client/assets/{Play-1bLCgUWF.js → Play-DF7j7sPZ.js} +1 -1
  21. package/dist/client/assets/{Plus-wat9tYeJ.js → Plus-DW0XqVol.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-D-1V89vv.js → RefreshCcw01-Csm4yVOO.js} +1 -1
  23. package/dist/client/assets/{SearchMd-BoptgjAM.js → SearchMd-DZ6aIwIg.js} +1 -1
  24. package/dist/client/assets/{Settings02-8XjUg3gM.js → Settings02-D5me1w67.js} +1 -1
  25. package/dist/client/assets/{Shield01-CjOnx-7R.js → Shield01-kWYSVjnp.js} +1 -1
  26. package/dist/client/assets/{Star01-Dsaeuwpa.js → Star01-Co_EFaK6.js} +1 -1
  27. package/dist/client/assets/{Stars01-DDkk5qux.js → Stars01-M9lSQCUv.js} +1 -1
  28. package/dist/client/assets/{Stars02-ChPYLNIJ.js → Stars02-C-4orbjJ.js} +1 -1
  29. package/dist/client/assets/{Sun-BUoG5bs4.js → Sun-D3s8g6wD.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CkdIfbJ1.js → SwitchHorizontal01-CRsSfTt7.js} +1 -1
  31. package/dist/client/assets/{Tool01-Be5AVc1v.js → Tool01-CmnBi-ns.js} +1 -1
  32. package/dist/client/assets/{Trash01-YuwiLEVo.js → Trash01-DdLe4vdc.js} +1 -1
  33. package/dist/client/assets/{Upload01-aGUy8jUM.js → Upload01-B_SjMibr.js} +1 -1
  34. package/dist/client/assets/{User01-CUMpCZVS.js → User01-DXJ1fbKo.js} +1 -1
  35. package/dist/client/assets/{Users01-BGw9h7dE.js → Users01-j12rIRFD.js} +1 -1
  36. package/dist/client/assets/{Users03-Cf3_qQGc.js → Users03-CIMcoZEN.js} +1 -1
  37. package/dist/client/assets/{X-D1kqmcok.js → X-BNvE6MEM.js} +1 -1
  38. package/dist/client/assets/{XCircle-Ds6l9Vuw.js → XCircle-DxeB44sm.js} +1 -1
  39. package/dist/client/assets/{XClose-CwNjmDWz.js → XClose-SVLNQiVU.js} +1 -1
  40. package/dist/client/assets/{Zap-j2XVmCfk.js → Zap-Bgg4Oev9.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-DMmAEMvR.js → ZapSquare-CBHt5u2b.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-C6xbqN0H.js → ZoomOut-CiW88kaG.js} +1 -1
  43. package/dist/client/assets/{access-gate-DfmEpXgP.js → access-gate-D-y2d9t8.js} +1 -1
  44. package/dist/client/assets/{accordion-B4RSATFh.js → accordion-zpPrX7CV.js} +1 -1
  45. package/dist/client/assets/add-section-modal-DAWzDKwe.js +1 -0
  46. package/dist/client/assets/{agent-capabilities-UHQXEFqt.js → agent-capabilities-CPytCHGh.js} +2 -2
  47. package/dist/client/assets/{agent-icon-BAU0Nn5Q.js → agent-icon-CR2BOYIt.js} +1 -1
  48. package/dist/client/assets/{agent-icons-CMqOumOa.js → agent-icons-DnVG8vkz.js} +2 -2
  49. package/dist/client/assets/agents-list-DwVMk1n-.js +1 -0
  50. package/dist/client/assets/ai-providers-mE8ABjTw.js +1 -0
  51. package/dist/client/assets/{alert-CeTPCPF-.js → alert-B8OrVPLn.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-nDI1xJhR.js → alert-dialog-BN8wMw1R.js} +1 -1
  53. package/dist/client/assets/app-editor-Bbf1K7Id.js +1 -0
  54. package/dist/client/assets/{auth-catchall-BHc3WJmM.js → auth-catchall-DHwYEi7u.js} +1 -1
  55. package/dist/client/assets/auth-ottC0wHr.js +1 -0
  56. package/dist/client/assets/{auth-split-layout-By3wB5zH.js → auth-split-layout-CxpQ1x33.js} +1 -1
  57. package/dist/client/assets/{automation-list-row-C-im7Cyh.js → automation-list-row-BEJwS8Vh.js} +1 -1
  58. package/dist/client/assets/{automation-runs-BYZ99hni.js → automation-runs-DhzB2pEa.js} +1 -1
  59. package/dist/client/assets/automations-D61pNajM.js +1 -0
  60. package/dist/client/assets/{avatar-BZq-o3M_.js → avatar-CdZJe3C8.js} +1 -1
  61. package/dist/client/assets/{badge-DBQKr8ze.js → badge-C7EEpKuN.js} +1 -1
  62. package/dist/client/assets/brand-context-CNpbI5Wl.js +1 -0
  63. package/dist/client/assets/buckets-CdV7wLzR.js +1 -0
  64. package/dist/client/assets/{calendar-D0ZGZM9k.js → calendar-DFbEMX6r.js} +1 -1
  65. package/dist/client/assets/{capability-load-error-BqquNR5_.js → capability-load-error-Cl1kq3iF.js} +1 -1
  66. package/dist/client/assets/{card-_9LUJQRQ.js → card-CDrd0DTi.js} +1 -1
  67. package/dist/client/assets/{chat-context-BGBybCr0.js → chat-context-DG8MYWh9.js} +6 -6
  68. package/dist/client/assets/{checkbox-BoVEsaTu.js → checkbox-BGw-FQHn.js} +1 -1
  69. package/dist/client/assets/{cli-auth-success-BYlIpapz.js → cli-auth-success-DtIVHpOK.js} +1 -1
  70. package/dist/client/assets/collection-detail-FqeWA-st.js +1 -0
  71. package/dist/client/assets/{collection-display-button-C331HXzj.js → collection-display-button-C7zc09ko.js} +1 -1
  72. package/dist/client/assets/{collection-search-D2zd2w_6.js → collection-search-p8x92ubf.js} +1 -1
  73. package/dist/client/assets/{collection-table-wrapper-D_JocMSh.js → collection-table-wrapper-Cnh8Wpna.js} +1 -1
  74. package/dist/client/assets/{collection-tabs-Et7HpQI-.js → collection-tabs-CkYCGOii.js} +1 -1
  75. package/dist/client/assets/{collections-BEkDC2fV.js → collections-DyJP_FmO.js} +1 -1
  76. package/dist/client/assets/{command-DjRT1inC.js → command-BWTUFK3g.js} +1 -1
  77. package/dist/client/assets/{connect-desktop-dialog-C7P5AZy7.js → connect-desktop-dialog-BozHMyNF.js} +1 -1
  78. package/dist/client/assets/{connection-card-C6z8X3mv.js → connection-card-D4ICX_rU.js} +1 -1
  79. package/dist/client/assets/{connection-detail-DWcaSH3b.js → connection-detail-ucWXxoPl.js} +1 -1
  80. package/dist/client/assets/{connection-form-helpers-CJ-3PHD0.js → connection-form-helpers-8awFltv-.js} +1 -1
  81. package/dist/client/assets/{connections-plRLUbCm.js → connections-iQ8Bv6Z6.js} +1 -1
  82. package/dist/client/assets/decopilot-sse-pool-DR3EOQSz.js +1 -0
  83. package/dist/client/assets/{dialog-DilC5A4p.js → dialog-DDaCuEXe.js} +1 -1
  84. package/dist/client/assets/domain-settings-DTybx0PS.js +1 -0
  85. package/dist/client/assets/{drawer-PqoucHj8.js → drawer-iJuY2KNl.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-CCeLALQe.js → dropdown-menu-Bbmpm5z3.js} +1 -1
  87. package/dist/client/assets/dynamic-plugin-layout-fiDb4X6H.js +1 -0
  88. package/dist/client/assets/{empty-state-cuRG9xrS.js → empty-state-Cdm1CYyS.js} +1 -1
  89. package/dist/client/assets/{empty-state-C0m3QPuD.js → empty-state-D-Pxp7j0.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-zlBEIx4x.js → extract-connection-data-SrWlxhIa.js} +1 -1
  91. package/dist/client/assets/features-Cwh1Qv1Z.js +1 -0
  92. package/dist/client/assets/file-explorer--zdN4Zrz.js +2 -0
  93. package/dist/client/assets/{file-type-icon-CBlaUM9a.js → file-type-icon-B4-le7-M.js} +1 -1
  94. package/dist/client/assets/{files-De7CB1eQ.js → files-DFiPv_6i.js} +1 -1
  95. package/dist/client/assets/{form-DcfAV72q.js → form-3ozPMiDy.js} +1 -1
  96. package/dist/client/assets/general-BBvPcHvJ.js +1 -0
  97. package/dist/client/assets/generate-id-B9GOZfm-.js +1 -0
  98. package/dist/client/assets/{github-repo-picker-CIreZixy.js → github-repo-picker-CLz-6KHT.js} +2 -2
  99. package/dist/client/assets/{header-tab-button-CNFRl9p4.js → header-tab-button-KOmUg_0n.js} +3 -3
  100. package/dist/client/assets/{hover-card-Bizl54yc.js → hover-card-BdET2LVl.js} +1 -1
  101. package/dist/client/assets/{image-field-Btc7vZ_B.js → image-field-jDtV8hKH.js} +1 -1
  102. package/dist/client/assets/{index-CoxAwU4M.js → index-7nVwqMEY.js} +1 -1
  103. package/dist/client/assets/{index-CeH9NvWc.js → index-B1J4YXFH.js} +13 -13
  104. package/dist/client/assets/{index-DOV0yCSN.js → index-B8Zn3P3M.js} +1 -1
  105. package/dist/client/assets/{index-B6U1MHPz.js → index-BRNlnl29.js} +1 -1
  106. package/dist/client/assets/{index-Dr3ZvAAC.js → index-Bg-8akWr.js} +2 -2
  107. package/dist/client/assets/{index-WAvrfxHO.js → index-BnzjjyUc.js} +1 -1
  108. package/dist/client/assets/index-ByDZ7Ijt.js +1 -0
  109. package/dist/client/assets/{index-C_YL5c1Q.js → index-C6TcjGKf.js} +1 -1
  110. package/dist/client/assets/{index-KCjld4_L.js → index-CKiY6q7v.js} +3 -3
  111. package/dist/client/assets/{index-NuAPKwye.js → index-CMT1KgDi.js} +1 -1
  112. package/dist/client/assets/{index-DxLTuX83.js → index-CR2BsklH.js} +34 -34
  113. package/dist/client/assets/{index-DM719JZt.js → index-DB-iXjqO.js} +1 -1
  114. package/dist/client/assets/{index-EffHR3rD.js → index-jguHAjxa.js} +1 -1
  115. package/dist/client/assets/{index-VW961Pbw.js → index-lVjgiIsy.js} +1 -1
  116. package/dist/client/assets/{index-redirect-BoGD6xOD.js → index-redirect-0OmXb9MX.js} +1 -1
  117. package/dist/client/assets/index-sGHofokC.js +1 -0
  118. package/dist/client/assets/{input-3FcnQKag.js → input-BXKnvLhL.js} +1 -1
  119. package/dist/client/assets/{integration-icon-C2c_G7v_.js → integration-icon-Bw8f7ZPI.js} +1 -1
  120. package/dist/client/assets/{label-Cv-qQXYd.js → label-CjPScbhz.js} +1 -1
  121. package/dist/client/assets/{layout-2bgJD0NS.js → layout-Di1CCr2Q.js} +1 -1
  122. package/dist/client/assets/{login-DDLq_BK-.js → login-5GQvHYAE.js} +1 -1
  123. package/dist/client/assets/mcp-oauth-BRWfHEzR.js +1 -0
  124. package/dist/client/assets/{members-BlttLAcq.js → members-QwMU-3Ki.js} +2 -2
  125. package/dist/client/assets/{monaco-editor-BenQSBIk.js → monaco-editor-Cg1EQRnF.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-BcGGFk75.js → monitoring-stats-row-CNaJGhPf.js} +1 -1
  127. package/dist/client/assets/oauth-callback-D9zCuUON.js +1 -0
  128. package/dist/client/assets/{oauth-callback-ai-provider-BF79mlu4.js → oauth-callback-ai-provider-hDwaAL5R.js} +1 -1
  129. package/dist/client/assets/{onboarding-Dd72TDGl.js → onboarding-DlrXj6YO.js} +1 -1
  130. package/dist/client/assets/{org-install-Bv_VZKPn.js → org-install-Bu5JllIi.js} +1 -1
  131. package/dist/client/assets/{org-layout-CTAm8_WK.js → org-layout-BbJy_b93.js} +1 -1
  132. package/dist/client/assets/org-plugin-layout-B9FRU2Is.js +1 -0
  133. package/dist/client/assets/{page-seo-form-B0n1eGFy.js → page-seo-form-_9ZP3QBG.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-E9iDhskP.js +1 -0
  135. package/dist/client/assets/{pair-DU07s2Yy.js → pair-gQKhMMDb.js} +6 -6
  136. package/dist/client/assets/{plugin-empty-state-CVzEQ5Cm.js → plugin-empty-state-BZknPdIb.js} +1 -1
  137. package/dist/client/assets/{plugin-header-B7b_y-0E.js → plugin-header-DkjZWp_i.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-Bwwo9Dmw.js → plugin-layout-BdqEclCD.js} +1 -1
  139. package/dist/client/assets/{popover-DpnBmU5u.js → popover-BTmtXv14.js} +1 -1
  140. package/dist/client/assets/{post-editor-DOuE35_z.js → post-editor-CH5fTOhb.js} +2 -2
  141. package/dist/client/assets/{primitives-DCRAmGAV.js → primitives-CKu1vpZw.js} +1 -1
  142. package/dist/client/assets/profile-Dko06RsO.js +1 -0
  143. package/dist/client/assets/project-app-view-Cd-36Jgd.js +1 -0
  144. package/dist/client/assets/record-editor-DT2U_m_t.js +1 -0
  145. package/dist/client/assets/{registry-layout-BMV-48W2.js → registry-layout-C-Rhe1GR.js} +4 -4
  146. package/dist/client/assets/registry-lt8SPDA4.js +2 -0
  147. package/dist/client/assets/{require-capability-BolUdzxs.js → require-capability-CvIZOTUa.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-Ce12SDHB.js → required-auth-layout-B00155Vc.js} +1 -1
  149. package/dist/client/assets/{reset-password-BUAFUG-w.js → reset-password-NK-zyZWv.js} +1 -1
  150. package/dist/client/assets/{resizable-CDtszfkc.js → resizable-DmhfTA5q.js} +1 -1
  151. package/dist/client/assets/roles-BUjXqBF2.js +1 -0
  152. package/dist/client/assets/save-referenced-block-CNwoR_kv.js +1 -0
  153. package/dist/client/assets/{save-status-CrbNr3Yt.js → save-status-DbsdUBrs.js} +1 -1
  154. package/dist/client/assets/{schema-form-DF5JNe2x.js → schema-form-DzfWzqPW.js} +1 -1
  155. package/dist/client/assets/{scroll-area-DtVZtiV9.js → scroll-area-CLZP3_5w.js} +1 -1
  156. package/dist/client/assets/{search-input-B5QgW7DO.js → search-input-MJliZ4jI.js} +1 -1
  157. package/dist/client/assets/{secrets-vyIYAehl.js → secrets-D4QL_fAR.js} +1 -1
  158. package/dist/client/assets/{sections-editor-ChsSqsQp.js → sections-editor-FDdDi8FD.js} +2 -2
  159. package/dist/client/assets/{select-C0Tyz9qJ.js → select-BFSfYXlX.js} +1 -1
  160. package/dist/client/assets/{select-model-qL2AwJh1.js → select-model-BbRpf076.js} +1 -1
  161. package/dist/client/assets/seo-editor-DwVV4QI0.js +1 -0
  162. package/dist/client/assets/settings-layout-B9A_ZqDS.js +1 -0
  163. package/dist/client/assets/{settings-section-BxOSnd7f.js → settings-section-C-Pwj2mI.js} +1 -1
  164. package/dist/client/assets/{sheet-BZaR5cN8.js → sheet-tO1j8MLX.js} +1 -1
  165. package/dist/client/assets/{shell-controls-B_EeVM1l.js → shell-controls-Bym8A09n.js} +1 -1
  166. package/dist/client/assets/{shell-layout-DSw-nDR6.js → shell-layout-CVwlRsIR.js} +1 -1
  167. package/dist/client/assets/shell-route-loading-I4t8prq1.js +1 -0
  168. package/dist/client/assets/{sidebar-DILd2AwV.js → sidebar-B1ZxuBN_.js} +1 -1
  169. package/dist/client/assets/{skeleton-Dvzf2GQP.js → skeleton-DJEW9jDp.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-DhgyheK_.js → sortable.esm-LeLAN_LP.js} +2 -2
  171. package/dist/client/assets/{spinner-CIUpakvk.js → spinner-CDjEeRHa.js} +1 -1
  172. package/dist/client/assets/{sso-BYueQDf4.js → sso-DCBE9NzY.js} +1 -1
  173. package/dist/client/assets/store-BZj3mNA3.js +1 -0
  174. package/dist/client/assets/store-registry-Bh2zZ5xN.js +2 -0
  175. package/dist/client/assets/{studio-tools-qhNYzbg-.js → studio-tools-BgmLlqq0.js} +1 -1
  176. package/dist/client/assets/{switch-B2R8Oovd.js → switch-fOoBffiM.js} +1 -1
  177. package/dist/client/assets/{tab-id-BEXPtrYn.js → tab-id-DF4EtVz0.js} +1 -1
  178. package/dist/client/assets/{table-BHblf7Co.js → table-B7zPFKH4.js} +1 -1
  179. package/dist/client/assets/{tabs-BEFEoOMo.js → tabs-DwCivvg2.js} +1 -1
  180. package/dist/client/assets/{task-status-17hQtONR.js → task-status-Do0N2yEZ.js} +1 -1
  181. package/dist/client/assets/{textarea-CZOXZ6_T.js → textarea-C0PLb8A1.js} +1 -1
  182. package/dist/client/assets/{toggle-group-DzrJraBm.js → toggle-group-Bn94xmD3.js} +1 -1
  183. package/dist/client/assets/{toolbar-A-Rw_MZF.js → toolbar-D1E6jsA-.js} +1 -1
  184. package/dist/client/assets/tools-list-BXq3S6hl.js +1 -0
  185. package/dist/client/assets/{tooltip-D1D9JHhD.js → tooltip-CLG87qyy.js} +1 -1
  186. package/dist/client/assets/{types-DsYUq_UX.js → types-CBP_wAn8.js} +3 -3
  187. package/dist/client/assets/{use-ai-providers-CIvGzfXg.js → use-ai-providers-B-vDc98I.js} +1 -1
  188. package/dist/client/assets/{use-automations-CP8543px.js → use-automations-BPoyZBdX.js} +1 -1
  189. package/dist/client/assets/{use-capability-DDDjfOOE.js → use-capability-B_PDwTk3.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-DufrTL6j.js → use-clock-tick-dBvSZsql.js} +1 -1
  191. package/dist/client/assets/use-collections-C_yZKgDo.js +1 -0
  192. package/dist/client/assets/{use-connection-DIX015NP.js → use-connection-BGirJeWX.js} +1 -1
  193. package/dist/client/assets/{use-copy-B_iKACkn.js → use-copy-vy8ApQ-I.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-BiFjwqV_.js → use-create-virtual-mcp-BjqcuHoP.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-CsGRGmM0.js → use-debounced-autosave-D3nmvc0o.js} +1 -1
  196. package/dist/client/assets/use-delete-connection-hy9eBOJA.js +1 -0
  197. package/dist/client/assets/{use-file-configs-CzVPvQ04.js → use-file-configs-Rh_uaFMZ.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-BmPWzVgW.js → use-infinite-scroll-DzA4PJqc.js} +1 -1
  199. package/dist/client/assets/{use-list-state-BxWtfKJF.js → use-list-state-BKFx4oGM.js} +1 -1
  200. package/dist/client/assets/use-mcp-client-WRUNhji3.js +10 -0
  201. package/dist/client/assets/{use-mcp-prompts-B8H3Sb8-.js → use-mcp-prompts-D8_D9pv7.js} +1 -1
  202. package/dist/client/assets/use-mcp-tools-C9n7HK44.js +1 -0
  203. package/dist/client/assets/{use-members-D33brPm2.js → use-members-CRFHIxPI.js} +1 -1
  204. package/dist/client/assets/{use-navigate-to-agent-BpOmxFKV.js → use-navigate-to-agent-S7VbkvxA.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-B3bhhuY4.js → use-org-auth-client-CSi9369v.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-qcLKm5I7.js → use-org-sso-BpQsq_SJ.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-DV7FcWv5.js → use-organization-roles-D_SSRrwH.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-mMiPWte8.js → use-organization-settings-CGN7GbnQ.js} +1 -1
  209. package/dist/client/assets/use-registry-connections-UhNQSvBW.js +1 -0
  210. package/dist/client/assets/{use-secrets-CMyn_SAh.js → use-secrets-pnJMJ9Be.js} +1 -1
  211. package/dist/client/assets/use-status-sounds-Dz4RsXmq.js +1 -0
  212. package/dist/client/assets/{use-view-mode-CQiQ9BoV.js → use-view-mode-Gu7r5Cby.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-BHCygv1Q.js → use-virtual-mcp-CYog3nxZ.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-BSkLeLWA.js +1 -0
  215. package/dist/client/assets/{useRouterState-CPOZ6kYF.js → useRouterState-D4-J_KM9.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-VzK0S1M9.js +1 -0
  217. package/dist/client/assets/{user-BHiBl7KY.js → user-BiR0-i8i.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-C4AuqTiF.js → view-mode-toggle-YSQkkoIu.js} +1 -1
  219. package/dist/client/assets/{watch-sse-pool-BEICArze.js → watch-sse-pool-D-9b4N8J.js} +1 -1
  220. package/dist/client/assets/workflow-D9qNodRH.js +1 -0
  221. package/dist/client/assets/workflow-detail-CmQwmqlu.js +1 -0
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +458 -458
  224. package/dist/server/migrate.js +95 -95
  225. package/dist/server/server.js +335 -335
  226. package/package.json +1 -1
  227. package/dist/client/assets/add-section-modal-DGPmEqVH.js +0 -1
  228. package/dist/client/assets/agents-list-f6dvlBDo.js +0 -1
  229. package/dist/client/assets/ai-providers-CIni-0nv.js +0 -1
  230. package/dist/client/assets/app-editor-Dd3wbzna.js +0 -1
  231. package/dist/client/assets/automations-BKZFJOPp.js +0 -1
  232. package/dist/client/assets/brand-context-CpadUeMB.js +0 -1
  233. package/dist/client/assets/buckets-BWDxlk4n.js +0 -1
  234. package/dist/client/assets/collection-detail-C5awVm7D.js +0 -1
  235. package/dist/client/assets/decopilot-sse-pool-Cu7Nizzp.js +0 -1
  236. package/dist/client/assets/domain-settings-BUYR_el1.js +0 -1
  237. package/dist/client/assets/dynamic-plugin-layout-b5WMDmEL.js +0 -1
  238. package/dist/client/assets/features-1PDTV_2R.js +0 -1
  239. package/dist/client/assets/file-explorer-CBKgCWMC.js +0 -2
  240. package/dist/client/assets/general-DCkCuFZl.js +0 -1
  241. package/dist/client/assets/generate-id-N17blLwS.js +0 -1
  242. package/dist/client/assets/index-4vxs0ZGV.js +0 -1
  243. package/dist/client/assets/index-CQQJ5UaG.js +0 -1
  244. package/dist/client/assets/oauth-callback-CdBo7Kde.js +0 -1
  245. package/dist/client/assets/org-plugin-layout-KpgdAlfM.js +0 -1
  246. package/dist/client/assets/page-seo-sheet-Bo7n8Dbw.js +0 -1
  247. package/dist/client/assets/profile-DvJYJ7rR.js +0 -1
  248. package/dist/client/assets/project-app-view-DQhfhWs_.js +0 -1
  249. package/dist/client/assets/record-editor-BYnzNxDd.js +0 -1
  250. package/dist/client/assets/registry-469wEK7T.js +0 -2
  251. package/dist/client/assets/roles-ChM1uml4.js +0 -1
  252. package/dist/client/assets/save-referenced-block-p44kfiVf.js +0 -1
  253. package/dist/client/assets/seo-editor-BdvXc5GQ.js +0 -1
  254. package/dist/client/assets/settings-layout-Cd7DSf19.js +0 -1
  255. package/dist/client/assets/shell-route-loading-DGAtAFWm.js +0 -1
  256. package/dist/client/assets/store-DRNbauSU.js +0 -1
  257. package/dist/client/assets/store-registry-Cj3hC5ms.js +0 -2
  258. package/dist/client/assets/tools-list-CmTd7_Mb.js +0 -1
  259. package/dist/client/assets/use-collections-CUoYyXrz.js +0 -1
  260. package/dist/client/assets/use-delete-connection-C2rrW8fa.js +0 -1
  261. package/dist/client/assets/use-mcp-client-B7YSHa6V.js +0 -10
  262. package/dist/client/assets/use-mcp-tools-Bb7rwoEF.js +0 -1
  263. package/dist/client/assets/use-registry-connections-BIDj-EVl.js +0 -1
  264. package/dist/client/assets/use-status-sounds-FktjeAga.js +0 -1
  265. package/dist/client/assets/useInfiniteQuery-Du3dTl6W.js +0 -1
  266. package/dist/client/assets/useSuspenseInfiniteQuery-BHnbmrEl.js +0 -1
  267. package/dist/client/assets/workflow-CqlkVMXi.js +0 -1
  268. package/dist/client/assets/workflow-detail-CqR4Jdyr.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "3.34.3",
3
+ "version": "3.35.0",
4
4
  "description": "Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{e as $,r as g,j as r,c as H}from"./index-DxLTuX83.js";import{E as _}from"./agent-icon-BAU0Nn5Q.js";import{i as V}from"./SearchMd-BoptgjAM.js";import{D as X,a as J,c as K,b as Q}from"./dialog-DilC5A4p.js";import{I as Y}from"./input-3FcnQKag.js";import{a4 as Z,a2 as ee,a5 as te,a6 as G,G as re}from"./index-CeH9NvWc.js";import"./AlertCircle-B5QG7wg7.js";import"./Tool01-Be5AVc1v.js";import"./SwitchHorizontal01-CkdIfbJ1.js";import"./RefreshCcw01-D-1V89vv.js";import"./XCircle-Ds6l9Vuw.js";import"./ArrowUpRight-Ce95HJs8.js";import"./ZapSquare-DMmAEMvR.js";import"./Users03-Cf3_qQGc.js";import"./CheckCircle-BiLWpS6e.js";import"./Check-CV74Rqqs.js";import"./ChevronDown-XKMoQgX6.js";import"./ChevronLeft-rORK5a-Y.js";import"./ChevronRight-Betyx6_9.js";import"./ChevronUp-CGfhqWp1.js";import"./DotsVertical-CuchmOf0.js";import"./Container-Byi81M5N.js";import"./Eye-RSaOlPZv.js";import"./ZoomOut-C6xbqN0H.js";import"./Globe01-Ds0ZgQYM.js";import"./FilterLines-DuHSJmFt.js";import"./Star01-Dsaeuwpa.js";import"./Palette-gIYgJ3Wn.js";import"./HardDrive-C0JdZ_DO.js";import"./Stars02-ChPYLNIJ.js";import"./Key01-CStdo5WX.js";import"./LayoutLeft-BdQI12mG.js";import"./LinkExternal01-D7swM7zC.js";import"./Monitor01-CaSeRueL.js";import"./Sun-BUoG5bs4.js";import"./Play-1bLCgUWF.js";import"./Plus-wat9tYeJ.js";import"./Settings02-8XjUg3gM.js";import"./Shield01-CjOnx-7R.js";import"./Stars01-DDkk5qux.js";import"./Trash01-YuwiLEVo.js";import"./Upload01-aGUy8jUM.js";import"./User01-CUMpCZVS.js";import"./Users01-BGw9h7dE.js";import"./XClose-CwNjmDWz.js";import"./X-D1kqmcok.js";import"./Zap-j2XVmCfk.js";import"./agent-capabilities-UHQXEFqt.js";import"./chat-context-BGBybCr0.js";import"./tab-id-BEXPtrYn.js";import"./use-mcp-client-B7YSHa6V.js";import"./watch-sse-pool-BEICArze.js";import"./decopilot-sse-pool-Cu7Nizzp.js";import"./studio-tools-qhNYzbg-.js";import"./use-virtual-mcp-BHCygv1Q.js";import"./use-collections-CUoYyXrz.js";import"./use-ai-providers-CIvGzfXg.js";import"./use-organization-settings-mMiPWte8.js";import"./pair-DU07s2Yy.js";import"./use-clock-tick-DufrTL6j.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./scroll-area-DtVZtiV9.js";import"./select-C0Tyz9qJ.js";import"./tooltip-D1D9JHhD.js";import"./use-copy-B_iKACkn.js";import"./file-type-icon-CBlaUM9a.js";import"./content-blocks-o63cs2vh.js";import"./types-DsYUq_UX.js";import"./shell-layout-DSw-nDR6.js";import"./avatar-BZq-o3M_.js";import"./required-auth-layout-Ce12SDHB.js";import"./useRouterState-CPOZ6kYF.js";import"./use-org-sso-qcLKm5I7.js";import"./integration-icon-C2c_G7v_.js";import"./use-navigate-to-agent-BpOmxFKV.js";import"./use-connection-DIX015NP.js";import"./use-mcp-prompts-B8H3Sb8-.js";import"./form-DcfAV72q.js";import"./label-Cv-qQXYd.js";import"./spinner-CIUpakvk.js";import"./drawer-PqoucHj8.js";import"./collection-search-D2zd2w_6.js";import"./tabs-BEFEoOMo.js";import"./toggle-group-DzrJraBm.js";import"./sortable.esm-DhgyheK_.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C6z8X3mv.js";import"./use-registry-connections-BIDj-EVl.js";import"./useInfiniteQuery-Du3dTl6W.js";import"./use-infinite-scroll-BmPWzVgW.js";import"./extract-connection-data-zlBEIx4x.js";import"./generate-id-N17blLwS.js";import"./collections-BEkDC2fV.js";import"./card-_9LUJQRQ.js";import"./collection-tabs-Et7HpQI-.js";import"./badge-DBQKr8ze.js";import"./textarea-CZOXZ6_T.js";import"./connection-form-helpers-CJ-3PHD0.js";import"./useSuspenseInfiniteQuery-BHnbmrEl.js";import"./connect-desktop-dialog-C7P5AZy7.js";import"./agent-icons-CMqOumOa.js";import"./checkbox-BoVEsaTu.js";import"./skeleton-Dvzf2GQP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BxOSnd7f.js";import"./popover-DpnBmU5u.js";import"./command-DjRT1inC.js";import"./index-B6U1MHPz.js";import"./index-NuAPKwye.js";import"./dropdown-menu-CCeLALQe.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DGAtAFWm.js";import"./sidebar-DILd2AwV.js";import"./sheet-BZaR5cN8.js";import"./toolbar-A-Rw_MZF.js";import"./use-create-virtual-mcp-BiFjwqV_.js";import"./github-repo-picker-CIreZixy.js";import"./use-mcp-tools-Bb7rwoEF.js";import"./alert-dialog-nDI1xJhR.js";import"./index-CoxAwU4M.js";import"./use-org-auth-client-B3bhhuY4.js";import"./hover-card-Bizl54yc.js";import"./task-status-17hQtONR.js";import"./use-status-sounds-FktjeAga.js";import"./empty-state-cuRG9xrS.js";import"./resizable-CDtszfkc.js";import"./use-capability-DDDjfOOE.js";import"./header-tab-button-CNFRl9p4.js";import"./index-WAvrfxHO.js";import"./user-BHiBl7KY.js";import"./tools-list-CmTd7_Mb.js";import"./switch-B2R8Oovd.js";import"./use-debounced-autosave-CsGRGmM0.js";import"./index-DM719JZt.js";import"./search-input-B5QgW7DO.js";import"./use-secrets-CMyn_SAh.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-B4RSATFh.js";import"./view-mode-toggle-C4AuqTiF.js";import"./select-model-qL2AwJh1.js";import"./use-automations-CP8543px.js";import"./monaco-editor-BenQSBIk.js";import"./automation-runs-BYZ99hni.js";import"./table-BHblf7Co.js";import"./use-members-D33brPm2.js";import"./automation-list-row-C-im7Cyh.js";const oe=12,E=new Set,D=new Set;function ie(){for(const l of D)l()}function se(l){return E.has(l)?!0:E.size>=oe?!1:(E.add(l),!0)}function F(l){E.delete(l)&&ie()}function le(l){return D.add(l),()=>{D.delete(l)}}function me(l,e){const t=g.useRef(!1),[v,n]=g.useState(!1),m=g.useRef(null),p=g.useRef(null),i=g.useRef(null),o=g.useRef(l);o.current=l;const[x]=g.useState(()=>{const s=()=>{i.current?.(),i.current=null},c=()=>t.current?!0:se(e)?(t.current=!0,n(!0),s(),!0):!1;return f=>{if(p.current=f,m.current&&(m.current.disconnect(),m.current=null),s(),!f){t.current&&(F(e),t.current=!1,n(!1));return}queueMicrotask(()=>{if(p.current!==f)return;const a=new IntersectionObserver(u=>{if(u[0]?.isIntersecting??!1){!c()&&!i.current&&(i.current=le(()=>{p.current===f&&c()}));return}s(),t.current&&(F(e),t.current=!1,n(!1))},{root:o.current.current,rootMargin:"160px 0px"});a.observe(f),m.current=a})}});return{ref:x,iframeActive:v}}function ne(l){const e=$.c(8),{previewUrl:t,title:v,scrollRootRef:n,slotId:m}=l,{ref:p,iframeActive:i}=me(n,m),[o,x]=g.useState(!1);let s;e[0]!==i||e[1]!==o||e[2]!==t||e[3]!==v?(s=i?r.jsxs(r.Fragment,{children:[!o&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted/40",children:r.jsx(_,{className:"h-8 w-8 animate-pulse text-muted-foreground/40"})}),r.jsx("iframe",{src:t,title:`Preview ${v}`,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",className:"pointer-events-none h-[200%] w-[200%] origin-top-left scale-50 border-0 bg-white",tabIndex:-1,onLoad:()=>x(!0)})]}):r.jsx("div",{className:"flex h-full items-center justify-center",children:r.jsx(_,{className:"h-8 w-8 text-muted-foreground/30"})}),e[0]=i,e[1]=o,e[2]=t,e[3]=v,e[4]=s):s=e[4];let c;return e[5]!==p||e[6]!==s?(c=r.jsx("div",{ref:p,className:"relative aspect-[16/10] w-full overflow-hidden bg-muted/40",children:s}),e[5]=p,e[6]=s,e[7]=c):c=e[7],c}function pe(l){const e=$.c(26),{entry:t,previewUrl:v,scrollRootRef:n,onSelect:m}=l,p=t.isSavedBlock&&"border-global-section/35 hover:bg-global-section/8";let i;e[0]!==p?(i=H("group flex flex-col overflow-hidden rounded-lg border bg-card text-left transition-colors","hover:border-primary/40 hover:bg-accent/30",p),e[0]=p,e[1]=i):i=e[1];let o;e[2]!==t.resolveType||e[3]!==t.title||e[4]!==v||e[5]!==n?(o=r.jsx(ne,{previewUrl:v,title:t.title,scrollRootRef:n,slotId:t.resolveType}),e[2]=t.resolveType,e[3]=t.title,e[4]=v,e[5]=n,e[6]=o):o=e[6];let x;e[7]!==t.isSavedBlock?(x=t.isSavedBlock?{color:re}:void 0,e[7]=t.isSavedBlock,e[8]=x):x=e[8];let s;e[9]!==x?(s=r.jsx(_,{className:"h-4 w-4 shrink-0",style:x}),e[9]=x,e[10]=s):s=e[10];let c;e[11]!==t.title?(c=r.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e[11]=t.title,e[12]=c):c=e[12];let f;e[13]!==t.description?(f=t.description&&r.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.description}),e[13]=t.description,e[14]=f):f=e[14];let a;e[15]!==c||e[16]!==f?(a=r.jsxs("div",{className:"min-w-0 flex-1",children:[c,f]}),e[15]=c,e[16]=f,e[17]=a):a=e[17];let u;e[18]!==s||e[19]!==a?(u=r.jsxs("div",{className:"flex items-center gap-2 border-t px-3 py-2.5",children:[s,a]}),e[18]=s,e[19]=a,e[20]=u):u=e[20];let h;return e[21]!==m||e[22]!==i||e[23]!==o||e[24]!==u?(h=r.jsxs("button",{type:"button",onClick:m,className:i,children:[o,u]}),e[21]=m,e[22]=i,e[23]=o,e[24]=u,e[25]=h):h=e[25],h}function Xr(l){const e=$.c(41),{open:t,onOpenChange:v,meta:n,decofile:m,previewBaseUrl:p,onSelect:i}=l,[o,x]=g.useState(""),[s,c]=g.useState(t),f=g.useRef(null);t!==s&&(c(t),t&&x(""));let a,u,h,b,S,j,N,y,w,R,C;if(e[0]!==m||e[1]!==n||e[2]!==v||e[3]!==i||e[4]!==t||e[5]!==p||e[6]!==o){const U=t&&n&&m?Z(n,m):[],M=n?ee(n):"",z=m?te(m):void 0,W=new Map;if(t&&M)for(const d of U)W.set(d.resolveType,G(p,M,d.previewBlock,z));const A=o.trim().toLowerCase(),q=A?U.filter(d=>d.title.toLowerCase().includes(A)||d.resolveType.toLowerCase().includes(A)||d.description?.toLowerCase().includes(A)):U;u=X,R=t,C=v,a=J,N="top-3 right-3",y="flex h-[90vh] max-h-[90vh] w-[96vw] max-w-[96vw] sm:max-w-[96vw] flex-col gap-0 overflow-hidden p-0";let O;e[18]===Symbol.for("react.memo_cache_sentinel")?(O=r.jsx(K,{children:"Add section"}),e[18]=O):O=e[18];let k;e[19]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(V,{size:14,className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e[19]=k):k=e[19];let B;e[20]===Symbol.for("react.memo_cache_sentinel")?(B=d=>x(d.target.value),e[20]=B):B=e[20],e[21]!==o?(w=r.jsxs(Q,{className:"shrink-0 border-b px-4 py-3 text-left",children:[O,r.jsxs("div",{className:"relative pt-2",children:[k,r.jsx(Y,{value:o,onChange:B,placeholder:"Search sections...",className:"h-9 pl-8"})]})]}),e[21]=o,e[22]=w):w=e[22],S=f,j="min-h-0 flex-1 overflow-y-auto",h="p-4",b=q.length===0?r.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No sections found."}):r.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:q.map(d=>r.jsx(pe,{entry:d,scrollRootRef:f,previewUrl:W.get(d.resolveType)??G(p,M,d.previewBlock,z),onSelect:()=>i(d)},d.resolveType))}),e[0]=m,e[1]=n,e[2]=v,e[3]=i,e[4]=t,e[5]=p,e[6]=o,e[7]=a,e[8]=u,e[9]=h,e[10]=b,e[11]=S,e[12]=j,e[13]=N,e[14]=y,e[15]=w,e[16]=R,e[17]=C}else a=e[7],u=e[8],h=e[9],b=e[10],S=e[11],j=e[12],N=e[13],y=e[14],w=e[15],R=e[16],C=e[17];let T;e[23]!==h||e[24]!==b?(T=r.jsx("div",{className:h,children:b}),e[23]=h,e[24]=b,e[25]=T):T=e[25];let I;e[26]!==T||e[27]!==S||e[28]!==j?(I=r.jsx("div",{ref:S,className:j,children:T}),e[26]=T,e[27]=S,e[28]=j,e[29]=I):I=e[29];let L;e[30]!==a||e[31]!==I||e[32]!==N||e[33]!==y||e[34]!==w?(L=r.jsxs(a,{closeButtonClassName:N,className:y,children:[w,I]}),e[30]=a,e[31]=I,e[32]=N,e[33]=y,e[34]=w,e[35]=L):L=e[35];let P;return e[36]!==u||e[37]!==L||e[38]!==R||e[39]!==C?(P=r.jsx(u,{open:R,onOpenChange:C,children:L}),e[36]=u,e[37]=L,e[38]=R,e[39]=C,e[40]=P):P=e[40],P}export{Xr as AddSectionModal};
@@ -1 +0,0 @@
1
- import{e as se,j as s,B as Z,q as me,r as Y,t as v,o as de}from"./index-DxLTuX83.js";import{c as k,b as ne,a as ee,D as te}from"./dropdown-menu-CCeLALQe.js";import{s as pe}from"./Star01-Dsaeuwpa.js";import{a as fe}from"./Users03-Cf3_qQGc.js";import{S as ge,G as ue,u as he,H as ie,W as oe,a as xe,I as je}from"./github-repo-picker-CIreZixy.js";import{a as _e,b as Ce,c as be}from"./use-virtual-mcp-BHCygv1Q.js";import{P as q}from"./index-DM719JZt.js";import{i as ye}from"./DotsVertical-CuchmOf0.js";import{a as Ne}from"./Settings02-8XjUg3gM.js";import{s as Se}from"./Trash01-YuwiLEVo.js";import{A as De,ap as ve}from"./agent-icon-BAU0Nn5Q.js";import{k as Ae}from"./use-navigate-to-agent-BpOmxFKV.js";import{C as ke}from"./card-_9LUJQRQ.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as we}from"./use-capability-DDDjfOOE.js";import{E as Te}from"./empty-state-cuRG9xrS.js";import{u as ze}from"./use-create-virtual-mcp-BiFjwqV_.js";import{c as Ie,b as Pe,d as He,f as Ee,e as Me,g as Oe,a as Be,A as Ge}from"./alert-dialog-nDI1xJhR.js";import{S as $e}from"./search-input-B5QgW7DO.js";import{s as le}from"./Plus-wat9tYeJ.js";import"./Check-CV74Rqqs.js";import"./ChevronRight-Betyx6_9.js";import"./use-connection-DIX015NP.js";import"./use-collections-CUoYyXrz.js";import"./use-mcp-client-B7YSHa6V.js";import"./dialog-DilC5A4p.js";import"./X-D1kqmcok.js";import"./RefreshCcw01-D-1V89vv.js";import"./collection-search-D2zd2w_6.js";import"./SearchMd-BoptgjAM.js";import"./checkbox-BoVEsaTu.js";import"./use-mcp-tools-Bb7rwoEF.js";import"./extract-connection-data-zlBEIx4x.js";import"./generate-id-N17blLwS.js";import"./collections-BEkDC2fV.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./tooltip-D1D9JHhD.js";import"./sheet-BZaR5cN8.js";import"./AlertCircle-B5QG7wg7.js";import"./Tool01-Be5AVc1v.js";import"./SwitchHorizontal01-CkdIfbJ1.js";import"./XCircle-Ds6l9Vuw.js";import"./ArrowUpRight-Ce95HJs8.js";import"./ZapSquare-DMmAEMvR.js";import"./CheckCircle-BiLWpS6e.js";import"./ChevronDown-XKMoQgX6.js";import"./ChevronLeft-rORK5a-Y.js";import"./ChevronUp-CGfhqWp1.js";import"./Container-Byi81M5N.js";import"./Eye-RSaOlPZv.js";import"./ZoomOut-C6xbqN0H.js";import"./Globe01-Ds0ZgQYM.js";import"./FilterLines-DuHSJmFt.js";import"./Palette-gIYgJ3Wn.js";import"./HardDrive-C0JdZ_DO.js";import"./Stars02-ChPYLNIJ.js";import"./Key01-CStdo5WX.js";import"./LinkExternal01-D7swM7zC.js";import"./Monitor01-CaSeRueL.js";import"./Sun-BUoG5bs4.js";import"./Play-1bLCgUWF.js";import"./Shield01-CjOnx-7R.js";import"./Stars01-DDkk5qux.js";import"./Upload01-aGUy8jUM.js";import"./User01-CUMpCZVS.js";import"./Users01-BGw9h7dE.js";import"./XClose-CwNjmDWz.js";import"./Zap-j2XVmCfk.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:ge,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(ue,{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 rs(){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}=he(),[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=q,A=q,w=q;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(q.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 K=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]!==K?(P=s.jsxs(w.Body,{children:[I,K,J]}),t[17]=J,t[18]=w.Body,t[19]=I,t[20]=K,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(xe,{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{rs as default};
@@ -1 +0,0 @@
1
- import{T as V,W as C,aH as ne,aJ as le,aK as he,aI as xe,ba as me,e as U,I as ge,H as be,r as O,j as s,D as Ee,o as Q,C as ye,q as oe,G as re,a as J,K as B,n as ve,c as ue,B as L,t as je,E as $e}from"./index-DxLTuX83.js";import{i as Re}from"./AlertCircle-B5QG7wg7.js";import{P as te}from"./index-DM719JZt.js";import{S as ae}from"./skeleton-Dvzf2GQP.js";import{b as _e,a as ce,S as de,c as Fe}from"./settings-section-BxOSnd7f.js";import{u as X,b as se,c as Se}from"./use-ai-providers-CIvGzfXg.js";import{i as Oe}from"./CheckCircle-BiLWpS6e.js";import{p as Me}from"./chat-context-BGBybCr0.js";import{e as Te,f as Ue}from"./use-organization-settings-mMiPWte8.js";import{M as ze}from"./select-model-qL2AwJh1.js";import{u as qe}from"./use-debounced-autosave-CsGRGmM0.js";import{I as ie}from"./input-3FcnQKag.js";import{a as fe,T as Le}from"./toggle-group-DzrJraBm.js";import{b as ke,c as Ie,d as Ce,f as Ne,a as Pe,e as we,g as Ae,A as De}from"./alert-dialog-nDI1xJhR.js";import{u as Y}from"./studio-tools-qhNYzbg-.js";import{s as Ve}from"./Plus-wat9tYeJ.js";import{i as Be}from"./Tool01-Be5AVc1v.js";import{s as Ge}from"./Trash01-YuwiLEVo.js";import{A as Qe}from"./avatar-BZq-o3M_.js";import{O as Ke,P as We,c as pe}from"./agent-icons-CMqOumOa.js";import{a as Ye}from"./RefreshCcw01-D-1V89vv.js";import{s as He}from"./Eye-RSaOlPZv.js";import{d as Je,b as Xe,c as Ze,a as et,D as tt}from"./dialog-DilC5A4p.js";import{S as st}from"./spinner-CIUpakvk.js";import{f as it}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as ot}from"./require-capability-BolUdzxs.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./tooltip-D1D9JHhD.js";import"./sheet-BZaR5cN8.js";import"./X-D1kqmcok.js";import"./card-_9LUJQRQ.js";import"./ArrowUpRight-Ce95HJs8.js";import"./use-mcp-client-B7YSHa6V.js";import"./tab-id-BEXPtrYn.js";import"./watch-sse-pool-BEICArze.js";import"./decopilot-sse-pool-Cu7Nizzp.js";import"./use-virtual-mcp-BHCygv1Q.js";import"./use-collections-CUoYyXrz.js";import"./drawer-PqoucHj8.js";import"./User01-CUMpCZVS.js";import"./checkbox-BoVEsaTu.js";import"./Check-CV74Rqqs.js";import"./select-C0Tyz9qJ.js";import"./ChevronDown-XKMoQgX6.js";import"./ChevronUp-CGfhqWp1.js";import"./Key01-CStdo5WX.js";import"./SearchMd-BoptgjAM.js";import"./Settings02-8XjUg3gM.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-CaSeRueL.js";import"./ChevronRight-Betyx6_9.js";import"./connect-desktop-dialog-C7P5AZy7.js";import"./Stars01-DDkk5qux.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-DDDjfOOE.js";import"./access-gate-DfmEpXgP.js";import"./capability-load-error-BqquNR5_.js";V({title:C(),url:C(),icon:C()});V({registries:le(C(),V({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ne(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const H=V({keyId:C(),modelId:C(),title:C().optional()}).nullable();xe(["fast","smart","thinking","image","web_research"]);xe(["fast","smart","thinking"]);const rt=V({tiers:V({fast:H,smart:H,thinking:H,image:H,web_research:H})});V({ids:ne(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});V({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:V({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:V({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ne(le(C(),me())).nullable().optional().describe("Brand images"),metadata:le(C(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const lt=e=>e.capabilities?.includes("image")===!0,nt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},at=[{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:lt},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:nt}];function ct(e){const t=U.c(20),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:l}=e,r=X(),[x,_]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&_(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let a;t[2]!==d?(a=[d],t[2]=d,t[3]=a):a=t[3],O.useEffect(b,a);const m=x??l;let c;t[4]!==m||t[5]!==r?(c=m?r.find(y=>y.id===m):null,t[4]=m,t[5]=r,t[6]=c):c=t[6];const u=c,{models:g,isLoading:v}=se(o?m??void 0:void 0),j=o?v||g.some(o):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=f):f=t[9];const k=f;if(o&&!j){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=>_(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==n?(h=y=>{const R=y.keyId??m??"";_(R),n({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=n,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==o||t[17]!==k||t[18]!==h?(p=s.jsx(ze,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:o,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=o,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function dt(e){const t=U.c(2),{isPending:i,showSaved:n}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=t[0],o}if(n){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function mt(){const e=U.c(42),t=X(),i=Te(),n=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ge(rt),e[0]=o):o=e[0];let l;e[1]!==i?(l={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const r=be(l),{mutate:x,isPending:_,isSuccess:b}=Ue(),d=r.formState.isDirty;let a;e[3]!==r||e[4]!==i||e[5]!==x?(a={delayMs:250,save:async()=>{const S=r.getValues();x(S,{onSuccess:()=>r.reset(S,{keepValues:!0}),onError:w=>{r.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=r,e[4]=i,e[5]=x,e[6]=a):a=e[6];const{schedule:m}=qe(a),c=t[0],u=t[1],g=t[2],{models:v}=se(c?.id),{models:j}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==r||e[8]!==n?(k=()=>{n||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},I=[n,r],e[7]=r,e[8]=n,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==r||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==v||e[17]!==j||e[18]!==f?(h=()=>{const S=r.getValues(),w=new Set(t.map(ut)),$={};c?.id&&($[c.id]=v),u?.id&&($[u.id]=j),g?.id&&($[g.id]=f);const P=W=>W!=null&&!w.has(W.keyId),N={fast:P(S.tiers.fast)?null:S.tiers.fast,smart:P(S.tiers.smart)?null:S.tiers.smart,thinking:P(S.tiers.thinking)?null:S.tiers.thinking,image:P(S.tiers.image)?null:S.tiers.image,web_research:P(S.tiers.web_research)?null:S.tiers.web_research},q=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,z=N.fast===S.tiers.fast&&N.smart===S.tiers.smart&&N.thinking===S.tiers.thinking&&N.image===S.tiers.image&&N.web_research===S.tiers.web_research;if(!q&&z)return;const G=Me(t,$);r.reset({tiers:{fast:N.fast??G.chat.fast,smart:N.smart??G.chat.smart,thinking:N.thinking??G.chat.thinking,image:N.image??G.image,web_research:N.web_research??G.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=c,e[14]=u,e[15]=g,e[16]=v,e[17]=j,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,R=g?.id;let M;e[20]!==t||e[21]!==r||e[22]!==v||e[23]!==j||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==R?(M=[r,t,v,j,f,p,y,R],e[20]=t,e[21]=r,e[22]=v,e[23]=j,e[24]=f,e[25]=p,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 A;e[30]!==_||e[31]!==F?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(dt,{isPending:_,showSaved:F})]}),e[30]=_,e[31]=F,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==m?(D=at.map(S=>s.jsx(Ee,{control:r.control,name:`tiers.${S.key}`,render:w=>{const{field:$}=w;return s.jsx(_e,{title:S.label,description:S.description,action:s.jsx(ct,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:S.filter,onSlotChange:P=>{$.onChange(P),m()}})})}},S.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=m,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(ce,{children:D}),e[37]=D,e[38]=K):K=e[38];let E;return e[39]!==A||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=E):E=e[41],E}function ut(e){return e.id}const ft={usd:[10,20,100],brl:[50,100,500]};function pt(){const e=U.c(26),t=Y(),[i,n]=O.useState(!1),{mutate:o,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:xt,onError:ht}),[r,x]=O.useState(""),[_,b]=O.useState("usd"),d=_,a=parseFloat(r),m=!isNaN(a)&&a>=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,v;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),v=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=v):(g=e[2],v=e[3]);let j;e[4]!==d||e[5]!==u?(j=s.jsxs(Le,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,v]}),e[4]=d,e[5]=u,e[6]=j):j=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==o?(f=!i&&s.jsxs(s.Fragment,{children:[ft[d].map(h=>s.jsxs(L,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>o(h*100),children:[c,h]},h)),s.jsx(L,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>n(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=o,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==r||e[15]!==a||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==o?(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:r,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(L,{className:"h-10",disabled:!m||l,onClick:()=>o(Math.round(a*100)),children:l?"...":"Add"}),s.jsx(L,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{n(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=r,e[15]=a,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=o,e[21]=k):k=e[21];let I;return e[22]!==j||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[j,f,k]})}),e[22]=j,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function ht(e){Q.error(`Top-up failed: ${e.message}`)}function xt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function gt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function bt(){const e=U.c(58),{org:t}=oe(),i=Y(),n=re(),o=X();let l;e[0]!==o?(l=o.find(vt),e[0]=o,e[1]=l):l=e[1];const r=l,[x,_]=O.useState(!1);let b;e[2]!==r||e[3]!==i?(b=async()=>{r&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:r.id})},e[2]=r,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==n?(d=()=>{n.invalidateQueries({queryKey:B.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:B.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),_(!1)},e[5]=t.id,e[6]=n,e[7]=d):d=e[7];let a;e[8]!==b||e[9]!==d?(a={mutationFn:b,onSuccess:d,onError:yt},e[8]=b,e[9]=d,e[10]=a):a=e[10];const{mutate:m,isPending:c}=J(a);let u;e[11]!==t.id?(u=B.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!r;let v;e[13]!==i?(v=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=v):v=e[14];let j;e[15]!==u||e[16]!==g||e[17]!==v?(j={queryKey:u,enabled:g,staleTime:6e4,queryFn:v},e[15]=u,e[16]=g,e[17]=v,e[18]=j):j=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(j);if(!r)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const 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=()=>_(!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(L,{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 A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=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]=A):A=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsx(Ne,{children:"Cancel"}),e[26]=D):D=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[A,s.jsxs(we,{children:[D,s.jsx(Ae,{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(De,{open:x,onOpenChange:_,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let S;e[32]!==p||e[33]!==R||e[34]!==h||e[35]!==k?(S=k||h?s.jsx(ae,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&&gt(p)),children:R}),e[32]=p,e[33]=R,e[34]=h,e[35]=k,e[36]=S):S=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 N;e[41]!==P?(N=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=N):N=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==N?(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:N}),e[43]=h,e[44]=w,e[45]=N,e[46]=q):q=e[46];let z;e[47]!==S||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,q]}),e[47]=S,e[48]=q,e[49]=z):z=e[49];let G;e[50]===Symbol.for("react.memo_cache_sentinel")?(G=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=G):G=e[50];let W;e[51]!==z?(W=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,G]}),e[51]=z,e[52]=W):W=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(pt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==F||e[55]!==E||e[56]!==W?(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,W,Z]})})}),e[54]=F,e[55]=E,e[56]=W,e[57]=ee):ee=e[57],ee}function yt(e){Q.error(`Failed to disconnect: ${e.message}`)}function vt(e){return e.providerId==="deco"}function jt(){const e=U.c(8),{org:t}=oe(),i=Y(),n=re();let o;e[0]!==i?(o=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=o):o=e[1];let l;e[2]!==t||e[3]!==n?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),n.invalidateQueries({queryKey:B.aiProviderKeys(t.id)}),n.invalidateQueries({queryKey:B.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=n,e[4]=l):l=e[4];let r;return e[5]!==o||e[6]!==l?(r={mutationFn:o,onSuccess:l,onError:_t},e[5]=o,e[6]=l,e[7]=r):r=e[7],J(r)}function _t(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function St(){const e=U.c(10),{mutate:t,isPending:i}=jt();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=["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]=n):n=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:n.join(", ")}}),e[1]=o):o=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 r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=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]=r):r=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const _=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==_?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,r,s.jsx(L,{variant:"outline",disabled:i,onClick:x,children:_})]})]}),e[6]=i,e[7]=x,e[8]=_,e[9]=b):b=e[9],b}const kt=V({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function It({providerKey:e,provider:t,preset:i,maskedKey:n,currentLabel:o,currentBaseUrl:l,onCancel:r,onSuccess:x}){const{org:_}=oe(),b=Y(),d=re(),[a,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:v,watch:j,formState:{errors:f}}=be({resolver:ge(kt),defaultValues:{label:o,apiKey:"",baseUrl:l??""}}),k=j("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:B.aiProviderKeys(_.id)}),d.invalidateQueries({queryKey:B.aiProviders(_.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:v(p=>I(p)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:a&&k?"text":"password",placeholder:n,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!a),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:a?s.jsx(Ye,{size:14}):s.jsx(He,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(Je,{children:[s.jsx(L,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:h,children:"Cancel"}),s.jsx(L,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function Ct(e){const t=U.c(28),{providerKey:i,provider:n,open:o,onOpenChange:l}=e,r=Y();let x;t[0]!==n.id||t[1]!==i.presetId?(x=n.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=n.id,t[1]=i.presetId,t[2]=x):x=t[2];const _=x,b=_?.name??n.name;let d;t[3]!==i.id?(d=B.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let a;t[5]!==i.id||t[6]!==r?(a=()=>r.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=r,t[7]=a):a=t[7];let m;t[8]!==o||t[9]!==d||t[10]!==a?(m={queryKey:d,queryFn:a,enabled:o,staleTime:0},t[8]=o,t[9]=d,t[10]=a,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(Xe,{children:s.jsxs(Ze,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let v;t[14]!==u||t[15]!==l||t[16]!==_||t[17]!==c||t[18]!==n||t[19]!==i?(v=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(st,{})}):s.jsx(It,{providerKey:i,provider:n,preset:_,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=_,t[17]=c,t[18]=n,t[19]=i,t[20]=v):v=t[20];let j;t[21]!==g||t[22]!==v?(j=s.jsxs(et,{className:"sm:max-w-md",children:[g,v]}),t[21]=g,t[22]=v,t[23]=j):j=t[23];let f;return t[24]!==l||t[25]!==o||t[26]!==j?(f=s.jsx(tt,{open:o,onOpenChange:l,children:j}),t[24]=l,t[25]=o,t[26]=j,t[27]=f):f=t[27],f}function Nt(e){const t=U.c(48),{providerKey:i,provider:n}=e,{org:o}=oe(),l=Y(),r=re(),[x,_]=O.useState(!1),[b,d]=O.useState(!1),a=n.id==="openai-compatible";let m;t[0]!==a||t[1]!==i.presetId?(m=a&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=a,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:a?"Custom OpenAI-compatible":n.name,g=c?.logo??n.logo;let v;e:{if(a){v=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=it(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],v=`${q} · added ${z} ago`}const j=v;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==o||t[9]!==i.id||t[10]!==r?(k=()=>{r.invalidateQueries({queryKey:B.aiProviderKeys(o.id)}),r.invalidateQueries({queryKey:B.aiProviders(o.id)}),r.invalidateQueries({queryKey:B.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),_(!1)},t[8]=o,t[9]=i.id,t[10]=r,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:Pt},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Qe,{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(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Be,{size:14})}),t[18]=R):R=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>_(!0),T=s.jsx(Ge,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let F;t[21]!==p?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(L,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=F):F=t[22];let A;t[23]!==j||t[24]!==u||t[25]!==F||t[26]!==y?(A=s.jsx(_e,{icon:y,title:u,description:j,action:F}),t[23]=j,t[24]=u,t[25]=F,t[26]=y,t[27]=A):A=t[27];let D;t[28]!==b||t[29]!==n||t[30]!==i?(D=s.jsx(Ct,{providerKey:i,provider:n,open:b,onOpenChange:d}),t[28]=b,t[29]=n,t[30]=i,t[31]=D):D=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 S;t[35]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Ne,{children:"Cancel"}),t[35]=S):S=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[S,s.jsx(Ae,{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(De,{open:x,onOpenChange:_,children:$}),t[41]=x,t[42]=$,t[43]=P):P=t[43];let N;return t[44]!==A||t[45]!==D||t[46]!==P?(N=s.jsxs(s.Fragment,{children:[A,D,P]}),t[44]=A,t[45]=D,t[46]=P,t[47]=N):N=t[47],N}function Pt(e){return Q.error(`Failed to delete key: ${e.message}`)}function wt(e){const t=U.c(11),{onConnectClick:i}=e,n=X(),o=Se();let l;t[0]!==o?.providers?(l=o?.providers??[],t[0]=o?.providers,t[1]=l):l=t[1];const r=l;let x;if(t[2]!==n||t[3]!==i||t[4]!==r){let _;t[6]!==r?(_=m=>({key:m,provider:r.find(c=>c.id===m.providerId)}),t[6]=r,t[7]=_):_=t[7];const b=n.filter(Kt).map(_).filter(Dt);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ve,{size:14}),t[8]=d):d=t[8];let a;t[9]!==i?(a=s.jsxs(L,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=a):a=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:a,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(At)})}),t[2]=n,t[3]=i,t[4]=r,t[5]=x}else x=t[5];return x}function At(e){const{key:t,provider:i}=e;return s.jsx(Nt,{providerKey:t,provider:i},t.id)}function Dt(e){return e.provider!==void 0}function Kt(e){return e.providerId!=="deco"}function Et(e){const t=U.c(3),{error:i}=e;let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Re,{size:16}),t[0]=n):n=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function $t(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Rt),e[0]=t,e[1]=i):i=e[1];const n=i,o=t.length>0,[l,r]=O.useState(!1),[x,_]=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 a=d;if(!o){let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>r(!0),e[4]=j):j=e[4];let f;e[5]!==a?(f=s.jsx(We,{providers:a,onSelect:_,onShowAll:j}),e[5]=a,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(_(null),r(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-16 w-full"}),children:s.jsx(mt,{})}),e[14]=m):m=e[14];let c;e[15]!==n?(c=n?s.jsx(bt,{}):s.jsx(St,{}),e[15]=n,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(wt,{onConnectClick:()=>r(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:r}),e[18]=l,e[19]=g):g=e[19];let v;return e[20]!==c||e[21]!==g?(v=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=v):v=e[22],v}function Rt(e){return e.providerId==="deco"}function Ft(){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:Ot,children:s.jsx(O.Suspense,{fallback:s.jsx(ae,{className:"h-64 w-full"}),children:s.jsx($t,{})})})]})})})}),e[1]=i):i=e[1],i}function Ot(e){const{error:t}=e;return s.jsx(Et,{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(ot,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Ft,{})}),e[0]=t):t=e[0],t}export{qs as default};
@@ -1 +0,0 @@
1
- import{e as W,r as B,j as e,c as X,l as Y}from"./index-DxLTuX83.js";import{i as Z}from"./ChevronRight-Betyx6_9.js";import{S as tt}from"./scroll-area-DtVZtiV9.js";import{aa as et,ab as rt,f as ot}from"./index-CeH9NvWc.js";import{c as it}from"./save-referenced-block-p44kfiVf.js";import{S as mt}from"./schema-form-DF5JNe2x.js";import{S as pt}from"./save-status-CrbNr3Yt.js";import"./select-C0Tyz9qJ.js";import"./tooltip-D1D9JHhD.js";import"./Check-CV74Rqqs.js";import"./ChevronDown-XKMoQgX6.js";import"./ChevronUp-CGfhqWp1.js";import"./agent-capabilities-UHQXEFqt.js";import"./chat-context-BGBybCr0.js";import"./tab-id-BEXPtrYn.js";import"./use-mcp-client-B7YSHa6V.js";import"./watch-sse-pool-BEICArze.js";import"./decopilot-sse-pool-Cu7Nizzp.js";import"./studio-tools-qhNYzbg-.js";import"./use-virtual-mcp-BHCygv1Q.js";import"./use-collections-CUoYyXrz.js";import"./use-ai-providers-CIvGzfXg.js";import"./use-organization-settings-mMiPWte8.js";import"./pair-DU07s2Yy.js";import"./agent-icon-BAU0Nn5Q.js";import"./AlertCircle-B5QG7wg7.js";import"./Tool01-Be5AVc1v.js";import"./SwitchHorizontal01-CkdIfbJ1.js";import"./RefreshCcw01-D-1V89vv.js";import"./XCircle-Ds6l9Vuw.js";import"./ArrowUpRight-Ce95HJs8.js";import"./ZapSquare-DMmAEMvR.js";import"./Users03-Cf3_qQGc.js";import"./CheckCircle-BiLWpS6e.js";import"./ChevronLeft-rORK5a-Y.js";import"./DotsVertical-CuchmOf0.js";import"./Container-Byi81M5N.js";import"./Eye-RSaOlPZv.js";import"./ZoomOut-C6xbqN0H.js";import"./Globe01-Ds0ZgQYM.js";import"./FilterLines-DuHSJmFt.js";import"./Star01-Dsaeuwpa.js";import"./Palette-gIYgJ3Wn.js";import"./HardDrive-C0JdZ_DO.js";import"./Stars02-ChPYLNIJ.js";import"./Key01-CStdo5WX.js";import"./LayoutLeft-BdQI12mG.js";import"./LinkExternal01-D7swM7zC.js";import"./Monitor01-CaSeRueL.js";import"./Sun-BUoG5bs4.js";import"./Play-1bLCgUWF.js";import"./Plus-wat9tYeJ.js";import"./SearchMd-BoptgjAM.js";import"./Settings02-8XjUg3gM.js";import"./Shield01-CjOnx-7R.js";import"./Stars01-DDkk5qux.js";import"./Trash01-YuwiLEVo.js";import"./Upload01-aGUy8jUM.js";import"./User01-CUMpCZVS.js";import"./Users01-BGw9h7dE.js";import"./XClose-CwNjmDWz.js";import"./X-D1kqmcok.js";import"./Zap-j2XVmCfk.js";import"./use-clock-tick-DufrTL6j.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B_iKACkn.js";import"./file-type-icon-CBlaUM9a.js";import"./dialog-DilC5A4p.js";import"./content-blocks-o63cs2vh.js";import"./types-DsYUq_UX.js";import"./shell-layout-DSw-nDR6.js";import"./avatar-BZq-o3M_.js";import"./required-auth-layout-Ce12SDHB.js";import"./useRouterState-CPOZ6kYF.js";import"./use-org-sso-qcLKm5I7.js";import"./integration-icon-C2c_G7v_.js";import"./use-navigate-to-agent-BpOmxFKV.js";import"./use-connection-DIX015NP.js";import"./use-mcp-prompts-B8H3Sb8-.js";import"./form-DcfAV72q.js";import"./label-Cv-qQXYd.js";import"./input-3FcnQKag.js";import"./spinner-CIUpakvk.js";import"./drawer-PqoucHj8.js";import"./collection-search-D2zd2w_6.js";import"./tabs-BEFEoOMo.js";import"./toggle-group-DzrJraBm.js";import"./sortable.esm-DhgyheK_.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C6z8X3mv.js";import"./use-registry-connections-BIDj-EVl.js";import"./useInfiniteQuery-Du3dTl6W.js";import"./use-infinite-scroll-BmPWzVgW.js";import"./extract-connection-data-zlBEIx4x.js";import"./generate-id-N17blLwS.js";import"./collections-BEkDC2fV.js";import"./card-_9LUJQRQ.js";import"./collection-tabs-Et7HpQI-.js";import"./badge-DBQKr8ze.js";import"./textarea-CZOXZ6_T.js";import"./connection-form-helpers-CJ-3PHD0.js";import"./useSuspenseInfiniteQuery-BHnbmrEl.js";import"./connect-desktop-dialog-C7P5AZy7.js";import"./agent-icons-CMqOumOa.js";import"./checkbox-BoVEsaTu.js";import"./skeleton-Dvzf2GQP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BxOSnd7f.js";import"./popover-DpnBmU5u.js";import"./command-DjRT1inC.js";import"./index-B6U1MHPz.js";import"./index-NuAPKwye.js";import"./dropdown-menu-CCeLALQe.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-DGAtAFWm.js";import"./sidebar-DILd2AwV.js";import"./sheet-BZaR5cN8.js";import"./toolbar-A-Rw_MZF.js";import"./use-create-virtual-mcp-BiFjwqV_.js";import"./github-repo-picker-CIreZixy.js";import"./use-mcp-tools-Bb7rwoEF.js";import"./alert-dialog-nDI1xJhR.js";import"./index-CoxAwU4M.js";import"./use-org-auth-client-B3bhhuY4.js";import"./hover-card-Bizl54yc.js";import"./task-status-17hQtONR.js";import"./use-status-sounds-FktjeAga.js";import"./empty-state-cuRG9xrS.js";import"./resizable-CDtszfkc.js";import"./use-capability-DDDjfOOE.js";import"./header-tab-button-CNFRl9p4.js";import"./index-WAvrfxHO.js";import"./user-BHiBl7KY.js";import"./tools-list-CmTd7_Mb.js";import"./switch-B2R8Oovd.js";import"./use-debounced-autosave-CsGRGmM0.js";import"./index-DM719JZt.js";import"./search-input-B5QgW7DO.js";import"./use-secrets-CMyn_SAh.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-B4RSATFh.js";import"./view-mode-toggle-C4AuqTiF.js";import"./select-model-qL2AwJh1.js";import"./use-automations-CP8543px.js";import"./monaco-editor-BenQSBIk.js";import"./automation-runs-BYZ99hni.js";import"./table-BHblf7Co.js";import"./use-members-D33brPm2.js";import"./automation-list-row-C-im7Cyh.js";import"./calendar-D0ZGZM9k.js";import"./image-field-Btc7vZ_B.js";import"./use-file-configs-CzVPvQ04.js";function Zr(E){const t=W.c(51),{orgSlug:R,virtualMcpId:P,branch:$,blockKey:r,block:m,meta:p,decofile:C,title:F,excludeFields:K,schemaPending:M}=E,V=M===void 0?!1:M,a=typeof m?.__resolveType=="string"?m.__resolveType:"";let v;t[0]!==K||t[1]!==p||t[2]!==a?(v=et(a,p,K),t[0]=K,t[1]=p,t[2]=a,t[3]=v):v=t[3];const s=v;let b;t[4]!==s?(b=!!s&&Object.keys(s.properties??{}).length>0,t[4]=s,t[5]=b):b=t[5];const T=b;let g;t[6]!==m||t[7]!==r||t[8]!==p||t[9]!==F?(g=F??(m?rt(r,m,p):r),t[6]=m,t[7]=r,t[8]=p,t[9]=F,t[10]=g):g=t[10];const n=g;let j;t[11]!==$||t[12]!==R||t[13]!==P?(j={orgSlug:R,virtualMcpId:P,branch:$},t[11]=$,t[12]=R,t[13]=P,t[14]=j):j=t[14];const{save:c,isPending:A}=ot(j);let y;t[15]!==c?(y=it((l,i)=>c(l,i)),t[15]=c,t[16]=y):y=t[16];const L=y,[G,H]=B.useState(r),[J,q]=B.useState(null),[z,Q]=B.useState(0);let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=[],t[17]=S):S=t[17];const[o,O]=B.useState(S);G!==r&&(H(r),q(null),Q(st),O([]));let N;t[18]!==m?(N=m??{},t[18]=m,t[19]=N):N=t[19];const D=J??N;let k;t[20]!==r||t[21]!==a||t[22]!==c?(k=l=>{const i=l;q(i),c(r,{...i,__resolveType:a})},t[20]=r,t[21]=a,t[22]=c,t[23]=k):k=t[23];const I=k;let _;t[24]!==o||t[25]!==n?(_=o.length>0?[n,...o]:[],t[24]=o,t[25]=n,t[26]=_):_=t[26];const h=_;let d;t[27]!==o||t[28]!==h||t[29]!==n?(d=h.length>0?e.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:h.map((l,i)=>{const U=i===h.length-1;return e.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[i>0&&e.jsx(Z,{className:"size-3 shrink-0 text-muted-foreground/60"}),e.jsx("button",{type:"button",onClick:()=>O(i===0?[]:o.slice(0,i)),title:l,className:X("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",U?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:l})]},`${l}-${i}`)})}):e.jsx("span",{className:"text-sm font-medium",children:n}),t[27]=o,t[28]=h,t[29]=n,t[30]=d):d=t[30];let f;t[31]!==A?(f=e.jsx(pt,{isPending:A,isError:!1}),t[31]=A,t[32]=f):f=t[32];let u;t[33]!==d||t[34]!==f?(u=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[d,f]}),t[33]=d,t[34]=f,t[35]=u):u=t[35];let x;t[36]!==r||t[37]!==o||t[38]!==C||t[39]!==D||t[40]!==z||t[41]!==I||t[42]!==T||t[43]!==p||t[44]!==L||t[45]!==s||t[46]!==V?(x=e.jsx(tt,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-6",children:e.jsx("div",{className:"mx-auto max-w-xl",children:T?e.jsx(mt,{schema:s,value:D,onChange:I,basePath:"",breadcrumbPath:o,onBreadcrumbChange:O,decofile:C,meta:p,onSaveReferencedBlock:L},`${r}:${z}`):V?e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[e.jsx(Y,{size:16,className:"animate-spin"}),"Loading app schema…"]}):e.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[36]=r,t[37]=o,t[38]=C,t[39]=D,t[40]=z,t[41]=I,t[42]=T,t[43]=p,t[44]=L,t[45]=s,t[46]=V,t[47]=x):x=t[47];let w;return t[48]!==u||t[49]!==x?(w=e.jsxs("div",{className:"flex h-full flex-col",children:[u,x]}),t[48]=u,t[49]=x,t[50]=w):w=t[50],w}function st(E){return E+1}export{Zr as AppEditor};
@@ -1 +0,0 @@
1
- import{e as k,j as o,q as L,f as T,r as $,B as M,t as N}from"./index-DxLTuX83.js";import{s as q}from"./Plus-wat9tYeJ.js";import{i as S}from"./Zap-j2XVmCfk.js";import{S as D}from"./search-input-B5QgW7DO.js";import{P as l}from"./index-DM719JZt.js";import{E as b}from"./empty-state-cuRG9xrS.js";import{c as O}from"./use-automations-CP8543px.js";import{k as V}from"./use-navigate-to-agent-BpOmxFKV.js";import{A as F}from"./automation-list-row-C-im7Cyh.js";import{h as G}from"./use-mcp-client-B7YSHa6V.js";import{a as H}from"./use-virtual-mcp-BHCygv1Q.js";import{R as J}from"./require-capability-BolUdzxs.js";import"./SearchMd-BoptgjAM.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./tooltip-D1D9JHhD.js";import"./sheet-BZaR5cN8.js";import"./X-D1kqmcok.js";import"./alert-dialog-nDI1xJhR.js";import"./dropdown-menu-CCeLALQe.js";import"./Check-CV74Rqqs.js";import"./ChevronRight-Betyx6_9.js";import"./DotsVertical-CuchmOf0.js";import"./agent-icon-BAU0Nn5Q.js";import"./AlertCircle-B5QG7wg7.js";import"./Tool01-Be5AVc1v.js";import"./SwitchHorizontal01-CkdIfbJ1.js";import"./RefreshCcw01-D-1V89vv.js";import"./XCircle-Ds6l9Vuw.js";import"./ArrowUpRight-Ce95HJs8.js";import"./ZapSquare-DMmAEMvR.js";import"./Users03-Cf3_qQGc.js";import"./CheckCircle-BiLWpS6e.js";import"./ChevronDown-XKMoQgX6.js";import"./ChevronLeft-rORK5a-Y.js";import"./ChevronUp-CGfhqWp1.js";import"./Container-Byi81M5N.js";import"./Eye-RSaOlPZv.js";import"./ZoomOut-C6xbqN0H.js";import"./Globe01-Ds0ZgQYM.js";import"./FilterLines-DuHSJmFt.js";import"./Star01-Dsaeuwpa.js";import"./Palette-gIYgJ3Wn.js";import"./HardDrive-C0JdZ_DO.js";import"./Stars02-ChPYLNIJ.js";import"./Key01-CStdo5WX.js";import"./LinkExternal01-D7swM7zC.js";import"./Monitor01-CaSeRueL.js";import"./Sun-BUoG5bs4.js";import"./Play-1bLCgUWF.js";import"./Settings02-8XjUg3gM.js";import"./Shield01-CjOnx-7R.js";import"./Stars01-DDkk5qux.js";import"./Trash01-YuwiLEVo.js";import"./Upload01-aGUy8jUM.js";import"./User01-CUMpCZVS.js";import"./Users01-BGw9h7dE.js";import"./XClose-CwNjmDWz.js";import"./use-collections-CUoYyXrz.js";import"./use-capability-DDDjfOOE.js";import"./access-gate-DfmEpXgP.js";import"./capability-load-error-BqquNR5_.js";function K(){const t=k.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,B=H(),R=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(B.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const m=y.get(e.virtual_mcp_id);if(m&&m.title.toLowerCase().includes(g))return!0}return!1}),P=(e,m)=>{const A=m&&y.has(m)?m:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),R(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 a;t[10]!==h.Content||t[11]!==s?(a=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=a):a=t[12];let c;return t[13]!==x||t[14]!==a?(c=o.jsx(x,{children:a}),t[13]=x,t[14]=a,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function eo(){const t=k.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{eo as default};
@@ -1 +0,0 @@
1
- import{e as H,X as Ie,q as Le,G as ze,K as Re,n as Ke,a as ge,j as n,B as Te,t as V,o as X,r as Oe,H as Xe,c as _e,D as fe}from"./index-DxLTuX83.js";import{a as He,u as Ue}from"./use-mcp-client-B7YSHa6V.js";import{t as qe}from"./ChevronDown-XKMoQgX6.js";import{i as Me}from"./ChevronRight-Betyx6_9.js";import{s as Ve,t as Ge}from"./Star01-Dsaeuwpa.js";import{n as Qe}from"./LinkExternal01-D7swM7zC.js";import{s as Pe}from"./Plus-wat9tYeJ.js";import{s as Ye}from"./Trash01-YuwiLEVo.js";import{i as Je}from"./Zap-j2XVmCfk.js";import{c as We,b as Ze,d as et,f as tt,g as st,e as nt,a as lt,A as ot}from"./alert-dialog-nDI1xJhR.js";import{I as ue}from"./input-3FcnQKag.js";import{T as rt}from"./textarea-CZOXZ6_T.js";import{P as Ne}from"./index-DM719JZt.js";import{u as at}from"./use-debounced-autosave-CsGRGmM0.js";import{R as it}from"./require-capability-BolUdzxs.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./tooltip-D1D9JHhD.js";import"./sheet-BZaR5cN8.js";import"./X-D1kqmcok.js";import"./use-capability-DDDjfOOE.js";import"./access-gate-DfmEpXgP.js";import"./capability-load-error-BqquNR5_.js";function $e(t){const e=t;if(e?.isError)throw new Error(e.content?.[0]?.text??"Tool call failed");const s=e?.structuredContent??t,o=s;if(o?.isError)throw new Error(o.content?.[0]?.text??"Tool call failed");return s}function we(t){const e=H.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let i;e[2]!==s?(i=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=i):i=e[3];let d;return e[4]!==o||e[5]!==r||e[6]!==i?(d=n.jsxs("div",{className:r,children:[i,o]}),e[4]=o,e[5]=r,e[6]=i,e[7]=d):d=e[7],d}function ct(t){const e=H.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Oe.useState("");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Je,{size:18,className:"text-primary"})}),e[0]=i):i=e[0];let d,u;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),u=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=d,e[2]=u):(d=e[1],u=e[2]);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=f=>r(f.target.value),e[3]=p):p=e[3];let b;e[4]!==l||e[5]!==o||e[6]!==s?(b=f=>{f.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=b):b=e[7];let m;e[8]!==l||e[9]!==b?(m=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:p,className:"max-w-xs",onKeyDown:b}),e[8]=l,e[9]=b,e[10]=m):m=e[10];let c;e[11]!==l||e[12]!==o?(c=!l.trim()||o,e[11]=l,e[12]=o,e[13]=c):c=e[13];let a;e[14]!==l||e[15]!==s?(a=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=a):a=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ve,{size:14}),e[17]=x):x=e[17];const g=o?"Extracting...":"Extract";let h;e[18]!==g||e[19]!==c||e[20]!==a?(h=n.jsxs(Te,{variant:"outline",disabled:c,onClick:a,children:[x,g]}),e[18]=g,e[19]=c,e[20]=a,e[21]=h):h=e[21];let v;return e[22]!==h||e[23]!==m?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[i,n.jsxs("div",{className:"flex-1",children:[d,u,n.jsxs("div",{className:"mt-3 flex gap-2",children:[m,h]})]})]})}),e[22]=h,e[23]=m,e[24]=v):v=e[24],v}function dt(t){const e=H.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const i=r;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=d):d=e[2];let u;e[3]!==o||e[4]!==l?(u=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=u):u=e[5];let p;e[6]!==s.control||e[7]!==u?(p=n.jsxs("div",{children:[d,n.jsx(fe,{control:s.control,name:"name",render:u})]}),e[6]=s.control,e[7]=u,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("span",{children:"Domain"}),e[9]=b):b=e[9];let m;e[10]!==i?(m=i&&n.jsxs("a",{href:`https://${i}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Qe,{size:10}),"open"]}),e[10]=i,e[11]=m):m=e[11];let c;e[12]!==m?(c=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[b,m]}),e[12]=m,e[13]=c):c=e[13];let a;e[14]!==o||e[15]!==l?(a=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=a):a=e[16];let x;e[17]!==s.control||e[18]!==a?(x=n.jsx(fe,{control:s.control,name:"domain",render:a}),e[17]=s.control,e[18]=a,e[19]=x):x=e[19];let g;e[20]!==c||e[21]!==x?(g=n.jsxs("div",{children:[c,x]}),e[20]=c,e[21]=x,e[22]=g):g=e[22];let h;e[23]!==g||e[24]!==p?(h=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[p,g]}),e[23]=g,e[24]=p,e[25]=h):h=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let f;e[27]!==o||e[28]!==l?(f=D=>{const{field:y}=D;return n.jsx(rt,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=f):f=e[29];let C;e[30]!==s.control||e[31]!==f?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:f})]}),e[30]=s.control,e[31]=f,e[32]=C):C=e[32];let w;return e[33]!==h||e[34]!==C?(w=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[h,C]})}),e[33]=h,e[34]=C,e[35]=w):w=e[35],w}const mt={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Se(t){const e=H.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:i,onFieldCommit:d}=t,u=r===void 0?"h-full w-full object-contain p-3":r;let p;e[0]!==s||e[1]!==o?(p=s.watch(o),e[0]=s,e[1]=o,e[2]=p):p=e[2];const b=p;let m;e[3]!==u||e[4]!==l||e[5]!==b?(m=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:mt,children:b?n.jsx("img",{src:b,alt:l,className:u,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=u,e[4]=l,e[5]=b,e[6]=m):m=e[6];let c;e[7]!==l?(c=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=c):c=e[8];let a;e[9]!==i||e[10]!==d?(a=v=>{const{field:f}=v;return n.jsx(ue,{...f,onChange:C=>{f.onChange(C),i()},onBlur:()=>{f.onBlur(),d()},placeholder:"https://..."})},e[9]=i,e[10]=d,e[11]=a):a=e[11];let x;e[12]!==s.control||e[13]!==o||e[14]!==a?(x=n.jsx(fe,{control:s.control,name:o,render:a}),e[12]=s.control,e[13]=o,e[14]=a,e[15]=x):x=e[15];let g;e[16]!==c||e[17]!==x?(g=n.jsxs("div",{className:"flex-1",children:[c,x]}),e[16]=c,e[17]=x,e[18]=g):g=e[18];let h;return e[19]!==m||e[20]!==g?(h=n.jsxs("div",{className:"flex items-start gap-3",children:[m,g]}),e[19]=m,e[20]=g,e[21]=h):h=e[21],h}function ft(t){const e=H.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const ut=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function xt(t){const e=H.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(d=>{const{key:u,label:p}=d,b=`fonts.${u}`,m=s.watch(b);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:p}),m&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:m},children:m})]}),n.jsx(fe,{control:s.control,name:b,render:c=>{const{field:a}=c;return n.jsx(ue,{...a,value:a.value??"",onChange:x=>{a.onChange(x),o()},onBlur:()=>{a.onBlur(),l()},placeholder:`Font family for ${p.toLowerCase()}`})}})]},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}const gt=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function ht(t){const e=H.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=gt.map(d=>{const{key:u,label:p}=d,b=`colors.${u}`;return n.jsx(fe,{control:s.control,name:b,render:m=>{const{field:c}=m;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:c.value??"#000000",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:c.value??"",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:p})]})}},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}function pt(t){const e=H.c(128),{brand:s,client:o,onChanged:l}=t,[r,i]=Oe.useState(s.isDefault??!1),[d,u]=Oe.useState(!1),p=s.name??"",b=s.domain??"",m=s.overview??"",c=s.logo??"",a=s.favicon??"",x=s.ogImage??"";let g;e[0]!==s.fonts?(g=s.fonts??{},e[0]=s.fonts,e[1]=g):g=e[1];let h;e[2]!==s.colors?(h=s.colors??{},e[2]=s.colors,e[3]=h):h=e[3];let v;e[4]!==p||e[5]!==b||e[6]!==m||e[7]!==c||e[8]!==a||e[9]!==x||e[10]!==g||e[11]!==h?(v={values:{name:p,domain:b,overview:m,logo:c,favicon:a,ogImage:x,fonts:g,colors:h}},e[4]=p,e[5]=b,e[6]=m,e[7]=c,e[8]=a,e[9]=x,e[10]=g,e[11]=h,e[12]=v):v=e[12];const f=Xe(v);let C;e[13]!==s.id||e[14]!==s.images||e[15]!==o?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(Et),Ce=Object.values(j.colors).some(Dt),Ae={id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null,images:s.images};await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:Ae})},onError:wt},e[13]=s.id,e[14]=s.images,e[15]=o,e[16]=C):C=e[16];const w=ge(C);let D;e[17]!==s.id||e[18]!==f||e[19]!==l||e[20]!==w?(D={delayMs:500,save:async()=>{const j=f.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=f.getValues(),Ae=f.control._defaultValues;f.reset(Ce,{keepValues:!0});try{await w.mutateAsync(Ce),V("brand_updated",{brand_id:s.id,fields:ve}),X.success("Brand context updated successfully"),l()}catch{f.reset(Ae,{keepValues:!0})}}},e[17]=s.id,e[18]=f,e[19]=l,e[20]=w,e[21]=D):D=e[21];const{schedule:y,flush:N}=at(D);let I;e[22]!==s.id||e[23]!==o?(I=async()=>{await o.callTool({name:"BRAND_CONTEXT_DELETE",arguments:{id:s.id}})},e[22]=s.id,e[23]=o,e[24]=I):I=e[24];let L;e[25]!==s.id||e[26]!==l?(L=()=>{V("brand_deleted",{brand_id:s.id}),u(!1),l(),X.success("Brand deleted")},e[25]=s.id,e[26]=l,e[27]=L):L=e[27];let U;e[28]!==I||e[29]!==L?(U={mutationFn:I,onSuccess:L,onError:_t},e[28]=I,e[29]=L,e[30]=U):U=e[30];const{mutate:xe,isPending:E}=ge(U);let k;e[31]!==s.id||e[32]!==s.isDefault||e[33]!==o?(k=async()=>{await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:{id:s.id,isDefault:!s.isDefault}})},e[31]=s.id,e[32]=s.isDefault,e[33]=o,e[34]=k):k=e[34];let S;e[35]!==s.id||e[36]!==s.isDefault||e[37]!==l?(S=()=>{V(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),l(),X.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[35]=s.id,e[36]=s.isDefault,e[37]=l,e[38]=S):S=e[38];let T;e[39]!==k||e[40]!==S?(T={mutationFn:k,onSuccess:S,onError:Nt},e[39]=k,e[40]=S,e[41]=T):T=e[41];const{mutate:O}=ge(T),M=s.isDefault?"border-primary/30":"border-border/60";let q;e[42]!==M?(q=_e("rounded-2xl border bg-background",M),e[42]=M,e[43]=q):q=e[43];let R;e[44]!==r?(R=()=>i(!r),e[44]=r,e[45]=R):R=e[45];let z;e[46]!==r?(z=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(qe,{size:14}):n.jsx(Me,{size:14})}),e[46]=r,e[47]=z):z=e[47];let B;e[48]!==s.logo||e[49]!==s.name?(B=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:Ct})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[48]=s.logo,e[49]=s.name,e[50]=B):B=e[50];const K=s.name||"Untitled Brand";let F;e[51]!==K?(F=n.jsx("span",{className:"text-sm font-medium text-foreground",children:K}),e[51]=K,e[52]=F):F=e[52];let A;e[53]!==s.domain?(A=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[53]=s.domain,e[54]=A):A=e[54];let P;e[55]!==F||e[56]!==A?(P=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[F,A]}),e[55]=F,e[56]=A,e[57]=P):P=e[57];let _;e[58]!==s.colors||e[59]!==r?(_=!r&&s.colors&&Object.values(s.colors).some(vt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(yt).map(jt)}),e[58]=s.colors,e[59]=r,e[60]=_):_=e[60];let $;e[61]!==s.fonts||e[62]!==r?($=!r&&s.fonts&&Object.values(s.fonts).some(bt)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[61]=s.fonts,e[62]=r,e[63]=$):$=e[63];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let G;e[64]!==De?(G=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[64]=De,e[65]=G):G=e[65];let Q,Y;e[66]!==O?(Q=j=>{j.stopPropagation(),O()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),O())},e[66]=O,e[67]=Q,e[68]=Y):(Q=e[67],Y=e[68]);const Ee=s.isDefault?"Unset as default":"Set as default",ke=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[69]!==ke?(J=_e(ke),e[69]=ke,e[70]=J):J=e[70];let W;e[71]!==J?(W=n.jsx(Ge,{size:13,className:J}),e[71]=J,e[72]=W):W=e[72];let Z;e[73]!==G||e[74]!==Q||e[75]!==Y||e[76]!==Ee||e[77]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:G,onClick:Q,onKeyDown:Y,title:Ee,children:W}),e[73]=G,e[74]=Q,e[75]=Y,e[76]=Ee,e[77]=W,e[78]=Z):Z=e[78];let he,pe;e[79]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),u(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),u(!0))},e[79]=he,e[80]=pe):(he=e[79],pe=e[80]);let be;e[81]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ye,{size:13,className:"text-muted-foreground"})}),e[81]=be):be=e[81];let ee;e[82]!==R||e[83]!==z||e[84]!==B||e[85]!==P||e[86]!==_||e[87]!==$||e[88]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:R,children:[z,B,P,_,$,Z,be]}),e[82]=R,e[83]=z,e[84]=B,e[85]=P,e[86]=_,e[87]=$,e[88]=Z,e[89]=ee):ee=e[89];let te;e[90]!==r||e[91]!==N||e[92]!==f||e[93]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(dt,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(ft,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ht,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(xt,{form:f,onFieldChange:y,onFieldCommit:N})]})]}),e[90]=r,e[91]=N,e[92]=f,e[93]=y,e[94]=te):te=e[94];let se;e[95]!==E?(se=j=>{!j&&!E&&u(!1)},e[95]=E,e[96]=se):se=e[96];let je;e[97]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(We,{children:"Delete brand?"}),e[97]=je):je=e[97];const Be=s.name||"this brand";let ne;e[98]!==Be?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Be}),". This action cannot be undone."]}),e[98]=Be,e[99]=ne):ne=e[99];let le;e[100]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[100]=s.isDefault,e[101]=le):le=e[101];let oe;e[102]!==ne||e[103]!==le?(oe=n.jsxs(Ze,{children:[je,n.jsx(et,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[102]=ne,e[103]=le,e[104]=oe):oe=e[104];let re;e[105]!==E?(re=n.jsx(tt,{disabled:E,children:"Cancel"}),e[105]=E,e[106]=re):re=e[106];let ae;e[107]!==xe?(ae=j=>{j.preventDefault(),xe()},e[107]=xe,e[108]=ae):ae=e[108];const Fe=E?"Deleting...":"Delete";let ie;e[109]!==E||e[110]!==ae||e[111]!==Fe?(ie=n.jsx(st,{onClick:ae,disabled:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[109]=E,e[110]=ae,e[111]=Fe,e[112]=ie):ie=e[112];let ce;e[113]!==re||e[114]!==ie?(ce=n.jsxs(nt,{children:[re,ie]}),e[113]=re,e[114]=ie,e[115]=ce):ce=e[115];let de;e[116]!==oe||e[117]!==ce?(de=n.jsxs(lt,{children:[oe,ce]}),e[116]=oe,e[117]=ce,e[118]=de):de=e[118];let me;e[119]!==d||e[120]!==se||e[121]!==de?(me=n.jsx(ot,{open:d,onOpenChange:se,children:de}),e[119]=d,e[120]=se,e[121]=de,e[122]=me):me=e[122];let ye;return e[123]!==q||e[124]!==ee||e[125]!==te||e[126]!==me?(ye=n.jsxs("div",{className:q,children:[ee,te,me]}),e[123]=q,e[124]=ee,e[125]=te,e[126]=me,e[127]=ye):ye=e[127],ye}function bt(t){return t}function jt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function yt(t){const[,e]=t;return e}function vt(t){return t}function Ct(t){t.target.style.display="none"}function Nt(){return X.error("Failed to update default brand")}function _t(){return X.error("Failed to delete brand")}function wt(){return X.error("Failed to save brand context")}function Dt(t){return t?.trim()}function Et(t){return t?.trim()}function kt(){const t=H.c(57),{brandExtractEnabled:e}=Ie(),{org:s}=Le();let o;t[0]!==s.id||t[1]!==s.slug?(o={connectionId:He,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=o):o=t[2];const l=Ue(o),r=ze();let i;t[3]!==s.id?(i=Re.brandContext(s.id),t[3]=s.id,t[4]=i):i=t[4];let d;t[5]!==l?(d=async()=>{const _=await l.callTool({name:"BRAND_CONTEXT_LIST",arguments:{includeArchived:!1}}),$=$e(_);return Array.isArray($?.items)?$.items:[]},t[5]=l,t[6]=d):d=t[6];let u;t[7]!==i||t[8]!==d?(u={queryKey:i,queryFn:d},t[7]=i,t[8]=d,t[9]=u):u=t[9];const{data:p}=Ke(u),m=(p===void 0?[]:p).filter(At);let c;t[10]!==s.id||t[11]!==r?(c=()=>r.invalidateQueries({queryKey:Re.brandContext(s.id),refetchType:"all"}),t[10]=s.id,t[11]=r,t[12]=c):c=t[12];const a=c;let x;t[13]!==l?(x=async()=>{await l.callTool({name:"BRAND_CONTEXT_CREATE",arguments:{name:"New Brand",domain:"example.com",overview:""}})},t[13]=l,t[14]=x):x=t[14];let g;t[15]!==a?(g=()=>{V("brand_created"),a(),X.success("Brand created")},t[15]=a,t[16]=g):g=t[16];let h;t[17]!==x||t[18]!==g?(h={mutationFn:x,onSuccess:g,onError:Ft},t[17]=x,t[18]=g,t[19]=h):h=t[19];const{mutate:v,isPending:f}=ge(h);let C;t[20]!==l?(C=async _=>{V("brand_extract_started",{domain:_});const $=await l.callTool({name:"BRAND_CONTEXT_EXTRACT",arguments:{domain:_}});$e($)},t[20]=l,t[21]=C):C=t[21];let w;t[22]!==a?(w=()=>{V("brand_extract_succeeded"),a(),X.success("Brand extracted successfully")},t[22]=a,t[23]=w):w=t[23];let D;t[24]!==w||t[25]!==C?(D={mutationFn:C,onSuccess:w,onError:Bt},t[24]=w,t[25]=C,t[26]=D):D=t[26];const{mutate:y,isPending:N}=ge(D),I=Ne,L=Ne,U=Ne,xe="flex flex-col gap-6";let E;t[27]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[27]=E):E=t[27];let k;t[28]!==v?(k=()=>v(),t[28]=v,t[29]=k):k=t[29];let S;t[30]===Symbol.for("react.memo_cache_sentinel")?(S=n.jsx(Pe,{size:14}),t[30]=S):S=t[30];let T;t[31]!==f||t[32]!==k?(T=n.jsxs("div",{className:"flex items-center justify-between",children:[E,n.jsxs(Te,{variant:"outline",onClick:k,disabled:f,children:[S,"Add Brand"]})]}),t[31]=f,t[32]=k,t[33]=T):T=t[33];let O;t[34]!==e||t[35]!==y||t[36]!==N?(O=e&&n.jsx(ct,{onExtract:_=>y(_),isExtracting:N}),t[34]=e,t[35]=y,t[36]=N,t[37]=O):O=t[37];const M=m.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Te,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>v(),disabled:f,children:[n.jsx(Pe,{size:14}),"Add your first brand"]})]}),q="group space-y-3";let R;t[38]!==l||t[39]!==a?(R=_=>n.jsx(pt,{brand:_,client:l,onChanged:a},_.id),t[38]=l,t[39]=a,t[40]=R):R=t[40];const z=m.map(R);let B;t[41]!==z?(B=n.jsx("div",{className:q,children:z}),t[41]=z,t[42]=B):B=t[42];let K;t[43]!==T||t[44]!==O||t[45]!==M||t[46]!==B?(K=n.jsxs("div",{className:xe,children:[T,O,M,B]}),t[43]=T,t[44]=O,t[45]=M,t[46]=B,t[47]=K):K=t[47];let F;t[48]!==U.Body||t[49]!==K?(F=n.jsx(U.Body,{children:K}),t[48]=U.Body,t[49]=K,t[50]=F):F=t[50];let A;t[51]!==L.Content||t[52]!==F?(A=n.jsx(L.Content,{children:F}),t[51]=L.Content,t[52]=F,t[53]=A):A=t[53];let P;return t[54]!==I||t[55]!==A?(P=n.jsx(I,{children:A}),t[54]=I,t[55]=A,t[56]=P):P=t[56],P}function Bt(t){V("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),X.error(t instanceof Error?t.message:"Failed to extract brand")}function Ft(){return X.error("Failed to create brand")}function At(t){return!t.archivedAt}function ts(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(it,{capability:"org:manage",area:"brand context",children:n.jsx(kt,{})}),t[0]=e):e=t[0],e}export{ts as default};
@@ -1 +0,0 @@
1
- import{e as D,j as t,E as q,r as v,B as A,o as P}from"./index-DxLTuX83.js";import{i as O}from"./AlertCircle-B5QG7wg7.js";import{i as $}from"./HardDrive-C0JdZ_DO.js";import{s as E}from"./Plus-wat9tYeJ.js";import{s as T}from"./Trash01-YuwiLEVo.js";import{f as L,g as K,c as G,b as M,d as W,e as H,a as J,A as Q}from"./alert-dialog-nDI1xJhR.js";import{D as V,a as X,b as Y,c as Z,e as ee,d as te}from"./dialog-DilC5A4p.js";import{I as N}from"./input-3FcnQKag.js";import{L as k}from"./label-Cv-qQXYd.js";import{S as se}from"./switch-B2R8Oovd.js";import{S as ie}from"./skeleton-Dvzf2GQP.js";import{T as re}from"./textarea-CZOXZ6_T.js";import{P as _}from"./index-DM719JZt.js";import{c as ne}from"./settings-section-BxOSnd7f.js";import{u as le,a as oe,b as ae}from"./use-file-configs-CzVPvQ04.js";import{R as ce}from"./require-capability-BolUdzxs.js";import"./X-D1kqmcok.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./tooltip-D1D9JHhD.js";import"./sheet-BZaR5cN8.js";import"./card-_9LUJQRQ.js";import"./ArrowUpRight-Ce95HJs8.js";import"./studio-tools-qhNYzbg-.js";import"./use-capability-DDDjfOOE.js";import"./access-gate-DfmEpXgP.js";import"./capability-load-error-BqquNR5_.js";function de(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 me(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(O,{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 fe(s){const e=D.c(41),{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($,{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.bucket||e[4]!==i.region?(o=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[3]=i.bucket,e[4]=i.region,e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==o?(p=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o]}),e[6]=l,e[7]=o,e[8]=p):p=e[8];let a;e[9]!==i.description?(a=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[9]=i.description,e[10]=a):a=e[10];let j;e[11]!==i.endpoint||e[12]!==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[11]=i.endpoint,e[12]=i.forcePathStyle,e[13]=j):j=e[13];let h;e[14]!==i.prefix?(h=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[14]=i.prefix,e[15]=h):h=e[15];let c;e[16]!==i.publicUrlBase?(c=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[16]=i.publicUrlBase,e[17]=c):c=e[17];let d;e[18]!==p||e[19]!==a||e[20]!==j||e[21]!==h||e[22]!==c?(d=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[p,a,j,h,c]})]}),e[18]=p,e[19]=a,e[20]=j,e[21]=h,e[22]=c,e[23]=d):d=e[23];let g;e[24]!==i.createdAt?(g=new Date(i.createdAt).toLocaleDateString(),e[24]=i.createdAt,e[25]=g):g=e[25];let x;e[26]!==g?(x=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[26]=g,e[27]=x):x=e[27];let m;e[28]!==i||e[29]!==n?(m=()=>n(i),e[28]=i,e[29]=n,e[30]=m):m=e[30];const y=`Delete ${i.name}`;let f;e[31]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(T,{size:14}),e[31]=f):f=e[31];let u;e[32]!==m||e[33]!==y?(u=t.jsx(A,{variant:"ghost",size:"sm",onClick:m,"aria-label":y,children:f}),e[32]=m,e[33]=y,e[34]=u):u=e[34];let S;e[35]!==x||e[36]!==u?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[x,u]}),e[35]=x,e[36]=u,e[37]=S):S=e[37];let C;return e[38]!==S||e[39]!==d?(C=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[d,S]}),e[38]=S,e[39]=d,e[40]=C):C=e[40],C}function ue(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($,{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(E,{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(A,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function B({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,p]=v.useState(""),[a,j]=v.useState(""),[h,c]=v.useState(""),[d,g]=v.useState(!1),[x,m]=v.useState(""),[y,f]=v.useState(""),[u,S]=v.useState(""),[C,w]=v.useState(""),F=oe();function R(){n(""),l(""),p(""),j(""),c(""),g(!1),m(""),f(""),S(""),w("")}async function z(b){if(b.preventDefault(),!(!i.trim()||!o.trim()||!a.trim())&&!(!u||!C))try{await F.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:a.trim(),endpoint:h.trim()||void 0,forcePathStyle:d,prefix:x.trim()||void 0,publicUrlBase:y.trim()||void 0,accessKeyId:u,secretAccessKey:C}),P.success(`Bucket "${i.trim()}" added`),R(),e(!1)}catch(I){P.error(de(I,"Failed to add bucket"))}}const U=F.isPending||!i.trim()||!o.trim()||!a.trim()||!u||!C;return t.jsx(V,{open:s,onOpenChange:e,children:t.jsxs(X,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(Y,{children:[t.jsx(Z,{children:"Add S3 bucket"}),t.jsx(ee,{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:z,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:b=>n(b.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(k,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:b=>p(b.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:a,onChange:b=>j(b.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:h,onChange:b=>c(b.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(k,{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(se,{id:"file-config-path-style",checked:d,onCheckedChange:g})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:x,onChange:b=>m(b.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(k,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:y,onChange:b=>f(b.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(k,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:u,onChange:b=>S(b.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:C,onChange:b=>w(b.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(re,{id:"file-config-description",value:r,onChange:b=>l(b.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(te,{children:[t.jsx(A,{type:"button",variant:"outline",onClick:()=>{R(),e(!1)},disabled:F.isPending,children:"Cancel"}),t.jsx(A,{type:"submit",disabled:U,children:F.isPending?"Adding…":"Add bucket"})]})]})]})})}function xe(s){const e=D.c(25),{config:i,onClose:n}=s,r=ae();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),P.success(`Bucket "${i.name}" removed`),n()}catch(S){const C=S;P.error(C instanceof Error?C.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,p=i!==null;let a;e[4]!==n?(a=u=>!u&&n(),e[4]=n,e[5]=a):a=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(G,{children:"Remove bucket configuration?"}),e[6]=j):j=e[6];const h=i?.name;let c;e[7]!==h?(c=t.jsxs(M,{children:[j,t.jsxs(W,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:h}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=h,e[8]=c):c=e[8];let d;e[9]!==r.isPending?(d=t.jsx(L,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=d):d=e[10];const g=r.isPending?"Removing…":"Remove";let x;e[11]!==r.isPending||e[12]!==o||e[13]!==g?(x=t.jsx(K,{onClick:o,disabled:r.isPending,children:g}),e[11]=r.isPending,e[12]=o,e[13]=g,e[14]=x):x=e[14];let m;e[15]!==d||e[16]!==x?(m=t.jsxs(H,{children:[d,x]}),e[15]=d,e[16]=x,e[17]=m):m=e[17];let y;e[18]!==m||e[19]!==c?(y=t.jsxs(J,{children:[c,m]}),e[18]=m,e[19]=c,e[20]=y):y=e[20];let f;return e[21]!==y||e[22]!==p||e[23]!==a?(f=t.jsx(Q,{open:p,onOpenChange:a,children:y}),e[21]=y,e[22]=p,e[23]=a,e[24]=f):f=e[24],f}function pe(){const s=D.c(25),e=le(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let f;s[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ue,{onCreate:()=>n(!0)}),s[0]=f):f=s[0];let u;return s[1]!==i?(u=t.jsxs(t.Fragment,{children:[f,t.jsx(B,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=u):u=s[2],u}const o=e.length===1?"":"s";let p;s[3]!==e.length||s[4]!==o?(p=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=p):p=s[5];let a;s[6]===Symbol.for("react.memo_cache_sentinel")?(a=()=>n(!0),s[6]=a):a=s[6];let j;s[7]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs(A,{onClick:a,size:"sm",children:[t.jsx(E,{size:14}),"Add bucket"]}),s[7]=j):j=s[7];let h;s[8]!==p?(h=t.jsxs("div",{className:"flex items-center justify-between",children:[p,j]}),s[8]=p,s[9]=h):h=s[9];let c;if(s[10]!==e){let f;s[12]===Symbol.for("react.memo_cache_sentinel")?(f=u=>t.jsx(fe,{config:u,onDelete:l},u.id),s[12]=f):f=s[12],c=e.map(f),s[10]=e,s[11]=c}else c=s[11];let d;s[13]!==c?(d=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:c})}),s[13]=c,s[14]=d):d=s[14];let g;s[15]!==i?(g=t.jsx(B,{open:i,onOpenChange:n}),s[15]=i,s[16]=g):g=s[16];let x;s[17]===Symbol.for("react.memo_cache_sentinel")?(x=()=>l(null),s[17]=x):x=s[17];let m;s[18]!==r?(m=t.jsx(xe,{config:r,onClose:x}),s[18]=r,s[19]=m):m=s[19];let y;return s[20]!==h||s[21]!==d||s[22]!==g||s[23]!==m?(y=t.jsxs(t.Fragment,{children:[h,d,g,m]}),s[20]=h,s[21]=d,s[22]=g,s[23]=m,s[24]=y):y=s[24],y}function he(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_,{children:t.jsx(_.Content,{children:t.jsx(_.Body,{children:t.jsxs(ne,{children:[e,t.jsx(q,{fallback:ge,children:t.jsx(v.Suspense,{fallback:t.jsx(ie,{className:"h-32 w-full"}),children:t.jsx(pe,{})})})]})})})}),s[1]=i):i=s[1],i}function ge(s){const{error:e}=s;return t.jsx(me,{error:e??new Error("Failed to load file configs")})}function Me(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ce,{capability:"file-configs:manage",area:"files",children:t.jsx(he,{})}),s[0]=e):e=s[0],e}export{Me as default};
@@ -1 +0,0 @@
1
- import{T as Ge,W as te,e as C,j as t,E as Pe,r as w,q as ie,H as Qe,c as J,bn as Ye,l as le,d as Xe,P as G,B as W,o as Ze,g as ae,bo as ke}from"./index-DxLTuX83.js";import{E as Ee}from"./empty-state-cuRG9xrS.js";import{u as et,a as Oe}from"./use-collections-CUoYyXrz.js";import{u as ce}from"./use-mcp-client-B7YSHa6V.js";import{F as se,a as tt,b as de,d as me}from"./form-DcfAV72q.js";import{I as ue}from"./input-3FcnQKag.js";import{T as re}from"./textarea-CZOXZ6_T.js";import{a as st,b as ot,V as pe}from"./layout-2bgJD0NS.js";import{S as nt,W as rt,a as it}from"./index-EffHR3rD.js";import{g as lt,M as at,a as be}from"./types-DsYUq_UX.js";import{A as ct,a as dt,b as mt}from"./alert-CeTPCPF-.js";import{d as Ne,S as ve,a as Se,b as ye,c as oe}from"./select-C0Tyz9qJ.js";import{c as ut,b as we,T as Ce,a as Ie}from"./tooltip-D1D9JHhD.js";import{i as pt}from"./AlertCircle-B5QG7wg7.js";import{T as xt,R as ft,a7 as ht,O as gt,a8 as jt,G as $e}from"./agent-icon-BAU0Nn5Q.js";import{a as bt}from"./Eye-RSaOlPZv.js";import{i as Nt}from"./Play-1bLCgUWF.js";import{i as vt}from"./ChevronRight-Betyx6_9.js";import{O as St,M as yt}from"./index-C_YL5c1Q.js";import{g as wt}from"./connection-slug-eyAPH6o3.js";import{u as Ct,T as It}from"./tools-list-CmTd7_Mb.js";import{a as Ae,u as Re}from"./use-connection-DIX015NP.js";import{b as $t}from"./use-mcp-tools-Bb7rwoEF.js";import{c as Tt}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-C2c_G7v_.js";import{g as Pt,i as kt}from"./chat-context-BGBybCr0.js";import{u as Et}from"./shell-layout-DSw-nDR6.js";import{M as Ot}from"./monaco-editor-BenQSBIk.js";import{E as At}from"./empty-state-C0m3QPuD.js";import{n as Rt}from"./Container-Byi81M5N.js";import"./label-Cv-qQXYd.js";import"./index-DM719JZt.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./sheet-BZaR5cN8.js";import"./X-D1kqmcok.js";import"./index-KCjld4_L.js";import"./collections-BEkDC2fV.js";import"./index-VW961Pbw.js";import"./use-virtual-mcp-BHCygv1Q.js";import"./resizable-CDtszfkc.js";import"./ZoomOut-C6xbqN0H.js";import"./badge-DBQKr8ze.js";import"./spinner-CIUpakvk.js";import"./view-mode-toggle-C4AuqTiF.js";import"./dialog-DilC5A4p.js";import"./scroll-area-DtVZtiV9.js";import"./index-NuAPKwye.js";import"./hover-card-Bizl54yc.js";import"./dropdown-menu-CCeLALQe.js";import"./Check-CV74Rqqs.js";import"./DotsVertical-CuchmOf0.js";import"./Plus-wat9tYeJ.js";import"./Tool01-Be5AVc1v.js";import"./XClose-CwNjmDWz.js";import"./accordion-B4RSATFh.js";import"./index-CoxAwU4M.js";import"./watch-sse-pool-BEICArze.js";import"./ChevronDown-XKMoQgX6.js";import"./ChevronUp-CGfhqWp1.js";import"./SwitchHorizontal01-CkdIfbJ1.js";import"./RefreshCcw01-D-1V89vv.js";import"./XCircle-Ds6l9Vuw.js";import"./ArrowUpRight-Ce95HJs8.js";import"./ZapSquare-DMmAEMvR.js";import"./Users03-Cf3_qQGc.js";import"./CheckCircle-BiLWpS6e.js";import"./ChevronLeft-rORK5a-Y.js";import"./Globe01-Ds0ZgQYM.js";import"./FilterLines-DuHSJmFt.js";import"./Star01-Dsaeuwpa.js";import"./Palette-gIYgJ3Wn.js";import"./HardDrive-C0JdZ_DO.js";import"./Stars02-ChPYLNIJ.js";import"./Key01-CStdo5WX.js";import"./LinkExternal01-D7swM7zC.js";import"./Monitor01-CaSeRueL.js";import"./Sun-BUoG5bs4.js";import"./SearchMd-BoptgjAM.js";import"./Settings02-8XjUg3gM.js";import"./Shield01-CjOnx-7R.js";import"./Stars01-DDkk5qux.js";import"./Trash01-YuwiLEVo.js";import"./Upload01-aGUy8jUM.js";import"./User01-CUMpCZVS.js";import"./Users01-BGw9h7dE.js";import"./Zap-j2XVmCfk.js";import"./extract-connection-data-zlBEIx4x.js";import"./generate-id-N17blLwS.js";import"./use-registry-connections-BIDj-EVl.js";import"./use-organization-settings-mMiPWte8.js";import"./index-B6U1MHPz.js";import"./popover-DpnBmU5u.js";import"./use-create-virtual-mcp-BiFjwqV_.js";import"./use-navigate-to-agent-BpOmxFKV.js";import"./tab-id-BEXPtrYn.js";import"./decopilot-sse-pool-Cu7Nizzp.js";import"./studio-tools-qhNYzbg-.js";import"./use-ai-providers-CIvGzfXg.js";import"./avatar-BZq-o3M_.js";import"./required-auth-layout-Ce12SDHB.js";import"./useRouterState-CPOZ6kYF.js";import"./use-org-sso-qcLKm5I7.js";import"./index-WAvrfxHO.js";Ge({title:te().min(1),description:te().nullable(),body:te()});function ne(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function _t(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),n=e>=0?s[e+1]:void 0;return n?decodeURIComponent(n):void 0}function Dt(s){const e=C.c(13),{form:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let r;e[1]!==n.control?(r=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:n.control,name:"title",render:zt}),t.jsx(se,{control:n.control,name:"description",render:Ut})]})]}),e[1]=n.control,e[2]=r):r=e[2];let i,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=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]=i,e[4]=a):(i=e[3],a=e[4]);let c;e[5]!==n.control?(c=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,a,t.jsx(se,{control:n.control,name:"body",render:Mt})]}),e[5]=n.control,e[6]=c):c=e[6];let l;e[7]!==r||e[8]!==c?(l=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:[r,c]}),e[7]=r,e[8]=c,e[9]=l):l=e[9];let p;return e[10]!==n||e[11]!==l?(p=t.jsx(tt,{...n,children:l}),e[10]=n,e[11]=l,e[12]=p):p=e[12],p}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 Ut(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 Bt(s){const e=C.c(36),{providerId:n,promptId:o}=s,{org:r}=ie(),i=n||null;let a;e[0]!==r.id||e[1]!==r.slug||e[2]!==i?(a={connectionId:i,orgId:r.id,orgSlug:r.slug},e[0]=r.id,e[1]=r.slug,e[2]=i,e[3]=a):a=e[3];const c=ce(a),l=et(n,"PROMPT",o,c),p=Oe(n,"PROMPT",c),f=p.update.isPending;let u;e[4]!==l?(u=l?{title:l.title,description:l.description??null,body:ne(l)}:void 0,e[4]=l,e[5]=u):u=e[5];let h;e[6]!==u?(h={values:u},e[6]=u,e[7]=h):h=e[7];const N=Qe(h);let T;e[8]!==N||e[9]!==l?(T=()=>{l&&N.reset({title:l.title,description:l.description??null,body:ne(l)})},e[8]=N,e[9]=l,e[10]=T):T=e[10];const O=T;let A;e[11]!==p.update||e[12]!==N||e[13]!==o?(A=N.handleSubmit(async j=>{const k=await p.update.mutateAsync({id:o,data:{title:j.title,description:j.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:j.body}}]}});N.reset({title:k.title,description:k.description??null,body:ne(k)})}),e[11]=p.update,e[12]=N,e[13]=o,e[14]=A):A=e[14];const R=A;if(!l){let j;return e[15]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=j):j=e[15],j}let y;e[16]!==l.title?(y=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:l.title}),e[16]=l.title,e[17]=y):y=e[17];let P;e[18]!==l.description?(P=l.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:l.description})]}):null,e[18]=l.description,e[19]=P):P=e[19];let I;e[20]!==y||e[21]!==P?(I=t.jsx(ot,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,P]})}),e[20]=y,e[21]=P,e[22]=I):I=e[22];let g;e[23]!==R?(g=()=>{R()},e[23]=R,e[24]=g):g=e[24];let v;e[25]!==N.formState.isDirty||e[26]!==f||e[27]!==O||e[28]!==g?(v=t.jsx(st,{children:t.jsx(nt,{onSave:g,onUndo:O,isDirty:N.formState.isDirty,isSaving:f})}),e[25]=N.formState.isDirty,e[26]=f,e[27]=O,e[28]=g,e[29]=v):v=e[29];let S;e[30]!==N?(S=t.jsx("div",{className:"h-full",children:t.jsx(Dt,{form:N})}),e[30]=N,e[31]=S):S=e[31];let $;return e[32]!==v||e[33]!==S||e[34]!==I?($=t.jsxs(pe,{children:[I,v,S]}),e[32]=v,e[33]=S,e[34]=I,e[35]=$):$=e[35],$}function Lt(s){const e=C.c(4),{itemId:n}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=_t(),e[0]=o):o=e[0];const r=o;if(!r){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=a):a=e[1],a}let i;return e[2]!==n?(i=t.jsx(Pe,{children:t.jsx(w.Suspense,{fallback:null,children:t.jsx(Bt,{providerId:r,promptId:n})})}),e[2]=n,e[3]=i):i=e[3],i}function _e(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("min-w-0 overflow-hidden",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function De(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("flex items-center gap-1.5 text-sm sm:gap-2 overflow-hidden",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("ol",{"data-slot":"breadcrumb-list",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function V(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("inline-flex items-center gap-1.5 min-w-0",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("li",{"data-slot":"breadcrumb-item",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Q(s){const e=C.c(10);let n,o,r;e[0]!==s?({asChild:n,className:o,...r}=s,e[0]=s,e[1]=n,e[2]=o,e[3]=r):(n=e[1],o=e[2],r=e[3]);const i=n?Ye:"a";let a;e[4]!==o?(a=J("hover:text-foreground transition-colors truncate",o),e[4]=o,e[5]=a):a=e[5];let c;return e[6]!==i||e[7]!==r||e[8]!==a?(c=t.jsx(i,{"data-slot":"breadcrumb-link",className:a,...r}),e[6]=i,e[7]=r,e[8]=a,e[9]=c):c=e[9],c}function Me(s){const e=C.c(8);let n,o;e[0]!==s?({className:n,...o}=s,e[0]=s,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let r;e[3]!==n?(r=J("text-foreground font-medium truncate",n),e[3]=n,e[4]=r):r=e[4];let i;return e[5]!==o||e[6]!==r?(i=t.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:r,...o}),e[5]=o,e[6]=r,e[7]=i):i=e[7],i}function Y(s){const e=C.c(12);let n,o,r;e[0]!==s?({children:n,className:o,...r}=s,e[0]=s,e[1]=n,e[2]=o,e[3]=r):(n=e[1],o=e[2],r=e[3]);let i;e[4]!==o?(i=J("[&>svg]:size-3.5 text-muted-foreground opacity-50 list-none shrink-0",o),e[4]=o,e[5]=i):i=e[5];let a;e[6]!==n?(a=n??t.jsx(vt,{}),e[6]=n,e[7]=a):a=e[7];let c;return e[8]!==r||e[9]!==i||e[10]!==a?(c=t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:i,...r,children:a}),e[8]=r,e[9]=i,e[10]=a,e[11]=c):c=e[11],c}const Ft=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Vt(s){const e=C.c(11),{toolName:n,connectionId:o,siblings:r,onSelectInstance:i,onBack:a}=s;let c;e[0]!==o?(c={connectionId:o},e[0]=o,e[1]=c):c=e[1];const l=Ct(c);if(!l.isAuthenticated){let u;return e[2]!==l.supportsOAuth||e[3]!==a?(u=t.jsx("div",{className:"flex h-full items-center justify-center",children:l.supportsOAuth?t.jsx(St,{onAuthenticate:()=>a(),buttonText:"Go back to authenticate"}):t.jsx(yt,{hasReadme:!1})}),e[2]=l.supportsOAuth,e[3]=a,e[4]=u):u=e[4],u}const p=`${o}:${n}`;let f;return e[5]!==o||e[6]!==i||e[7]!==r||e[8]!==p||e[9]!==n?(f=t.jsx(Jt,{toolName:n,connectionId:o,siblings:r,onSelectInstance:i},p),e[5]=o,e[6]=i,e[7]=r,e[8]=p,e[9]=n,e[10]=f):f=e[10],f}function Jt({toolName:s,connectionId:e,siblings:n,onSelectInstance:o}){const{replayId:r}=Xe({strict:!1}),i=(()=>{if(!r)return null;const d=`replay-${r}`,m=sessionStorage.getItem(d);if(!m)return null;sessionStorage.removeItem(d);try{return JSON.parse(m)}catch{return null}})(),a=(()=>{if(!i)return null;const d={};for(const[m,b]of Object.entries(i))b!==null&&typeof b=="object"?d[m]=JSON.stringify(b,null,2):d[m]=b;return d})(),[c,l]=w.useState(a??{}),[p,f]=w.useState(i?JSON.stringify(i,null,2):"{}"),[u,h]=w.useState(null),[N,T]=w.useState(null),[O,A]=w.useState(null),[R,y]=w.useState(null),[P,I]=w.useState(!1),[g,v]=w.useState(null),{org:S}=ie(),$=Ae(e),j=Pt(),k=kt(),{setChatOpen:B}=Et(),U=`${e}:${s}`,_=ce({connectionId:e,orgId:S.id,orgSlug:S.slug}),z=$t({client:_}),x=z.data?.tools?.find(d=>d.name===s),E=lt(x?._meta),F=d=>{if(!j)return;const m=Tt(d.content);m.content.length>0&&(B(!0),j.sendMessage({tiptapDoc:m}))},[D,X]=w.useState("json"),[Ue,ze]=w.useState(!1);E&&!Ue&&(X("ui"),ze(!0));const xe=x?.inputSchema?.properties,fe=xe?Object.keys(xe):[],q=fe.length>0,H={};if(q&&x?.inputSchema?.properties)for(const d of fe)H[d]=x.inputSchema.required?.includes(d)?"":void 0;const Z=d=>Object.prototype.hasOwnProperty.call(c,d),Be=async()=>{I(!0),y(null),h(null),T(null),A(null),v(null);const d=performance.now();try{if(!_)throw new Error("MCP client is not available");const m=q?{...H,...c}:(()=>{const M=p.trim();if(!M)return{};const L=JSON.parse(M);if(L&&typeof L=="object")return L;throw new Error("Raw JSON input must be an object.")})();q&&x?.inputSchema?.properties&&Object.entries(x.inputSchema.properties).forEach(([M,L])=>{if((L.type==="object"||L.type==="array")&&typeof m[M]=="string")try{m[M]=JSON.parse(m[M])}catch{}else if((L.type==="number"||L.type==="integer")&&typeof m[M]=="string"&&m[M]!==""){const je=Number(m[M]);Number.isNaN(je)||(m[M]=je)}});const b=await _.callTool({name:s,arguments:m}),K=b.structuredContent??b,We=performance.now(),He=Math.round(We-d);h(K),T(b),A(m);const Ke=JSON.stringify(K),ge=new TextEncoder().encode(Ke).length;v({duration:`${He}ms`,bytes:`${ge} bytes`,tokens:`~${Math.ceil(ge/4)} tokens`,cost:"$0.0000"})}catch(m){const b=m instanceof Error?m.message:String(m);y(b||"Unknown error occurred");const K=performance.now();v({duration:`${Math.round(K-d)}ms`})}finally{I(!1)}},ee=(d,m)=>{l(b=>({...b,[d]:m}))},Le=()=>{h(null),T(null),A(null),y(null),v(null)},Fe=x?.name??Ft(s),Ve=t.jsx(_e,{children:t.jsxs(De,{children:[t.jsx(V,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:S.slug},children:"Connections"})})}),t.jsx(Y,{}),$&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:S.slug,appSlug:wt($)},search:{tab:"tools"},children:$.title})})}),t.jsx(Y,{})]}),t.jsx(V,{children:t.jsx(Me,{children:Fe})})]})}),he=n.length>1&&t.jsxs(Ne,{value:e,onValueChange:o,children:[t.jsx(ve,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(Se,{})}),t.jsx(ye,{children:n.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"}),x?.inputSchema?.required&&x.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:q&&x?.inputSchema?.properties?Object.entries(x.inputSchema.properties).map(([d,m])=>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,x.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:m.type})]}),m.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:m.description}),m.type==="object"||m.type==="array"?t.jsx(re,{className:"font-mono text-xs",value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d} as JSON...`,rows:3}):m.type==="boolean"?t.jsxs(Ne,{value:Z(d)?String(c[d]??""):"",onValueChange:b=>ee(d,b==="true"),children:[t.jsx(ve,{children:t.jsx(Se,{placeholder:"Select true or false..."})}),t.jsxs(ye,{children:[t.jsx(oe,{value:"true",children:"true"}),t.jsx(oe,{value:"false",children:"false"})]})]}):t.jsx(ue,{value:Z(d)?c[d]??"":H[d]??"",onChange:b=>ee(d,b.target.value),placeholder:`Enter ${d}...`})]},d)):x?.inputSchema&&!q?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:p,onChange:d=>f(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:P?t.jsxs(W,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Le,children:[t.jsx(xt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(W,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Be,children:[t.jsx(Nt,{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:[g&&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(ft,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.duration})]}),g.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ht,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.tokens})]}),g.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(gt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:g.bytes})]}),g.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:g.cost})})]}),E&&t.jsx(ut,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(we,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(W,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(jt,{size:14})})}),t.jsx(Ie,{children:"Interactive view"})]}),t.jsxs(we,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(W,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx($e,{size:14})})}),t.jsx(Ie,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(ct,{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(pt,{className:"h-4 w-4"}),t.jsx(dt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(mt,{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:E&&D==="ui"&&_?t.jsx(w.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(at,{resourceURI:E,toolInfo:x?{tool:x}:void 0,toolInput:O??void 0,toolResult:N??void 0,displayMode:"fullscreen",minHeight:be.view.minHeight,maxHeight:be.view.maxHeight,client:_,onMessage:F,onUpdateModelContext:d=>k?.setAppContext(U,d),onTeardown:()=>k?.clearAppContext(U),className:"h-full"})}):u?t.jsxs(t.Fragment,{children:[t.jsx(Ot,{code:JSON.stringify(u,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(W,{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(u,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(bt,{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($e,{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(pe,{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:$?.icon||null,name:$?.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:[z.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):z.isLoading?t.jsx(le,{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:z.isSuccess?"ready":z.isLoading?"connecting":"error"})]}),t.jsx(It,{annotations:x?.annotations,_meta:x?._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:x?.description||"No description available"})]}),n.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 qt(s){const e=C.c(10),{itemId:n,siblings:o,onBack:r}=s,[i,a]=w.useState(o[0]?.id??"");let c;e[0]!==i||e[1]!==o?(c=o.find(h=>h.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=c):c=e[2];const l=c;if(!Ae(l||void 0)||!l){let h;return e[3]===Symbol.for("react.memo_cache_sentinel")?(h=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]=h):h=e[3],h}let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=f):f=e[4];let u;return e[5]!==l||e[6]!==r||e[7]!==o||e[8]!==n?(u=t.jsx(w.Suspense,{fallback:f,children:t.jsx(Vt,{toolName:n,connectionId:l,siblings:o,onSelectInstance:a,onBack:r})}),e[5]=l,e[6]=r,e[7]=o,e[8]=n,e[9]=u):u=e[9],u}const Wt={workflow:it,workflow_execution:rt,prompt:Lt};function Ht(){const s=C.c(9),e=ke();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const o=ae(n),r=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const a=Re(i);let c;s[3]!==e.history?(c=()=>{e.history.back()},s[3]=e.history,s[4]=c):c=s[4];const l=c,p=Kt;let f;return s[5]!==l||s[6]!==r||s[7]!==a?(f=t.jsx(qt,{itemId:r,siblings:a,onBack:l,onUpdate:p}),s[5]=l,s[6]=r,s[7]=a,s[8]=f):f=s[8],f}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=C.c(41),e=ke();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=n):n=s[0];const o=ae(n),r=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.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:l}=ie();let p;s[3]!==o.appSlug?(p={slug:o.appSlug},s[3]=o.appSlug,s[4]=p):p=s[4];const u=Re(p)[0]??null,h=u?.id??"",N=h||"no-connection",T=h??null;let O;s[5]!==l.id||s[6]!==l.slug||s[7]!==T?(O={connectionId:T,orgId:l.id,orgSlug:l.slug},s[5]=l.id,s[6]=l.slug,s[7]=T,s[8]=O):O=s[8];const A=ce(O),R=Oe(N,r,A);let y;s[9]!==R||s[10]!==i?(y=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=y):y=s[11];const P=y;let I;s[12]!==r?(I=r?.toLowerCase(),s[12]=r,s[13]=I):I=s[13];const g=I,v=g&&Wt[g];let S;s[14]!==r?(S=Gt(r),s[14]=r,s[15]=S):S=s[15];const $=S;let j;s[16]!==l.slug?(j=t.jsx(V,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections",params:{org:l.slug},children:"Connections"})})}),s[16]=l.slug,s[17]=j):j=s[17];let k;s[18]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Y,{}),s[18]=k):k=s[18];let B;s[19]!==r||s[20]!==u||s[21]!==l.slug||s[22]!==o.appSlug?(B=u&&t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(Q,{asChild:!0,children:t.jsx(G,{to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.appSlug},search:{tab:r},children:u.title})})}),t.jsx(Y,{})]}),s[19]=r,s[20]=u,s[21]=l.slug,s[22]=o.appSlug,s[23]=B):B=s[23];let U;s[24]!==$?(U=t.jsx(V,{children:t.jsx(Me,{children:$})}),s[24]=$,s[25]=U):U=s[25];let _;s[26]!==B||s[27]!==U||s[28]!==j?(_=t.jsx(_e,{children:t.jsxs(De,{children:[j,k,B,U]})}),s[26]=B,s[27]=U,s[28]=j,s[29]=_):_=s[29];const z=_;if(v){let D;return s[30]!==v||s[31]!==c||s[32]!==P||s[33]!==i?(D=t.jsx(v,{itemId:i,onBack:c,onUpdate:P}),s[30]=v,s[31]=c,s[32]=P,s[33]=i,s[34]=D):D=s[34],D}let x;s[35]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Rt,{size:36,className:"text-muted-foreground"}),s[35]=x):x=s[35];let E;s[36]!==c?(E=t.jsx(At,{icon:x,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:c,children:"Go back"}}),s[36]=c,s[37]=E):E=s[37];let F;return s[38]!==z||s[39]!==E?(F=t.jsx(pe,{breadcrumb:z,children:E}),s[38]=z,s[39]=E,s[40]=F):F=s[40],F}function Yt(){const s=C.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 n=ae(e);if(decodeURIComponent(n.collectionName)==="tools"){let a;return s[1]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Ht,{}),s[1]=a):a=s[1],a}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Qt,{}),s[2]=i):i=s[2],i}function Go(){const s=C.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx(w.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Yt,{})})}),s[0]=e):e=s[0],e}export{Go as default};
@@ -1 +0,0 @@
1
- import{d as o}from"./watch-sse-pool-BEICArze.js";const c=o;export{c as d};
@@ -1 +0,0 @@
1
- import{e as Z,q as L,b as Q,G as B,K as k,n as U,a as P,j as s,B as q,t as z,o as h}from"./index-DxLTuX83.js";import{u as $}from"./studio-tools-qhNYzbg-.js";import{S as Y}from"./switch-B2R8Oovd.js";import{S as H,a as v,b as M}from"./settings-section-BxOSnd7f.js";function ei(){const i=Z.c(59),{org:e}=L(),{data:J}=Q.useSession(),R=B(),a=$();let r;i[0]!==e.id?(r=k.organizationDomain(e.id),i[0]=e.id,i[1]=r):r=i[1];let d;i[2]!==a?(d=()=>a.call("ORGANIZATION_DOMAIN_GET",{}),i[2]=a,i[3]=d):d=i[3];let A;i[4]!==r||i[5]!==d?(A={queryKey:r,queryFn:d},i[4]=r,i[5]=d,i[6]=A):A=i[6];const{data:G,isPending:K}=U(A),T=J?.user?.email??"";let x;i[7]!==T?(x=T.split("@")[1]?.toLowerCase()??"",i[7]=T,i[8]=x):x=i[8];const n=x,o=G?.domain??null,w=G?.autoJoinEnabled??!1,F=n&&n!==o;let C;i[9]!==e.id||i[10]!==R?(C=()=>R.invalidateQueries({queryKey:k.organizationDomain(e.id)}),i[9]=e.id,i[10]=R,i[11]=C):C=i[11];const l=C;let c;i[12]!==a||i[13]!==n?(c=()=>a.call("ORGANIZATION_DOMAIN_SET",{domain:n,autoJoinEnabled:!1}),i[12]=a,i[13]=n,i[14]=c):c=i[14];let m;i[15]!==l||i[16]!==e.id||i[17]!==n?(m=()=>{z("organization_domain_claimed",{organization_id:e.id,email_domain:n}),l(),h.success("Domain claimed")},i[15]=l,i[16]=e.id,i[17]=n,i[18]=m):m=i[18];let u;i[19]!==e.id||i[20]!==n?(u=t=>{z("organization_domain_claim_failed",{organization_id:e.id,email_domain:n,error:t instanceof Error?t.message:String(t)}),h.error(t instanceof Error?t.message:"Failed to claim domain")},i[19]=e.id,i[20]=n,i[21]=u):u=i[21];let D;i[22]!==c||i[23]!==m||i[24]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[22]=c,i[23]=m,i[24]=u,i[25]=D):D=i[25];const p=P(D);let g;i[26]!==a?(g=()=>a.call("ORGANIZATION_DOMAIN_CLEAR",{}),i[26]=a,i[27]=g):g=i[27];let f;i[28]!==o||i[29]!==l||i[30]!==e.id?(f=()=>{z("organization_domain_cleared",{organization_id:e.id,email_domain:o}),l(),h.success("Domain removed")},i[28]=o,i[29]=l,i[30]=e.id,i[31]=f):f=i[31];let _;i[32]!==o||i[33]!==e.id?(_=t=>{z("organization_domain_clear_failed",{organization_id:e.id,email_domain:o,error:t instanceof Error?t.message:String(t)}),h.error(t instanceof Error?t.message:"Failed to remove domain")},i[32]=o,i[33]=e.id,i[34]=_):_=i[34];let I;i[35]!==f||i[36]!==_||i[37]!==g?(I={mutationFn:g,onSuccess:f,onError:_},i[35]=f,i[36]=_,i[37]=g,i[38]=I):I=i[38];const N=P(I);let E;i[39]!==o||i[40]!==e.id||i[41]!==a?(E=async t=>{if(o)return z("organization_auto_join_toggled",{organization_id:e.id,enabled:t}),a.call("ORGANIZATION_DOMAIN_UPDATE",{autoJoinEnabled:t})},i[39]=o,i[40]=e.id,i[41]=a,i[42]=E):E=i[42];let j;i[43]!==l?(j=()=>{l(),h.success("Auto-join setting updated")},i[43]=l,i[44]=j):j=i[44];let S;i[45]!==e.id?(S=t=>{z("organization_auto_join_toggle_failed",{organization_id:e.id,error:t instanceof Error?t.message:String(t)}),h.error(t instanceof Error?t.message:"Failed to update auto-join")},i[45]=e.id,i[46]=S):S=i[46];let O;i[47]!==E||i[48]!==j||i[49]!==S?(O={mutationFn:E,onSuccess:j,onError:S},i[47]=E,i[48]=j,i[49]=S,i[50]=O):O=i[50];const y=P(O);if(K)return null;let b;return i[51]!==w||i[52]!==F||i[53]!==N||i[54]!==o||i[55]!==p||i[56]!==y||i[57]!==n?(b=s.jsx(H,{title:"Email domain",children:o?s.jsxs(v,{children:[s.jsx(M,{title:o,description:"Claimed domain",action:s.jsx(q,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(M,{title:"Auto-join",description:`Users with @${o} emails will automatically join this organization on signup.`,action:s.jsx(Y,{checked:w,onCheckedChange:t=>y.mutate(t),disabled:y.isPending})})]}):F?s.jsx(v,{children:s.jsx(M,{title:n,description:"Let new users with matching emails auto-join this org.",action:s.jsx(q,{size:"sm",onClick:()=>p.mutate(),disabled:p.isPending,children:p.isPending?"Claiming...":"Claim domain"})})}):s.jsx(v,{children:s.jsx(M,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[51]=w,i[52]=F,i[53]=N,i[54]=o,i[55]=p,i[56]=y,i[57]=n,i[58]=b):b=i[58],b}export{ei as D};
@@ -1 +0,0 @@
1
- import{e as p,g as d,cm as l,j as s,O as u}from"./index-DxLTuX83.js";import{P as c}from"./plugin-layout-Bwwo9Dmw.js";import"./use-connection-DIX015NP.js";import"./use-collections-CUoYyXrz.js";import"./use-mcp-client-B7YSHa6V.js";import"./studio-tools-qhNYzbg-.js";import"./Settings02-8XjUg3gM.js";import"./index-DM719JZt.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./tooltip-D1D9JHhD.js";import"./sheet-BZaR5cN8.js";import"./X-D1kqmcok.js";function $(){const e=p.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:a}=d(n);let i;e[1]!==a?(i=l.find(r=>r.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let m;return e[8]!==o?(m=s.jsx(o,{}),e[8]=o,e[9]=m):m=e[9],m}export{$ as default};
@@ -1 +0,0 @@
1
- import{e as b,q as k,G as q,cm as P,j as n,cn as E,b7 as R,K as S,o as K}from"./index-DxLTuX83.js";import{P as j}from"./index-DM719JZt.js";import{d as _}from"./use-organization-settings-mMiPWte8.js";import{S as I}from"./switch-B2R8Oovd.js";import{n as Q}from"./Container-Byi81M5N.js";import{b as w,S as z,a as F,c as N}from"./settings-section-BxOSnd7f.js";import{R as T}from"./require-capability-BolUdzxs.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./tooltip-D1D9JHhD.js";import"./sheet-BZaR5cN8.js";import"./X-D1kqmcok.js";import"./use-mcp-client-B7YSHa6V.js";import"./card-_9LUJQRQ.js";import"./ArrowUpRight-Ce95HJs8.js";import"./use-capability-DDDjfOOE.js";import"./access-gate-DfmEpXgP.js";import"./capability-load-error-BqquNR5_.js";function U(){const e=b.c(17),{org:t,project:s}=k(),r=q();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const a=d,l=_();let m;e[2]!==t||e[3]!==s.slug||e[4]!==r?(m=()=>{r.invalidateQueries({queryKey:S.project(t.id,s.slug)}),r.invalidateQueries({queryKey:S.projects(t.id)}),r.invalidateQueries({predicate:i=>{const o=i.queryKey;return o[1]===t.id&&o[3]==="collection"&&o[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=r,e[5]=m):m=e[5];const x=m;let p;e[6]!==x||e[7]!==l||e[8]!==a?(p=(i,o)=>{const u=new Set(a);o?u.add(i):u.delete(i),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:x,onError:G})},e[6]=x,e[7]=l,e[8]=a,e[9]=p):p=e[9];const g=p,y=D,C=A;if(P.length===0){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=i):i=e[10],i}let c;e[11]!==g||e[12]!==l||e[13]!==a?(c=P.map(i=>{const o=y(i.id),u=C(i.id),h=a.includes(i.id);return n.jsx(w,{title:o?.label??i.id,description:u??void 0,icon:n.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:o?.icon??n.jsx(Q,{size:14})}),onClick:()=>!l.isPending&&g(i.id,!h),action:n.jsx(I,{checked:h,onCheckedChange:v=>g(i.id,v),disabled:l.isPending,onClick:$})},i.id)}),e[11]=g,e[12]=l,e[13]=a,e[14]=c):c=e[14];let f;return e[15]!==c?(f=n.jsx(z,{children:n.jsx(F,{children:c})}),e[15]=c,e[16]=f):f=e[16],f}function $(e){return e.stopPropagation()}function A(e){return P.find(s=>s.id===e)?.description??null}function D(e){const t=E.find(r=>r.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=R.find(r=>r.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function G(e){K.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function M(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(j,{children:n.jsx(j.Content,{children:n.jsx(j.Body,{children:n.jsxs(N,{children:[n.jsx(j.Title,{children:"Plugins"}),n.jsx(U,{})]})})})}),e[0]=t):t=e[0],t}function ae(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(T,{capability:"org:manage",area:"plugins",children:n.jsx(M,{})}),e[0]=t):t=e[0],t}export{ae as default};
@@ -1,2 +0,0 @@
1
- import{e as Ke,r as l,j as i,l as re,B as fe,c as Ve,G as ut,o as $,K as Te}from"./index-DxLTuX83.js";import{F as mt,l as pt}from"./index-WAvrfxHO.js";import{_ as ht,ar as xt,as as gt,at as ae,au as yt,H as $e}from"./agent-icon-BAU0Nn5Q.js";import{a as wt}from"./Tool01-Be5AVc1v.js";import{s as jt}from"./XClose-CwNjmDWz.js";import{S as bt}from"./scroll-area-DtVZtiV9.js";import{b as Re,T as Oe,a as ze}from"./tooltip-D1D9JHhD.js";import{A as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,f as Ft,g as Lt}from"./alert-dialog-nDI1xJhR.js";import{a as Et}from"./chat-context-BGBybCr0.js";import{u as Pt}from"./shell-layout-DSw-nDR6.js";import{a7 as le,a8 as Ae,a9 as Tt}from"./index-CeH9NvWc.js";import{c as $t,e as Rt,b as Ot,d as zt,a as At,D as Wt}from"./dialog-DilC5A4p.js";import{I as We}from"./input-3FcnQKag.js";import{C as It,c as _,d as Ie,e as Mt,f as Kt}from"./shell-route-loading-DGAtAFWm.js";import{t as Vt}from"./ChevronDown-XKMoQgX6.js";import{i as Bt}from"./ChevronRight-Betyx6_9.js";import{i as Gt}from"./ZoomOut-C6xbqN0H.js";import{E as qt,q as Me,r as he,s as Qt,t as Ut,v as Ht,w as M,x as ce,g as xe,y as ge,z as Jt,A as Xt,B as ye,C as de,D as we,G as Yt,I as Zt}from"./header-tab-button-CNFRl9p4.js";import"./AlertCircle-B5QG7wg7.js";import"./SwitchHorizontal01-CkdIfbJ1.js";import"./RefreshCcw01-D-1V89vv.js";import"./XCircle-Ds6l9Vuw.js";import"./ArrowUpRight-Ce95HJs8.js";import"./ZapSquare-DMmAEMvR.js";import"./Users03-Cf3_qQGc.js";import"./CheckCircle-BiLWpS6e.js";import"./Check-CV74Rqqs.js";import"./ChevronLeft-rORK5a-Y.js";import"./ChevronUp-CGfhqWp1.js";import"./DotsVertical-CuchmOf0.js";import"./Container-Byi81M5N.js";import"./Eye-RSaOlPZv.js";import"./Globe01-Ds0ZgQYM.js";import"./FilterLines-DuHSJmFt.js";import"./Star01-Dsaeuwpa.js";import"./Palette-gIYgJ3Wn.js";import"./HardDrive-C0JdZ_DO.js";import"./Stars02-ChPYLNIJ.js";import"./Key01-CStdo5WX.js";import"./LayoutLeft-BdQI12mG.js";import"./LinkExternal01-D7swM7zC.js";import"./Monitor01-CaSeRueL.js";import"./Sun-BUoG5bs4.js";import"./Play-1bLCgUWF.js";import"./Plus-wat9tYeJ.js";import"./SearchMd-BoptgjAM.js";import"./Settings02-8XjUg3gM.js";import"./Shield01-CjOnx-7R.js";import"./Stars01-DDkk5qux.js";import"./Trash01-YuwiLEVo.js";import"./Upload01-aGUy8jUM.js";import"./User01-CUMpCZVS.js";import"./Users01-BGw9h7dE.js";import"./X-D1kqmcok.js";import"./Zap-j2XVmCfk.js";import"./select-C0Tyz9qJ.js";import"./tab-id-BEXPtrYn.js";import"./use-mcp-client-B7YSHa6V.js";import"./watch-sse-pool-BEICArze.js";import"./decopilot-sse-pool-Cu7Nizzp.js";import"./studio-tools-qhNYzbg-.js";import"./use-virtual-mcp-BHCygv1Q.js";import"./use-collections-CUoYyXrz.js";import"./use-ai-providers-CIvGzfXg.js";import"./use-organization-settings-mMiPWte8.js";import"./avatar-BZq-o3M_.js";import"./required-auth-layout-Ce12SDHB.js";import"./useRouterState-CPOZ6kYF.js";import"./use-org-sso-qcLKm5I7.js";import"./agent-capabilities-UHQXEFqt.js";import"./pair-DU07s2Yy.js";import"./use-clock-tick-DufrTL6j.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B_iKACkn.js";import"./file-type-icon-CBlaUM9a.js";import"./content-blocks-o63cs2vh.js";import"./types-DsYUq_UX.js";import"./integration-icon-C2c_G7v_.js";import"./use-navigate-to-agent-BpOmxFKV.js";import"./use-connection-DIX015NP.js";import"./use-mcp-prompts-B8H3Sb8-.js";import"./form-DcfAV72q.js";import"./label-Cv-qQXYd.js";import"./spinner-CIUpakvk.js";import"./drawer-PqoucHj8.js";import"./collection-search-D2zd2w_6.js";import"./tabs-BEFEoOMo.js";import"./toggle-group-DzrJraBm.js";import"./sortable.esm-DhgyheK_.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-C6z8X3mv.js";import"./use-registry-connections-BIDj-EVl.js";import"./useInfiniteQuery-Du3dTl6W.js";import"./use-infinite-scroll-BmPWzVgW.js";import"./extract-connection-data-zlBEIx4x.js";import"./generate-id-N17blLwS.js";import"./collections-BEkDC2fV.js";import"./card-_9LUJQRQ.js";import"./collection-tabs-Et7HpQI-.js";import"./badge-DBQKr8ze.js";import"./textarea-CZOXZ6_T.js";import"./connection-form-helpers-CJ-3PHD0.js";import"./useSuspenseInfiniteQuery-BHnbmrEl.js";import"./connect-desktop-dialog-C7P5AZy7.js";import"./agent-icons-CMqOumOa.js";import"./checkbox-BoVEsaTu.js";import"./skeleton-Dvzf2GQP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-BxOSnd7f.js";import"./popover-DpnBmU5u.js";import"./command-DjRT1inC.js";import"./index-B6U1MHPz.js";import"./index-NuAPKwye.js";import"./dropdown-menu-CCeLALQe.js";import"./question-004-sINsf4GQ.js";import"./sidebar-DILd2AwV.js";import"./sheet-BZaR5cN8.js";import"./use-status-sounds-FktjeAga.js";import"./empty-state-cuRG9xrS.js";import"./toolbar-A-Rw_MZF.js";import"./resizable-CDtszfkc.js";import"./use-mcp-tools-Bb7rwoEF.js";import"./use-capability-DDDjfOOE.js";import"./user-BHiBl7KY.js";import"./tools-list-CmTd7_Mb.js";import"./switch-B2R8Oovd.js";import"./use-debounced-autosave-CsGRGmM0.js";import"./index-DM719JZt.js";import"./search-input-B5QgW7DO.js";import"./use-secrets-CMyn_SAh.js";import"./github-repo-picker-CIreZixy.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-B4RSATFh.js";import"./view-mode-toggle-C4AuqTiF.js";import"./select-model-qL2AwJh1.js";import"./use-automations-CP8543px.js";import"./monaco-editor-BenQSBIk.js";import"./automation-runs-BYZ99hni.js";import"./table-BHblf7Co.js";import"./use-members-D33brPm2.js";import"./use-org-auth-client-B3bhhuY4.js";import"./task-status-17hQtONR.js";import"./automation-list-row-C-im7Cyh.js";import"./use-create-virtual-mcp-BiFjwqV_.js";import"./index-CoxAwU4M.js";import"./hover-card-Bizl54yc.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>R(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function qi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){O(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,H]=l.useState(null),[J,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),H(null),me(n)}async function He(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),H(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Jt(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=J?qe(J.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
- `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=R?.path===n.path,Y=Ht(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&H(null)}}),i.jsx(vt,{open:J!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!J,onClick:t=>{t.preventDefault(),J&&Xe(J)},children:"Delete"})]})]})})]})}export{qi as FileExplorer};
@@ -1 +0,0 @@
1
- import{f as M,q as B,G as U,H as Q,I as H,a as $,t as P,o as D,K as I,j as n,D as L,T as Y,W as k,e as E,r as T,B as Z,L as q,a4 as W}from"./index-DxLTuX83.js";import{P as N}from"./index-DM719JZt.js";import{u as J}from"./use-org-auth-client-B3bhhuY4.js";import{u as X}from"./use-debounced-autosave-CsGRGmM0.js";import{A as ee}from"./avatar-BZq-o3M_.js";import{I as V}from"./input-3FcnQKag.js";import{S as G,a as K,b as A,c as te}from"./settings-section-BxOSnd7f.js";import{D as ne}from"./domain-settings-BUYR_el1.js";import{u as ae}from"./studio-tools-qhNYzbg-.js";import{c as se,b as oe,d as ie,f as re,e as le,g as ce,a as ue,A as de}from"./alert-dialog-nDI1xJhR.js";import{R as me}from"./require-capability-BolUdzxs.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./tooltip-D1D9JHhD.js";import"./sheet-BZaR5cN8.js";import"./X-D1kqmcok.js";import"./User01-CUMpCZVS.js";import"./card-_9LUJQRQ.js";import"./ArrowUpRight-Ce95HJs8.js";import"./switch-B2R8Oovd.js";import"./use-capability-DDDjfOOE.js";import"./access-gate-DfmEpXgP.js";import"./capability-load-error-BqquNR5_.js";const ge=Y({name:k().min(1,"Name is required").max(255,"Name is too long"),slug:k().min(1,"Slug is required").max(50,"Slug is too long").regex(/^[a-z0-9-]+$/,"Slug must contain only lowercase letters, numbers, and hyphens"),logo:k().optional()});function fe(e){const t=E.c(13),{value:v,onChange:h,name:o,disabled:d}=e,m=T.useRef(null);let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>m.current?.click(),t[0]=l):l=t[0];const r=l;let c;t[1]!==h?(c=x=>{const j=x.target.files?.[0];if(!j)return;if(j.size>2097152){D.error("Image must be smaller than 2MB");return}const u=new FileReader;u.onerror=pe,u.onloadend=()=>{u.result&&h(u.result),m.current&&(m.current.value="")},u.readAsDataURL(j)},t[1]=h,t[2]=c):c=t[2];const a=c;let s;t[3]!==d||t[4]!==a?(s=n.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:a,className:"hidden",disabled:d}),t[3]=d,t[4]=a,t[5]=s):s=t[5];const i=v||void 0,p=o??"?";let g;t[6]!==i||t[7]!==p?(g=n.jsx(ee,{url:i,fallback:p,shape:"square",size:"base"}),t[6]=i,t[7]=p,t[8]=g):g=t[8];let f;return t[9]!==d||t[10]!==s||t[11]!==g?(f=n.jsxs("button",{type:"button",onClick:r,disabled:d,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":"Upload organization logo",children:[s,g]}),t[9]=d,t[10]=s,t[11]=g,t[12]=f):f=t[12],f}function pe(){return D.error("Failed to read image")}function he(){const e=M(),{org:t}=B(),v=J(),h=U(),o=Q({resolver:H(ge),values:{name:t.name??"",slug:t.slug??"",logo:t.logo??""}}),d=$({mutationFn:async a=>{const s={name:a.name,slug:a.slug};a.logo&&(s.logo=a.logo);const i=await v.organization.update({data:s});if(i?.error)throw new Error(i.error.message||"Failed to update organization");return i},onSuccess:(a,s)=>{P("organization_settings_updated",{organization_id:t.id,fields:Object.keys(s)}),h.invalidateQueries({queryKey:I.organizations()}),h.invalidateQueries({queryKey:I.activeOrganization(t.slug)}),D.success("Organization updated successfully"),a?.data?.slug&&a.data.slug!==t.slug&&e({to:"/$org/settings/general",params:{org:a.data.slug}})},onError:(a,s)=>{P("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(s),error:a instanceof Error?a.message:String(a)}),D.error(a instanceof Error?a.message:"Failed to update organization")}}),{schedule:m,flush:l}=X({save:async()=>{const a=o.control._formState.dirtyFields;if(Object.keys(a).length===0||!await o.trigger())return;const i=o.getValues(),p=o.control._defaultValues;o.reset(i,{keepValues:!0});try{await d.mutateAsync(i)}catch{o.reset(p,{keepValues:!0})}}}),r=o.formState.errors,c=typeof window<"u"?`${window.location.host}/`:"";return n.jsx(G,{children:n.jsxs(K,{children:[n.jsx(A,{title:"Logo",description:"Recommended size is 256x256px",action:n.jsx(fe,{value:o.watch("logo"),onChange:a=>{o.setValue("logo",a??"",{shouldDirty:!0}),l()},name:o.watch("name")})}),n.jsx(A,{title:"Name",action:n.jsx(L,{control:o.control,name:"name",render:({field:a})=>n.jsx(V,{id:"org-name",...a,onChange:s=>{a.onChange(s),m()},onBlur:()=>{a.onBlur(),l()},placeholder:"Organization name",className:"w-[280px]"})})}),n.jsx(A,{title:"URL",action:n.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-input/30 focus-within:ring-2 focus-within:ring-ring/50 overflow-hidden",children:[c&&n.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:c}),n.jsx(L,{control:o.control,name:"slug",render:({field:a})=>n.jsx("input",{id:"org-slug",value:a.value??"",name:a.name,ref:a.ref,placeholder:"my-organization",className:"flex-1 min-w-0 bg-transparent px-2 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/60 outline-none",onChange:s=>{const i=s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"");o.setValue("slug",i,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),m()},onBlur:()=>{a.onBlur(),l()}})})]})}),(r.name||r.slug||r.logo)&&n.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[r.name&&n.jsx("p",{className:"text-xs text-destructive",children:r.name.message}),r.slug&&n.jsx("p",{className:"text-xs text-destructive",children:r.slug.message}),r.logo&&n.jsx("p",{className:"text-xs text-destructive",children:r.logo.message})]})]})})}function xe(){const e=E.c(42),{org:t}=B(),[v,h]=T.useState(!1),[o,d]=T.useState(""),m=ae();let l;e[0]!==t.id||e[1]!==m?(l=async()=>{await m.call("ORGANIZATION_DELETE",{id:t.id})},e[0]=t.id,e[1]=m,e[2]=l):l=e[2];let r;e[3]!==t.id||e[4]!==t.slug?(r=()=>{P("organization_deleted",{organization_id:t.id}),localStorage.getItem(q.lastOrgSlug())===t.slug&&localStorage.removeItem(q.lastOrgSlug()),W(),D.success("Organization deleted"),window.location.href="/"},e[3]=t.id,e[4]=t.slug,e[5]=r):r=e[5];let c;e[6]!==l||e[7]!==r?(c={mutationFn:l,onSuccess:r,onError:je},e[6]=l,e[7]=r,e[8]=c):c=e[8];const a=$(c);let s;e[9]===Symbol.for("react.memo_cache_sentinel")?(s=()=>h(!0),e[9]=s):s=e[9];let i;e[10]!==a.isPending?(i=n.jsx(G,{title:"Danger Zone",description:"Irreversible actions that affect your entire organization.",children:n.jsx(K,{className:"border-destructive/40",children:n.jsx(A,{title:"Delete organization",description:"Permanently delete this organization and all of its data. This action cannot be undone.",action:n.jsx(Z,{variant:"destructive",size:"sm",onClick:s,disabled:a.isPending,children:"Delete"})})})}),e[10]=a.isPending,e[11]=i):i=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=O=>{h(O),O||d("")},e[12]=p):p=e[12];let g;e[13]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(se,{children:"Delete Organization?"}),e[13]=g):g=e[13];let f;e[14]!==t.name?(f=n.jsxs("p",{children:["This will permanently delete all data associated with"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name}),". This action cannot be undone."]}),e[14]=t.name,e[15]=f):f=e[15];let x;e[16]!==t.name?(x=n.jsxs("p",{className:"mt-3 mb-1.5",children:["Type"," ",n.jsx("span",{className:"font-medium text-foreground",children:t.name})," ","to confirm:"]}),e[16]=t.name,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=O=>d(O.target.value),e[18]=j):j=e[18];let u;e[19]!==o||e[20]!==t.name?(u=n.jsx(V,{value:o,onChange:j,placeholder:t.name,autoFocus:!0}),e[19]=o,e[20]=t.name,e[21]=u):u=e[21];let y;e[22]!==u||e[23]!==f||e[24]!==x?(y=n.jsxs(oe,{children:[g,n.jsx(ie,{asChild:!0,children:n.jsxs("div",{children:[f,x,u]})})]}),e[22]=u,e[23]=f,e[24]=x,e[25]=y):y=e[25];let w;e[26]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(re,{children:"Cancel"}),e[26]=w):w=e[26];let b;e[27]!==a?(b=()=>a.mutate(),e[27]=a,e[28]=b):b=e[28];const F=o!==t.name||a.isPending,R=a.isPending?"Deleting…":"Delete organization";let S;e[29]!==b||e[30]!==F||e[31]!==R?(S=n.jsxs(le,{children:[w,n.jsx(ce,{onClick:b,disabled:F,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:R})]}),e[29]=b,e[30]=F,e[31]=R,e[32]=S):S=e[32];let z;e[33]!==y||e[34]!==S?(z=n.jsxs(ue,{children:[y,S]}),e[33]=y,e[34]=S,e[35]=z):z=e[35];let C;e[36]!==v||e[37]!==z?(C=n.jsx(de,{open:v,onOpenChange:p,children:z}),e[36]=v,e[37]=z,e[38]=C):C=e[38];let _;return e[39]!==C||e[40]!==i?(_=n.jsxs(n.Fragment,{children:[i,C]}),e[39]=C,e[40]=i,e[41]=_):_=e[41],_}function je(e){D.error(e instanceof Error?e.message:"Failed to delete organization")}function ve(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(N.Content,{children:n.jsx(N.Body,{children:n.jsxs(te,{children:[n.jsx(N.Title,{children:"Organization"}),n.jsx(he,{}),n.jsx(ne,{}),n.jsx(xe,{})]})})})}),e[0]=t):t=e[0],t}function Ge(){const e=E.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(me,{capability:"org:manage",area:"general settings",children:n.jsx(ve,{})}),e[0]=t):t=e[0],t}export{Ge as default};
@@ -1 +0,0 @@
1
- import{B as a}from"./collections-BEkDC2fV.js";import{cr as o}from"./index-DxLTuX83.js";const m=o(a,{target:"draft-7"});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",l=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=n[r[t]&63];return e};function s(t){return`${t}_${l()}`}export{m as B,s as g};