decocms 3.21.2 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/client/assets/{AlertCircle-GyiOEtAj.js → AlertCircle-pAk7pz2A.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-DlUPHWCe.js → ArrowUpRight-D8Q8bssU.js} +1 -1
  3. package/dist/client/assets/{Check-COv5M0lh.js → Check-DQAVDpIM.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-ChsHFiFQ.js → CheckCircle-D1Dg0XPv.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-BdEaOOXp.js → ChevronDown-Bi1TdyZy.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-B8kAn6JD.js → ChevronLeft-XwIoDSQw.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-o4nZK4mj.js → ChevronRight-CkJH34fR.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-y4zusQsp.js → ChevronUp-DCxLSeww.js} +1 -1
  9. package/dist/client/assets/{Container-CqLkbSjr.js → Container-DwZ_jX3H.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-W4F6Fa4e.js → DotsVertical-Yckr1dnc.js} +1 -1
  11. package/dist/client/assets/{Eye-f801Ko_Z.js → Eye-Bfr_QPuL.js} +1 -1
  12. package/dist/client/assets/{FilterLines-CdYz7NJH.js → FilterLines-Cp1P2LCk.js} +1 -1
  13. package/dist/client/assets/{Globe01-BfG_Acce.js → Globe01-C4jfaifn.js} +1 -1
  14. package/dist/client/assets/{HardDrive-D9UXv7dX.js → HardDrive-C5ROolZJ.js} +1 -1
  15. package/dist/client/assets/{Key01-B5dV9ECL.js → Key01--KIyCrgU.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-B60p8Um4.js → LayoutLeft-BWpv2uim.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-6cFTncDa.js → LinkExternal01-Bv2RdVrA.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Cc4WDpkR.js → Monitor01-BA2uzY6S.js} +1 -1
  19. package/dist/client/assets/{Palette--vnxJff4.js → Palette-CsWnTio_.js} +1 -1
  20. package/dist/client/assets/{Play-C7HtzLaD.js → Play-CxlcsRxR.js} +1 -1
  21. package/dist/client/assets/{Plus-LwySGDxB.js → Plus-BDGhAbty.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-CqQ0_ss_.js → RefreshCcw01-BjGXDN5P.js} +1 -1
  23. package/dist/client/assets/{SearchMd-MshnFe0l.js → SearchMd-CVl1nAAe.js} +1 -1
  24. package/dist/client/assets/{Settings02-StPTnFMx.js → Settings02-x5zYtWj4.js} +1 -1
  25. package/dist/client/assets/{Shield01-T0cQG3gR.js → Shield01-DhN0pDQP.js} +1 -1
  26. package/dist/client/assets/{Star01-DBs_rPC7.js → Star01-DUyS1T2P.js} +1 -1
  27. package/dist/client/assets/{Stars01-DHlDpyBS.js → Stars01-B3Wn6zcW.js} +1 -1
  28. package/dist/client/assets/{Stars02-B2A2nE0X.js → Stars02-B_JTSD1d.js} +1 -1
  29. package/dist/client/assets/{Sun-Deye0C8A.js → Sun-Cr-e1Lnp.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CXh2-ORd.js → SwitchHorizontal01-PCk62uIc.js} +1 -1
  31. package/dist/client/assets/{Tool01-nSGgZsVX.js → Tool01-gpAGz1_j.js} +1 -1
  32. package/dist/client/assets/{Trash01-DZfkybKU.js → Trash01-CzRVqEB7.js} +1 -1
  33. package/dist/client/assets/{Upload01-rVUdt3iJ.js → Upload01-BASWlYx7.js} +1 -1
  34. package/dist/client/assets/{User01-NlAzTddi.js → User01-CuXbKbjv.js} +1 -1
  35. package/dist/client/assets/{Users01-DaydqXQC.js → Users01-DhiSaCYj.js} +1 -1
  36. package/dist/client/assets/{Users03-BRSJ5vR7.js → Users03-Ducv2f-m.js} +1 -1
  37. package/dist/client/assets/{X-BN3arG6T.js → X-83EmnDMb.js} +1 -1
  38. package/dist/client/assets/{XCircle-xmKSYZKr.js → XCircle-Du1sONbV.js} +1 -1
  39. package/dist/client/assets/{XClose-1qd9ainB.js → XClose-Ch_f01gr.js} +1 -1
  40. package/dist/client/assets/{Zap-CYUIBMS-.js → Zap-DXMX0hJS.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-DsZrIKGl.js → ZapSquare-DtBxGgtE.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-CVKSaoni.js → ZoomOut-BXte6ipc.js} +1 -1
  43. package/dist/client/assets/{access-gate-CweS51cI.js → access-gate-C85vdQWH.js} +1 -1
  44. package/dist/client/assets/{accordion-Bl7Yi6C4.js → accordion-BAbAolne.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-uFfZJI5Z.js → add-section-modal-CBnNVtCp.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-D2XTyDA4.js → agent-capabilities-4tM1s30v.js} +1 -1
  47. package/dist/client/assets/{agent-icon-K7-2Vanq.js → agent-icon-DOdlVXXY.js} +1 -1
  48. package/dist/client/assets/{agent-icons-CeKYocvB.js → agent-icons-COLDzVhj.js} +1 -1
  49. package/dist/client/assets/{agents-list-SW53IbcR.js → agents-list-bc0td1kT.js} +1 -1
  50. package/dist/client/assets/{ai-providers-CRMVj1sW.js → ai-providers-DzT4bZkw.js} +1 -1
  51. package/dist/client/assets/{alert-CyRuR44t.js → alert-DKtEGRA-.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-CJQaL6p3.js → alert-dialog-C75TDKwb.js} +1 -1
  53. package/dist/client/assets/app-editor-D2RhfPtu.js +1 -0
  54. package/dist/client/assets/{auth-catchall-C0LPYH9l.js → auth-catchall-DN4Da23t.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-B0BicaKX.js → auth-split-layout-C4z3pxMd.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-DO-WP7Ai.js → automation-list-row-_XOinIwW.js} +1 -1
  57. package/dist/client/assets/{automation-runs-eraj829k.js → automation-runs-DtCF6tzm.js} +1 -1
  58. package/dist/client/assets/{automations-BVY79yPk.js → automations-DPMzMTmb.js} +1 -1
  59. package/dist/client/assets/{avatar-BdxyYnNK.js → avatar-DeC2l3ZL.js} +1 -1
  60. package/dist/client/assets/{badge-CS2sZUxN.js → badge-DRP9cnUB.js} +1 -1
  61. package/dist/client/assets/{brand-context-CjWlWxwt.js → brand-context-D6sOQk0K.js} +1 -1
  62. package/dist/client/assets/{buckets-BGHRc7Um.js → buckets-MtvBMqxU.js} +1 -1
  63. package/dist/client/assets/{calendar-DczL_N_A.js → calendar-igQ5YzHj.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-DNJuBq-F.js → capability-load-error-JYjfLxYd.js} +1 -1
  65. package/dist/client/assets/{card-Br94nOKg.js → card-BrlJfeB9.js} +1 -1
  66. package/dist/client/assets/{chat-context-DA35HLXS.js → chat-context-Dw-ZrfPh.js} +1 -1
  67. package/dist/client/assets/{checkbox-CqOCOG6Q.js → checkbox-DKV7xF32.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-BVqxZix5.js → cli-auth-success-CKqXED_A.js} +1 -1
  69. package/dist/client/assets/{collection-detail-CynKMc1R.js → collection-detail-C8ij4h83.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-Cv9SNAbw.js → collection-display-button-CIcRFE6e.js} +1 -1
  71. package/dist/client/assets/{collection-search-ChKSSxmH.js → collection-search-CYjEBahd.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-DGk9I-x6.js → collection-table-wrapper-NzDXm3JR.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-C5s6I9ON.js → collection-tabs-Bi3me5zn.js} +1 -1
  74. package/dist/client/assets/{collections-Dk6dLEYA.js → collections-B6f0c6Gc.js} +1 -1
  75. package/dist/client/assets/{command-BS0mokMv.js → command-iD5F3xsm.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-DpF_sI6h.js → connect-desktop-dialog-MhEPn6Pb.js} +1 -1
  77. package/dist/client/assets/{connection-card-CFu6MAht.js → connection-card-D8kKZ2Su.js} +1 -1
  78. package/dist/client/assets/{connection-detail-Bavv4Ydp.js → connection-detail-DGhMF7B5.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-C3EFMKqC.js → connection-form-helpers-BMAqR0H2.js} +1 -1
  80. package/dist/client/assets/{connections-BTIddADu.js → connections-tdft0iOw.js} +1 -1
  81. package/dist/client/assets/{decopilot-sse-pool-CZFgZ3nE.js → decopilot-sse-pool-DedBiWBR.js} +1 -1
  82. package/dist/client/assets/{dialog-CL1BseA9.js → dialog-BZr5zbCl.js} +1 -1
  83. package/dist/client/assets/{domain-settings-BnveJoGD.js → domain-settings-DqkGR4ju.js} +1 -1
  84. package/dist/client/assets/{drawer-C9J2FQkF.js → drawer-CYxbUg_h.js} +1 -1
  85. package/dist/client/assets/{dropdown-menu-DVje-EoW.js → dropdown-menu-CD_c2TIi.js} +1 -1
  86. package/dist/client/assets/{dynamic-plugin-layout-WHfaSv1Y.js → dynamic-plugin-layout-Lh2tkL5T.js} +1 -1
  87. package/dist/client/assets/{empty-state-DpAFEVjw.js → empty-state-B_0hb1A0.js} +1 -1
  88. package/dist/client/assets/{empty-state-Bv1Z9MXv.js → empty-state-IGBeO6tz.js} +1 -1
  89. package/dist/client/assets/{extract-connection-data-CrV9u96Z.js → extract-connection-data-Czkoga2m.js} +1 -1
  90. package/dist/client/assets/{features-BEAGHXsv.js → features-NyNeXc53.js} +1 -1
  91. package/dist/client/assets/{file-explorer-BwsVi5Sn.js → file-explorer-0TJBpiAM.js} +1 -1
  92. package/dist/client/assets/{file-type-icon-DVYPih9c.js → file-type-icon-BgrOltbN.js} +1 -1
  93. package/dist/client/assets/{files-10ME_3JG.js → files-BKGr96eN.js} +1 -1
  94. package/dist/client/assets/{form-4UXcNbUg.js → form-T-F5zllE.js} +1 -1
  95. package/dist/client/assets/{general-CWwyMwhB.js → general-DQ5l34wY.js} +1 -1
  96. package/dist/client/assets/{generate-id-CVdT0fIQ.js → generate-id-D6xcj4Vo.js} +1 -1
  97. package/dist/client/assets/{github-repo-picker-DD8wItvg.js → github-repo-picker-CzdLLUMG.js} +1 -1
  98. package/dist/client/assets/{header-tab-button-DgECRSSy.js → header-tab-button-BYE-cy4z.js} +1 -1
  99. package/dist/client/assets/{hover-card-BA4UtY_2.js → hover-card-DtN9e4lS.js} +1 -1
  100. package/dist/client/assets/{image-field-U7AFL_og.js → image-field-o5s939sw.js} +1 -1
  101. package/dist/client/assets/{index-DD8pNQTz.js → index-BCLfY73J.js} +1 -1
  102. package/dist/client/assets/{index-DsK69xEH.js → index-Bh6G0md4.js} +1 -1
  103. package/dist/client/assets/{index-DinTmsRi.js → index-Bl1Bupan.js} +4 -4
  104. package/dist/client/assets/{index-DYMkejmQ.js → index-BnbWlA-z.js} +1 -1
  105. package/dist/client/assets/{index-BQ89iNpK.js → index-CCE6qNuT.js} +1 -1
  106. package/dist/client/assets/{index-BBFvsGUO.js → index-CJIcolio.js} +1 -1
  107. package/dist/client/assets/{index-BQoodOft.js → index-CcxJg5tu.js} +1 -1
  108. package/dist/client/assets/{index-DC5ykVbq.js → index-D3uqbcw5.js} +3 -3
  109. package/dist/client/assets/{index-_z9AfqD0.js → index-DkP2MuRe.js} +1 -1
  110. package/dist/client/assets/{index-4cfzvyaB.js → index-DnlU3wo0.js} +1 -1
  111. package/dist/client/assets/{index-BK7hwLt0.js → index-DtoxuSdX.js} +1 -1
  112. package/dist/client/assets/{index-COXkGBKF.js → index-SUC3RRLY.js} +1 -1
  113. package/dist/client/assets/{index-BKKTxT9B.js → index-fQE_dv6G.js} +1 -1
  114. package/dist/client/assets/{index-CAfQQdyv.js → index-jCyOS9MH.js} +1 -1
  115. package/dist/client/assets/{index-redirect-BYXba1LQ.js → index-redirect-BId5g6Lh.js} +1 -1
  116. package/dist/client/assets/{index-CuZbHxuM.js → index-rl_0TNjh.js} +1 -1
  117. package/dist/client/assets/{infiniteQueryObserver-BFBhoWbn.js → infiniteQueryObserver-D-IGkyqs.js} +1 -1
  118. package/dist/client/assets/{input-CmdQXS7m.js → input-zaBOyrtt.js} +1 -1
  119. package/dist/client/assets/{integration-icon-DubrPseB.js → integration-icon-CJC0sPeU.js} +1 -1
  120. package/dist/client/assets/{label-BeKFq4Z_.js → label-DPx6ivm9.js} +1 -1
  121. package/dist/client/assets/{layout-8ZlqaeBv.js → layout-gBKaR4mV.js} +1 -1
  122. package/dist/client/assets/{login-Xkc831VM.js → login-Ch3wEDDK.js} +1 -1
  123. package/dist/client/assets/{members-8soouHex.js → members-BlcfjHox.js} +1 -1
  124. package/dist/client/assets/{monaco-editor-B-nbM8Ue.js → monaco-editor-RJ8gNNoQ.js} +1 -1
  125. package/dist/client/assets/{monitoring-stats-row-pLl4ltj8.js → monitoring-stats-row-DILukDZ6.js} +1 -1
  126. package/dist/client/assets/{oauth-callback-ai-provider-DgTV983m.js → oauth-callback-ai-provider-D3YO7YMo.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-m-HDC-da.js → oauth-callback-xHyCmXlJ.js} +1 -1
  128. package/dist/client/assets/{onboarding-CJD62kRn.js → onboarding-fkWHms0V.js} +1 -1
  129. package/dist/client/assets/{org-install-rd8eLbo7.js → org-install-1NyAgL-S.js} +1 -1
  130. package/dist/client/assets/{org-layout-DeIWaN_p.js → org-layout-CN6K9jjG.js} +1 -1
  131. package/dist/client/assets/{org-plugin-layout-LtGGGoMB.js → org-plugin-layout-LtMDxS9Z.js} +1 -1
  132. package/dist/client/assets/{page-seo-form-BkwbUlnR.js → page-seo-form-BShK5kAZ.js} +1 -1
  133. package/dist/client/assets/page-seo-sheet-DQk7EQyr.js +1 -0
  134. package/dist/client/assets/{pair-DE0D0Wie.js → pair-pYbSqQcN.js} +1 -1
  135. package/dist/client/assets/{plugin-empty-state-CyD0C1Bf.js → plugin-empty-state-GzFE5CjN.js} +1 -1
  136. package/dist/client/assets/{plugin-header-W1I2_V_j.js → plugin-header-BfmTrEzj.js} +1 -1
  137. package/dist/client/assets/{plugin-layout-B4yAz-3-.js → plugin-layout-3ttHdB9d.js} +1 -1
  138. package/dist/client/assets/{popover-Dp3QS8N6.js → popover-CgUQcq3p.js} +1 -1
  139. package/dist/client/assets/{post-editor-DR83fZSH.js → post-editor-aVo0AVg-.js} +1 -1
  140. package/dist/client/assets/{primitives-iMjdQad6.js → primitives-DtR_zYMp.js} +1 -1
  141. package/dist/client/assets/{profile-eau3k4Po.js → profile-BxuXyPDX.js} +1 -1
  142. package/dist/client/assets/{project-app-view-CRvOiu2b.js → project-app-view-BHxQpe2k.js} +1 -1
  143. package/dist/client/assets/record-editor-CnXyDyYd.js +1 -0
  144. package/dist/client/assets/registry-DS9vtvoZ.js +2 -0
  145. package/dist/client/assets/{registry-layout-BmSXJxoZ.js → registry-layout-B4WJgip1.js} +1 -1
  146. package/dist/client/assets/{require-capability-bCqnmJfy.js → require-capability-Csn3gUQB.js} +1 -1
  147. package/dist/client/assets/{required-auth-layout-D7jgv78c.js → required-auth-layout-DXvX2OUA.js} +1 -1
  148. package/dist/client/assets/{reset-password-D28fxRQV.js → reset-password-De5g837L.js} +1 -1
  149. package/dist/client/assets/{resizable-Cd48I16F.js → resizable-Cnvu-y5H.js} +1 -1
  150. package/dist/client/assets/{roles-gGKNgLrN.js → roles-DloWH0TZ.js} +1 -1
  151. package/dist/client/assets/save-referenced-block-B-yKXzWN.js +1 -0
  152. package/dist/client/assets/{save-status-B5l1r2yt.js → save-status-CIr-R2-S.js} +1 -1
  153. package/dist/client/assets/{schema-form-DoBelrVG.js → schema-form-BYDZovtl.js} +1 -1
  154. package/dist/client/assets/{scroll-area-P07qVNiz.js → scroll-area-D0LWyps5.js} +1 -1
  155. package/dist/client/assets/{search-input-BC00SFbU.js → search-input-DkB2Dsrg.js} +1 -1
  156. package/dist/client/assets/{secrets-C14kJLTf.js → secrets-CC_QyeBA.js} +1 -1
  157. package/dist/client/assets/{sections-editor-BXkiyOGf.js → sections-editor-6_6abvm3.js} +1 -1
  158. package/dist/client/assets/{select-n15H_mpn.js → select-D_4W4Lg1.js} +1 -1
  159. package/dist/client/assets/{select-model-D5qi4yVr.js → select-model-CM_3vKD2.js} +1 -1
  160. package/dist/client/assets/{seo-editor-D-F0mviD.js → seo-editor-BZdp6VKS.js} +1 -1
  161. package/dist/client/assets/{settings-layout-pqyPhxP-.js → settings-layout-BUtHz7wZ.js} +1 -1
  162. package/dist/client/assets/{settings-section-Tanq8jyR.js → settings-section-D_S8HruY.js} +1 -1
  163. package/dist/client/assets/{sheet-D4rfwRUO.js → sheet-w98ImB6I.js} +1 -1
  164. package/dist/client/assets/{shell-controls-mDSWSVmf.js → shell-controls-863u536F.js} +1 -1
  165. package/dist/client/assets/{shell-layout-BwqpmibN.js → shell-layout-U_5qPoVt.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-BcS4ogVM.js → shell-route-loading-nIjX0bB3.js} +1 -1
  167. package/dist/client/assets/{sidebar-BROkYxtG.js → sidebar-DXhRQRtB.js} +1 -1
  168. package/dist/client/assets/{skeleton-DWOWMile.js → skeleton-BBY1zrDO.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-QhdKIQMp.js → sortable.esm-CKTU_2ZT.js} +1 -1
  170. package/dist/client/assets/{spinner-CtVtBijD.js → spinner-OhUXCVj7.js} +1 -1
  171. package/dist/client/assets/{sso-iKeLtq8V.js → sso-DRU_umZF.js} +1 -1
  172. package/dist/client/assets/{store-D_M-OYO8.js → store-DWynEU5Q.js} +1 -1
  173. package/dist/client/assets/store-registry-DuYHljA6.js +2 -0
  174. package/dist/client/assets/{switch-QoxQ4Dp8.js → switch-BgSuJonO.js} +1 -1
  175. package/dist/client/assets/{tab-id-CNkO3hVN.js → tab-id-DUyu71z4.js} +11 -11
  176. package/dist/client/assets/{table-BsrEIQdy.js → table-D3b5WGm6.js} +1 -1
  177. package/dist/client/assets/{tabs-kJyWL6V1.js → tabs-ClMKJief.js} +1 -1
  178. package/dist/client/assets/{task-status-j0388nBE.js → task-status-B0NlkvAF.js} +1 -1
  179. package/dist/client/assets/{textarea-IFOxZRFP.js → textarea-DH-B0XCR.js} +1 -1
  180. package/dist/client/assets/{toggle-group--w1kOZWe.js → toggle-group-BjfIrx6t.js} +1 -1
  181. package/dist/client/assets/{toolbar-BBxreRsk.js → toolbar-KDA-DWZL.js} +1 -1
  182. package/dist/client/assets/{tools-list-DJXjW2l9.js → tools-list-rhnnnMTL.js} +1 -1
  183. package/dist/client/assets/{tooltip-D7cmoHaE.js → tooltip-Dn6fY6rk.js} +1 -1
  184. package/dist/client/assets/{types-BmGja53h.js → types-D6djITdr.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers--CmHEwAc.js → use-ai-providers-DqdSrndI.js} +1 -1
  186. package/dist/client/assets/{use-automations-BuOkYpgz.js → use-automations-BFFOEBBv.js} +1 -1
  187. package/dist/client/assets/{use-capability-CxysHd_P.js → use-capability-wplOe6EY.js} +1 -1
  188. package/dist/client/assets/{use-collections-BOfrARHt.js → use-collections-D8H9xA-I.js} +1 -1
  189. package/dist/client/assets/{use-connection-n0123jPK.js → use-connection-BbdJLgI8.js} +1 -1
  190. package/dist/client/assets/{use-copy-B0vwFN4z.js → use-copy-ArwJJTRo.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-D-CNGeek.js → use-create-virtual-mcp-Dxx_ym-F.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-D2Tk122B.js → use-debounced-autosave-xtjKJaqi.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-C4A0wxBY.js → use-delete-connection-C8w89wO_.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-CyyHbhaI.js → use-file-configs-ZKM7KIsV.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-CdSYgiPG.js → use-infinite-scroll-BAXuLTxv.js} +1 -1
  196. package/dist/client/assets/{use-list-state-eagOZcTM.js → use-list-state-Cs-88KBF.js} +1 -1
  197. package/dist/client/assets/{use-mcp-client-DyuH8eE6.js → use-mcp-client-BLVKRAvV.js} +1 -1
  198. package/dist/client/assets/{use-mcp-prompts-Bwn_S6iL.js → use-mcp-prompts-Bnq40S1K.js} +1 -1
  199. package/dist/client/assets/{use-mcp-tools-DC6ktQK8.js → use-mcp-tools-CKjjestk.js} +1 -1
  200. package/dist/client/assets/{use-members-BzP8QLPf.js → use-members-CWd3z_VY.js} +1 -1
  201. package/dist/client/assets/{use-navigate-to-agent-B09CyGqp.js → use-navigate-to-agent-DHne7I3j.js} +1 -1
  202. package/dist/client/assets/{use-org-auth-client-DHC5iDX4.js → use-org-auth-client-hXVq3OsM.js} +1 -1
  203. package/dist/client/assets/{use-org-sso-qSbMZg_F.js → use-org-sso-CzM7EYqW.js} +1 -1
  204. package/dist/client/assets/{use-organization-roles-SRzyOUnT.js → use-organization-roles-BKnRl7Of.js} +1 -1
  205. package/dist/client/assets/{use-organization-settings-B4dvDS7R.js → use-organization-settings-CG7i81jI.js} +1 -1
  206. package/dist/client/assets/{use-registry-connections-Bds9Ypgx.js → use-registry-connections-gGtQvhkv.js} +1 -1
  207. package/dist/client/assets/{use-secrets-CnpydoP_.js → use-secrets-DvpEVo0S.js} +1 -1
  208. package/dist/client/assets/{use-status-sounds-CK6N7rMv.js → use-status-sounds-CJb2nm_l.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-RCfU_Ov_.js → use-view-mode-Ji__gX1X.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-Dey3T-Qn.js → use-virtual-mcp-CXk1TW9Q.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-DkrlRLKs.js +1 -0
  212. package/dist/client/assets/{useRouterState-Suijaaey.js → useRouterState-DIs99FOC.js} +1 -1
  213. package/dist/client/assets/useSuspenseInfiniteQuery-Cn04Yo4W.js +1 -0
  214. package/dist/client/assets/{user-CZuNKuKE.js → user-DAvWZzaD.js} +1 -1
  215. package/dist/client/assets/{view-mode-toggle-DB4LJ27d.js → view-mode-toggle-C_rPFsNt.js} +1 -1
  216. package/dist/client/assets/{workflow-DdHZO7TR.js → workflow-CISvuYAS.js} +1 -1
  217. package/dist/client/assets/workflow-detail-CnaBysQA.js +1 -0
  218. package/dist/client/index.html +1 -1
  219. package/dist/server/cli.js +404 -402
  220. package/dist/server/migrate.js +40 -40
  221. package/dist/server/server.js +191 -191
  222. package/package.json +1 -1
  223. package/dist/client/assets/app-editor-DrKlBV5m.js +0 -1
  224. package/dist/client/assets/page-seo-sheet-j1sLOOHG.js +0 -1
  225. package/dist/client/assets/record-editor-B-ZWb752.js +0 -1
  226. package/dist/client/assets/registry-B8CD131L.js +0 -2
  227. package/dist/client/assets/save-referenced-block-BX18LfXg.js +0 -1
  228. package/dist/client/assets/store-registry-DrWHKBnR.js +0 -2
  229. package/dist/client/assets/useInfiniteQuery-DMrx4YUI.js +0 -1
  230. package/dist/client/assets/useSuspenseInfiniteQuery-BEThz4gg.js +0 -1
  231. package/dist/client/assets/workflow-detail-DelfG9w7.js +0 -1
@@ -1,4 +1,4 @@
1
- import{cY as tc,dU as Fe,bV as Os,W as oe,U as ge,aK as ti,ct as _i,aH as Ie,bT as mt,bp as Ve,aI as mr,dV as rn,T as _e,dW as Ii,dX as ws,dY as nc,cr as rc,dZ as ia,d_ as ic,d$ as sc,e0 as oc,d8 as fn,d9 as Cr,da as xs,ch as sa,c9 as ac,ba as ze,cs as lc,aJ as On,bC as Ti,e1 as cc,r as N,j as w,e2 as oa,cX as uc}from"./index-DC5ykVbq.js";import{A as aa,d as fc,e as dc,n as hc,f as pc,C as mc}from"./use-mcp-client-DyuH8eE6.js";import{B as Ci,c as Pi}from"./collections-Dk6dLEYA.js";import{R as Es}from"./index-COXkGBKF.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{cY as tc,dU as Fe,bV as Os,W as oe,U as ge,aK as ti,ct as _i,aH as Ie,bT as mt,bp as Ve,aI as mr,dV as rn,T as _e,dW as Ii,dX as ws,dY as nc,cr as rc,dZ as ia,d_ as ic,d$ as sc,e0 as oc,d8 as fn,d9 as Cr,da as xs,ch as sa,c9 as ac,ba as ze,cs as lc,aJ as On,bC as Ti,e1 as cc,r as N,j as w,e2 as oa,cX as uc}from"./index-D3uqbcw5.js";import{A as aa,d as fc,e as dc,n as hc,f as pc,C as mc}from"./use-mcp-client-BLVKRAvV.js";import{B as Ci,c as Pi}from"./collections-B6f0c6Gc.js";import{R as Es}from"./index-SUC3RRLY.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{av as g,dC as d,dD as v}from"./index-DC5ykVbq.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:u,isError:c,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",f=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
1
+ import{av as g,dC as d,dD as v}from"./index-D3uqbcw5.js";var b=class extends g{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:s}=e,i=super.createResult(e,t),{isFetching:a,isRefetching:u,isError:c,isRefetchError:P}=i,r=s.fetchMeta?.fetchMore?.direction,h=c&&r==="forward",o=a&&r==="forward",n=c&&r==="backward",f=a&&r==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:v(t,s.data),hasPreviousPage:d(t,s.data),isFetchNextPageError:h,isFetchingNextPage:o,isFetchPreviousPageError:n,isFetchingPreviousPage:f,isRefetchError:P&&!h&&!n,isRefetching:u&&!o&&!f}}};export{b as I};
@@ -1 +1 @@
1
- import{e as s,c as a,j as d}from"./index-DC5ykVbq.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-D3uqbcw5.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-DC5ykVbq.js";import{n as L}from"./Container-CqLkbSjr.js";import{A as k}from"./agent-icon-K7-2Vanq.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-D3uqbcw5.js";import{n as L}from"./Container-DwZ_jX3H.js";import{A as k}from"./agent-icon-DOdlVXXY.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-DC5ykVbq.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-D3uqbcw5.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-DC5ykVbq.js";import{P as E}from"./index-BQoodOft.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-D3uqbcw5.js";import{P as E}from"./index-CcxJg5tu.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-DC5ykVbq.js";import{I}from"./input-CmdQXS7m.js";import{A as de}from"./auth-split-layout-B0BicaKX.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-D3uqbcw5.js";import{I}from"./input-zaBOyrtt.js";import{A as de}from"./auth-split-layout-C4z3pxMd.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 $t,r as ce,q as me,G as ze,b as zt,H as Dt,a as pe,t as fe,o as G,K as ie,j as s,B as Pe,e as J,s as kt,n as Nt,c as $e,l as Ze,E as Ft}from"./index-DC5ykVbq.js";import{C as Ot}from"./collection-display-button-Cv9SNAbw.js";import{S as Lt}from"./search-input-BC00SFbU.js";import{P as Me}from"./index-BQoodOft.js";import{C as qt}from"./collection-table-wrapper-DGk9I-x6.js";import{E as He}from"./empty-state-Bv1Z9MXv.js";import{D as Bt,i as Kt,a as Vt,b as Ut,c as Qt,d as Gt}from"./dialog-CL1BseA9.js";import{a as Jt,F as ot,b as rt,c as Ht,d as ct,f as mt}from"./form-4UXcNbUg.js";import{d as Xe,S as et,a as tt,b as st,c as nt}from"./select-n15H_mpn.js";import{T as Wt}from"./textarea-IFOxZRFP.js";import{u as at}from"./use-org-auth-client-DHC5iDX4.js";import{u as Tt}from"./use-organization-roles-SRzyOUnT.js";import{u as Yt}from"./use-members-BzP8QLPf.js";import{S as Zt,u as Xt}from"./use-mcp-client-DyuH8eE6.js";import{T as es,a as ts,c as ss,b as ns}from"./tooltip-D7cmoHaE.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-CJQaL6p3.js";import{A as Be}from"./avatar-BdxyYnNK.js";import{B as Ve}from"./badge-CS2sZUxN.js";import{C as jt}from"./card-Br94nOKg.js";import{D as It,a as At,b as Et,e as is,f as as,g as ls,c as it,d as os}from"./dropdown-menu-DVje-EoW.js";import{i as Mt}from"./DotsVertical-W4F6Fa4e.js";import{i as rs}from"./Key01-B5dV9ECL.js";import{i as cs}from"./Shield01-T0cQG3gR.js";import{a as ms}from"./SwitchHorizontal01-CXh2-ORd.js";import{s as ds}from"./Trash01-DZfkybKU.js";import{s as Pt}from"./XClose-1qd9ainB.js";import{C as vt}from"./checkbox-CqOCOG6Q.js";import{a as We,e as Ye,f as Ct,C as us,d as fs,b as hs,c as gs}from"./command-BS0mokMv.js";import{b as ps,P as xs,a as bs}from"./popover-Dp3QS8N6.js";import{t as js}from"./ChevronDown-BdEaOOXp.js";import{s as vs}from"./Plus-LwySGDxB.js";import{R as Cs}from"./require-capability-bCqnmJfy.js";import"./Check-COv5M0lh.js";import"./view-mode-toggle-DB4LJ27d.js";import"./SearchMd-MshnFe0l.js";import"./sidebar-BROkYxtG.js";import"./LayoutLeft-B60p8Um4.js";import"./sheet-D4rfwRUO.js";import"./X-BN3arG6T.js";import"./table-BsrEIQdy.js";import"./label-BeKFq4Z_.js";import"./ChevronUp-y4zusQsp.js";import"./User01-NlAzTddi.js";import"./ChevronRight-o4nZK4mj.js";import"./index-CAfQQdyv.js";import"./use-capability-CxysHd_P.js";import"./access-gate-CweS51cI.js";import"./capability-load-error-DNJuBq-F.js";const ys=$t().email("Invalid email address");function Ss(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 ws({trigger:t}){const[e,n]=ce.useState(!1),{locator:a}=me(),l=at(),i=ze(),{data:o}=zt.useSession(),r=o?.user?.email,{roles:g,isLoading:x}=Tt(),j=g.filter(m=>m.role!=="owner"),p=Dt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=p.watch("emailsText"),E=p.watch("role"),v=Ss(b).filter(m=>{const c=ys.safeParse(m).success,f=!r||m!==r.toLowerCase();return c&&f}),N=pe({mutationFn:async({emails:m,role:c})=>{if(!c)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await l.organization.inviteMember({email:w,role:c});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:c,role:f})=>{fe("member_invited",{count:c.length,role:f}),i.invalidateQueries({queryKey:ie.members(a)}),i.invalidateQueries({queryKey:ie.invitations(a)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:c,role:f})=>{fe("member_invite_failed",{count:c.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})},z=v.length>0&&!!E;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(Ut,{children:s.jsx(Qt,{children:"Invite members"})}),s.jsx(Jt,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(ot,{control:p.control,name:"emailsText",render:({field:m})=>s.jsxs(rt,{children:[s.jsx(Ht,{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 $t,r as ce,q as me,G as ze,b as zt,H as Dt,a as pe,t as fe,o as G,K as ie,j as s,B as Pe,e as J,s as kt,n as Nt,c as $e,l as Ze,E as Ft}from"./index-D3uqbcw5.js";import{C as Ot}from"./collection-display-button-CIcRFE6e.js";import{S as Lt}from"./search-input-DkB2Dsrg.js";import{P as Me}from"./index-CcxJg5tu.js";import{C as qt}from"./collection-table-wrapper-NzDXm3JR.js";import{E as He}from"./empty-state-IGBeO6tz.js";import{D as Bt,i as Kt,a as Vt,b as Ut,c as Qt,d as Gt}from"./dialog-BZr5zbCl.js";import{a as Jt,F as ot,b as rt,c as Ht,d as ct,f as mt}from"./form-T-F5zllE.js";import{d as Xe,S as et,a as tt,b as st,c as nt}from"./select-D_4W4Lg1.js";import{T as Wt}from"./textarea-DH-B0XCR.js";import{u as at}from"./use-org-auth-client-hXVq3OsM.js";import{u as Tt}from"./use-organization-roles-BKnRl7Of.js";import{u as Yt}from"./use-members-CWd3z_VY.js";import{S as Zt,u as Xt}from"./use-mcp-client-BLVKRAvV.js";import{T as es,a as ts,c as ss,b as ns}from"./tooltip-Dn6fY6rk.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-C75TDKwb.js";import{A as Be}from"./avatar-DeC2l3ZL.js";import{B as Ve}from"./badge-DRP9cnUB.js";import{C as jt}from"./card-BrlJfeB9.js";import{D as It,a as At,b as Et,e as is,f as as,g as ls,c as it,d as os}from"./dropdown-menu-CD_c2TIi.js";import{i as Mt}from"./DotsVertical-Yckr1dnc.js";import{i as rs}from"./Key01--KIyCrgU.js";import{i as cs}from"./Shield01-DhN0pDQP.js";import{a as ms}from"./SwitchHorizontal01-PCk62uIc.js";import{s as ds}from"./Trash01-CzRVqEB7.js";import{s as Pt}from"./XClose-Ch_f01gr.js";import{C as vt}from"./checkbox-DKV7xF32.js";import{a as We,e as Ye,f as Ct,C as us,d as fs,b as hs,c as gs}from"./command-iD5F3xsm.js";import{b as ps,P as xs,a as bs}from"./popover-CgUQcq3p.js";import{t as js}from"./ChevronDown-Bi1TdyZy.js";import{s as vs}from"./Plus-BDGhAbty.js";import{R as Cs}from"./require-capability-Csn3gUQB.js";import"./Check-DQAVDpIM.js";import"./view-mode-toggle-C_rPFsNt.js";import"./SearchMd-CVl1nAAe.js";import"./sidebar-DXhRQRtB.js";import"./LayoutLeft-BWpv2uim.js";import"./sheet-w98ImB6I.js";import"./X-83EmnDMb.js";import"./table-D3b5WGm6.js";import"./label-DPx6ivm9.js";import"./ChevronUp-DCxLSeww.js";import"./User01-CuXbKbjv.js";import"./ChevronRight-CkJH34fR.js";import"./index-jCyOS9MH.js";import"./use-capability-wplOe6EY.js";import"./access-gate-C85vdQWH.js";import"./capability-load-error-JYjfLxYd.js";const ys=$t().email("Invalid email address");function Ss(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 ws({trigger:t}){const[e,n]=ce.useState(!1),{locator:a}=me(),l=at(),i=ze(),{data:o}=zt.useSession(),r=o?.user?.email,{roles:g,isLoading:x}=Tt(),j=g.filter(m=>m.role!=="owner"),p=Dt({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),b=p.watch("emailsText"),E=p.watch("role"),v=Ss(b).filter(m=>{const c=ys.safeParse(m).success,f=!r||m!==r.toLowerCase();return c&&f}),N=pe({mutationFn:async({emails:m,role:c})=>{if(!c)throw new Error("Please select a role");const f=await Promise.allSettled(m.map(async w=>{const A=await l.organization.inviteMember({email:w,role:c});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:c,role:f})=>{fe("member_invited",{count:c.length,role:f}),i.invalidateQueries({queryKey:ie.members(a)}),i.invalidateQueries({queryKey:ie.invitations(a)}),G.success(c.length===1?"Member invited successfully!":`${c.length} members invited successfully!`),p.reset({emailsText:"",role:"user"}),n(!1)},onError:(m,{emails:c,role:f})=>{fe("member_invite_failed",{count:c.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})},z=v.length>0&&!!E;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(Ut,{children:s.jsx(Qt,{children:"Invite members"})}),s.jsx(Jt,{...p,children:s.jsxs("form",{onSubmit:p.handleSubmit(y),className:"space-y-4",children:[s.jsx(ot,{control:p.control,name:"emailsText",render:({field:m})=>s.jsxs(rt,{children:[s.jsx(Ht,{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:p.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(c=>{const f=[];return c.isBuiltin||(c.allowsAllStaticPermissions?f.push("Full org access"):c.staticPermissionCount&&c.staticPermissionCount>0&&f.push(`${c.staticPermissionCount} org perm${c.staticPermissionCount!==1?"s":""}`),c.allowsAllConnections?f.push("All connections"):c.connectionCount&&c.connectionCount>0&&f.push(`${c.connectionCount} connection${c.connectionCount!==1?"s":""}`),(c.connectionCount!==0||c.allowsAllConnections)&&(c.allowsAllTools?f.push("all tools"):c.toolCount&&c.toolCount>0&&f.push(`${c.toolCount} tool${c.toolCount!==1?"s":""}`))),s.jsx(nt,{value:c.role,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:c.label}),!c.isBuiltin&&f.length>0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:f.join(", ")})]})},c.role)})})]})}),s.jsx(mt,{})]})}),s.jsxs(Gt,{children:[s.jsx(Pe,{variant:"outline",onClick:()=>{p.reset({emailsText:"",role:"user"}),n(!1)},type:"button",disabled:N.isPending,children:"Cancel"}),s.jsx(Pe,{type:"submit",disabled:N.isPending||!z,children:N.isPending?"Inviting...":`Invite ${v.length||0} Member${v.length!==1?"s":""}`})]})]})})]})]})}function Ns(){const t=J.c(10),{org:e,locator:n}=me();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Zt,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const l=Xt(a);let i;t[3]!==n?(i=ie.invitations(n),t[3]=n,t[4]=i):i=t[4];let o;t[5]!==l?(o=async()=>{const g=await l.callTool({name:"ORGANIZATION_GET",arguments:{}});return(g.structuredContent??g)?.invitations??[]},t[5]=l,t[6]=o):o=t[6];let r;return t[7]!==i||t[8]!==o?(r={queryKey:i,queryFn:o},t[7]=i,t[8]=o,t[9]=r):r=t[9],kt(r)}function Ts(){const t=J.c(10),{locator:e}=me(),n=at(),a=ze();let l;t[0]!==n?(l=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]=l):l=t[1];let i;t[2]!==e||t[3]!==a?(i=()=>{a.invalidateQueries({queryKey:ie.invitations(e)}),G.success("Invitation cancelled")},t[2]=e,t[3]=a,t[4]=i):i=t[4];let o;t[5]!==l||t[6]!==i?(o={mutationFn:l,onSuccess:i,onError:Is},t[5]=l,t[6]=i,t[7]=o):o=t[7];const r=pe(o);let g;return t[8]!==r?(g={cancel:r},t[8]=r,t[9]=g):g=t[9],g}function Is(t){G.error(t instanceof Error?t.message:"Failed to cancel invitation")}class As extends Error{constructor(e,n){super(e),this.status=n,this.name="StudioToolError"}status}async function Es(t,e,n){const a=await fetch(`/api/${encodeURIComponent(t)}/tools/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n??{})});if(!a.ok){let l=`${e} failed (${a.status})`;try{const i=await a.json();i?.error&&(l=i.error)}catch{}throw new As(l,a.status)}return await a.json()}function Ue(){const t=J.c(5),{org:e}=me(),n=e.slug;let a;t[0]!==n?(a=(i,o)=>Es(n,i,o),t[0]=n,t[1]=a):a=t[1];let l;return t[2]!==n||t[3]!==a?(l={orgSlug:n,call:a},t[2]=n,t[3]=a,t[4]=l):l=t[4],l}function Ms(){const t=J.c(7),{locator:e}=me(),n=Ue();let a;t[0]!==e?(a=ie.tags(e),t[0]=e,t[1]=a):a=t[1];let l;t[2]!==n?(l=async()=>{const{tags:o}=await n.call("TAGS_LIST",{});return o},t[2]=n,t[3]=l):l=t[3];let i;return t[4]!==a||t[5]!==l?(i={queryKey:a,queryFn:l,staleTime:3e4},t[4]=a,t[5]=l,t[6]=i):i=t[6],Nt(i)}function Ps(){const t=J.c(8),e=ze(),{locator:n}=me(),a=Ue();let l;t[0]!==a?(l=async r=>{const{tag:g}=await a.call("TAGS_CREATE",{name:r});return g},t[0]=a,t[1]=l):l=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]!==l||t[6]!==i?(o={mutationFn:l,onSuccess:i,onError:_s},t[5]=l,t[6]=i,t[7]=o):o=t[7],pe(o)}function _s(t){G.error(t instanceof Error?t.message:"Failed to create tag")}function Rs(t){const e=J.c(10),{locator:n}=me(),a=Ue();let l;e[0]!==n||e[1]!==t?(l=ie.memberTags(n,t),e[0]=n,e[1]=t,e[2]=l):l=e[2];let i;e[3]!==t||e[4]!==a?(i=async()=>{const{tags:g}=await a.call("MEMBER_TAGS_GET",{memberId:t});return g},e[3]=t,e[4]=a,e[5]=i):i=e[5];const o=!!t;let r;return e[6]!==l||e[7]!==i||e[8]!==o?(r={queryKey:l,queryFn:i,staleTime:3e4,enabled:o},e[6]=l,e[7]=i,e[8]=o,e[9]=r):r=e[9],Nt(r)}function $s(){const t=J.c(8),e=ze(),{locator:n}=me(),a=Ue();let l;t[0]!==a?(l=async r=>{const{memberId:g,tagIds:x}=r;return await a.call("MEMBER_TAGS_SET",{memberId:g,tagIds:x})},t[0]=a,t[1]=l):l=t[1];let i;t[2]!==n||t[3]!==e?(i=(r,g)=>{e.invalidateQueries({queryKey:ie.memberTags(n,g.memberId)})},t[2]=n,t[3]=e,t[4]=i):i=t[4];let o;return t[5]!==l||t[6]!==i?(o={mutationFn:l,onSuccess:i,onError:zs},t[5]=l,t[6]=i,t[7]=o):o=t[7],pe(o)}function zs(t){G.error(t instanceof Error?t.message:"Failed to update member tags")}function _t(t){const e=J.c(44),{memberId:n,className:a,disabled:l,placeholder:i,maxDisplay:o}=t,r=l===void 0?!1:l,g=i===void 0?"Add tags...":i,x=o===void 0?2:o,[j,p]=ce.useState(!1),[b,E]=ce.useState(""),{data:R,isLoading:v}=Ms(),N=R===void 0?[]:R,{data:y,isLoading:z}=Rs(n),m=y===void 0?[]:y,c=Ps(),f=$s(),I=v||z,w=m.map(ks);let A;e[0]!==b?(A=S=>S.name.toLowerCase().includes(b.toLowerCase()),e[0]=b,e[1]=A):A=e[1];const $=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),M=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 c.mutateAsync(b.trim());await f.mutateAsync({memberId:n,tagIds:[...w,S.id]}),E("")},d=async S=>{const ne=w.filter(ge=>ge!==S);await f.mutateAsync({memberId:n,tagIds:ne})},C=c.isPending||f.isPending,L=xs;let D;e[4]!==j?(D=()=>p(!j),e[4]=j,e[5]=D):D=e[5];let F;e[6]!==a?(F=$e("h-auto min-h-8 px-2 py-1 justify-start font-normal","hover:bg-accent/50",a),e[6]=a,e[7]=F):F=e[7];const V=r||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(Ds),m.length>x&&s.jsxs(Ve,{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:g});let U;e[8]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(js,{size:14,className:"ml-1 shrink-0 opacity-50"}),e[8]=U):U=e[8];let q;e[9]!==V||e[10]!==O||e[11]!==D||e[12]!==F?(q=s.jsx(bs,{asChild:!0,children:s.jsxs(Pe,{variant:"ghost",size:"sm",onClick:D,className:F,disabled:V,children:[O,U]})}),e[9]=V,e[10]=O,e[11]=D,e[12]=F,e[13]=q):q=e[13];const Q=ps,H="w-56 p-0",W="start";let Y;e[14]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>p(!1),e[14]=Y):Y=e[14];const ae=hs,xe=!1;let Z;e[15]!==b?(Z=s.jsx(gs,{placeholder:"Search or create...",value:b,onValueChange:E,className:"h-9"}),e[15]=b,e[16]=Z):Z=e[16];const le=fs,de=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=$.length===0&&!M&&s.jsx(us,{children:"No tags found."}),he=$.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]!==M?(re=M&&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(vs,{size:14}),s.jsxs("span",{children:['Create "',b.trim(),'"']})]})})})]}),e[21]=P,e[22]=C,e[23]=b,e[24]=M,e[25]=re):re=e[25];let X;e[26]!==le||e[27]!==de||e[28]!==oe||e[29]!==re?(X=s.jsxs(le,{children:[de,oe,re]}),e[26]=le,e[27]=de,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]!==Q||e[36]!==Y||e[37]!==ee?(te=s.jsx(Q,{className:H,align:W,onEscapeKeyDown:Y,children:ee}),e[35]=Q,e[36]=Y,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:p,children:[q,te]}),e[39]=L,e[40]=j,e[41]=q,e[42]=te,e[43]=se):se=e[43],se}function Ds(t){return s.jsx(Ve,{variant:"secondary",className:"text-xs px-1.5 py-0 h-5",children:t.name},t.id)}function ks(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"],Fs={owner:"bg-red-500",admin:"bg-blue-500",user:"bg-green-500"};function Ke(t){return t?t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?"}function Os(t){const e=new Map;for(const[n,a]of Object.entries(Fs))e.set(n,a);for(let n=0;n<t.length;n++){const a=t[n];a&&!e.has(a.role)&&e.set(a.role,yt[n%yt.length]??"bg-neutral-400")}return e}function Ls(t){return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function qe(t){const e=J.c(79),{role:n,memberId:a,isOwner:l,roleColorMap:i,selectableRoles:o,onRoleChange:r,size:g,className:x}=t,j=g===void 0?"xs":g;let p,b,E,R,v,N,y,z,m,c,f;if(e[0]!==x||e[1]!==l||e[2]!==a||e[3]!==r||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(l){let d;e[19]!==a||e[20]!==r?(d=H=>r(a,H),e[19]=a,e[20]=r,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:$e("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=W=>{const Y=i.get(W.role)??"bg-neutral-400";return s.jsx(nt,{value:W.role,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:$e("size-3 rounded-full",Y)}),s.jsx("span",{className:"capitalize",children:W.label})]})},W.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 U;e[37]!==l||e[38]!==n||e[39]!==d||e[40]!==F||e[41]!==O?(U=s.jsx(es,{asChild:!0,children:s.jsx("div",{className:"w-fit",children:s.jsxs(Xe,{value:n,onValueChange:d,disabled:l,children:[F,O]})})}),e[37]=l,e[38]=n,e[39]=d,e[40]=F,e[41]=O,e[42]=U):U=e[42];let q;e[43]===Symbol.for("react.memo_cache_sentinel")?(q=s.jsx(ts,{children:s.jsx("p",{children:"The owner role cannot be changed"})}),e[43]=q):q=e[43];let Q;e[44]!==U?(Q=s.jsx(ss,{children:s.jsxs(ns,{children:[U,q]})}),e[44]=U,e[45]=Q):Q=e[45],f=Q;break e}E=Xe,z=n,e[46]!==a||e[47]!==r?(m=d=>r(a,d),e[46]=a,e[47]=r,e[48]=m):m=e[48],c=l,b=et,N=j,y=x,p=tt,v="flex items-center gap-2 min-w-0",R=$e("size-2 rounded-full shrink-0",P)}e[0]=x,e[1]=l,e[2]=a,e[3]=r,e[4]=n,e[5]=i,e[6]=o,e[7]=j,e[8]=p,e[9]=b,e[10]=E,e[11]=R,e[12]=v,e[13]=N,e[14]=y,e[15]=z,e[16]=m,e[17]=c,e[18]=f}else p=e[8],b=e[9],E=e[10],R=e[11],v=e[12],N=e[13],y=e[14],z=e[15],m=e[16],c=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 $;e[57]!==p||e[58]!==A?($=s.jsx(p,{children:A}),e[57]=p,e[58]=A,e[59]=$):$=e[59];let T;e[60]!==b||e[61]!==$||e[62]!==N||e[63]!==y?(T=s.jsx(b,{size:N,className:y,children:$}),e[60]=b,e[61]=$,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:$e("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 M;e[70]!==K?(M=s.jsx(st,{children:K}),e[70]=K,e[71]=M):M=e[71];let k;return e[72]!==E||e[73]!==T||e[74]!==M||e[75]!==z||e[76]!==m||e[77]!==c?(k=s.jsxs(E,{value:z,onValueChange:m,disabled:c,children:[T,M]}),e[72]=E,e[73]=T,e[74]=M,e[75]=z,e[76]=m,e[77]=c,e[78]=k):k=e[78],k}function St(t){const e=J.c(51),{member:n,roles:a,onChangeRole:l,onRemove:i,isUpdating:o}=t,r=o===void 0?!1:o,g=n.role==="owner";let x,j,p,b,E,R,v,N,y;if(e[0]!==g||e[1]!==r||e[2]!==n.id||e[3]!==n.role||e[4]!==l||e[5]!==a){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=a.filter(T);b=It;let M;e[17]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Mt,{size:20}),e[17]=M):M=e[17],e[18]!==g?(y=s.jsx(At,{asChild:!0,children:s.jsx(Pe,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",disabled:g,onClick:Bs,children:M})}),e[18]=g,e[19]=y):y=e[19],p=Et,v="end",N=qs,j=is;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(ms,{size:16}),e[20]=k):k=e[20],e[21]!==r?(R=s.jsxs(as,{disabled:r,children:[k,"Change Role"]}),e[21]=r,e[22]=R):R=e[22],x=ls;let P;e[23]!==r||e[24]!==n.id||e[25]!==l?(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(),l(n.id,d.role)},disabled:r,children:[d.isBuiltin?s.jsx(cs,{size:16}):s.jsx(rs,{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]=r,e[24]=n.id,e[25]=l,e[26]=P):P=e[26],E=K.map(P),e[0]=g,e[1]=r,e[2]=n.id,e[3]=n.role,e[4]=l,e[5]=a,e[6]=x,e[7]=j,e[8]=p,e[9]=b,e[10]=E,e[11]=R,e[12]=v,e[13]=N,e[14]=y}else x=e[6],j=e[7],p=e[8],b=e[9],E=e[10],R=e[11],v=e[12],N=e[13],y=e[14];let z;e[27]!==x||e[28]!==E?(z=s.jsx(x,{children:E}),e[27]=x,e[28]=E,e[29]=z):z=e[29];let m;e[30]!==j||e[31]!==R||e[32]!==z?(m=s.jsxs(j,{children:[R,z]}),e[30]=j,e[31]=R,e[32]=z,e[33]=m):m=e[33];let c;e[34]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(os,{}),e[34]=c):c=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(ds,{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]!==p||e[42]!==w||e[43]!==v||e[44]!==N||e[45]!==m?(A=s.jsxs(p,{align:v,onClick:N,children:[m,c,w]}),e[41]=p,e[42]=w,e[43]=v,e[44]=N,e[45]=m,e[46]=A):A=e[46];let $;return e[47]!==b||e[48]!==A||e[49]!==y?($=s.jsxs(b,{children:[y,A]}),e[47]=b,e[48]=A,e[49]=y,e[50]=$):$=e[50],$}function qs(t){return t.stopPropagation()}function Bs(t){return t.stopPropagation()}function wt(t){const e=J.c(8),{invitationId:n,onCancel:a,isCancelling:l}=t,i=l===void 0?!1:l;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:Vs,children:s.jsx(Mt,{size:20})})}),e[0]=o):o=e[0];let r;e[1]!==n||e[2]!==a?(r=j=>{j.stopPropagation(),a(n)},e[1]=n,e[2]=a,e[3]=r):r=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(Pt,{size:16}),e[4]=g):g=e[4];let x;return e[5]!==i||e[6]!==r?(x=s.jsxs(It,{children:[o,s.jsx(Et,{align:"end",onClick:Ks,children:s.jsxs(it,{variant:"destructive",onClick:r,disabled:i,children:[g,"Cancel Invitation"]})})]}),e[5]=i,e[6]=r,e[7]=x):x=e[7],x}function Ks(t){return t.stopPropagation()}function Vs(t){return t.stopPropagation()}function Us(){const t=J.c(101),{data:e}=Yt(),{data:n}=Ns(),a=Ts(),l=ze(),{locator:i}=me(),o=at(),[r,g]=ce.useState(null),[x,j]=ce.useState(null),[p,b]=ce.useState(""),[E,R]=ce.useState("table"),[v,N]=ce.useState("member"),[y,z]=ce.useState("asc"),m=e?.data?.members;let c;t[0]!==v?(c=u=>{v===u?z(sn):(N(u),z("asc"))},t[0]=v,t[1]=c):c=t[1];const f=c;let I=m??[],w=n??[];if(p){const u=p.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,ue;e:switch(v){case"member":{B=h.user?.name||"",ue=_.user?.name||"";break e}case"role":{B=h.role||"",ue=_.role||"";break e}case"joined":{B=h.createdAt?typeof h.createdAt=="string"?h.createdAt:h.createdAt.toISOString():"",ue=_.createdAt?typeof _.createdAt=="string"?_.createdAt:_.createdAt.toISOString():"";break e}default:return 0}return y==="asc"?B.localeCompare(ue):ue.localeCompare(B)},t[2]=y,t[3]=v,t[4]=u):u=t[4],I=[...I].sort(u)}const A=I;let $;t[5]!==o?($=async u=>{const h=await o.organization.removeMember({memberIdOrEmail:u});if(h?.error)throw new Error(h.error.message)},t[5]=o,t[6]=$):$=t[6];let T;t[7]!==i||t[8]!==l?(T=()=>{fe("member_removed"),l.invalidateQueries({queryKey:ie.members(i)}),G.success("Member has been removed from the organization"),g(null)},t[7]=i,t[8]=l,t[9]=T):T=t[9];let K;t[10]!==$||t[11]!==T?(K={mutationFn:$,onSuccess:T,onError:tn},t[10]=$,t[11]=T,t[12]=K):K=t[12];const M=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]!==l?(P=(u,h)=>{fe("member_role_updated",{new_role:h.role}),l.invalidateQueries({queryKey:ie.members(i)}),G.success("Member's role has been updated")},t[15]=i,t[16]=l,t[17]=P):P=t[17];let d;t[18]!==k||t[19]!==P?(d={mutationFn:k,onSuccess:P,onError:en},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,ue=await o.organization.cancelInvitation({invitationId:h});if(ue?.error)throw new Error(ue.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]!==l?(D=(u,h)=>{fe("invitation_role_updated",{new_role:h.role}),l.invalidateQueries({queryKey:ie.invitations(i)}),G.success("Invitation role has been updated")},t[23]=i,t[24]=l,t[25]=D):D=t[25];let F;t[26]!==L||t[27]!==D?(F={mutationFn:L,onSuccess:D,onError:Xs},t[26]=L,t[27]=D,t[28]=F):F=t[28];const V=pe(F),{roles:O,customRoles:U}=Tt();let q;t[29]!==U?(q=Os(U),t[29]=U,t[30]=q):q=t[30];const Q=q;let H;t[31]!==O?(H=O.filter(Zs),t[31]=O,t[32]=H):H=t[32];const W=H;let Y;t[33]===Symbol.for("react.memo_cache_sentinel")?(Y={id:"member",header:"Member",render:Ys,cellClassName:"flex-1 min-w-0",sortable:!0},t[33]=Y):Y=t[33];let ae;t[34]!==Q||t[35]!==W||t[36]!==V||t[37]!==C?(ae={id:"role",header:"Role",render:u=>u.type==="member"?s.jsx(qe,{role:u.data.role,memberId:u.data.id,isOwner:u.data.role==="owner",roleColorMap:Q,selectableRoles:W,onRoleChange:(h,_)=>C.mutate({memberId:h,role:_}),className:"w-36"}):s.jsx(qe,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:Q,selectableRoles:W,onRoleChange:(h,_)=>V.mutate({invitationId:h,role:_,email:u.data.email}),className:"w-36"}),cellClassName:"w-36 shrink-0",sortable:!0},t[34]=Q,t[35]=W,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:Ws,cellClassName:"w-40 shrink-0"},Z={id:"joined",header:"Joined",render:Hs,cellClassName:"w-48 shrink-0",sortable:!0},t[39]=xe,t[40]=Z):(xe=t[39],Z=t[40]);let le;t[41]!==a.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:g,isUpdating:C.isPending}):s.jsx(wt,{invitationId:u.data.id,onCancel:j,isCancelling:a.cancel.isPending}),cellClassName:"w-12 shrink-0"},t[41]=a.cancel.isPending,t[42]=O,t[43]=C,t[44]=le):le=t[44];let de;t[45]!==ae||t[46]!==le?(de=[Y,ae,xe,Z,le],t[45]=ae,t[46]=le,t[47]=de):de=t[47];const _e=de;let be;t[48]===Symbol.for("react.memo_cache_sentinel")?(be=s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(ws,{trigger:s.jsx(Pe,{children:"Invite Member"})})}),t[48]=be):be=t[48];const Re=be,he=[...A.map(Js),...w.filter(Gs).map(Qs)],oe=Me,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]!==a.cancel||t[53]!==x?(se=()=>{x&&(a.cancel.mutate(x),j(null))},t[52]=a.cancel,t[53]=x,t[54]=se):se=t[54];let S;t[55]!==a.cancel.isPending||t[56]!==se?(S=s.jsxs(dt,{children:[ee,s.jsxs(ut,{children:[te,s.jsx(ft,{onClick:se,disabled:a.cancel.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Cancel Invitation"})]})]}),t[55]=a.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=!!r;let je;t[61]===Symbol.for("react.memo_cache_sentinel")?(je=()=>g(null),t[61]=je):je=t[61];let De;t[62]===Symbol.for("react.memo_cache_sentinel")?(De=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]=De):De=t[62];let ke;t[63]===Symbol.for("react.memo_cache_sentinel")?(ke=s.jsx(xt,{children:"Cancel"}),t[63]=ke):ke=t[63];let ve;t[64]!==r||t[65]!==M?(ve=()=>r&&M.mutate(r),t[64]=r,t[65]=M,t[66]=ve):ve=t[66];let Ce;t[67]!==M.isPending||t[68]!==ve?(Ce=s.jsxs(dt,{children:[De,s.jsxs(ut,{children:[ke,s.jsx(ft,{onClick:ve,disabled:M.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Remove"})]})]}),t[67]=M.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 Qe=Me,Ge=Me,Rt="flex flex-col gap-6";let Se;t[73]===Symbol.for("react.memo_cache_sentinel")?(Se=s.jsx(Me.Title,{children:"Members"}),t[73]=Se):Se=t[73];let Fe;t[74]===Symbol.for("react.memo_cache_sentinel")?(Fe=u=>{u.key==="Escape"&&(b(""),u.target.blur())},t[74]=Fe):Fe=t[74];let we;t[75]!==p?(we=s.jsx(Lt,{value:p,onChange:b,placeholder:"Search members...",className:"w-full md:w-[375px]",onKeyDown:Fe}),t[75]=p,t[76]=we):we=t[76];let Oe;t[77]===Symbol.for("react.memo_cache_sentinel")?(Oe=[{id:"member",label:"Name"},{id:"role",label:"Role"},{id:"joined",label:"Joined"}],t[77]=Oe):Oe=t[77];let Ne;t[78]!==f||t[79]!==y||t[80]!==v||t[81]!==E?(Ne=s.jsx(Ot,{viewMode:E,onViewModeChange:R,sortKey:v,sortDirection:y,onSort:f,sortOptions:Oe}),t[78]=f,t[79]=y,t[80]=v,t[81]=E,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 Je=E==="cards"?s.jsx("div",{children:he.length===0?s.jsx(He,{title:"No members found",description:p?`No members match "${p}"`:"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:a.cancel.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Be,{fallback:Ke(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(Ve,{variant:"outline",className:"w-fit text-amber-600 border-amber-400",children:"Pending"})}),s.jsx(qe,{role:u.data.role,memberId:u.data.id,isOwner:!1,roleColorMap:Q,selectableRoles:W,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:g,isUpdating:C.isPending})}),s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsx(Be,{url:h.user?.image??void 0,fallback:Ke(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(qe,{role:h.role,memberId:h.id,isOwner:h.role==="owner",roleColorMap:Q,selectableRoles:W,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:p?s.jsx(He,{title:"No members found",description:`No members match "${p}"`}):s.jsx(He,{title:"No members found",description:"Invite members to get started."})});let Ie;t[86]!==Se||t[87]!==Te||t[88]!==Je?(Ie=s.jsxs("div",{className:Rt,children:[Se,Te,Je]}),t[86]=Se,t[87]=Te,t[88]=Je,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 Ee;t[93]!==Qe.Content||t[94]!==Ae?(Ee=s.jsx(Qe.Content,{children:Ae}),t[93]=Qe.Content,t[94]=Ae,t[95]=Ee):Ee=t[95];let Le;return t[96]!==oe||t[97]!==ne||t[98]!==ye||t[99]!==Ee?(Le=s.jsxs(oe,{children:[ne,ye,Ee]}),t[96]=oe,t[97]=ne,t[98]=ye,t[99]=Ee,t[100]=Le):Le=t[100],Le}function Qs(t){return{type:"invitation",data:t}}function Gs(t){return t.status==="pending"}function Js(t){return{type:"member",data:t}}function Hs(t){return t.type==="member"?s.jsx("span",{className:"text-sm text-foreground",children:t.data.createdAt?Ls(t.data.createdAt):"N/A"}):s.jsx(Ve,{variant:"outline",children:"Pending"})}function Ws(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 Ys(t){return t.type==="member"?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Be,{url:t.data.user?.image??void 0,fallback:Ke(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(Be,{fallback:Ke(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 Zs(t){return t.role!=="owner"}function Xs(t,e){fe("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 en(t,e){fe("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 tn(t){fe("member_remove_failed",{error:t instanceof Error?t.message:String(t)}),G.error(t instanceof Error?t.message:"Failed to remove member")}function sn(t){return t==="asc"?"desc":t==="desc"?null:"asc"}function nn(){const t=J.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Me,{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(Me,{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(Us,{})})}),t[1]=n):n=t[1],n}function Xn(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Cs,{capability:"members:manage",area:"members",children:s.jsx(nn,{})}),t[0]=e):e=t[0],e}export{Xn as default};
@@ -1,4 +1,4 @@
1
- import{r as c,e as $,j as f,_ as O}from"./index-DC5ykVbq.js";import{l as I,F as K}from"./index-DYMkejmQ.js";import{S as N}from"./spinner-CtVtBijD.js";async function A(t){const e=t.getModel();if(!e)throw new Error("[Monaco] No model found in editor");const r=e.getValue(),i=r.replace(/export default (async )?function/,"export default $1function __default")+`
1
+ import{r as c,e as $,j as f,_ as O}from"./index-D3uqbcw5.js";import{l as I,F as K}from"./index-BnbWlA-z.js";import{S as N}from"./spinner-OhUXCVj7.js";async function A(t){const e=t.getModel();if(!e)throw new Error("[Monaco] No model found in editor");const r=e.getValue(),i=r.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