@decocms/mesh 2.133.1 → 2.134.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 (196) hide show
  1. package/dist/client/assets/{AlertCircle-C_-Exi_n.js → AlertCircle-dxGFeayp.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-DU7XXs04.js → AlignLeft-zf4ygcA_.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-Ci69NI9T.js → ArrowDown-BfANN175.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-DiQ6H1qe.js → ArrowLeft-DKmEJ5pf.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-YaPl1lq-.js → ArrowUp-BNm6R5tp.js} +1 -1
  6. package/dist/client/assets/{Check-AlxQ-j2G.js → Check-BuBqfL8V.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BQbEhLAd.js → CheckCircle-B-t884rD.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-CnA5MJ5u.js → CheckDone01-C_N43WOE.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-9ppFNPbL.js → CheckVerified02-CF--qrDr.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-Bt1ewsqh.js → ChevronDown-D15Vpp0r.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-ZjYcxOdo.js → ChevronLeft-CJX984rp.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-sqD7LMFa.js → ChevronRight-u7jqeZNG.js} +1 -1
  13. package/dist/client/assets/{Clock-CGeVATg-.js → Clock-B88-VhpY.js} +1 -1
  14. package/dist/client/assets/{Code01-X9LTEq8d.js → Code01-DhSY1b20.js} +1 -1
  15. package/dist/client/assets/{Container-Dt3fts2O.js → Container-CFxptFeR.js} +1 -1
  16. package/dist/client/assets/{Copy01-yMwUMo5Y.js → Copy01-D2l3XUry.js} +1 -1
  17. package/dist/client/assets/{Dataflow03-GEBPM69Y.js → Dataflow03-TMmWfgl9.js} +1 -1
  18. package/dist/client/assets/{DotsHorizontal-rnia2dDb.js → DotsHorizontal-CZq86zFa.js} +1 -1
  19. package/dist/client/assets/{DotsVertical-DxigKHHt.js → DotsVertical-B78gtBdB.js} +1 -1
  20. package/dist/client/assets/{Download01-axlmJqAw.js → Download01-DDJLkXru.js} +1 -1
  21. package/dist/client/assets/{Edit01-Cg13Y9IR.js → Edit01-CbZPkCJz.js} +1 -1
  22. package/dist/client/assets/{Eye-D5VDCdLP.js → Eye-vR70tVFn.js} +1 -1
  23. package/dist/client/assets/{File02-DasnEozT.js → File02-B1NunE2J.js} +1 -1
  24. package/dist/client/assets/{File06-B5xn-On2.js → File06-D8w_IYOr.js} +1 -1
  25. package/dist/client/assets/{FilterLines-7rCsQUMC.js → FilterLines-BY-bo6_s.js} +1 -1
  26. package/dist/client/assets/{Globe01-DghE3nSS.js → Globe01-CL7GrOsx.js} +1 -1
  27. package/dist/client/assets/{Globe02-DsDY7_VG.js → Globe02-6j3SB4QZ.js} +1 -1
  28. package/dist/client/assets/{Grid01-C3osH3dx.js → Grid01-DjcW2Js4.js} +1 -1
  29. package/dist/client/assets/{Hash02-D2cqLEQA.js → Hash02-BMwtcDtI.js} +1 -1
  30. package/dist/client/assets/{Home02-BwxX5zad.js → Home02-CMWrNstp.js} +1 -1
  31. package/dist/client/assets/{Image01-Dk65YqxA.js → Image01-oZtE9Z5q.js} +1 -1
  32. package/dist/client/assets/{Inbox01-kmB3TeMO.js → Inbox01-xF_R8liT.js} +1 -1
  33. package/dist/client/assets/{InfoCircle-C0U8p7zQ.js → InfoCircle-B_WtF_e0.js} +1 -1
  34. package/dist/client/assets/{Key01-CqhHrRJL.js → Key01-Cvjt_ykt.js} +1 -1
  35. package/dist/client/assets/{LayersTwo01-BFhpnCtq.js → LayersTwo01-f778oNbj.js} +1 -1
  36. package/dist/client/assets/{LayoutLeft-CW10Mj8C.js → LayoutLeft-BXJHafgx.js} +1 -1
  37. package/dist/client/assets/{LinkExternal01-DdPfa8wq.js → LinkExternal01-DY3cItdE.js} +1 -1
  38. package/dist/client/assets/{List-iHNJ390y.js → List-Be3XBHwN.js} +1 -1
  39. package/dist/client/assets/{Loading01-SjZGs3Wk.js → Loading01-BLoQsWVt.js} +1 -1
  40. package/dist/client/assets/{Lock01-CryAxM1F.js → Lock01-Cj3RiFKG.js} +1 -1
  41. package/dist/client/assets/{Play-CKKDGI7M.js → Play-CCz3CWMJ.js} +1 -1
  42. package/dist/client/assets/{Plus-DXYydVCi.js → Plus-4zX3n4bH.js} +1 -1
  43. package/dist/client/assets/{RefreshCcw01-DT9wSPl_.js → RefreshCcw01-DzE0Vt_s.js} +1 -1
  44. package/dist/client/assets/{Save01-w3vLU2XF.js → Save01-DiUMsefH.js} +1 -1
  45. package/dist/client/assets/{SearchMd-CSKcblxx.js → SearchMd-BvHN4xgB.js} +1 -1
  46. package/dist/client/assets/{Settings01-Dkx2ZoN9.js → Settings01-B5kunEo2.js} +1 -1
  47. package/dist/client/assets/{Shield01-BqITe6MU.js → Shield01-DrTQ94s0.js} +1 -1
  48. package/dist/client/assets/{Terminal-B4v75vOD.js → Terminal-DQnj9LXz.js} +1 -1
  49. package/dist/client/assets/{Trash01-CDDpTvNv.js → Trash01-BvIumE4M.js} +1 -1
  50. package/dist/client/assets/{Upload01-DAiUnxPv.js → Upload01-DLPOqCLa.js} +1 -1
  51. package/dist/client/assets/{Users03-BXHamAas.js → Users03-CUxh9_Jy.js} +1 -1
  52. package/dist/client/assets/{X-BHBlYu74.js → X-CpsrVd7E.js} +1 -1
  53. package/dist/client/assets/{XCircle-Bm1DtLmf.js → XCircle-BcvU_Xzf.js} +1 -1
  54. package/dist/client/assets/{XClose-B0OIa3qG.js → XClose-CnTCpAeI.js} +1 -1
  55. package/dist/client/assets/{Zap-DYif66ZC.js → Zap-BACXfgKn.js} +1 -1
  56. package/dist/client/assets/{agent-connections-preview-131FyINm.js → agent-connections-preview-BTescy5G.js} +1 -1
  57. package/dist/client/assets/{agent-detail-BQD2V8eu.js → agent-detail-C9_VIiuY.js} +1 -1
  58. package/dist/client/assets/{agents-BChxlMJi.js → agents-DkUxuyJc.js} +1 -1
  59. package/dist/client/assets/{alert-dialog-DRnSCcWl.js → alert-dialog-B0yEBEkb.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-qZjolz1d.js → auth-catchall-CZYx2ePL.js} +1 -1
  61. package/dist/client/assets/{avatar-BsFgSPZd.js → avatar-BeiX4aSz.js} +1 -1
  62. package/dist/client/assets/{badge-BZU2aZ4g.js → badge-UPowR1Nj.js} +1 -1
  63. package/dist/client/assets/{binder-CXy7pGaI.js → binder-DUACCYIe.js} +1 -1
  64. package/dist/client/assets/{breadcrumb-CkhUU1qO.js → breadcrumb-DxXcAXh7.js} +1 -1
  65. package/dist/client/assets/{card-BiGYvdPr.js → card-BRjix5ol.js} +1 -1
  66. package/dist/client/assets/{chart-x30PoZrw.js → chart-FIHtzVp6.js} +1 -1
  67. package/dist/client/assets/{checkbox-DaiL5KlM.js → checkbox-Df-Mj-oX.js} +1 -1
  68. package/dist/client/assets/{circle-alert-D5aKQND0.js → circle-alert-CHATLFG-.js} +1 -1
  69. package/dist/client/assets/collapsible-CG7okAAn.js +23 -0
  70. package/dist/client/assets/{collection-detail-Bder-uOv.js → collection-detail-DnFoqwX5.js} +1 -1
  71. package/dist/client/assets/{collection-search-Bkt-jVWx.js → collection-search-BgstpGbD.js} +1 -1
  72. package/dist/client/assets/{collection-tab-DILgyiiN.js → collection-tab-CkymCS_K.js} +1 -1
  73. package/dist/client/assets/{collection-table-wrapper-c85b97QJ.js → collection-table-wrapper-B7II4YYC.js} +1 -1
  74. package/dist/client/assets/{collection-tabs-ywHh3L-3.js → collection-tabs-nglpt7Dm.js} +1 -1
  75. package/dist/client/assets/{command-BLXAYQCa.js → command-BvChE5AN.js} +1 -1
  76. package/dist/client/assets/{connect-BJqi59zN.js → connect-C_zUgms_.js} +1 -1
  77. package/dist/client/assets/{connection-card-CRg7yGx3.js → connection-card-DE2PfyYV.js} +1 -1
  78. package/dist/client/assets/{connection-detail-D1-5uzSn.js → connection-detail-CIlY792n.js} +1 -1
  79. package/dist/client/assets/{connections-D1tXy5Nn.js → connections-e6eEADmb.js} +1 -1
  80. package/dist/client/assets/{constants-2Gp-yGJ1.js → constants--aQ9HnxF.js} +1 -1
  81. package/dist/client/assets/constants-DoLvwboP.js +1 -0
  82. package/dist/client/assets/{create-organization-dialog-CtQ-v5j4.js → create-organization-dialog-BW4s7GqS.js} +1 -1
  83. package/dist/client/assets/{create-project-dialog-DpFucZww.js → create-project-dialog-BMiLf2Mr.js} +1 -1
  84. package/dist/client/assets/{danger-CHhKecE7.js → danger-BAlOLeDE.js} +1 -1
  85. package/dist/client/assets/{danger-zone-B1ksqQ3N.js → danger-zone-PDtJsuS3.js} +1 -1
  86. package/dist/client/assets/{decopilot-events-DlkvGkzj.js → decopilot-events-DZodCqX1.js} +1 -1
  87. package/dist/client/assets/{dependencies-DO7dUDR7.js → dependencies-DOcreK8_.js} +1 -1
  88. package/dist/client/assets/{dialog-BeE7uUPn.js → dialog-CrYlSCa6.js} +1 -1
  89. package/dist/client/assets/{dropdown-menu-B0Dgts11.js → dropdown-menu-DvfBJ25L.js} +1 -1
  90. package/dist/client/assets/{dynamic-plugin-layout-ChmoTPch.js → dynamic-plugin-layout-1UBvkRf8.js} +1 -1
  91. package/dist/client/assets/{editable-task-title--9hhF-R6.js → editable-task-title-emHsd6RF.js} +1 -1
  92. package/dist/client/assets/{empty-state-DE4SQU5S.js → empty-state-C2LU6BeW.js} +1 -1
  93. package/dist/client/assets/{env-vars-editor-CBMsqTh6.js → env-vars-editor-DM7ragIP.js} +1 -1
  94. package/dist/client/assets/{extract-connection-data-0trSaHAT.js → extract-connection-data-DtOGbK2O.js} +1 -1
  95. package/dist/client/assets/{file-browser-0DYVKNPK.js → file-browser-dzB3GMud.js} +2 -2
  96. package/dist/client/assets/{form-DNs_mLgF.js → form-DKOb9Dxi.js} +1 -1
  97. package/dist/client/assets/{general-CC_F5c1Q.js → general-C8KCERL-.js} +1 -1
  98. package/dist/client/assets/{grid-view-Y6fAVOxf.js → grid-view-Dp6SbR5A.js} +1 -1
  99. package/dist/client/assets/{home-DXg-PZRS.js → home-DpLONLMM.js} +1 -1
  100. package/dist/client/assets/{index-BMtw0aq_.js → index-B4YFEuZr.js} +1 -1
  101. package/dist/client/assets/{index-DTgZok4N.js → index-BkxNgQ-z.js} +3 -3
  102. package/dist/client/assets/{index-C6fMaWPS.js → index-Bq_4mEQF.js} +1 -1
  103. package/dist/client/assets/{index-eYcb2Cm9.js → index-CKt9M-ST.js} +1 -1
  104. package/dist/client/assets/{index--9MdKIVD.js → index-CuJORTyw.js} +1 -1
  105. package/dist/client/assets/{index-DqmnWcee.js → index-UbMd2WCz.js} +1 -1
  106. package/dist/client/assets/{index-C_SwSaaG.js → index-ZJA9ZP0w.js} +1 -1
  107. package/dist/client/assets/{index-BG6VshDR.js → index-dKQNml8k.js} +1 -1
  108. package/dist/client/assets/{index-Gr3qtElA.js → index-u5kBBr5i.js} +1 -1
  109. package/dist/client/assets/{infiniteQueryObserver-Dy7IOO2y.js → infiniteQueryObserver-DFroUYRE.js} +1 -1
  110. package/dist/client/assets/{input-CjsuYubG.js → input-BxWPl4Ur.js} +1 -1
  111. package/dist/client/assets/{integration-icon-BqSOA-1d.js → integration-icon-DqBJsR0X.js} +1 -1
  112. package/dist/client/assets/{label-ND6ncjGS.js → label-DQ6CQRMq.js} +1 -1
  113. package/dist/client/assets/{layout-CKzU3ZCb.js → layout-0mFUwCP9.js} +1 -1
  114. package/dist/client/assets/{layout-K29HidGl.js → layout-rnNZXdmD.js} +1 -1
  115. package/dist/client/assets/{localstorage-keys-Cenhbz-P.js → localstorage-keys-2beZrYfY.js} +1 -1
  116. package/dist/client/assets/{login-oxVPXFpk.js → login-DcPWsiJb.js} +1 -1
  117. package/dist/client/assets/{markdown-DI_NQ3zj.js → markdown-08iefd1w.js} +1 -1
  118. package/dist/client/assets/{mcp-app-renderer-D2qbe9d6.js → mcp-app-renderer-DlqJcoS_.js} +1 -1
  119. package/dist/client/assets/{mcp-oauth-BGy49NaP.js → mcp-oauth-hrdldmcp.js} +1 -1
  120. package/dist/client/assets/{mcp-server-card-Dn8mS4B0.js → mcp-server-card-DopVvusq.js} +1 -1
  121. package/dist/client/assets/{mcp-server-detail-BJrSdPXE.js → mcp-server-detail-6bJ8ASSa.js} +2 -2
  122. package/dist/client/assets/{members-DZd5xLHT.js → members-Do6CpQ6P.js} +1 -1
  123. package/dist/client/assets/{monitoring-DpcldHRD.js → monitoring-CKBrV8zM.js} +1 -1
  124. package/dist/client/assets/{monitoring-dashboard-edit-Dua9qsND.js → monitoring-dashboard-edit-CisDX-AH.js} +1 -1
  125. package/dist/client/assets/{monitoring-dashboard-view-X9A7Dt7e.js → monitoring-dashboard-view-CLglwuRf.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-CsqoN40N.js → oauth-callback-EWqhoS77.js} +1 -1
  127. package/dist/client/assets/{page-CLamcNIQ.js → page-BIGqii57.js} +1 -1
  128. package/dist/client/assets/{page-Cx3Xt8ip.js → page-CrIdFE4e.js} +1 -1
  129. package/dist/client/assets/{plugin-empty-state-BV6g5sMv.js → plugin-empty-state-AsJFZqlq.js} +1 -1
  130. package/dist/client/assets/{plugin-empty-state-Df_tIhim.js → plugin-empty-state-DgfbXovL.js} +1 -1
  131. package/dist/client/assets/{plugin-header-CsoLpSwS.js → plugin-header-CdB0sXQc.js} +1 -1
  132. package/dist/client/assets/{plugin-header-ClbYQgeN.js → plugin-header-DMTu3kKy.js} +1 -1
  133. package/dist/client/assets/plugins-AJrV2JnY.js +1 -0
  134. package/dist/client/assets/{popover-C2X8YaiC.js → popover-CJnKtmVV.js} +1 -1
  135. package/dist/client/assets/{project-app-view-CkhQ-sFM.js → project-app-view-CrOJlRSX.js} +1 -1
  136. package/dist/client/assets/{project-layout-DcmZkb79.js → project-layout-CxbfzuHT.js} +1 -1
  137. package/dist/client/assets/{project-plugins-BxtIWCHr.js → project-plugins-OrxVzBYc.js} +1 -1
  138. package/dist/client/assets/{projects-list-B9ZNjsmc.js → projects-list-CaeO-dsb.js} +1 -1
  139. package/dist/client/assets/purify.es-C0_7NiBM.js +2 -0
  140. package/dist/client/assets/{readme-viewer-DQ57Paqf.js → readme-viewer-CvFtkeFt.js} +1 -1
  141. package/dist/client/assets/{registry-layout-BOuKDda5.js → registry-layout-C_lUsUO4.js} +1 -1
  142. package/dist/client/assets/{registry-utils-BFXjOPvi.js → registry-utils-Bm8aYhvn.js} +1 -1
  143. package/dist/client/assets/{reports-layout-_5crmBff.js → reports-layout-COQgk5-M.js} +1 -1
  144. package/dist/client/assets/{reset-password-Qo3jQxbB.js → reset-password-BHTKtR6U.js} +1 -1
  145. package/dist/client/assets/{resizable-BotMD0Ea.js → resizable-DNctE6m6.js} +1 -1
  146. package/dist/client/assets/{save-actions-BGfSClkF.js → save-actions-DgW9lLRI.js} +1 -1
  147. package/dist/client/assets/{scroll-area-CiqOJ4_4.js → scroll-area-Ce3JzMbc.js} +1 -1
  148. package/dist/client/assets/{select-CwGh16En.js → select-CHQkyynJ.js} +1 -1
  149. package/dist/client/assets/{shell-layout-DOy4fAYb.js → shell-layout-CZrDFZIJ.js} +2 -2
  150. package/dist/client/assets/{sidebar-settings-Ctg4uu33.js → sidebar-settings-C8pM5SP-.js} +1 -1
  151. package/dist/client/assets/{skeleton-DZ7Qc_fE.js → skeleton-Bla1LCSZ.js} +1 -1
  152. package/dist/client/assets/{spinner-CF1sqMoC.js → spinner-B_k6AtHn.js} +1 -1
  153. package/dist/client/assets/{store-invite-BbaXHihy.js → store-invite-CVXBjHsb.js} +1 -1
  154. package/dist/client/assets/{switch-BO1AHmQl.js → switch-BX7m8ylT.js} +1 -1
  155. package/dist/client/assets/{table-CZRzSdcB.js → table-BJ3W5Geb.js} +1 -1
  156. package/dist/client/assets/{tabs-DkvkxCCI.js → tabs-tcquyh90.js} +1 -1
  157. package/dist/client/assets/tasks-CJro_3w3.js +1 -0
  158. package/dist/client/assets/{tasks-panel-Bl5BMQl6.js → tasks-panel-CIityBOn.js} +1 -1
  159. package/dist/client/assets/{textarea-Cp-ThsnH.js → textarea-CceQB-N2.js} +1 -1
  160. package/dist/client/assets/{time-range-picker-CXsB0sBK.js → time-range-picker-B9lHM6xz.js} +1 -1
  161. package/dist/client/assets/{toggle-group-CIpiKQbG.js → toggle-group-KbsXFu3M.js} +1 -1
  162. package/dist/client/assets/{tools-list-BYhjzTws.js → tools-list-Cb9H3DsC.js} +1 -1
  163. package/dist/client/assets/{tooltip-B2vpv_WH.js → tooltip-DvMRS01W.js} +1 -1
  164. package/dist/client/assets/{topbar-portal-Dy36ZPgB.js → topbar-portal-CyxFPAeb.js} +1 -1
  165. package/dist/client/assets/{types-DeMEWRHV.js → types-9lUbCnT7.js} +1 -1
  166. package/dist/client/assets/{use-binding-CXeaDqWF.js → use-binding-CVLYzFG-.js} +1 -1
  167. package/dist/client/assets/{use-connection-Du5eRm0t.js → use-connection-DjiXkPUz.js} +1 -1
  168. package/dist/client/assets/{use-copy-5Xu6yo2D.js → use-copy-DiVO6tbG.js} +1 -1
  169. package/dist/client/assets/{use-create-virtual-mcp-EqzJGE7y.js → use-create-virtual-mcp-DnOGpm5h.js} +1 -1
  170. package/dist/client/assets/{use-install-from-registry-D98zOCZs.js → use-install-from-registry-kgqBLGhb.js} +1 -1
  171. package/dist/client/assets/{use-list-state-Dxk-n9cc.js → use-list-state-CCFlT7yz.js} +1 -1
  172. package/dist/client/assets/{use-llm-B4rO8f2r.js → use-llm-Bkjj502R.js} +1 -1
  173. package/dist/client/assets/{use-mcp-resources-Bf8HKw75.js → use-mcp-resources-DS8p1Owh.js} +1 -1
  174. package/dist/client/assets/{use-mcp-tools-v3YYc4L1.js → use-mcp-tools-CHOGR3no.js} +1 -1
  175. package/dist/client/assets/{use-members-D4kqyRbv.js → use-members-94lmhn12.js} +1 -1
  176. package/dist/client/assets/{use-mobile-II1SQS1g.js → use-mobile-BArkW6j1.js} +1 -1
  177. package/dist/client/assets/{use-project-DEgKISl8.js → use-project-BRlk9_cU.js} +1 -1
  178. package/dist/client/assets/{use-settings-modal-BJVHprSk.js → use-settings-modal-QjZt77PI.js} +1 -1
  179. package/dist/client/assets/{use-view-mode-D38VMwz6.js → use-view-mode-3_G2qIMG.js} +1 -1
  180. package/dist/client/assets/{use-virtual-mcp-CS7dIIbK.js → use-virtual-mcp-Wj5StsuR.js} +1 -1
  181. package/dist/client/assets/useInfiniteQuery-cPtxg-KP.js +1 -0
  182. package/dist/client/assets/{useMutation-B99hCaMl.js → useMutation-DtOoZO7h.js} +1 -1
  183. package/dist/client/assets/useQuery-Cj-miqA2.js +1 -0
  184. package/dist/client/assets/useSuspenseInfiniteQuery-D62VIKAF.js +1 -0
  185. package/dist/client/assets/{user-BncBYJfn.js → user-BcEL6pjj.js} +1 -1
  186. package/dist/client/assets/{workflow-DS5DwWhu.js → workflow-Bdyylvch.js} +1 -1
  187. package/dist/client/index.html +1 -1
  188. package/package.json +1 -1
  189. package/dist/client/assets/collapsible-Bqyw5z5a.js +0 -23
  190. package/dist/client/assets/constants-DTNMmCfY.js +0 -1
  191. package/dist/client/assets/plugins-BA5p5lXm.js +0 -1
  192. package/dist/client/assets/purify.es-Bzr520pe.js +0 -2
  193. package/dist/client/assets/tasks-BSVHqtcQ.js +0 -1
  194. package/dist/client/assets/useInfiniteQuery-DvriYWG_.js +0 -1
  195. package/dist/client/assets/useQuery-C-DbMOQt.js +0 -1
  196. package/dist/client/assets/useSuspenseInfiniteQuery-CX_HgzHm.js +0 -1
