decocms 4.57.2 → 4.58.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 (240) hide show
  1. package/dist/client/assets/{AlertCircle-DQCGvut8.js → AlertCircle-BsK2j8lX.js} +1 -1
  2. package/dist/client/assets/AreaChart-BLzsywx_.js +15 -0
  3. package/dist/client/assets/{ArrowUp-D7T7n9iH.js → ArrowUp-CiXcGn12.js} +1 -1
  4. package/dist/client/assets/{ArrowUpRight-BEFV2vkA.js → ArrowUpRight-C4WIYJS6.js} +1 -1
  5. package/dist/client/assets/{Check-BEeJ8fxa.js → Check-CIsZpsif.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-CsSfP7Xf.js → CheckCircle-V3Hv2XSA.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-BVsraXi6.js → ChevronDown-Cf7u9l43.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-D4jesAkw.js → ChevronRight-BNYV3zMY.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-G9frUDJZ.js → ChevronUp-CCh08wW9.js} +1 -1
  10. package/dist/client/assets/{Circle-D3nky9aw.js → Circle-DPPhpz1H.js} +1 -1
  11. package/dist/client/assets/{Copy01-DyXaUHnt.js → Copy01-DZTNMmB_.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CkzUgpIb.js → DotsVertical-xF2OLIK0.js} +1 -1
  13. package/dist/client/assets/{Eye-Z74BlA3H.js → Eye-zIW_btrx.js} +1 -1
  14. package/dist/client/assets/{FilterLines-Bu3ZCrw6.js → FilterLines-DEPqd77p.js} +1 -1
  15. package/dist/client/assets/{Globe01-B0Trj5Ay.js → Globe01-B6ViMY-a.js} +1 -1
  16. package/dist/client/assets/{Globe04-oRfi9_O4.js → Globe04-Ds-oxCM4.js} +1 -1
  17. package/dist/client/assets/{HardDrive-Dx7eQadd.js → HardDrive-bbtqUR30.js} +1 -1
  18. package/dist/client/assets/{Key01-DlSVTdTy.js → Key01-DQPMjuS7.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-CPcvIk6j.js → LayoutLeft-Dh8b6qBD.js} +1 -1
  20. package/dist/client/assets/{LinkExternal01-8ULSUK9E.js → LinkExternal01-9VsFaQCg.js} +1 -1
  21. package/dist/client/assets/{List-BrdeiVAK.js → List-DxDwUsHQ.js} +1 -1
  22. package/dist/client/assets/{Loading02-CBukUc03.js → Loading02-DlaqgSnW.js} +1 -1
  23. package/dist/client/assets/{Monitor01-YH69hLmg.js → Monitor01-DetfAZxn.js} +1 -1
  24. package/dist/client/assets/{Package-BC8j5O7T.js → Package-P2uQA8UR.js} +1 -1
  25. package/dist/client/assets/{Palette-COkzmwuD.js → Palette-B1W3bpHO.js} +1 -1
  26. package/dist/client/assets/{Play-fRGAaRLr.js → Play-C3EW_5aN.js} +1 -1
  27. package/dist/client/assets/{Plus-DZ8Y2lWX.js → Plus-DWsP481X.js} +1 -1
  28. package/dist/client/assets/{SearchLg-DCnLlGR7.js → SearchLg-DtlozG9O.js} +1 -1
  29. package/dist/client/assets/{SearchMd-BxmBL442.js → SearchMd-BzqJR21G.js} +1 -1
  30. package/dist/client/assets/{Settings02-Bo6T9XLP.js → Settings02-CfwJwixJ.js} +1 -1
  31. package/dist/client/assets/{Shield01-CJ4mz5gK.js → Shield01-D8BSHCuL.js} +1 -1
  32. package/dist/client/assets/{Star01-IZ68g_xa.js → Star01-BElbpB-4.js} +1 -1
  33. package/dist/client/assets/{Stars01-BBDTresZ.js → Stars01-CnLrPEGr.js} +1 -1
  34. package/dist/client/assets/{Stars02-6a4XNIIU.js → Stars02-DV2x_8X4.js} +1 -1
  35. package/dist/client/assets/{Sun-CE4zZZrK.js → Sun-LNIUqEwV.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-60hw4Alk.js → SwitchHorizontal01-LhVEaBhn.js} +1 -1
  37. package/dist/client/assets/{Tool01-B4Z7JhlQ.js → Tool01-D9X9-2gX.js} +1 -1
  38. package/dist/client/assets/{Tool02-BY98RBMi.js → Tool02-3aANdbCk.js} +1 -1
  39. package/dist/client/assets/{Trash01-B9pw3Dz-.js → Trash01-YlywuJOa.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-C8HikdRN.js → TrendUp01-Cn96zgOO.js} +1 -1
  41. package/dist/client/assets/{Upload01-DwHzJTDj.js → Upload01-Ds0fsDXO.js} +1 -1
  42. package/dist/client/assets/{User01-0_lYU3sr.js → User01-Cn7CiRhy.js} +1 -1
  43. package/dist/client/assets/{Users01-BA0tYZge.js → Users01-B36BnXKf.js} +1 -1
  44. package/dist/client/assets/{Users03-DGfmL8ng.js → Users03-CH4KGn7q.js} +1 -1
  45. package/dist/client/assets/{X-bCYPxEGT.js → X-CCOY7lES.js} +1 -1
  46. package/dist/client/assets/{XCircle-DP6KZoJI.js → XCircle-CBw8-s9c.js} +1 -1
  47. package/dist/client/assets/{XClose-Cy2zn03A.js → XClose-BZZDYipc.js} +1 -1
  48. package/dist/client/assets/{Zap-rVhVjFMk.js → Zap-CLmJ7X99.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-CojtzYzX.js → ZapSquare-4ta3HU4A.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-HiEViCQt.js → ZoomOut-CpVNvi6I.js} +1 -1
  51. package/dist/client/assets/{access-gate-CW4lpdxL.js → access-gate-Dm9HP6nd.js} +1 -1
  52. package/dist/client/assets/{add-section-modal-CKPdN6QS.js → add-section-modal-Dkif2MHI.js} +1 -1
  53. package/dist/client/assets/{agent-capabilities-Crp4S07c.js → agent-capabilities-tgV1dWvl.js} +1 -1
  54. package/dist/client/assets/{agent-icon-B3Khwrxs.js → agent-icon-B7V41V3w.js} +1 -1
  55. package/dist/client/assets/{agents-list-DwwU9Hnm.js → agents-list-BbB-Rj7G.js} +1 -1
  56. package/dist/client/assets/{ai-providers-eeNsHUnH.js → ai-providers-9NSoRJvL.js} +1 -1
  57. package/dist/client/assets/{alert-C5yvBlhG.js → alert-CFsGAZmo.js} +1 -1
  58. package/dist/client/assets/{alert-dialog-DDJF6hNh.js → alert-dialog-DlH1qn27.js} +1 -1
  59. package/dist/client/assets/app-editor-Fenxhw0K.js +1 -0
  60. package/dist/client/assets/{auth-iC_q9BIr.js → auth-DIw1R4FB.js} +1 -1
  61. package/dist/client/assets/{auth-catchall-B6qliEa1.js → auth-catchall-DT8ZYblC.js} +1 -1
  62. package/dist/client/assets/{auth-entry-mmqAi7ho.js → auth-entry-C6xBObDF.js} +1 -1
  63. package/dist/client/assets/{auth-split-layout-CLn74vff.js → auth-split-layout-DokQOGq8.js} +1 -1
  64. package/dist/client/assets/{authenticate-and-persist-oauth-BNnoe036.js → authenticate-and-persist-oauth-BWW5qgjr.js} +1 -1
  65. package/dist/client/assets/{automation-list-row-LFCTBiwF.js → automation-list-row-CrZMuVyz.js} +1 -1
  66. package/dist/client/assets/{automation-runs-Dx0I1hOP.js → automation-runs-COfUpgLG.js} +1 -1
  67. package/dist/client/assets/{automations-BjKfIDQh.js → automations-vCJ2mZTl.js} +1 -1
  68. package/dist/client/assets/{autosend-BRQL6Rcu.js → autosend-Dqth_Lvz.js} +1 -1
  69. package/dist/client/assets/{avatar-Y-6cgdhP.js → avatar-BLw8Q1_P.js} +1 -1
  70. package/dist/client/assets/{badge-CDBU7Jnw.js → badge-BLlsFYFH.js} +1 -1
  71. package/dist/client/assets/{block-document-C3ckqHj2.js → block-document-CxtI5tT-.js} +1 -1
  72. package/dist/client/assets/{brand-context-DAj-SFs1.js → brand-context-DF9Lu69M.js} +1 -1
  73. package/dist/client/assets/{breadcrumb-BcIGB1Or.js → breadcrumb-D4-_sl4P.js} +1 -1
  74. package/dist/client/assets/{buckets-BKE9WN4t.js → buckets-B4zVpzu4.js} +1 -1
  75. package/dist/client/assets/{bulk-category-panel-B-LV8g2E.js → bulk-category-panel-BlQt2ZBG.js} +1 -1
  76. package/dist/client/assets/{calendar-D1uldZAa.js → calendar-BfXhAJwH.js} +1 -1
  77. package/dist/client/assets/{capability-load-error-DJ84c_wk.js → capability-load-error-CqbGYiTK.js} +1 -1
  78. package/dist/client/assets/{card-PDwkjkZo.js → card-Dr39ocdW.js} +1 -1
  79. package/dist/client/assets/category-editor-qjicpFa3.js +1 -0
  80. package/dist/client/assets/{chat-context-DHTaLNyE.js → chat-context-Cj90aqG3.js} +1 -1
  81. package/dist/client/assets/{checkbox-Gk-F98s7.js → checkbox-BLTtdUJX.js} +1 -1
  82. package/dist/client/assets/{cli-auth-success-Bf_4v7L8.js → cli-auth-success-Bogsg1gc.js} +1 -1
  83. package/dist/client/assets/collection-detail-DCRlIVFr.js +1 -0
  84. package/dist/client/assets/{collection-display-button-BHXd0hJ0.js → collection-display-button-BAWZrgtL.js} +1 -1
  85. package/dist/client/assets/{collection-search-C94-PhCw.js → collection-search-DxjEuL_D.js} +1 -1
  86. package/dist/client/assets/{collection-table-wrapper-Bu0j3VFq.js → collection-table-wrapper-DOw4jIB9.js} +1 -1
  87. package/dist/client/assets/{collection-tabs-BM-YDljB.js → collection-tabs-DwKDQp6H.js} +1 -1
  88. package/dist/client/assets/{command-D4Q48wPz.js → command-Dr_Fu2IW.js} +1 -1
  89. package/dist/client/assets/{commerce-onboarding-nAX-PPzc.js → commerce-onboarding-DasOD5zN.js} +1 -1
  90. package/dist/client/assets/{connect-desktop-dialog-C-AzZ9uU.js → connect-desktop-dialog-CHkD7GAc.js} +1 -1
  91. package/dist/client/assets/{connection-card-CmtTMlc6.js → connection-card-DbKoXvAA.js} +1 -1
  92. package/dist/client/assets/connection-detail-DcxhLZlM.js +1 -0
  93. package/dist/client/assets/{connection-form-helpers-ChroeVON.js → connection-form-helpers-ZtAjEE6E.js} +1 -1
  94. package/dist/client/assets/{connections-1FquVkUb.js → connections-D-tLBJFZ.js} +1 -1
  95. package/dist/client/assets/{decopilot-sse-pool-Cb8qqxEJ.js → decopilot-sse-pool-CDyfzRYy.js} +1 -1
  96. package/dist/client/assets/{dialog-mPkr-RRK.js → dialog-fh7l4sng.js} +1 -1
  97. package/dist/client/assets/{domain-settings-Bxn6YUIN.js → domain-settings-DoB42dVy.js} +1 -1
  98. package/dist/client/assets/{drawer-B8TNUPgG.js → drawer-C6ZV4KXJ.js} +1 -1
  99. package/dist/client/assets/{dropdown-menu-B0v0032v.js → dropdown-menu-Y2JpHwLO.js} +1 -1
  100. package/dist/client/assets/{empty-state-DpnHm9Ff.js → empty-state-DalbBhZq.js} +1 -1
  101. package/dist/client/assets/{extract-connection-data-CrDh9fRV.js → extract-connection-data-CSGt_bh7.js} +1 -1
  102. package/dist/client/assets/file-explorer-BXo29_Z4.js +2 -0
  103. package/dist/client/assets/{file-type-icon-C6k5FmYJ.js → file-type-icon-Dt3FbbjO.js} +1 -1
  104. package/dist/client/assets/{files-DpxNGuGX.js → files-D8622kE_.js} +1 -1
  105. package/dist/client/assets/{form-h_6je5dw.js → form-MOAQpg4z.js} +1 -1
  106. package/dist/client/assets/{general-CzAYaKfe.js → general-DwEzGRBj.js} +1 -1
  107. package/dist/client/assets/{github-repo-picker-tThpI_5I.js → github-repo-picker-Bnkr38By.js} +1 -1
  108. package/dist/client/assets/{hooks-Cb3Qy_Dc.js → hooks-BOmfFPA1.js} +1 -1
  109. package/dist/client/assets/{index-BjHyzbtR.js → index-1m4TnoDs.js} +1 -1
  110. package/dist/client/assets/{index-BtB12M4y.js → index-BDgkjVbt.js} +1 -1
  111. package/dist/client/assets/{index-BeENLzbG.js → index-BIMrgiGT.js} +1 -1
  112. package/dist/client/assets/{index-icYCRExU.js → index-BScXsDNd.js} +1 -1
  113. package/dist/client/assets/index-B_EB6W38.css +1 -0
  114. package/dist/client/assets/{index-D_Pdja_K.js → index-Bdud9TAa.js} +1 -1
  115. package/dist/client/assets/{index-Bl_XoHF-.js → index-BjIv3NiG.js} +1 -1
  116. package/dist/client/assets/{index-D75hG9Mx.js → index-BwtIoAWX.js} +1 -1
  117. package/dist/client/assets/{types-CqK4Iemy.js → index-CdiNO3pS.js} +19 -19
  118. package/dist/client/assets/{index-DD5ljKuD.js → index-Cs0l2cdC.js} +28 -28
  119. package/dist/client/assets/{index-Dgo5nlaH.js → index-DQS4uqTL.js} +2 -2
  120. package/dist/client/assets/{index-C0SPe6C9.js → index-Hf6MZntC.js} +1 -1
  121. package/dist/client/assets/{index-D7lYswsa.js → index-NLWgbFF6.js} +1 -1
  122. package/dist/client/assets/{index-DSn_1D7b.js → index-fTBvXwtq.js} +4 -4
  123. package/dist/client/assets/{index-el6kTH3I.js → index-pasDzH67.js} +1 -1
  124. package/dist/client/assets/{index-redirect-6phzSyPm.js → index-redirect-DVXKyr8c.js} +1 -1
  125. package/dist/client/assets/{input-nFXBUvLG.js → input-BCFnb5pa.js} +1 -1
  126. package/dist/client/assets/{integration-icon-CsT4Vm35.js → integration-icon-D2ih8lLH.js} +1 -1
  127. package/dist/client/assets/{invite-member-dialog-HImcbPYG.js → invite-member-dialog-HKCs9csw.js} +1 -1
  128. package/dist/client/assets/{label-BBor9OYw.js → label-DlcV7-lQ.js} +1 -1
  129. package/dist/client/assets/{layout-HBls_j3M.js → layout-DQ-E3CMX.js} +1 -1
  130. package/dist/client/assets/{login-C1z8WfZx.js → login-CAzmisNW.js} +1 -1
  131. package/dist/client/assets/{mcp-oauth-Cx2xXJpN.js → mcp-oauth-WwLjUcQG.js} +1 -1
  132. package/dist/client/assets/{members-DqxuSRlg.js → members-Db9Pp1S_.js} +1 -1
  133. package/dist/client/assets/{monaco-editor-Xh2wk8Tp.js → monaco-editor-CU5IsWCk.js} +1 -1
  134. package/dist/client/assets/monitoring-stats-row-je4jOOK4.js +28 -0
  135. package/dist/client/assets/{oauth-callback-D6VCxkRw.js → oauth-callback-EFcI6S_n.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-ai-provider-DYyPEDo4.js → oauth-callback-ai-provider-CRMHZb_k.js} +1 -1
  137. package/dist/client/assets/{onboarding-DVl-fCKX.js → onboarding-MhSEXmGS.js} +1 -1
  138. package/dist/client/assets/{org-install-BzILOYuY.js → org-install-BL1nnV4S.js} +1 -1
  139. package/dist/client/assets/{org-layout-laXMj9ba.js → org-layout-leGZ1nms.js} +1 -1
  140. package/dist/client/assets/{organization-choice-C1pQcp6T.js → organization-choice-CGh-oHoO.js} +1 -1
  141. package/dist/client/assets/{orgs-Bc8QR1cA.js → orgs-Bcnn1l3-.js} +1 -1
  142. package/dist/client/assets/{page-seo-form-C6Pv2Hrd.js → page-seo-form-BleD6npj.js} +1 -1
  143. package/dist/client/assets/page-seo-sheet-EWq7D9q1.js +1 -0
  144. package/dist/client/assets/{popover-CgzT12BA.js → popover-CNxsj5z1.js} +1 -1
  145. package/dist/client/assets/post-editor-7yiM1RvF.js +1 -0
  146. package/dist/client/assets/{primitives-CVV5R_ix.js → primitives-DLmkvEJN.js} +1 -1
  147. package/dist/client/assets/{profile-B7SVI-oN.js → profile-e7Ghaczc.js} +1 -1
  148. package/dist/client/assets/project-app-view-DRxqcpXA.js +1 -0
  149. package/dist/client/assets/record-editor-DphlBghM.js +1 -0
  150. package/dist/client/assets/registry-CQWcDlJ4.js +2 -0
  151. package/dist/client/assets/{registry-layout-BSextZQo.js → registry-layout-D72cFP53.js} +1 -1
  152. package/dist/client/assets/{reports-BPMxCBex.js → reports-B6abVv3u.js} +1 -1
  153. package/dist/client/assets/{require-capability-DvnraaMn.js → require-capability-BkA_0M4L.js} +1 -1
  154. package/dist/client/assets/{required-auth-layout-D9qojMWR.js → required-auth-layout-BQbJTgYE.js} +1 -1
  155. package/dist/client/assets/{reset-password-ClkV8uQd.js → reset-password-DIckw0Ms.js} +1 -1
  156. package/dist/client/assets/{roles-BeLiefT1.js → roles-DyKLhx_B.js} +1 -1
  157. package/dist/client/assets/{search-input-Dn0hSWZ5.js → search-input--Rgpfj-4.js} +1 -1
  158. package/dist/client/assets/{secrets-e4SIb0hm.js → secrets-DxkIt321.js} +1 -1
  159. package/dist/client/assets/{sections-editor-BxFAXK53.js → sections-editor-DjeaapZJ.js} +1 -1
  160. package/dist/client/assets/{select-CviXI9ki.js → select-VaDgX2xH.js} +1 -1
  161. package/dist/client/assets/{select-model-BVeB6qMz.js → select-model-eQuhl8Ce.js} +1 -1
  162. package/dist/client/assets/seo-editor-BNXe112p.js +1 -0
  163. package/dist/client/assets/{settings-layout-iJMVXYnp.js → settings-layout-DJl6ndvG.js} +1 -1
  164. package/dist/client/assets/{settings-section-VSZi6AlU.js → settings-section-Dhs7I_E9.js} +1 -1
  165. package/dist/client/assets/{shell-controls-D0LeXgkd.js → shell-controls-rVApaBEX.js} +1 -1
  166. package/dist/client/assets/{shell-layout-CVOU9xRB.js → shell-layout-LRsQP-h_.js} +1 -1
  167. package/dist/client/assets/{sidebar-CmQSAjPL.js → sidebar-CYWiRPI2.js} +1 -1
  168. package/dist/client/assets/{skeleton-CcEQud32.js → skeleton-BjvmRaJs.js} +1 -1
  169. package/dist/client/assets/{sso-C5qh7UXa.js → sso-BRcEauRm.js} +1 -1
  170. package/dist/client/assets/{store-f-uGRwHZ.js → store-LV2LmI7b.js} +1 -1
  171. package/dist/client/assets/store-registry-BPEcVVl-.js +2 -0
  172. package/dist/client/assets/{studio-tools-E9yDf3_0.js → studio-tools-Bgge8r2I.js} +1 -1
  173. package/dist/client/assets/{switch-QOV1_3MP.js → switch-B5hqdxQf.js} +1 -1
  174. package/dist/client/assets/{table-B6d_9e6u.js → table-BGC66mX8.js} +1 -1
  175. package/dist/client/assets/{tabs-BEnBthXe.js → tabs-7iMqy-cX.js} +1 -1
  176. package/dist/client/assets/{textarea-Dl16KMAC.js → textarea-DUeM1qLR.js} +1 -1
  177. package/dist/client/assets/{toggle-group-lOSgrtpS.js → toggle-group-DGTTTK16.js} +1 -1
  178. package/dist/client/assets/{toolbar-CC2Wp6FF.js → toolbar-f57IeKJA.js} +1 -1
  179. package/dist/client/assets/{toolbar-icon-button-Dxmr2sEF.js → toolbar-icon-button-BxWJLLOv.js} +1 -1
  180. package/dist/client/assets/{tools-list-C9rz13Xx.js → tools-list-lsZ0EoUN.js} +1 -1
  181. package/dist/client/assets/{tooltip-M_e_krSv.js → tooltip-BeUHG-np.js} +1 -1
  182. package/dist/client/assets/{use-ai-providers-CSQgALBc.js → use-ai-providers-BixOjL9U.js} +1 -1
  183. package/dist/client/assets/{use-automations-B73FT1wm.js → use-automations-BmZJRHpv.js} +1 -1
  184. package/dist/client/assets/{use-capability-aTF0AI3e.js → use-capability-DqpCecgW.js} +1 -1
  185. package/dist/client/assets/{use-clock-tick-CCTl5Yxu.js → use-clock-tick-BxBaYbkF.js} +1 -1
  186. package/dist/client/assets/{use-collections-Ce-cuEBy.js → use-collections-CAn6PdRl.js} +1 -1
  187. package/dist/client/assets/{use-connection-hkUuQBrT.js → use-connection-CRWYWlA3.js} +1 -1
  188. package/dist/client/assets/{use-copy-Dijkn7yI.js → use-copy-C72jUXvA.js} +1 -1
  189. package/dist/client/assets/{use-create-virtual-mcp-GoXz08-t.js → use-create-virtual-mcp-BCfEdG_e.js} +1 -1
  190. package/dist/client/assets/{use-debounced-autosave-jg3g3c9r.js → use-debounced-autosave-CV4I7zcE.js} +1 -1
  191. package/dist/client/assets/{use-debounced-value-DaMxSpzh.js → use-debounced-value-BhdX0Eeh.js} +1 -1
  192. package/dist/client/assets/{use-decopilot-events-Cxs4WDOZ.js → use-decopilot-events-CZZxmCko.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-BlA3-BWP.js → use-delete-connection-D4cIX0rG.js} +1 -1
  194. package/dist/client/assets/{use-deployment-admin-D-vSLeTr.js → use-deployment-admin-C-056bEj.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-CQ4BSXsE.js → use-file-configs-BDx4iCDa.js} +1 -1
  196. package/dist/client/assets/{use-infinite-scroll-D7VcwF5k.js → use-infinite-scroll-CGAPBZVb.js} +1 -1
  197. package/dist/client/assets/{use-join-requests-BjfgTura.js → use-join-requests-B3QaYtT8.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-B9awT5X_.js → use-mcp-client-DtdzmFrp.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-BzGw36c7.js → use-mcp-tools-DJ2ELHXx.js} +1 -1
  200. package/dist/client/assets/{use-members-NrGwwdtD.js → use-members-BCw3JyoG.js} +1 -1
  201. package/dist/client/assets/{use-mobile-CkmVE_-7.js → use-mobile-9MTF5ix-.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-B5-47yrA.js → use-navigate-to-agent-CL_Sr9aS.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-BaKQjOSf.js → use-org-auth-client-QJOcG_S6.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-By_u0hEv.js → use-org-sso-D1Hh9X5_.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-izeSBzjT.js → use-organization-roles-RnVZIuuZ.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-C5RS8nea.js → use-organization-settings-4fF6reF2.js} +1 -1
  207. package/dist/client/assets/{use-registry-connections-BqTrjEc0.js → use-registry-connections-BKqXWBpN.js} +1 -1
  208. package/dist/client/assets/{use-secrets-BXostql4.js → use-secrets-C0ii327y.js} +1 -1
  209. package/dist/client/assets/{use-status-sounds-CqFkTrqw.js → use-status-sounds-BeMLu_4s.js} +1 -1
  210. package/dist/client/assets/{use-view-mode-CcTBUhei.js → use-view-mode-BM9KKZ6W.js} +1 -1
  211. package/dist/client/assets/{use-virtual-mcp-CymLeNR8.js → use-virtual-mcp-UbApJn5U.js} +1 -1
  212. package/dist/client/assets/useInfiniteQuery-E-ZlRxfS.js +1 -0
  213. package/dist/client/assets/{useRouterState-DMxFySuU.js → useRouterState-DnqIZgiT.js} +1 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-pC4lCsVT.js +1 -0
  215. package/dist/client/assets/{users-KcJjBogC.js → users-CqWKV4Rn.js} +1 -1
  216. package/dist/client/assets/variant-calendar-B6bYDAsn.js +1 -0
  217. package/dist/client/assets/{view-mode-toggle-GEAV0tV-.js → view-mode-toggle-COBf4bvm.js} +1 -1
  218. package/dist/client/index.html +2 -2
  219. package/dist/server/cli.js +1 -1
  220. package/dist/server/server.js +1 -1
  221. package/package.json +1 -1
  222. package/dist/client/assets/app-editor-DAsGG8dk.js +0 -1
  223. package/dist/client/assets/category-editor-CRZnesMJ.js +0 -1
  224. package/dist/client/assets/collection-detail-B_n2rihW.js +0 -1
  225. package/dist/client/assets/connection-detail-BxkxPzQa.js +0 -1
  226. package/dist/client/assets/file-explorer-BdaIcZQu.js +0 -2
  227. package/dist/client/assets/index-D8u7pwON.js +0 -1
  228. package/dist/client/assets/index-DSlfjNs9.css +0 -1
  229. package/dist/client/assets/monitoring-stats-row-DOoEOmXM.js +0 -42
  230. package/dist/client/assets/page-seo-sheet-Bug-S7y6.js +0 -1
  231. package/dist/client/assets/post-editor-BoWGvi2D.js +0 -1
  232. package/dist/client/assets/project-app-view-CKjkrpiR.js +0 -1
  233. package/dist/client/assets/record-editor-_6aJOrjd.js +0 -1
  234. package/dist/client/assets/registry-Ci8iRoo4.js +0 -2
  235. package/dist/client/assets/seo-editor-C2cy6kyj.js +0 -1
  236. package/dist/client/assets/store-registry-3gItvs85.js +0 -2
  237. package/dist/client/assets/use-mcp-prompts-EOAbT9yX.js +0 -1
  238. package/dist/client/assets/useInfiniteQuery-BqDEFx1l.js +0 -1
  239. package/dist/client/assets/useSuspenseInfiniteQuery-BnQw-mx8.js +0 -1
  240. package/dist/client/assets/variant-calendar-B64RcPST.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decocms",
