decocms 3.34.1 → 3.34.3

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 (234) hide show
  1. package/dist/client/assets/{AlertCircle-rpaL6q8T.js → AlertCircle-B5QG7wg7.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-D7_4FAQ5.js → ArrowUpRight-Ce95HJs8.js} +1 -1
  3. package/dist/client/assets/{Check-6LmIKXJj.js → Check-CV74Rqqs.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-D0kUlRsN.js → CheckCircle-BiLWpS6e.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-CaCYdoie.js → ChevronDown-XKMoQgX6.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-BuXkBFIm.js → ChevronLeft-rORK5a-Y.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-kLRVkGUs.js → ChevronRight-Betyx6_9.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-DkGtzqyl.js → ChevronUp-CGfhqWp1.js} +1 -1
  9. package/dist/client/assets/{Container-Bl0qWNtu.js → Container-Byi81M5N.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CvhOKI-w.js → DotsVertical-CuchmOf0.js} +1 -1
  11. package/dist/client/assets/{Eye-BNS1RmzG.js → Eye-RSaOlPZv.js} +1 -1
  12. package/dist/client/assets/{FilterLines-BSmtfAHG.js → FilterLines-DuHSJmFt.js} +1 -1
  13. package/dist/client/assets/{Globe01-DjWlKHom.js → Globe01-Ds0ZgQYM.js} +1 -1
  14. package/dist/client/assets/{HardDrive-Dx3Blqhn.js → HardDrive-C0JdZ_DO.js} +1 -1
  15. package/dist/client/assets/{Key01-D6jyUgYu.js → Key01-CStdo5WX.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-C7Cmt2J8.js → LayoutLeft-BdQI12mG.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-B6flmd1s.js → LinkExternal01-D7swM7zC.js} +1 -1
  18. package/dist/client/assets/{Monitor01-DBfOkkx9.js → Monitor01-CaSeRueL.js} +1 -1
  19. package/dist/client/assets/{Palette-BX6fdd-v.js → Palette-gIYgJ3Wn.js} +1 -1
  20. package/dist/client/assets/{Play-DApzrsBx.js → Play-1bLCgUWF.js} +1 -1
  21. package/dist/client/assets/{Plus-Do6ZWheh.js → Plus-wat9tYeJ.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-CW918RSV.js → RefreshCcw01-D-1V89vv.js} +1 -1
  23. package/dist/client/assets/{SearchMd-B4Lavo8e.js → SearchMd-BoptgjAM.js} +1 -1
  24. package/dist/client/assets/{Settings02-B57k_aEv.js → Settings02-8XjUg3gM.js} +1 -1
  25. package/dist/client/assets/{Shield01-CFDfVqiL.js → Shield01-CjOnx-7R.js} +1 -1
  26. package/dist/client/assets/{Star01-QoJ-qcfh.js → Star01-Dsaeuwpa.js} +1 -1
  27. package/dist/client/assets/{Stars01-ANwy09AP.js → Stars01-DDkk5qux.js} +1 -1
  28. package/dist/client/assets/{Stars02-C17u9BVa.js → Stars02-ChPYLNIJ.js} +1 -1
  29. package/dist/client/assets/{Sun-D4yzlyEv.js → Sun-BUoG5bs4.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CkwE98n9.js → SwitchHorizontal01-CkdIfbJ1.js} +1 -1
  31. package/dist/client/assets/{Tool01-B0zT3ots.js → Tool01-Be5AVc1v.js} +1 -1
  32. package/dist/client/assets/{Trash01-Bifm5Wb3.js → Trash01-YuwiLEVo.js} +1 -1
  33. package/dist/client/assets/{Upload01-mjA8r4Fi.js → Upload01-aGUy8jUM.js} +1 -1
  34. package/dist/client/assets/{User01-BZL6tFVt.js → User01-CUMpCZVS.js} +1 -1
  35. package/dist/client/assets/{Users01-CqVfleMx.js → Users01-BGw9h7dE.js} +1 -1
  36. package/dist/client/assets/{Users03-C5i2CKOP.js → Users03-Cf3_qQGc.js} +1 -1
  37. package/dist/client/assets/{X-BWR0-4rz.js → X-D1kqmcok.js} +1 -1
  38. package/dist/client/assets/{XCircle-CiiIVhRh.js → XCircle-Ds6l9Vuw.js} +1 -1
  39. package/dist/client/assets/{XClose-D0wmxYTF.js → XClose-CwNjmDWz.js} +1 -1
  40. package/dist/client/assets/{Zap-BGp3QjmM.js → Zap-j2XVmCfk.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-CxE5iHdd.js → ZapSquare-DMmAEMvR.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-B1VNHI1K.js → ZoomOut-C6xbqN0H.js} +1 -1
  43. package/dist/client/assets/{access-gate-BELP4oqa.js → access-gate-DfmEpXgP.js} +1 -1
  44. package/dist/client/assets/{accordion-Dsx4jZXX.js → accordion-B4RSATFh.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-BPiyATcO.js → add-section-modal-DGPmEqVH.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-CmHO-Kgo.js → agent-capabilities-UHQXEFqt.js} +1 -1
  47. package/dist/client/assets/{agent-icon-CpBAbwoh.js → agent-icon-BAU0Nn5Q.js} +1 -1
  48. package/dist/client/assets/{agent-icons-C_pHQRgk.js → agent-icons-CMqOumOa.js} +1 -1
  49. package/dist/client/assets/{agents-list-ud8B7XUs.js → agents-list-f6dvlBDo.js} +1 -1
  50. package/dist/client/assets/{ai-providers-DuT9vieJ.js → ai-providers-CIni-0nv.js} +1 -1
  51. package/dist/client/assets/{alert-C_aVuLV8.js → alert-CeTPCPF-.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-Dsb6KPFM.js → alert-dialog-nDI1xJhR.js} +1 -1
  53. package/dist/client/assets/app-editor-Dd3wbzna.js +1 -0
  54. package/dist/client/assets/{auth-catchall-DsJQjIZu.js → auth-catchall-BHc3WJmM.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-BBz1-8cc.js → auth-split-layout-By3wB5zH.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-DTcrDIUh.js → automation-list-row-C-im7Cyh.js} +1 -1
  57. package/dist/client/assets/{automation-runs-D8yf4pum.js → automation-runs-BYZ99hni.js} +1 -1
  58. package/dist/client/assets/{automations-BqoqwiaS.js → automations-BKZFJOPp.js} +1 -1
  59. package/dist/client/assets/{avatar-nCSKoB6F.js → avatar-BZq-o3M_.js} +1 -1
  60. package/dist/client/assets/{badge-CY1rqnYU.js → badge-DBQKr8ze.js} +1 -1
  61. package/dist/client/assets/{brand-context-DCIkJfS8.js → brand-context-CpadUeMB.js} +1 -1
  62. package/dist/client/assets/{buckets-CvxCU-Mg.js → buckets-BWDxlk4n.js} +1 -1
  63. package/dist/client/assets/{calendar-vde5tCHf.js → calendar-D0ZGZM9k.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-DYWpzVHl.js → capability-load-error-BqquNR5_.js} +1 -1
  65. package/dist/client/assets/{card-CYGsSb57.js → card-_9LUJQRQ.js} +1 -1
  66. package/dist/client/assets/{chat-context-CDygsN4Q.js → chat-context-BGBybCr0.js} +1 -1
  67. package/dist/client/assets/{checkbox-vKl7eadT.js → checkbox-BoVEsaTu.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BgBSOhsv.js → cli-auth-success-BYlIpapz.js} +1 -1
  69. package/dist/client/assets/{collection-detail-Cl0_mdap.js → collection-detail-C5awVm7D.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-VpCmWGot.js → collection-display-button-C331HXzj.js} +1 -1
  71. package/dist/client/assets/{collection-search-CjkYy_AH.js → collection-search-D2zd2w_6.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-CuUrD2rg.js → collection-table-wrapper-D_JocMSh.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-BGsvaOVA.js → collection-tabs-Et7HpQI-.js} +1 -1
  74. package/dist/client/assets/{collections-NCEoL2EX.js → collections-BEkDC2fV.js} +1 -1
  75. package/dist/client/assets/{command-KCI9wvsu.js → command-DjRT1inC.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-CgeQRUKM.js → connect-desktop-dialog-C7P5AZy7.js} +1 -1
  77. package/dist/client/assets/{connection-card-BioQsepZ.js → connection-card-C6z8X3mv.js} +1 -1
  78. package/dist/client/assets/{connection-detail-szcerrZK.js → connection-detail-DWcaSH3b.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-DC_9yJsF.js → connection-form-helpers-CJ-3PHD0.js} +1 -1
  80. package/dist/client/assets/{connections-ZTcaOmQJ.js → connections-plRLUbCm.js} +1 -1
  81. package/dist/client/assets/decopilot-sse-pool-Cu7Nizzp.js +1 -0
  82. package/dist/client/assets/{dialog-CxpeEAA2.js → dialog-DilC5A4p.js} +1 -1
  83. package/dist/client/assets/{domain-settings-FkOLC-vc.js → domain-settings-BUYR_el1.js} +1 -1
  84. package/dist/client/assets/{drawer-R-Q-vfsa.js → drawer-PqoucHj8.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-Xj0lVIXK.js → dropdown-menu-CCeLALQe.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-ggJeSS9L.js → dynamic-plugin-layout-b5WMDmEL.js} +1 -1
  87. package/dist/client/assets/{empty-state-BEE0EBKQ.js → empty-state-C0m3QPuD.js} +1 -1
  88. package/dist/client/assets/{empty-state-BhV-zl-f.js → empty-state-cuRG9xrS.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-BJ4lD3eO.js → extract-connection-data-zlBEIx4x.js} +1 -1
  90. package/dist/client/assets/{features-2oa5PE-D.js → features-1PDTV_2R.js} +1 -1
  91. package/dist/client/assets/{file-explorer-mkpu5feK.js → file-explorer-CBKgCWMC.js} +1 -1
  92. package/dist/client/assets/{file-type-icon-35VBMVCk.js → file-type-icon-CBlaUM9a.js} +1 -1
  93. package/dist/client/assets/{files-C37GYe47.js → files-De7CB1eQ.js} +1 -1
  94. package/dist/client/assets/{form-Ci8PGt-R.js → form-DcfAV72q.js} +1 -1
  95. package/dist/client/assets/{general-NmglolSe.js → general-DCkCuFZl.js} +1 -1
  96. package/dist/client/assets/{generate-id-nWw_PZwJ.js → generate-id-N17blLwS.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-DY4w_1I0.js → github-repo-picker-CIreZixy.js} +1 -1
  98. package/dist/client/assets/{header-tab-button-C7XZ27Uv.js → header-tab-button-CNFRl9p4.js} +1 -1
  99. package/dist/client/assets/{hover-card-DY9PmUZF.js → hover-card-Bizl54yc.js} +1 -1
  100. package/dist/client/assets/{image-field-DXfNSgLy.js → image-field-Btc7vZ_B.js} +1 -1
  101. package/dist/client/assets/{index-So-S11eP.js → index-4vxs0ZGV.js} +1 -1
  102. package/dist/client/assets/{index-BEe1oLVg.js → index-B6U1MHPz.js} +1 -1
  103. package/dist/client/assets/{index-Rf_PdJ5z.js → index-CQQJ5UaG.js} +1 -1
  104. package/dist/client/assets/{index-Czr8nkWj.js → index-C_YL5c1Q.js} +1 -1
  105. package/dist/client/assets/{index-u2XUNnQk.js → index-CeH9NvWc.js} +4 -4
  106. package/dist/client/assets/{index-czuYZ_ID.js → index-CoxAwU4M.js} +1 -1
  107. package/dist/client/assets/{index-DO3UwA_I.js → index-DM719JZt.js} +1 -1
  108. package/dist/client/assets/{index-BToBsTv0.js → index-DOV0yCSN.js} +1 -1
  109. package/dist/client/assets/{index-BvKb9qza.js → index-Dr3ZvAAC.js} +1 -1
  110. package/dist/client/assets/{index-rZ1TPVyD.js → index-DxLTuX83.js} +3 -3
  111. package/dist/client/assets/{index-61WbL3ye.js → index-EffHR3rD.js} +1 -1
  112. package/dist/client/assets/{index-DUiGV32e.js → index-KCjld4_L.js} +1 -1
  113. package/dist/client/assets/{index-Dczuf3at.js → index-NuAPKwye.js} +1 -1
  114. package/dist/client/assets/{index-D9SSFpE5.js → index-VW961Pbw.js} +1 -1
  115. package/dist/client/assets/{index-DppjWA7O.js → index-WAvrfxHO.js} +1 -1
  116. package/dist/client/assets/{index-redirect-Mq-_t69h.js → index-redirect-BoGD6xOD.js} +1 -1
  117. package/dist/client/assets/{input-BPXWlz46.js → input-3FcnQKag.js} +1 -1
  118. package/dist/client/assets/{integration-icon-CWT0gSfx.js → integration-icon-C2c_G7v_.js} +1 -1
  119. package/dist/client/assets/{label-CzVCjiiL.js → label-Cv-qQXYd.js} +1 -1
  120. package/dist/client/assets/{layout-DRDhyVmm.js → layout-2bgJD0NS.js} +1 -1
  121. package/dist/client/assets/{login-BDymjDs5.js → login-DDLq_BK-.js} +1 -1
  122. package/dist/client/assets/{members-CtJP3l4D.js → members-BlttLAcq.js} +1 -1
  123. package/dist/client/assets/{monaco-editor-C-H4UmIT.js → monaco-editor-BenQSBIk.js} +1 -1
  124. package/dist/client/assets/{monitoring-stats-row-Bjwv0PCc.js → monitoring-stats-row-BcGGFk75.js} +1 -1
  125. package/dist/client/assets/{oauth-callback-BS0_f_H5.js → oauth-callback-CdBo7Kde.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-Bp-Z15lU.js → oauth-callback-ai-provider-BF79mlu4.js} +1 -1
  127. package/dist/client/assets/{onboarding-tR6ID9Ba.js → onboarding-Dd72TDGl.js} +1 -1
  128. package/dist/client/assets/{org-install-Dao8BW5b.js → org-install-Bv_VZKPn.js} +1 -1
  129. package/dist/client/assets/{org-layout-3WhlK4a0.js → org-layout-CTAm8_WK.js} +1 -1
  130. package/dist/client/assets/{org-plugin-layout-C-NqJRXX.js → org-plugin-layout-KpgdAlfM.js} +1 -1
  131. package/dist/client/assets/{page-seo-form-Dk6e77BM.js → page-seo-form-B0n1eGFy.js} +1 -1
  132. package/dist/client/assets/page-seo-sheet-Bo7n8Dbw.js +1 -0
  133. package/dist/client/assets/{pair-DYb6YfcG.js → pair-DU07s2Yy.js} +1 -1
  134. package/dist/client/assets/{plugin-empty-state-YbbYO5hU.js → plugin-empty-state-CVzEQ5Cm.js} +1 -1
  135. package/dist/client/assets/{plugin-header-8P4QiIoH.js → plugin-header-B7b_y-0E.js} +1 -1
  136. package/dist/client/assets/{plugin-layout-CKmZivzq.js → plugin-layout-Bwwo9Dmw.js} +1 -1
  137. package/dist/client/assets/{popover-Bk3EwUPD.js → popover-DpnBmU5u.js} +1 -1
  138. package/dist/client/assets/{post-editor-Bw21I9pc.js → post-editor-DOuE35_z.js} +1 -1
  139. package/dist/client/assets/{primitives-Dql_hUCU.js → primitives-DCRAmGAV.js} +1 -1
  140. package/dist/client/assets/{profile-DVNKZaX-.js → profile-DvJYJ7rR.js} +1 -1
  141. package/dist/client/assets/project-app-view-DQhfhWs_.js +1 -0
  142. package/dist/client/assets/record-editor-BYnzNxDd.js +1 -0
  143. package/dist/client/assets/registry-469wEK7T.js +2 -0
  144. package/dist/client/assets/{registry-layout-DwX4dFWX.js → registry-layout-BMV-48W2.js} +1 -1
  145. package/dist/client/assets/{require-capability-6kSOKhdT.js → require-capability-BolUdzxs.js} +1 -1
  146. package/dist/client/assets/{required-auth-layout-YEZh9H2w.js → required-auth-layout-Ce12SDHB.js} +1 -1
  147. package/dist/client/assets/{reset-password-DaCJM4Eh.js → reset-password-BUAFUG-w.js} +1 -1
  148. package/dist/client/assets/{resizable-23UTrxEL.js → resizable-CDtszfkc.js} +1 -1
  149. package/dist/client/assets/{roles-xmvI7O0C.js → roles-ChM1uml4.js} +1 -1
  150. package/dist/client/assets/save-referenced-block-p44kfiVf.js +1 -0
  151. package/dist/client/assets/{save-status-BkzFYIeb.js → save-status-CrbNr3Yt.js} +1 -1
  152. package/dist/client/assets/{schema-form-DNaVud8y.js → schema-form-DF5JNe2x.js} +1 -1
  153. package/dist/client/assets/{scroll-area-QXSqgT3C.js → scroll-area-DtVZtiV9.js} +1 -1
  154. package/dist/client/assets/{search-input-DbmU5zU8.js → search-input-B5QgW7DO.js} +1 -1
  155. package/dist/client/assets/{secrets-CrK7EU6I.js → secrets-vyIYAehl.js} +1 -1
  156. package/dist/client/assets/{sections-editor-DJ6-AL_q.js → sections-editor-ChsSqsQp.js} +1 -1
  157. package/dist/client/assets/{select-DRqZIuLQ.js → select-C0Tyz9qJ.js} +1 -1
  158. package/dist/client/assets/{select-model-CZe_eVYF.js → select-model-qL2AwJh1.js} +1 -1
  159. package/dist/client/assets/{seo-editor-pRBB6PMK.js → seo-editor-BdvXc5GQ.js} +1 -1
  160. package/dist/client/assets/{settings-layout-osjNi_Qw.js → settings-layout-Cd7DSf19.js} +1 -1
  161. package/dist/client/assets/{settings-section-5LNAbhU4.js → settings-section-BxOSnd7f.js} +1 -1
  162. package/dist/client/assets/{sheet-Dsfk9URc.js → sheet-BZaR5cN8.js} +1 -1
  163. package/dist/client/assets/{shell-controls-BvG0M9XK.js → shell-controls-B_EeVM1l.js} +1 -1
  164. package/dist/client/assets/{shell-layout-DkW3B_MZ.js → shell-layout-DSw-nDR6.js} +1 -1
  165. package/dist/client/assets/{shell-route-loading-CKElD_Av.js → shell-route-loading-DGAtAFWm.js} +1 -1
  166. package/dist/client/assets/{sidebar-B3SsvTHC.js → sidebar-DILd2AwV.js} +1 -1
  167. package/dist/client/assets/{skeleton-DvVUqja_.js → skeleton-Dvzf2GQP.js} +1 -1
  168. package/dist/client/assets/{sortable.esm-CnPAeADV.js → sortable.esm-DhgyheK_.js} +1 -1
  169. package/dist/client/assets/{spinner-DZmgr2qu.js → spinner-CIUpakvk.js} +1 -1
  170. package/dist/client/assets/{sso-Ce8-uwYP.js → sso-BYueQDf4.js} +1 -1
  171. package/dist/client/assets/{store-Cy7UQOIx.js → store-DRNbauSU.js} +1 -1
  172. package/dist/client/assets/store-registry-Cj3hC5ms.js +2 -0
  173. package/dist/client/assets/{studio-tools-jbRVdtpc.js → studio-tools-qhNYzbg-.js} +1 -1
  174. package/dist/client/assets/{switch-rL3a0x4B.js → switch-B2R8Oovd.js} +1 -1
  175. package/dist/client/assets/{tab-id-hZWLCmfc.js → tab-id-BEXPtrYn.js} +1 -1
  176. package/dist/client/assets/{table-cHRXPecF.js → table-BHblf7Co.js} +1 -1
  177. package/dist/client/assets/{tabs-B68TQ0Dt.js → tabs-BEFEoOMo.js} +1 -1
  178. package/dist/client/assets/{task-status-Cqn0_tco.js → task-status-17hQtONR.js} +1 -1
  179. package/dist/client/assets/{textarea-Bymi75yx.js → textarea-CZOXZ6_T.js} +1 -1
  180. package/dist/client/assets/{toggle-group-DnRl91Ne.js → toggle-group-DzrJraBm.js} +1 -1
  181. package/dist/client/assets/{toolbar-Cb06hfKk.js → toolbar-A-Rw_MZF.js} +1 -1
  182. package/dist/client/assets/{tools-list-D12nTCg-.js → tools-list-CmTd7_Mb.js} +1 -1
  183. package/dist/client/assets/{tooltip-ua4lJTzI.js → tooltip-D1D9JHhD.js} +1 -1
  184. package/dist/client/assets/{types-DJl0mitR.js → types-DsYUq_UX.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-P6PF7YRx.js → use-ai-providers-CIvGzfXg.js} +1 -1
  186. package/dist/client/assets/{use-automations-DGe3A7k6.js → use-automations-CP8543px.js} +1 -1
  187. package/dist/client/assets/{use-capability-B2IrzHkM.js → use-capability-DDDjfOOE.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-x-ip1-Lp.js → use-clock-tick-DufrTL6j.js} +1 -1
  189. package/dist/client/assets/{use-collections-Dvp_IbhN.js → use-collections-CUoYyXrz.js} +1 -1
  190. package/dist/client/assets/{use-connection-CyWLUiRu.js → use-connection-DIX015NP.js} +1 -1
  191. package/dist/client/assets/{use-copy-nAd5EMaO.js → use-copy-B_iKACkn.js} +1 -1
  192. package/dist/client/assets/{use-create-virtual-mcp-DmdlMapL.js → use-create-virtual-mcp-BiFjwqV_.js} +1 -1
  193. package/dist/client/assets/{use-debounced-autosave-DSZqKaTf.js → use-debounced-autosave-CsGRGmM0.js} +1 -1
  194. package/dist/client/assets/{use-delete-connection-VJfJqSrZ.js → use-delete-connection-C2rrW8fa.js} +1 -1
  195. package/dist/client/assets/{use-file-configs-DXD_Hwrv.js → use-file-configs-CzVPvQ04.js} +1 -1
  196. package/dist/client/assets/{use-infinite-scroll-B2zyjKex.js → use-infinite-scroll-BmPWzVgW.js} +1 -1
  197. package/dist/client/assets/{use-list-state-ByLS4CFA.js → use-list-state-BxWtfKJF.js} +1 -1
  198. package/dist/client/assets/{use-mcp-client-CGBZ7ekq.js → use-mcp-client-B7YSHa6V.js} +1 -1
  199. package/dist/client/assets/{use-mcp-prompts-BQNNtRte.js → use-mcp-prompts-B8H3Sb8-.js} +1 -1
  200. package/dist/client/assets/{use-mcp-tools-Dn2JgISP.js → use-mcp-tools-Bb7rwoEF.js} +1 -1
  201. package/dist/client/assets/{use-members-BaX0tyb1.js → use-members-D33brPm2.js} +1 -1
  202. package/dist/client/assets/{use-navigate-to-agent-5w6ZqBss.js → use-navigate-to-agent-BpOmxFKV.js} +1 -1
  203. package/dist/client/assets/{use-org-auth-client-CLnnUl3h.js → use-org-auth-client-B3bhhuY4.js} +1 -1
  204. package/dist/client/assets/{use-org-sso-B8CLPiZl.js → use-org-sso-qcLKm5I7.js} +1 -1
  205. package/dist/client/assets/{use-organization-roles-UOgWPl1e.js → use-organization-roles-DV7FcWv5.js} +1 -1
  206. package/dist/client/assets/{use-organization-settings-D68AqLOQ.js → use-organization-settings-mMiPWte8.js} +1 -1
  207. package/dist/client/assets/{use-registry-connections-CRtbznIm.js → use-registry-connections-BIDj-EVl.js} +1 -1
  208. package/dist/client/assets/{use-secrets--KIFsJ5I.js → use-secrets-CMyn_SAh.js} +1 -1
  209. package/dist/client/assets/{use-status-sounds-B8VUkU2E.js → use-status-sounds-FktjeAga.js} +1 -1
  210. package/dist/client/assets/{use-view-mode-CvlKEBCR.js → use-view-mode-CQiQ9BoV.js} +1 -1
  211. package/dist/client/assets/{use-virtual-mcp-mhycHzLS.js → use-virtual-mcp-BHCygv1Q.js} +1 -1
  212. package/dist/client/assets/useInfiniteQuery-Du3dTl6W.js +1 -0
  213. package/dist/client/assets/{useRouterState-qr3F3XJE.js → useRouterState-CPOZ6kYF.js} +1 -1
  214. package/dist/client/assets/useSuspenseInfiniteQuery-BHnbmrEl.js +1 -0
  215. package/dist/client/assets/{user-D73GXODW.js → user-BHiBl7KY.js} +1 -1
  216. package/dist/client/assets/{view-mode-toggle-3i0Tx7_t.js → view-mode-toggle-C4AuqTiF.js} +1 -1
  217. package/dist/client/assets/{watch-sse-pool-Bo209v56.js → watch-sse-pool-BEICArze.js} +1 -1
  218. package/dist/client/assets/{workflow-DoAXdkx8.js → workflow-CqlkVMXi.js} +1 -1
  219. package/dist/client/assets/workflow-detail-CqR4Jdyr.js +1 -0
  220. package/dist/client/index.html +1 -1
  221. package/dist/server/cli.js +2 -2
  222. package/dist/server/server.js +1 -1
  223. package/package.json +1 -1
  224. package/dist/client/assets/app-editor-CJE_W_Dn.js +0 -1
  225. package/dist/client/assets/decopilot-sse-pool-C2fCSDxg.js +0 -1
  226. package/dist/client/assets/page-seo-sheet-Ceb0gnAp.js +0 -1
  227. package/dist/client/assets/project-app-view-CMCeiidr.js +0 -1
  228. package/dist/client/assets/record-editor-803FPqaV.js +0 -1
  229. package/dist/client/assets/registry-BZxoTJql.js +0 -2
  230. package/dist/client/assets/save-referenced-block-CMYI5Fv0.js +0 -1
  231. package/dist/client/assets/store-registry-Cn522mzq.js +0 -2
  232. package/dist/client/assets/useInfiniteQuery-k6dph5MZ.js +0 -1
  233. package/dist/client/assets/useSuspenseInfiniteQuery-DGO3SU3a.js +0 -1
  234. package/dist/client/assets/workflow-detail-BVmen01p.js +0 -1