@@ -1 +1 @@
1
- import{c as y,m as p}from"./index-DTgZok4N.js";import{u as q}from"./useQuery-C-DbMOQt.js";import{u as C}from"./useMutation-B99hCaMl.js";import{K as T}from"./constants-2Gp-yGJ1.js";function w(r){const e=y.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],p(n)}function F(r){const e=y.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],q(n)}function P(r){const e=y.c(21);let t,s,l,o;e[0]!==r?({client:t,toolName:o,toolArguments:l,...s}=r,e[0]=r,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const m=JSON.stringify(l??{});u=p,i=s,n=T.mcpToolCall(t,o,m),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==o?(a=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=a):a=e[15];const f=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==a||e[19]!==f?(c={...i,queryKey:n,queryFn:a,staleTime:f,retry:!1},e[16]=i,e[17]=n,e[18]=a,e[19]=f,e[20]=c):c=e[20],u(c)}function $(r){const e=y.c(21);let t,s,l,o;e[0]!==r?({client:t,toolName:o,toolArguments:l,...s}=r,e[0]=r,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const m=JSON.stringify(l??{});u=q,i=s,n=T.mcpToolCall(t,o,m),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==o?(a=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=a):a=e[15];const f=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==a||e[19]!==f?(c={...i,queryKey:n,queryFn:a,staleTime:f,retry:!1},e[16]=i,e[17]=n,e[18]=a,e[19]=f,e[20]=c):c=e[20],u(c)}function L(r){const e=y.c(8);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=async i=>await t.callTool(i),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==l?(o={...s,mutationFn:l},e[5]=s,e[6]=l,e[7]=o):o=e[7],C(o)}export{L as a,$ as b,w as c,F as d,P as u};
1
+ import{c as y,m as p}from"./index-BkxNgQ-z.js";import{u as q}from"./useQuery-Cj-miqA2.js";import{u as C}from"./useMutation-DtOoZO7h.js";import{K as T}from"./constants--aQ9HnxF.js";function w(r){const e=y.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],p(n)}function F(r){const e=y.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=T.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let o;e[5]!==t?(o=async()=>await t.listTools(),e[5]=t,e[6]=o):o=e[6];const i=s.staleTime??3e4;let n;return e[7]!==s||e[8]!==l||e[9]!==o||e[10]!==i?(n={...s,queryKey:l,queryFn:o,staleTime:i,retry:!1},e[7]=s,e[8]=l,e[9]=o,e[10]=i,e[11]=n):n=e[11],q(n)}function P(r){const e=y.c(21);let t,s,l,o;e[0]!==r?({client:t,toolName:o,toolArguments:l,...s}=r,e[0]=r,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const m=JSON.stringify(l??{});u=p,i=s,n=T.mcpToolCall(t,o,m),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==o?(a=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=a):a=e[15];const f=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==a||e[19]!==f?(c={...i,queryKey:n,queryFn:a,staleTime:f,retry:!1},e[16]=i,e[17]=n,e[18]=a,e[19]=f,e[20]=c):c=e[20],u(c)}function $(r){const e=y.c(21);let t,s,l,o;e[0]!==r?({client:t,toolName:o,toolArguments:l,...s}=r,e[0]=r,e[1]=t,e[2]=s,e[3]=l,e[4]=o):(t=e[1],s=e[2],l=e[3],o=e[4]);let i,n,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==o){const m=JSON.stringify(l??{});u=q,i=s,n=T.mcpToolCall(t,o,m),e[5]=t,e[6]=s,e[7]=l,e[8]=o,e[9]=i,e[10]=n,e[11]=u}else i=e[9],n=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==o?(a=async()=>await t.callTool({name:o,arguments:l}),e[12]=t,e[13]=l,e[14]=o,e[15]=a):a=e[15];const f=s.staleTime??3e4;let c;return e[16]!==i||e[17]!==n||e[18]!==a||e[19]!==f?(c={...i,queryKey:n,queryFn:a,staleTime:f,retry:!1},e[16]=i,e[17]=n,e[18]=a,e[19]=f,e[20]=c):c=e[20],u(c)}function L(r){const e=y.c(8);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=async i=>await t.callTool(i),e[3]=t,e[4]=l):l=e[4];let o;return e[5]!==s||e[6]!==l?(o={...s,mutationFn:l},e[5]=s,e[6]=l,e[7]=o):o=e[7],C(o)}export{L as a,$ as b,w as c,F as d,P as u};
@@ -1 +1 @@
1
- import{c as n,u as o,m as u,K as i,d as a}from"./index-DTgZok4N.js";function l(){const e=n.c(4),{locator:r}=o();let t;e[0]!==r?(t=i.members(r),e[0]=r,e[1]=t):t=e[1];let s;return e[2]!==t?(s={queryKey:t,queryFn:m},e[2]=t,e[3]=s):s=e[3],u(s)}function m(){return a.organization.listMembers()}export{l as u};
1
+ import{c as n,u as o,m as u,K as i,d as a}from"./index-BkxNgQ-z.js";function l(){const e=n.c(4),{locator:r}=o();let t;e[0]!==r?(t=i.members(r),e[0]=r,e[1]=t):t=e[1];let s;return e[2]!==t?(s={queryKey:t,queryFn:m},e[2]=t,e[3]=s):s=e[3],u(s)}function m(){return a.organization.listMembers()}export{l as u};
@@ -1 +1 @@
1
- import{c as m,r}from"./index-DTgZok4N.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
1
+ import{c as m,r}from"./index-BkxNgQ-z.js";const a=768,o=()=>globalThis.innerWidth<a;function u(){const e=m.c(2),[l,n]=r.useState(o);let t,s;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{const i=()=>n(o),c=globalThis.matchMedia(`(max-width: ${a-1}px)`);return c.addEventListener("change",i),n(o),()=>c.removeEventListener("change",i)},s=[],e[0]=t,e[1]=s):(t=e[0],s=e[1]),r.useEffect(t,s),l}export{u};
@@ -1 +1 @@
1
- import{K as m,c as C,m as T}from"./index-DTgZok4N.js";import{u as y}from"./useQuery-C-DbMOQt.js";import{u as f,a}from"./constants-2Gp-yGJ1.js";function S(t,s){const e=C.c(13);let r;e[0]!==t?(r={connectionId:a,orgId:t},e[0]=t,e[1]=r):r=e[1];const l=f(r);let u;e[2]!==t||e[3]!==s?(u=m.project(t,s),e[2]=t,e[3]=s,e[4]=u):u=e[4];let c;e[5]!==l||e[6]!==t||e[7]!==s?(c=async()=>{const p=await l.callTool({name:"PROJECT_GET",arguments:{organizationId:t,slug:s}});return(p.structuredContent??p).project},e[5]=l,e[6]=t,e[7]=s,e[8]=c):c=e[8];const o=!!t&&!!s;let n;return e[9]!==u||e[10]!==c||e[11]!==o?(n={queryKey:u,queryFn:c,enabled:o,staleTime:3e4},e[9]=u,e[10]=c,e[11]=o,e[12]=n):n=e[12],y(n)}function _(t,s){const e=f({connectionId:a,orgId:t}),r={queryKey:m.projects(t),queryFn:async()=>{const l=await e.callTool({name:"PROJECT_LIST",arguments:{organizationId:t}});return(l.structuredContent??l).projects.map(c=>({...c,organizationId:t}))},staleTime:3e4};return s?.suspense?T(r):y({...r,enabled:!!t})}export{_ as a,S as u};
1
+ import{K as m,c as C,m as T}from"./index-BkxNgQ-z.js";import{u as y}from"./useQuery-Cj-miqA2.js";import{u as f,a}from"./constants--aQ9HnxF.js";function S(t,s){const e=C.c(13);let r;e[0]!==t?(r={connectionId:a,orgId:t},e[0]=t,e[1]=r):r=e[1];const l=f(r);let u;e[2]!==t||e[3]!==s?(u=m.project(t,s),e[2]=t,e[3]=s,e[4]=u):u=e[4];let c;e[5]!==l||e[6]!==t||e[7]!==s?(c=async()=>{const p=await l.callTool({name:"PROJECT_GET",arguments:{organizationId:t,slug:s}});return(p.structuredContent??p).project},e[5]=l,e[6]=t,e[7]=s,e[8]=c):c=e[8];const o=!!t&&!!s;let n;return e[9]!==u||e[10]!==c||e[11]!==o?(n={queryKey:u,queryFn:c,enabled:o,staleTime:3e4},e[9]=u,e[10]=c,e[11]=o,e[12]=n):n=e[12],y(n)}function _(t,s){const e=f({connectionId:a,orgId:t}),r={queryKey:m.projects(t),queryFn:async()=>{const l=await e.callTool({name:"PROJECT_LIST",arguments:{organizationId:t}});return(l.structuredContent??l).projects.map(c=>({...c,organizationId:t}))},staleTime:3e4};return s?.suspense?T(r):y({...r,enabled:!!t})}export{_ as a,S as u};
@@ -1 +1 @@
1
- import{r as g,c as v,b as C,a as k,e as E}from"./index-DTgZok4N.js";const x=({size:e=24,color:t="currentColor",...s})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},g.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));x.displayName="Building02";const M=({size:e=24,color:t="currentColor",...s})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},g.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));M.displayName="Coins01";const j=new Set(["account.profile","account.preferences","account.experimental","org.general","org.plugins","org.billing"]);function w(e){return e?j.has(e):!1}function _(){const e=v.c(17),t=C();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const r=k(s);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[1]=i):i=e[1];const{org:o,project:n}=E(i);let c;e[2]!==r.settings?(c=w(r.settings)?r.settings:void 0,e[2]=r.settings,e[3]=c):c=e[3];const m=c,p=!!m;let a;e[4]!==t||e[5]!==o||e[6]!==n?(a=S=>{!o||!n||t({to:"/$org/$project",params:{org:o,project:n},search:{settings:S}})},e[4]=t,e[5]=o,e[6]=n,e[7]=a):a=e[7];const f=a;let l;e[8]!==t||e[9]!==o||e[10]!==n?(l=()=>{!o||!n||t({to:"/$org/$project",params:{org:o,project:n},search:{}})},e[8]=t,e[9]=o,e[10]=n,e[11]=l):l=e[11];const h=l,d=m??"account.preferences";let u;return e[12]!==h||e[13]!==p||e[14]!==f||e[15]!==d?(u={isOpen:p,activeSection:d,open:f,close:h},e[12]=h,e[13]=p,e[14]=f,e[15]=d,e[16]=u):u=e[16],u}export{M as i,x as t,_ as u};
1
+ import{r as g,c as v,b as C,a as k,e as E}from"./index-BkxNgQ-z.js";const x=({size:e=24,color:t="currentColor",...s})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},g.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));x.displayName="Building02";const M=({size:e=24,color:t="currentColor",...s})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},g.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));M.displayName="Coins01";const j=new Set(["account.profile","account.preferences","account.experimental","org.general","org.plugins","org.billing"]);function w(e){return e?j.has(e):!1}function _(){const e=v.c(17),t=C();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const r=k(s);let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},e[1]=i):i=e[1];const{org:o,project:n}=E(i);let c;e[2]!==r.settings?(c=w(r.settings)?r.settings:void 0,e[2]=r.settings,e[3]=c):c=e[3];const m=c,p=!!m;let a;e[4]!==t||e[5]!==o||e[6]!==n?(a=S=>{!o||!n||t({to:"/$org/$project",params:{org:o,project:n},search:{settings:S}})},e[4]=t,e[5]=o,e[6]=n,e[7]=a):a=e[7];const f=a;let l;e[8]!==t||e[9]!==o||e[10]!==n?(l=()=>{!o||!n||t({to:"/$org/$project",params:{org:o,project:n},search:{}})},e[8]=t,e[9]=o,e[10]=n,e[11]=l):l=e[11];const h=l,d=m??"account.preferences";let u;return e[12]!==h||e[13]!==p||e[14]!==f||e[15]!==d?(u={isOpen:p,activeSection:d,open:f,close:h},e[12]=h,e[13]=p,e[14]=f,e[15]=d,e[16]=u):u=e[16],u}export{M as i,x as t,_ as u};
@@ -1 +1 @@
1
- import{c as p,r as f}from"./index-DTgZok4N.js";import{u as w}from"./use-mobile-II1SQS1g.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
1
+ import{c as p,r as f}from"./index-BkxNgQ-z.js";import{u as w}from"./use-mobile-BArkW6j1.js";function S(m,M){const e=p.c(12),u=M===void 0?"cards":M,o=w(),b=f.useRef(o),s=m?`deco-view-mode-${m}`:"deco-view-mode";let i;e[0]!==u||e[1]!==s?(i=()=>{const r=globalThis.localStorage?.getItem(s);return r==="cards"||r==="table"?r:u},e[0]=u,e[1]=s,e[2]=i):i=e[2];const[t,g]=f.useState(i);let l;e[3]!==s?(l=r=>{g(r),globalThis.localStorage?.setItem(s,r)},e[3]=s,e[4]=l):l=e[4];const d=l;let c,a;e[5]!==o||e[6]!==t?(c=()=>{!b.current&&o&&t==="table"&&g("cards"),b.current=o},a=[o,t],e[5]=o,e[6]=t,e[7]=c,e[8]=a):(c=e[7],a=e[8]),f.useEffect(c,a);let n;return e[9]!==d||e[10]!==t?(n=[t,d],e[9]=d,e[10]=t,e[11]=n):n=e[11],n}export{S as u};
@@ -1 +1 @@
1
- import{c,u as r}from"./index-DTgZok4N.js";import{e as a,u as C,d as I}from"./use-connection-Du5eRm0t.js";import{a as l,u}from"./constants-2Gp-yGJ1.js";function m(i){const t=c.c(4);let o;t[0]!==i?(o=i===void 0?{}:i,t[0]=i,t[1]=o):o=t[1];const n=o,{org:e}=r();let s;t[2]!==e.id?(s={connectionId:l,orgId:e.id},t[2]=e.id,t[3]=s):s=t[3];const d=u(s);return a(e.id,"VIRTUAL_MCP",d,n)}function V(i){const t=c.c(2),{org:o}=r();let n;t[0]!==o.id?(n={connectionId:l,orgId:o.id},t[0]=o.id,t[1]=n):n=t[1];const e=u(n);return I(o.id,"VIRTUAL_MCP",i??void 0,e)}function p(){const i=c.c(2),{org:t}=r();let o;i[0]!==t.id?(o={connectionId:l,orgId:t.id},i[0]=t.id,i[1]=o):o=i[1];const n=u(o);return C(t.id,"VIRTUAL_MCP",n)}export{p as a,m as b,V as u};
1
+ import{c,u as r}from"./index-BkxNgQ-z.js";import{e as a,u as C,d as I}from"./use-connection-DjiXkPUz.js";import{a as l,u}from"./constants--aQ9HnxF.js";function m(i){const t=c.c(4);let o;t[0]!==i?(o=i===void 0?{}:i,t[0]=i,t[1]=o):o=t[1];const n=o,{org:e}=r();let s;t[2]!==e.id?(s={connectionId:l,orgId:e.id},t[2]=e.id,t[3]=s):s=t[3];const d=u(s);return a(e.id,"VIRTUAL_MCP",d,n)}function V(i){const t=c.c(2),{org:o}=r();let n;t[0]!==o.id?(n={connectionId:l,orgId:o.id},t[0]=o.id,t[1]=n):n=t[1];const e=u(n);return I(o.id,"VIRTUAL_MCP",i??void 0,e)}function p(){const i=c.c(2),{org:t}=r();let o;i[0]!==t.id?(o={connectionId:l,orgId:t.id},i[0]=t.id,i[1]=o):o=i[1];const n=u(o);return C(t.id,"VIRTUAL_MCP",n)}export{p as a,m as b,V as u};
@@ -0,0 +1 @@
1
+ import{I as u}from"./infiniteQueryObserver-DFroUYRE.js";import{Y as i}from"./index-BkxNgQ-z.js";function t(e,r){return i(e,u,r)}export{t as u};
@@ -1 +1 @@
1
- import{aN as l,aO as p,aP as n,aQ as d,aR as h,n as b,r as o,aS as m,aT as f}from"./index-DTgZok4N.js";var v=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),p(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&n(s.mutationKey)!==n(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??d();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,i=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#e.onSuccess?.(t.data,s,i,e),this.#e.onSettled?.(t.data,null,s,i,e)):t?.type==="error"&&(this.#e.onError?.(t.error,s,i,e),this.#e.onSettled?.(void 0,t.error,s,i,e))}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const i=b(s),[e]=o.useState(()=>new v(i,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const r=o.useSyncExternalStore(o.useCallback(a=>e.subscribe(h.batchCalls(a)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((a,c)=>{e.mutate(a,c).catch(m)},[e]);if(r.error&&f(e.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:u,mutateAsync:r.mutate}}export{O as u};
1
+ import{aN as l,aO as p,aP as n,aQ as d,aR as h,n as b,r as o,aS as m,aT as f}from"./index-BkxNgQ-z.js";var v=class extends l{#s;#i=void 0;#t;#e;constructor(t,s){super(),this.#s=t,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#s.defaultMutationOptions(t),p(this.options,s)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),s?.mutationKey&&this.options.mutationKey&&n(s.mutationKey)!==n(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(t,s){return this.#e=s,this.#t?.removeObserver(this),this.#t=this.#s.getMutationCache().build(this.#s,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??d();this.#i={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){h.batch(()=>{if(this.#e&&this.hasListeners()){const s=this.#i.variables,i=this.#i.context,e={client:this.#s,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#e.onSuccess?.(t.data,s,i,e),this.#e.onSettled?.(t.data,null,s,i,e)):t?.type==="error"&&(this.#e.onError?.(t.error,s,i,e),this.#e.onSettled?.(void 0,t.error,s,i,e))}this.listeners.forEach(s=>{s(this.#i)})})}};function O(t,s){const i=b(s),[e]=o.useState(()=>new v(i,t));o.useEffect(()=>{e.setOptions(t)},[e,t]);const r=o.useSyncExternalStore(o.useCallback(a=>e.subscribe(h.batchCalls(a)),[e]),()=>e.getCurrentResult(),()=>e.getCurrentResult()),u=o.useCallback((a,c)=>{e.mutate(a,c).catch(m)},[e]);if(r.error&&f(e.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:u,mutateAsync:r.mutate}}export{O as u};
@@ -0,0 +1 @@
1
+ import{Y as u,a3 as s}from"./index-BkxNgQ-z.js";function o(e,r){return u(e,s,r)}export{o as u};
@@ -0,0 +1 @@
1
+ import{I as s}from"./infiniteQueryObserver-DFroUYRE.js";import{Y as u,Z as n}from"./index-BkxNgQ-z.js";function a(r,e){return u({...r,enabled:!0,suspense:!0,throwOnError:n},s,e)}export{a as u};
@@ -1 +1 @@
1
- import{c as w,u as C,K as S,v as y,j as t}from"./index-DTgZok4N.js";import{A as E}from"./avatar-BsFgSPZd.js";import{u as k}from"./useQuery-C-DbMOQt.js";import{a as A,u as _}from"./constants-2Gp-yGJ1.js";function K(m){const e=w.c(11),{org:h}=C();let x;e[0]!==h.id?(x={connectionId:A,orgId:h.id},e[0]=h.id,e[1]=x):x=e[1];const u=_(x);let d;e[2]!==m?(d=S.user(m),e[2]=m,e[3]=d):d=e[3];let s;e[4]!==u||e[5]!==m?(s=async()=>{const r=await u.callTool({name:"USER_GET",arguments:{id:m}});return(r.structuredContent??r).user},e[4]=u,e[5]=m,e[6]=s):s=e[6];const l=!!m;let o;return e[7]!==d||e[8]!==s||e[9]!==l?(o={queryKey:d,queryFn:s,staleTime:3e5,retry:1,enabled:l},e[7]=d,e[8]=s,e[9]=l,e[10]=o):o=e[10],k(o)}function q(m){const e=w.c(36),{id:h,size:x,showEmail:u,avatarOnly:d,className:s}=m,l=x===void 0?"xs":x,o=u===void 0?!1:u,r=d===void 0?!1:d,{data:c,isLoading:U,isError:b}=K(h);if(U){let a;e[0]!==s?(a=y("flex items-center gap-2",s),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==l?(i=t.jsx(E.Skeleton,{shape:"circle",size:l}),e[2]=l,e[3]=i):i=e[3];let n;e[4]!==r||e[5]!==o?(n=!r&&t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),o&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"})]}),e[4]=r,e[5]=o,e[6]=n):n=e[6];let f;return e[7]!==a||e[8]!==i||e[9]!==n?(f=t.jsxs("div",{className:a,children:[i,n]}),e[7]=a,e[8]=i,e[9]=n,e[10]=f):f=e[10],f}if(b||!c){let a;e[11]!==s?(a=y("flex items-center gap-2",s),e[11]=s,e[12]=a):a=e[12];let i;e[13]!==l?(i=t.jsx(E,{shape:"circle",size:l,fallback:"?",muted:!0}),e[13]=l,e[14]=i):i=e[14];let n;e[15]!==r?(n=!r&&t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[15]=r,e[16]=n):n=e[16];let f;return e[17]!==a||e[18]!==i||e[19]!==n?(f=t.jsxs("div",{className:a,children:[i,n]}),e[17]=a,e[18]=i,e[19]=n,e[20]=f):f=e[20],f}let p;e[21]!==s?(p=y("flex items-center gap-2",s),e[21]=s,e[22]=p):p=e[22];const N=c.image??void 0;let v;e[23]!==l||e[24]!==N||e[25]!==c.name?(v=t.jsx(E,{shape:"circle",size:l,url:N,fallback:c.name}),e[23]=l,e[24]=N,e[25]=c.name,e[26]=v):v=e[26];let j;e[27]!==r||e[28]!==o||e[29]!==c.email||e[30]!==c.name?(j=!r&&t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-sm font-medium",children:c.name}),o&&t.jsx("div",{className:"text-xs text-muted-foreground",children:c.email})]}),e[27]=r,e[28]=o,e[29]=c.email,e[30]=c.name,e[31]=j):j=e[31];let g;return e[32]!==p||e[33]!==v||e[34]!==j?(g=t.jsxs("div",{className:p,children:[v,j]}),e[32]=p,e[33]=v,e[34]=j,e[35]=g):g=e[35],g}export{q as U};
1
+ import{c as w,u as C,K as S,v as y,j as t}from"./index-BkxNgQ-z.js";import{A as E}from"./avatar-BeiX4aSz.js";import{u as k}from"./useQuery-Cj-miqA2.js";import{a as A,u as _}from"./constants--aQ9HnxF.js";function K(m){const e=w.c(11),{org:h}=C();let x;e[0]!==h.id?(x={connectionId:A,orgId:h.id},e[0]=h.id,e[1]=x):x=e[1];const u=_(x);let d;e[2]!==m?(d=S.user(m),e[2]=m,e[3]=d):d=e[3];let s;e[4]!==u||e[5]!==m?(s=async()=>{const r=await u.callTool({name:"USER_GET",arguments:{id:m}});return(r.structuredContent??r).user},e[4]=u,e[5]=m,e[6]=s):s=e[6];const l=!!m;let o;return e[7]!==d||e[8]!==s||e[9]!==l?(o={queryKey:d,queryFn:s,staleTime:3e5,retry:1,enabled:l},e[7]=d,e[8]=s,e[9]=l,e[10]=o):o=e[10],k(o)}function q(m){const e=w.c(36),{id:h,size:x,showEmail:u,avatarOnly:d,className:s}=m,l=x===void 0?"xs":x,o=u===void 0?!1:u,r=d===void 0?!1:d,{data:c,isLoading:U,isError:b}=K(h);if(U){let a;e[0]!==s?(a=y("flex items-center gap-2",s),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==l?(i=t.jsx(E.Skeleton,{shape:"circle",size:l}),e[2]=l,e[3]=i):i=e[3];let n;e[4]!==r||e[5]!==o?(n=!r&&t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-3 w-24 bg-muted animate-pulse rounded"}),o&&t.jsx("div",{className:"h-2 w-32 bg-muted animate-pulse rounded"})]}),e[4]=r,e[5]=o,e[6]=n):n=e[6];let f;return e[7]!==a||e[8]!==i||e[9]!==n?(f=t.jsxs("div",{className:a,children:[i,n]}),e[7]=a,e[8]=i,e[9]=n,e[10]=f):f=e[10],f}if(b||!c){let a;e[11]!==s?(a=y("flex items-center gap-2",s),e[11]=s,e[12]=a):a=e[12];let i;e[13]!==l?(i=t.jsx(E,{shape:"circle",size:l,fallback:"?",muted:!0}),e[13]=l,e[14]=i):i=e[14];let n;e[15]!==r?(n=!r&&t.jsx("div",{className:"flex flex-col",children:t.jsx("div",{className:"text-sm text-muted-foreground",children:"Unknown User"})}),e[15]=r,e[16]=n):n=e[16];let f;return e[17]!==a||e[18]!==i||e[19]!==n?(f=t.jsxs("div",{className:a,children:[i,n]}),e[17]=a,e[18]=i,e[19]=n,e[20]=f):f=e[20],f}let p;e[21]!==s?(p=y("flex items-center gap-2",s),e[21]=s,e[22]=p):p=e[22];const N=c.image??void 0;let v;e[23]!==l||e[24]!==N||e[25]!==c.name?(v=t.jsx(E,{shape:"circle",size:l,url:N,fallback:c.name}),e[23]=l,e[24]=N,e[25]=c.name,e[26]=v):v=e[26];let j;e[27]!==r||e[28]!==o||e[29]!==c.email||e[30]!==c.name?(j=!r&&t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-sm font-medium",children:c.name}),o&&t.jsx("div",{className:"text-xs text-muted-foreground",children:c.email})]}),e[27]=r,e[28]=o,e[29]=c.email,e[30]=c.name,e[31]=j):j=e[31];let g;return e[32]!==p||e[33]!==v||e[34]!==j?(g=t.jsxs("div",{className:p,children:[v,j]}),e[32]=p,e[33]=v,e[34]=j,e[35]=g):g=e[35],g}export{q as U};
@@ -1 +1 @@
1
- import{r as N,u as w,d as q,b as G,j as t,B as I,O as B,c as _,E as Q,_ as J,aD as Z,n as V,K as W,t as A}from"./index-DTgZok4N.js";import{a as Y,u as X,e as ee}from"./constants-2Gp-yGJ1.js";import{C as te}from"./collection-tab-DILgyiiN.js";import{g as ne,h as se}from"./use-connection-Du5eRm0t.js";import{E as R}from"./collection-search-Bkt-jVWx.js";import{P as x}from"./index-BMtw0aq_.js";import{B as F,a as M,b as z,c as T}from"./breadcrumb-CkhUU1qO.js";import{a as ie,b as oe}from"./use-binding-CXeaDqWF.js";import{i as le}from"./Loading01-SjZGs3Wk.js";import{s as re}from"./RefreshCcw01-DT9wSPl_.js";import{u as ae}from"./useMutation-B99hCaMl.js";import{e as ce}from"./Dataflow03-GEBPM69Y.js";import"./generate-id-Dyweu44Y.js";import"./collection-table-wrapper-c85b97QJ.js";import"./dropdown-menu-B0Dgts11.js";import"./Check-AlxQ-j2G.js";import"./ChevronRight-sqD7LMFa.js";import"./ArrowDown-Ci69NI9T.js";import"./ArrowUp-YaPl1lq-.js";import"./Grid01-C3osH3dx.js";import"./List-iHNJ390y.js";import"./tooltip-B2vpv_WH.js";import"./index-BG6VshDR.js";import"./table-CZRzSdcB.js";import"./card-BiGYvdPr.js";import"./integration-icon-BqSOA-1d.js";import"./Container-Dt3fts2O.js";import"./Copy01-yMwUMo5Y.js";import"./DotsVertical-DxigKHHt.js";import"./Edit01-Cg13Y9IR.js";import"./Eye-D5VDCdLP.js";import"./Trash01-CDDpTvNv.js";import"./empty-state-DE4SQU5S.js";import"./Inbox01-kmB3TeMO.js";import"./user-BncBYJfn.js";import"./avatar-BsFgSPZd.js";import"./useQuery-C-DbMOQt.js";import"./use-list-state-Dxk-n9cc.js";import"./use-view-mode-D38VMwz6.js";import"./use-mobile-II1SQS1g.js";import"./constants-DTNMmCfY.js";import"./alert-dialog-DRnSCcWl.js";import"./Plus-DXYydVCi.js";import"./layout-K29HidGl.js";import"./SearchMd-CSKcblxx.js";import"./input-CjsuYubG.js";import"./localstorage-keys-Cenhbz-P.js";import"./binder-CXy7pGaI.js";const D=({size:n=24,color:e="currentColor",...i})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},N.createElement("path",{d:"m9.395 19.371.585 1.315a2.212 2.212 0 0 0 4.044 0l.584-1.315a2.426 2.426 0 0 1 2.47-1.423l1.43.152a2.212 2.212 0 0 0 2.023-3.502l-.847-1.164a2.428 2.428 0 0 1-.46-1.434c0-.513.163-1.014.464-1.429l.847-1.163a2.211 2.211 0 0 0-2.022-3.502l-1.43.152a2.433 2.433 0 0 1-1.47-.312 2.426 2.426 0 0 1-1-1.117l-.589-1.315a2.212 2.212 0 0 0-4.044 0L9.395 4.63c-.207.468-.557.86-1 1.117-.445.256-.96.365-1.47.312l-1.434-.152a2.212 2.212 0 0 0-2.023 3.502l.847 1.163a2.43 2.43 0 0 1 0 2.858l-.847 1.163a2.21 2.21 0 0 0 .786 3.273c.382.195.811.274 1.237.23l1.43-.153a2.434 2.434 0 0 1 2.474 1.43Z"}),N.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));D.displayName="Settings02";function de({title:n,description:e,wellKnownMcp:i,imageSrc:a,onConnected:o}){const c=ne(),{org:{slug:s}}=w(),{data:r}=q.useSession(),d=G(),[m,p]=N.useState(!1),l=async()=>{if(!(!i||!r?.user?.id)){p(!0);try{const f=await c.create.mutateAsync(i);o?.(f.id),d({to:"/$org/$project/mcps/$connectionId",params:{org:s,project:B,connectionId:f.id}})}finally{p(!1)}}},u=()=>{d({to:"/$org/$project/mcps",params:{org:s,project:B},search:{action:"create"}})};return t.jsx(R,{image:a?t.jsx("img",{src:a,alt:n,width:336,height:320,className:"max-w-full h-auto"}):null,title:n,description:e,actions:t.jsxs(t.Fragment,{children:[t.jsxs(I,{variant:"outline",onClick:l,disabled:m||!i,children:[i?.icon&&t.jsx("img",{src:i.icon,alt:"",className:"size-4"}),m?"Installing...":`Install ${i?.title||"MCP"}`]}),t.jsx(I,{variant:"outline",onClick:u,children:"Custom Connection"})]})})}function me(n){const e=_.c(35),{bindingName:i,collectionName:a,title:o,emptyState:c,wellKnownMcp:s}=n,{org:r}=w(),d=se();let m;e[0]!==d||e[1]!==i?(m={connections:d,binding:i},e[0]=d,e[1]=i,e[2]=m):m=e[2];const l=ie(m)[0],u=oe(l);let f;if(e[3]!==a||e[4]!==u){let g;e[6]!==a?(g=$=>$.name.toLowerCase()===a.toLowerCase(),e[6]=a,e[7]=g):g=e[7],f=u.find(g),e[3]=a,e[4]=u,e[5]=f}else f=e[5];const S=f,[U,H]=N.useState(null),L=l&&S&&(l.id||U);let h;e[8]!==o?(h=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:o})})})})})}),e[8]=o,e[9]=h):h=e[9];let j;e[10]!==l||e[11]!==r||e[12]!==o?(j=g=>{const{error:$,resetError:K}=g;return t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(J,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("h3",{className:"text-lg font-medium",children:["Failed to load ",o.toLowerCase()]}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:$?.message||"Unable to connect to the server. Please check that it is running and accessible."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(I,{variant:"outline",onClick:K,children:[t.jsx(re,{className:"size-4"}),"Try again"]}),l&&t.jsx(I,{variant:"outline",asChild:!0,children:t.jsxs(Z,{to:"/$org/$project/mcps/$connectionId",params:{org:r.slug,project:B,connectionId:l.id},search:{tab:"settings"},children:[t.jsx(D,{className:"size-4"}),"Connection Settings"]})})]})]})},e[10]=l,e[11]=r,e[12]=o,e[13]=j):j=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),e[14]=k):k=e[14];let b;e[15]!==o?(b=o.toLowerCase(),e[15]=o,e[16]=b):b=e[16];let C;e[17]!==b?(C=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[k,t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",b,"..."]})]}),e[17]=b,e[18]=C):C=e[18];let y;e[19]!==S||e[20]!==l||e[21]!==c||e[22]!==r||e[23]!==L||e[24]!==s?(y=L?t.jsx(te,{connectionId:l.id,org:r.slug,activeCollection:S}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(de,{title:c.title,description:c.description,wellKnownMcp:s,imageSrc:c.imageSrc,onConnected:g=>{H(g)}})}),e[19]=S,e[20]=l,e[21]=c,e[22]=r,e[23]=L,e[24]=s,e[25]=y):y=e[25];let P;e[26]!==C||e[27]!==y?(P=t.jsx(N.Suspense,{fallback:C,children:y}),e[26]=C,e[27]=y,e[28]=P):P=e[28];let E;e[29]!==j||e[30]!==P?(E=t.jsx(x.Content,{children:t.jsx(Q,{fallback:j,children:P})}),e[29]=j,e[30]=P,e[31]=E):E=e[31];let v;return e[32]!==E||e[33]!==h?(v=t.jsxs(x,{children:[h,E]}),e[32]=E,e[33]=h,e[34]=v):v=e[34],v}function ue(){const n=_.c(12),{org:e,project:i}=w(),a=V();let o;n[0]!==e.id?(o={connectionId:Y,orgId:e.id},n[0]=e.id,n[1]=o):o=n[1];const c=X(o);let s;n[2]!==c||n[3]!==i?(s=async p=>{const l=i.enabledPlugins??[];if(l.includes(p))return;const u=[...l,p],f=await c.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,enabledPlugins:u}});return f.structuredContent??f},n[2]=c,n[3]=i,n[4]=s):s=n[4];let r;n[5]!==e.id||n[6]!==i||n[7]!==a?(r=()=>{a.invalidateQueries({queryKey:W.project(e.id,i.slug)}),a.invalidateQueries({queryKey:W.projects(e.id)})},n[5]=e.id,n[6]=i,n[7]=a,n[8]=r):r=n[8];let d;return n[9]!==s||n[10]!==r?(d={mutationFn:s,onSuccess:r,onError:pe},n[9]=s,n[10]=r,n[11]=d):d=n[11],ae(d)}function pe(n){A.error("Failed to enable plugin: "+(n instanceof Error?n.message:"Unknown error"))}function fe(n){const e=_.c(12),{pluginId:i,title:a,description:o,icon:c}=n,s=ue();let r;e[0]!==s||e[1]!==i?(r=async()=>{try{await s.mutateAsync(i),A.success("Plugin enabled!")}catch{}},e[0]=s,e[1]=i,e[2]=r):r=e[2];const d=r,m=c??null,p=s.isPending?"Enabling…":"Enable plugin";let l;e[3]!==s.isPending||e[4]!==d||e[5]!==p?(l=t.jsx(I,{onClick:d,disabled:s.isPending,children:p}),e[3]=s.isPending,e[4]=d,e[5]=p,e[6]=l):l=e[6];let u;return e[7]!==o||e[8]!==m||e[9]!==l||e[10]!==a?(u=t.jsx(R,{image:m,title:a,description:o,actions:l}),e[7]=o,e[8]=m,e[9]=l,e[10]=a,e[11]=u):u=e[11],u}const O="workflows";function ct(){const n=_.c(3),{project:e}=w();if(!(e.enabledPlugins??[]).includes(O)){let c;n[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:"Workflows"})})})})})}),n[0]=c):c=n[0];let s;return n[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs(x,{children:[c,t.jsx(x.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(fe,{pluginId:O,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(ce,{className:"size-8 text-muted-foreground"})})})})})]}),n[1]=s):s=n[1],s}let o;return n[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(me,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Run durable MCP tool calls in background."},wellKnownMcp:ee()}),n[2]=o):o=n[2],o}export{ct as default};
1
+ import{r as N,u as w,d as q,b as G,j as t,B as I,O as B,c as _,E as Q,_ as J,aD as Z,n as V,K as W,t as A}from"./index-BkxNgQ-z.js";import{a as Y,u as X,e as ee}from"./constants--aQ9HnxF.js";import{C as te}from"./collection-tab-CkymCS_K.js";import{g as ne,h as se}from"./use-connection-DjiXkPUz.js";import{E as R}from"./collection-search-BgstpGbD.js";import{P as x}from"./index-B4YFEuZr.js";import{B as F,a as M,b as z,c as T}from"./breadcrumb-DxXcAXh7.js";import{a as ie,b as oe}from"./use-binding-CVLYzFG-.js";import{i as le}from"./Loading01-BLoQsWVt.js";import{s as re}from"./RefreshCcw01-DzE0Vt_s.js";import{u as ae}from"./useMutation-DtOoZO7h.js";import{e as ce}from"./Dataflow03-TMmWfgl9.js";import"./generate-id-Dyweu44Y.js";import"./collection-table-wrapper-B7II4YYC.js";import"./dropdown-menu-DvfBJ25L.js";import"./Check-BuBqfL8V.js";import"./ChevronRight-u7jqeZNG.js";import"./ArrowDown-BfANN175.js";import"./ArrowUp-BNm6R5tp.js";import"./Grid01-DjcW2Js4.js";import"./List-Be3XBHwN.js";import"./tooltip-DvMRS01W.js";import"./index-dKQNml8k.js";import"./table-BJ3W5Geb.js";import"./card-BRjix5ol.js";import"./integration-icon-DqBJsR0X.js";import"./Container-CFxptFeR.js";import"./Copy01-D2l3XUry.js";import"./DotsVertical-B78gtBdB.js";import"./Edit01-CbZPkCJz.js";import"./Eye-vR70tVFn.js";import"./Trash01-BvIumE4M.js";import"./empty-state-C2LU6BeW.js";import"./Inbox01-xF_R8liT.js";import"./user-BcEL6pjj.js";import"./avatar-BeiX4aSz.js";import"./useQuery-Cj-miqA2.js";import"./use-list-state-CCFlT7yz.js";import"./use-view-mode-3_G2qIMG.js";import"./use-mobile-BArkW6j1.js";import"./constants-DoLvwboP.js";import"./alert-dialog-B0yEBEkb.js";import"./Plus-4zX3n4bH.js";import"./layout-rnNZXdmD.js";import"./SearchMd-BvHN4xgB.js";import"./input-BxWPl4Ur.js";import"./localstorage-keys-2beZrYfY.js";import"./binder-DUACCYIe.js";const D=({size:n=24,color:e="currentColor",...i})=>N.createElement("svg",{viewBox:"0 0 24 24",width:n,height:n,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},N.createElement("path",{d:"m9.395 19.371.585 1.315a2.212 2.212 0 0 0 4.044 0l.584-1.315a2.426 2.426 0 0 1 2.47-1.423l1.43.152a2.212 2.212 0 0 0 2.023-3.502l-.847-1.164a2.428 2.428 0 0 1-.46-1.434c0-.513.163-1.014.464-1.429l.847-1.163a2.211 2.211 0 0 0-2.022-3.502l-1.43.152a2.433 2.433 0 0 1-1.47-.312 2.426 2.426 0 0 1-1-1.117l-.589-1.315a2.212 2.212 0 0 0-4.044 0L9.395 4.63c-.207.468-.557.86-1 1.117-.445.256-.96.365-1.47.312l-1.434-.152a2.212 2.212 0 0 0-2.023 3.502l.847 1.163a2.43 2.43 0 0 1 0 2.858l-.847 1.163a2.21 2.21 0 0 0 .786 3.273c.382.195.811.274 1.237.23l1.43-.153a2.434 2.434 0 0 1 2.474 1.43Z"}),N.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}));D.displayName="Settings02";function de({title:n,description:e,wellKnownMcp:i,imageSrc:a,onConnected:o}){const c=ne(),{org:{slug:s}}=w(),{data:r}=q.useSession(),d=G(),[m,p]=N.useState(!1),l=async()=>{if(!(!i||!r?.user?.id)){p(!0);try{const f=await c.create.mutateAsync(i);o?.(f.id),d({to:"/$org/$project/mcps/$connectionId",params:{org:s,project:B,connectionId:f.id}})}finally{p(!1)}}},u=()=>{d({to:"/$org/$project/mcps",params:{org:s,project:B},search:{action:"create"}})};return t.jsx(R,{image:a?t.jsx("img",{src:a,alt:n,width:336,height:320,className:"max-w-full h-auto"}):null,title:n,description:e,actions:t.jsxs(t.Fragment,{children:[t.jsxs(I,{variant:"outline",onClick:l,disabled:m||!i,children:[i?.icon&&t.jsx("img",{src:i.icon,alt:"",className:"size-4"}),m?"Installing...":`Install ${i?.title||"MCP"}`]}),t.jsx(I,{variant:"outline",onClick:u,children:"Custom Connection"})]})})}function me(n){const e=_.c(35),{bindingName:i,collectionName:a,title:o,emptyState:c,wellKnownMcp:s}=n,{org:r}=w(),d=se();let m;e[0]!==d||e[1]!==i?(m={connections:d,binding:i},e[0]=d,e[1]=i,e[2]=m):m=e[2];const l=ie(m)[0],u=oe(l);let f;if(e[3]!==a||e[4]!==u){let g;e[6]!==a?(g=$=>$.name.toLowerCase()===a.toLowerCase(),e[6]=a,e[7]=g):g=e[7],f=u.find(g),e[3]=a,e[4]=u,e[5]=f}else f=e[5];const S=f,[U,H]=N.useState(null),L=l&&S&&(l.id||U);let h;e[8]!==o?(h=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:o})})})})})}),e[8]=o,e[9]=h):h=e[9];let j;e[10]!==l||e[11]!==r||e[12]!==o?(j=g=>{const{error:$,resetError:K}=g;return t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(J,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("h3",{className:"text-lg font-medium",children:["Failed to load ",o.toLowerCase()]}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:$?.message||"Unable to connect to the server. Please check that it is running and accessible."})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(I,{variant:"outline",onClick:K,children:[t.jsx(re,{className:"size-4"}),"Try again"]}),l&&t.jsx(I,{variant:"outline",asChild:!0,children:t.jsxs(Z,{to:"/$org/$project/mcps/$connectionId",params:{org:r.slug,project:B,connectionId:l.id},search:{tab:"settings"},children:[t.jsx(D,{className:"size-4"}),"Connection Settings"]})})]})]})},e[10]=l,e[11]=r,e[12]=o,e[13]=j):j=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),e[14]=k):k=e[14];let b;e[15]!==o?(b=o.toLowerCase(),e[15]=o,e[16]=b):b=e[16];let C;e[17]!==b?(C=t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[k,t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Loading ",b,"..."]})]}),e[17]=b,e[18]=C):C=e[18];let y;e[19]!==S||e[20]!==l||e[21]!==c||e[22]!==r||e[23]!==L||e[24]!==s?(y=L?t.jsx(te,{connectionId:l.id,org:r.slug,activeCollection:S}):t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(de,{title:c.title,description:c.description,wellKnownMcp:s,imageSrc:c.imageSrc,onConnected:g=>{H(g)}})}),e[19]=S,e[20]=l,e[21]=c,e[22]=r,e[23]=L,e[24]=s,e[25]=y):y=e[25];let P;e[26]!==C||e[27]!==y?(P=t.jsx(N.Suspense,{fallback:C,children:y}),e[26]=C,e[27]=y,e[28]=P):P=e[28];let E;e[29]!==j||e[30]!==P?(E=t.jsx(x.Content,{children:t.jsx(Q,{fallback:j,children:P})}),e[29]=j,e[30]=P,e[31]=E):E=e[31];let v;return e[32]!==E||e[33]!==h?(v=t.jsxs(x,{children:[h,E]}),e[32]=E,e[33]=h,e[34]=v):v=e[34],v}function ue(){const n=_.c(12),{org:e,project:i}=w(),a=V();let o;n[0]!==e.id?(o={connectionId:Y,orgId:e.id},n[0]=e.id,n[1]=o):o=n[1];const c=X(o);let s;n[2]!==c||n[3]!==i?(s=async p=>{const l=i.enabledPlugins??[];if(l.includes(p))return;const u=[...l,p],f=await c.callTool({name:"PROJECT_UPDATE",arguments:{projectId:i.id,enabledPlugins:u}});return f.structuredContent??f},n[2]=c,n[3]=i,n[4]=s):s=n[4];let r;n[5]!==e.id||n[6]!==i||n[7]!==a?(r=()=>{a.invalidateQueries({queryKey:W.project(e.id,i.slug)}),a.invalidateQueries({queryKey:W.projects(e.id)})},n[5]=e.id,n[6]=i,n[7]=a,n[8]=r):r=n[8];let d;return n[9]!==s||n[10]!==r?(d={mutationFn:s,onSuccess:r,onError:pe},n[9]=s,n[10]=r,n[11]=d):d=n[11],ae(d)}function pe(n){A.error("Failed to enable plugin: "+(n instanceof Error?n.message:"Unknown error"))}function fe(n){const e=_.c(12),{pluginId:i,title:a,description:o,icon:c}=n,s=ue();let r;e[0]!==s||e[1]!==i?(r=async()=>{try{await s.mutateAsync(i),A.success("Plugin enabled!")}catch{}},e[0]=s,e[1]=i,e[2]=r):r=e[2];const d=r,m=c??null,p=s.isPending?"Enabling…":"Enable plugin";let l;e[3]!==s.isPending||e[4]!==d||e[5]!==p?(l=t.jsx(I,{onClick:d,disabled:s.isPending,children:p}),e[3]=s.isPending,e[4]=d,e[5]=p,e[6]=l):l=e[6];let u;return e[7]!==o||e[8]!==m||e[9]!==l||e[10]!==a?(u=t.jsx(R,{image:m,title:a,description:o,actions:l}),e[7]=o,e[8]=m,e[9]=l,e[10]=a,e[11]=u):u=e[11],u}const O="workflows";function ct(){const n=_.c(3),{project:e}=w();if(!(e.enabledPlugins??[]).includes(O)){let c;n[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(x.Header,{children:t.jsx(x.Header.Left,{children:t.jsx(F,{children:t.jsx(M,{children:t.jsx(z,{children:t.jsx(T,{children:"Workflows"})})})})})}),n[0]=c):c=n[0];let s;return n[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs(x,{children:[c,t.jsx(x.Content,{children:t.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:t.jsx(fe,{pluginId:O,title:"Enable Workflows",description:"Automate multi-step processes by enabling the Workflows plugin. Once enabled you can create, run, and monitor workflows.",icon:t.jsx("div",{className:"bg-muted p-4 rounded-full",children:t.jsx(ce,{className:"size-8 text-muted-foreground"})})})})})]}),n[1]=s):s=n[1],s}let o;return n[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(me,{bindingName:"WORKFLOW",collectionName:"workflow",title:"Workflows",emptyState:{title:"Create Workflows",description:"Run durable MCP tool calls in background."},wellKnownMcp:ee()}),n[2]=o):o=n[2],o}export{ct as default};
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <title>MCP Mesh</title>
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
- <script type="module" crossorigin src="/assets/index-DTgZok4N.js"></script>
6
+ <script type="module" crossorigin src="/assets/index-BkxNgQ-z.js"></script>
7
7
  <link rel="stylesheet" crossorigin href="/assets/index-nMGos9dp.css">
8
8
  </head>
9
9
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/mesh",
3
- "version": "2.133.1",
3
+ "version": "2.134.0",
4
4
  "description": "MCP Mesh - Self-hostable MCP Gateway for managing AI connections and tools",
5
5
  "author": "Deco team",
6
6
  "license": "MIT",
@@ -1,23 +0,0 @@
1
- import{r as _,c7 as fa,c8 as ha,a0 as ga,bN as Y,s as y,c9 as Ke,ca as hs,bR as va,bS as ya,bM as xa,bO as J,bI as Fe,aF as qe,o as D,bP as T,bQ as he,cb as ba,cc as $,aG as Sa,bG as _a,c as F,u as Ie,K as _e,e as gs,n as st,t as ke,v as Ue,j as u,E as Et,B as Xe,b as Ea,O as Ia,_ as wa,d as Na,G as Ta,H as It,aH as Ca,M as Aa,U as Ma,T as ja,I as Ra,bC as ka}from"./index-DTgZok4N.js";import{u as wt,a as Nt,d as Oa}from"./constants-2Gp-yGJ1.js";import{b as Pa}from"./use-virtual-mcp-CS7dIIbK.js";import{A as Ut,D as ct}from"./decopilot-events-DlkvGkzj.js";import{u as Tt,a as Da}from"./use-llm-B4rO8f2r.js";import{u as $a}from"./useQuery-C-DbMOQt.js";import{u as et,L as Ct}from"./localstorage-keys-Cenhbz-P.js";import{u as La}from"./tabs-DkvkxCCI.js";import{C as Za}from"./checkbox-DaiL5KlM.js";import{I as Fa}from"./input-CjsuYubG.js";import{f as Ua,c as za,a as Ba,D as Va}from"./dialog-BeE7uUPn.js";import{S as qa,a as Wa,b as Ja,c as Ha,d as Ga}from"./select-CwGh16En.js";import{S as q}from"./skeleton-DZ7Qc_fE.js";import{i as Ya}from"./AlignLeft-DU7XXs04.js";import{i as Qa}from"./ArrowLeft-DiQ6H1qe.js";import{t as ht}from"./ChevronDown-Bt1ewsqh.js";import{a as Ka}from"./Image01-Dk65YqxA.js";import{s as Xa}from"./RefreshCcw01-DT9wSPl_.js";import{i as vs}from"./SearchMd-CSKcblxx.js";import{t as At}from"./Settings01-Dkx2ZoN9.js";import{b as Mt,c as er,a as tr,e as sr}from"./use-connection-Du5eRm0t.js";import{u as ar}from"./useSuspenseInfiniteQuery-CX_HgzHm.js";const rr=({size:t=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"M4 7h11m0 0-4 4m4-4-4-4M4 17h16m0 0-4 4m4-4-4-4"}));rr.displayName="ArrowsRight";const ys=({size:t=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));ys.displayName="ChevronSelectorVertical";const nr=({size:t=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"M10 17.659V20a2 2 0 1 0 4 0v-2.341M12 2v1m-9 9H2m3.5-6.5-.6-.6m13.6.6.6-.6M22 12h-1m-3 0a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z"}));nr.displayName="Lightbulb02";const xs=({size:t=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));xs.displayName="Stars01";const bs=({size:t=24,color:e="currentColor",...s})=>_.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},_.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));bs.displayName="Tool01";var ze;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function s(r){throw new Error}t.assertNever=s,t.arrayToEnum=r=>{const n={};for(const i of r)n[i]=i;return n},t.getValidEnumValues=r=>{const n=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of n)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(n){return r[n]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const n=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(i);return n},t.find=(r,n)=>{for(const i of r)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function a(r,n=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=a,t.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(ze||(ze={}));var zt;(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(zt||(zt={}));ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class tt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}format(e){const s=e||function(n){return n.message},a={_errors:[]},r=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)a._errors.push(s(i));else{let o=a,c=0;for(;c<i.path.length;){const l=i.path[c];c===i.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(s(i))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return r(this),a}static assert(e){if(!(e instanceof tt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ze.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){const s=Object.create(null),a=[];for(const r of this.issues)if(r.path.length>0){const n=r.path[0];s[n]=s[n]||[],s[n].push(e(r))}else a.push(e(r));return{formErrors:a,fieldErrors:s}}get formErrors(){return this.flatten()}}tt.create=t=>new tt(t);var Bt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Bt||(Bt={}));var M;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(M||(M={}));var Ss="vercel.ai.error",or=Symbol.for(Ss),Vt,qt,ce=class _s extends(qt=Error,Vt=or,qt){constructor({name:e,message:s,cause:a}){super(s),this[Vt]=!0,this.name=e,this.cause=a}static isInstance(e){return _s.hasMarker(e,Ss)}static hasMarker(e,s){const a=Symbol.for(s);return e!=null&&typeof e=="object"&&a in e&&typeof e[a]=="boolean"&&e[a]===!0}};function Es(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Is="AI_InvalidArgumentError",ws=`vercel.ai.error.${Is}`,ir=Symbol.for(ws),Wt,Jt,lr=class extends(Jt=ce,Wt=ir,Jt){constructor({message:t,cause:e,argument:s}){super({name:Is,message:t,cause:e}),this[Wt]=!0,this.argument=s}static isInstance(t){return ce.hasMarker(t,ws)}},Ns="AI_JSONParseError",Ts=`vercel.ai.error.${Ns}`,cr=Symbol.for(Ts),Ht,Gt,Yt=class extends(Gt=ce,Ht=cr,Gt){constructor({text:t,cause:e}){super({name:Ns,message:`JSON parsing failed: Text: ${t}.
2
- Error message: ${Es(e)}`,cause:e}),this[Ht]=!0,this.text=t}static isInstance(t){return ce.hasMarker(t,Ts)}},Cs="AI_TypeValidationError",As=`vercel.ai.error.${Cs}`,ur=Symbol.for(As),Qt,Kt,Oe=class gt extends(Kt=ce,Qt=ur,Kt){constructor({value:e,cause:s,context:a}){let r="Type validation failed";if(a?.field&&(r+=` for ${a.field}`),a?.entityName||a?.entityId){r+=" (";const n=[];a.entityName&&n.push(a.entityName),a.entityId&&n.push(`id: "${a.entityId}"`),r+=n.join(", "),r+=")"}super({name:Cs,message:`${r}: Value: ${JSON.stringify(e)}.
3
- Error message: ${Es(s)}`,cause:s}),this[Qt]=!0,this.value=e,this.context=a}static isInstance(e){return ce.hasMarker(e,As)}static wrap({value:e,cause:s,context:a}){var r,n,i;return gt.isInstance(s)&&s.value===e&&((r=s.context)==null?void 0:r.field)===a?.field&&((n=s.context)==null?void 0:n.entityName)===a?.entityName&&((i=s.context)==null?void 0:i.entityId)===a?.entityId?s:new gt({value:e,cause:s,context:a})}},We=({prefix:t,size:e=16,alphabet:s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:a="-"}={})=>{const r=()=>{const n=s.length,i=new Array(e);for(let o=0;o<e;o++)i[o]=s[Math.random()*n|0];return i.join("")};if(t==null)return r;if(s.includes(a))throw new lr({argument:"separator",message:`The separator "${a}" must not be part of the alphabet "${s}".`});return()=>`${t}${a}${r()}`},dr=We();function Xt(t=globalThis){var e,s,a;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(a=(s=t.process)==null?void 0:s.versions)!=null&&a.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Se(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((s,a)=>{e[a.toLowerCase()]=s});else{Array.isArray(t)||(t=Object.entries(t));for(const[s,a]of t)a!=null&&(e[s.toLowerCase()]=a)}return e}function es(t,...e){const s=new Headers(Se(t)),a=s.get("user-agent")||"";return s.set("user-agent",[a,...e].filter(Boolean).join(" ")),Object.fromEntries(s.entries())}var pr=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,mr=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function ts(t){const e=JSON.parse(t);return e===null||typeof e!="object"||pr.test(t)===!1&&mr.test(t)===!1?e:fr(e)}function fr(t){let e=[t];for(;e.length;){const s=e;e=[];for(const a of s){if(Object.prototype.hasOwnProperty.call(a,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(a,"constructor")&&a.constructor!==null&&typeof a.constructor=="object"&&Object.prototype.hasOwnProperty.call(a.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const r in a){const n=a[r];n&&typeof n=="object"&&e.push(n)}}}return t}function hr(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return ts(t)}try{return ts(t)}finally{Error.stackTraceLimit=e}}function jt(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:s}=t;if(s!=null)for(const a of Object.keys(s))s[a]=be(s[a])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(be):be(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(be)),t.allOf!=null&&(t.allOf=t.allOf.map(be)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(be));const{definitions:e}=t;if(e!=null)for(const s of Object.keys(e))e[s]=be(e[s]);return t}function be(t){return typeof t=="boolean"?t:jt(t)}var gr=Symbol("Let zodToJsonSchema decide on which parser to use"),ss={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},vr=t=>typeof t=="string"?{...ss,name:t}:{...ss,...t};function Q(){return{}}function yr(t,e){var s,a,r;const n={type:"array"};return(s=t.type)!=null&&s._def&&((r=(a=t.type)==null?void 0:a._def)==null?void 0:r.typeName)!==M.ZodAny&&(n.items=P(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(n.minItems=t.minLength.value),t.maxLength&&(n.maxItems=t.maxLength.value),t.exactLength&&(n.minItems=t.exactLength.value,n.maxItems=t.exactLength.value),n}function xr(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const s of t.checks)switch(s.kind){case"min":s.inclusive?e.minimum=s.value:e.exclusiveMinimum=s.value;break;case"max":s.inclusive?e.maximum=s.value:e.exclusiveMaximum=s.value;break;case"multipleOf":e.multipleOf=s.value;break}return e}function br(){return{type:"boolean"}}function Ms(t,e){return P(t.type._def,e)}var Sr=(t,e)=>P(t.innerType._def,e);function js(t,e,s){const a=s??e.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((r,n)=>js(t,e,r))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return _r(t)}}var _r=t=>{const e={type:"integer",format:"unix-time"};for(const s of t.checks)switch(s.kind){case"min":e.minimum=s.value;break;case"max":e.maximum=s.value;break}return e};function Er(t,e){return{...P(t.innerType._def,e),default:t.defaultValue()}}function Ir(t,e){return e.effectStrategy==="input"?P(t.schema._def,e):Q()}function wr(t){return{type:"string",enum:Array.from(t.values)}}var Nr=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Tr(t,e){const s=[P(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),P(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(r=>!!r),a=[];return s.forEach(r=>{if(Nr(r))a.push(...r.allOf);else{let n=r;if("additionalProperties"in r&&r.additionalProperties===!1){const{additionalProperties:i,...o}=r;n=o}a.push(n)}}),a.length?{allOf:a}:void 0}function Cr(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var ut=void 0,te={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(ut===void 0&&(ut=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ut),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Rs(t,e){const s={type:"string"};if(t.checks)for(const a of t.checks)switch(a.kind){case"min":s.minLength=typeof s.minLength=="number"?Math.max(s.minLength,a.value):a.value;break;case"max":s.maxLength=typeof s.maxLength=="number"?Math.min(s.maxLength,a.value):a.value;break;case"email":switch(e.emailStrategy){case"format:email":se(s,"email",a.message,e);break;case"format:idn-email":se(s,"idn-email",a.message,e);break;case"pattern:zod":W(s,te.email,a.message,e);break}break;case"url":se(s,"uri",a.message,e);break;case"uuid":se(s,"uuid",a.message,e);break;case"regex":W(s,a.regex,a.message,e);break;case"cuid":W(s,te.cuid,a.message,e);break;case"cuid2":W(s,te.cuid2,a.message,e);break;case"startsWith":W(s,RegExp(`^${dt(a.value,e)}`),a.message,e);break;case"endsWith":W(s,RegExp(`${dt(a.value,e)}$`),a.message,e);break;case"datetime":se(s,"date-time",a.message,e);break;case"date":se(s,"date",a.message,e);break;case"time":se(s,"time",a.message,e);break;case"duration":se(s,"duration",a.message,e);break;case"length":s.minLength=typeof s.minLength=="number"?Math.max(s.minLength,a.value):a.value,s.maxLength=typeof s.maxLength=="number"?Math.min(s.maxLength,a.value):a.value;break;case"includes":{W(s,RegExp(dt(a.value,e)),a.message,e);break}case"ip":{a.version!=="v6"&&se(s,"ipv4",a.message,e),a.version!=="v4"&&se(s,"ipv6",a.message,e);break}case"base64url":W(s,te.base64url,a.message,e);break;case"jwt":W(s,te.jwt,a.message,e);break;case"cidr":{a.version!=="v6"&&W(s,te.ipv4Cidr,a.message,e),a.version!=="v4"&&W(s,te.ipv6Cidr,a.message,e);break}case"emoji":W(s,te.emoji(),a.message,e);break;case"ulid":{W(s,te.ulid,a.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{se(s,"binary",a.message,e);break}case"contentEncoding:base64":{s.contentEncoding="base64";break}case"pattern:zod":{W(s,te.base64,a.message,e);break}}break}case"nanoid":W(s,te.nanoid,a.message,e)}return s}function dt(t,e){return e.patternStrategy==="escape"?Mr(t):t}var Ar=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Mr(t){let e="";for(let s=0;s<t.length;s++)Ar.has(t[s])||(e+="\\"),e+=t[s];return e}function se(t,e,s,a){var r;t.format||(r=t.anyOf)!=null&&r.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...s&&a.errorMessages&&{errorMessage:{format:s}}})):t.format=e}function W(t,e,s,a){var r;t.pattern||(r=t.allOf)!=null&&r.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:as(e,a),...s&&a.errorMessages&&{errorMessage:{pattern:s}}})):t.pattern=as(e,a)}function as(t,e){var s;if(!e.applyRegexFlags||!t.flags)return t.source;const a={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},r=a.i?t.source.toLowerCase():t.source;let n="",i=!1,o=!1,c=!1;for(let l=0;l<r.length;l++){if(i){n+=r[l],i=!1;continue}if(a.i){if(o){if(r[l].match(/[a-z]/)){c?(n+=r[l],n+=`${r[l-2]}-${r[l]}`.toUpperCase(),c=!1):r[l+1]==="-"&&((s=r[l+2])!=null&&s.match(/[a-z]/))?(n+=r[l],c=!0):n+=`${r[l]}${r[l].toUpperCase()}`;continue}}else if(r[l].match(/[a-z]/)){n+=`[${r[l]}${r[l].toUpperCase()}]`;continue}}if(a.m){if(r[l]==="^"){n+=`(^|(?<=[\r
4
- ]))`;continue}else if(r[l]==="$"){n+=`($|(?=[\r
5
- ]))`;continue}}if(a.s&&r[l]==="."){n+=o?`${r[l]}\r
6
- `:`[${r[l]}\r
7
- ]`;continue}n+=r[l],r[l]==="\\"?i=!0:o&&r[l]==="]"?o=!1:!o&&r[l]==="["&&(o=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return n}function ks(t,e){var s,a,r,n,i,o;const c={type:"object",additionalProperties:(s=P(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?s:e.allowedAdditionalProperties};if(((a=t.keyType)==null?void 0:a._def.typeName)===M.ZodString&&((r=t.keyType._def.checks)!=null&&r.length)){const{type:l,...d}=Rs(t.keyType._def,e);return{...c,propertyNames:d}}else{if(((n=t.keyType)==null?void 0:n._def.typeName)===M.ZodEnum)return{...c,propertyNames:{enum:t.keyType._def.values}};if(((i=t.keyType)==null?void 0:i._def.typeName)===M.ZodBranded&&t.keyType._def.type._def.typeName===M.ZodString&&((o=t.keyType._def.type._def.checks)!=null&&o.length)){const{type:l,...d}=Ms(t.keyType._def,e);return{...c,propertyNames:d}}}return c}function jr(t,e){if(e.mapStrategy==="record")return ks(t,e);const s=P(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||Q(),a=P(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||Q();return{type:"array",maxItems:125,items:{type:"array",items:[s,a],minItems:2,maxItems:2}}}function Rr(t){const e=t.values,a=Object.keys(t.values).filter(n=>typeof e[e[n]]!="number").map(n=>e[n]),r=Array.from(new Set(a.map(n=>typeof n)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:a}}function kr(){return{not:Q()}}function Or(){return{type:"null"}}var vt={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Pr(t,e){const s=t.options instanceof Map?Array.from(t.options.values()):t.options;if(s.every(a=>a._def.typeName in vt&&(!a._def.checks||!a._def.checks.length))){const a=s.reduce((r,n)=>{const i=vt[n._def.typeName];return i&&!r.includes(i)?[...r,i]:r},[]);return{type:a.length>1?a:a[0]}}else if(s.every(a=>a._def.typeName==="ZodLiteral"&&!a.description)){const a=s.reduce((r,n)=>{const i=typeof n._def.value;switch(i){case"string":case"number":case"boolean":return[...r,i];case"bigint":return[...r,"integer"];case"object":if(n._def.value===null)return[...r,"null"];default:return r}},[]);if(a.length===s.length){const r=a.filter((n,i,o)=>o.indexOf(n)===i);return{type:r.length>1?r:r[0],enum:s.reduce((n,i)=>n.includes(i._def.value)?n:[...n,i._def.value],[])}}}else if(s.every(a=>a._def.typeName==="ZodEnum"))return{type:"string",enum:s.reduce((a,r)=>[...a,...r._def.values.filter(n=>!a.includes(n))],[])};return Dr(t,e)}var Dr=(t,e)=>{const s=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((a,r)=>P(a._def,{...e,currentPath:[...e.currentPath,"anyOf",`${r}`]})).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0));return s.length?{anyOf:s}:void 0};function $r(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[vt[t.innerType._def.typeName],"null"]};const s=P(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return s&&{anyOf:[s,{type:"null"}]}}function Lr(t){const e={type:"number"};if(!t.checks)return e;for(const s of t.checks)switch(s.kind){case"int":e.type="integer";break;case"min":s.inclusive?e.minimum=s.value:e.exclusiveMinimum=s.value;break;case"max":s.inclusive?e.maximum=s.value:e.exclusiveMaximum=s.value;break;case"multipleOf":e.multipleOf=s.value;break}return e}function Zr(t,e){const s={type:"object",properties:{}},a=[],r=t.shape();for(const i in r){let o=r[i];if(o===void 0||o._def===void 0)continue;const c=Ur(o),l=P(o._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});l!==void 0&&(s.properties[i]=l,c||a.push(i))}a.length&&(s.required=a);const n=Fr(t,e);return n!==void 0&&(s.additionalProperties=n),s}function Fr(t,e){if(t.catchall._def.typeName!=="ZodNever")return P(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function Ur(t){try{return t.isOptional()}catch{return!0}}var zr=(t,e)=>{var s;if(e.currentPath.toString()===((s=e.propertyPath)==null?void 0:s.toString()))return P(t.innerType._def,e);const a=P(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return a?{anyOf:[{not:Q()},a]}:Q()},Br=(t,e)=>{if(e.pipeStrategy==="input")return P(t.in._def,e);if(e.pipeStrategy==="output")return P(t.out._def,e);const s=P(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),a=P(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",s?"1":"0"]});return{allOf:[s,a].filter(r=>r!==void 0)}};function Vr(t,e){return P(t.type._def,e)}function qr(t,e){const a={type:"array",uniqueItems:!0,items:P(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(a.minItems=t.minSize.value),t.maxSize&&(a.maxItems=t.maxSize.value),a}function Wr(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((s,a)=>P(s._def,{...e,currentPath:[...e.currentPath,"items",`${a}`]})).reduce((s,a)=>a===void 0?s:[...s,a],[]),additionalItems:P(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((s,a)=>P(s._def,{...e,currentPath:[...e.currentPath,"items",`${a}`]})).reduce((s,a)=>a===void 0?s:[...s,a],[])}}function Jr(){return{not:Q()}}function Hr(){return Q()}var Gr=(t,e)=>P(t.innerType._def,e),Yr=(t,e,s)=>{switch(e){case M.ZodString:return Rs(t,s);case M.ZodNumber:return Lr(t);case M.ZodObject:return Zr(t,s);case M.ZodBigInt:return xr(t);case M.ZodBoolean:return br();case M.ZodDate:return js(t,s);case M.ZodUndefined:return Jr();case M.ZodNull:return Or();case M.ZodArray:return yr(t,s);case M.ZodUnion:case M.ZodDiscriminatedUnion:return Pr(t,s);case M.ZodIntersection:return Tr(t,s);case M.ZodTuple:return Wr(t,s);case M.ZodRecord:return ks(t,s);case M.ZodLiteral:return Cr(t);case M.ZodEnum:return wr(t);case M.ZodNativeEnum:return Rr(t);case M.ZodNullable:return $r(t,s);case M.ZodOptional:return zr(t,s);case M.ZodMap:return jr(t,s);case M.ZodSet:return qr(t,s);case M.ZodLazy:return()=>t.getter()._def;case M.ZodPromise:return Vr(t,s);case M.ZodNaN:case M.ZodNever:return kr();case M.ZodEffects:return Ir(t,s);case M.ZodAny:return Q();case M.ZodUnknown:return Hr();case M.ZodDefault:return Er(t,s);case M.ZodBranded:return Ms(t,s);case M.ZodReadonly:return Gr(t,s);case M.ZodCatch:return Sr(t,s);case M.ZodPipeline:return Br(t,s);case M.ZodFunction:case M.ZodVoid:case M.ZodSymbol:return;default:return(a=>{})()}},Qr=(t,e)=>{let s=0;for(;s<t.length&&s<e.length&&t[s]===e[s];s++);return[(t.length-s).toString(),...e.slice(s)].join("/")};function P(t,e,s=!1){var a;const r=e.seen.get(t);if(e.override){const c=(a=e.override)==null?void 0:a.call(e,t,e,r,s);if(c!==gr)return c}if(r&&!s){const c=Kr(r,e);if(c!==void 0)return c}const n={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,n);const i=Yr(t,t.typeName,e),o=typeof i=="function"?P(i(),e):i;if(o&&Xr(t,e,o),e.postProcess){const c=e.postProcess(o,t,e);return n.jsonSchema=o,c}return n.jsonSchema=o,o}var Kr=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Qr(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((s,a)=>e.currentPath[a]===s)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),Q()):e.$refStrategy==="seen"?Q():void 0}},Xr=(t,e,s)=>(t.description&&(s.description=t.description),s),en=t=>{const e=vr(t),s=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:s,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([a,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,a],jsonSchema:void 0}]))}},tn=(t,e)=>{var s;const a=en(e);let r=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[d,m])=>{var h;return{...l,[d]:(h=P(m._def,{...a,currentPath:[...a.basePath,a.definitionPath,d]},!0))!=null?h:Q()}},{}):void 0;const n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=(s=P(t._def,n===void 0?a:{...a,currentPath:[...a.basePath,a.definitionPath,n]},!1))!=null?s:Q(),o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(i.title=o);const c=n===void 0?r?{...i,[a.definitionPath]:r}:i:{$ref:[...a.$refStrategy==="relative"?[]:a.basePath,a.definitionPath,n].join("/"),[a.definitionPath]:{...r,[n]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},yt=Symbol.for("vercel.ai.schema");function sn(t){let e;return()=>(e==null&&(e=t()),e)}function at(t,{validate:e}={}){return{[yt]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function an(t){return typeof t=="object"&&t!==null&&yt in t&&t[yt]===!0&&"jsonSchema"in t&&"validate"in t}function Rt(t){return t==null?at({properties:{},additionalProperties:!1}):an(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Os(t):rn(t):t()}function rn(t){return at(()=>jt(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const s=await t["~standard"].validate(e);return"value"in s?{success:!0,value:s.value}:{success:!1,error:new Oe({value:e,cause:s.issues})}}})}function nn(t,e){var s;const a=(s=void 0)!=null?s:!1;return at(()=>tn(t,{$refStrategy:a?"root":"none"}),{validate:async r=>{const n=await t.safeParseAsync(r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function on(t,e){var s;const a=(s=void 0)!=null?s:!1;return at(()=>jt(ga(t,{target:"draft-7",io:"input",reused:a?"ref":"inline"})),{validate:async r=>{const n=await ha(t,r);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function ln(t){return"_zod"in t}function Os(t,e){return ln(t)?on(t):nn(t)}async function rs({value:t,schema:e,context:s}){const a=await Be({value:t,schema:e,context:s});if(!a.success)throw Oe.wrap({value:t,cause:a.error,context:s});return a.value}async function Be({value:t,schema:e,context:s}){const a=Rt(e);try{if(a.validate==null)return{success:!0,value:t,rawValue:t};const r=await a.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:Oe.wrap({value:t,cause:r.error,context:s}),rawValue:t}}catch(r){return{success:!1,error:Oe.wrap({value:t,cause:r,context:s}),rawValue:t}}}async function Ee({text:t,schema:e}){try{const s=hr(t);return e==null?{success:!0,value:s,rawValue:s}:await Be({value:s,schema:e})}catch(s){return{success:!1,error:Yt.isInstance(s)?s:new Yt({text:t,cause:s}),rawValue:void 0}}}function cn({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new fa).pipeThrough(new TransformStream({async transform({data:s},a){s!=="[DONE]"&&a.enqueue(await Ee({text:s,schema:e}))}}))}async function ve(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var un=Object.defineProperty,dn=(t,e)=>{for(var s in e)un(t,s,{get:e[s],enumerable:!0})},Ps="AI_NoObjectGeneratedError",Ds=`vercel.ai.error.${Ps}`,pn=Symbol.for(Ds),$s,ye=class extends ce{constructor({message:t="No object generated.",cause:e,text:s,response:a,usage:r,finishReason:n}){super({name:Ps,message:t,cause:e}),this[$s]=!0,this.text=s,this.response=a,this.usage=r,this.finishReason=n}static isInstance(t){return ce.hasMarker(t,Ds)}};$s=pn;var Ls="AI_UIMessageStreamError",Zs=`vercel.ai.error.${Ls}`,mn=Symbol.for(Zs),Fs,Me=class extends ce{constructor({chunkType:t,chunkId:e,message:s}){super({name:Ls,message:s}),this[Fs]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return ce.hasMarker(t,Zs)}};Fs=mn;var ns="6.0.116",Us=Y([y(),Ke(Uint8Array),Ke(ArrayBuffer),hs(t=>{var e,s;return(s=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?s:!1},{message:"Must be a Buffer"})]),Ve=va(()=>Y([ya(),y(),xa(),J(),Fe(y(),Ve.optional()),qe(Ve)])),R=Fe(y(),Fe(y(),Ve.optional())),zs=D({type:T("text"),text:y(),providerOptions:R.optional()}),fn=D({type:T("image"),image:Y([Us,Ke(URL)]),mediaType:y().optional(),providerOptions:R.optional()}),Bs=D({type:T("file"),data:Y([Us,Ke(URL)]),filename:y().optional(),mediaType:y(),providerOptions:R.optional()}),hn=D({type:T("reasoning"),text:y(),providerOptions:R.optional()}),gn=D({type:T("tool-call"),toolCallId:y(),toolName:y(),input:he(),providerOptions:R.optional(),providerExecuted:J().optional()}),vn=ba("type",[D({type:T("text"),value:y(),providerOptions:R.optional()}),D({type:T("json"),value:Ve,providerOptions:R.optional()}),D({type:T("execution-denied"),reason:y().optional(),providerOptions:R.optional()}),D({type:T("error-text"),value:y(),providerOptions:R.optional()}),D({type:T("error-json"),value:Ve,providerOptions:R.optional()}),D({type:T("content"),value:qe(Y([D({type:T("text"),text:y(),providerOptions:R.optional()}),D({type:T("media"),data:y(),mediaType:y()}),D({type:T("file-data"),data:y(),mediaType:y(),filename:y().optional(),providerOptions:R.optional()}),D({type:T("file-url"),url:y(),providerOptions:R.optional()}),D({type:T("file-id"),fileId:Y([y(),Fe(y(),y())]),providerOptions:R.optional()}),D({type:T("image-data"),data:y(),mediaType:y(),providerOptions:R.optional()}),D({type:T("image-url"),url:y(),providerOptions:R.optional()}),D({type:T("image-file-id"),fileId:Y([y(),Fe(y(),y())]),providerOptions:R.optional()}),D({type:T("custom"),providerOptions:R.optional()})]))})]),Vs=D({type:T("tool-result"),toolCallId:y(),toolName:y(),output:vn,providerOptions:R.optional()}),yn=D({type:T("tool-approval-request"),approvalId:y(),toolCallId:y()}),xn=D({type:T("tool-approval-response"),approvalId:y(),approved:J(),reason:y().optional()}),bn=D({role:T("system"),content:y(),providerOptions:R.optional()}),Sn=D({role:T("user"),content:Y([y(),qe(Y([zs,fn,Bs]))]),providerOptions:R.optional()}),_n=D({role:T("assistant"),content:Y([y(),qe(Y([zs,Bs,hn,gn,Vs,yn]))]),providerOptions:R.optional()}),En=D({role:T("tool"),content:qe(Y([Vs,xn])),providerOptions:R.optional()});Y([bn,Sn,_n,En]);function qs(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const s={...t};for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const r=e[a];if(r===void 0)continue;const n=a in t?t[a]:void 0,i=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),o=n!=null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof Date)&&!(n instanceof RegExp);i&&o?s[a]=qs(n,r):s[a]=r}return s}var In={};dn(In,{array:()=>Cn,choice:()=>An,json:()=>Mn,object:()=>Tn,text:()=>Nn});function wn(t){const e=["ROOT"];let s=-1,a=null;function r(c,l,d){switch(c){case'"':{s=l,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{s=l,a=l,e.pop(),e.push(d),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{s=l,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{s=l,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{s=l,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function n(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{s=l,e.pop();break}}}function i(c,l){switch(c){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{s=l,e.pop();break}}}for(let c=0;c<t.length;c++){const l=t[c];switch(e[e.length-1]){case"ROOT":r(l,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{s=c,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(l,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{n(l,c);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),s=c;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:s=c}break}case"INSIDE_ARRAY_START":{l==="]"?(s=c,e.pop()):(s=c,r(l,c,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{s=c,e.pop();break}default:{s=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),s=c;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{s=c;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&n(l,c);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const m=t.substring(a,c+1);!"false".startsWith(m)&&!"true".startsWith(m)&&!"null".startsWith(m)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?n(l,c):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(l,c)):s=c;break}}}let o=t.slice(0,s+1);for(let c=e.length-1;c>=0;c--)switch(e[c]){case"INSIDE_STRING":{o+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const d=t.substring(a,t.length);"true".startsWith(d)?o+="true".slice(d.length):"false".startsWith(d)?o+="false".slice(d.length):"null".startsWith(d)&&(o+="null".slice(d.length))}}return o}async function Je(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await Ee({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await Ee({text:wn(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Nn=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),Tn=({schema:t,name:e,description:s})=>{const a=Rt(t);return{name:"object",responseFormat:ve(a.jsonSchema).then(r=>({type:"json",schema:r,...e!=null&&{name:e},...s!=null&&{description:s}})),async parseCompleteOutput({text:r},n){const i=await Ee({text:r});if(!i.success)throw new ye({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=await Be({value:i.value,schema:a});if(!o.success)throw new ye({message:"No object generated: response did not match schema.",cause:o.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});return o.value},async parsePartialOutput({text:r}){const n=await Je(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:n.value}}},createElementStreamTransform(){}}},Cn=({element:t,name:e,description:s})=>{const a=Rt(t);return{name:"array",responseFormat:ve(a.jsonSchema).then(r=>{const{$schema:n,...i}=r;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...s!=null&&{description:s}}}),async parseCompleteOutput({text:r},n){const i=await Ee({text:r});if(!i.success)throw new ye({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});const o=i.value;if(o==null||typeof o!="object"||!("elements"in o)||!Array.isArray(o.elements))throw new ye({message:"No object generated: response did not match schema.",cause:new Oe({value:o,cause:"response must be an object with an elements array"}),text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});for(const c of o.elements){const l=await Be({value:c,schema:a});if(!l.success)throw new ye({message:"No object generated: response did not match schema.",cause:l.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason})}return o.elements},async parsePartialOutput({text:r}){const n=await Je(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=n.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;const o=n.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(const l of o){const d=await Be({value:l,schema:a});d.success&&c.push(d.value)}return{partial:c}}}},createElementStreamTransform(){let r=0;return new TransformStream({transform({partialOutput:n},i){if(n!=null)for(;r<n.length;r++)i.enqueue(n[r])}})}}},An=({options:t,name:e,description:s})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...s!=null&&{description:s}}),async parseCompleteOutput({text:a},r){const n=await Ee({text:a});if(!n.success)throw new ye({message:"No object generated: could not parse the response.",cause:n.error,text:a,response:r.response,usage:r.usage,finishReason:r.finishReason});const i=n.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!t.includes(i.result))throw new ye({message:"No object generated: response did not match schema.",cause:new Oe({value:i,cause:"response must be an object that contains a choice value."}),text:a,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.result},async parsePartialOutput({text:a}){const r=await Je(a);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const n=r.value;if(n==null||typeof n!="object"||!("result"in n)||typeof n.result!="string")return;const i=t.filter(o=>o.startsWith(n.result));return r.state==="successful-parse"?i.includes(n.result)?{partial:n.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),Mn=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:s},a){const r=await Ee({text:s});if(!r.success)throw new ye({message:"No object generated: could not parse the response.",cause:r.error,text:s,response:a.response,usage:a.usage,finishReason:a.finishReason});return r.value},async parsePartialOutput({text:s}){const a=await Je(s);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return a.value===void 0?void 0:{partial:a.value}}},createElementStreamTransform(){}});We({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
8
-
9
- `)},flush(t){t.enqueue(`data: [DONE]
10
-
11
- `)}})}});var jn=sn(()=>Os(Y([$({type:T("text-start"),id:y(),providerMetadata:R.optional()}),$({type:T("text-delta"),id:y(),delta:y(),providerMetadata:R.optional()}),$({type:T("text-end"),id:y(),providerMetadata:R.optional()}),$({type:T("error"),errorText:y()}),$({type:T("tool-input-start"),toolCallId:y(),toolName:y(),providerExecuted:J().optional(),providerMetadata:R.optional(),dynamic:J().optional(),title:y().optional()}),$({type:T("tool-input-delta"),toolCallId:y(),inputTextDelta:y()}),$({type:T("tool-input-available"),toolCallId:y(),toolName:y(),input:he(),providerExecuted:J().optional(),providerMetadata:R.optional(),dynamic:J().optional(),title:y().optional()}),$({type:T("tool-input-error"),toolCallId:y(),toolName:y(),input:he(),providerExecuted:J().optional(),providerMetadata:R.optional(),dynamic:J().optional(),errorText:y(),title:y().optional()}),$({type:T("tool-approval-request"),approvalId:y(),toolCallId:y()}),$({type:T("tool-output-available"),toolCallId:y(),output:he(),providerExecuted:J().optional(),dynamic:J().optional(),preliminary:J().optional()}),$({type:T("tool-output-error"),toolCallId:y(),errorText:y(),providerExecuted:J().optional(),dynamic:J().optional()}),$({type:T("tool-output-denied"),toolCallId:y()}),$({type:T("reasoning-start"),id:y(),providerMetadata:R.optional()}),$({type:T("reasoning-delta"),id:y(),delta:y(),providerMetadata:R.optional()}),$({type:T("reasoning-end"),id:y(),providerMetadata:R.optional()}),$({type:T("source-url"),sourceId:y(),url:y(),title:y().optional(),providerMetadata:R.optional()}),$({type:T("source-document"),sourceId:y(),mediaType:y(),title:y(),filename:y().optional(),providerMetadata:R.optional()}),$({type:T("file"),url:y(),mediaType:y(),providerMetadata:R.optional()}),$({type:hs(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:y().optional(),data:he(),transient:J().optional()}),$({type:T("start-step")}),$({type:T("finish-step")}),$({type:T("start"),messageId:y().optional(),messageMetadata:he().optional()}),$({type:T("finish"),finishReason:Sa(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:he().optional()}),$({type:T("abort"),reason:y().optional()}),$({type:T("message-metadata"),messageMetadata:he()})])));function Rn(t){return t.type.startsWith("data-")}function xt(t){return t.type.startsWith("tool-")}function kn(t){return t.type==="dynamic-tool"}function Pe(t){return xt(t)||kn(t)}function os(t){return t.type.split("-").slice(1).join("-")}function On({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Pn({stream:t,messageMetadataSchema:e,dataPartSchemas:s,runUpdateMessageJob:a,onError:r,onToolCall:n,onData:i}){return t.pipeThrough(new TransformStream({async transform(o,c){await a(async({state:l,write:d})=>{var m,h,f,v;function S(p){const w=l.message.parts.filter(Pe).find(A=>A.toolCallId===p);if(w==null)throw new Me({chunkType:"tool-invocation",chunkId:p,message:`No tool invocation found for tool call ID "${p}".`});return w}function E(p){var I;const w=l.message.parts.find(N=>xt(N)&&N.toolCallId===p.toolCallId),A=p,g=w;w!=null?(w.state=p.state,g.input=A.input,g.output=A.output,g.errorText=A.errorText,g.rawInput=A.rawInput,g.preliminary=A.preliminary,p.title!==void 0&&(g.title=p.title),g.providerExecuted=(I=A.providerExecuted)!=null?I:w.providerExecuted,A.providerMetadata!=null&&(w.callProviderMetadata=A.providerMetadata)):l.message.parts.push({type:`tool-${p.toolName}`,toolCallId:p.toolCallId,state:p.state,title:p.title,input:A.input,output:A.output,rawInput:A.rawInput,errorText:A.errorText,providerExecuted:A.providerExecuted,preliminary:A.preliminary,...A.providerMetadata!=null?{callProviderMetadata:A.providerMetadata}:{}})}function b(p){var I,w;const A=l.message.parts.find(C=>C.type==="dynamic-tool"&&C.toolCallId===p.toolCallId),g=p,N=A;A!=null?(A.state=p.state,N.toolName=p.toolName,N.input=g.input,N.output=g.output,N.errorText=g.errorText,N.rawInput=(I=g.rawInput)!=null?I:N.rawInput,N.preliminary=g.preliminary,p.title!==void 0&&(N.title=p.title),N.providerExecuted=(w=g.providerExecuted)!=null?w:A.providerExecuted,g.providerMetadata!=null&&(A.callProviderMetadata=g.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:p.toolName,toolCallId:p.toolCallId,state:p.state,input:g.input,output:g.output,errorText:g.errorText,preliminary:g.preliminary,providerExecuted:g.providerExecuted,title:p.title,...g.providerMetadata!=null?{callProviderMetadata:g.providerMetadata}:{}})}async function x(p){if(p!=null){const I=l.message.metadata!=null?qs(l.message.metadata,p):p;e!=null&&await rs({value:I,schema:e,context:{field:"message.metadata",entityId:l.message.id}}),l.message.metadata=I}}switch(o.type){case"text-start":{const p={type:"text",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeTextParts[o.id]=p,l.message.parts.push(p),d();break}case"text-delta":{const p=l.activeTextParts[o.id];if(p==null)throw new Me({chunkType:"text-delta",chunkId:o.id,message:`Received text-delta for missing text part with ID "${o.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});p.text+=o.delta,p.providerMetadata=(m=o.providerMetadata)!=null?m:p.providerMetadata,d();break}case"text-end":{const p=l.activeTextParts[o.id];if(p==null)throw new Me({chunkType:"text-end",chunkId:o.id,message:`Received text-end for missing text part with ID "${o.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});p.state="done",p.providerMetadata=(h=o.providerMetadata)!=null?h:p.providerMetadata,delete l.activeTextParts[o.id],d();break}case"reasoning-start":{const p={type:"reasoning",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeReasoningParts[o.id]=p,l.message.parts.push(p),d();break}case"reasoning-delta":{const p=l.activeReasoningParts[o.id];if(p==null)throw new Me({chunkType:"reasoning-delta",chunkId:o.id,message:`Received reasoning-delta for missing reasoning part with ID "${o.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});p.text+=o.delta,p.providerMetadata=(f=o.providerMetadata)!=null?f:p.providerMetadata,d();break}case"reasoning-end":{const p=l.activeReasoningParts[o.id];if(p==null)throw new Me({chunkType:"reasoning-end",chunkId:o.id,message:`Received reasoning-end for missing reasoning part with ID "${o.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});p.providerMetadata=(v=o.providerMetadata)!=null?v:p.providerMetadata,p.state="done",delete l.activeReasoningParts[o.id],d();break}case"file":{l.message.parts.push({type:"file",mediaType:o.mediaType,url:o.url,...o.providerMetadata!=null?{providerMetadata:o.providerMetadata}:{}}),d();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:o.sourceId,url:o.url,title:o.title,providerMetadata:o.providerMetadata}),d();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:o.sourceId,mediaType:o.mediaType,title:o.title,filename:o.filename,providerMetadata:o.providerMetadata}),d();break}case"tool-input-start":{const p=l.message.parts.filter(xt);l.partialToolCalls[o.toolCallId]={text:"",toolName:o.toolName,index:p.length,dynamic:o.dynamic,title:o.title},o.dynamic?b({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted,title:o.title,providerMetadata:o.providerMetadata}):E({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted,title:o.title,providerMetadata:o.providerMetadata}),d();break}case"tool-input-delta":{const p=l.partialToolCalls[o.toolCallId];if(p==null)throw new Me({chunkType:"tool-input-delta",chunkId:o.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${o.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});p.text+=o.inputTextDelta;const{value:I}=await Je(p.text);p.dynamic?b({toolCallId:o.toolCallId,toolName:p.toolName,state:"input-streaming",input:I,title:p.title}):E({toolCallId:o.toolCallId,toolName:p.toolName,state:"input-streaming",input:I,title:p.title}),d();break}case"tool-input-available":{o.dynamic?b({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata,title:o.title}):E({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata,title:o.title}),d(),n&&!o.providerExecuted&&await n({toolCall:o});break}case"tool-input-error":{const p=l.message.parts.filter(Pe).find(w=>w.toolCallId===o.toolCallId);(p!=null?p.type==="dynamic-tool":!!o.dynamic)?b({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}):E({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:void 0,rawInput:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}),d();break}case"tool-approval-request":{const p=S(o.toolCallId);p.state="approval-requested",p.approval={id:o.approvalId},d();break}case"tool-output-denied":{const p=S(o.toolCallId);p.state="output-denied",d();break}case"tool-output-available":{const p=S(o.toolCallId);p.type==="dynamic-tool"?b({toolCallId:o.toolCallId,toolName:p.toolName,state:"output-available",input:p.input,output:o.output,preliminary:o.preliminary,providerExecuted:o.providerExecuted,title:p.title}):E({toolCallId:o.toolCallId,toolName:os(p),state:"output-available",input:p.input,output:o.output,providerExecuted:o.providerExecuted,preliminary:o.preliminary,title:p.title}),d();break}case"tool-output-error":{const p=S(o.toolCallId);p.type==="dynamic-tool"?b({toolCallId:o.toolCallId,toolName:p.toolName,state:"output-error",input:p.input,errorText:o.errorText,providerExecuted:o.providerExecuted,title:p.title}):E({toolCallId:o.toolCallId,toolName:os(p),state:"output-error",input:p.input,rawInput:p.rawInput,errorText:o.errorText,providerExecuted:o.providerExecuted,title:p.title}),d();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{o.messageId!=null&&(l.message.id=o.messageId),await x(o.messageMetadata),(o.messageId!=null||o.messageMetadata!=null)&&d();break}case"finish":{o.finishReason!=null&&(l.finishReason=o.finishReason),await x(o.messageMetadata),o.messageMetadata!=null&&d();break}case"message-metadata":{await x(o.messageMetadata),o.messageMetadata!=null&&d();break}case"error":{r?.(new Error(o.errorText));break}default:if(Rn(o)){if(s?.[o.type]!=null){const w=l.message.parts.findIndex(g=>"id"in g&&"data"in g&&g.id===o.id&&g.type===o.type),A=w>=0?w:l.message.parts.length;await rs({value:o.data,schema:s[o.type],context:{field:`message.parts[${A}].data`,entityName:o.type,entityId:o.id}})}const p=o;if(p.transient){i?.(p);break}const I=p.id!=null?l.message.parts.find(w=>p.type===w.type&&p.id===w.id):void 0;I!=null?I.data=p.data:l.message.parts.push(p),i?.(p),d()}}c.enqueue(o)})}}))}async function Dn({stream:t,onError:e}){const s=t.getReader();try{for(;;){const{done:a}=await s.read();if(a)break}}catch(a){e?.(a)}finally{s.releaseLock()}}We({prefix:"aitxt",size:24});We({prefix:"aiobj",size:24});var $n=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(t){return new Promise((e,s)=>{this.queue.push(async()=>{try{await t(),e()}catch(a){s(a)}}),this.processQueue()})}};We({prefix:"aiobj",size:24});async function Ln(t){if(t==null)return[];if(!globalThis.FileList||!(t instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(t).map(async e=>{const{name:s,type:a}=e,r=await new Promise((n,i)=>{const o=new FileReader;o.onload=c=>{var l;n((l=c.target)==null?void 0:l.result)},o.onerror=c=>i(c),o.readAsDataURL(e)});return{type:"file",mediaType:a,filename:s,url:r}}))}var Zn=class{constructor({api:t="/api/chat",credentials:e,headers:s,body:a,fetch:r,prepareSendMessagesRequest:n,prepareReconnectToStreamRequest:i}){this.api=t,this.credentials=e,this.headers=s,this.body=a,this.fetch=r,this.prepareSendMessagesRequest=n,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:t,...e}){var s,a,r,n,i;const o=await ve(this.body),c=await ve(this.headers),l=await ve(this.credentials),d={...Se(c),...Se(e.headers)},m=await((s=this.prepareSendMessagesRequest)==null?void 0:s.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...o,...e.body},headers:d,credentials:l,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),h=(a=m?.api)!=null?a:this.api,f=m?.headers!==void 0?Se(m.headers):d,v=m?.body!==void 0?m.body:{...o,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},S=(r=m?.credentials)!=null?r:l,b=await((n=this.fetch)!=null?n:globalThis.fetch)(h,{method:"POST",headers:es({"Content-Type":"application/json",...f},`ai-sdk/${ns}`,Xt()),body:JSON.stringify(v),credentials:S,signal:t});if(!b.ok)throw new Error((i=await b.text())!=null?i:"Failed to fetch the chat response.");if(!b.body)throw new Error("The response body is empty.");return this.processResponseStream(b.body)}async reconnectToStream(t){var e,s,a,r,n;const i=await ve(this.body),o=await ve(this.headers),c=await ve(this.credentials),l={...Se(o),...Se(t.headers)},d=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...i,...t.body},headers:l,credentials:c,requestMetadata:t.metadata})),m=(s=d?.api)!=null?s:`${this.api}/${t.chatId}/stream`,h=d?.headers!==void 0?Se(d.headers):l,f=(a=d?.credentials)!=null?a:c,S=await((r=this.fetch)!=null?r:globalThis.fetch)(m,{method:"GET",headers:es(h,`ai-sdk/${ns}`,Xt()),credentials:f});if(S.status===204)return null;if(!S.ok)throw new Error((n=await S.text())!=null?n:"Failed to fetch the chat response.");if(!S.body)throw new Error("The response body is empty.");return this.processResponseStream(S.body)}},Ws=class extends Zn{constructor(t={}){super(t)}processResponseStream(t){return cn({stream:t,schema:jn}).pipeThrough(new TransformStream({async transform(e,s){if(!e.success)throw e.error;s.enqueue(e.value)}}))}},Fn=class{constructor({generateId:t=dr,id:e=t(),transport:s=new Ws,messageMetadataSchema:a,dataPartSchemas:r,state:n,onError:i,onToolCall:o,onFinish:c,onData:l,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new $n,this.sendMessage=async(m,h)=>{var f,v,S,E;if(m==null){await this.makeRequest({trigger:"submit-message",messageId:(f=this.lastMessage)==null?void 0:f.id,...h});return}let b;if("text"in m||"files"in m?b={parts:[...Array.isArray(m.files)?m.files:await Ln(m.files),..."text"in m&&m.text!=null?[{type:"text",text:m.text}]:[]]}:b=m,m.messageId!=null){const x=this.state.messages.findIndex(p=>p.id===m.messageId);if(x===-1)throw new Error(`message with id ${m.messageId} not found`);if(this.state.messages[x].role!=="user")throw new Error(`message with id ${m.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,x+1),this.state.replaceMessage(x,{...b,id:m.messageId,role:(v=b.role)!=null?v:"user",metadata:m.metadata})}else this.state.pushMessage({...b,id:(S=b.id)!=null?S:this.generateId(),role:(E=b.role)!=null?E:"user",metadata:m.metadata});await this.makeRequest({trigger:"submit-message",messageId:m.messageId,...h})},this.regenerate=async({messageId:m,...h}={})=>{const f=m==null?this.state.messages.length-1:this.state.messages.findIndex(v=>v.id===m);if(f===-1)throw new Error(`message ${m} not found`);this.state.messages=this.state.messages.slice(0,this.messages[f].role==="assistant"?f:f+1),await this.makeRequest({trigger:"regenerate-message",messageId:m,...h})},this.resumeStream=async(m={})=>{await this.makeRequest({trigger:"resume-stream",...m})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:m,approved:h,reason:f})=>this.jobExecutor.run(async()=>{const v=this.state.messages,S=v[v.length-1],E=b=>Pe(b)&&b.state==="approval-requested"&&b.approval.id===m?{...b,state:"approval-responded",approval:{id:m,approved:h,reason:f}}:b;this.state.replaceMessage(v.length-1,{...S,parts:S.parts.map(E)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(E)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(b=>{var x;b&&this.makeRequest({trigger:"submit-message",messageId:(x=this.lastMessage)==null?void 0:x.id})})}),this.addToolOutput=async({state:m="output-available",tool:h,toolCallId:f,output:v,errorText:S})=>this.jobExecutor.run(async()=>{const E=this.state.messages,b=E[E.length-1],x=p=>Pe(p)&&p.toolCallId===f?{...p,state:m,output:v,errorText:S}:p;this.state.replaceMessage(E.length-1,{...b,parts:b.parts.map(x)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(x)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(p=>{var I;p&&this.makeRequest({trigger:"submit-message",messageId:(I=this.lastMessage)==null?void 0:I.id})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var m;this.status!=="streaming"&&this.status!=="submitted"||(m=this.activeResponse)!=null&&m.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=s,this.generateId=t,this.messageMetadataSchema=a,this.dataPartSchemas=r,this.state=n,this.onError=i,this.onToolCall=o,this.onFinish=c,this.onData=l,this.sendAutomaticallyWhen=d}get status(){return this.state.status}setStatus({status:t,error:e}){this.status!==t&&(this.state.status=t,this.state.error=e)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(t){this.state.messages=t}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;const t=this.sendAutomaticallyWhen({messages:this.state.messages});return t&&typeof t=="object"&&"then"in t?await t:t}async makeRequest({trigger:t,metadata:e,headers:s,body:a,messageId:r}){var n,i,o;let c;if(t==="resume-stream")try{const f=await this.transport.reconnectToStream({chatId:this.id,metadata:e,headers:s,body:a});if(f==null)return;c=f}catch(f){this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f});return}this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let d=!1,m=!1,h=!1;try{const f={state:On({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};f.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=f;let v;t==="resume-stream"?v=c:v=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:f.abortController.signal,metadata:e,headers:s,body:a,trigger:t,messageId:r});const S=E=>this.jobExecutor.run(()=>E({state:f.state,write:()=>{var b;this.setStatus({status:"streaming"}),f.state.message.id===((b=this.lastMessage)==null?void 0:b.id)?this.state.replaceMessage(this.state.messages.length-1,f.state.message):this.state.pushMessage(f.state.message)}}));await Dn({stream:Pn({stream:v,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:S,onError:E=>{throw E}}),onError:E=>{throw E}}),this.setStatus({status:"ready"})}catch(f){if(d||f.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;h=!0,f instanceof TypeError&&(f.message.toLowerCase().includes("fetch")||f.message.toLowerCase().includes("network"))&&(m=!0),this.onError&&f instanceof Error&&this.onError(f),this.setStatus({status:"error",error:f})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:m,isError:h,finishReason:(n=this.activeResponse)==null?void 0:n.state.finishReason})}catch(f){console.error(f)}this.activeResponse=void 0}!h&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(o=this.lastMessage)==null?void 0:o.id,metadata:e,headers:s,body:a})}};function Un({messages:t}){const e=t[t.length-1];if(!e||e.role!=="assistant")return!1;const s=e.parts.reduce((r,n,i)=>n.type==="step-start"?i:r,-1),a=e.parts.slice(s+1).filter(Pe).filter(r=>!r.providerExecuted);return a.filter(r=>r.state==="approval-responded").length>0&&a.every(r=>r.state==="output-available"||r.state==="output-error"||r.state==="approval-responded")}function zn({messages:t}){const e=t[t.length-1];if(!e||e.role!=="assistant")return!1;const s=e.parts.reduce((r,n,i)=>n.type==="step-start"?i:r,-1),a=e.parts.slice(s+1).filter(Pe).filter(r=>!r.providerExecuted);return a.length>0&&a.every(r=>r.state==="output-available"||r.state==="output-error")}var pt,is;function Bn(){if(is)return pt;is=1;function t(e,s){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let a,r=0;return function(...i){clearTimeout(a);const o=Date.now(),c=o-r,l=s-c;l<=0?(r=o,e.apply(this,i)):a=setTimeout(()=>{r=Date.now(),e.apply(this,i)},l)}}return pt=t,pt}var Vn=Bn();const qn=_a(Vn);var Js=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},L=(t,e,s)=>(Js(t,e,"read from private field"),s?s.call(t):e.get(t)),le=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},ge=(t,e,s,a)=>(Js(t,e,"write to private field"),e.set(t,s),s);function Wn(t,e){return e!=null?qn(t,e):t}var X,Ye,Qe,$e,Le,Ze,je,bt,St,Jn=class{constructor(t=[]){le(this,X,void 0),le(this,Ye,"ready"),le(this,Qe,void 0),le(this,$e,new Set),le(this,Le,new Set),le(this,Ze,new Set),this.pushMessage=e=>{ge(this,X,L(this,X).concat(e)),L(this,je).call(this)},this.popMessage=()=>{ge(this,X,L(this,X).slice(0,-1)),L(this,je).call(this)},this.replaceMessage=(e,s)=>{ge(this,X,[...L(this,X).slice(0,e),this.snapshot(s),...L(this,X).slice(e+1)]),L(this,je).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,s)=>{const a=s?Wn(e,s):e;return L(this,$e).add(a),()=>{L(this,$e).delete(a)}},this["~registerStatusCallback"]=e=>(L(this,Le).add(e),()=>{L(this,Le).delete(e)}),this["~registerErrorCallback"]=e=>(L(this,Ze).add(e),()=>{L(this,Ze).delete(e)}),le(this,je,()=>{L(this,$e).forEach(e=>e())}),le(this,bt,()=>{L(this,Le).forEach(e=>e())}),le(this,St,()=>{L(this,Ze).forEach(e=>e())}),ge(this,X,t)}get status(){return L(this,Ye)}set status(t){ge(this,Ye,t),L(this,bt).call(this)}get error(){return L(this,Qe)}set error(t){ge(this,Qe,t),L(this,St).call(this)}get messages(){return L(this,X)}set messages(t){ge(this,X,[...t]),L(this,je).call(this)}};X=new WeakMap;Ye=new WeakMap;Qe=new WeakMap;$e=new WeakMap;Le=new WeakMap;Ze=new WeakMap;je=new WeakMap;bt=new WeakMap;St=new WeakMap;var Re,ls=class extends Fn{constructor({messages:t,...e}){const s=new Jn(t);super({...e,state:s}),le(this,Re,void 0),this["~registerMessagesCallback"]=(a,r)=>L(this,Re)["~registerMessagesCallback"](a,r),this["~registerStatusCallback"]=a=>L(this,Re)["~registerStatusCallback"](a),this["~registerErrorCallback"]=a=>L(this,Re)["~registerErrorCallback"](a),ge(this,Re,s)}};Re=new WeakMap;function Hn({experimental_throttle:t,resume:e=!1,...s}={}){const a=_.useRef("chat"in s?{}:{onToolCall:s.onToolCall,onData:s.onData,onFinish:s.onFinish,onError:s.onError,sendAutomaticallyWhen:s.sendAutomaticallyWhen});"chat"in s||(a.current={onToolCall:s.onToolCall,onData:s.onData,onFinish:s.onFinish,onError:s.onError,sendAutomaticallyWhen:s.sendAutomaticallyWhen});const r={...s,onToolCall:h=>{var f,v;return(v=(f=a.current).onToolCall)==null?void 0:v.call(f,h)},onData:h=>{var f,v;return(v=(f=a.current).onData)==null?void 0:v.call(f,h)},onFinish:h=>{var f,v;return(v=(f=a.current).onFinish)==null?void 0:v.call(f,h)},onError:h=>{var f,v;return(v=(f=a.current).onError)==null?void 0:v.call(f,h)},sendAutomaticallyWhen:h=>{var f,v,S;return(S=(v=(f=a.current).sendAutomaticallyWhen)==null?void 0:v.call(f,h))!=null?S:!1}},n=_.useRef("chat"in s?s.chat:new ls(r));("chat"in s&&s.chat!==n.current||"id"in s&&n.current.id!==s.id)&&(n.current="chat"in s?s.chat:new ls(r));const o=_.useCallback(h=>n.current["~registerMessagesCallback"](h,t),[t,n.current.id]),c=_.useSyncExternalStore(o,()=>n.current.messages,()=>n.current.messages),l=_.useSyncExternalStore(n.current["~registerStatusCallback"],()=>n.current.status,()=>n.current.status),d=_.useSyncExternalStore(n.current["~registerErrorCallback"],()=>n.current.error,()=>n.current.error),m=_.useCallback(h=>{typeof h=="function"&&(h=h(n.current.messages)),n.current.messages=h},[n]);return _.useEffect(()=>{e&&n.current.resumeStream()},[e,n]),{id:n.current.id,messages:c,setMessages:m,sendMessage:n.current.sendMessage,regenerate:n.current.regenerate,clearError:n.current.clearError,stop:n.current.stop,error:d,resumeStream:n.current.resumeStream,status:l,addToolResult:n.current.addToolOutput,addToolOutput:n.current.addToolOutput,addToolApprovalResponse:n.current.addToolApprovalResponse}}function Gn(t){const{buildUrl:e,eventTypes:s}=t,a=new Map;function r(n){let i=a.get(n);if(!i){const o=new EventSource(e(n));i={es:o,refCount:0},a.set(n,i),o.onerror=()=>{o.readyState===EventSource.CLOSED&&a.delete(n)}}return i}return{subscribe(n,i){const o=r(n);o.refCount++;for(const l of s)o.es.addEventListener(l,i);let c=!1;return()=>{if(!c){c=!0;for(const l of s)o.es.removeEventListener(l,i);o.refCount--,o.refCount<=0&&(o.es.close(),a.delete(n))}}}}}const Yn=Gn({buildUrl:t=>{const e=Ut.join(",");return`/org/${t}/watch?types=${e}`},eventTypes:[...Ut]}),cs=()=>0;function Qn(t){const{orgId:e,taskId:s,enabled:a=!0,onStep:r,onFinish:n,onTaskStatus:i}=t,o=_.useRef({taskId:s,onStep:r,onFinish:n,onTaskStatus:i});o.current={taskId:s,onStep:r,onFinish:n,onTaskStatus:i};const c=_.useRef(null),l=_.useRef(a),d=_.useRef(e);(!c.current||l.current!==a||d.current!==e)&&(l.current=a,d.current=e,c.current=m=>{if(!a||!e)return()=>{};const h=f=>{let v;try{v=JSON.parse(f.data)}catch{return}const S=o.current;if(!(S.taskId&&v.subject!==S.taskId)){switch(v.type){case ct.STEP:S.onStep?.(v);break;case ct.FINISH:S.onFinish?.(v);break;case ct.THREAD_STATUS:S.onTaskStatus?.(v);break}m()}};return Yn.subscribe(e,h)}),_.useSyncExternalStore(c.current,cs,cs)}function Hs(){const t=F.c(21),{locator:e,org:s}=Ie();let a;t[0]!==e?(a=_e.allowedModels(e),t[0]=e,t[1]=a):a=t[1];let r;t[2]!==s?(r=async()=>{const E=await fetch(`/api/${s.slug}/decopilot/allowed-models`,{credentials:"include"});return E.ok?E.json():{allowAll:!0,models:{}}},t[2]=s,t[3]=r):r=t[3];let n;t[4]!==a||t[5]!==r?(n={queryKey:a,queryFn:r,staleTime:3e4},t[4]=a,t[5]=r,t[6]=n):n=t[6];const{data:i,isLoading:o}=$a(n),c=i?.allowAll??!0;let l;t[7]!==i?.models?(l=i?.models??{},t[7]=i?.models,t[8]=l):l=t[8];const d=l;let m;t[9]!==c||t[10]!==d?(m=(E,b)=>{if(c)return!0;const x=d[E];return x?x.includes("*")||x.includes(b):d["*"]?.includes("*")??!1},t[9]=c,t[10]=d,t[11]=m):m=t[11];const h=m;let f;t[12]!==c||t[13]!==d?(f=E=>{if(c)return!0;const b=d[E];if(b&&b.length>0)return!0;const x=d["*"];return x?x.length>0:!1},t[12]=c,t[13]=d,t[14]=f):f=t[14];const v=f;let S;return t[15]!==c||t[16]!==v||t[17]!==o||t[18]!==h||t[19]!==d?(S={allowAll:c,models:d,isLoading:o,isModelAllowed:h,hasConnectionModels:v},t[15]=c,t[16]=v,t[17]=o,t[18]=h,t[19]=d,t[20]=S):S=t[20],S}function Kn(t){const e=F.c(10);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={strict:!1},e[0]=s):s=e[0];const a=gs(s);let r;if(e[1]!==a.collectionName||e[2]!==a.connectionId||e[3]!==a.itemId||e[4]!==t){r=[],t&&r.push(`### Selected Agent
12
- - ID: ${t}`);let n;e[6]!==a.collectionName||e[7]!==a.connectionId||e[8]!==a.itemId?(n=[],a.connectionId&&n.push(`- Connection ID: ${a.connectionId}`),a.collectionName&&n.push(`- Collection: ${a.collectionName}`),a.itemId&&n.push(`- Item ID: ${a.itemId}`),e[6]=a.collectionName,e[7]=a.connectionId,e[8]=a.itemId,e[9]=n):n=e[9],n.length>0&&r.push(`### Current Resource
13
- The user is viewing the following resource:
14
- ${n.join(`
15
- `)}
16
-
17
- Help the user understand and work with this resource.`),e[1]=a.collectionName,e[2]=a.connectionId,e[3]=a.itemId,e[4]=t,e[5]=r}else r=e[5];return r.join(`
18
-
19
- `)}function Xn(){const t=F.c(5),e=st(),{org:s}=Ie();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},t[0]=a):a=t[0];const r=gs(a);let n;return t[1]!==s||t[2]!==r||t[3]!==e?(n=i=>{const c=i.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!c||!c[1])return;const l=c[1],d=r.connectionId;if(!d)return;e.invalidateQueries({queryKey:_e.collection(s.slug,d,l)});const m=l.toLowerCase().replace(/_/g," ");ke.success(`${m} updated`)},t[1]=s,t[2]=r,t[3]=e,t[4]=n):n=t[4],n}const mt=(()=>{if(typeof window>"u")return null;const t=new Audio("/sounds/notification.mp3");return t.preload="auto",t.addEventListener("error",e=>{console.warn("Failed to preload notification sound:",e)}),t.load(),t})();function eo(){return{showNotification:async e=>{const{title:s,body:a,icon:r="/favicon.svg",tag:n}=e;if(typeof Notification>"u")return;if(Notification.permission!=="granted"){Notification.requestPermission().then(o=>{o==="denied"&&ke.error("Notifications denied. Please enable them in your browser settings.")});return}if(document?.hasFocus())return;mt&&(mt.currentTime=0,mt.play().catch(o=>{console.warn("Failed to play notification sound:",o)}));const i=new Notification(s,{body:a,icon:r,tag:n});i.onclick=()=>{window.focus(),i.close()}}}}const us=["smarter","faster","cheaper"],ds={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},to=[{tier:"smarter",prefixes:["anthropic/claude-4.6-opus","anthropic/claude-opus-4.6","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","qwen/qwen-plus","qwen/qwen-turbo","qwen/qwen3-235b","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","qwen/qwen-long","cohere/command-r"]}],so=":free",ao=to.flatMap(({tier:t,prefixes:e})=>e.map(s=>({tier:t,prefix:s}))).sort((t,e)=>e.prefix.length-t.prefix.length),ro=new Set(["google/gemini-2.5-pro"]);function no(t){if(t.endsWith(so))return"cheaper";for(const{tier:e,prefix:s}of ao)if(t.startsWith(s)){if(ro.has(s)&&t.length>s.length&&t[s.length]==="-"){const r=t[s.length+1];if(!r||!/\d/.test(r))continue}return e}return null}const Gs=["anthropic/claude-4.6-opus-20260205","anthropic/claude-opus-4.6","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"],ps=new Set(Gs),_t=new Map;Gs.forEach((t,e)=>_t.set(t,e));const Ys="mesh:model-shortlist:";function oo(t){try{const e=localStorage.getItem(Ys+t);return e?JSON.parse(e):null}catch{return null}}function io(t,e){localStorage.setItem(Ys+t,JSON.stringify(e))}function kt(t){const e=F.c(3);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={pageSize:999},e[0]=s):s=e[0];const a=Da(t??void 0,s);let r;return e[1]!==a?(r=a.filter(co).sort(lo),e[1]=a,e[2]=r):r=e[2],r}function lo(t,e){const s=_t.get(t.id),a=_t.get(e.id);return s!==void 0&&a!==void 0?s-a:s!==void 0?-1:a!==void 0?1:t.title.localeCompare(e.title)}function co(t){return t.limits?.contextWindow&&t.limits?.maxOutputTokens}function uo(t){return t<32e3?{level:1,label:"Small",description:"Short conversations"}:t<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:t<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const po=["bg-destructive","bg-warning","bg-success","bg-success"],mo=["text-success","text-warning","text-warning","text-destructive"];function fo(t){const e=Math.round(t*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(t*.75)} words`}function ho(t){return t<1?{level:1,label:"Cheap"}:t<5?{level:2,label:"Moderate"}:t<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const go={text:{icon:u.jsx(Ya,{className:"size-3.5"}),label:"Text"},vision:{icon:u.jsx(Ka,{className:"size-3.5"}),label:"Vision"},tools:{icon:u.jsx(bs,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:u.jsx(xs,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:u.jsx(vs,{className:"size-3.5"}),label:"Web search"}};function vo(t){const e=F.c(5),{capability:s}=t;let a;e[0]!==s?(a=go[s]??{icon:null,label:s.charAt(0).toUpperCase()+s.slice(1)},e[0]=s,e[1]=a):a=e[1];const r=a;let n;return e[2]!==r.icon||e[3]!==r.label?(n=u.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[r.icon,r.label]}),e[2]=r.icon,e[3]=r.label,e[4]=n):n=e[4],n}function yo(t){const e=F.c(53),{model:s,compact:a}=t,r=a===void 0?!1:a;if(!s){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=g):g=e[0],g}const n=s.costs?.input!=null?s.costs.input*1e6:null,i=s.costs?.output!=null?s.costs.output*1e6:null;let o;e[1]!==s.id||e[2]!==s.provider||e[3]!==s.title?(o=s.title.includes(": ")?s.title.split(": ")[0]:s.provider??s.id.split("/")[0],e[1]=s.id,e[2]=s.provider,e[3]=s.title,e[4]=o):o=e[4];const c=o;let l;e[5]!==s.title?(l=s.title.includes(": ")?s.title.split(": ").slice(1).join(": "):s.title,e[5]=s.title,e[6]=l):l=e[6];const d=l;if(r){let g;e[7]!==s.limits?(g=s.limits?.contextWindow&&u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Context"}),u.jsxs("span",{className:"text-foreground font-medium",children:[s.limits.contextWindow.toLocaleString()," tokens"]})]}),e[7]=s.limits,e[8]=g):g=e[8];let N;e[9]!==n?(N=n!=null&&u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Input"}),u.jsxs("span",{className:"text-foreground font-medium",children:["$",n.toFixed(2)," / 1M"]})]}),e[9]=n,e[10]=N):N=e[10];let C;e[11]!==i?(C=i!=null&&u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Output"}),u.jsxs("span",{className:"text-foreground font-medium",children:["$",i.toFixed(2)," / 1M"]})]}),e[11]=i,e[12]=C):C=e[12];let O;e[13]!==s.limits?(O=s.limits?.maxOutputTokens&&u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),u.jsxs("span",{className:"text-foreground font-medium",children:[s.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[13]=s.limits,e[14]=O):O=e[14];let k;return e[15]!==g||e[16]!==N||e[17]!==C||e[18]!==O?(k=u.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[g,N,C,O]}),e[15]=g,e[16]=N,e[17]=C,e[18]=O,e[19]=k):k=e[19],k}let m;e[20]!==c?(m=u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[20]=c,e[21]=m):m=e[21];let h;e[22]!==s.logo||e[23]!==s.title?(h=s.logo&&u.jsx("img",{src:s.logo,className:"size-6 shrink-0 rounded-md",alt:s.title}),e[22]=s.logo,e[23]=s.title,e[24]=h):h=e[24];let f;e[25]!==d?(f=u.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[25]=d,e[26]=f):f=e[26];let v;e[27]!==h||e[28]!==f?(v=u.jsxs("div",{className:"flex items-center gap-2.5",children:[h,f]}),e[27]=h,e[28]=f,e[29]=v):v=e[29];let S;e[30]!==s.id?(S=u.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:s.id}),e[30]=s.id,e[31]=S):S=e[31];let E;e[32]!==m||e[33]!==v||e[34]!==S?(E=u.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[m,v,S]}),e[32]=m,e[33]=v,e[34]=S,e[35]=E):E=e[35];let b;e[36]!==s.capabilities?(b=s.capabilities&&s.capabilities.length>0&&u.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:s.capabilities.map(xo)}),e[36]=s.capabilities,e[37]=b):b=e[37];let x;e[38]!==s.limits?(x=s.limits?.contextWindow&&(()=>{const{level:g,label:N,description:C}=uo(s.limits.contextWindow);return u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(O=>u.jsx("div",{className:Ue("w-2 h-2 rounded-full",O<=g?po[g-1]:"bg-muted")},O))}),u.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),u.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",C]})]}),u.jsxs("span",{className:"text-sm text-muted-foreground",children:[s.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[38]=s.limits,e[39]=x):x=e[39];let p;e[40]!==s.limits?(p=s.limits?.maxOutputTokens&&u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),u.jsxs("div",{className:"flex items-baseline gap-2",children:[u.jsxs("span",{className:"text-sm text-foreground",children:[s.limits.maxOutputTokens.toLocaleString()," tokens"]}),u.jsx("span",{className:"text-sm text-muted-foreground",children:fo(s.limits.maxOutputTokens)})]})]}),e[40]=s.limits,e[41]=p):p=e[41];let I;e[42]!==n||e[43]!==i?(I=(n!=null||i!=null)&&(()=>{const{level:g,label:N}=n!=null?ho(n):{level:0,label:""};return u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),n!=null&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>u.jsx("span",{className:Ue("text-sm font-bold leading-none",C<=g?mo[g-1]:"text-muted-foreground/20"),children:"$"},C))}),u.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),u.jsxs("div",{className:"flex flex-col gap-1",children:[n!=null&&u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),u.jsxs("span",{className:"text-xs text-foreground",children:["$",n.toFixed(2)," / 1M tokens"]})]}),i!=null&&u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),u.jsxs("span",{className:"text-xs text-foreground",children:["$",i.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[42]=n,e[43]=i,e[44]=I):I=e[44];let w;e[45]!==x||e[46]!==p||e[47]!==I?(w=u.jsxs("div",{className:"flex flex-col gap-6",children:[x,p,I]}),e[45]=x,e[46]=p,e[47]=I,e[48]=w):w=e[48];let A;return e[49]!==b||e[50]!==w||e[51]!==E?(A=u.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[E,b,w]}),e[49]=b,e[50]=w,e[51]=E,e[52]=A):A=e[52],A}function xo(t){return u.jsx(vo,{capability:t},t)}function ms(t){const e=F.c(23),{model:s,onHover:a}=t;let r;e[0]!==s.title?(r=s.title.includes(": ")?s.title.split(": ").slice(1).join(": "):s.title,e[0]=s.title,e[1]=r):r=e[1];const n=r;let i;e[2]!==s.id||e[3]!==s.provider||e[4]!==s.title?(i=s.title.includes(": ")?s.title.split(": ")[0]:s.provider??s.id.split("/")[0],e[2]=s.id,e[3]=s.provider,e[4]=s.title,e[5]=i):i=e[5];const o=i;let c;e[6]!==s||e[7]!==a?(c=()=>a(s),e[6]=s,e[7]=a,e[8]=c):c=e[8];let l;e[9]!==s.logo||e[10]!==s.title?(l=s.logo&&u.jsx("img",{src:s.logo,className:"w-4 h-4 shrink-0 rounded-sm",alt:s.title}),e[9]=s.logo,e[10]=s.title,e[11]=l):l=e[11];let d;e[12]!==n?(d=u.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:n}),e[12]=n,e[13]=d):d=e[13];let m;e[14]!==o?(m=u.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:o}),e[14]=o,e[15]=m):m=e[15];let h;e[16]!==d||e[17]!==m?(h=u.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[d,m]}),e[16]=d,e[17]=m,e[18]=h):h=e[18];let f;return e[19]!==c||e[20]!==l||e[21]!==h?(f=u.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:c,children:[l,h]}),e[19]=c,e[20]=l,e[21]=h,e[22]=f):f=e[22],f}function bo(t){const e=F.c(21),{error:s,onRetry:a,connectionId:r,orgSlug:n}=t,i=Ea();let o;e[0]!==r||e[1]!==i||e[2]!==n?(o=()=>{!r||!n||i({to:"/$org/$project/mcps/$connectionId",params:{org:n,project:Ia,connectionId:r}})},e[0]=r,e[1]=i,e[2]=n,e[3]=o):o=e[3];const c=o;let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:u.jsx(wa,{className:"size-5 text-destructive"})}),e[4]=l):l=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[5]=d):d=e[5];const m=s?.message||"Could not fetch models from this provider.";let h;e[6]!==m?(h=u.jsxs("div",{className:"flex flex-col gap-1",children:[d,u.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[m," Try another provider or retry."]})]}),e[6]=m,e[7]=h):h=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=u.jsx(Xa,{className:"size-3.5"}),e[8]=f):f=e[8];let v;e[9]!==a?(v=u.jsxs(Xe,{variant:"outline",size:"sm",onClick:a,className:"gap-1.5",children:[f,"Retry"]}),e[9]=a,e[10]=v):v=e[10];let S;e[11]!==r||e[12]!==c||e[13]!==n?(S=r&&n&&u.jsxs(Xe,{variant:"outline",size:"sm",onClick:c,className:"gap-1.5",children:[u.jsx(At,{className:"size-3.5"}),"Configure"]}),e[11]=r,e[12]=c,e[13]=n,e[14]=S):S=e[14];let E;e[15]!==v||e[16]!==S?(E=u.jsxs("div",{className:"flex items-center gap-2",children:[v,S]}),e[15]=v,e[16]=S,e[17]=E):E=e[17];let b;return e[18]!==h||e[19]!==E?(b=u.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,h,E]}),e[18]=h,e[19]=E,e[20]=b):b=e[20],b}function So(){const t=F.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(_o)}),t[0]=e):e=t[0],e}function _o(t,e){return u.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[u.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),u.jsx(q,{className:"flex-1 h-4"}),u.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Eo({connectionId:t,allowAll:e,isModelAllowed:s,searchTerm:a,selectedModel:r,onModelSelect:n,onHover:i,managing:o,onToggleManage:c,allModelsRef:l,onSelectedModelResolved:d}){const m=kt(t??void 0);l.current=m,_.useEffect(()=>{if(r&&m.length>0){const g=m.find(N=>N.id===r.thinking.id)??null;g&&d(g)}},[r,m,d]);const h=e?m:m.filter(g=>t&&s(t,g.id)),[f,v]=_.useState(0),S=t?oo(t):null,E=S?new Set(S):ps,b=g=>{const N={smarter:[],faster:[],cheaper:[],other:[]};for(const C of g){const O=no(C.id);N[O??"other"].push(C)}for(const C of Object.keys(N))N[C].sort((O,k)=>O.title.localeCompare(k.title));return N};if(o){const g=a.trim()?h.filter(k=>{const B=a.toLowerCase();return k.title.toLowerCase().includes(B)||k.provider?.toLowerCase().includes(B)}):h,N=b(g),C=k=>{if(!t)return;const B=S??[...ps],V=B.includes(k)?B.filter(xe=>xe!==k):[...B,k];io(t,V),v(xe=>xe+1)},O=(k,B)=>B.length===0?null:u.jsxs("div",{children:[u.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:k}),B.map(V=>u.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:()=>i(V),children:[u.jsx(Za,{checked:E.has(V.id),onCheckedChange:()=>C(V.id)}),V.logo&&u.jsx("img",{src:V.logo,className:"w-5 h-5 shrink-0",alt:V.title}),u.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:V.title})]},V.id))]},k);return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[u.jsxs("button",{type:"button",onClick:c,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[u.jsx(Qa,{size:14}),"Back"]}),u.jsxs("span",{className:"text-xs text-muted-foreground",children:[h.filter(k=>E.has(k.id)).length," selected"]})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1",children:[us.map(k=>O(ds[k],N[k])),O("Other",N.other)]})]})}const x=h.filter(g=>E.has(g.id)),p=x.length>0?x:h,I=a.trim()?p.filter(g=>{const N=a.toLowerCase();return g.title.toLowerCase().includes(N)||g.provider?.toLowerCase().includes(N)||g.description?.toLowerCase().includes(N)}):p;if(I.length===0)return u.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center py-8 gap-3",children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"No models found"}),u.jsxs(Xe,{variant:"outline",size:"sm",onClick:c,className:"gap-1.5",children:[u.jsx(At,{className:"size-3.5"}),"Manage models"]})]});if(a.trim().length>0)return u.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:I.map(g=>{const N=g.id===r?.thinking.id;return u.jsx("div",{onClick:()=>n(g),className:Ue("rounded-lg mb-1",N&&"bg-accent/50"),children:u.jsx(ms,{model:g,onHover:i})},g.id)})});const w=b(I),A=(g,N)=>N.length===0?null:u.jsxs("div",{children:[u.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:g}),N.map(C=>{const O=C.id===r?.thinking.id;return u.jsx("div",{onClick:()=>n(C),className:Ue("rounded-lg mb-1",O&&"bg-accent/50"),children:u.jsx(ms,{model:C,onHover:i})},C.id)})]},g);return u.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[us.map(g=>A(ds[g],w[g])),w.other.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mx-3 my-2 border-t border-border"}),A("Other",w.other)]})]})}function Ot(t){const e=F.c(16),{model:s,placeholder:a}=t,r=a===void 0?"Select model":a;if(!s){let m;e[0]!==r?(m=u.jsx("span",{className:"text-sm text-muted-foreground",children:r}),e[0]=r,e[1]=m):m=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=u.jsx(ht,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[2]=h):h=e[2];let f;return e[3]!==m?(f=u.jsxs("div",{className:"flex items-center gap-1.5",children:[m,h]}),e[3]=m,e[4]=f):f=e[4],f}let n;e[5]!==s.title?(n=s.title.includes(": ")?s.title.split(": ").slice(1).join(": "):s.title,e[5]=s.title,e[6]=n):n=e[6];const i=n;let o;e[7]!==s.logo||e[8]!==s.title?(o=s.logo&&u.jsx("img",{src:s.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:s.title}),e[7]=s.logo,e[8]=s.title,e[9]=o):o=e[9];let c;e[10]!==i?(c=u.jsx("span",{className:"text-sm text-muted-foreground truncate whitespace-nowrap hidden md:inline",children:i}),e[10]=i,e[11]=c):c=e[11];let l;e[12]===Symbol.for("react.memo_cache_sentinel")?(l=u.jsx(ht,{size:14,className:"text-muted-foreground opacity-50 shrink-0 hidden md:inline"}),e[12]=l):l=e[12];let d;return e[13]!==o||e[14]!==c?(d=u.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[o,c,l]}),e[13]=o,e[14]=c,e[15]=d):d=e[15],d}function Mi(t){return t?.thinking?.capabilities?.vision===!0}function Io(){const t=F.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=u.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:u.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[u.jsx(q,{className:"size-4 shrink-0"}),u.jsx(q,{className:"flex-1 h-6"}),u.jsx(q,{className:"w-[140px] h-8 shrink-0"})]})}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=u.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px]",children:[e,u.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(wo)})]}),t[1]=s):s=t[1];let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[u.jsx(q,{className:"size-6 shrink-0"}),u.jsx(q,{className:"h-6 w-32"})]}),t[2]=a):a=t[2];let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=u.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[a,u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(q,{className:"h-6 w-20 rounded-md"}),u.jsx(q,{className:"h-6 w-24 rounded-md"})]})]}),t[3]=r):r=t[3];let n;t[4]===Symbol.for("react.memo_cache_sentinel")?(n=u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(q,{className:"h-4 w-24"}),u.jsx(q,{className:"h-4 w-32"})]}),t[4]=n):n=t[4];let i;return t[5]===Symbol.for("react.memo_cache_sentinel")?(i=u.jsxs("div",{className:"flex flex-col md:flex-row h-[460px]",children:[s,u.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:u.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[r,u.jsxs("div",{className:"flex flex-col gap-4",children:[n,u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(q,{className:"h-4 w-16"}),u.jsx(q,{className:"h-4 w-40"})]})]})]})})]}),t[5]=i):i=t[5],i}function wo(t,e){return u.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[u.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),u.jsx(q,{className:"flex-1 h-4"}),u.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function No(t){const e=F.c(51),{selectedModel:s,onModelChange:a,onClose:r,modelsConnections:n}=t,[i,o]=_.useState(null),[c,l]=_.useState(""),[d,m]=_.useState(!1),h=_.useRef(null);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=[],e[0]=f):f=e[0];const v=_.useRef(f),[S,E]=_.useState(null),{org:b}=Ie(),x=Tt(),p=n??x,{isModelAllowed:I,allowAll:w,hasConnectionModels:A}=Hs();let g;e[1]!==p||e[2]!==w||e[3]!==A?(g=w?p:p.filter(G=>A(G.id)),e[1]=p,e[2]=w,e[3]=A,e[4]=g):g=e[4];const N=g,[C,O]=_.useState(s?.connectionId??N[0]?.id??null);let k,B;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{setTimeout(()=>{h.current?.focus()},0)},B=[],e[5]=k,e[6]=B):(k=e[5],B=e[6]),_.useEffect(k,B);let V;e[7]===Symbol.for("react.memo_cache_sentinel")?(V=G=>{O(G),o(null)},e[7]=V):V=e[7];const xe=V;let we;e[8]!==r||e[9]!==a||e[10]!==C?(we=G=>{C&&(a({id:G.id,connectionId:C,provider:G.provider??void 0,capabilities:G.capabilities,limits:G.limits??void 0}),l(""),r())},e[8]=r,e[9]=a,e[10]=C,e[11]=we):we=e[11];const De=we;let U;e[12]===Symbol.for("react.memo_cache_sentinel")?(U=u.jsx(vs,{size:16,className:"text-muted-foreground shrink-0"}),e[12]=U):U=e[12];const ae=d?"Search all models...":"Search for a model...";let Ne;e[13]===Symbol.for("react.memo_cache_sentinel")?(Ne=G=>l(G.target.value),e[13]=Ne):Ne=e[13];let me;e[14]!==c||e[15]!==ae?(me=u.jsx(Fa,{ref:h,type:"text",placeholder:ae,value:c,onChange:Ne,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[14]=c,e[15]=ae,e[16]=me):me=e[16];let ue;e[17]!==N||e[18]!==C?(ue=N.length>0&&u.jsxs(qa,{value:C??"",onValueChange:xe,children:[u.jsxs(Wa,{size:"sm",className:"w-auto min-w-[140px] h-8 shrink-0 [&>svg:last-child]:hidden",onClick:Ao,children:[u.jsx(Ja,{placeholder:"Select connection"}),u.jsx(ys,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),u.jsx(Ha,{children:N.map(Co)})]}),e[17]=N,e[18]=C,e[19]=ue):ue=e[19];let re;e[20]!==me||e[21]!==ue?(re=u.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:u.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[U,me,ue]})}),e[20]=me,e[21]=ue,e[22]=re):re=e[22];let H;e[23]!==b.slug||e[24]!==C?(H=G=>{const{error:nt,resetError:ot}=G;return u.jsx(bo,{error:nt,onRetry:ot,connectionId:C,orgSlug:b.slug})},e[23]=b.slug,e[24]=C,e[25]=H):H=e[25];let ee;e[26]===Symbol.for("react.memo_cache_sentinel")?(ee=u.jsx(So,{}),e[26]=ee):ee=e[26];let ne;e[27]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>m(To),e[27]=ne):ne=e[27];let fe;e[28]!==w||e[29]!==De||e[30]!==I||e[31]!==d||e[32]!==c||e[33]!==C||e[34]!==s?(fe=u.jsx(_.Suspense,{fallback:ee,children:u.jsx(Eo,{connectionId:C,allowAll:w,isModelAllowed:I,searchTerm:c,selectedModel:s,onModelSelect:De,onHover:o,managing:d,onToggleManage:ne,allModelsRef:v,onSelectedModelResolved:E})}),e[28]=w,e[29]=De,e[30]=I,e[31]=d,e[32]=c,e[33]=C,e[34]=s,e[35]=fe):fe=e[35];let K;e[36]!==C||e[37]!==H||e[38]!==fe?(K=u.jsx(Et,{fallback:H,children:fe},C),e[36]=C,e[37]=H,e[38]=fe,e[39]=K):K=e[39];let oe;e[40]!==d?(oe=!d&&u.jsx("div",{className:"border-t border-border",children:u.jsxs("button",{type:"button",onClick:()=>m(!0),className:"flex items-center gap-2 w-full px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[u.jsx(At,{className:"size-3.5 shrink-0"}),"Manage models"]})}),e[40]=d,e[41]=oe):oe=e[41];let ie;e[42]!==re||e[43]!==K||e[44]!==oe?(ie=u.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px]",children:[re,K,oe]}),e[42]=re,e[43]=K,e[44]=oe,e[45]=ie):ie=e[45];const Te=i??S;let de;e[46]!==Te?(de=u.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:u.jsx(yo,{model:Te})}),e[46]=Te,e[47]=de):de=e[47];let Ce;return e[48]!==ie||e[49]!==de?(Ce=u.jsxs("div",{className:"flex flex-col md:flex-row h-[460px]",children:[ie,de]}),e[48]=ie,e[49]=de,e[50]=Ce):Ce=e[50],Ce}function To(t){return!t}function Co(t){return u.jsx(Ga,{value:t.id,children:u.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?u.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):u.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),u.jsx("span",{children:t.title})]})},t.id)}function Ao(t){return t.stopPropagation()}function Mo(t){const e=F.c(6),{selectedModel:s,placeholder:a}=t,r=s?.connectionId??void 0,n=kt(r);let i;e[0]!==n||e[1]!==s?(i=s?n.find(l=>l.id===s.thinking.id):void 0,e[0]=n,e[1]=s,e[2]=i):i=e[2];const o=i;let c;return e[3]!==o||e[4]!==a?(c=u.jsx(Ot,{model:o,placeholder:a}),e[3]=o,e[4]=a,e[5]=c):c=e[5],c}function jo(t){const e=F.c(9),{selectedModel:s,placeholder:a}=t;if(!s){let d;return e[0]!==a?(d=u.jsx(Ot,{model:void 0,placeholder:a}),e[0]=a,e[1]=d):d=e[1],d}const r=s.thinking.id;let n;e[2]!==r?(n=r.split("/").pop()??r,e[2]=r,e[3]=n):n=e[3];const i=n;let o;e[4]!==i?(o=u.jsx("span",{className:"text-sm text-muted-foreground truncate whitespace-nowrap hidden md:inline",children:i}),e[4]=i,e[5]=o):o=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=u.jsx(ht,{size:14,className:"text-muted-foreground opacity-50 shrink-0 hidden md:inline"}),e[6]=c):c=e[6];let l;return e[7]!==o?(l=u.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[o,c]}),e[7]=o,e[8]=l):l=e[8],l}function ji(t){const e=F.c(32),{selectedModel:s,onModelChange:a,modelsConnections:r,variant:n,className:i,placeholder:o}=t,c=n===void 0?"borderless":n,l=o===void 0?"Select model":o,[d,m]=_.useState(!1),h=Tt(),f=r??h;if(f.length===0)return null;const v=c==="borderless"?"ghost":"outline",S=c==="borderless"&&"md:border-none";let E;e[0]!==i||e[1]!==S?(E=Ue("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",S,i),e[0]=i,e[1]=S,e[2]=E):E=e[2];let b;e[3]!==l||e[4]!==s?(b=u.jsx(jo,{selectedModel:s,placeholder:l}),e[3]=l,e[4]=s,e[5]=b):b=e[5];let x;e[6]!==l?(x=u.jsx(Ot,{model:void 0,placeholder:l}),e[6]=l,e[7]=x):x=e[7];let p;e[8]!==l||e[9]!==s?(p=u.jsx(Mo,{selectedModel:s,placeholder:l}),e[8]=l,e[9]=s,e[10]=p):p=e[10];let I;e[11]!==x||e[12]!==p?(I=u.jsx(_.Suspense,{fallback:x,children:p}),e[11]=x,e[12]=p,e[13]=I):I=e[13];let w;e[14]!==b||e[15]!==I?(w=u.jsx(Et,{fallback:b,children:I}),e[14]=b,e[15]=I,e[16]=w):w=e[16];let A;e[17]!==w||e[18]!==v||e[19]!==E?(A=u.jsx(Ua,{asChild:!0,children:u.jsx(Xe,{variant:v,size:"sm",className:E,children:w})}),e[17]=w,e[18]=v,e[19]=E,e[20]=A):A=e[20];let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=u.jsx(za,{className:"sr-only",children:"Select model"}),e[21]=g):g=e[21];let N;e[22]===Symbol.for("react.memo_cache_sentinel")?(N=u.jsx(Io,{}),e[22]=N):N=e[22];let C;e[23]===Symbol.for("react.memo_cache_sentinel")?(C=()=>m(!1),e[23]=C):C=e[23];let O;e[24]!==f||e[25]!==a||e[26]!==s?(O=u.jsxs(Ba,{className:"p-0 gap-0 sm:max-w-fit overflow-hidden",closeButtonClassName:"top-3.5 right-3.5 z-20",children:[g,u.jsx(_.Suspense,{fallback:N,children:u.jsx(No,{selectedModel:s,onModelChange:a,onClose:C,modelsConnections:f})})]}),e[24]=f,e[25]=a,e[26]=s,e[27]=O):O=e[27];let k;return e[28]!==d||e[29]!==A||e[30]!==O?(k=u.jsxs(Va,{open:d,onOpenChange:m,children:[A,O]}),e[28]=d,e[29]=A,e[30]=O,e[31]=k):k=e[31],k}function Ro(){const t=F.c(2),e=st();let s;return t[0]!==e?(s={prefillCollectionCache:(r,n,i,o)=>{if(!r)return;const c=Mt(r,n,i,o);if(e.getQueryData(c))return;const d={structuredContent:{items:[]},isError:!1};e.setQueryData(c,d)}},t[0]=e,t[1]=s):s=t[1],s}const pe={TASK_MESSAGES_PAGE_SIZE:100,TASKS_PAGE_SIZE:50,QUERY_STALE_TIME:3e4};function ft(t,e,s,a){const r=_e.tasks(e),n=t.getQueryData(r);if(!n)return;const i=n.pages.map(c=>{const l=c.items.findIndex(f=>f.id===s);if(l===-1)return c;const d=[...c.items],m=d[l];if(!m)return c;const h={id:m.id,title:a.title??m.title,created_at:m.created_at,updated_at:a.updated_at??m.updated_at,hidden:a.hidden??m.hidden,status:a.status??m.status};return d[l]=h,{...c,items:d}});i.some((c,l)=>c.items.length!==n.pages[l]?.items.length||c.items.some((d,m)=>d.id===s&&d!==n.pages[l]?.items[m]))&&t.setQueryData(r,{...n,pages:i})}function ko(t,e,s){const a=_e.tasks(e),r=t.getQueryData(a);if(!r){t.setQueryData(a,{pages:[{items:[s],hasMore:!1,totalCount:1}],pageParams:[0]});return}if(r.pages.some(o=>o.items.some(c=>c.id===s.id)))return;const i=r.pages[0];if(i){const o={...i,items:[s,...i.items],totalCount:(i.totalCount??i.items.length)+1};t.setQueryData(a,{...r,pages:[o,...r.pages.slice(1)]})}else t.setQueryData(a,{...r,pages:[{items:[s],hasMore:!1,totalCount:1}]})}async function Oo(t,e,s,a){if(!e)return;const r=Mt(e,"THREAD_MESSAGES",s,{filters:[{column:"thread_id",value:a}],pageSize:pe.TASK_MESSAGES_PAGE_SIZE});if(!r||t.getQueryData(r))return;const i="COLLECTION_THREAD_MESSAGES_LIST",o=er(void 0,[{column:"thread_id",value:a}],[]),c=tr(void 0,void 0,"updated_at"),l={...o&&{where:o},...c&&{orderBy:c},limit:pe.TASK_MESSAGES_PAGE_SIZE,offset:0};await t.fetchQuery({queryKey:r,queryFn:async()=>await e.callTool({name:i,arguments:l}),staleTime:pe.QUERY_STALE_TIME,retry:!1})}function Po(t,e,s,a,r){if(!e)return;const n=Mt(e,"THREAD_MESSAGES",s,{filters:[{column:"thread_id",value:a}],pageSize:pe.TASK_MESSAGES_PAGE_SIZE});n&&t.setQueryData(n,{structuredContent:{items:r},isError:!1})}async function fs(t,e,s){if(!t)throw new Error("MCP client is not available");const a=await t.callTool({name:"COLLECTION_THREADS_UPDATE",arguments:{id:e,data:s}});return(a.structuredContent??a).item}function Do(t){const e=new Date().toISOString();return{id:t,title:"New chat",created_at:e,updated_at:e}}function $o(t,e){return t.find(s=>s.id!==e)??null}function Lo(){const t=F.c(17),{locator:e,org:s}=Ie();let a;t[0]!==s.id?(a={connectionId:Nt,orgId:s.id},t[0]=s.id,t[1]=a):a=t[1];const r=wt(a);let n;t[2]!==e?(n=_e.tasks(e),t[2]=e,t[3]=n):n=t[3];let i;t[4]!==r?(i=async E=>{const{pageParam:b}=E,x=b===void 0?0:b;if(!r)throw new Error("MCP client is not available");const p={limit:pe.TASKS_PAGE_SIZE,offset:x},I=await r.callTool({name:"COLLECTION_THREADS_LIST",arguments:p}),w=I.structuredContent??I;return{items:w.items??[],hasMore:w.hasMore??!1,totalCount:w.totalCount}},t[4]=r,t[5]=i):i=t[5];let o;t[6]!==n||t[7]!==i?(o={queryKey:n,queryFn:i,getNextPageParam:Fo,initialPageParam:0,staleTime:pe.QUERY_STALE_TIME},t[6]=n,t[7]=i,t[8]=o):o=t[8];const{data:c,fetchNextPage:l,hasNextPage:d,isFetchingNextPage:m,refetch:h}=ar(o);let f;t[9]!==c?.pages?(f=c?.pages.flatMap(Zo)??[],t[9]=c?.pages,t[10]=f):f=t[10];const v=f;let S;return t[11]!==l||t[12]!==d||t[13]!==m||t[14]!==h||t[15]!==v?(S={tasks:v,refetch:h,hasNextPage:d,isFetchingNextPage:m,fetchNextPage:l},t[11]=l,t[12]=d,t[13]=m,t[14]=h,t[15]=v,t[16]=S):S=t[16],S}function Zo(t){return t.items}function Fo(t,e){if(t.hasMore)return e.length*pe.TASKS_PAGE_SIZE}function Uo(t){const e=F.c(6),{org:s}=Ie();let a;e[0]!==s.id?(a={connectionId:Nt,orgId:s.id},e[0]=s.id,e[1]=a):a=e[1];const r=wt(a);let n;e[2]!==t?(n={filters:t?[{column:"thread_id",value:t}]:[],pageSize:pe.TASK_MESSAGES_PAGE_SIZE},e[2]=t,e[3]=n):n=e[3];const i=sr(s.id,"THREAD_MESSAGES",r,n);let o;return e[4]!==i?(o=i??[],e[4]=i,e[5]=o):o=e[5],o}function zo(){const{locator:t,org:e}=Ie(),s=st(),{prefillCollectionCache:a}=Ro(),{tasks:r,hasNextPage:n,isFetchingNextPage:i,fetchNextPage:o}=Lo(),c=wt({connectionId:Nt,orgId:e.id}),[l,d]=et(Ct.assistantChatActiveTask(t),r[0]?.id??crypto.randomUUID()),m=Uo(l),h=()=>{const x=crypto.randomUUID(),p=Do(x);ko(s,t,p),c&&a(c,"THREAD_MESSAGES",e.id,{filters:[{column:"thread_id",value:x}],pageSize:pe.TASK_MESSAGES_PAGE_SIZE}),d(x)},f=async x=>{await Oo(s,c,e.id,x),d(x)};return{tasks:r,activeTaskId:l,messages:m,hasNextPage:n,isFetchingNextPage:i,fetchNextPage:o,createTask:h,switchToTask:f,updateTask:(x,p)=>{ft(s,t,x,p)},renameTask:async(x,p)=>{try{const I=await fs(c,x,{title:p});I&&ft(s,t,x,{title:p,updated_at:I.updated_at??new Date().toISOString()})}catch(I){const w=I;ke.error(`Failed to rename task: ${w.message}`),console.error("[chat] Failed to rename task:",I)}},hideTask:async x=>{try{const p=await fs(c,x,{hidden:!0});if(p){if(x===l){const w=$o(r,x);w?await f(w.id):h()}ft(s,t,x,{hidden:!0,updated_at:p.updated_at??new Date().toISOString()})}}catch(p){const I=p;ke.error(`Failed to update task: ${I.message}`),console.error("[chat] Failed to update task:",p)}},updateMessagesCache:(x,p)=>{Po(s,c,e.id,x,p)}}}const Qs={parentTask:null,finishReason:null};function Bo(t,e){switch(e.type){case"START_BRANCH":return{...t,parentTask:e.payload};case"CLEAR_BRANCH":return{...t,parentTask:null};case"SET_FINISH_REASON":return t.finishReason===e.payload?t:{...t,finishReason:e.payload};case"CLEAR_FINISH_REASON":return{...t,finishReason:null};case"RESET":return Qs;default:return t}}const Vo=(t,e)=>new Ws({api:`/api/${t}/decopilot/stream`,credentials:"include",prepareReconnectToStreamRequest:({id:s})=>({api:`/api/${t}/decopilot/attach/${s}`}),prepareSendMessagesRequest:({messages:s,requestMetadata:a={}})=>{const{system:r,tiptapDoc:n,...i}=a,o=r?{id:crypto.randomUUID(),role:"system",parts:[{type:"text",text:r}]}:null,c=s.slice(-1).filter(Boolean),l=o?[o,...c]:c,d=s.at(-1)?.metadata??{},m={...i,agent:i.agent??d.agent,models:i.models??d.models,thread_id:i.thread_id??d.thread_id};return{body:{messages:l,...m,...e.current&&{toolApprovalLevel:e.current}}}}}),qo=(t,e)=>t?.find(s=>s.id===e)??t?.[0]??null,Wo=(t,e)=>{const s=F.c(11);let a;s[0]!==t?(a=Ct.chatSelectedModel(t),s[0]=t,s[1]=a):a=s[1];const[r,n]=et(a,null),i=r?.connectionId;let o;s[2]!==e||s[3]!==i?(o=qo(e,i),s[2]=e,s[3]=i,s[4]=o):o=s[4];const c=o;let l;s[5]!==r||s[6]!==c?(l=r&&c?{connectionId:c.id,thinking:{id:r.id,provider:r.provider,capabilities:r.capabilities?{vision:r.capabilities.includes("vision")?!0:void 0,text:r.capabilities.includes("text")?!0:void 0,tools:r.capabilities.includes("tools")?!0:void 0}:void 0,limits:r.limits}}:null,s[5]=r,s[6]=c,s[7]=l):l=s[7];const d=l;let m;return s[8]!==d||s[9]!==n?(m=[d,n],s[8]=d,s[9]=n,s[10]=m):m=s[10],m};function Jo(t,e){const s=[];for(const a of t)"text"in a&&a.text?s.push({type:"text",text:`[${e}]
20
- ${a.text}`}):"blob"in a&&a.blob&&a.mimeType&&s.push({type:"file",url:`data:${a.mimeType};base64,${a.blob}`,filename:String(a.uri),mediaType:String(a.mimeType)});return s}function Ho(t,e){const s=[];for(const a of t){if(a.role!=="user"||!a.content)continue;const r=Array.isArray(a.content)?a.content:[a.content];for(const n of r)switch(n.type){case"text":{const i=n.text?.trim();if(!i)continue;s.push({type:"text",text:`[${e}]
21
- ${i}`});break}case"image":case"audio":{if(!n.data||!n.mimeType)continue;s.push({type:"file",url:`data:${n.mimeType};base64,${n.data}`,mediaType:n.mimeType});break}case"resource":{const i=n.resource;if(!i||!i.mimeType)continue;i&&("text"in i&&i.text?s.push({type:"text",text:`[${e}]
22
- ${i.text}`}):"blob"in i&&i.blob&&i.mimeType&&s.push({type:"file",url:`data:${i.mimeType};base64,${i.blob}`,filename:String(i.uri),mediaType:String(i.mimeType)}));break}}}return s}function Go(t,e){const{mimeType:s,data:a}=t;if(s.startsWith("text/"))try{const r=atob(a);return[{type:"text",text:`${e}
23
- ${r}`}]}catch(r){console.error("Failed to decode text file:",r)}return[{type:"file",url:`data:${s};base64,${a}`,filename:e,mediaType:s}]}function Yo(t){if(!t)return[];const e=[];let s="";const a=r=>{if(r){if(r.type==="text"&&"text"in r&&typeof r.text=="string")s+=r.text;else if(r.type==="mention"&&r.attrs){const n=r.attrs.char??"/",i=`${n}${r.attrs.name}`;if(s+=i,n==="@"){const o=r.attrs.metadata||[];e.push(...Jo(o,i))}else{const o=r.attrs.metadata||r.attrs.prompts||[];e.push(...Ho(o,i))}}else if(r.type==="file"&&r.attrs){const n=r.attrs,i=`[file:://${encodeURIComponent(n.name)}]`;s+=i,e.push(...Go(n,i))}if("content"in r&&Array.isArray(r.content))for(const n of r.content)a(n)}};return a(t),s.trim()&&e.unshift({type:"text",text:s.trim()}),e}const Ks=_.createContext(null),Xs=_.createContext(null);function Qo(t){const e=F.c(8),{modelsConnections:s,currentConfig:a,onAutoSelect:r,allowAll:n,isModelAllowed:i}=t,o=s[0],c=kt(o?.id);let l,d;return e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==i||e[4]!==c||e[5]!==r?(l=()=>{if(a||!o||c.length===0)return;const m=n?c:c.filter(v=>i(o.id,v.id)),f=m.find(ti)??m.find(ei)??m.find(Xo)??m.find(Ko)??m[0];f&&r({id:f.id,connectionId:o.id,provider:f.provider??void 0,capabilities:f.capabilities??void 0,limits:f.limits??void 0})},d=[c,a,o,r,n,i],e[0]=n,e[1]=a,e[2]=o,e[3]=i,e[4]=c,e[5]=r,e[6]=l,e[7]=d):(l=e[6],d=e[7]),_.useEffect(l,d),null}function Ko(t){return t.id.includes("claude-sonnet")}function Xo(t){return t.id.includes("claude-sonnet-4.6")}function ei(t){return t.id.includes("claude-opus-4.6")}function ti(t){return t.id.includes("claude-4.6-opus")}function Ri({children:t}){const{locator:e,org:s}=Ie(),a=st(),r=zo(),{data:n}=Na.useSession(),i=n?.user??null,[o]=La(),[c,l]=_.useReducer(Bo,Qs),d=_.useRef(void 0),m=_.useRef(o.toolApprovalLevel);m.current=o.toolApprovalLevel;const h=Pa(),[f,v]=et(`${e}:selected-virtual-mcp-id`,null),S=Tt(),{hasConnectionModels:E,isModelAllowed:b,allowAll:x}=Hs(),p=S.filter(j=>E(j.id)),[I,w]=Wo(e,p),[A,g]=et(Ct.chatSelectedMode(e),"code_execution"),N=r.messages,C=Kn(f),O=Xn(),{showNotification:k}=eo(),B=f?h.find(j=>j.id===f)??null:null,V=Oa(s.id).id,xe=Vo(s.slug,m),we=async({finishReason:j,isAbort:Z,isDisconnect:z,isError:He,message:lt,messages:Ge})=>{l({type:"SET_FINISH_REASON",payload:j??null});const Ae=lt.metadata?.thread_id??r.activeTaskId;if(Z||z||He){Ae&&Ge.length>0&&r.updateMessagesCache(Ae,Ge);return}Ae&&(Ge.length>0&&r.updateMessagesCache(Ae,Ge),o.enableNotifications&&k({tag:`chat-${Ae}`,title:"Decopilot is waiting for your input at",body:r.tasks.find(ma=>ma.id===Ae)?.title??"New chat"}))},De=j=>{console.error("[chat] Error",j)},U=Hn({id:r.activeTaskId,messages:N,transport:xe,sendAutomaticallyWhen:({messages:j})=>zn({messages:j})||Un({messages:j}),onFinish:we,onToolCall:O,onError:De,onData:({data:j,type:Z})=>{if(Z==="data-thread-title"){const{title:z}=j;if(!z)return;r.updateTask(r.activeTaskId,{title:z,updated_at:new Date().toISOString()})}}}),ae=U.status==="submitted"||U.status==="streaming",Ne=(()=>{const j=U.messages.at(-1);return!j||j.role!=="assistant"?!1:j.parts.some(Z=>"state"in Z&&Z.state==="approval-requested")})(),me=U.messages.length===0&&r.messages.length===0,ue=r.tasks.find(j=>j.id===r.activeTaskId),re=(ue?.status==="in_progress"||ue?.status==="expired")&&!ae,H=_.useRef(U);H.current=U;const ee=_.useRef(null),ne=_.useRef(0),fe=3,K=()=>{a.invalidateQueries({queryKey:_e.tasks(e)});const j=r.activeTaskId;j&&a.invalidateQueries({predicate:Z=>{const z=Z.queryKey;return z[3]!=="collection"||z[4]!=="THREAD_MESSAGES"?!1:(typeof z[6]=="string"?z[6]:"").includes(j)}})},oe=j=>{const Z=r.activeTaskId;!Z||ee.current===Z||ne.current>=fe||(ee.current=Z,console.log(`[chat] resumeStream (${j})`,Z),H.current.resumeStream().catch(z=>{console.error("[chat] resumeStream error",z),ne.current++,ee.current=null,K()}))},ie=_.useRef(K);ie.current=K;const Te=_.useRef(oe);Te.current=oe,Qn({orgId:s.id,taskId:r.activeTaskId,onStep:()=>oe("sse-step"),onFinish:()=>{ee.current=null,ne.current=0,ae||K()},onTaskStatus:()=>{ae||K()}});const de=_.useRef(r.activeTaskId);de.current!==r.activeTaskId&&(de.current=r.activeTaskId,ee.current=null,ne.current=0);const Ce=3e4;_.useEffect(()=>{if(!re)return;Te.current("page-load"),ie.current();const j=setInterval(()=>ie.current(),Ce);return()=>{clearInterval(j)}},[re]);const G=ae?U.messages:r.messages,nt=()=>{it(),r.createTask()},ot=r.switchToTask,sa=r.renameTask,aa=r.hideTask,it=()=>l({type:"RESET"}),ra=j=>{v(j)},na=j=>{w({id:j.id,connectionId:j.connectionId,provider:j.provider,capabilities:j.capabilities,limits:j.limits})},oa=async j=>{if(!I){ke.error("No model configured");return}const Z=Yo(j);if(Z.length===0)return;r.messages.length>0&&H.current.setMessages(r.messages),it();const z={tiptapDoc:j,created_at:new Date().toISOString(),thread_id:r.activeTaskId,agent:{id:B?.id??V,mode:A},user:{avatar:i?.image??void 0,name:i?.name??"you"}},He={...z,system:C,models:I},lt={id:crypto.randomUUID(),role:"user",parts:Z,metadata:z};await H.current.sendMessage(lt,{metadata:He})},Ft=async()=>{const j=r.activeTaskId;if(j){ee.current=null,ne.current=0,H.current.messages.length>0&&r.updateMessagesCache(j,H.current.messages),H.current.stop();try{const Z=await fetch(`/api/${s.slug}/decopilot/cancel/${j}`,{method:"POST",credentials:"include"});if(!Z.ok){const z=await Z.json().catch(()=>({}));throw new Error(z.message??`Cancel failed: ${Z.status}`)}await a.invalidateQueries({queryKey:_e.tasks(e)})}catch(Z){const z=Z instanceof Error?Z.message:"Failed to cancel";ke.error(z),console.error("[chat] cancelRun",Z)}}},ia=()=>{ae&&Ft(),U.stop()},la=()=>(ia(),Promise.resolve()),ca=()=>l({type:"CLEAR_FINISH_REASON"}),ua=_.useDeferredValue(G),da={tiptapDocRef:d,resetInteraction:it,activeTaskId:r.activeTaskId,tasks:r.tasks,createTask:nt,switchToTask:ot,renameTask:sa,hideTask:aa,hasNextPage:r.hasNextPage,isFetchingNextPage:r.isFetchingNextPage,fetchNextPage:r.fetchNextPage,virtualMcps:h,selectedVirtualMcp:B,setVirtualMcpId:ra,modelsConnections:p,selectedModel:I,setSelectedModel:na,selectedMode:A,setSelectedMode:g,sendMessage:oa,cancelRun:Ft},pa={messages:ua,status:U.status,setMessages:U.setMessages,error:U.error,clearError:U.clearError,stop:la,addToolOutput:U.addToolOutput,addToolApprovalResponse:U.addToolApprovalResponse,isStreaming:ae,isChatEmpty:me,finishReason:c.finishReason,clearFinishReason:ca,isWaitingForApprovals:Ne,isRunInProgress:re};return u.jsx(Ks.Provider,{value:da,children:u.jsxs(Xs.Provider,{value:pa,children:[u.jsx(Et,{fallback:null,children:u.jsx(_.Suspense,{fallback:null,children:u.jsx(Qo,{modelsConnections:p,currentConfig:I,onAutoSelect:w,allowAll:x,isModelAllowed:b})})}),t]})})}function si(){const t=_.useContext(Ks);if(!t)throw new Error("useChatStable must be used within a ChatProvider");return t}function ai(){const t=_.useContext(Xs);if(!t)throw new Error("useChatStream must be used within a ChatProvider");return t}function ki(){const t=F.c(3),e=si(),s=ai();let a;return t[0]!==e||t[1]!==s?(a={...e,...s},t[0]=e,t[1]=s,t[2]=a):a=t[2],a}var rt="Collapsible",[ri,Oi]=Ma(rt),[ni,Pt]=ri(rt),ea=_.forwardRef((t,e)=>{const{__scopeCollapsible:s,open:a,defaultOpen:r,disabled:n,onOpenChange:i,...o}=t,[c,l]=Ta({prop:a,defaultProp:r??!1,onChange:i,caller:rt});return u.jsx(ni,{scope:s,disabled:n,contentId:Ca(),open:c,onOpenToggle:_.useCallback(()=>l(d=>!d),[l]),children:u.jsx(It.div,{"data-state":Zt(c),"data-disabled":n?"":void 0,...o,ref:e})})});ea.displayName=rt;var ta="CollapsibleTrigger",Dt=_.forwardRef((t,e)=>{const{__scopeCollapsible:s,...a}=t,r=Pt(ta,s);return u.jsx(It.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":Zt(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...a,ref:e,onClick:Aa(t.onClick,r.onOpenToggle)})});Dt.displayName=ta;var $t="CollapsibleContent",Lt=_.forwardRef((t,e)=>{const{forceMount:s,...a}=t,r=Pt($t,t.__scopeCollapsible);return u.jsx(ja,{present:s||r.open,children:({present:n})=>u.jsx(oi,{...a,ref:e,present:n})})});Lt.displayName=$t;var oi=_.forwardRef((t,e)=>{const{__scopeCollapsible:s,present:a,children:r,...n}=t,i=Pt($t,s),[o,c]=_.useState(a),l=_.useRef(null),d=Ra(e,l),m=_.useRef(0),h=m.current,f=_.useRef(0),v=f.current,S=i.open||o,E=_.useRef(S),b=_.useRef(void 0);return _.useEffect(()=>{const x=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(x)},[]),ka(()=>{const x=l.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const p=x.getBoundingClientRect();m.current=p.height,f.current=p.width,E.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),c(a)}},[i.open,a]),u.jsx(It.div,{"data-state":Zt(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!S,...n,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:S&&r})});function Zt(t){return t?"open":"closed"}var ii=ea,Pi=Dt,Di=Lt;function $i(t){const e=F.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=u.jsx(ii,{"data-slot":"collapsible",...s}),e[2]=s,e[3]=a):a=e[3],a}function Li(t){const e=F.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=u.jsx(Dt,{"data-slot":"collapsible-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function Zi(t){const e=F.c(4);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a=u.jsx(Lt,{"data-slot":"collapsible-content",...s}),e[2]=s,e[3]=a):a=e[3],a}export{$i as C,ji as M,ii as R,Pi as T,ki as a,bs as b,nr as c,Li as d,ys as e,Zi as f,Di as g,Oi as h,rr as i,Gn as j,Ri as k,Mi as m,xs as t,si as u};
@@ -1 +0,0 @@
1
- import{a0 as a,a1 as t}from"./index-DTgZok4N.js";const e=a(t,{target:"draft-7"});export{e as B};
@@ -1 +0,0 @@
1
- import{c as r,j as i}from"./index-DTgZok4N.js";import{P as m}from"./project-plugins-BxtIWCHr.js";import"./useQuery-C-DbMOQt.js";import"./useMutation-B99hCaMl.js";import"./constants-2Gp-yGJ1.js";import"./switch-BO1AHmQl.js";import"./label-ND6ncjGS.js";import"./Container-Dt3fts2O.js";import"./use-connection-Du5eRm0t.js";import"./use-binding-CXeaDqWF.js";import"./binder-CXy7pGaI.js";import"./use-install-from-registry-D98zOCZs.js";import"./extract-connection-data-0trSaHAT.js";import"./constants-DTNMmCfY.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-BFXjOPvi.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-SjZGs3Wk.js";import"./Plus-DXYydVCi.js";import"./select-CwGh16En.js";import"./index-BG6VshDR.js";import"./Check-AlxQ-j2G.js";import"./ChevronDown-Bt1ewsqh.js";function q(){const o=r.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(m,{}),o[0]=t):t=o[0],t}export{q as default};