3
- "version": "4.57.2",
3
+ "version": "4.58.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{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-DSn_1D7b.js";import{i as jt}from"./ChevronRight-D4jesAkw.js";import{A as kt}from"./automation-runs-Dx0I1hOP.js";import{A as _t}from"./add-section-modal-CKPdN6QS.js";import{n as Bt,h as wt,j as At,e as Nt,k as Rt,l as Ct,m as Et,o as Kt,S as Tt}from"./index-DD5ljKuD.js";import"./select-CviXI9ki.js";import"./tooltip-M_e_krSv.js";import"./Check-BEeJ8fxa.js";import"./ChevronDown-BVsraXi6.js";import"./ChevronUp-G9frUDJZ.js";import"./useInfiniteQuery-BqDEFx1l.js";import"./use-infinite-scroll-D7VcwF5k.js";import"./use-connection-hkUuQBrT.js";import"./use-collections-Ce-cuEBy.js";import"./use-mcp-client-B9awT5X_.js";import"./constants-CaIX_f5U.js";import"./auth-iC_q9BIr.js";import"./use-virtual-mcp-CymLeNR8.js";import"./card-PDwkjkZo.js";import"./sidebar-CmQSAjPL.js";import"./LayoutLeft-CPcvIk6j.js";import"./use-mobile-CkmVE_-7.js";import"./X-bCYPxEGT.js";import"./table-B6d_9e6u.js";import"./empty-state-DpnHm9Ff.js";import"./use-members-NrGwwdtD.js";import"./use-org-auth-client-BaKQjOSf.js";import"./use-clock-tick-CCTl5Yxu.js";import"./AlertCircle-DQCGvut8.js";import"./CheckCircle-CsSfP7Xf.js";import"./Circle-D3nky9aw.js";import"./agent-icon-B3Khwrxs.js";import"./Tool01-B4Z7JhlQ.js";import"./ArrowUp-D7T7n9iH.js";import"./Settings02-Bo6T9XLP.js";import"./Tool02-BY98RBMi.js";import"./XCircle-DP6KZoJI.js";import"./ArrowUpRight-BEFV2vkA.js";import"./TrendUp01-C8HikdRN.js";import"./ZapSquare-CojtzYzX.js";import"./Users03-DGfmL8ng.js";import"./Loading02-CBukUc03.js";import"./Stars02-6a4XNIIU.js";import"./Copy01-DyXaUHnt.js";import"./ZoomOut-HiEViCQt.js";import"./DotsVertical-CkzUgpIb.js";import"./Globe01-B0Trj5Ay.js";import"./Eye-Z74BlA3H.js";import"./FilterLines-Bu3ZCrw6.js";import"./Star01-IZ68g_xa.js";import"./Globe04-oRfi9_O4.js";import"./SwitchHorizontal01-60hw4Alk.js";import"./HardDrive-Dx7eQadd.js";import"./Key01-DlSVTdTy.js";import"./LinkExternal01-8ULSUK9E.js";import"./List-BrdeiVAK.js";import"./Monitor01-YH69hLmg.js";import"./Sun-CE4zZZrK.js";import"./Package-BC8j5O7T.js";import"./Palette-COkzmwuD.js";import"./Play-fRGAaRLr.js";import"./Plus-DZ8Y2lWX.js";import"./SearchLg-DCnLlGR7.js";import"./SearchMd-BxmBL442.js";import"./Shield01-CJ4mz5gK.js";import"./Stars01-BBDTresZ.js";import"./Trash01-B9pw3Dz-.js";import"./Upload01-DwHzJTDj.js";import"./User01-0_lYU3sr.js";import"./Users01-BA0tYZge.js";import"./XClose-Cy2zn03A.js";import"./Zap-rVhVjFMk.js";import"./use-automations-B73FT1wm.js";import"./studio-tools-E9yDf3_0.js";import"./useSuspenseInfiniteQuery-BnQw-mx8.js";import"./badge-CDBU7Jnw.js";import"./checkbox-Gk-F98s7.js";import"./command-D4Q48wPz.js";import"./index-icYCRExU.js";import"./dialog-mPkr-RRK.js";import"./popover-CgzT12BA.js";import"./avatar-Y-6cgdhP.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dijkn7yI.js";import"./file-type-icon-C6k5FmYJ.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-Xh2wk8Tp.js";import"./index-D7lYswsa.js";import"./chat-context-DHTaLNyE.js";import"./autosend-BRQL6Rcu.js";import"./hooks-Cb3Qy_Dc.js";import"./decopilot-sse-pool-Cb8qqxEJ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-CSQgALBc.js";import"./use-decopilot-events-Cxs4WDOZ.js";import"./use-organization-settings-C5RS8nea.js";import"./types-CqK4Iemy.js";import"./shell-layout-CVOU9xRB.js";import"./alert-dialog-DDJF6hNh.js";import"./required-auth-layout-D9qojMWR.js";import"./use-org-sso-By_u0hEv.js";import"./integration-icon-CsT4Vm35.js";import"./use-navigate-to-agent-B5-47yrA.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-EOAbT9yX.js";import"./form-h_6je5dw.js";import"./label-BBor9OYw.js";import"./input-nFXBUvLG.js";import"./drawer-B8TNUPgG.js";import"./collection-search-C94-PhCw.js";import"./tabs-BEnBthXe.js";import"./toggle-group-lOSgrtpS.js";import"./agent-capabilities-Crp4S07c.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CmtTMlc6.js";import"./use-registry-connections-BqTrjEc0.js";import"./extract-connection-data-CrDh9fRV.js";import"./collection-tabs-BM-YDljB.js";import"./textarea-Dl16KMAC.js";import"./connection-form-helpers-ChroeVON.js";import"./authenticate-and-persist-oauth-BNnoe036.js";import"./mcp-oauth-Cx2xXJpN.js";import"./connect-desktop-dialog-C-AzZ9uU.js";import"./select-model-BVeB6qMz.js";import"./skeleton-CcEQud32.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-VSZi6AlU.js";import"./dropdown-menu-B0v0032v.js";import"./index-C0SPe6C9.js";import"./toolbar-CC2Wp6FF.js";import"./use-debounced-value-DaMxSpzh.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CqFkTrqw.js";import"./use-mcp-tools-BzGw36c7.js";import"./use-capability-aTF0AI3e.js";import"./tools-list-C9rz13Xx.js";import"./switch-QOV1_3MP.js";import"./use-debounced-autosave-jg3g3c9r.js";import"./index-el6kTH3I.js";import"./search-input-Dn0hSWZ5.js";import"./github-repo-picker-tThpI_5I.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-BXostql4.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-BtB12M4y.js";import"./get-initials-D-f_fDFw.js";import"./calendar-D1uldZAa.js";import"./toolbar-icon-button-Dxmr2sEF.js";import"./use-file-configs-CQ4BSXsE.js";import"./automation-list-row-LFCTBiwF.js";function $t(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",n=Bt(t,f);return{blockKey:n,data:{__resolveType:l.resolveType,name:n}}}function Nr(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:n,blockKey:i,block:a,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:nt,previewBaseUrl:at}=l,G=nt===void 0?!1:nt,u=at===void 0?null:at,x=typeof a?.__resolveType=="string"?a.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const J=C;let E;t[6]!==a||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(a?At(i,a,m):i),t[6]=a,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==n||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:n},t[11]=n,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let T;t[15]!==n||t[16]!==s||t[17]!==f?(T={orgSlug:s,virtualMcpId:f,branch:n},t[15]=n,t[16]=s,t[17]=f,t[18]=T):T=t[18];const X=Rt(T);let $;t[19]!==b?($=Et((e,r)=>b(e,r)),t[19]=b,t[20]=$):$=t[20];const Y=$,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==a?(O=a??{},t[22]=a,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let z;t[26]!==it||t[27]!==g?(z={...it,...g},t[26]=it,t[27]=g,t[28]=z):z=t[28];const mt=z;let L;t[29]!==i||t[30]!==x||t[31]!==b?(L=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=L):L=t[32];const st=L;let V;t[33]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{ft(e)},t[33]=V):V=t[33];const pt=V;let q;t[34]!==c||t[35]!==Q||t[36]!==X?(q=async(e,r)=>{try{const{blockKey:d,data:N}=$t(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=q):q=t[37];const y=q;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(jt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let j;t[48]!==W?(j=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=j):j=t[49];let k;t[50]!==S||t[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),t[50]=S,t[51]=j,t[52]=k):k=t[52];let _;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(_=o.jsx(kt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Tt,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=_):_=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(_t,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==k||t[74]!==_||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),t[73]=k,t[74]=_,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Nr as AppEditor};
@@ -1 +0,0 @@
1
- import{c as G,r as S,l as Q,j as t,B as U,i as V,t as I}from"./index-DSn_1D7b.js";import{i as X}from"./XCircle-DP6KZoJI.js";import{aH as Y,ab as T}from"./agent-icon-B3Khwrxs.js";import{n as Z}from"./LinkExternal01-8ULSUK9E.js";import{f as K,a as _,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-DDJF6hNh.js";import{I as H}from"./input-nFXBUvLG.js";import{L}from"./label-BBor9OYw.js";import{v as at,w as mt,T as nt,o as lt,x as R,y as pt,U as ct}from"./index-DD5ljKuD.js";import{c as dt,B as ut,a as gt}from"./block-document-C3ckqHj2.js";import{u as xt,s as v,E as ft}from"./primitives-CVV5R_ix.js";import{t as ht}from"./ChevronDown-BVsraXi6.js";import{J as yt,K as jt,I as vt}from"./automation-runs-Dx0I1hOP.js";import"./AlertCircle-DQCGvut8.js";import"./Tool01-B4Z7JhlQ.js";import"./ArrowUp-D7T7n9iH.js";import"./Settings02-Bo6T9XLP.js";import"./Tool02-BY98RBMi.js";import"./ArrowUpRight-BEFV2vkA.js";import"./TrendUp01-C8HikdRN.js";import"./ZapSquare-CojtzYzX.js";import"./Users03-DGfmL8ng.js";import"./Loading02-CBukUc03.js";import"./CheckCircle-CsSfP7Xf.js";import"./Check-BEeJ8fxa.js";import"./ChevronRight-D4jesAkw.js";import"./ChevronUp-G9frUDJZ.js";import"./Circle-D3nky9aw.js";import"./Stars02-6a4XNIIU.js";import"./Copy01-DyXaUHnt.js";import"./ZoomOut-HiEViCQt.js";import"./DotsVertical-CkzUgpIb.js";import"./Globe01-B0Trj5Ay.js";import"./Eye-Z74BlA3H.js";import"./FilterLines-Bu3ZCrw6.js";import"./Star01-IZ68g_xa.js";import"./Globe04-oRfi9_O4.js";import"./SwitchHorizontal01-60hw4Alk.js";import"./HardDrive-Dx7eQadd.js";import"./Key01-DlSVTdTy.js";import"./LayoutLeft-CPcvIk6j.js";import"./List-BrdeiVAK.js";import"./Monitor01-YH69hLmg.js";import"./Sun-CE4zZZrK.js";import"./Package-BC8j5O7T.js";import"./Palette-COkzmwuD.js";import"./Play-fRGAaRLr.js";import"./Plus-DZ8Y2lWX.js";import"./SearchLg-DCnLlGR7.js";import"./SearchMd-BxmBL442.js";import"./Shield01-CJ4mz5gK.js";import"./Stars01-BBDTresZ.js";import"./Trash01-B9pw3Dz-.js";import"./Upload01-DwHzJTDj.js";import"./User01-0_lYU3sr.js";import"./Users01-BA0tYZge.js";import"./XClose-Cy2zn03A.js";import"./X-bCYPxEGT.js";import"./Zap-rVhVjFMk.js";import"./chat-context-DHTaLNyE.js";import"./autosend-BRQL6Rcu.js";import"./hooks-Cb3Qy_Dc.js";import"./use-mcp-client-B9awT5X_.js";import"./constants-CaIX_f5U.js";import"./auth-iC_q9BIr.js";import"./decopilot-sse-pool-Cb8qqxEJ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-CymLeNR8.js";import"./use-collections-Ce-cuEBy.js";import"./use-ai-providers-CSQgALBc.js";import"./studio-tools-E9yDf3_0.js";import"./use-decopilot-events-Cxs4WDOZ.js";import"./tab-id-bb-jjgGv.js";import"./use-organization-settings-C5RS8nea.js";import"./tooltip-M_e_krSv.js";import"./dialog-mPkr-RRK.js";import"./drawer-B8TNUPgG.js";import"./collection-search-C94-PhCw.js";import"./use-mobile-CkmVE_-7.js";import"./use-mcp-prompts-EOAbT9yX.js";import"./shell-layout-CVOU9xRB.js";import"./avatar-Y-6cgdhP.js";import"./required-auth-layout-D9qojMWR.js";import"./use-org-sso-By_u0hEv.js";import"./form-h_6je5dw.js";import"./select-CviXI9ki.js";import"./tabs-BEnBthXe.js";import"./toggle-group-lOSgrtpS.js";import"./agent-capabilities-Crp4S07c.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CmtTMlc6.js";import"./use-registry-connections-BqTrjEc0.js";import"./use-connection-hkUuQBrT.js";import"./useInfiniteQuery-BqDEFx1l.js";import"./use-infinite-scroll-D7VcwF5k.js";import"./extract-connection-data-CrDh9fRV.js";import"./card-PDwkjkZo.js";import"./integration-icon-CsT4Vm35.js";import"./collection-tabs-BM-YDljB.js";import"./badge-CDBU7Jnw.js";import"./textarea-Dl16KMAC.js";import"./connection-form-helpers-ChroeVON.js";import"./authenticate-and-persist-oauth-BNnoe036.js";import"./mcp-oauth-Cx2xXJpN.js";import"./useSuspenseInfiniteQuery-BnQw-mx8.js";import"./connect-desktop-dialog-C-AzZ9uU.js";import"./select-model-BVeB6qMz.js";import"./checkbox-Gk-F98s7.js";import"./skeleton-CcEQud32.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-VSZi6AlU.js";import"./command-D4Q48wPz.js";import"./index-icYCRExU.js";import"./popover-CgzT12BA.js";import"./dropdown-menu-B0v0032v.js";import"./index-C0SPe6C9.js";import"./file-type-icon-C6k5FmYJ.js";import"./toolbar-CC2Wp6FF.js";import"./use-debounced-value-DaMxSpzh.js";import"./index-D7lYswsa.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CqFkTrqw.js";import"./empty-state-DpnHm9Ff.js";import"./use-mcp-tools-BzGw36c7.js";import"./types-CqK4Iemy.js";import"./use-capability-aTF0AI3e.js";import"./tools-list-C9rz13Xx.js";import"./switch-QOV1_3MP.js";import"./use-debounced-autosave-jg3g3c9r.js";import"./index-el6kTH3I.js";import"./sidebar-CmQSAjPL.js";import"./search-input-Dn0hSWZ5.js";import"./github-repo-picker-tThpI_5I.js";import"./use-navigate-to-agent-B5-47yrA.js";import"./reusable-new-chat-CouMjkYR.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-BXostql4.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-members-NrGwwdtD.js";import"./use-org-auth-client-BaKQjOSf.js";import"./index-BtB12M4y.js";import"./get-initials-D-f_fDFw.js";import"./format-time-BnbuEtat.js";import"./calendar-D1uldZAa.js";import"./toolbar-icon-button-Dxmr2sEF.js";import"./use-file-configs-CQ4BSXsE.js";import"./monaco-editor-Xh2wk8Tp.js";import"./use-automations-B73FT1wm.js";import"./automation-list-row-LFCTBiwF.js";import"./table-B6d_9e6u.js";import"./use-clock-tick-CCTl5Yxu.js";import"./use-copy-Dijkn7yI.js";function bt(k){const e=G.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(yt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(jt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function gr({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,y]=S.useState(a),[m,C]=S.useState(null),[N,$]=S.useState(!1),z=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],j=z.length,M=o=>s("slug",o),J=async(o,w)=>{const q=v(r.name);$(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:q,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:R(P,"posts",F)}),g+=1)}const E={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",E)}),c(E),I.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){y(o),C(null),I.error(g instanceof Error?g.message:"Rename failed")}finally{$(!1)}},W=()=>{const o=B.trim();if(o===a){B!==o&&y(o);return}if(!o){y(a);return}if(j===0){M(o);return}C({oldSlug:a,newSlug:o,count:j})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-slug",children:"Slug"}),t.jsx(H,{id:"category-slug",value:B,onChange:o=>y(o.target.value),onBlur:W,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(L,{htmlFor:"category-description",children:"Description"}),t.jsx(H,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[j," ",j===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),j>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:z.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(K,{open:!!m,onOpenChange:o=>{o||N||(y(a),C(null))},children:t.jsxs(_,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&J(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{gr as CategoryEditor};
@@ -1 +0,0 @@
1
- import{c as O,j as t,B as F,i as Y,H as Ge,I as te,U as Pe,r as $,a5 as re,M as Qe,u as Ye,L as W,t as Ze,l as je,e as le,aZ as ke}from"./index-DSn_1D7b.js";import{E as Ae}from"./empty-state-DpnHm9Ff.js";import{u as Xe,a as Ee}from"./use-collections-Ce-cuEBy.js";import{u as ae}from"./use-mcp-client-B9awT5X_.js";import{F as se,a as et,b as ce,d as de}from"./form-h_6je5dw.js";import{I as me}from"./input-nFXBUvLG.js";import{T as ie}from"./textarea-Dl16KMAC.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-D75hG9Mx.js";import{ar as it,L as rt,an as lt,U as at,ae as ct,as as dt,Y as be}from"./agent-icon-B3Khwrxs.js";import{g as mt,M as ut,a as Ne}from"./types-CqK4Iemy.js";import{A as xt,a as pt,b as ft}from"./alert-C5yvBlhG.js";import{S as ve,a as Se,b as ye,c as we,d as ne}from"./select-CviXI9ki.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-M_e_krSv.js";import{i as gt}from"./AlertCircle-DQCGvut8.js";import{s as jt}from"./Stars02-6a4XNIIU.js";import{a as bt}from"./Copy01-DyXaUHnt.js";import{i as Nt}from"./Play-fRGAaRLr.js";import{a as Oe,b as Re,B as J,c as G,d as Q,e as _e}from"./breadcrumb-BcIGB1Or.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-C9rz13Xx.js";import{a as Me,u as De}from"./use-connection-hkUuQBrT.js";import{a as wt}from"./use-mcp-tools-BzGw36c7.js";import{M as Ct,c as It}from"./monaco-editor-Xh2wk8Tp.js";import{I as Te}from"./integration-icon-CsT4Vm35.js";import{g as $t,l as Tt}from"./chat-context-DHTaLNyE.js";import{u as Pt}from"./shell-layout-CVOU9xRB.js";import{n as kt}from"./Tool02-BY98RBMi.js";import"./constants-CaIX_f5U.js";import"./auth-iC_q9BIr.js";import"./label-BBor9OYw.js";import"./index-el6kTH3I.js";import"./sidebar-CmQSAjPL.js";import"./LayoutLeft-CPcvIk6j.js";import"./use-mobile-CkmVE_-7.js";import"./X-bCYPxEGT.js";import"./ZoomOut-HiEViCQt.js";import"./Key01-DlSVTdTy.js";import"./extract-connection-data-CrDh9fRV.js";import"./use-registry-connections-BqTrjEc0.js";import"./use-organization-settings-C5RS8nea.js";import"./studio-tools-E9yDf3_0.js";import"./Plus-DZ8Y2lWX.js";import"./index-D8u7pwON.js";import"./index-D_Pdja_K.js";import"./index-icYCRExU.js";import"./popover-CgzT12BA.js";import"./use-virtual-mcp-CymLeNR8.js";import"./Check-BEeJ8fxa.js";import"./SearchMd-BxmBL442.js";import"./Users03-DGfmL8ng.js";import"./use-create-virtual-mcp-GoXz08-t.js";import"./use-navigate-to-agent-B5-47yrA.js";import"./hooks-Cb3Qy_Dc.js";import"./decopilot-sse-pool-Cb8qqxEJ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Tool01-B4Z7JhlQ.js";import"./ArrowUp-D7T7n9iH.js";import"./Settings02-Bo6T9XLP.js";import"./XCircle-DP6KZoJI.js";import"./ArrowUpRight-BEFV2vkA.js";import"./TrendUp01-C8HikdRN.js";import"./ZapSquare-CojtzYzX.js";import"./Loading02-CBukUc03.js";import"./CheckCircle-CsSfP7Xf.js";import"./ChevronDown-BVsraXi6.js";import"./ChevronRight-D4jesAkw.js";import"./ChevronUp-G9frUDJZ.js";import"./Circle-D3nky9aw.js";import"./DotsVertical-CkzUgpIb.js";import"./Globe01-B0Trj5Ay.js";import"./Eye-Z74BlA3H.js";import"./FilterLines-Bu3ZCrw6.js";import"./Star01-IZ68g_xa.js";import"./Globe04-oRfi9_O4.js";import"./SwitchHorizontal01-60hw4Alk.js";import"./HardDrive-Dx7eQadd.js";import"./LinkExternal01-8ULSUK9E.js";import"./List-BrdeiVAK.js";import"./Monitor01-YH69hLmg.js";import"./Sun-CE4zZZrK.js";import"./Package-BC8j5O7T.js";import"./Palette-COkzmwuD.js";import"./SearchLg-DCnLlGR7.js";import"./Shield01-CJ4mz5gK.js";import"./Stars01-BBDTresZ.js";import"./Trash01-B9pw3Dz-.js";import"./Upload01-DwHzJTDj.js";import"./User01-0_lYU3sr.js";import"./Users01-BA0tYZge.js";import"./XClose-Cy2zn03A.js";import"./Zap-rVhVjFMk.js";import"./mcp-oauth-Cx2xXJpN.js";import"./badge-CDBU7Jnw.js";import"./index-D7lYswsa.js";import"./autosend-BRQL6Rcu.js";import"./use-ai-providers-CSQgALBc.js";import"./use-decopilot-events-Cxs4WDOZ.js";import"./tab-id-bb-jjgGv.js";import"./avatar-Y-6cgdhP.js";import"./dialog-mPkr-RRK.js";import"./alert-dialog-DDJF6hNh.js";import"./required-auth-layout-D9qojMWR.js";import"./use-org-sso-By_u0hEv.js";function At(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Ge({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function Et(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=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 l;e[1]!==r.control?(l=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:r.control,name:"title",render:Mt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...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 _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...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 Mt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Xe(r,"PROMPT",o,d),u=Ee(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Qe(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const A=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:A.title,description:A.description??null,body:oe(A)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.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:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(At,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function Lt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=Et(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ae,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Dt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const zt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=Me(e),N=$t(),A=Tt(),{openSidePanel:U}=Pt(),L=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),z=wt({client:_}),j=z.data?.tools?.find(a=>a.name===s),E=mt(j?._meta),V=a=>{if(!N)return;const h=It(a.content);h.content.length>0&&(U("chat"),N.sendMessage({tiptapDoc:h}))},[M,Z]=$.useState("json"),[Le,ze]=$.useState(!1);E&&!Le&&(Z("ui"),ze(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const X=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const D=u.trim();if(!D)return{};const B=JSON.parse(D);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([D,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[D]=="string")try{h[D]=JSON.parse(h[D])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[D]=="string"&&h[D]!==""){const ge=Number(h[D]);Number.isNaN(ge)||(h[D]=ge)}});const v=await _.callTool({name:s,arguments:h}),K=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-a);p(K),g(v),C(h);const We=JSON.stringify(K),he=new TextEncoder().encode(We).length;y({duration:`${Ke}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const K=performance.now();y({duration:`${Math.round(K-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??zt(s),Ve=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(Q,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(Q,{})]}),t.jsx(J,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:X(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:X(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.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:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(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:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),E&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:M==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>Z("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{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(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{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&&M==="ui"&&_?t.jsx($.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(ut,{resourceURI:E,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:a=>A?.setAppContext(L,a),onTeardown:()=>A?.clearAppContext(L),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Ct,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Ze.success("Copied to clipboard")},children:t.jsx(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(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{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:P?.icon||null,name:P?.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(Y,{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(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.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"}),fe]}),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 Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!Me(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Vt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Jt={prompt:Lt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=De(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Kt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Wt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=De(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ee(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async M=>{i&&await R.update.mutateAsync({id:i,data:M})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Jt[b];let w;s[14]!==l?(w=Kt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let A;s[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Q,{}),s[18]=A):A=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(G,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(Q,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let L;s[24]!==P?(L=t.jsx(J,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=L):L=s[25];let _;s[26]!==U||s[27]!==L||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,A,U,L]})}),s[26]=U,s[27]=L,s[28]=N,s[29]=_):_=s[29];const z=_;if(y){let M;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(M=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=M):M=s[34],M}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let E;s[36]!==d?(E=t.jsx(Vt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=E):E=s[37];let V;return s[38]!==z||s[39]!==E?(V=t.jsx(ue,{breadcrumb:z,children:E}),s[38]=z,s[39]=E,s[40]=V):V=s[40],V}function Gt(){const s=O.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 r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{}),s[2]=i):i=s[2],i}function Wn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Gt,{})})}),s[0]=e):e=s[0],e}export{Wn as default};
@@ -1 +0,0 @@
1
- import{H as he,af as Ie,b2 as Ae,I as le,ad as $e,c as P,j as t,i as ge,B as V,r as G,l as je,a5 as J,P as De,K as ne,b as Y,aI as ce,Z as Pe,b3 as Oe,U as Me,e as ze,b4 as Ee,n as Ve,M as Ue,J as Re,t as X,b5 as Fe}from"./index-DSn_1D7b.js";import{a as Le}from"./extract-connection-data-CrDh9fRV.js";import{E as ve}from"./empty-state-DpnHm9Ff.js";import{E as He,c as Be,r as qe,b as We,d as Xe}from"./connection-form-helpers-ChroeVON.js";import{c as Ge,S as Ke,V as Qe}from"./index-D75hG9Mx.js";import{u as be,T as Je}from"./tools-list-C9rz13Xx.js";import{u as Ye}from"./use-members-NrGwwdtD.js";import{A as Ze}from"./avatar-Y-6cgdhP.js";import{a as Ne,b as ye,u as et}from"./use-connection-hkUuQBrT.js";import{u as _e}from"./use-mcp-client-B9awT5X_.js";import{a as tt}from"./use-mcp-tools-BzGw36c7.js";import{a as st}from"./use-mcp-prompts-EOAbT9yX.js";import{i as nt,a as ot}from"./mcp-oauth-Cx2xXJpN.js";import{I as oe}from"./integration-icon-CsT4Vm35.js";import{s as it}from"./Plus-DZ8Y2lWX.js";import{N as rt,O as at,aq as lt,am as ct}from"./agent-icon-B3Khwrxs.js";import{a as Ce,s as dt}from"./Settings02-Bo6T9XLP.js";import{s as re}from"./Trash01-B9pw3Dz-.js";import{q as mt,p as ut,o as xt,m as pt,n as ft}from"./sidebar-CmQSAjPL.js";import{F as L,b as H,c as B,d as E,e as q,f as ht,a as gt}from"./form-h_6je5dw.js";import{I as W}from"./input-nFXBUvLG.js";import{u as jt,D as vt}from"./use-delete-connection-BlA3-BWP.js";import{c as bt,C as Nt,B as yt,a as _t,b as Ct,d as St,e as wt}from"./monitoring-stats-row-DOoEOmXM.js";import{u as kt}from"./studio-tools-E9yDf3_0.js";import{a as Tt}from"./use-virtual-mcp-CymLeNR8.js";import{i as Se}from"./ChevronRight-D4jesAkw.js";import{a as we}from"./Users03-DGfmL8ng.js";import{b as ee,c as It,T as te,a as At}from"./tabs-BEnBthXe.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as $t}from"./ZapSquare-CojtzYzX.js";import{d as Dt}from"./Tool01-B4Z7JhlQ.js";import{g as ae,M as Pt}from"./types-CqK4Iemy.js";import{C as Ot}from"./collection-search-C94-PhCw.js";import{C as Mt}from"./card-PDwkjkZo.js";import{B as zt}from"./badge-CDBU7Jnw.js";import{D as Et,a as Vt,c as Ut,d as de}from"./dropdown-menu-B0v0032v.js";import{S as me,a as ue,b as xe,c as pe,d as F}from"./select-CviXI9ki.js";import{i as Rt}from"./CheckCircle-CsSfP7Xf.js";import{t as Ft}from"./ChevronDown-BVsraXi6.js";import{n as Lt}from"./Tool02-BY98RBMi.js";import{s as se}from"./Star01-IZ68g_xa.js";import{s as Ht}from"./XClose-Cy2zn03A.js";import"./constants-CaIX_f5U.js";import"./index-el6kTH3I.js";import"./ZoomOut-HiEViCQt.js";import"./Key01-DlSVTdTy.js";import"./auth-iC_q9BIr.js";import"./use-registry-connections-BqTrjEc0.js";import"./use-organization-settings-C5RS8nea.js";import"./index-D8u7pwON.js";import"./index-D_Pdja_K.js";import"./index-icYCRExU.js";import"./popover-CgzT12BA.js";import"./tooltip-M_e_krSv.js";import"./Check-BEeJ8fxa.js";import"./SearchMd-BxmBL442.js";import"./use-mobile-CkmVE_-7.js";import"./use-create-virtual-mcp-GoXz08-t.js";import"./use-navigate-to-agent-B5-47yrA.js";import"./hooks-Cb3Qy_Dc.js";import"./decopilot-sse-pool-Cb8qqxEJ.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CouMjkYR.js";import"./Eye-Z74BlA3H.js";import"./use-org-auth-client-BaKQjOSf.js";import"./User01-0_lYU3sr.js";import"./use-collections-Ce-cuEBy.js";import"./AlertCircle-DQCGvut8.js";import"./ArrowUp-D7T7n9iH.js";import"./XCircle-DP6KZoJI.js";import"./ArrowUpRight-BEFV2vkA.js";import"./TrendUp01-C8HikdRN.js";import"./Loading02-CBukUc03.js";import"./ChevronUp-G9frUDJZ.js";import"./Circle-D3nky9aw.js";import"./Stars02-6a4XNIIU.js";import"./Copy01-DyXaUHnt.js";import"./DotsVertical-CkzUgpIb.js";import"./Globe01-B0Trj5Ay.js";import"./FilterLines-Bu3ZCrw6.js";import"./Globe04-oRfi9_O4.js";import"./SwitchHorizontal01-60hw4Alk.js";import"./HardDrive-Dx7eQadd.js";import"./LayoutLeft-CPcvIk6j.js";import"./LinkExternal01-8ULSUK9E.js";import"./List-BrdeiVAK.js";import"./Monitor01-YH69hLmg.js";import"./Sun-CE4zZZrK.js";import"./Package-BC8j5O7T.js";import"./Palette-COkzmwuD.js";import"./Play-fRGAaRLr.js";import"./SearchLg-DCnLlGR7.js";import"./Shield01-CJ4mz5gK.js";import"./Stars01-BBDTresZ.js";import"./Upload01-DwHzJTDj.js";import"./Users01-BA0tYZge.js";import"./X-bCYPxEGT.js";import"./Zap-rVhVjFMk.js";import"./label-BBor9OYw.js";import"./alert-dialog-DDJF6hNh.js";const Bt=he({scopes:$e(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),qt=[{name:"MCP_CONFIGURATION",inputSchema:he({}),outputSchema:Bt}];function Wt(s){const e=P.c(46),{instance:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a}=s;let d;e[0]!==n.id?(d={connectionId:n.id},e[0]=n.id,e[1]=d):d=e[1];const l=be(d),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",c=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==c?(h=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",c),e[2]=c,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==a?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>a(n,"active"),children:[t.jsx(rt,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>a(n,"inactive"),title:"Disable",children:t.jsx(at,{size:13})}),e[20]=n,e[21]=p,e[22]=a,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==i?(S=()=>i(n),e[24]=n,e[25]=i,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(re,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let f;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(f=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=f):f=e[40];let w;return e[41]!==f||e[42]!==h||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:h,children:[g,j,f]}),e[41]=f,e[42]=h,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function Xt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let a;e[5]!==n||e[6]!==i?(a=()=>i(n),e[5]=n,e[6]=i,e[7]=a):a=e[7];let d;e[8]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:13}),e[8]=d):d=e[8];let l;e[9]!==a?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,title:"Configure",children:d})}),e[9]=a,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function Gt(s){const e=P.c(27),{instances:n,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a,onAdd:d,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let c;e[4]!==l||e[5]!==d||e[6]!==p?(c=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:d,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=d,e[6]=p,e[7]=c):c=e[7];let h;e[8]!==x||e[9]!==c?(h=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,c]}),e[8]=x,e[9]=c,e[10]=h):h=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==i||e[14]!==o||e[15]!==a){let j;e[17]!==r||e[18]!==i||e[19]!==o||e[20]!==a?(j=N=>t.jsx(G.Suspense,{fallback:t.jsx(Xt,{instance:N,onConfigure:i}),children:t.jsx(Wt,{instance:N,onConfigure:i,onAuthenticate:r,onDelete:o,onToggleStatus:a})},N.id),e[17]=r,e[18]=i,e[19]=o,e[20]=a,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=i,e[14]=o,e[15]=a,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==h||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[h,v]}),e[24]=h,e[25]=v,e[26]=b):b=e[26],b}function Kt(s,e=3){const n=new Map;for(const i of s){if(!i.isError)continue;const r=(i.errorMessage??"").trim()||"Unknown error";n.set(r,(n.get(r)??0)+1)}return[...n.entries()].map(([i,r])=>({message:i,count:r})).sort((i,r)=>r.count-i.count).slice(0,e)}const Qt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Jt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Yt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Zt(s){const e=P.c(1),{connectionId:n,orgId:i,timeframe:r}=s,o=kt(),a=Jt(r),{data:d}=De({queryKey:ne.connectionActivity(n,r,i),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=bt(d?.logs??[],a),u=l.data,x=l.totalCalls>0,p=Kt(d?.logs??[]),c=l.totalCalls>0?Math.round(l.totalErrors/l.totalCalls*100):0;let h;return e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=h):h=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),h]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(Nt,{config:Yt,className:"h-16 w-full",children:t.jsxs(yt,{data:u,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(Ct,{labelFormatter:ss}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(ts)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})}),p.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:["Top errors",c>0?` · ${c}% of calls failed`:""]}),t.jsx("ul",{className:"space-y-1.5",children:p.map(es)})]})]})}function es(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ts(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ss(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ns(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function os(s){const e=P.c(13),{connectionId:n}=s,[i,r]=G.useState("14d"),{org:o}=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=a):a=e[0];let d;e[1]!==i?(d=Qt.map(c=>t.jsx("button",{type:"button",onClick:()=>r(c.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===c.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:c.label},c.value)),e[1]=i,e[2]=d):d=e[2];let l;e[3]!==d?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[a,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:d})]}),e[3]=d,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ns,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==i?(x=t.jsx(G.Suspense,{fallback:u,children:t.jsx(Zt,{connectionId:n,orgId:o.id,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=i,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function is(s){const e=P.c(15),{virtualMcp:n,org:i}=s,r=Y();let o;e[0]!==r||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{size:16}),e[4]=a):a=e[4];let d;e[5]!==n.icon||e[6]!==n.title?(d=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[5]=n.icon,e[6]=n.title,e[7]=d):d=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==d||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[d,l,u]}),e[11]=o,e[12]=d,e[13]=l,e[14]=x):x=e[14],x}function rs(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let r;if(e[0]!==i||e[1]!==n){let a;e[3]!==i?(a=d=>t.jsx(is,{virtualMcp:d,org:i},d.id),e[3]=i,e[4]=a):a=e[4],r=n.map(a),e[0]=i,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function as(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=d):d=e[3];let l;return e[4]!==i.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,t.jsx("div",{className:"px-5 py-4",children:t.jsx(rs,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=l):l=e[6],l}function ls(s){const e=P.c(31),{tools:n,connectionId:i,org:r}=s,o=Y(),{org:a}=J();let d;e[0]!==i||e[1]!==a.id||e[2]!==a.slug?(d={connectionId:i,orgId:a.id,orgSlug:a.slug},e[0]=i,e[1]=a.id,e[2]=a.slug,e[3]=d):d=e[3];const l=_e(d),u=Ne(i);let x;e[4]!==u||e[5]!==i?(x=u?ke(u):i,e[4]=u,e[5]=i,e[6]=x):x=e[6];const p=x,[c,h]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==c||e[12]!==n){const S=(n??[]).filter(cs),y=c.toLowerCase().trim(),I=y?S.filter(f=>f.name.toLowerCase().includes(y)||f.description&&f.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=f=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(f.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=f=>{f.key==="Escape"&&(h(""),f.target.blur())},e[21]=C):C=e[21],e[22]!==c?(j=t.jsx(Ot,{value:c,onChange:h,placeholder:"Search apps...",onKeyDown:C}),e[22]=c,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:c?"No apps found":"No apps available",description:c?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(f=>{const w=ae(f._meta);return t.jsxs(Mt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(f),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:f},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:f.name}),t.jsx(Je,{annotations:f.annotations,_meta:f._meta})]}),f.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:f.description})]})]},f.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=c,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function cs(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=a=>a.charAt(0).toUpperCase()+a.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&i.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function ds(s){const e=P.c(50),{tools:n,prompts:i,resources:r,connectionId:o,org:a}=s;let d;e[0]!==i?(d=i===void 0?[]:i,e[0]=i,e[1]=d):d=e[1];const l=d;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),c=Ne(o??"");let h;e[4]!==c||e[5]!==o?(h=c?ke(c):o,e[4]=c,e[5]=o,e[6]=h):h=e[6];const g=h;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==a?(v=function($){!o||!a||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:g,collectionName:"tools",itemId:encodeURIComponent($)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=a,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==a||e[14]!==n?(j=o&&a&&n.some(xs),e[12]=o,e[13]=a,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let f;e[29]!==C?(f=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=f):f=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==a||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ls,{tools:n,connectionId:o,org:a})}),e[31]=o,e[32]=N,e[33]=a,e[34]=n,e[35]=w):w=e[35];let M;e[36]!==l?(M=l.length>0?l.map(us):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(ms):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let z;e[42]!==A?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=z):z=e[43];let U;return e[44]!==k||e[45]!==f||e[46]!==w||e[47]!==O||e[48]!==z?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,f,w,O,z]})}),e[44]=k,e[45]=f,e[46]=w,e[47]=O,e[48]=z,e[49]=U):U=e[49],U}function ms(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function us(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function xs(s){return ae(s._meta)}function ps(s){const e=P.c(13),{connection:n,displayTitle:i}=s,r=i??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let a;e[3]!==r?(a=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=a):a=e[4];let d;e[5]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==d?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,d]}),e[7]=a,e[8]=d,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function fs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),a=ce({control:s.control,name:"connection_url"}),{stdioEnabled:d}=Pe(),l=(()=>{if(typeof a!="string"||!a)return!1;try{const c=new URL(a);return c.hostname==="api.githubcopilot.com"&&c.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=d||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(W,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:c.value,onValueChange:c.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(q,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(W,{placeholder:"@perplexity-ai/mcp-server",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(q,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(W,{placeholder:"node, bun, python...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(q,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(W,{placeholder:"arg1 arg2 --flag value",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(q,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(W,{placeholder:"/path/to/project (optional)",...c,value:c.value||"",className:"h-10 rounded-lg"})}),t.jsx(q,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(He,{value:c.value??[],onChange:c.onChange})}),t.jsx(q,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:c})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(B,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(zt,{variant:"success",className:"gap-1.5",children:[t.jsx(Rt,{size:12}),"Authenticated via OAuth",t.jsx(Ft,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:i,children:[t.jsx(dt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(re,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&c.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>c.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(W,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...c,value:c.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ht,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(q,{})]})})]})}function hs(s){return s.command==="npx"}function gs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function js(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function fe(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Fe(s.connection_headers)){const i=s.connection_headers,r=qe(i.envVars);if(hs(i)){const a=gs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=js(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function vs(s){let e,n=null,i=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=We(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function bs({connection:s,connectionId:e,org:n,isUpdating:i,tools:r,prompts:o,resources:a,siblings:d}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),c=jt({onSuccess:()=>{d.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=G.useState(null),[v,b]=G.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=h??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=Ge(k,qt),f=Ue({resolver:Re(Be),values:fe(h??s)}),w=f.formState.isDirty,M=async()=>{if(!await f.trigger())return;const $=f.getValues(),D=vs($),R=h?.id??e;await x.update.mutateAsync({id:R,data:D}),f.reset($)},O=()=>{f.reset(fe(h??s))},A=async m=>{const{token:$,tokenInfo:D,error:R}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(R||!$){X.error(`Authentication failed: ${R}`);return}if(D)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:$}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:$}})}else await x.update.mutateAsync({id:m,data:{connection_token:$}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),X.success("Authentication successful")},z=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const D=await m.text();X.error(`Failed to remove OAuth: ${D}`);return}const $=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated($.href,null)}),X.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),X.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...c}),t.jsx(mt,{open:h!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ut,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(xt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(pt,{className:"text-base",children:h?.title??s.title}),t.jsx(ft,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(gt,{...f,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:f.control,name:"title",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Name"}),t.jsx(E,{children:t.jsx(W,{...m})}),t.jsx(q,{})]})}),t.jsx(L,{control:f.control,name:"description",render:({field:m})=>t.jsxs(H,{children:[t.jsx(B,{children:"Description"}),t.jsx(E,{children:t.jsx(W,{...m,value:m.value||""})}),t.jsx(q,{})]})})]}),t.jsx(fs,{form:f,connection:h??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:U}),t.jsx(Ke,{connection:h??s,form:f,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:M,disabled:!w||i,className:"flex-1",children:i?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=h??s;g(null),c.requestDelete(m)},children:[t.jsx(re,{size:15}),"Delete"]})]})]},h?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ps,{connection:s,displayTitle:(()=>{const m=d[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(os,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:d,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>c.requestDelete(m),onToggleStatus:async(m,$)=>{try{await x.update.mutateAsync({id:m.id,data:{status:$}}),X.success($==="active"?"Connection enabled":"Connection disabled")}catch{X.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=d[0]??s,$=m.title.replace(/\s*\(\d+\)\s*$/,""),D=d.length+1,R=`${$} (${D})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:R,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await nt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(as,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ds,{tools:r,prompts:o,resources:a,connectionId:e,org:n})})]})})]})})]})}function Ns(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:r,org:o}=ze(i),{org:a}=J(),d=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",c=p||null;let h;s[4]!==a.id||s[5]!==a.slug||s[6]!==c?(h={connectionId:c,orgId:a.id,orgSlug:a.slug},s[4]=a.id,s[5]=a.slug,s[6]=c,s[7]=h):h=s[7];const g=_e(h);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(ks):(x?.tools??[]).map(ws);e:{if(u.length<=1){j=A;break e}const z=new Set,U=[],m=Cs;for(const $ of u){const D=$.id===p?A:m($.tools);for(const R of D)z.has(R.name)||(z.add(R.name),U.push(R))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=st(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(_s),s[21]=_,s[22]=k):k=s[22];const C=k;let f;s[23]!==I?.resources?(f=I?.resources??[],s[23]=I?.resources,s[24]=f):f=s[24];let w;s[25]!==f?(w=f.map(ys),s[25]=f,s[26]=w):w=s[26];const M=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==d.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==M||s[37]!==u?(O=t.jsx(bs,{org:o,connection:x,connectionId:p,isUpdating:d.update.isPending,tools:N,prompts:C,resources:M,siblings:u}),s[30]=d.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=M,s[37]=u,s[38]=O):O=s[38],O}function ys(s){return{name:s.name,description:s.description,uri:s.uri}}function _s(s){return{name:s.name,description:s.description}}function Cs(s){return(s??[]).map(Ss)}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ks(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ns,{})})}),s[0]=e):e=s[0],e}function Co(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ts,{}),s[0]=e):e=s[0],e}export{Co as default};
@@ -1,2 +0,0 @@
1
- import{c as Z,r as u,j as r,i as se,B as he,d$ as Mt,aO as Dt,aU as ie,e0 as Rt,e1 as Pt,e2 as Et,e3 as kt,bN as Tt,e4 as Ot,e5 as qe,aQ as At,e6 as Lt,e7 as Ft,e8 as It,e9 as $t,ea as _t,eb as zt,ec as Wt,ed as Gt,ee as Kt,l as ae,n as Bt,t as W,K as $e}from"./index-DSn_1D7b.js";import{F as Ut,l as Vt}from"./index-D7lYswsa.js";import{i as qt,aD as Qt,aE as Ht,aF as ue,aG as Xt,ab as _e}from"./agent-icon-B3Khwrxs.js";import{a as Jt}from"./Tool01-B4Z7JhlQ.js";import{s as Yt}from"./XClose-Cy2zn03A.js";import{A as Zt}from"./automation-runs-Dx0I1hOP.js";import{T as ze,a as We,b as Ge}from"./tooltip-M_e_krSv.js";import{f as en,a as tn,b as nn,c as rn,d as on,e as sn,A as an,g as ln}from"./alert-dialog-DDJF6hNh.js";import{a as cn}from"./chat-context-DHTaLNyE.js";import{u as dn}from"./shell-layout-CVOU9xRB.js";import{s as fe,a as Ke,f as un}from"./index-DD5ljKuD.js";import{a as fn,f as mn,D as pn,c as xn,d as hn,e as gn}from"./dialog-mPkr-RRK.js";import{I as Be}from"./input-nFXBUvLG.js";import{t as vn}from"./ChevronDown-BVsraXi6.js";import{i as yn}from"./ChevronRight-D4jesAkw.js";import{a as wn}from"./ZoomOut-HiEViCQt.js";import{E as Cn,v as Ue,w as we,x as bn,y as jn,z as Nn,A as U,C as me,g as Ce,D as be,G as Sn,I as Mn,J as je,K as pe,M as Ne,N as Dn,O as Rn}from"./index-C0SPe6C9.js";import"./AlertCircle-DQCGvut8.js";import"./ArrowUp-D7T7n9iH.js";import"./Settings02-Bo6T9XLP.js";import"./Tool02-BY98RBMi.js";import"./XCircle-DP6KZoJI.js";import"./ArrowUpRight-BEFV2vkA.js";import"./TrendUp01-C8HikdRN.js";import"./ZapSquare-CojtzYzX.js";import"./Users03-DGfmL8ng.js";import"./Loading02-CBukUc03.js";import"./CheckCircle-CsSfP7Xf.js";import"./Check-BEeJ8fxa.js";import"./ChevronUp-G9frUDJZ.js";import"./Circle-D3nky9aw.js";import"./Stars02-6a4XNIIU.js";import"./Copy01-DyXaUHnt.js";import"./DotsVertical-CkzUgpIb.js";import"./Globe01-B0Trj5Ay.js";import"./Eye-Z74BlA3H.js";import"./FilterLines-Bu3ZCrw6.js";import"./Star01-IZ68g_xa.js";import"./Globe04-oRfi9_O4.js";import"./SwitchHorizontal01-60hw4Alk.js";import"./HardDrive-Dx7eQadd.js";import"./Key01-DlSVTdTy.js";import"./LayoutLeft-CPcvIk6j.js";import"./LinkExternal01-8ULSUK9E.js";import"./List-BrdeiVAK.js";import"./Monitor01-YH69hLmg.js";import"./Sun-CE4zZZrK.js";import"./Package-BC8j5O7T.js";import"./Palette-COkzmwuD.js";import"./Play-fRGAaRLr.js";import"./Plus-DZ8Y2lWX.js";import"./SearchLg-DCnLlGR7.js";import"./SearchMd-BxmBL442.js";import"./Shield01-CJ4mz5gK.js";import"./Stars01-BBDTresZ.js";import"./Trash01-B9pw3Dz-.js";import"./Upload01-DwHzJTDj.js";import"./User01-0_lYU3sr.js";import"./Users01-BA0tYZge.js";import"./X-bCYPxEGT.js";import"./Zap-rVhVjFMk.js";import"./select-CviXI9ki.js";import"./useInfiniteQuery-BqDEFx1l.js";import"./use-infinite-scroll-D7VcwF5k.js";import"./use-connection-hkUuQBrT.js";import"./use-collections-Ce-cuEBy.js";import"./use-mcp-client-B9awT5X_.js";import"./constants-CaIX_f5U.js";import"./auth-iC_q9BIr.js";import"./use-virtual-mcp-CymLeNR8.js";import"./card-PDwkjkZo.js";import"./sidebar-CmQSAjPL.js";import"./use-mobile-CkmVE_-7.js";import"./table-B6d_9e6u.js";import"./empty-state-DpnHm9Ff.js";import"./use-members-NrGwwdtD.js";import"./use-org-auth-client-BaKQjOSf.js";import"./use-clock-tick-CCTl5Yxu.js";import"./use-automations-B73FT1wm.js";import"./studio-tools-E9yDf3_0.js";import"./useSuspenseInfiniteQuery-BnQw-mx8.js";import"./badge-CDBU7Jnw.js";import"./checkbox-Gk-F98s7.js";import"./command-D4Q48wPz.js";import"./index-icYCRExU.js";import"./popover-CgzT12BA.js";import"./avatar-Y-6cgdhP.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-Dijkn7yI.js";import"./file-type-icon-C6k5FmYJ.js";import"./tab-id-bb-jjgGv.js";import"./monaco-editor-Xh2wk8Tp.js";import"./delay-CnY5UFtP.js";import"./types-CqK4Iemy.js";import"./hooks-Cb3Qy_Dc.js";import"./decopilot-sse-pool-Cb8qqxEJ.js";import"./backoff-CrEUbyZT.js";import"./integration-icon-CsT4Vm35.js";import"./use-navigate-to-agent-B5-47yrA.js";import"./reusable-new-chat-CouMjkYR.js";import"./use-mcp-prompts-EOAbT9yX.js";import"./form-h_6je5dw.js";import"./label-BBor9OYw.js";import"./autosend-BRQL6Rcu.js";import"./use-ai-providers-CSQgALBc.js";import"./use-decopilot-events-Cxs4WDOZ.js";import"./use-organization-settings-C5RS8nea.js";import"./required-auth-layout-D9qojMWR.js";import"./use-org-sso-By_u0hEv.js";import"./drawer-B8TNUPgG.js";import"./collection-search-C94-PhCw.js";import"./tabs-BEnBthXe.js";import"./toggle-group-lOSgrtpS.js";import"./agent-capabilities-Crp4S07c.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CmtTMlc6.js";import"./use-registry-connections-BqTrjEc0.js";import"./extract-connection-data-CrDh9fRV.js";import"./collection-tabs-BM-YDljB.js";import"./textarea-Dl16KMAC.js";import"./connection-form-helpers-ChroeVON.js";import"./authenticate-and-persist-oauth-BNnoe036.js";import"./mcp-oauth-Cx2xXJpN.js";import"./connect-desktop-dialog-C-AzZ9uU.js";import"./select-model-BVeB6qMz.js";import"./skeleton-CcEQud32.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-VSZi6AlU.js";import"./dropdown-menu-B0v0032v.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CqFkTrqw.js";import"./toolbar-CC2Wp6FF.js";import"./use-mcp-tools-BzGw36c7.js";import"./use-capability-aTF0AI3e.js";import"./tools-list-C9rz13Xx.js";import"./switch-QOV1_3MP.js";import"./use-debounced-autosave-jg3g3c9r.js";import"./index-el6kTH3I.js";import"./search-input-Dn0hSWZ5.js";import"./github-repo-picker-tThpI_5I.js";import"./use-debounced-value-DaMxSpzh.js";import"./github-installations-D2vHSx02.js";import"./use-secrets-BXostql4.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./index-BtB12M4y.js";import"./get-initials-D-f_fDFw.js";import"./calendar-D1uldZAa.js";import"./toolbar-icon-button-Dxmr2sEF.js";import"./use-file-configs-CQ4BSXsE.js";import"./automation-list-row-LFCTBiwF.js";const Pn={"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(s){const e=Z.c(51),{open:i,mode:a,initialName:c,parentLabel:m,isPending:x,onSubmit:p,onOpenChange:g}=s,M=c===void 0?"":c,d=x===void 0?!1:x,[h,y]=u.useState(M),[B,V]=u.useState(i),w=Pn[a];i!==B&&(V(i),i&&y(M));let I;e[0]!==d||e[1]!==g?(I=_=>{!_&&!d&&g(!1)},e[0]=d,e[1]=g,e[2]=I):I=e[2];const H=I;let q;e[3]!==d||e[4]!==h||e[5]!==p?(q=async _=>{_.preventDefault();const K=h.trim();!K||d||await p(K)},e[3]=d,e[4]=h,e[5]=p,e[6]=q):q=e[6];const Q=q;let $;e[7]!==w.title?($=r.jsx(fn,{children:w.title}),e[7]=w.title,e[8]=$):$=e[8];let T;e[9]!==w.description?(T=r.jsx(mn,{children:w.description}),e[9]=w.description,e[10]=T):T=e[10];let G;e[11]!==$||e[12]!==T?(G=r.jsxs(pn,{children:[$,T]}),e[11]=$,e[12]=T,e[13]=G):G=e[13];let O;e[14]!==m?(O=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),r.jsx(Be,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=m,e[15]=O):O=e[15];let A;e[16]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=A):A=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=_=>y(_.target.value),e[17]=R):R=e[17];let P;e[18]!==w.placeholder||e[19]!==d||e[20]!==h?(P=r.jsxs("div",{className:"space-y-1.5",children:[A,r.jsx(Be,{id:"file-explorer-name",value:h,onChange:R,placeholder:w.placeholder,autoFocus:!0,disabled:d})]}),e[18]=w.placeholder,e[19]=d,e[20]=h,e[21]=P):P=e[21];let j;e[22]!==P||e[23]!==O?(j=r.jsxs("div",{className:"space-y-4 py-4",children:[O,P]}),e[22]=P,e[23]=O,e[24]=j):j=e[24];let N;e[25]!==g?(N=()=>g(!1),e[25]=g,e[26]=N):N=e[26];let E;e[27]!==d||e[28]!==N?(E=r.jsx(he,{type:"button",variant:"outline",onClick:N,disabled:d,children:"Cancel"}),e[27]=d,e[28]=N,e[29]=E):E=e[29];let k;e[30]!==d||e[31]!==h?(k=!h.trim()||d,e[30]=d,e[31]=h,e[32]=k):k=e[32];let C;e[33]!==w.submit||e[34]!==d?(C=d?r.jsxs(r.Fragment,{children:[r.jsx(se,{size:14,className:"animate-spin"}),"Saving…"]}):w.submit,e[33]=w.submit,e[34]=d,e[35]=C):C=e[35];let L;e[36]!==k||e[37]!==C?(L=r.jsx(he,{type:"submit",disabled:k,children:C}),e[36]=k,e[37]=C,e[38]=L):L=e[38];let b;e[39]!==E||e[40]!==L?(b=r.jsxs(xn,{children:[E,L]}),e[39]=E,e[40]=L,e[41]=b):b=e[41];let S;e[42]!==Q||e[43]!==j||e[44]!==b||e[45]!==G?(S=r.jsx(hn,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:Q,children:[G,j,b]})}),e[42]=Q,e[43]=j,e[44]=b,e[45]=G,e[46]=S):S=e[46];let z;return e[47]!==H||e[48]!==i||e[49]!==S?(z=r.jsx(gn,{open:i,onOpenChange:H,children:S}),e[47]=H,e[48]=i,e[49]=S,e[50]=z):z=e[50],z}var Me="ContextMenu",[kn]=At(Me,[qe]),F=qe(),[Tn,Qe]=kn(Me),He=s=>{const{__scopeContextMenu:e,children:i,onOpenChange:a,dir:c,modal:m=!0}=s,[x,p]=u.useState(!1),g=F(e),M=Tt(a),d=u.useCallback(h=>{p(h),M(h)},[M]);return r.jsx(Tn,{scope:e,open:x,onOpenChange:d,modal:m,children:r.jsx(Ot,{...g,dir:c,open:x,onOpenChange:d,modal:m,children:i})})};He.displayName=Me;var Xe="ContextMenuTrigger",Je=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,disabled:a=!1,...c}=s,m=Qe(Xe,i),x=F(i),p=u.useRef({x:0,y:0}),g=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...p.current})}),M=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(M.current),[]),h=y=>{p.current={x:y.clientX,y:y.clientY},m.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>{a&&d()},[a,d]),r.jsxs(r.Fragment,{children:[r.jsx(Mt,{...x,virtualRef:g}),r.jsx(Dt.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...c,ref:e,style:{WebkitTouchCallout:"none",...s.style},onContextMenu:a?s.onContextMenu:ie(s.onContextMenu,y=>{d(),h(y),y.preventDefault()}),onPointerDown:a?s.onPointerDown:ie(s.onPointerDown,xe(y=>{d(),M.current=window.setTimeout(()=>h(y),700)})),onPointerMove:a?s.onPointerMove:ie(s.onPointerMove,xe(d)),onPointerCancel:a?s.onPointerCancel:ie(s.onPointerCancel,xe(d)),onPointerUp:a?s.onPointerUp:ie(s.onPointerUp,xe(d))})]})});Je.displayName=Xe;var On="ContextMenuPortal",Ye=s=>{const{__scopeContextMenu:e,...i}=s,a=F(e);return r.jsx(Et,{...a,...i})};Ye.displayName=On;var Ze="ContextMenuContent",et=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=Qe(Ze,i),m=F(i),x=u.useRef(!1);return r.jsx(kt,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:p=>{s.onCloseAutoFocus?.(p),!p.defaultPrevented&&x.current&&p.preventDefault(),x.current=!1},onInteractOutside:p=>{s.onInteractOutside?.(p),!p.defaultPrevented&&!c.modal&&(x.current=!0)},style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});et.displayName=Ze;var An="ContextMenuGroup",Ln=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Lt,{...c,...a,ref:e})});Ln.displayName=An;var Fn="ContextMenuLabel",In=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Ft,{...c,...a,ref:e})});In.displayName=Fn;var $n="ContextMenuItem",tt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Rt,{...c,...a,ref:e})});tt.displayName=$n;var _n="ContextMenuCheckboxItem",zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(It,{...c,...a,ref:e})});zn.displayName=_n;var Wn="ContextMenuRadioGroup",Gn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx($t,{...c,...a,ref:e})});Gn.displayName=Wn;var Kn="ContextMenuRadioItem",Bn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(_t,{...c,...a,ref:e})});Bn.displayName=Kn;var Un="ContextMenuItemIndicator",Vn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(zt,{...c,...a,ref:e})});Vn.displayName=Un;var qn="ContextMenuSeparator",nt=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Pt,{...c,...a,ref:e})});nt.displayName=qn;var Qn="ContextMenuArrow",Hn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Wt,{...c,...a,ref:e})});Hn.displayName=Qn;var Xn="ContextMenuSubTrigger",Jn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Gt,{...c,...a,ref:e})});Jn.displayName=Xn;var Yn="ContextMenuSubContent",Zn=u.forwardRef((s,e)=>{const{__scopeContextMenu:i,...a}=s,c=F(i);return r.jsx(Kt,{...c,...a,ref:e,style:{...s.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Zn.displayName=Yn;function xe(s){return e=>e.pointerType!=="mouse"?s(e):void 0}var er=He,tr=Je,nr=Ye,rr=et,or=tt,ir=nt;function sr(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(er,{"data-slot":"context-menu",...i}),e[2]=i,e[3]=a):a=e[3],a}function ar(s){const e=Z.c(4);let i;e[0]!==s?({...i}=s,e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==i?(a=r.jsx(tr,{"data-slot":"context-menu-trigger",...i}),e[2]=i,e[3]=a):a=e[3],a}function lr(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(nr,{children:r.jsx(rr,{"data-slot":"context-menu-content",className:c,...a})}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}function te(s){const e=Z.c(12);let i,a,c,m;e[0]!==s?({className:i,inset:a,variant:m,...c}=s,e[0]=s,e[1]=i,e[2]=a,e[3]=c,e[4]=m):(i=e[1],a=e[2],c=e[3],m=e[4]);const x=m===void 0?"default":m;let p;e[5]!==i?(p=ae("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",i),e[5]=i,e[6]=p):p=e[6];let g;return e[7]!==a||e[8]!==c||e[9]!==p||e[10]!==x?(g=r.jsx(or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":x,className:p,...c}),e[7]=a,e[8]=c,e[9]=p,e[10]=x,e[11]=g):g=e[11],g}function Ve(s){const e=Z.c(8);let i,a;e[0]!==s?({className:i,...a}=s,e[0]=s,e[1]=i,e[2]=a):(i=e[1],a=e[2]);let c;e[3]!==i?(c=ae("bg-border -mx-1 my-1 h-px",i),e[3]=i,e[4]=c):c=e[4];let m;return e[5]!==a||e[6]!==c?(m=r.jsx(ir,{"data-slot":"context-menu-separator",className:c,...a}),e[5]=a,e[6]=c,e[7]=m):m=e[7],m}const cr="#d9a441";function dr(s){const e=Z.c(45),{node:i,depth:a,isExpanded:c,isSelected:m,isLoading:x,fileVisual:p,onOpen:g,onSelect:M,onNewFile:d,onNewFolder:h,onCopyPath:y,onCopyRelativePath:B,onRename:V,onDelete:w}=s,I=x===void 0?!1:x,H=i.kind==="directory",{Icon:q,color:Q}=p,$=m&&"bg-accent";let T;e[0]!==$?(T=ae("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",$),e[0]=$,e[1]=T):T=e[1];const G=`${a*14+8}px`;let O;e[2]!==G?(O={paddingLeft:G},e[2]=G,e[3]=O):O=e[3];let A;e[4]!==g||e[5]!==M?(A=()=>{M(),g()},e[4]=g,e[5]=M,e[6]=A):A=e[6];let R;e[7]!==q||e[8]!==Q||e[9]!==H||e[10]!==c||e[11]!==I?(R=H?r.jsxs(r.Fragment,{children:[I?r.jsx(se,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):c?r.jsx(vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(yn,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(wn,{size:16,className:"shrink-0",style:{color:cr}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(q,{size:16,className:"shrink-0",style:{color:Q}})]}),e[7]=q,e[8]=Q,e[9]=H,e[10]=c,e[11]=I,e[12]=R):R=e[12];let P;e[13]!==i.name?(P=r.jsx("span",{className:"truncate",children:i.name}),e[13]=i.name,e[14]=P):P=e[14];let j;e[15]!==T||e[16]!==O||e[17]!==A||e[18]!==R||e[19]!==P?(j=r.jsx(ar,{asChild:!0,children:r.jsxs("button",{type:"button",className:T,style:O,onClick:A,children:[R,P]})}),e[15]=T,e[16]=O,e[17]=A,e[18]=R,e[19]=P,e[20]=j):j=e[20];let N;e[21]!==d?(N=r.jsx(te,{onSelect:d,children:"New File"}),e[21]=d,e[22]=N):N=e[22];let E;e[23]!==h?(E=r.jsx(te,{onSelect:h,children:"New Folder"}),e[23]=h,e[24]=E):E=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ve,{}),e[25]=k):k=e[25];let C;e[26]!==y?(C=r.jsx(te,{onSelect:y,children:"Copy Path"}),e[26]=y,e[27]=C):C=e[27];let L;e[28]!==B?(L=r.jsx(te,{onSelect:B,children:"Copy Relative Path"}),e[28]=B,e[29]=L):L=e[29];let b;e[30]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(Ve,{}),e[30]=b):b=e[30];let S;e[31]!==V?(S=r.jsx(te,{onSelect:V,children:"Rename"}),e[31]=V,e[32]=S):S=e[32];let z;e[33]!==w?(z=r.jsx(te,{variant:"destructive",onSelect:w,children:"Delete"}),e[33]=w,e[34]=z):z=e[34];let _;e[35]!==N||e[36]!==E||e[37]!==C||e[38]!==L||e[39]!==S||e[40]!==z?(_=r.jsxs(lr,{className:"w-52",children:[N,E,k,C,L,b,S,z]}),e[35]=N,e[36]=E,e[37]=C,e[38]=L,e[39]=S,e[40]=z,e[41]=_):_=e[41];let K;return e[42]!==_||e[43]!==j?(K=r.jsxs(sr,{children:[j,_]}),e[42]=_,e[43]=j,e[44]=K):K=e[44],K}Vt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function Se(s,e,i,a){return`/api/${s}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(i)}/${a}`}function ur(s){const e=U(s);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const fr="#94a3b8";function mr(s){const e=s.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ue,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ue,color:"#d9a441"}:e.endsWith(".json")?{Icon:Xt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ue,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ue,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:Jt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:_e,color:"#64748b"}:{Icon:_e,color:fr}}function os({orgSlug:s,virtualMcpId:e,branch:i,openPath:a}){const[c,m]=u.useState({files:[],directories:[],truncated:!1}),{files:x,directories:p}=c,[g,M]=u.useState(new Set),[d,h]=u.useState(null),[y,B]=u.useState(null),[V,w]=u.useState([]),[I,H]=u.useState(""),[q,Q]=u.useState(!1),[$,T]=u.useState(!1),[,G]=u.useState(new Set),[O,A]=u.useState(new Set),R=u.useRef(0),P=u.useRef(null),j=u.useRef(new Set),N=u.useRef(new Map);function E(t){G(n=>{const o=typeof t=="function"?t(n):t;return j.current=o,o})}const[k,C]=u.useState(new Map),L=u.useRef(null),[b,S]=u.useState(null),{sendMessage:z}=cn(),{openSidePanel:_}=dn(),K=Bt(),[D,X]=u.useState(null),[J,ge]=u.useState(null),[ne,le]=u.useState(!1);async function re(t,n){const o=await fetch(Se(s,e,i,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const l=await o.json().catch(()=>({}));throw new Error(l.error??`Request failed (${o.status})`)}return o.json()}async function ce(){K.invalidateQueries({queryKey:Ke(s,e,i)})}function De(t,n){navigator.clipboard.writeText(n).then(()=>W.success(`${t} copied`),()=>W.error(`Failed to copy ${t.toLowerCase()}`))}function rt(t){const n=Dn(t);if(!n)return;const o=`${s}/${e}/${i}`;K.setQueryData($e.decofile(o),l=>{if(!l)return l;const{[n]:f,...v}=l;return v}),K.invalidateQueries({queryKey:$e.liveMeta(o)})}function ot(t){const n=t.kind==="file"?[t.path]:x.filter(o=>o.startsWith(".deco/blocks/")).map(o=>me(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)rt(o)}function it(t){const n=me(t);return V.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const l=k.get(o);return!!(l?.loaded&&l.editorValue!==l.savedContent)})}function Re(t){w(n=>n.map(o=>t(o)).filter(o=>o!==null)),h(n=>n&&t(n)),C(n=>{const o=new Map;for(const[l,f]of n){const v=t(l);v&&o.set(v,f)}return o}),B(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function st(t){const n=me(t);B(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Re(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function at(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);await re("write",{path:U(n),content:""}),await oe(),await ce(),X(null),ve(n)}async function lt(t){if(!D)return;const n=pe(D.parentDir,t);if(Ne(n,x,p))throw new Error(`"${t}" already exists`);const o=U(n);await re("mkdir",{path:o}),m(l=>({...l,directories:l.directories.includes(o)?l.directories:[...l.directories,o]})),await oe(),await ce(),X(null),M(l=>{const f=new Set(l);for(const v of we(n))f.add(v);return f.add(n),f}),B({name:t,path:n,kind:"directory",children:[]})}async function ct(t){if(!D)return;const n=D.node.path,o=je(n),l=pe(o,t);if(l===n){X(null);return}if(Ne(l,x,p))throw new Error(`"${t}" already exists`);await re("rename",{from:U(n),to:U(l)}),Re(f=>f===n?l:f.startsWith(`${n}/`)?pe(l,f.slice(n.length+1)):f),await oe(),await ce(),X(null)}async function dt(t){le(!0);try{await re("unlink",{path:U(t.path),recursive:t.kind==="directory"}),ot(t),st(t.path),await oe(),await ce(),ge(null),W.success(`Deleted "${t.name}"`)}catch(n){W.error(n instanceof Error?n.message:"Delete failed")}finally{le(!1)}}async function ut(t){const n=Mn(t);if(n){W.error(n);return}le(!0);try{D?.mode==="new-file"?(await at(t),W.success(`Created "${t}"`)):D?.mode==="new-folder"?(await lt(t),W.success(`Created folder "${t}"`)):D?.mode==="rename"&&(await ct(t),W.success(`Renamed to "${t}"`))}catch(o){W.error(o instanceof Error?o.message:"Operation failed")}finally{le(!1)}}const Pe=u.useRef(!1);Pe.current||(Pe.current=!0,P.current=oe());const[ft,mt]=u.useState(null);if(a&&a!==ft){mt(a);const t=a;queueMicrotask(()=>{ur(t)&&ve(t).catch(n=>{W.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ee(t){const n=await re("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function ke(t,n,o){if(o!==R.current)return!1;let l=!1;return m(f=>{const v=n?Rn(f.files,f.directories,t,f.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return l=!!v.truncated,{files:v.files,directories:v.directories,truncated:l}}),l&&W.warning("File list truncated — some files may be hidden"),l}async function pt(t){const n=N.current.get(t);if(n)return n;const o=R.current,l=(async()=>{const f=await Ee({pattern:"**/*",path:U(t),limit:Ue}),v=ke(f,!0,o);return!v&&o===R.current&&E(Y=>{const de=new Set(Y);return de.add(t),de}),v})();N.current.set(t,l);try{return await l}finally{N.current.delete(t)}}async function Te(t){if(!be(t,j.current))return!1;A(n=>new Set(n).add(t));try{return await pt(t)}finally{A(n=>{const o=new Set(n);return o.delete(t),o})}}async function xt(t){const n=new Set(j.current);for(const o of we(t)){if(!be(o,n))continue;if(await Te(o))throw new Error("Folder listing truncated — expand again to load more");n.add(o)}}async function oe(){const t=++R.current;N.current.clear(),Q(!0),E(new Set),M(new Set),A(new Set);try{const n=await Ee({pattern:"**/*",limit:Ue,maxDepth:Cn});ke(n,!1,t),T(!0)}catch{$&&W.error("Failed to refresh file tree")}finally{Q(!1)}}async function Oe(t){if(!k.get(t)?.loaded){C(o=>{const l=new Map(o);return l.set(t,{savedContent:"",editorValue:"",loaded:!1}),l});try{const o=await fetch(Se(s,e,i,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),full:!0})});if(!o.ok)return;const l=await o.json(),f=Sn(l.content??"");C(v=>{const Y=new Map(v);return Y.set(t,{savedContent:f,editorValue:f,loaded:!0}),Y})}catch{}}}async function ht(t,n){try{const o=await fetch(Se(s,e,i,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:U(t),content:n})});if(!o.ok){fe("file save failed",{path:t,status:o.status});return}fe("file saved via sandbox /write",{path:t}),K.invalidateQueries({queryKey:Ke(s,e,i)});try{const l=await un(s,e,i);fe("git status after save",l)}catch(l){fe("git status after save failed",{path:t,error:l instanceof Error?l.message:String(l)})}C(l=>{const f=new Map(l),v=f.get(t);return v&&f.set(t,{...v,savedContent:n}),f})}catch{}}function gt(t){h(t),B({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),S(null),V.includes(t)||w(n=>[...n,t]),Oe(t)}function vt(t){w(n=>{const o=n.filter(l=>l!==t);return d===t&&h(o[o.length-1]??null),o}),C(n=>{const o=new Map(n);return o.delete(t),o})}function Ae(t){M(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function yt(t){if(be(t,j.current))try{if(await Te(t))return}catch(n){W.error(n instanceof Error?n.message:"Failed to load folder");return}Ae(t)}async function wt(t,n){if(n){Ae(t);return}await yt(t)}async function ve(t){await P.current,await xt(t);const n=we(t);M(o=>{const l=new Set(o);for(const f of n)l.add(f);return l}),gt(t)}function Ct(){return y?.kind==="directory"?y.path:y?.kind==="file"?je(y.path):d?je(d):"/"}function Le(t){const n=Ct();X({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const bt=bn(x,p),Fe=jn(bt,g),Ie=I?Fe.filter(t=>t.node.name.toLowerCase().includes(I.toLowerCase())):Fe,ee=d?k.get(d):null,jt=ee?.loaded&&ee.editorValue!==ee.savedContent,ye=J?it(J.path):[],Nt=(t,n)=>{L.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!d)return;const o=t.getValue();await ht(d,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),l=t.getModel();if(!o||!l||!d)return;const f=l.getValueInRange(o);S({filePath:d,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:f})})};function St(t){if(!b)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${b.filePath}\``,`**Lines:** ${b.lineStart}–${b.lineEnd}`];if(b.selectedCode){const o=Ce(b.filePath),l=b.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,l,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),_("chat"),z({parts:[{type:"text",text:n.join(`
2
- `)}]}),S(null)}return q&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(qt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:I,onChange:t=>H(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"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:r.jsx(Qt,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New file"})]}),r.jsxs(ze,{children:[r.jsx(We,{asChild:!0,children:r.jsx(he,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:r.jsx(Ht,{size:14})})}),r.jsx(Ge,{side:"bottom",children:"New folder"})]})]}),r.jsx(Zt,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[Ie.map(t=>{const{node:n,depth:o}=t,l=n.kind==="directory",f=g.has(n.path),v=y?.path===n.path,Y=Nn(n.path,n.kind),de=l&&O.has(n.path);return r.jsx(dr,{node:n,depth:o,isExpanded:f,isSelected:v,isLoading:de,fileVisual:mr(n.name),onSelect:()=>B(n),onOpen:()=>{l?wt(n.path,f):ve(n.path)},onNewFile:()=>X({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>X({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>De("Path",me(n.path)),onCopyRelativePath:()=>De("Relative path",U(n.path)),onRename:()=>X({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ge(n)},n.path)}),$&&Ie.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:I?`No files match "${I}"`:"No files found"})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[V.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:V.map(t=>{const n=k.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,l=d===t,f=t.split("/").pop()??t;return r.jsxs("div",{className:ae("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",l?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{h(t),Oe(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":l,children:[r.jsx("span",{className:"truncate max-w-32",children:f}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),vt(t)},children:r.jsx(Yt,{size:12})})]},t)})}),b&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.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 o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&St(o.value)},children:[r.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"&&S(null)}}),r.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:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:"Send"}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:d&&ee?.loaded?r.jsx(Ut,{language:Ce(d),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ee.editorValue,path:d,onChange:t=>{const n=d;n&&C(o=>{const l=new Map(o),f=l.get(n);return f&&l.set(n,{...f,editorValue:t??""}),l})},onMount:Nt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{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}}},d):d&&!ee?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(se,{size:20,className:"animate-spin text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),d&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:d}),r.jsxs("span",{children:[jt?"Modified":"Saved"," ·"," ",Ce(d)]})]})]}),r.jsx(En,{open:D!==null,mode:D?.mode??"new-file",initialName:D?.mode==="rename"?D.node.name:"",parentLabel:D&&D.mode!=="rename"?D.parentDir==="/"?"/":U(D.parentDir):void 0,isPending:ne,onSubmit:ut,onOpenChange:t=>{!t&&!ne&&X(null)}}),r.jsx(en,{open:J!==null,onOpenChange:t=>{!t&&!ne&&ge(null)},children:r.jsxs(tn,{children:[r.jsxs(nn,{children:[r.jsxs(rn,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),r.jsxs(on,{children:["This will permanently delete"," ",r.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",ye.length>0&&r.jsxs(r.Fragment,{children:[" ",ye.length===1?"One open file has unsaved changes that will be lost.":`${ye.length} open files have unsaved changes that will be lost.`]})]})]}),r.jsxs(sn,{children:[r.jsx(an,{disabled:ne,children:"Cancel"}),r.jsx(ln,{disabled:ne||!J,onClick:t=>{t.preventDefault(),J&&dt(J)},children:"Delete"})]})]})})]})}export{os as FileExplorer};
@@ -1 +0,0 @@
1
- import{bw as _}from"./index-DSn_1D7b.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const M=_(g);export{M as R,g as r};