@@ -1,4 +1,4 @@
1
- import{e5 as se,e as I,j as o,B as te,l as Yt,b5 as Ae,e6 as Gs,r as X,q as oe,c as $,g as Qs,G as Zt,e7 as Nt,e8 as es,o as Ys,v as Zs,e9 as en,ea as tn}from"./index-rZ1TPVyD.js";import{D as sn,F as nn,B as on}from"./index-DUiGV32e.js";import{h as De,i as rn,u as ae}from"./use-mcp-client-CGBZ7ekq.js";import{a as ts}from"./use-virtual-mcp-mhycHzLS.js";import{M as Oe}from"./monaco-editor-C-H4UmIT.js";import{b as ln,R as zt,a as cn}from"./resizable-23UTrxEL.js";import{B as le}from"./badge-CY1rqnYU.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-DRqZIuLQ.js";import{S as et}from"./spinner-DZmgr2qu.js";import{V as an}from"./view-mode-toggle-3i0Tx7_t.js";import{aj as un,q as dn,i as fn,B as ss,ak as mn,a4 as pn,v as xn,al as ns,aa as hn,O as os,am as gn,an as bn,a6 as ft,ao as jn}from"./agent-icon-CpBAbwoh.js";import{i as rs}from"./Play-DApzrsBx.js";import{b as Sn,a as yn,V as Ge}from"./layout-DRDhyVmm.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-ua4lJTzI.js";import{u as wn,a as vn}from"./use-connection-CyWLUiRu.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-Dn2JgISP.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-CxpeEAA2.js";import"./index-D9SSFpE5.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-QXSqgT3C.js";import{S as Fn}from"./index-Dczuf3at.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-DY9PmUZF.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-Xj0lVIXK.js";import{s as Un}from"./Plus-Do6ZWheh.js";import{b as ps}from"./Tool01-B0zT3ots.js";import{i as Fe}from"./Check-6LmIKXJj.js";import{s as _t}from"./XClose-D0wmxYTF.js";import{I as Ct}from"./integration-icon-CWT0gSfx.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-Dsx4jZXX.js";import"./index-czuYZ_ID.js";import{i as xs}from"./X-BWR0-4rz.js";import{u as hs,a as Gn}from"./use-collections-Dvp_IbhN.js";import{E as gs}from"./empty-state-BEE0EBKQ.js";import{w as Qn}from"./watch-sse-pool-Bo209v56.js";import{I as Wt}from"./input-BPXWlz46.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
1
+ import{e5 as se,e as I,j as o,B as te,l as Yt,b5 as Ae,e6 as Gs,r as X,q as oe,c as $,g as Qs,G as Zt,e7 as Nt,e8 as es,o as Ys,v as Zs,e9 as en,ea as tn}from"./index-DxLTuX83.js";import{D as sn,F as nn,B as on}from"./index-KCjld4_L.js";import{h as De,i as rn,u as ae}from"./use-mcp-client-B7YSHa6V.js";import{a as ts}from"./use-virtual-mcp-BHCygv1Q.js";import{M as Oe}from"./monaco-editor-BenQSBIk.js";import{b as ln,R as zt,a as cn}from"./resizable-CDtszfkc.js";import{B as le}from"./badge-DBQKr8ze.js";import{b as xt,d as ht,c as Ze,a as gt,S as bt}from"./select-C0Tyz9qJ.js";import{S as et}from"./spinner-CIUpakvk.js";import{V as an}from"./view-mode-toggle-C4AuqTiF.js";import{aj as un,q as dn,i as fn,B as ss,ak as mn,a4 as pn,v as xn,al as ns,aa as hn,O as os,am as gn,an as bn,a6 as ft,ao as jn}from"./agent-icon-BAU0Nn5Q.js";import{i as rs}from"./Play-1bLCgUWF.js";import{b as Sn,a as yn,V as Ge}from"./layout-2bgJD0NS.js";import{c as is,b as ls,T as cs,a as as}from"./tooltip-D1D9JHhD.js";import{u as wn,a as vn}from"./use-connection-DIX015NP.js";import{u as kt,d as It,b as us}from"./use-mcp-tools-Bb7rwoEF.js";import{b as Nn,c as kn,e as In,d as _n,a as Cn,D as Tn}from"./dialog-DilC5A4p.js";import"./index-VW961Pbw.js";import{N as En,m as $n,n as On,o as Ke,P as Mn,i as Rn,R as Ln,u as zn,p as An,e as At,d as Wn,q as Pn,S as Dn}from"./scroll-area-DtVZtiV9.js";import{S as Fn}from"./index-NuAPKwye.js";import{H as Vn,a as qn,b as Hn}from"./hover-card-Bizl54yc.js";import{D as ds,a as fs,b as ms,c as Qe}from"./dropdown-menu-CCeLALQe.js";import{s as Un}from"./Plus-wat9tYeJ.js";import{b as ps}from"./Tool01-Be5AVc1v.js";import{i as Fe}from"./Check-CV74Rqqs.js";import{s as _t}from"./XClose-CwNjmDWz.js";import{I as Ct}from"./integration-icon-C2c_G7v_.js";import{A as Kn,c as Bn,a as Xn,b as Jn}from"./accordion-B4RSATFh.js";import"./index-CoxAwU4M.js";import{i as xs}from"./X-D1kqmcok.js";import{u as hs,a as Gn}from"./use-collections-CUoYyXrz.js";import{E as gs}from"./empty-state-C0m3QPuD.js";import{w as Qn}from"./watch-sse-pool-BEICArze.js";import{I as Wt}from"./input-3FcnQKag.js";const bs=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const js=se("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);const tt=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const st=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Yn=se("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ss=se("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Zn=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const ys=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ws=se("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);const vs=se("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const eo=se("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);const Ns=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ks=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const to=se("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Is=se("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);function so(t){const e=I.c(15),{onSave:n,onUndo:s,isDirty:i,isSaving:r,saveLabel:l,undoLabel:c}=t,a=l===void 0?"Save":l,u=c===void 0?"Undo":c;if(!i)return null;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=o.jsx(un,{size:14}),e[0]=d):d=e[0];let f;e[1]!==r||e[2]!==s||e[3]!==u?(f=o.jsxs(te,{variant:"outline",size:"sm",onClick:s,disabled:r,"aria-label":u,children:[d,u]}),e[1]=r,e[2]=s,e[3]=u,e[4]=f):f=e[4];let m;e[5]!==r?(m=r?o.jsx(Yt,{size:14,className:"animate-spin"}):o.jsx(dn,{size:14}),e[5]=r,e[6]=m):m=e[6];let p;e[7]!==r||e[8]!==n||e[9]!==a||e[10]!==m?(p=o.jsxs(te,{variant:"default",size:"sm",onClick:n,disabled:r,"aria-label":a,children:[m,a]}),e[7]=r,e[8]=n,e[9]=a,e[10]=m,e[11]=p):p=e[11];let x;return e[12]!==f||e[13]!==p?(x=o.jsxs(o.Fragment,{children:[f,p]}),e[12]=f,e[13]=p,e[14]=x):x=e[14],x}const Pt=t=>{let e;const n=new Set,s=(u,d)=>{const f=typeof u=="function"?u(e):u;if(!Object.is(f,e)){const m=e;e=d??(typeof f!="object"||f===null)?f:Object.assign({},e,f),n.forEach(p=>p(e,m))}},i=()=>e,c={setState:s,getState:i,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=e=t(s,i,c);return c},Tt=(t=>t?Pt(t):Pt),no=t=>t;function jt(t,e=no){const n=Ae.useSyncExternalStore(t.subscribe,Ae.useCallback(()=>e(t.getState()),[t,e]),Ae.useCallback(()=>e(t.getInitialState()),[t,e]));return Ae.useDebugValue(n),n}const oo=t=>{const e=Tt(t),n=s=>jt(e,s);return Object.assign(n,e),n},ro=(t=>oo);function _s(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var r;const l=a=>a===null?null:JSON.parse(a,void 0),c=(r=n.getItem(i))!=null?r:null;return c instanceof Promise?c.then(l):l(c)},setItem:(i,r)=>n.setItem(i,JSON.stringify(r,void 0)),removeItem:i=>n.removeItem(i)}}const St=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(s){return St(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return St(s)(n)}}}},io=(t,e)=>(n,s,i)=>{let r={storage:_s(()=>window.localStorage),partialize:g=>g,version:0,merge:(g,b)=>({...b,...g}),...e},l=!1,c=0;const a=new Set,u=new Set;let d=r.storage;if(!d)return t((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${r.name}', the given storage is currently unavailable.`),n(...g)},s,i);const f=()=>{const g=r.partialize({...s()});return d.setItem(r.name,{state:g,version:r.version})},m=i.setState;i.setState=(g,b)=>(m(g,b),f());const p=t((...g)=>(n(...g),f()),s,i);i.getInitialState=()=>p;let x;const h=()=>{var g,b;if(!d)return;const S=++c;l=!1,a.forEach(y=>{var j;return y((j=s())!=null?j:p)});const w=((b=r.onRehydrateStorage)==null?void 0:b.call(r,(g=s())!=null?g:p))||void 0;return St(d.getItem.bind(d))(r.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==r.version){if(r.migrate){const j=r.migrate(y.state,y.version);return j instanceof Promise?j.then(v=>[!0,v]):[!0,j]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var j;if(S!==c)return;const[v,N]=y;if(x=r.merge(N,(j=s())!=null?j:p),n(x,!0),v)return f()}).then(()=>{S===c&&(w?.(s(),void 0),x=s(),l=!0,u.forEach(y=>y(x)))}).catch(y=>{S===c&&w?.(void 0,y)})};return i.persist={setOptions:g=>{r={...r,...g},g.storage&&(d=g.storage)},clearStorage:()=>{d?.removeItem(r.name)},getOptions:()=>r,rehydrate:()=>h(),hasHydrated:()=>l,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(u.add(g),()=>{u.delete(g)})},r.skipHydration||h(),x||p},Cs=io,{useSyncExternalStoreWithSelector:lo}=Gs,co=t=>t;function ao(t,e=co,n){const s=lo(t.subscribe,t.getState,t.getInitialState,e,n);return Ae.useDebugValue(s),s}const Dt=t=>Symbol.iterator in t,Ft=t=>"entries"in t,Vt=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),s=e instanceof Map?e:new Map(e.entries());if(n.size!==s.size)return!1;for(const[i,r]of n)if(!s.has(i)||!Object.is(r,s.get(i)))return!1;return!0},uo=(t,e)=>{const n=t[Symbol.iterator](),s=e[Symbol.iterator]();let i=n.next(),r=s.next();for(;!i.done&&!r.done;){if(!Object.is(i.value,r.value))return!1;i=n.next(),r=s.next()}return!!i.done&&!!r.done};function fo(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:Dt(t)&&Dt(e)?Ft(t)&&Ft(e)?Vt(t,e):uo(t,e):Vt({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function Ts(t,e="Output"){if(!t)return`interface ${e} {}`;function n(r){if(!r||typeof r!="object")return"unknown";const l=r.type;if(Array.isArray(l))return l.map(c=>s(c)).join(" | ");switch(l){case"string":return r.enum?r.enum.map(c=>`"${c}"`).join(" | "):"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";case"array":{const c=r.items;return c?`${n(c)}[]`:"unknown[]"}case"object":return i(r);default:return r.anyOf?r.anyOf.map(n).join(" | "):r.oneOf?r.oneOf.map(n).join(" | "):r.allOf?r.allOf.map(n).join(" & "):"unknown"}}function s(r){switch(r){case"string":return"string";case"number":case"integer":return"number";case"boolean":return"boolean";case"null":return"null";default:return"unknown"}}function i(r){const l=r.properties;if(!l)return"Record<string, unknown>";const c=new Set(r.required||[]);return`{
2
2
  ${Object.entries(l).map(([u,d])=>{const f=c.has(u)?"":"?";return`${d.description?` /** ${d.description} */
3
3
  `:""} ${u}${f}: ${n(d)};`}).join(`
4
4
  `)}
@@ -1,4 +1,4 @@
1
- import{c_ as tc,dW as Fe,bX as Os,W as oe,U as ge,aK as ti,cv as _i,aH as Ie,bV as mt,bp as Ve,aI as mr,dX as rn,T as _e,dY as Ii,dZ as ws,d_ as nc,ct as rc,d$ as ia,e0 as ic,e1 as sc,e2 as oc,da as fn,db as Cr,dc as xs,cj as sa,cb as ac,ba as ze,cu as lc,aJ as On,bC as Ti,e3 as cc,r as N,j as w,e4 as oa,cZ as uc}from"./index-rZ1TPVyD.js";import{A as aa,d as fc,e as dc,n as hc,f as pc,C as mc}from"./use-mcp-client-CGBZ7ekq.js";import{B as Ci,c as Pi}from"./collections-NCEoL2EX.js";import{R as Es}from"./index-D9SSFpE5.js";function yc(){const e=new aa({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0,code:{optimize:!1}});return tc(e),e}class gc{#e=yc();#t=new Map;#n=new WeakMap;getValidator(t){const n=this.#n.get(t);if(n)return n;const r=bc(t);let i=this.#t.get(r);i||(i=this.#e.compile(t),this.#t.set(r,i));const s=i,o=a=>s(a)?{valid:!0,data:a,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this.#e.errorsText(s.errors)};return this.#n.set(t,o),o}}function bc(e){return JSON.stringify(e,(t,n)=>n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.keys(n).sort().map(r=>[r,n[r]])):n)}const Sc=new gc;var vc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},Oc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=Ve(n):typeof n=="number"?e.number=Ve(n):typeof n=="boolean"?e.boolean=Ve(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},wc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return Ve(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([Ve(n),Ve(r),...i.map(s=>Ve(s))])}return t==="boolean"?mt([Ve(!0),Ve(!1)]):!1}},xc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=oc();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Ec=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},Ac=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},_c=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},Ic=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},Tc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Cc=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Pc=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},Fc=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},jc=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},$c=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Dc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Nc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Rc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof nc){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},Mc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},Uc=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},kc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Lc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Bc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Cn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Cn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Cn(e[i],t[i]))}return!1}function Wc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Cn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Vc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},qc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Wc(),{message:"Array items must be unique"})}},Hc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Kc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Gc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},zc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Yc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof ic||e instanceof sc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Jc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Cn(r,i)),{message:"Value must match one of the enum values"})}},Zc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Cn(r,n),{message:"Value must equal the const value"})}},Xc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},Qc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},eu=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},tu=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},nu=[new Oc,new wc,new vc,new xc,new Ec,new $c,new kc,new Ac,new _c,new Ic,new Tc,new Cc,new Pc,new Fc,new jc,new Mc,new Dc,new Nc,new Rc,new Lc,new Bc,new Uc],ru=[new Qc,new Jc,new Zc,new Hc,new Kc,new Gc,new zc,new Yc,new eu,new Vc,new qc,new tu,new Xc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of nu)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=rc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of ru)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function iu(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var la=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||la("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?la("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Te,Et,kt,Qn,ur,wn,Vt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Te),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,Vt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Te)===this.CLOSED)return;he(this,Te,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,Vt,void 0),G(this,Te)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,su()));else throw new Error("Invalid URL")}catch{throw iu("An invalid or illegal string was specified")}he(this,Lt,fc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Te,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Te)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,Vt)&&clearTimeout(G(this,Vt)),G(this,Te)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Te,this.CLOSED),he(this,ct,void 0))}}Te=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,Vt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Te,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Te)!==this.CLOSED&&he(this,Te,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Te)===this.CLOSED)return;he(this,Te,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,Vt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function su(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class ou extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class au{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=dc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=hc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new ou(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Cr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const lu="mcp";class cu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,lu),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class uu extends pc{constructor(t,n){super(t,n)}send(t,n){const r=fu(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function fu(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class du extends mc{constructor(t,n){super(t,{jsonSchemaValidator:Sc,...n})}async listTools(t,n){return await this.request({method:"tools/list",params:t},ac,n)}}const hu=async(e,t,n)=>{const r=pu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new du({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},pu=(e,t,n)=>{if(e.type==="Websocket")return new cu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new au(new URL(e.url),s)}return new uu(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Ts=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Cs=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function mu(e){const t=n=>"connection"in e?hu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Ts(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Ts(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Cs(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Cs(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>yu({connection:n}):global[t]}});function yu(e){return mu(e)}const gu=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),bu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
1
+ import{c_ as tc,dW as Fe,bX as Os,W as oe,U as ge,aK as ti,cv as _i,aH as Ie,bV as mt,bp as Ve,aI as mr,dX as rn,T as _e,dY as Ii,dZ as ws,d_ as nc,ct as rc,d$ as ia,e0 as ic,e1 as sc,e2 as oc,da as fn,db as Cr,dc as xs,cj as sa,cb as ac,ba as ze,cu as lc,aJ as On,bC as Ti,e3 as cc,r as N,j as w,e4 as oa,cZ as uc}from"./index-DxLTuX83.js";import{A as aa,d as fc,e as dc,n as hc,f as pc,C as mc}from"./use-mcp-client-B7YSHa6V.js";import{B as Ci,c as Pi}from"./collections-BEkDC2fV.js";import{R as Es}from"./index-VW961Pbw.js";function yc(){const e=new aa({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0,code:{optimize:!1}});return tc(e),e}class gc{#e=yc();#t=new Map;#n=new WeakMap;getValidator(t){const n=this.#n.get(t);if(n)return n;const r=bc(t);let i=this.#t.get(r);i||(i=this.#e.compile(t),this.#t.set(r,i));const s=i,o=a=>s(a)?{valid:!0,data:a,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this.#e.errorsText(s.errors)};return this.#n.set(t,o),o}}function bc(e){return JSON.stringify(e,(t,n)=>n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.keys(n).sort().map(r=>[r,n[r]])):n)}const Sc=new gc;var vc=class{apply(e,t){if(!t.type)return;const n=Array.isArray(t.type)?t.type:[t.type],r=new Set(n);if(r.has("string")||(e.string=!1),!r.has("number")&&!r.has("integer")&&(e.number=!1),r.has("boolean")||(e.boolean=!1),r.has("null")||(e.null=!1),r.has("array")||(e.array=!1),r.has("object")||(e.object=!1),r.has("integer")&&e.number!==!1){const i=e.number||ge();i instanceof rn&&(e.number=i.int())}}},Oc=class{apply(e,t){if(t.const===void 0)return;const n=t.const;e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1,typeof n=="string"?e.string=Ve(n):typeof n=="number"?e.number=Ve(n):typeof n=="boolean"?e.boolean=Ve(n):n===null?e.null=_i():Array.isArray(n)?e.array=void 0:typeof n=="object"&&(e.object=void 0)}},wc=class{apply(e,t){if(!t.enum)return;if(t.enum.length===0){t.type||(e.string=!1,e.number=!1,e.boolean=!1,e.null=!1,e.array=!1,e.object=!1);return}const n={string:t.enum.filter(r=>typeof r=="string"),number:t.enum.filter(r=>typeof r=="number"),boolean:t.enum.filter(r=>typeof r=="boolean"),null:t.enum.filter(r=>r===null),array:t.enum.filter(r=>Array.isArray(r)),object:t.enum.filter(r=>typeof r=="object"&&r!==null&&!Array.isArray(r))};e.string=this.createTypeSchema(n.string,"string"),e.number=this.createTypeSchema(n.number,"number"),e.boolean=this.createTypeSchema(n.boolean,"boolean"),e.null=n.null.length>0?_i():!1,e.array=n.array.length>0?void 0:!1,e.object=n.object.length>0?void 0:!1}createTypeSchema(e,t){if(e.length===0)return!1;if(e.length===1)return Ve(e[0]);if(t==="string")return mr(e);if(t==="number"){const[n,r,...i]=e;return mt([Ve(n),Ve(r),...i.map(s=>Ve(s))])}return t==="boolean"?mt([Ve(!0),Ve(!1)]):!1}},xc=class{apply(e,t){const n=t;if(n.type==="string"&&n.format==="binary"&&n.contentEncoding==="binary"){let r=oc();n.minLength!==void 0&&(r=r.min(n.minLength)),n.maxLength!==void 0&&(r=r.max(n.maxLength)),n.contentMediaType!==void 0&&(r=r.mime(n.contentMediaType)),e.file=r,e.string=!1}}},Ec=class{apply(e,t){const n=t;t.type===void 0&&(n.minLength!==void 0||n.maxLength!==void 0||n.pattern!==void 0)&&e.string===void 0&&(e.string=oe())}},Ac=class{apply(e,t){const n=t;if(n.minLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length>=n.minLength,{message:`String must be at least ${n.minLength} characters long`}))}}},_c=class{apply(e,t){const n=t;if(n.maxLength!==void 0&&e.string!==!1){const r=e.string||oe();r instanceof Ii&&(e.string=r.refine(i=>Array.from(i).length<=n.maxLength,{message:`String must be at most ${n.maxLength} characters long`}))}}},Ic=class{apply(e,t){const n=t;if(n.pattern&&e.string!==!1){const r=e.string||oe();if(r instanceof Ii){const i=new RegExp(n.pattern);e.string=r.regex(i)}}}},Tc=class{apply(e,t){const n=t;if(n.minimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.min(n.minimum))}}},Cc=class{apply(e,t){const n=t;if(n.maximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.max(n.maximum))}}},Pc=class{apply(e,t){const n=t;if(n.exclusiveMinimum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMinimum=="number"?e.number=r.gt(n.exclusiveMinimum):e.number=!1)}}},Fc=class{apply(e,t){const n=t;if(n.exclusiveMaximum!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(typeof n.exclusiveMaximum=="number"?e.number=r.lt(n.exclusiveMaximum):e.number=!1)}}},jc=class{apply(e,t){const n=t;if(n.multipleOf!==void 0&&e.number!==!1){const r=e.number||ge();r instanceof rn&&(e.number=r.refine(i=>{if(n.multipleOf===0)return!1;const s=i/n.multipleOf,o=Math.round(s),a=Math.min(Math.abs(i)*Number.EPSILON*10,Math.abs(n.multipleOf)*Number.EPSILON*10);return Math.abs(s-o)<=a/Math.abs(n.multipleOf)},{message:`Must be a multiple of ${n.multipleOf}`}))}}},$c=class{apply(e,t){const n=t;t.type===void 0&&(n.minItems!==void 0||n.maxItems!==void 0||n.items!==void 0||n.prefixItems!==void 0)&&e.array===void 0&&(e.array=Ie(Fe()))}},Dc=class{apply(e,t){const n=t;n.minItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).min(n.minItems))}},Nc=class{apply(e,t){const n=t;n.maxItems!==void 0&&e.array!==!1&&(e.array=(e.array||Ie(Fe())).max(n.maxItems))}},Rc=class{apply(e,t){const n=t;if(e.array!==!1)if(Array.isArray(n.items))e.array=e.array||Ie(Fe());else if(n.items&&typeof n.items!="boolean"&&!n.prefixItems){const r=Ae(n.items);let i=Ie(r);if(e.array&&e.array instanceof nc){const s=e.array._def;s.checks&&s.checks.forEach(o=>{if(o._zod&&o._zod.def){const a=o._zod.def;a.check==="min_length"&&a.minimum!==void 0?i=i.min(a.minimum):a.check==="max_length"&&a.maximum!==void 0&&(i=i.max(a.maximum))}})}e.array=i}else typeof n.items=="boolean"&&n.items===!1?n.prefixItems?e.array=e.array||Ie(Fe()):e.array=Ie(Fe()).max(0):typeof n.items=="boolean"&&n.items===!0?e.array=e.array||Ie(Fe()):n.prefixItems&&(e.array=e.array||Ie(Fe()))}},Mc=class{apply(e,t){if(t.type!=="array")return;const n=t;if(!Array.isArray(n.items)||e.array===!1)return;const r=n.items.map(s=>Ae(s));let i;r.length===0?i=ws([]):i=ws(r),n.minItems!==void 0&&n.minItems>r.length&&(i=!1),n.maxItems!==void 0&&n.maxItems<r.length&&(i=!1),e.tuple=i,e.array=!1}},Uc=class{apply(e,t){const n=t;e.object!==!1&&(n.properties||n.required||n.additionalProperties!==void 0)&&(e.object=e.object||_e({}).passthrough())}},kc=class{apply(e,t){const n=t;t.type===void 0&&(n.maxProperties!==void 0||n.minProperties!==void 0)&&e.object===void 0&&(e.object=_e({}).passthrough())}},Lc=class{apply(e,t){const n=t;if(n.maxProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length<=n.maxProperties,{message:`Object must have at most ${n.maxProperties} properties`})}}},Bc=class{apply(e,t){const n=t;if(n.minProperties!==void 0&&e.object!==!1){const r=e.object||_e({}).passthrough();e.object=r.refine(i=>Object.keys(i).length>=n.minProperties,{message:`Object must have at least ${n.minProperties} properties`})}}};function Cn(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>Cn(n,t[r]));if(typeof e=="object"&&typeof t=="object"){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>r.includes(i)&&Cn(e[i],t[i]))}return!1}function Wc(){return e=>{if(!Array.isArray(e))return!0;const t=[];return e.every(n=>t.some(i=>Cn(n,i))?!1:(t.push(n),!0))}}function cr(e,t){return e.safeParse(t).success}var Vc=class{apply(e,t){if(!t.not)return e;const n=Ae(t.not);return e.refine(r=>!cr(n,r),{message:"Value must not match the 'not' schema"})}},qc=class{apply(e,t){return t.uniqueItems!==!0?e:e.refine(Wc(),{message:"Array items must be unique"})}},Hc=class{apply(e,t){return!t.allOf||t.allOf.length===0?e:t.allOf.map(r=>Ae(r)).reduce((r,i)=>ia(r,i),e)}},Kc=class{apply(e,t){if(!t.anyOf||t.anyOf.length===0)return e;const n=t.anyOf.length===1?Ae(t.anyOf[0]):mt([Ae(t.anyOf[0]),Ae(t.anyOf[1]),...t.anyOf.slice(2).map(r=>Ae(r))]);return ia(e,n)}},Gc=class{apply(e,t){if(!t.oneOf||t.oneOf.length===0)return e;const n=t.oneOf.map(r=>Ae(r));return e.refine(r=>{let i=0;for(const s of n)if(s.safeParse(r).success&&(i++,i>1))return!1;return i===1},{message:"Value must match exactly one of the oneOf schemas"})}},zc=class{apply(e,t){const n=t;if(n.prefixItems&&Array.isArray(n.prefixItems)){const i=n.prefixItems.map(s=>Ae(s));return e.refine(s=>{if(!Array.isArray(s))return!0;for(let o=0;o<Math.min(s.length,i.length);o++)if(!cr(i[o],s[o]))return!1;if(s.length>i.length){if(typeof n.items=="boolean"&&n.items===!1)return!1;if(n.items&&typeof n.items=="object"&&!Array.isArray(n.items)){const o=Ae(n.items);for(let a=i.length;a<s.length;a++)if(!cr(o,s[a]))return!1}}return!0},{message:"Array does not match prefixItems schema"})}return e}},Yc=class{apply(e,t){const n=t;if(!n.properties&&!n.required&&n.additionalProperties!==!1)return e;if(e instanceof ic||e instanceof sc){const r={};if(n.properties)for(const[i,s]of Object.entries(n.properties))s!==void 0&&(r[i]=Ae(s));if(n.required&&Array.isArray(n.required)){const i=new Set(n.required);for(const s of Object.keys(r))i.has(s)||(r[s]=r[s].optional())}else for(const i of Object.keys(r))r[i]=r[i].optional();return n.additionalProperties===!1?_e(r):_e(r).passthrough()}return e.refine(r=>{if(typeof r!="object"||r===null||Array.isArray(r))return!0;if(n.properties){for(const[i,s]of Object.entries(n.properties))if(s!==void 0&&Object.getOwnPropertyDescriptor(r,i)!==void 0&&!Ae(s).safeParse(r[i]).success)return!1}if(n.required&&Array.isArray(n.required)){for(const i of n.required)if(!(Object.getOwnPropertyDescriptor(r,i)!==void 0))return!1}if(n.additionalProperties===!1&&n.properties){const i=new Set(Object.keys(n.properties));for(const s in r)if(!i.has(s))return!1}return!0},{message:"Object constraints validation failed"})}},Jc=class{apply(e,t){if(!t.enum||t.enum.length===0)return e;const n=t.enum.filter(r=>Array.isArray(r)||typeof r=="object"&&r!==null);return n.length===0?e:e.refine(r=>typeof r!="object"||r===null?!0:n.some(i=>Cn(r,i)),{message:"Value must match one of the enum values"})}},Zc=class{apply(e,t){if(t.const===void 0)return e;const n=t.const;return typeof n!="object"||n===null?e:e.refine(r=>Cn(r,n),{message:"Value must equal the const value"})}},Xc=class{apply(e,t){return t.description&&(e=e.describe(t.description)),e}},Qc=class{apply(e,t){var n;const r=t;return!((n=r.required)!=null&&n.includes("__proto__"))||t.type!==void 0?e:Fe().refine(i=>this.validateRequired(i,r.required),{message:"Missing required properties"})}validateRequired(e,t){return typeof e!="object"||e===null||Array.isArray(e)?!0:t.every(n=>Object.prototype.hasOwnProperty.call(e,n))}},eu=class{apply(e,t){var n;const r=t;if(r.contains===void 0)return e;const i=Ae(r.contains),s=(n=r.minContains)!=null?n:1,o=r.maxContains;return e.refine(a=>{if(!Array.isArray(a))return!0;let l=0;for(const c of a)cr(i,c)&&l++;return!(l<s||o!==void 0&&l>o)},{message:"Array must contain required items matching the schema"})}},tu=class{apply(e,t){const{default:n}=t;return n===void 0||!e.safeParse(n).success?e:e.default(n)}},nu=[new Oc,new wc,new vc,new xc,new Ec,new $c,new kc,new Ac,new _c,new Ic,new Tc,new Cc,new Pc,new Fc,new jc,new Mc,new Dc,new Nc,new Rc,new Lc,new Bc,new Uc],ru=[new Qc,new Jc,new Zc,new Hc,new Kc,new Gc,new zc,new Yc,new eu,new Vc,new qc,new tu,new Xc];function Ae(e){if(typeof e=="boolean")return e?Fe():Os();const t={};for(const i of nu)i.apply(t,e);const n=[];if(t.string!==!1&&n.push(t.string||oe()),t.number!==!1&&n.push(t.number||ge()),t.boolean!==!1&&n.push(t.boolean||ti()),t.null!==!1&&n.push(t.null||_i()),t.array!==!1&&n.push(t.array||Ie(Fe())),t.tuple!==!1&&t.tuple!==void 0&&n.push(t.tuple),t.object!==!1)if(t.object)n.push(t.object);else{const i=rc(s=>typeof s=="object"&&s!==null&&!Array.isArray(s),"Must be an object, not an array");n.push(i)}t.file!==!1&&t.file!==void 0&&n.push(t.file);let r;n.length===0?r=Os():n.length===1?r=n[0]:Object.keys(e).some(s=>s!=="$schema"&&s!=="title"&&s!=="description")?r=mt(n):r=Fe();for(const i of ru)r=i.apply(r,e);return r}class As extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(i=n?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(_s(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(_s(this),n)}}function iu(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function ni(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(ni).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${ni(e.cause)}`:e.message:`${e}`}function _s(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var la=e=>{throw TypeError(e)},Fi=(e,t,n)=>t.has(e)||la("Cannot "+n),G=(e,t,n)=>(Fi(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?la("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Fi(e,t,"write to private field"),t.set(e,n),n),Qe=(e,t,n)=>(Fi(e,t,"access private method"),n),Te,Et,kt,Qn,ur,wn,Vt,xn,ct,Lt,Gt,Bt,mn,Re,ri,ii,si,Is,oi,ai,yn,li,ci;class er extends EventTarget{constructor(t,n){var r,i;super(),Se(this,Re),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Se(this,Te),Se(this,Et),Se(this,kt),Se(this,Qn),Se(this,ur),Se(this,wn),Se(this,Vt),Se(this,xn,null),Se(this,ct),Se(this,Lt),Se(this,Gt,null),Se(this,Bt,null),Se(this,mn,null),Se(this,ii,async s=>{var o;G(this,Lt).reset();const{body:a,redirected:l,status:c,headers:u}=s;if(c===204){Qe(this,Re,yn).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?he(this,kt,new URL(s.url)):he(this,kt,void 0),c!==200){Qe(this,Re,yn).call(this,`Non-200 status code (${c})`,c);return}if(!(u.get("content-type")||"").startsWith("text/event-stream")){Qe(this,Re,yn).call(this,'Invalid content type, expected "text/event-stream"',c);return}if(G(this,Te)===this.CLOSED)return;he(this,Te,this.OPEN);const f=new Event("open");if((o=G(this,mn))==null||o.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Qe(this,Re,yn).call(this,"Invalid response body, expected a web ReadableStream",c),this.close();return}const h=new TextDecoder,m=a.getReader();let d=!0;do{const{done:p,value:y}=await m.read();y&&G(this,Lt).feed(h.decode(y,{stream:!p})),p&&(d=!1,G(this,Lt).reset(),Qe(this,Re,li).call(this))}while(d)}),Se(this,si,s=>{he(this,ct,void 0),!(s.name==="AbortError"||s.type==="aborted")&&Qe(this,Re,li).call(this,ni(s))}),Se(this,oi,s=>{typeof s.id=="string"&&he(this,xn,s.id);const o=new MessageEvent(s.event||"message",{data:s.data,origin:G(this,kt)?G(this,kt).origin:G(this,Et).origin,lastEventId:s.id||""});G(this,Bt)&&(!s.event||s.event==="message")&&G(this,Bt).call(this,o),this.dispatchEvent(o)}),Se(this,ai,s=>{he(this,wn,s)}),Se(this,ci,()=>{he(this,Vt,void 0),G(this,Te)===this.CONNECTING&&Qe(this,Re,ri).call(this)});try{if(t instanceof URL)he(this,Et,t);else if(typeof t=="string")he(this,Et,new URL(t,su()));else throw new Error("Invalid URL")}catch{throw iu("An invalid or illegal string was specified")}he(this,Lt,fc({onEvent:G(this,oi),onRetry:G(this,ai)})),he(this,Te,this.CONNECTING),he(this,wn,3e3),he(this,ur,(r=n?.fetch)!=null?r:globalThis.fetch),he(this,Qn,(i=n?.withCredentials)!=null?i:!1),Qe(this,Re,ri).call(this)}get readyState(){return G(this,Te)}get url(){return G(this,Et).href}get withCredentials(){return G(this,Qn)}get onerror(){return G(this,Gt)}set onerror(t){he(this,Gt,t)}get onmessage(){return G(this,Bt)}set onmessage(t){he(this,Bt,t)}get onopen(){return G(this,mn)}set onopen(t){he(this,mn,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){G(this,Vt)&&clearTimeout(G(this,Vt)),G(this,Te)!==this.CLOSED&&(G(this,ct)&&G(this,ct).abort(),he(this,Te,this.CLOSED),he(this,ct,void 0))}}Te=new WeakMap,Et=new WeakMap,kt=new WeakMap,Qn=new WeakMap,ur=new WeakMap,wn=new WeakMap,Vt=new WeakMap,xn=new WeakMap,ct=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Bt=new WeakMap,mn=new WeakMap,Re=new WeakSet,ri=function(){he(this,Te,this.CONNECTING),he(this,ct,new AbortController),G(this,ur)(G(this,Et),Qe(this,Re,Is).call(this)).then(G(this,ii)).catch(G(this,si))},ii=new WeakMap,si=new WeakMap,Is=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...G(this,xn)?{"Last-Event-ID":G(this,xn)}:void 0},cache:"no-store",signal:(e=G(this,ct))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},oi=new WeakMap,ai=new WeakMap,yn=function(e,t){var n;G(this,Te)!==this.CLOSED&&he(this,Te,this.CLOSED);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r)},li=function(e,t){var n;if(G(this,Te)===this.CLOSED)return;he(this,Te,this.CONNECTING);const r=new As("error",{code:t,message:e});(n=G(this,Gt))==null||n.call(this,r),this.dispatchEvent(r),he(this,Vt,setTimeout(G(this,ci),G(this,wn)))},ci=new WeakMap,er.CONNECTING=0,er.OPEN=1,er.CLOSED=2;function su(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}class ou extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class au{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n?.eventSourceInit,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=dc(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new fn("No auth provider");let t;try{t=await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(n){throw this.onerror?.(n),n}if(t!=="AUTHORIZED")throw new fn;return await this._startOrAuth()}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=hc(this._requestInit?.headers);return new Headers({...t,...n})}_startOrAuth(){const t=this?._eventSourceInit?.fetch??this._fetch??fetch;return new Promise((n,r)=>{this._eventSource=new er(this._url.href,{...this._eventSourceInit,fetch:async(i,s)=>{const o=await this._commonHeaders();o.set("Accept","text/event-stream");const a=await t(i,{...s,headers:o});if(a.status===401&&a.headers.has("www-authenticate")){const{resourceMetadataUrl:l,scope:c}=xs(a);this._resourceMetadataUrl=l,this._scope=c}return a}}),this._abortController=new AbortController,this._eventSource.onerror=i=>{if(i.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const s=new ou(i.code,i.message,i);r(s),this.onerror?.(s)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",i=>{const s=i;try{if(this._endpoint=new URL(s.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(o){r(o),this.onerror?.(o),this.close();return}n()}),this._eventSource.onmessage=i=>{const s=i;let o;try{o=sa.parse(JSON.parse(s.data))}catch(a){this.onerror?.(a);return}this.onmessage?.(o)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(t){if(!this._authProvider)throw new fn("No auth provider");if(await Cr(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn("Failed to authorize")}async close(){this._abortController?.abort(),this._eventSource?.close(),this.onclose?.()}async send(t){if(!this._endpoint)throw new Error("Not connected");try{const n=await this._commonHeaders();n.set("content-type","application/json");const r={...this._requestInit,method:"POST",headers:n,body:JSON.stringify(t),signal:this._abortController?.signal},i=await(this._fetch??fetch)(this._endpoint,r);if(!i.ok){const s=await i.text().catch(()=>null);if(i.status===401&&this._authProvider){const{resourceMetadataUrl:o,scope:a}=xs(i);if(this._resourceMetadataUrl=o,this._scope=a,await Cr(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new fn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${i.status}): ${s}`)}await i.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const lu="mcp";class cu{constructor(t){this._url=t}start(){if(this._socket)throw new Error("WebSocketClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((t,n)=>{this._socket=new WebSocket(this._url,lu),this._socket.onerror=r=>{const i="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(i),this.onerror?.(i)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let i;try{i=sa.parse(JSON.parse(r.data))}catch(s){this.onerror?.(s);return}this.onmessage?.(i)}})}async close(){this._socket?.close()}send(t){return new Promise((n,r)=>{if(!this._socket){r(new Error("Not connected"));return}this._socket?.send(JSON.stringify(t)),n()})}}class uu extends pc{constructor(t,n){super(t,n)}send(t,n){const r=fu(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function fu(e){const t=e;if(!t||typeof t!="object"||!("method"in t))return null;switch(t.method){case"initialize":{const n=t?.params?.protocolVersion;return n?{type:"emit",message:{result:{protocolVersion:n,capabilities:{tools:{}},serverInfo:{name:"deco-chat-server",version:"1.0.0"}},jsonrpc:t.jsonrpc??"2.0",id:t.id}}:null}case"notifications/roots/list_changed":case"notifications/initialized":case"notifications/cancelled":case"notifications/progress":return{type:"suppress"};default:return null}}class du extends mc{constructor(t,n){super(t,{jsonSchemaValidator:Sc,...n})}async listTools(t,n){return await this.request({method:"tools/list",params:t},ac,n)}}const hu=async(e,t,n)=>{const r=pu(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const i=new du({name:e?.name??"MCP Client",version:"1.0.0"});return await i.connect(r),{client:i}},pu=(e,t,n)=>{if(e.type==="Websocket")return new cu(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const i={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const s={requestInit:{headers:i,signal:t}};return e.token&&(s.eventSourceInit={fetch:(o,a)=>fetch(o,{...a,headers:{...i,Accept:"text/event-stream"},signal:t})}),new au(new URL(e.url),s)}return new uu(new URL(e.url),{requestInit:{headers:i,signal:t,credentials:"include"}})},Ts=e=>{try{return JSON.parse(e)}catch{return e}},zn=new Map,Cs=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?Ae(e.inputSchema):void 0,outputSchema:e.outputSchema?Ae(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function mu(e){const t=n=>"connection"in e?hu({connection:e.connection},void 0,n):e.client;return new Proxy({},{get(n,r){if(r==="toJSON")return null;if(typeof r!="string")throw new Error("Name must be a string");if(r==="listTools")return a;async function i(l,c=r){const u=e?.debugId?.(),f=u?{"x-trace-debug-id":u}:void 0,{client:h}=await t(f),{structuredContent:m,isError:d,content:p}=await h.callTool({name:String(c),arguments:l});if(d){const S=p?.[0]?.text,O=typeof S=="string"?Ts(S):null,E=O?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(O.code,O.message,O.traceId):null;throw E||new Error(`Tool ${String(c)} returned an error: ${JSON.stringify(m??p)}`)}if(m!==void 0)return m;const y=p?.[0]?.text;return typeof y=="string"?Ts(y):void 0}async function s(){const{client:l}=await t(),{tools:c}=await l.listTools();return c}async function o(){if(!("connection"in e))return s();const l=e.connection,c=JSON.stringify(l);try{return zn.has(c)||zn.set(c,s()),await zn.get(c)}catch(u){console.error("Failed to list tools",u),zn.delete(c);return}}async function a(){return(await o()??[]).map(c=>Cs(c,i))}return i.asTool=async()=>{const c=(await o()??[]).find(u=>u.name===r);if(!c)throw new Error(`Tool ${r} not found`);return Cs(c,i)},i}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>yu({connection:n}):global[t]}});function yu(e){return mu(e)}const gu=_e({toolName:oe().describe("Name of the tool to invoke on that connection"),transformCode:oe().optional().describe("Pure TypeScript function for data transformation of the tool call result. Must be a TypeScript file that declares the Output interface and exports a default function: `interface Output { ... } export default async function(stepInput): Output { ... }`\n The stepInput will match with the tool call outputSchema. If transformCode is not provided, the tool call result will be used as the step output.\n Providing an transformCode is recommended because it both allows you to transform the data and validate it against a JSON Schema - tools are ephemeral and may return unexpected data.")}),bu=_e({code:oe().describe(`Pure TypeScript function for data transformation. Useful to merge data from multiple steps and transform it. Must be a TypeScript file that declares the Output interface and exports a default function: \`interface Output { ... } export default async function(stepInput): Output { ... }\`
2
2
  The stepInput is the resolved value of the references in the input field. Example:
3
3
  {
4
4
  "input": {
@@ -1 +1 @@
1
- import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-QXSqgT3C.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:v}=x,B=b&&!P,y=Q(D),F=new RegExp(`\\s${y}$`),h=j?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const K=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=K+u.index;let p=I+u[0].length;return B&&F.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:j=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:F="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:K=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,O=A||i&&R;if(!w&&!k&&!O)return;const $=O&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),O&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=K({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(F),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
1
+ import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-DtVZtiV9.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:v}=x,B=b&&!P,y=Q(D),F=new RegExp(`\\s${y}$`),h=j?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const K=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=K+u.index;let p=I+u[0].length;return B&&F.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:j=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:F="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:K=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,O=A||i&&R;if(!w&&!k&&!O)return;const $=O&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),O&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=K({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(F),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
@@ -1 +1 @@
1
- import{bC as _}from"./index-rZ1TPVyD.js";var S={exports:{}},r={};var $;function C(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function I(){return v||(v=1,S.exports=C()),S.exports}var g=I();const h=_(g);export{h as R,g as r};
1
+ import{bC as _}from"./index-DxLTuX83.js";var S={exports:{}},r={};var $;function C(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function I(){return v||(v=1,S.exports=C()),S.exports}var g=I();const h=_(g);export{h as R,g as r};
@@ -1,4 +1,4 @@
1
- import{r as a,b5 as R}from"./index-rZ1TPVyD.js";function re(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function me(e){if(Array.isArray(e))return e}function be(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,s=[],f=!0,p=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);f=!0);}catch(j){p=!0,o=j}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(p)throw o}}return s}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{r as a,b5 as R}from"./index-DxLTuX83.js";function re(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function me(e){if(Array.isArray(e))return e}function be(e,t,r){return(t=Se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,c,s=[],f=!0,p=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(f=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);f=!0);}catch(j){p=!0,o=j}finally{try{if(!f&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(p)throw o}}return s}}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ne(Object(r),!0).forEach(function(n){be(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ne(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oe(e,t){if(e==null)return{};var r,n,o=je(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function je(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Me(e,t){return me(e)||ye(e,t)||Ee(e,t)||we()}function Pe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Se(e){var t=Pe(e,"string");return typeof t=="symbol"?t:t+""}function Ee(e,t){if(e){if(typeof e=="string")return re(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?re(e,t):void 0}}function Re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ie(Object(r),!0).forEach(function(n){Re(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ie(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ie(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function A(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function F(e){return{}.toString.call(e).includes("Object")}function Te(e){return!Object.keys(e).length}function D(e){return typeof e=="function"}function Ce(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Le(e,t){return F(t)||P("changeType"),Object.keys(t).some(function(r){return!Ce(e,r)})&&P("changeField"),t}function Ae(e){D(e)||P("selectorType")}function $e(e){D(e)||F(e)||P("handlerType"),F(e)&&Object.values(e).some(function(t){return!D(t)})&&P("handlersType")}function De(e){e||P("initialIsRequired"),F(e)||P("initialType"),Te(e)&&P("initialContent")}function Ve(e,t){throw new Error(e[t]||e.default)}var xe={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},P=A(Ve)(xe),q={changes:Le,selector:Ae,handler:$e,initial:De};function Ne(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};q.initial(e),q.handler(t);var r={current:e},n=A(Fe)(r,t),o=A(ze)(r),i=A(q.changes)(e),c=A(qe)(r);function s(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(j){return j};return q.selector(p),p(r.current)}function f(p){Ie(n,o,i,c)(p)}return[s,f]}function qe(e,t){return D(t)?t(e.current):t}function ze(e,t){return e.current=ae(ae({},e.current),t),t}function Fe(e,t,r){return D(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var Ue={create:Ne},He={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function We(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,s=new Array(c),f=0;f<c;f++)s[f]=arguments[f];return t.apply(r,[].concat(o,s))}}}function Be(e){return{}.toString.call(e).includes("Object")}function Ke(e){return e||ue("configIsRequired"),Be(e)||ue("configType"),e.urls?(Ge(),{paths:{vs:e.urls.monacoBase}}):e}function Ge(){console.warn(ce.deprecation)}function Ye(e,t){throw new Error(e[t]||e.default)}var ce={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
3
  You are using deprecated way of configuration.
4
4
 
@@ -1 +1 @@
1
- import{e as c,g as p,j as s,l as u,N as a}from"./index-rZ1TPVyD.js";import{a as x}from"./use-capability-B2IrzHkM.js";import{C as j}from"./capability-load-error-DYWpzVHl.js";function v(){const t=c.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:g}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(g){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
1
+ import{e as c,g as p,j as s,l as u,N as a}from"./index-DxLTuX83.js";import{a as x}from"./use-capability-DDDjfOOE.js";import{C as j}from"./capability-load-error-BqquNR5_.js";function v(){const t=c.c(21);let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org"},t[0]=o):o=t[0];const{org:r}=p(o),{capabilities:l,isPrivileged:m,loading:f,error:g}=x();if(f){let e;return t[1]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex flex-1 items-center justify-center p-8",children:s.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[1]=e):e=t[1],e}if(g){let e;return t[2]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(j,{}),t[2]=e):e=t[2],e}const i=e=>m||l[e]===!0;if(i("org:manage")){let e;return t[3]!==r?(e=s.jsx(a,{to:"/$org/settings/general",params:{org:r},replace:!0}),t[3]=r,t[4]=e):e=t[4],e}if(i("ai-providers:manage")){let e;return t[5]!==r?(e=s.jsx(a,{to:"/$org/settings/ai-providers",params:{org:r},replace:!0}),t[5]=r,t[6]=e):e=t[6],e}if(i("secrets:manage")){let e;return t[7]!==r?(e=s.jsx(a,{to:"/$org/settings/secrets",params:{org:r},replace:!0}),t[7]=r,t[8]=e):e=t[8],e}if(i("file-configs:manage")){let e;return t[9]!==r?(e=s.jsx(a,{to:"/$org/settings/buckets",params:{org:r},replace:!0}),t[9]=r,t[10]=e):e=t[10],e}if(i("automations:manage")){let e;return t[11]!==r?(e=s.jsx(a,{to:"/$org/settings/automations",params:{org:r},replace:!0}),t[11]=r,t[12]=e):e=t[12],e}if(i("registry:manage")){let e;return t[13]!==r?(e=s.jsx(a,{to:"/$org/settings/store",params:{org:r},replace:!0}),t[13]=r,t[14]=e):e=t[14],e}if(i("monitoring:view")){let e;return t[15]!==r?(e=s.jsx(a,{to:"/$org/settings/monitor",params:{org:r},replace:!0}),t[15]=r,t[16]=e):e=t[16],e}if(i("members:manage")){let e;return t[17]!==r?(e=s.jsx(a,{to:"/$org/settings/members",params:{org:r},replace:!0}),t[17]=r,t[18]=e):e=t[18],e}let n;return t[19]!==r?(n=s.jsx(a,{to:"/$org/settings/profile",params:{org:r},replace:!0}),t[19]=r,t[20]=n):n=t[20],n}export{v as default};
@@ -1 +1 @@
1
- import{e as s,c as a,j as d}from"./index-rZ1TPVyD.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
1
+ import{e as s,c as a,j as d}from"./index-DxLTuX83.js";function f(l){const e=s.c(10);let i,t,r;e[0]!==l?({className:i,type:r,...t}=l,e[0]=l,e[1]=i,e[2]=t,e[3]=r):(i=e[1],t=e[2],r=e[3]);let n;e[4]!==i?(n=a("file:text-foreground text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-lg bg-background dark:bg-input/30 px-3 py-1 text-sm transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:opacity-50 card-shadow","focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",i),e[4]=i,e[5]=n):n=e[5];let o;return e[6]!==t||e[7]!==n||e[8]!==r?(o=d.jsx("input",{type:r,"data-slot":"input",className:n,...t}),e[6]=t,e[7]=n,e[8]=r,e[9]=o):o=e[9],o}export{f as I};
@@ -1 +1 @@
1
- import{e as A,j as h,r as z,c as _}from"./index-rZ1TPVyD.js";import{n as L}from"./Container-Bl0qWNtu.js";import{A as k}from"./agent-icon-CpBAbwoh.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
1
+ import{e as A,j as h,r as z,c as _}from"./index-DxLTuX83.js";import{n as L}from"./Container-Byi81M5N.js";import{A as k}from"./agent-icon-BAU0Nn5Q.js";const C={"2xs":"h-4 w-4",xs:"h-6 w-6",sm:"h-9 w-9",md:"h-12 w-12",lg:"h-16 w-16",xl:"h-14 w-14"},Z={"2xs":"min-w-4",xs:"min-w-6",sm:"min-w-9",md:"min-w-12",lg:"min-w-16",xl:"min-w-14"},y={"2xs":8,xs:12,sm:16,md:24,lg:32,xl:28},M={"2xs":"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"};function q(E){const e=A.c(12),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w;if(t?.startsWith("icon://")||t?.includes("#agentcolor=")){const r=M[n];let l;return e[0]!==o||e[1]!==t||e[2]!==s||e[3]!==r?(l=h.jsx(k,{icon:t,name:s,size:r,className:o}),e[0]=o,e[1]=t,e[2]=s,e[3]=r,e[4]=l):l=e[4],l}const g=t??"no-icon";let i;return e[5]!==o||e[6]!==c||e[7]!==t||e[8]!==s||e[9]!==n||e[10]!==g?(i=h.jsx(R,{icon:t,name:s,size:n,className:o,fallbackIcon:c},g),e[5]=o,e[6]=c,e[7]=t,e[8]=s,e[9]=n,e[10]=g,e[11]=i):i=e[11],i}function R(E){const e=A.c(24),{icon:t,name:s,size:w,className:o,fallbackIcon:c}=E,n=w===void 0?"md":w,[g,i]=z.useState(!1),r=!!t&&g,l=C[n],b=Z[n];let a;e[0]!==o||e[1]!==l||e[2]!==b?(a=_("rounded-lg border border-border shrink-0 overflow-hidden aspect-square bg-white",l,b,o),e[0]=o,e[1]=l,e[2]=b,e[3]=a):a=e[3];const p=t||void 0,N=!r&&"hidden";let m;e[4]!==N?(m=_("h-full w-full object-cover",N),e[4]=N,e[5]=m):m=e[5];let I,S;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=()=>i(!1),S=()=>i(!0),e[6]=I,e[7]=S):(I=e[6],S=e[7]);let d;e[8]!==s||e[9]!==p||e[10]!==m?(d=h.jsx("img",{src:p,alt:s,className:m,onError:I,onLoad:S}),e[8]=s,e[9]=p,e[10]=m,e[11]=d):d=e[11];const v=r&&"hidden";let f;e[12]!==v?(f=_("h-full w-full flex items-center justify-center bg-muted/20",v),e[12]=v,e[13]=f):f=e[13];let x;e[14]!==c||e[15]!==n?(x=c??h.jsx(L,{size:y[n],className:"text-muted-foreground"}),e[14]=c,e[15]=n,e[16]=x):x=e[16];let u;e[17]!==f||e[18]!==x?(u=h.jsx("div",{className:f,children:x}),e[17]=f,e[18]=x,e[19]=u):u=e[19];let j;return e[20]!==d||e[21]!==u||e[22]!==a?(j=h.jsxs("div",{className:a,children:[d,u]}),e[20]=d,e[21]=u,e[22]=a,e[23]=j):j=e[23],j}export{q as I};
@@ -1 +1 @@
1
- import{e as n,c as r,j as i,bw as p}from"./index-rZ1TPVyD.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
1
+ import{e as n,c as r,j as i,bw as p}from"./index-DxLTuX83.js";function c(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=r("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(p,{"data-slot":"label",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{c as L};
@@ -1 +1 @@
1
- import{e as C,r as i,c as A,j as a,aU as V}from"./index-rZ1TPVyD.js";import{P as E}from"./index-DO3UwA_I.js";const H=i.createContext(null);function q(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function D(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const z=D;function B(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=A(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{B as V,z as a,q as b};
1
+ import{e as C,r as i,c as A,j as a,aU as V}from"./index-DxLTuX83.js";import{P as E}from"./index-DM719JZt.js";const H=i.createContext(null);function q(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.tabsEl)return null;let c;return e[0]!==l||e[1]!==s.tabsEl?(c=V.createPortal(l,s.tabsEl),e[0]=l,e[1]=s.tabsEl,e[2]=c):c=e[2],c}function D(x){const e=C.c(3),{children:l}=x,s=i.useContext(H);if(!s?.actionsEl)return null;let c;return e[0]!==l||e[1]!==s.actionsEl?(c=V.createPortal(l,s.actionsEl),e[0]=l,e[1]=s.actionsEl,e[2]=c):c=e[2],c}const z=D;function B(x){const e=C.c(21),{children:l,breadcrumb:s,hideHeader:c}=x;let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={leftEl:null,tabsEl:null,actionsEl:null},e[0]=b):b=e[0];const[w,g]=i.useState(b),N=i.useRef(null),P=i.useRef(null),L=i.useRef(null);let h;e[1]===Symbol.for("react.memo_cache_sentinel")?(h=t=>{N.current=t,t&&g(n=>n.leftEl===t?n:{...n,leftEl:t})},e[1]=h):h=e[1];const $=h;let R;e[2]===Symbol.for("react.memo_cache_sentinel")?(R=t=>{P.current=t,t&&g(n=>n.tabsEl===t?n:{...n,tabsEl:t})},e[2]=R):R=e[2];const _=R;let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=t=>{L.current=t,t&&g(n=>n.actionsEl===t?n:{...n,actionsEl:t})},e[3]=d):d=e[3];const k=d,p=c&&"hidden";let o;e[4]!==p?(o=A(p),e[4]=p,e[5]=o):o=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=a.jsx("div",{ref:$,className:"flex items-center gap-2 min-w-0"}),e[6]=j):j=e[6];let r;e[7]!==s?(r=a.jsxs(E.Header.Left,{children:[s,j]}),e[7]=s,e[8]=r):r=e[8];let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsxs(E.Header.Right,{children:[a.jsx("div",{ref:_,className:"flex items-center gap-2 overflow-x-auto min-w-0"}),a.jsx("div",{ref:k,className:"flex items-center gap-2 shrink-0"})]}),e[9]=y):y=e[9];let f;e[10]!==o||e[11]!==r?(f=a.jsxs(E.Header,{className:o,children:[r,y]}),e[10]=o,e[11]=r,e[12]=f):f=e[12];let m;e[13]!==l?(m=a.jsx(E.Content,{children:l}),e[13]=l,e[14]=m):m=e[14];let u;e[15]!==f||e[16]!==m?(u=a.jsxs(E,{children:[f,m]}),e[15]=f,e[16]=m,e[17]=u):u=e[17];let S;return e[18]!==w||e[19]!==u?(S=a.jsx(H,{value:w,children:u}),e[18]=w,e[19]=u,e[20]=S):S=e[20],S}export{B as V,z as a,q as b};
@@ -1 +1 @@
1
- import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-rZ1TPVyD.js";import{I}from"./input-BPXWlz46.js";import{A as de}from"./auth-split-layout-BBz1-8cc.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
1
+ import{u as X,r as m,a as z,t as P,b,j as e,c as B,B as Q,d as ie,S as W,N as oe,e as le}from"./index-DxLTuX83.js";import{I}from"./input-3FcnQKag.js";import{A as de}from"./auth-split-layout-By3wB5zH.js";function ce({redirectUrl:s,callbackUrl:n="/"}){const{emailAndPassword:d,resetPassword:u,emailOtp:i,socialProviders:l}=X(),[r,j]=m.useState(""),[y,D]=m.useState(""),[w,C]=m.useState(""),[A,O]=m.useState(""),[f,L]=m.useState(!1),[F,N]=m.useState(()=>i.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[c,S]=m.useState(""),[$,Y]=m.useState(!1),h=F==="signUp",p=F==="forgotPassword",x=F==="emailOtp",R=z({mutationFn:async({email:t,password:a,name:q})=>{try{if(h){const g=await b.signUp.email({email:t,password:a,name:q||""});if(g.error)throw new Error(g.error.message||"Sign up failed");return g}else{const g=await b.signIn.email({email:t,password:a});if(g.error)throw new Error(g.error.message||"Sign in failed");return g}}catch(g){throw g instanceof Error?g:new Error("Authentication failed")}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P(h?"user_signup_failed":"user_signin_failed",{error:t instanceof Error?t.message:String(t)})}}),U=z({mutationFn:async({email:t})=>{const a=await b.requestPasswordReset({email:t,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||"Failed to send reset email");return a},onSuccess:()=>{P("password_reset_requested"),Y(!0)},onError:t=>{P("password_reset_request_failed",{error:t instanceof Error?t.message:String(t)})}}),E=z({mutationFn:async({email:t})=>{const a=await b.emailOtp.sendVerificationOtp({email:t,type:"sign-in"});if(a.error)throw new Error(a.error.message||"Failed to send code");return a},onSuccess:()=>{P("email_otp_sent"),L(!0)},onError:t=>{P("email_otp_send_failed",{error:t instanceof Error?t.message:String(t)})}}),_=z({mutationFn:async({email:t,otp:a})=>{const q=await b.signIn.emailOtp({email:t,otp:a});if(q.error)throw new Error(q.error.message||"Invalid code");return q},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=s??n},onError:t=>{P("email_otp_verify_failed",{error:t instanceof Error?t.message:String(t)})}}),T=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t),V=()=>{r.trim()&&!T(r)&&S("Invalid email address")},Z=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}R.mutate({email:r,password:y,name:w})},ee=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}U.mutate({email:r})},te=t=>{if(t.preventDefault(),!T(r)){S("Invalid email address");return}E.mutate({email:r})},se=t=>{t.preventDefault(),_.mutate({email:r,otp:A})},k=t=>a=>{t(a.target.value),G&&R.reset(),H&&U.reset(),J&&(E.reset(),_.reset()),t===j&&c&&S("")},M=t=>{N(t),C(""),O(""),L(!1),S(""),Y(!1),R.reset(),U.reset(),E.reset(),_.reset()},o=R.isPending||U.isPending||E.isPending||_.isPending,G=R.error,H=U.error,J=E.error||_.error,v=h?r.trim()&&y.trim()&&w.trim():p?r.trim():x?f?A.trim():r.trim():r.trim()&&y.trim(),ne=t=>{if(!t)return null;const a=t.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?"Invalid email or password. Please try again.":a.includes("already exists")||a.includes("409")?"An account with this email already exists. Try signing in instead.":a.includes("network")||a.includes("fetch")?"Network error. Please check your connection and try again.":a.includes("rate limit")||a.includes("429")?"Too many attempts. Please wait a moment and try again.":a.includes("invalid")&&a.includes("otp")?"Invalid or expired code. Please try again.":t.message||"An error occurred. Please try again."},K=G||H||J,re=p?"Reset your password":x&&f?"Enter verification code":"Welcome to deco",ae=p?"We'll send you a reset link":x&&f?`Code sent to ${r}`:"Sign in or create a new account";return e.jsxs("div",{className:"w-full grid gap-10",children:[e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:re}),e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ae})]}),K&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ne(K)}),$&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:"Check your email for a password reset link."}),!p&&!(x&&f)&&l.enabled&&e.jsx("div",{className:"grid gap-2",children:l.providers.map(t=>e.jsxs("button",{type:"button",disabled:o,onClick:()=>{b.signIn.social({provider:t.name,callbackURL:s??n})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[t.icon&&e.jsx("img",{src:t.icon,alt:"",className:B("h-5 w-5",t.name==="github"&&"dark:invert"),"aria-hidden":"true"}),"Continue with"," ",t.name.charAt(0).toUpperCase()+t.name.slice(1)]},t.name))}),!p&&!(x&&f)&&l.enabled&&(d.enabled||i.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:"or"}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),x&&i.enabled&&e.jsx(e.Fragment,{children:f?e.jsxs("form",{onSubmit:se,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Verification code"}),e.jsx(I,{type:"text",placeholder:"Enter code",value:A,onChange:k(O),required:!0,disabled:o,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Verifying...":"Verify"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),O(""),E.reset(),_.reset()},disabled:o,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Use a different email"})]}):e.jsxs("form",{onSubmit:te,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:"Email"}),e.jsx(I,{type:"email",placeholder:"Email address",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive",children:c})]}),e.jsx("button",{type:"submit",disabled:o||!v,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:o?"Sending...":"Send code"})]})}),p&&d.enabled&&!$&&e.jsxs("form",{onSubmit:ee,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsx(Q,{type:"submit",disabled:o||!v,className:"w-full font-semibold",size:"xl",children:o?"Sending...":"Send reset link"})]}),!p&&!x&&d.enabled&&e.jsxs("form",{onSubmit:Z,className:"grid gap-5",children:[h&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Name"}),e.jsx(I,{type:"text",placeholder:"Your name",value:w,onChange:k(C),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Email"}),e.jsx(I,{type:"email",placeholder:"you@example.com",value:r,onChange:k(j),onBlur:V,required:!0,disabled:o,"aria-invalid":!!c,className:"h-11 rounded-lg"}),c&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:c})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Password"}),!h&&u.enabled&&e.jsx("button",{type:"button",onClick:()=>M("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:"Forgot password?"})]}),e.jsx(I,{type:"password",placeholder:"••••••••",value:y,onChange:k(D),required:!0,disabled:o,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",v?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!v&&"pointer-events-none"),children:e.jsx(Q,{type:"submit",disabled:o||!v,className:B("w-full font-semibold"),size:"xl","aria-hidden":!v,children:o?h?"Creating account...":"Signing in...":"Continue"})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:p?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Back to sign in"}):x&&d.enabled?e.jsx("button",{type:"button",onClick:()=>M("signIn"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with password instead"}):!x&&d.enabled?e.jsxs(e.Fragment,{children:[h?"Already have an account? ":"Don't have an account? ",e.jsx("button",{type:"button",onClick:()=>M(h?"signIn":"signUp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:h?"Sign in":"Sign up"}),i.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>M("emailOtp"),disabled:o,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:"Sign in with email code"})]})]}):null})]})}function ue({redirectTo:s}){const[n,d]=m.useState(null);return m.useEffect(()=>{let u=!1;return(async()=>{try{let i;for(let l=0;l<5&&(i=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"}),!(i.ok||i.status<500));l++)await new Promise(r=>setTimeout(r,Math.min(1e3*2**l,1e4)));if(!i?.ok){const l=await i?.json().catch(()=>({}));throw new Error(l?.error||"Auto-login failed")}if(!u){const l=s.startsWith("/")&&!s.startsWith("//")?s:"/";window.location.href=l}}catch(i){u||d(i instanceof Error?i.message:"Auto-login failed")}})(),()=>{u=!0}},[s]),n?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",n]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(W,{})}function me(s){if(!s.client_id||s.response_type!=="code")return null;const n=new URLSearchParams;return s.client_id&&n.set("client_id",s.client_id),s.redirect_uri&&n.set("redirect_uri",s.redirect_uri),s.response_type&&n.set("response_type",s.response_type),s.state&&n.set("state",s.state),s.scope&&n.set("scope",s.scope),s.code_challenge&&n.set("code_challenge",s.code_challenge),s.code_challenge_method&&n.set("code_challenge_method",s.code_challenge_method),`/api/auth/mcp/authorize?${n.toString()}`}function ge(s){const n=le.c(5),{callbackURL:d,providerId:u}=s;let i,l;n[0]!==d||n[1]!==u?(i=()=>{(async()=>await b.signIn.sso({providerId:u,callbackURL:d}))()},l=[u,d],n[0]=d,n[1]=u,n[2]=i,n[3]=l):(i=n[2],l=n[3]),m.useEffect(i,l);let r;return n[4]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(W,{}),n[4]=r):r=n[4],r}function pe(){const s=b.useSession(),n=ie({from:"/login"}),{next:d="/",client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}=n,w=d.startsWith("/")&&!d.startsWith("//")?d:"/",{sso:C,emailAndPassword:A,magicLink:O,emailOtp:f,socialProviders:L,localMode:F}=X(),N=me({client_id:u,redirect_uri:i,response_type:l,state:r,scope:j,code_challenge:y,code_challenge_method:D}),c=N||w;return s.data?N?(window.location.href=N,e.jsx(W,{})):e.jsx(oe,{to:w}):F?e.jsx(ue,{redirectTo:c}):C.enabled?e.jsx(ge,{callbackURL:c,providerId:C.providerId}):A.enabled||O.enabled||f.enabled||L.enabled?e.jsx(de,{children:e.jsx(ce,{redirectUrl:N,callbackUrl:w})}):e.jsx("div",{children:"No login options available"})}export{pe as default};
@@ -1,3 +1,3 @@
1
- import{W as zt,r as ce,q as fe,G as $e,b as $t,H as Dt,a as pe,t as ue,o as G,K as ie,j as s,B as Pe,e as Y,s as kt,n as Nt,c as ze,l as Ze,E as Ft}from"./index-rZ1TPVyD.js";import{C as Ot}from"./collection-display-button-VpCmWGot.js";import{S as Lt}from"./search-input-DbmU5zU8.js";import{P as Ee}from"./index-DO3UwA_I.js";import{C as qt}from"./collection-table-wrapper-CuUrD2rg.js";import{E as Je}from"./empty-state-BhV-zl-f.js";import{D as Bt,i as Kt,a as Vt,b as Qt,c as Ut,d as Gt}from"./dialog-CxpeEAA2.js";import{a as Ht,F as ot,b as rt,c as Jt,d as ct,f as mt}from"./form-Ci8PGt-R.js";import{d as Xe,S as et,a as tt,b as st,c as nt}from"./select-DRqZIuLQ.js";import{T as Wt}from"./textarea-Bymi75yx.js";import{u as at}from"./use-org-auth-client-CLnnUl3h.js";import{u as Tt}from"./use-organization-roles-UOgWPl1e.js";import{u as Yt}from"./use-members-BaX0tyb1.js";import{u as De}from"./studio-tools-jbRVdtpc.js";import{T as Zt,a as Xt,c as es,b as ts}from"./tooltip-ua4lJTzI.js";import{a as dt,e as ut,g as ft,b as ht,c as gt,d as pt,f as xt,A as bt}from"./alert-dialog-Dsb6KPFM.js";import{A as Ke}from"./avatar-nCSKoB6F.js";import{B as Qe}from"./badge-CY1rqnYU.js";import{C as jt}from"./card-CYGsSb57.js";import{D as It,a as At,b as Mt,d as ss,e as ns,f as is,c as it,g as as}from"./dropdown-menu-Xj0lVIXK.js";import{i as Et}from"./DotsVertical-CvhOKI-w.js";import{i as ls}from"./Key01-D6jyUgYu.js";import{i as os}from"./Shield01-CFDfVqiL.js";import{a as rs}from"./SwitchHorizontal01-CkwE98n9.js";import{s as cs}from"./Trash01-Bifm5Wb3.js";import{s as Pt}from"./XClose-D0wmxYTF.js";import{C as vt}from"./checkbox-vKl7eadT.js";import{a as We,e as Ye,f as Ct,C as ms,d as ds,b as us,c as fs}from"./command-KCI9wvsu.js";import{b as hs,P as gs,a as ps}from"./popover-Bk3EwUPD.js";import{t as xs}from"./ChevronDown-CaCYdoie.js";import{s as bs}from"./Plus-Do6ZWheh.js";import{R as js}from"./require-capability-6kSOKhdT.js";import"./Check-6LmIKXJj.js";import"./view-mode-toggle-3i0Tx7_t.js";import"./SearchMd-B4Lavo8e.js";import"./sidebar-B3SsvTHC.js";import"./LayoutLeft-C7Cmt2J8.js";import"./sheet-Dsfk9URc.js";import"./X-BWR0-4rz.js";import"./table-cHRXPecF.js";import"./label-CzVCjiiL.js";import"./ChevronUp-DkGtzqyl.js";import"./User01-BZL6tFVt.js";import"./ChevronRight-kLRVkGUs.js";import"./index-BEe1oLVg.js";import"./use-capability-B2IrzHkM.js";import"./access-gate-BELP4oqa.js";import"./capability-load-error-DYWpzVHl.js";const vs=zt().email("Invalid email address");function Cs(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function ys({trigger:t}){const[e,n]=ce.useState(!1),{locator:l}=fe(),a=at(),i=$e(),{data:o}=$t.useSession(),c=o?.user?.email,{roles:p,isLoading:x}=Tt(),j=p.filter(m=>m.role!=="owner"),g=Dt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=g.watch("emailsText"),M=g.watch("role"),v=Cs(b).filter(m=>{const r=vs.safeParse(m).success,f=!c||m!==c.toLowerCase();return r&&f}),N=pe({mutationFn:async({emails:m,role:r})=>{if(!r)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await a.organization.inviteMember({email:w,role:r});if(A.error)throw new Error(A.error.message);return A.data})),I=f.filter(w=>w.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return f},onSuccess:(m,{emails:r,role:f})=>{ue("member_invited",{count:r.length,role:f}),i.invalidateQueries({queryKey:ie.members(l)}),i.invalidateQueries({queryKey:ie.invitations(l)}),G.success(r.length===1?"Member invited successfully!":`${r.length} members invited successfully!`),g.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:r,role:f})=>{ue("member_invite_failed",{count:r.length,role:f,error:m instanceof Error?m.message:String(m)}),G.error(m instanceof Error?m.message:"Failed to invite members")}}),y=m=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!m.role){G.error("Please select a role");return}N.mutate({emails:v,role:m.role})},$=v.length>0&&!!M;return s.jsxs(Bt,{open:e,onOpenChange:n,children:[s.jsx(Kt,{asChild:!0,children:t}),s.jsxs(Vt,{className:"sm:max-w-lg",children:[s.jsx(Qt,{children:s.jsx(Ut,{children:"Invite members"})}),s.jsx(Ht,{...g,children:s.jsxs("form",{onSubmit:g.handleSubmit(y),className:"space-y-4",children:[s.jsx(ot,{control:g.control,name:"emailsText",render:({field:m})=>s.jsxs(rt,{children:[s.jsx(Jt,{children:"Email addresses"}),s.jsx(ct,{children:s.jsx(Wt,{...m,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
1
+ import{W as zt,r as ce,q as fe,G as $e,b as $t,H as Dt,a as pe,t as ue,o as G,K as ie,j as s,B as Pe,e as Y,s as kt,n as Nt,c as ze,l as Ze,E as Ft}from"./index-DxLTuX83.js";import{C as Ot}from"./collection-display-button-C331HXzj.js";import{S as Lt}from"./search-input-B5QgW7DO.js";import{P as Ee}from"./index-DM719JZt.js";import{C as qt}from"./collection-table-wrapper-D_JocMSh.js";import{E as Je}from"./empty-state-cuRG9xrS.js";import{D as Bt,i as Kt,a as Vt,b as Qt,c as Ut,d as Gt}from"./dialog-DilC5A4p.js";import{a as Ht,F as ot,b as rt,c as Jt,d as ct,f as mt}from"./form-DcfAV72q.js";import{d as Xe,S as et,a as tt,b as st,c as nt}from"./select-C0Tyz9qJ.js";import{T as Wt}from"./textarea-CZOXZ6_T.js";import{u as at}from"./use-org-auth-client-B3bhhuY4.js";import{u as Tt}from"./use-organization-roles-DV7FcWv5.js";import{u as Yt}from"./use-members-D33brPm2.js";import{u as De}from"./studio-tools-qhNYzbg-.js";import{T as Zt,a as Xt,c as es,b as ts}from"./tooltip-D1D9JHhD.js";import{a as dt,e as ut,g as ft,b as ht,c as gt,d as pt,f as xt,A as bt}from"./alert-dialog-nDI1xJhR.js";import{A as Ke}from"./avatar-BZq-o3M_.js";import{B as Qe}from"./badge-DBQKr8ze.js";import{C as jt}from"./card-_9LUJQRQ.js";import{D as It,a as At,b as Mt,d as ss,e as ns,f as is,c as it,g as as}from"./dropdown-menu-CCeLALQe.js";import{i as Et}from"./DotsVertical-CuchmOf0.js";import{i as ls}from"./Key01-CStdo5WX.js";import{i as os}from"./Shield01-CjOnx-7R.js";import{a as rs}from"./SwitchHorizontal01-CkdIfbJ1.js";import{s as cs}from"./Trash01-YuwiLEVo.js";import{s as Pt}from"./XClose-CwNjmDWz.js";import{C as vt}from"./checkbox-BoVEsaTu.js";import{a as We,e as Ye,f as Ct,C as ms,d as ds,b as us,c as fs}from"./command-DjRT1inC.js";import{b as hs,P as gs,a as ps}from"./popover-DpnBmU5u.js";import{t as xs}from"./ChevronDown-XKMoQgX6.js";import{s as bs}from"./Plus-wat9tYeJ.js";import{R as js}from"./require-capability-BolUdzxs.js";import"./Check-CV74Rqqs.js";import"./view-mode-toggle-C4AuqTiF.js";import"./SearchMd-BoptgjAM.js";import"./sidebar-DILd2AwV.js";import"./LayoutLeft-BdQI12mG.js";import"./sheet-BZaR5cN8.js";import"./X-D1kqmcok.js";import"./table-BHblf7Co.js";import"./label-Cv-qQXYd.js";import"./ChevronUp-CGfhqWp1.js";import"./User01-CUMpCZVS.js";import"./ChevronRight-Betyx6_9.js";import"./index-B6U1MHPz.js";import"./use-capability-DDDjfOOE.js";import"./access-gate-DfmEpXgP.js";import"./capability-load-error-BqquNR5_.js";const vs=zt().email("Invalid email address");function Cs(t){if(!t.trim())return[];const e=t.split(/[,;\n]/).map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return Array.from(new Set(e))}function ys({trigger:t}){const[e,n]=ce.useState(!1),{locator:l}=fe(),a=at(),i=$e(),{data:o}=$t.useSession(),c=o?.user?.email,{roles:p,isLoading:x}=Tt(),j=p.filter(m=>m.role!=="owner"),g=Dt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=g.watch("emailsText"),M=g.watch("role"),v=Cs(b).filter(m=>{const r=vs.safeParse(m).success,f=!c||m!==c.toLowerCase();return r&&f}),N=pe({mutationFn:async({emails:m,role:r})=>{if(!r)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await a.organization.inviteMember({email:w,role:r});if(A.error)throw new Error(A.error.message);return A.data})),I=f.filter(w=>w.status==="rejected");if(I.length>0)throw new Error(`Failed to invite ${I.length} member${I.length>1?"s":""}`);return f},onSuccess:(m,{emails:r,role:f})=>{ue("member_invited",{count:r.length,role:f}),i.invalidateQueries({queryKey:ie.members(l)}),i.invalidateQueries({queryKey:ie.invitations(l)}),G.success(r.length===1?"Member invited successfully!":`${r.length} members invited successfully!`),g.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:r,role:f})=>{ue("member_invite_failed",{count:r.length,role:f,error:m instanceof Error?m.message:String(m)}),G.error(m instanceof Error?m.message:"Failed to invite members")}}),y=m=>{if(v.length===0){G.error("Please enter at least one valid email address");return}if(!m.role){G.error("Please select a role");return}N.mutate({emails:v,role:m.role})},$=v.length>0&&!!M;return s.jsxs(Bt,{open:e,onOpenChange:n,children:[s.jsx(Kt,{asChild:!0,children:t}),s.jsxs(Vt,{className:"sm:max-w-lg",children:[s.jsx(Qt,{children:s.jsx(Ut,{children:"Invite members"})}),s.jsx(Ht,{...g,children:s.jsxs("form",{onSubmit:g.handleSubmit(y),className:"space-y-4",children:[s.jsx(ot,{control:g.control,name:"emailsText",render:({field:m})=>s.jsxs(rt,{children:[s.jsx(Jt,{children:"Email addresses"}),s.jsx(ct,{children:s.jsx(Wt,{...m,disabled:N.isPending,placeholder:`Enter email addresses separated by commas or new lines
2
2
  e.g. user1@example.com, user2@example.com
3
3
  or one per line`,className:"min-h-[120px] resize-none"})}),s.jsx(mt,{})]})}),s.jsx(ot,{control:g.control,name:"role",render:({field:m})=>s.jsxs(rt,{children:[s.jsx(ct,{children:s.jsxs(Xe,{value:m.value,onValueChange:m.onChange,disabled:N.isPending||x,children:[s.jsx(et,{className:"w-full",children:s.jsx(tt,{placeholder:"Select a role"})}),s.jsx(st,{children:j.map(r=>{const f=[];return r.isBuiltin||(r.allowsAllStaticPermissions?f.push("Full org access"):r.staticPermissionCount&&r.staticPermissionCount>0&&f.push(`${r.staticPermissionCount} org perm${r.staticPermissionCount!==1?"s":""}`),r.allowsAllConnections?f.push("All connections"):r.connectionCount&&r.connectionCount>0&&f.push(`${r.connectionCount} connection${r.connectionCount!==1?"s":""}`),(r.connectionCount!==0||r.allowsAllConnections)&&(r.allowsAllTools?f.push("all tools"):r.toolCount&&r.toolCount>0&&f.push(`${r.toolCount} tool${r.toolCount!==1?"s":""}`))),s.jsx(nt,{value:r.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:r.label}),!r.isBuiltin&&f.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:f.join(", ")})]})},r.role)})})]})}),s.jsx(mt,{})]})}),s.jsxs(Gt,{children:[s.jsx(Pe,{variant:"outline",onClick:()=>{g.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:N.isPending,children:"Cancel"}),s.jsx(Pe,{type:"submit",disabled:N.isPending||!$,children:N.isPending?"Inviting...":`Invite ${v.length||0} Member${v.length!==1?"s":""}`})]})]})})]})]})}function Ss(){const t=Y.c(7),{locator:e}=fe(),n=De();let l;t[0]!==e?(l=ie.invitations(e),t[0]=e,t[1]=l):l=t[1];let a;t[2]!==n?(a=async()=>(await n.call("ORGANIZATION_GET",{}))?.invitations??[],t[2]=n,t[3]=a):a=t[3];let i;return t[4]!==l||t[5]!==a?(i={queryKey:l,queryFn:a},t[4]=l,t[5]=a,t[6]=i):i=t[6],kt(i)}function ws(){const t=Y.c(10),{locator:e}=fe(),n=at(),l=$e();let a;t[0]!==n?(a=async x=>{const j=await n.organization.cancelInvitation({invitationId:x});if(j?.error)throw new Error(j.error.message);return j.data},t[0]=n,t[1]=a):a=t[1];let i;t[2]!==e||t[3]!==l?(i=()=>{l.invalidateQueries({queryKey:ie.invitations(e)}),G.success("Invitation cancelled")},t[2]=e,t[3]=l,t[4]=i):i=t[4];let o;t[5]!==a||t[6]!==i?(o={mutationFn:a,onSuccess:i,onError:Ns},t[5]=a,t[6]=i,t[7]=o):o=t[7];const c=pe(o);let p;return t[8]!==c?(p={cancel:c},t[8]=c,t[9]=p):p=t[9],p}function Ns(t){G.error(t instanceof Error?t.message:"Failed to cancel invitation")}function Ts(){const t=Y.c(7),{locator:e}=fe(),n=De();let l;t[0]!==e?(l=ie.tags(e),t[0]=e,t[1]=l):l=t[1];let a;t[2]!==n?(a=async()=>{const{tags:o}=await n.call("TAGS_LIST",{});return o},t[2]=n,t[3]=a):a=t[3];let i;return t[4]!==l||t[5]!==a?(i={queryKey:l,queryFn:a,staleTime:3e4},t[4]=l,t[5]=a,t[6]=i):i=t[6],Nt(i)}function Is(){const t=Y.c(8),e=$e(),{locator:n}=fe(),l=De();let a;t[0]!==l?(a=async c=>{const{tag:p}=await l.call("TAGS_CREATE",{name:c});return p},t[0]=l,t[1]=a):a=t[1];let i;t[2]!==n||t[3]!==e?(i=()=>{e.invalidateQueries({queryKey:ie.tags(n)})},t[2]=n,t[3]=e,t[4]=i):i=t[4];let o;return t[5]!==a||t[6]!==i?(o={mutationFn:a,onSuccess:i,onError:As},t[5]=a,t[6]=i,t[7]=o):o=t[7],pe(o)}function As(t){G.error(t instanceof Error?t.message:"Failed to create tag")}function Ms(t){const e=Y.c(10),{locator:n}=fe(),l=De();let a;e[0]!==n||e[1]!==t?(a=ie.memberTags(n,t),e[0]=n,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>{const{tags:p}=await l.call("MEMBER_TAGS_GET",{memberId:t});return p},e[3]=t,e[4]=l,e[5]=i):i=e[5];const o=!!t;let c;return e[6]!==a||e[7]!==i||e[8]!==o?(c={queryKey:a,queryFn:i,staleTime:3e4,enabled:o},e[6]=a,e[7]=i,e[8]=o,e[9]=c):c=e[9],Nt(c)}function Es(){const t=Y.c(8),e=$e(),{locator:n}=fe(),l=De();let a;t[0]!==l?(a=async c=>{const{memberId:p,tagIds:x}=c;return await l.call("MEMBER_TAGS_SET",{memberId:p,tagIds:x})},t[0]=l,t[1]=a):a=t[1];let i;t[2]!==n||t[3]!==e?(i=(c,p)=>{e.invalidateQueries({queryKey:ie.memberTags(n,p.memberId)})},t[2]=n,t[3]=e,t[4]=i):i=t[4];let o;return t[5]!==a||t[6]!==i?(o={mutationFn:a,onSuccess:i,onError:Ps},t[5]=a,t[6]=i,t[7]=o):o=t[7],pe(o)}function Ps(t){G.error(t instanceof Error?t.message:"Failed to update member tags")}function _t(t){const e=Y.c(44),{memberId:n,className:l,disabled:a,placeholder:i,maxDisplay:o}=t,c=a===void 0?!1:a,p=i===void 0?"Add tags...":i,x=o===void 0?2:o,[j,g]=ce.useState(!1),[b,M]=ce.useState(""),{data:R,isLoading:v}=Ts(),N=R===void 0?[]:R,{data:y,isLoading:$}=Ms(n),m=y===void 0?[]:y,r=Is(),f=Es(),I=v||$,w=m.map(Rs);let A;e[0]!==b?(A=S=>S.name.toLowerCase().includes(b.toLowerCase()),e[0]=b,e[1]=A):A=e[1];const z=N.filter(A);let T;e[2]!==b?(T=S=>S.name.toLowerCase()===b.toLowerCase(),e[2]=b,e[3]=T):T=e[3];const K=N.find(T),E=b.trim()&&!K,k=async S=>{const ge=w.includes(S.id)?w.filter(je=>je!==S.id):[...w,S.id];await f.mutateAsync({memberId:n,tagIds:ge})},P=async()=>{if(!b.trim())return;const S=await r.mutateAsync(b.trim());await f.mutateAsync({memberId:n,tagIds:[...w,S.id]}),M("")},d=async S=>{const ne=w.filter(ge=>ge!==S);await f.mutateAsync({memberId:n,tagIds:ne})},C=r.isPending||f.isPending,L=gs;let D;e[4]!==j?(D=()=>g(!j),e[4]=j,e[5]=D):D=e[5];let F;e[6]!==l?(F=ze("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",l),e[6]=l,e[7]=F):F=e[7];const V=c||I,O=I?s.jsx(Ze,{size:14,className:"animate-spin text-muted-foreground"}):m.length>0?s.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[m.slice(0,x).map(_s),m.length>x&&s.jsxs(Qe,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:["+",m.length-x]})]}):s.jsx("span",{className:"text-muted-foreground text-xs",children:p});let Q;e[8]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(xs,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=Q):Q=e[8];let q;e[9]!==V||e[10]!==O||e[11]!==D||e[12]!==F?(q=s.jsx(ps,{asChild:!0,children:s.jsxs(Pe,{variant:"ghost",size:"sm",onClick:D,className:F,disabled:V,children:[O,Q]})}),e[9]=V,e[10]=O,e[11]=D,e[12]=F,e[13]=q):q=e[13];const U=hs,H="w-56 p-0",J="start";let W;e[14]===Symbol.for("react.memo_cache_sentinel")?(W=()=>g(!1),e[14]=W):W=e[14];const ae=us,xe=!1;let Z;e[15]!==b?(Z=s.jsx(fs,{placeholder:"Search or create...",value:b,onValueChange:M,className:"h-9"}),e[15]=b,e[16]=Z):Z=e[16];const le=ds,me=m.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(We,{heading:"Selected",children:m.map(S=>s.jsx(Ye,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(vt,{checked:!0,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]}),s.jsx("button",{onClick:ne=>{ne.stopPropagation(),d(S.id)},className:"opacity-50 hover:opacity-100",disabled:C,children:s.jsx(Pt,{size:14})})]})},S.id))}),s.jsx(Ct,{})]}),_e=We,be="Available",Re=z.length===0&&!E&&s.jsx(ms,{children:"No tags found."}),he=z.filter(S=>!w.includes(S.id)).map(S=>s.jsx(Ye,{onSelect:()=>k(S),className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(vt,{checked:!1,className:"[&_svg]:!text-primary-foreground"}),s.jsx("span",{children:S.name})]})},S.id));let oe;e[17]!==_e||e[18]!==Re||e[19]!==he?(oe=s.jsxs(_e,{heading:be,children:[Re,he]}),e[17]=_e,e[18]=Re,e[19]=he,e[20]=oe):oe=e[20];let re;e[21]!==P||e[22]!==C||e[23]!==b||e[24]!==E?(re=E&&s.jsxs(s.Fragment,{children:[s.jsx(Ct,{}),s.jsx(We,{children:s.jsx(Ye,{onSelect:P,className:"cursor-pointer",disabled:C,children:s.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[C?s.jsx(Ze,{size:14,className:"animate-spin"}):s.jsx(bs,{size:14}),s.jsxs("span",{children:['Create "',b.trim(),'"']})]})})})]}),e[21]=P,e[22]=C,e[23]=b,e[24]=E,e[25]=re):re=e[25];let X;e[26]!==le||e[27]!==me||e[28]!==oe||e[29]!==re?(X=s.jsxs(le,{children:[me,oe,re]}),e[26]=le,e[27]=me,e[28]=oe,e[29]=re,e[30]=X):X=e[30];let ee;e[31]!==ae||e[32]!==Z||e[33]!==X?(ee=s.jsxs(ae,{shouldFilter:xe,children:[Z,X]}),e[31]=ae,e[32]=Z,e[33]=X,e[34]=ee):ee=e[34];let te;e[35]!==U||e[36]!==W||e[37]!==ee?(te=s.jsx(U,{className:H,align:J,onEscapeKeyDown:W,children:ee}),e[35]=U,e[36]=W,e[37]=ee,e[38]=te):te=e[38];let se;return e[39]!==L||e[40]!==j||e[41]!==q||e[42]!==te?(se=s.jsxs(L,{open:j,onOpenChange:g,children:[q,te]}),e[39]=L,e[40]=j,e[41]=q,e[42]=te,e[43]=se):se=e[43],se}function _s(t){return s.jsx(Qe,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function Rs(t){return t.id}const yt=["bg-neutral-400","bg-red-500","bg-orange-500","bg-amber-500","bg-yellow-500","bg-lime-500","bg-green-500","bg-emerald-500","bg-teal-500","bg-cyan-500","bg-sky-500","bg-blue-500","bg-indigo-500","bg-violet-500","bg-purple-500","bg-fuchsia-500","bg-pink-500","bg-rose-500","bg-slate-500"],zs={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ve(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function $s(t){const e=new Map;for(const[n,l]of Object.entries(zs))e.set(n,l);for(let n=0;n<t.length;n++){const l=t[n];l&&!e.has(l.role)&&e.set(l.role,yt[n%yt.length]??"bg-neutral-400")}return e}function Ds(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function Be(t){const e=Y.c(79),{role:n,memberId:l,isOwner:a,roleColorMap:i,selectableRoles:o,onRoleChange:c,size:p,className:x}=t,j=p===void 0?"xs":p;let g,b,M,R,v,N,y,$,m,r,f;if(e[0]!==x||e[1]!==a||e[2]!==l||e[3]!==c||e[4]!==n||e[5]!==i||e[6]!==o||e[7]!==j){f=Symbol.for("react.early_return_sentinel");e:{const P=i.get(n)??"bg-neutral-400";if(a){let d;e[19]!==l||e[20]!==c?(d=H=>c(l,H),e[19]=l,e[20]=c,e[21]=d):d=e[21];let C;e[22]!==n?(C=s.jsx("span",{className:"capitalize truncate",children:n}),e[22]=n,e[23]=C):C=e[23];const L=s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx("div",{className:ze("size-2 rounded-full shrink-0",P)}),C]});let D;e[24]!==L?(D=s.jsx(tt,{children:L}),e[24]=L,e[25]=D):D=e[25];let F;e[26]!==x||e[27]!==j||e[28]!==D?(F=s.jsx(et,{size:j,className:x,children:D}),e[26]=x,e[27]=j,e[28]=D,e[29]=F):F=e[29];let V;if(e[30]!==i||e[31]!==o){let H;e[33]!==i?(H=J=>{const W=i.get(J.role)??"bg-neutral-400";return s.jsx(nt,{value:J.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ze("size-3 rounded-full",W)}),s.jsx("span",{className:"capitalize",children:J.label})]})},J.role)},e[33]=i,e[34]=H):H=e[34],V=o.map(H),e[30]=i,e[31]=o,e[32]=V}else V=e[32];let O;e[35]!==V?(O=s.jsx(st,{children:V}),e[35]=V,e[36]=O):O=e[36];let Q;e[37]!==a||e[38]!==n||e[39]!==d||e[40]!==F||e[41]!==O?(Q=s.jsx(Zt,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(Xe,{value:n,onValueChange:d,disabled:a,children:[F,O]})})}),e[37]=a,e[38]=n,e[39]=d,e[40]=F,e[41]=O,e[42]=Q):Q=e[42];let q;e[43]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(Xt,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=q):q=e[43];let U;e[44]!==Q?(U=s.jsx(es,{children:s.jsxs(ts,{children:[Q,q]})}),e[44]=Q,e[45]=U):U=e[45],f=U;break e}M=Xe,$=n,e[46]!==l||e[47]!==c?(m=d=>c(l,d),e[46]=l,e[47]=c,e[48]=m):m=e[48],r=a,b=et,N=j,y=x,g=tt,v="flex items-center gap-2 min-w-0",R=ze("size-2 rounded-full shrink-0",P)}e[0]=x,e[1]=a,e[2]=l,e[3]=c,e[4]=n,e[5]=i,e[6]=o,e[7]=j,e[8]=g,e[9]=b,e[10]=M,e[11]=R,e[12]=v,e[13]=N,e[14]=y,e[15]=$,e[16]=m,e[17]=r,e[18]=f}else g=e[8],b=e[9],M=e[10],R=e[11],v=e[12],N=e[13],y=e[14],$=e[15],m=e[16],r=e[17],f=e[18];if(f!==Symbol.for("react.early_return_sentinel"))return f;let I;e[49]!==R?(I=s.jsx("div",{className:R}),e[49]=R,e[50]=I):I=e[50];let w;e[51]!==n?(w=s.jsx("span",{className:"capitalize truncate",children:n}),e[51]=n,e[52]=w):w=e[52];let A;e[53]!==I||e[54]!==w||e[55]!==v?(A=s.jsxs("div",{className:v,children:[I,w]}),e[53]=I,e[54]=w,e[55]=v,e[56]=A):A=e[56];let z;e[57]!==g||e[58]!==A?(z=s.jsx(g,{children:A}),e[57]=g,e[58]=A,e[59]=z):z=e[59];let T;e[60]!==b||e[61]!==z||e[62]!==N||e[63]!==y?(T=s.jsx(b,{size:N,className:y,children:z}),e[60]=b,e[61]=z,e[62]=N,e[63]=y,e[64]=T):T=e[64];let K;if(e[65]!==i||e[66]!==o){let P;e[68]!==i?(P=d=>{const C=i.get(d.role)??"bg-neutral-400";return s.jsx(nt,{value:d.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:ze("size-3 rounded-full",C)}),s.jsx("span",{className:"capitalize",children:d.label})]})},d.role)},e[68]=i,e[69]=P):P=e[69],K=o.map(P),e[65]=i,e[66]=o,e[67]=K}else K=e[67];let E;e[70]!==K?(E=s.jsx(st,{children:K}),e[70]=K,e[71]=E):E=e[71];let k;return e[72]!==M||e[73]!==T||e[74]!==E||e[75]!==$||e[76]!==m||e[77]!==r?(k=s.jsxs(M,{value:$,onValueChange:m,disabled:r,children:[T,E]}),e[72]=M,e[73]=T,e[74]=E,e[75]=$,e[76]=m,e[77]=r,e[78]=k):k=e[78],k}function St(t){const e=Y.c(51),{member:n,roles:l,onChangeRole:a,onRemove:i,isUpdating:o}=t,c=o===void 0?!1:o,p=n.role==="owner";let x,j,g,b,M,R,v,N,y;if(e[0]!==p||e[1]!==c||e[2]!==n.id||e[3]!==n.role||e[4]!==a||e[5]!==l){let T;e[15]!==n.role?(T=d=>d.role!==n.role&&d.role!=="owner",e[15]=n.role,e[16]=T):T=e[16];const K=l.filter(T);b=It;let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Et,{size:20}),e[17]=E):E=e[17],e[18]!==p?(y=s.jsx(At,{asChild:!0,children:s.jsx(Pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:p,onClick:Fs,children:E})}),e[18]=p,e[19]=y):y=e[19],g=Mt,v="end",N=ks,j=ss;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(rs,{size:16}),e[20]=k):k=e[20],e[21]!==c?(R=s.jsxs(ns,{disabled:c,children:[k,"Change Role"]}),e[21]=c,e[22]=R):R=e[22],x=is;let P;e[23]!==c||e[24]!==n.id||e[25]!==a?(P=d=>{const C=[];return d.isBuiltin||(d.allowsAllStaticPermissions?C.push("Full org access"):d.staticPermissionCount&&d.staticPermissionCount>0&&C.push(`${d.staticPermissionCount} org perm${d.staticPermissionCount!==1?"s":""}`),d.allowsAllConnections?C.push("All connections"):d.connectionCount&&d.connectionCount>0&&C.push(`${d.connectionCount} connection${d.connectionCount!==1?"s":""}`),(d.connectionCount!==0||d.allowsAllConnections)&&(d.allowsAllTools?C.push("all tools"):d.toolCount&&d.toolCount>0&&C.push(`${d.toolCount} tool${d.toolCount!==1?"s":""}`))),s.jsxs(it,{onClick:L=>{L.stopPropagation(),a(n.id,d.role)},disabled:c,children:[d.isBuiltin?s.jsx(os,{size:16}):s.jsx(ls,{size:16}),s.jsxs("span",{className:"flex flex-col",children:[s.jsx("span",{children:d.label}),!d.isBuiltin&&C.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:C.join(", ")})]})]},d.role)},e[23]=c,e[24]=n.id,e[25]=a,e[26]=P):P=e[26],M=K.map(P),e[0]=p,e[1]=c,e[2]=n.id,e[3]=n.role,e[4]=a,e[5]=l,e[6]=x,e[7]=j,e[8]=g,e[9]=b,e[10]=M,e[11]=R,e[12]=v,e[13]=N,e[14]=y}else x=e[6],j=e[7],g=e[8],b=e[9],M=e[10],R=e[11],v=e[12],N=e[13],y=e[14];let $;e[27]!==x||e[28]!==M?($=s.jsx(x,{children:M}),e[27]=x,e[28]=M,e[29]=$):$=e[29];let m;e[30]!==j||e[31]!==R||e[32]!==$?(m=s.jsxs(j,{children:[R,$]}),e[30]=j,e[31]=R,e[32]=$,e[33]=m):m=e[33];let r;e[34]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(as,{}),e[34]=r):r=e[34];let f;e[35]!==n.id||e[36]!==i?(f=T=>{T.stopPropagation(),i(n.id)},e[35]=n.id,e[36]=i,e[37]=f):f=e[37];let I;e[38]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(cs,{size:16}),e[38]=I):I=e[38];let w;e[39]!==f?(w=s.jsxs(it,{variant:"destructive",onClick:f,children:[I,"Remove Member"]}),e[39]=f,e[40]=w):w=e[40];let A;e[41]!==g||e[42]!==w||e[43]!==v||e[44]!==N||e[45]!==m?(A=s.jsxs(g,{align:v,onClick:N,children:[m,r,w]}),e[41]=g,e[42]=w,e[43]=v,e[44]=N,e[45]=m,e[46]=A):A=e[46];let z;return e[47]!==b||e[48]!==A||e[49]!==y?(z=s.jsxs(b,{children:[y,A]}),e[47]=b,e[48]=A,e[49]=y,e[50]=z):z=e[50],z}function ks(t){return t.stopPropagation()}function Fs(t){return t.stopPropagation()}function wt(t){const e=Y.c(8),{invitationId:n,onCancel:l,isCancelling:a}=t,i=a===void 0?!1:a;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(At,{asChild:!0,children:s.jsx(Pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ls,children:s.jsx(Et,{size:20})})}),e[0]=o):o=e[0];let c;e[1]!==n||e[2]!==l?(c=j=>{j.stopPropagation(),l(n)},e[1]=n,e[2]=l,e[3]=c):c=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(Pt,{size:16}),e[4]=p):p=e[4];let x;return e[5]!==i||e[6]!==c?(x=s.jsxs(It,{children:[o,s.jsx(Mt,{align:"end",onClick:Os,children:s.jsxs(it,{variant:"destructive",onClick:c,disabled:i,children:[p,"Cancel Invitation"]})})]}),e[5]=i,e[6]=c,e[7]=x):x=e[7],x}function Os(t){return t.stopPropagation()}function Ls(t){return t.stopPropagation()}function qs(){const t=Y.c(101),{data:e}=Yt(),{data:n}=Ss(),l=ws(),a=$e(),{locator:i}=fe(),o=at(),[c,p]=ce.useState(null),[x,j]=ce.useState(null),[g,b]=ce.useState(""),[M,R]=ce.useState("table"),[v,N]=ce.useState("member"),[y,$]=ce.useState("asc"),m=e?.data?.members;let r;t[0]!==v?(r=u=>{v===u?$(Zs):(N(u),$("asc"))},t[0]=v,t[1]=r):r=t[1];const f=r;let I=m??[],w=n??[];if(g){const u=g.toLowerCase();I=I.filter(h=>h.user?.name?.toLowerCase().includes(u)||h.user?.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u)),w=w.filter(h=>h.email?.toLowerCase().includes(u)||h.role?.toLowerCase().includes(u))}if(v&&y){let u;t[2]!==y||t[3]!==v?(u=(h,_)=>{let B,de;e:switch(v){case"member":{B=h.user?.name||"",de=_.user?.name||"";break e}case"role":{B=h.role||"",de=_.role||"";break e}case"joined":{B=h.createdAt?typeof h.createdAt=="string"?h.createdAt:h.createdAt.toISOString():"",de=_.createdAt?typeof _.createdAt=="string"?_.createdAt:_.createdAt.toISOString():"";break e}default:return 0}return y==="asc"?B.localeCompare(de):de.localeCompare(B)},t[2]=y,t[3]=v,t[4]=u):u=t[4],I=[...I].sort(u)}const A=I;let z;t[5]!==o?(z=async u=>{const h=await o.organization.removeMember({memberIdOrEmail:u});if(h?.error)throw new Error(h.error.message)},t[5]=o,t[6]=z):z=t[6];let T;t[7]!==i||t[8]!==a?(T=()=>{ue("member_removed"),a.invalidateQueries({queryKey:ie.members(i)}),G.success("Member has been removed from the organization"),p(null)},t[7]=i,t[8]=a,t[9]=T):T=t[9];let K;t[10]!==z||t[11]!==T?(K={mutationFn:z,onSuccess:T,onError:Ys},t[10]=z,t[11]=T,t[12]=K):K=t[12];const E=pe(K);let k;t[13]!==o?(k=async u=>{const{memberId:h,role:_}=u,B=await o.organization.updateMemberRole({memberId:h,role:[_]});if(B?.error)throw new Error(B.error.message)},t[13]=o,t[14]=k):k=t[14];let P;t[15]!==i||t[16]!==a?(P=(u,h)=>{ue("member_role_updated",{new_role:h.role}),a.invalidateQueries({queryKey:ie.members(i)}),G.success("Member's role has been updated")},t[15]=i,t[16]=a,t[17]=P):P=t[17];let d;t[18]!==k||t[19]!==P?(d={mutationFn:k,onSuccess:P,onError:Ws},t[18]=k,t[19]=P,t[20]=d):d=t[20];const C=pe(d);let L;t[21]!==o?(L=async u=>{const{invitationId:h,role:_,email:B}=u,de=await o.organization.cancelInvitation({invitationId:h});if(de?.error)throw new Error(de.error.message);const lt=await o.organization.inviteMember({email:B,role:_});if(lt?.error)throw new Error(lt.error.message)},t[21]=o,t[22]=L):L=t[22];let D;t[23]!==i||t[24]!==a?(D=(u,h)=>{ue("invitation_role_updated",{new_role:h.role}),a.invalidateQueries({queryKey:ie.invitations(i)}),G.success("Invitation role has been updated")},t[23]=i,t[24]=a,t[25]=D):D=t[25];let F;t[26]!==L||t[27]!==D?(F={mutationFn:L,onSuccess:D,onError:Js},t[26]=L,t[27]=D,t[28]=F):F=t[28];const V=pe(F),{roles:O,customRoles:Q}=Tt();let q;t[29]!==Q?(q=$s(Q),t[29]=Q,t[30]=q):q=t[30];const U=q;let H;t[31]!==O?(H=O.filter(Hs),t[31]=O,t[32]=H):H=t[32];const J=H;let W;t[33]===Symbol.for("react.memo_cache_sentinel")?(W={id:"member",header:"Member",render:Gs,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=W):W=t[33];let ae;t[34]!==U||t[35]!==J||t[36]!==V||t[37]!==C?(ae={id:"role",header:"Role",render:u=>u.type==="member"?s.jsx(Be,{role:u.data.role,memberId:u.data.id,isOwner:u.data.role==="owner",roleColorMap:U,selectableRoles:J,onRoleChange:(h,_)=>C.mutate({memberId:h,role:_}),className:"w-36"}):s.jsx(Be,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:U,selectableRoles:J,onRoleChange:(h,_)=>V.mutate({invitationId:h,role:_,email:u.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=U,t[35]=J,t[36]=V,t[37]=C,t[38]=ae):ae=t[38];let xe,Z;t[39]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"tags",header:"Tags",render:Us,cellClassName:"w-40 shrink-0"},Z={id:"joined",header:"Joined",render:Qs,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=xe,t[40]=Z):(xe=t[39],Z=t[40]);let le;t[41]!==l.cancel.isPending||t[42]!==O||t[43]!==C?(le={id:"actions",header:"",render:u=>u.type==="member"?s.jsx(St,{member:u.data,roles:O,onChangeRole:(h,_)=>C.mutate({memberId:h,role:_}),onRemove:p,isUpdating:C.isPending}):s.jsx(wt,{invitationId:u.data.id,onCancel:j,isCancelling:l.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=l.cancel.isPending,t[42]=O,t[43]=C,t[44]=le):le=t[44];let me;t[45]!==ae||t[46]!==le?(me=[W,ae,xe,Z,le],t[45]=ae,t[46]=le,t[47]=me):me=t[47];const _e=me;let be;t[48]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(ys,{trigger:s.jsx(Pe,{children:"Invite Member"})})}),t[48]=be):be=t[48];const Re=be,he=[...A.map(Vs),...w.filter(Ks).map(Bs)],oe=Ee,re=!!x;let X;t[49]===Symbol.for("react.memo_cache_sentinel")?(X=()=>j(null),t[49]=X):X=t[49];let ee;t[50]===Symbol.for("react.memo_cache_sentinel")?(ee=s.jsxs(ht,{children:[s.jsx(gt,{children:"Cancel Invitation"}),s.jsx(pt,{children:"Are you sure you want to cancel this invitation? The invitee will no longer be able to join the organization with this invitation."})]}),t[50]=ee):ee=t[50];let te;t[51]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx(xt,{children:"Keep Invitation"}),t[51]=te):te=t[51];let se;t[52]!==l.cancel||t[53]!==x?(se=()=>{x&&(l.cancel.mutate(x),j(null))},t[52]=l.cancel,t[53]=x,t[54]=se):se=t[54];let S;t[55]!==l.cancel.isPending||t[56]!==se?(S=s.jsxs(dt,{children:[ee,s.jsxs(ut,{children:[te,s.jsx(ft,{onClick:se,disabled:l.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=l.cancel.isPending,t[56]=se,t[57]=S):S=t[57];let ne;t[58]!==re||t[59]!==S?(ne=s.jsx(bt,{open:re,onOpenChange:X,children:S}),t[58]=re,t[59]=S,t[60]=ne):ne=t[60];const ge=!!c;let je;t[61]===Symbol.for("react.memo_cache_sentinel")?(je=()=>p(null),t[61]=je):je=t[61];let ke;t[62]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsxs(ht,{children:[s.jsx(gt,{children:"Remove Member"}),s.jsx(pt,{children:"Are you sure you want to remove this member from the organization? This action cannot be undone."})]}),t[62]=ke):ke=t[62];let Fe;t[63]===Symbol.for("react.memo_cache_sentinel")?(Fe=s.jsx(xt,{children:"Cancel"}),t[63]=Fe):Fe=t[63];let ve;t[64]!==c||t[65]!==E?(ve=()=>c&&E.mutate(c),t[64]=c,t[65]=E,t[66]=ve):ve=t[66];let Ce;t[67]!==E.isPending||t[68]!==ve?(Ce=s.jsxs(dt,{children:[ke,s.jsxs(ut,{children:[Fe,s.jsx(ft,{onClick:ve,disabled:E.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=E.isPending,t[68]=ve,t[69]=Ce):Ce=t[69];let ye;t[70]!==ge||t[71]!==Ce?(ye=s.jsx(bt,{open:ge,onOpenChange:je,children:Ce}),t[70]=ge,t[71]=Ce,t[72]=ye):ye=t[72];const Ue=Ee,Ge=Ee,Rt="flex flex-col gap-6";let Se;t[73]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(Ee.Title,{children:"Members"}),t[73]=Se):Se=t[73];let Oe;t[74]===Symbol.for("react.memo_cache_sentinel")?(Oe=u=>{u.key==="Escape"&&(b(""),u.target.blur())},t[74]=Oe):Oe=t[74];let we;t[75]!==g?(we=s.jsx(Lt,{value:g,onChange:b,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:Oe}),t[75]=g,t[76]=we):we=t[76];let Le;t[77]===Symbol.for("react.memo_cache_sentinel")?(Le=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[77]=Le):Le=t[77];let Ne;t[78]!==f||t[79]!==y||t[80]!==v||t[81]!==M?(Ne=s.jsx(Ot,{viewMode:M,onViewModeChange:R,sortKey:v,sortDirection:y,onSort:f,sortOptions:Le}),t[78]=f,t[79]=y,t[80]=v,t[81]=M,t[82]=Ne):Ne=t[82];let Te;t[83]!==we||t[84]!==Ne?(Te=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[we,Ne]}),Re]}),t[83]=we,t[84]=Ne,t[85]=Te):Te=t[85];const He=M==="cards"?s.jsx("div",{children:he.length===0?s.jsx(Je,{title:"No members found",description:g?`No members match "${g}"`:"Invite members to get started."}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:he.map(u=>{if(u.type==="invitation")return s.jsxs(jt,{className:"transition-colors relative opacity-75",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(wt,{invitationId:u.data.id,onCancel:j,isCancelling:l.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ke,{fallback:Ve(u.data.email),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:u.data.email}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Qe,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(Be,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:U,selectableRoles:J,onRoleChange:(_,B)=>V.mutate({invitationId:_,role:B,email:u.data.email}),className:"w-fit"})]})]})]},`inv-${u.data.id}`);const h=u.data;return s.jsxs(jt,{className:"transition-colors relative",children:[s.jsx("div",{className:"absolute top-4 right-4 z-10",children:s.jsx(St,{member:h,roles:O,onChangeRole:(_,B)=>C.mutate({memberId:_,role:B}),onRemove:p,isUpdating:C.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Ke,{url:h.user?.image??void 0,fallback:Ve(h.user?.name),shape:"circle",size:"lg",className:"shrink-0"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.user?.name||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:h.user?.email}),s.jsx(Be,{role:h.role,memberId:h.id,isOwner:h.role==="owner",roleColorMap:U,selectableRoles:J,onRoleChange:(_,B)=>C.mutate({memberId:_,role:B}),className:"w-fit"}),s.jsx(_t,{memberId:h.id,maxDisplay:3})]})]})]},h.id)})})}):s.jsx(qt,{columns:_e,data:he,isLoading:!1,sortKey:v,sortDirection:y,onSort:f,emptyState:g?s.jsx(Je,{title:"No members found",description:`No members match "${g}"`}):s.jsx(Je,{title:"No members found",description:"Invite members to get started."})});let Ie;t[86]!==Se||t[87]!==Te||t[88]!==He?(Ie=s.jsxs("div",{className:Rt,children:[Se,Te,He]}),t[86]=Se,t[87]=Te,t[88]=He,t[89]=Ie):Ie=t[89];let Ae;t[90]!==Ge.Body||t[91]!==Ie?(Ae=s.jsx(Ge.Body,{children:Ie}),t[90]=Ge.Body,t[91]=Ie,t[92]=Ae):Ae=t[92];let Me;t[93]!==Ue.Content||t[94]!==Ae?(Me=s.jsx(Ue.Content,{children:Ae}),t[93]=Ue.Content,t[94]=Ae,t[95]=Me):Me=t[95];let qe;return t[96]!==oe||t[97]!==ne||t[98]!==ye||t[99]!==Me?(qe=s.jsxs(oe,{children:[ne,ye,Me]}),t[96]=oe,t[97]=ne,t[98]=ye,t[99]=Me,t[100]=qe):qe=t[100],qe}function Bs(t){return{type:"invitation",data:t}}function Ks(t){return t.status==="pending"}function Vs(t){return{type:"member",data:t}}function Qs(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ds(t.data.createdAt):"N/A"}):s.jsx(Qe,{variant:"outline",children:"Pending"})}function Us(t){return t.type==="member"?s.jsx(_t,{memberId:t.data.id,maxDisplay:2}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}function Gs(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ke,{url:t.data.user?.image??void 0,fallback:Ve(t.data.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.user?.name||"Unknown"}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:t.data.user?.email})]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ke,{fallback:Ve(t.data.email),shape:"circle",size:"sm"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium text-foreground truncate",children:t.data.email}),s.jsx("div",{className:"text-sm text-muted-foreground truncate",children:"Invitation sent"})]})]})}function Hs(t){return t.role!=="owner"}function Js(t,e){ue("invitation_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update invitation role")}function Ws(t,e){ue("member_role_update_failed",{new_role:e.role,error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to update role")}function Ys(t){ue("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to remove member")}function Zs(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function Xs(){const t=Y.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Ee,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:"Failed to load members"})})}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Ft,{fallback:e,children:s.jsx(ce.Suspense,{fallback:s.jsx(Ee,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Ze,{size:32,className:"animate-spin text-muted-foreground"})})}),children:s.jsx(qs,{})})}),t[1]=n):n=t[1],n}function Jn(){const t=Y.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(js,{capability:"members:manage",area:"members",children:s.jsx(Xs,{})}),t[0]=e):e=t[0],e}export{Jn as default};
@@ -1,4 +1,4 @@
1
- import{e as L,j as f,r as p,_ as O}from"./index-rZ1TPVyD.js";import{l as I,F as $}from"./index-DppjWA7O.js";import{S as N}from"./spinner-DZmgr2qu.js";async function K(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
1
+ import{e as L,j as f,r as p,_ as O}from"./index-DxLTuX83.js";import{l as I,F as $}from"./index-WAvrfxHO.js";import{S as N}from"./spinner-CIUpakvk.js";async function K(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
2
2
  type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
3
3
  ? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
4
4
  : T extends object