@decocms/mesh 2.59.2 → 2.59.4

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 (174) hide show
  1. package/dist/client/assets/{AlertCircle--GzH2vta.js → AlertCircle-DcHEglIM.js} +1 -1
  2. package/dist/client/assets/{ArrowLeft-DzpTEYvO.js → ArrowLeft-Dlm4CF9d.js} +1 -1
  3. package/dist/client/assets/{ArrowUp-BfBrilbk.js → ArrowUp-CC-2uYGu.js} +1 -1
  4. package/dist/client/assets/Calendar-PdB3o_9d.js +1 -0
  5. package/dist/client/assets/{Check-CXkamnnr.js → Check-BzMGOxMB.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-DaqG_J6Z.js → ChevronDown-BV0rwdFr.js} +1 -1
  7. package/dist/client/assets/{Code01-BNQVP8-g.js → Code01-KWN4ist8.js} +1 -1
  8. package/dist/client/assets/{Copy01-CpBgXJFP.js → Copy01-DH_iV9-n.js} +1 -1
  9. package/dist/client/assets/{DotsHorizontal-BDAFctKq.js → DotsHorizontal-CFL9xkGv.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-D5MnD2QZ.js → DotsVertical-DOgWrY6o.js} +1 -1
  11. package/dist/client/assets/{Download01-4Tu3o0-K.js → Download01-npnn9kWB.js} +1 -1
  12. package/dist/client/assets/{Edit01-7Ak8JL9W.js → Edit01-CH6U7DHj.js} +1 -1
  13. package/dist/client/assets/File02-Cuc-ZPtg.js +1 -0
  14. package/dist/client/assets/{File06-C7QVLRp6.js → File06-BUwGdOjl.js} +1 -1
  15. package/dist/client/assets/{FilterLines-UNZ5Kk_X.js → FilterLines-ia0H5bBk.js} +1 -1
  16. package/dist/client/assets/{Grid01-C_dMOr-7.js → Grid01-DmaR0g3f.js} +1 -1
  17. package/dist/client/assets/{Home02-Cfg1gm8U.js → Home02-Cagj2miO.js} +1 -1
  18. package/dist/client/assets/{Image01-C6IcS9Ip.js → Image01-BCcbzsoK.js} +1 -1
  19. package/dist/client/assets/{Inbox01-D1IW7Je7.js → Inbox01-DoVQ3gCk.js} +1 -1
  20. package/dist/client/assets/{InfoCircle-Dwuc2RiH.js → InfoCircle-qTETvFXb.js} +1 -1
  21. package/dist/client/assets/{Key01-CrwOIsjX.js → Key01-CHZQ8Cf-.js} +1 -1
  22. package/dist/client/assets/{LinkExternal01-yVEf-2cT.js → LinkExternal01-Cq8yx7fP.js} +1 -1
  23. package/dist/client/assets/{List-d88_8fTd.js → List-DZ53jWcW.js} +1 -1
  24. package/dist/client/assets/{Loading01-Bf56vlFv.js → Loading01-Bo9vDQAp.js} +1 -1
  25. package/dist/client/assets/{Lock01-CQ0bp8OP.js → Lock01-C1QZkjy0.js} +1 -1
  26. package/dist/client/assets/{Pin01-DBKe5RmK.js → Pin01-NWg5BL2M.js} +1 -1
  27. package/dist/client/assets/Play-D2yqwct8.js +1 -0
  28. package/dist/client/assets/{Plus-CcqPpwU0.js → Plus-DAW17Fqf.js} +1 -1
  29. package/dist/client/assets/{SearchMd-Ns-pswyj.js → SearchMd-D9E7kgub.js} +1 -1
  30. package/dist/client/assets/{Share07-B5yrbjwk.js → Share07-CN4FUsWW.js} +1 -1
  31. package/dist/client/assets/{Terminal-qZhwvVsv.js → Terminal-1HZulC_H.js} +1 -1
  32. package/dist/client/assets/Tool01-Ir04gLyn.js +1 -0
  33. package/dist/client/assets/{Trash01-DVYV3BJw.js → Trash01-BUkAP1vf.js} +1 -1
  34. package/dist/client/assets/{Upload01-CCAaxnrW.js → Upload01-DPPzM8Sw.js} +1 -1
  35. package/dist/client/assets/{Users03-CSRHEIl2.js → Users03-DscKVk_U.js} +1 -1
  36. package/dist/client/assets/{X-Dz8JZ2ZX.js → X-DyyqPnhR.js} +1 -1
  37. package/dist/client/assets/{XClose-BhgPfyG3.js → XClose-nvPI0OtD.js} +1 -1
  38. package/dist/client/assets/agent-detail-pV-lC3Zh.js +1 -0
  39. package/dist/client/assets/{agents-4MJAHJGV.js → agents-DepniFRU.js} +1 -1
  40. package/dist/client/assets/{alert-dialog-5t1wq8Xl.js → alert-dialog-QzYPe_ae.js} +3 -3
  41. package/dist/client/assets/{auth-catchall-CTOFzXVU.js → auth-catchall-COlMpx6Y.js} +1 -1
  42. package/dist/client/assets/{avatar-Cx4ORVtq.js → avatar-KkS1NpLz.js} +1 -1
  43. package/dist/client/assets/{badge-DfeUgg96.js → badge-CfH2vrIM.js} +1 -1
  44. package/dist/client/assets/{binder-Dh-m11Sm.js → binder-Cyeq_Zec.js} +1 -1
  45. package/dist/client/assets/{button-C83AQWC1.js → button-D_0RTXDt.js} +1 -1
  46. package/dist/client/assets/{card-CbXWWn3M.js → card-BmOa96dk.js} +1 -1
  47. package/dist/client/assets/{checkbox-DcPieRc5.js → checkbox-CUtYbeQD.js} +1 -1
  48. package/dist/client/assets/{circle-alert-ChrxIBwd.js → circle-alert-BnmazpCh.js} +1 -1
  49. package/dist/client/assets/collapsible-0N2BB6Bm.js +23 -0
  50. package/dist/client/assets/{collection-detail-B_qs3xwg.js → collection-detail-CeAvZaUS.js} +4 -4
  51. package/dist/client/assets/{collection-display-button-DlAEKbje.js → collection-display-button-Cm0zQnM_.js} +1 -1
  52. package/dist/client/assets/{collection-header-Fc9BtUxQ.js → collection-header-CbT_At3k.js} +1 -1
  53. package/dist/client/assets/{collection-page-DvzZtNQd.js → collection-page-CpAhF9Tg.js} +1 -1
  54. package/dist/client/assets/collection-search-DRZ8ScZP.js +1 -0
  55. package/dist/client/assets/{collection-tab-BB_A78nH.js → collection-tab-CyuO9CaU.js} +1 -1
  56. package/dist/client/assets/{collection-table-wrapper-Ch8oh2UW.js → collection-table-wrapper-CspbeKNx.js} +1 -1
  57. package/dist/client/assets/connect-Dx3Myol5.js +1 -0
  58. package/dist/client/assets/{connection-card-BZU7F7-m.js → connection-card-C6VYrDSx.js} +1 -1
  59. package/dist/client/assets/connection-detail-BAO1w9SL.js +1 -0
  60. package/dist/client/assets/{connections-dluTnyJM.js → connections-xwpD87cp.js} +1 -1
  61. package/dist/client/assets/{constants-ytntCGH9.js → constants-D8fdcBr8.js} +1 -1
  62. package/dist/client/assets/constants-rfrR0uMr.js +1 -0
  63. package/dist/client/assets/{create-organization-dialog-GjXRxTaj.js → create-organization-dialog-D96wehG4.js} +1 -1
  64. package/dist/client/assets/{dialog-D_ebnPDF.js → dialog-B-A0vnh-.js} +1 -1
  65. package/dist/client/assets/dropdown-menu-CMmh8IDN.js +1 -0
  66. package/dist/client/assets/{dynamic-plugin-layout-DrCIvG61.js → dynamic-plugin-layout-D5OcFZH0.js} +1 -1
  67. package/dist/client/assets/{empty-state-CxA9hap0.js → empty-state-BS0aVQHO.js} +1 -1
  68. package/dist/client/assets/{empty-state-Cr5g6Vh9.js → empty-state-DKQ_J1zp.js} +1 -1
  69. package/dist/client/assets/{env-vars-editor-DXJo5cdV.js → env-vars-editor-BFfuzqB5.js} +1 -1
  70. package/dist/client/assets/{error-boundary-Dg0Af8BA.js → error-boundary-ynZ9rF8y.js} +1 -1
  71. package/dist/client/assets/{extract-connection-data-BYPMZtVW.js → extract-connection-data-5Dbbyfmc.js} +1 -1
  72. package/dist/client/assets/file-browser-DWYmbjoP.js +2 -0
  73. package/dist/client/assets/{form-BISYEAnP.js → form-DngqlMy0.js} +1 -1
  74. package/dist/client/assets/grid-view-DBdpM4tG.js +1 -0
  75. package/dist/client/assets/home-Dh3O7N9x.js +1 -0
  76. package/dist/client/assets/index-B8BaCPuX.js +25 -0
  77. package/dist/client/assets/index-BWcrkV98.js +1 -0
  78. package/dist/client/assets/index-BtGsFE3_.js +233 -0
  79. package/dist/client/assets/{index-B-pYSGnK.js → index-C_CYTppS.js} +1 -1
  80. package/dist/client/assets/index-CqeIU8-o.css +1 -0
  81. package/dist/client/assets/index-DaiP89U7.js +1 -0
  82. package/dist/client/assets/{index-C8OOnmm1.js → index-Dho9MRVw.js} +2 -2
  83. package/dist/client/assets/{infiniteQueryObserver-B1N6PF-z.js → infiniteQueryObserver-DDmbfPGP.js} +1 -1
  84. package/dist/client/assets/{input-CrR0FEof.js → input-trZWilTG.js} +1 -1
  85. package/dist/client/assets/layout-BZ8_9wgI.js +1 -0
  86. package/dist/client/assets/localstorage-keys-B7V7cQcH.js +1 -0
  87. package/dist/client/assets/{login-BFXWEB6t.js → login-D61ut3BQ.js} +1 -1
  88. package/dist/client/assets/{mcp-oauth-BkqLXiLL.js → mcp-oauth-kjSe-9sd.js} +1 -1
  89. package/dist/client/assets/{mcp-server-card-CkDDvd5o.js → mcp-server-card-DkR0AaJs.js} +1 -1
  90. package/dist/client/assets/{mcp-server-detail-CuItqIIY.js → mcp-server-detail-Bq0lDMH3.js} +2 -2
  91. package/dist/client/assets/members-DqAGtLhZ.js +3 -0
  92. package/dist/client/assets/{monaco-editor-gim9RLZ3.js → monaco-editor-KzPiR_VS.js} +4 -4
  93. package/dist/client/assets/{monitoring-AmN2oTrM.js → monitoring-DkEahA8B.js} +5 -5
  94. package/dist/client/assets/{oauth-callback-BO8hRY4t.js → oauth-callback-C_OPSpWp.js} +1 -1
  95. package/dist/client/assets/page-BQkgsSw9.js +1 -0
  96. package/dist/client/assets/{page-BcZkyr2a.js → page-DWOf0lbq.js} +1 -1
  97. package/dist/client/assets/{pin-to-sidebar-button-DbV8w54G.js → pin-to-sidebar-button-Cdnz6iok.js} +1 -1
  98. package/dist/client/assets/plugin-empty-state-Dr-6CK5g.js +1 -0
  99. package/dist/client/assets/plugin-header-CAC6QLaV.js +1 -0
  100. package/dist/client/assets/plugins-57qT4Dil.js +1 -0
  101. package/dist/client/assets/popover-Bkt9Kfhi.js +1 -0
  102. package/dist/client/assets/{registry-utils-DekIcM3F.js → registry-utils-tiv71gSA.js} +1 -1
  103. package/dist/client/assets/{resizable-V4jINWPU.js → resizable-BdOXbYHL.js} +1 -1
  104. package/dist/client/assets/{resource-tabs-BsRvwnyx.js → resource-tabs-G-U5EIhm.js} +1 -1
  105. package/dist/client/assets/select-reGYS0Ly.js +1 -0
  106. package/dist/client/assets/settings-zvu2qyde.js +1 -0
  107. package/dist/client/assets/shell-layout-C-8OlUFV.js +3 -0
  108. package/dist/client/assets/{spinner-CwfYynNt.js → spinner-E8mBz_Z6.js} +1 -1
  109. package/dist/client/assets/{store-invite-BErtY6PV.js → store-invite-DnYGNBjx.js} +1 -1
  110. package/dist/client/assets/switch-t5mcsF2Z.js +1 -0
  111. package/dist/client/assets/{textarea-DRMuRqUv.js → textarea-x7X_L353.js} +1 -1
  112. package/dist/client/assets/{tools-list-DesNUyav.js → tools-list-DQZuaE9M.js} +1 -1
  113. package/dist/client/assets/tooltip-Cw2xVvTD.js +1 -0
  114. package/dist/client/assets/typewriter-title-BK26jx8M.js +16 -0
  115. package/dist/client/assets/use-binding-BVBmgj67.js +23 -0
  116. package/dist/client/assets/use-collections-CVO4vm4G.js +1 -0
  117. package/dist/client/assets/{use-connection-TLrid9RM.js → use-connection-BU-nKbTz.js} +1 -1
  118. package/dist/client/assets/{use-create-virtual-mcp-Bi6QQFl1.js → use-create-virtual-mcp-Cr2fOp7g.js} +1 -1
  119. package/dist/client/assets/use-deco-chat-open-D-b5da72.js +1 -0
  120. package/dist/client/assets/{use-list-state-DuKw_MMV.js → use-list-state-ClsnlmlI.js} +1 -1
  121. package/dist/client/assets/use-mcp-prompts-B5zcyY9X.js +1 -0
  122. package/dist/client/assets/{use-members-g_5Yt7ve.js → use-members-CVUMGKct.js} +1 -1
  123. package/dist/client/assets/{use-mobile-DQ806XzQ.js → use-mobile-VoJXvE1W.js} +1 -1
  124. package/dist/client/assets/use-organization-settings-CeE0FyqT.js +1 -0
  125. package/dist/client/assets/{use-virtual-mcp-C8lLKpyG.js → use-virtual-mcp-DbjvrtSR.js} +1 -1
  126. package/dist/client/assets/useInfiniteQuery-CVAyTLiO.js +1 -0
  127. package/dist/client/assets/useMutation-Lj_Cbq0P.js +1 -0
  128. package/dist/client/assets/useQuery-C2zqJzGD.js +1 -0
  129. package/dist/client/assets/useSuspenseInfiniteQuery-BS0TxHG_.js +1 -0
  130. package/dist/client/assets/{view-mode-toggle-jPeow5hv.js → view-mode-toggle-BagEO4CJ.js} +1 -1
  131. package/dist/client/assets/{workflow-pPSpZECL.js → workflow-BuhbYm_s.js} +1 -1
  132. package/dist/client/index.html +2 -2
  133. package/dist/server/cli.js +169 -169
  134. package/dist/server/migrate.js +176 -176
  135. package/dist/server/server.js +160 -160
  136. package/package.json +1 -1
  137. package/dist/client/assets/FlipBackward-Cc_OirbM.js +0 -1
  138. package/dist/client/assets/Play-l95VP5u9.js +0 -1
  139. package/dist/client/assets/agent-detail-nBBUtMd0.js +0 -1
  140. package/dist/client/assets/collection-search-bOTNZP0b.js +0 -1
  141. package/dist/client/assets/connect-DYIKCRWy.js +0 -1
  142. package/dist/client/assets/connection-detail-D3-I_W38.js +0 -1
  143. package/dist/client/assets/constants-CnfPGmdA.js +0 -1
  144. package/dist/client/assets/dropdown-menu-CzQCi3DZ.js +0 -1
  145. package/dist/client/assets/file-browser-2RP-n1Xp.js +0 -2
  146. package/dist/client/assets/grid-view-BzgHSliB.js +0 -1
  147. package/dist/client/assets/home-CZ1MSx2E.js +0 -1
  148. package/dist/client/assets/index-CIvJ2wFV.js +0 -255
  149. package/dist/client/assets/index-CmUKmcyS.js +0 -1
  150. package/dist/client/assets/index-HgNYu27A.js +0 -1
  151. package/dist/client/assets/index-c6ju_hIh.js +0 -25
  152. package/dist/client/assets/index-cFLiAqt_.css +0 -1
  153. package/dist/client/assets/layout-BGZtLEwK.js +0 -1
  154. package/dist/client/assets/localstorage-keys-N4jrVxvr.js +0 -1
  155. package/dist/client/assets/members-C3Nvqq2t.js +0 -3
  156. package/dist/client/assets/page-D-IBJ4SW.js +0 -1
  157. package/dist/client/assets/plugin-empty-state-Df2LAyPv.js +0 -1
  158. package/dist/client/assets/plugin-header-e5FObvvx.js +0 -1
  159. package/dist/client/assets/plugins-BOsIh96E.js +0 -1
  160. package/dist/client/assets/popover-B2yKs5LA.js +0 -1
  161. package/dist/client/assets/select-BlFReF6r.js +0 -1
  162. package/dist/client/assets/settings-cRTESMAX.js +0 -1
  163. package/dist/client/assets/shell-layout-BfC0vVyw.js +0 -3
  164. package/dist/client/assets/switch-DjW_2nBx.js +0 -1
  165. package/dist/client/assets/tool-set-selector-Btgo2YwH.js +0 -1
  166. package/dist/client/assets/tooltip-aHeHMhKh.js +0 -1
  167. package/dist/client/assets/typewriter-title-DRU6uRKP.js +0 -16
  168. package/dist/client/assets/use-binding-C2mDgpbB.js +0 -23
  169. package/dist/client/assets/use-collections-CkAaybvR.js +0 -1
  170. package/dist/client/assets/use-mcp-prompts-D5tApqEs.js +0 -1
  171. package/dist/client/assets/use-organization-settings-C-IzAdi1.js +0 -1
  172. package/dist/client/assets/useInfiniteQuery-BUOCgX3w.js +0 -1
  173. package/dist/client/assets/useMutation-C4aXMLv3.js +0 -1
  174. package/dist/client/assets/useQuery-DNOH3p7p.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-browser-2RP-n1Xp.js","assets/useInfiniteQuery-BUOCgX3w.js","assets/infiniteQueryObserver-B1N6PF-z.js","assets/button-C83AQWC1.js","assets/checkbox-DcPieRc5.js","assets/Check-CXkamnnr.js","assets/AlertCircle--GzH2vta.js","assets/Grid01-C_dMOr-7.js","assets/Download01-4Tu3o0-K.js","assets/Home02-Cfg1gm8U.js","assets/List-d88_8fTd.js","assets/Loading01-Bf56vlFv.js","assets/Trash01-DVYV3BJw.js","assets/Upload01-CCAaxnrW.js","assets/useMutation-C4aXMLv3.js","assets/plugin-header-e5FObvvx.js","assets/ChevronDown-DaqG_J6Z.js","assets/login-BFXWEB6t.js","assets/input-CrR0FEof.js","assets/connect-DYIKCRWy.js","assets/useQuery-DNOH3p7p.js","assets/card-CbXWWn3M.js","assets/mcp-oauth-BkqLXiLL.js","assets/circle-alert-ChrxIBwd.js","assets/shell-layout-BfC0vVyw.js","assets/popover-B2yKs5LA.js","assets/badge-DfeUgg96.js","assets/Inbox01-D1IW7Je7.js","assets/XClose-BhgPfyG3.js","assets/error-boundary-Dg0Af8BA.js","assets/File06-C7QVLRp6.js","assets/X-Dz8JZ2ZX.js","assets/use-mobile-DQ806XzQ.js","assets/typewriter-title-DRU6uRKP.js","assets/SearchMd-Ns-pswyj.js","assets/tooltip-aHeHMhKh.js","assets/index-CIvJ2wFV.js","assets/constants-ytntCGH9.js","assets/use-virtual-mcp-C8lLKpyG.js","assets/use-collections-CkAaybvR.js","assets/use-connection-TLrid9RM.js","assets/use-binding-C2mDgpbB.js","assets/binder-Dh-m11Sm.js","assets/monaco-editor-gim9RLZ3.js","assets/spinner-CwfYynNt.js","assets/localstorage-keys-N4jrVxvr.js","assets/select-BlFReF6r.js","assets/Image01-C6IcS9Ip.js","assets/use-mcp-prompts-D5tApqEs.js","assets/dialog-D_ebnPDF.js","assets/form-BISYEAnP.js","assets/empty-state-Cr5g6Vh9.js","assets/ArrowUp-BfBrilbk.js","assets/Edit01-7Ak8JL9W.js","assets/Users03-CSRHEIl2.js","assets/Copy01-CpBgXJFP.js","assets/Terminal-qZhwvVsv.js","assets/generate-id-Dyweu44Y.js","assets/use-create-virtual-mcp-Bi6QQFl1.js","assets/Plus-CcqPpwU0.js","assets/use-organization-settings-C-IzAdi1.js","assets/create-organization-dialog-GjXRxTaj.js","assets/alert-dialog-5t1wq8Xl.js","assets/avatar-Cx4ORVtq.js","assets/dropdown-menu-CzQCi3DZ.js","assets/LinkExternal01-yVEf-2cT.js","assets/switch-DjW_2nBx.js","assets/Code01-BNQVP8-g.js","assets/resizable-V4jINWPU.js","assets/home-CZ1MSx2E.js","assets/page-D-IBJ4SW.js","assets/Pin01-DBKe5RmK.js","assets/Share07-B5yrbjwk.js","assets/members-C3Nvqq2t.js","assets/collection-header-Fc9BtUxQ.js","assets/collection-display-button-DlAEKbje.js","assets/view-mode-toggle-jPeow5hv.js","assets/collection-page-DvzZtNQd.js","assets/collection-search-bOTNZP0b.js","assets/collection-table-wrapper-Ch8oh2UW.js","assets/tool-set-selector-Btgo2YwH.js","assets/ArrowLeft-DzpTEYvO.js","assets/use-members-g_5Yt7ve.js","assets/DotsHorizontal-BDAFctKq.js","assets/Lock01-CQ0bp8OP.js","assets/textarea-DRMuRqUv.js","assets/DotsVertical-D5MnD2QZ.js","assets/Key01-CrwOIsjX.js","assets/connections-dluTnyJM.js","assets/connection-card-BZU7F7-m.js","assets/use-list-state-DuKw_MMV.js","assets/registry-utils-DekIcM3F.js","assets/env-vars-editor-DXJo5cdV.js","assets/settings-cRTESMAX.js","assets/plugins-BOsIh96E.js","assets/monitoring-AmN2oTrM.js","assets/FilterLines-UNZ5Kk_X.js","assets/Play-l95VP5u9.js","assets/index-B-pYSGnK.js","assets/resource-tabs-BsRvwnyx.js","assets/page-BcZkyr2a.js","assets/slugify-CEUa2lfQ.js","assets/mcp-server-card-CkDDvd5o.js","assets/github-icon-Dp3wHhYE.js","assets/mcp-server-detail-CuItqIIY.js","assets/extract-connection-data-BYPMZtVW.js","assets/constants-CnfPGmdA.js","assets/tools-list-DesNUyav.js","assets/layout-BGZtLEwK.js","assets/tools-list-CSRUKxnt.css","assets/InfoCircle-Dwuc2RiH.js","assets/connection-detail-D3-I_W38.js","assets/index-c6ju_hIh.js","assets/pin-to-sidebar-button-DbV8w54G.js","assets/index-CmUKmcyS.js","assets/collection-tab-BB_A78nH.js","assets/empty-state-CxA9hap0.js","assets/collection-detail-B_qs3xwg.js","assets/FlipBackward-Cc_OirbM.js","assets/agents-4MJAHJGV.js","assets/agent-detail-nBBUtMd0.js","assets/workflow-pPSpZECL.js","assets/dynamic-plugin-layout-DrCIvG61.js","assets/oauth-callback-BO8hRY4t.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-browser-DWYmbjoP.js","assets/useInfiniteQuery-CVAyTLiO.js","assets/infiniteQueryObserver-DDmbfPGP.js","assets/button-D_0RTXDt.js","assets/checkbox-CUtYbeQD.js","assets/Check-BzMGOxMB.js","assets/AlertCircle-DcHEglIM.js","assets/Grid01-DmaR0g3f.js","assets/Download01-npnn9kWB.js","assets/File02-Cuc-ZPtg.js","assets/Home02-Cagj2miO.js","assets/List-DZ53jWcW.js","assets/Loading01-Bo9vDQAp.js","assets/Trash01-BUkAP1vf.js","assets/Upload01-DPPzM8Sw.js","assets/useMutation-Lj_Cbq0P.js","assets/plugin-header-CAC6QLaV.js","assets/ChevronDown-BV0rwdFr.js","assets/login-D61ut3BQ.js","assets/input-trZWilTG.js","assets/connect-Dx3Myol5.js","assets/useQuery-C2zqJzGD.js","assets/card-BmOa96dk.js","assets/mcp-oauth-kjSe-9sd.js","assets/circle-alert-BnmazpCh.js","assets/shell-layout-C-8OlUFV.js","assets/index-BtGsFE3_.js","assets/X-DyyqPnhR.js","assets/collapsible-0N2BB6Bm.js","assets/constants-D8fdcBr8.js","assets/use-virtual-mcp-DbjvrtSR.js","assets/use-collections-CVO4vm4G.js","assets/use-connection-BU-nKbTz.js","assets/use-binding-BVBmgj67.js","assets/binder-Cyeq_Zec.js","assets/useSuspenseInfiniteQuery-BS0TxHG_.js","assets/localstorage-keys-B7V7cQcH.js","assets/popover-Bkt9Kfhi.js","assets/select-reGYS0Ly.js","assets/tooltip-Cw2xVvTD.js","assets/File06-BUwGdOjl.js","assets/Image01-BCcbzsoK.js","assets/SearchMd-D9E7kgub.js","assets/spinner-E8mBz_Z6.js","assets/use-mcp-prompts-B5zcyY9X.js","assets/error-boundary-ynZ9rF8y.js","assets/dialog-B-A0vnh-.js","assets/form-DngqlMy0.js","assets/empty-state-DKQ_J1zp.js","assets/ArrowUp-CC-2uYGu.js","assets/Edit01-CH6U7DHj.js","assets/Users03-DscKVk_U.js","assets/Copy01-DH_iV9-n.js","assets/Terminal-1HZulC_H.js","assets/monaco-editor-KzPiR_VS.js","assets/generate-id-Dyweu44Y.js","assets/use-create-virtual-mcp-Cr2fOp7g.js","assets/Plus-DAW17Fqf.js","assets/use-deco-chat-open-D-b5da72.js","assets/typewriter-title-BK26jx8M.js","assets/badge-CfH2vrIM.js","assets/Inbox01-DoVQ3gCk.js","assets/XClose-nvPI0OtD.js","assets/use-mobile-VoJXvE1W.js","assets/use-organization-settings-CeE0FyqT.js","assets/create-organization-dialog-D96wehG4.js","assets/alert-dialog-QzYPe_ae.js","assets/avatar-KkS1NpLz.js","assets/dropdown-menu-CMmh8IDN.js","assets/LinkExternal01-Cq8yx7fP.js","assets/switch-t5mcsF2Z.js","assets/Code01-KWN4ist8.js","assets/resizable-BdOXbYHL.js","assets/home-Dh3O7N9x.js","assets/page-BQkgsSw9.js","assets/Pin01-NWg5BL2M.js","assets/Share07-CN4FUsWW.js","assets/members-DqAGtLhZ.js","assets/collection-header-CbT_At3k.js","assets/collection-display-button-Cm0zQnM_.js","assets/view-mode-toggle-BagEO4CJ.js","assets/collection-page-CpAhF9Tg.js","assets/collection-search-DRZ8ScZP.js","assets/collection-table-wrapper-CspbeKNx.js","assets/ArrowLeft-Dlm4CF9d.js","assets/use-members-CVUMGKct.js","assets/DotsHorizontal-CFL9xkGv.js","assets/Lock01-C1QZkjy0.js","assets/textarea-x7X_L353.js","assets/DotsVertical-DOgWrY6o.js","assets/Key01-CHZQ8Cf-.js","assets/connections-xwpD87cp.js","assets/connection-card-C6VYrDSx.js","assets/use-list-state-ClsnlmlI.js","assets/registry-utils-tiv71gSA.js","assets/env-vars-editor-BFfuzqB5.js","assets/settings-zvu2qyde.js","assets/plugins-57qT4Dil.js","assets/monitoring-DkEahA8B.js","assets/FilterLines-ia0H5bBk.js","assets/Play-D2yqwct8.js","assets/index-C_CYTppS.js","assets/Calendar-PdB3o_9d.js","assets/resource-tabs-G-U5EIhm.js","assets/page-DWOf0lbq.js","assets/slugify-CEUa2lfQ.js","assets/mcp-server-card-DkR0AaJs.js","assets/github-icon-Dp3wHhYE.js","assets/mcp-server-detail-Bq0lDMH3.js","assets/extract-connection-data-5Dbbyfmc.js","assets/constants-rfrR0uMr.js","assets/tools-list-DQZuaE9M.js","assets/layout-BZ8_9wgI.js","assets/tools-list-CSRUKxnt.css","assets/InfoCircle-qTETvFXb.js","assets/connection-detail-BAO1w9SL.js","assets/index-B8BaCPuX.js","assets/pin-to-sidebar-button-Cdnz6iok.js","assets/index-BWcrkV98.js","assets/collection-tab-CyuO9CaU.js","assets/empty-state-BS0aVQHO.js","assets/collection-detail-CeAvZaUS.js","assets/Tool01-Ir04gLyn.js","assets/agents-DepniFRU.js","assets/agent-detail-pV-lC3Zh.js","assets/workflow-BuhbYm_s.js","assets/dynamic-plugin-layout-D5OcFZH0.js","assets/oauth-callback-C_OPSpWp.js"])))=>i.map(i=>d[i]);
2
2
  function DD(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();const LD="modulepreload",jD=function(e){return"/"+e},zR={},ln=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=u?.nonce||u?.getAttribute("nonce");a=l(n.map(f=>{if(f=jD(f),f in zR)return;zR[f]=!0;const m=f.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const g=document.createElement("link");if(g.rel=m?"stylesheet":LD,m||(g.as="script"),g.crossOrigin="",g.href=f,d&&g.setAttribute("nonce",d),document.head.appendChild(g),m)return new Promise((y,S)=>{g.addEventListener("load",y),g.addEventListener("error",()=>S(Error(`Unable to preload CSS for ${f}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return a.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};var Vre=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ka(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var py={exports:{}},hu={};var VR;function $D(){if(VR)return hu;VR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:i}}return hu.Fragment=t,hu.jsx=n,hu.jsxs=n,hu}var FR;function UD(){return FR||(FR=1,py.exports=$D()),py.exports}var x=UD(),my={exports:{}},pu={},gy={exports:{}},vy={};var BR;function zD(){return BR||(BR=1,(function(e){function t(B,W){var Y=B.length;B.push(W);e:for(;0<Y;){var pe=Y-1>>>1,ae=B[pe];if(0<a(ae,W))B[pe]=W,B[Y]=ae,Y=pe;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var W=B[0],Y=B.pop();if(Y!==W){B[0]=Y;e:for(var pe=0,ae=B.length,M=ae>>>1;pe<M;){var q=2*(pe+1)-1,F=B[q],L=q+1,V=B[L];if(0>a(F,Y))L<ae&&0>a(V,F)?(B[pe]=V,B[L]=Y,pe=L):(B[pe]=F,B[q]=Y,pe=q);else if(L<ae&&0>a(V,Y))B[pe]=V,B[L]=Y,pe=L;else break e}}return W}function a(B,W){var Y=B.sortIndex-W.sortIndex;return Y!==0?Y:B.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],m=1,p=null,g=3,y=!1,S=!1,w=!1,b=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function O(B){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=B)r(f),W.sortIndex=W.expirationTime,t(d,W);else break;W=n(f)}}function C(B){if(w=!1,O(B),!S)if(n(d)!==null)S=!0,I||(I=!0,Z());else{var W=n(f);W!==null&&le(C,W.startTime-B)}}var I=!1,N=-1,P=5,U=-1;function G(){return b?!0:!(e.unstable_now()-U<P)}function z(){if(b=!1,I){var B=e.unstable_now();U=B;var W=!0;try{e:{S=!1,w&&(w=!1,R(N),N=-1),y=!0;var Y=g;try{t:{for(O(B),p=n(d);p!==null&&!(p.expirationTime>B&&G());){var pe=p.callback;if(typeof pe=="function"){p.callback=null,g=p.priorityLevel;var ae=pe(p.expirationTime<=B);if(B=e.unstable_now(),typeof ae=="function"){p.callback=ae,O(B),W=!0;break t}p===n(d)&&r(d),O(B)}else r(d);p=n(d)}if(p!==null)W=!0;else{var M=n(f);M!==null&&le(C,M.startTime-B),W=!1}}break e}finally{p=null,g=Y,y=!1}W=void 0}}finally{W?Z():I=!1}}}var Z;if(typeof T=="function")Z=function(){T(z)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,X=$.port2;$.port1.onmessage=z,Z=function(){X.postMessage(null)}}else Z=function(){E(z,0)};function le(B,W){N=E(function(){B(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var W=3;break;default:W=g}var Y=g;g=W;try{return B()}finally{g=Y}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(B,W){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var Y=g;g=B;try{return W()}finally{g=Y}},e.unstable_scheduleCallback=function(B,W,Y){var pe=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?pe+Y:pe):Y=pe,B){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=Y+ae,B={id:m++,callback:W,priorityLevel:B,startTime:Y,expirationTime:ae,sortIndex:-1},Y>pe?(B.sortIndex=Y,t(f,B),n(d)===null&&B===n(f)&&(w?(R(N),N=-1):w=!0,le(C,Y-pe))):(B.sortIndex=ae,t(d,B),S||y||(S=!0,I||(I=!0,Z()))),B},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(B){var W=g;return function(){var Y=g;g=W;try{return B.apply(this,arguments)}finally{g=Y}}}})(vy)),vy}var qR;function VD(){return qR||(qR=1,gy.exports=zD()),gy.exports}var yy={exports:{}},et={};var HR;function FD(){if(HR)return et;HR=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,b={};function E(M,q,F){this.props=M,this.context=q,this.refs=b,this.updater=F||S}E.prototype.isReactComponent={},E.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},E.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function R(){}R.prototype=E.prototype;function T(M,q,F){this.props=M,this.context=q,this.refs=b,this.updater=F||S}var O=T.prototype=new R;O.constructor=T,w(O,E.prototype),O.isPureReactComponent=!0;var C=Array.isArray;function I(){}var N={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function U(M,q,F){var L=F.ref;return{$$typeof:e,type:M,key:q,ref:L!==void 0?L:null,props:F}}function G(M,q){return U(M.type,q,M.props)}function z(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function Z(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(F){return q[F]})}var $=/\/+/g;function X(M,q){return typeof M=="object"&&M!==null&&M.key!=null?Z(""+M.key):q.toString(36)}function le(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(I,I):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function B(M,q,F,L,V){var J=typeof M;(J==="undefined"||J==="boolean")&&(M=null);var de=!1;if(M===null)de=!0;else switch(J){case"bigint":case"string":case"number":de=!0;break;case"object":switch(M.$$typeof){case e:case t:de=!0;break;case m:return de=M._init,B(de(M._payload),q,F,L,V)}}if(de)return V=V(M),de=L===""?"."+X(M,0):L,C(V)?(F="",de!=null&&(F=de.replace($,"$&/")+"/"),B(V,q,F,"",function(Ae){return Ae})):V!=null&&(z(V)&&(V=G(V,F+(V.key==null||M&&M.key===V.key?"":(""+V.key).replace($,"$&/")+"/")+de)),q.push(V)),1;de=0;var ve=L===""?".":L+":";if(C(M))for(var Ie=0;Ie<M.length;Ie++)L=M[Ie],J=ve+X(L,Ie),de+=B(L,q,F,J,V);else if(Ie=y(M),typeof Ie=="function")for(M=Ie.call(M),Ie=0;!(L=M.next()).done;)L=L.value,J=ve+X(L,Ie++),de+=B(L,q,F,J,V);else if(J==="object"){if(typeof M.then=="function")return B(le(M),q,F,L,V);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return de}function W(M,q,F){if(M==null)return M;var L=[],V=0;return B(M,L,"","",function(J){return q.call(F,J,V++)}),L}function Y(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(F){(M._status===0||M._status===-1)&&(M._status=1,M._result=F)},function(F){(M._status===0||M._status===-1)&&(M._status=2,M._result=F)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var pe=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},ae={map:W,forEach:function(M,q,F){W(M,function(){q.apply(this,arguments)},F)},count:function(M){var q=0;return W(M,function(){q++}),q},toArray:function(M){return W(M,function(q){return q})||[]},only:function(M){if(!z(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return et.Activity=p,et.Children=ae,et.Component=E,et.Fragment=n,et.Profiler=a,et.PureComponent=T,et.StrictMode=r,et.Suspense=d,et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,et.__COMPILER_RUNTIME={__proto__:null,c:function(M){return N.H.useMemoCache(M)}},et.cache=function(M){return function(){return M.apply(null,arguments)}},et.cacheSignal=function(){return null},et.cloneElement=function(M,q,F){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var L=w({},M.props),V=M.key;if(q!=null)for(J in q.key!==void 0&&(V=""+q.key),q)!P.call(q,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&q.ref===void 0||(L[J]=q[J]);var J=arguments.length-2;if(J===1)L.children=F;else if(1<J){for(var de=Array(J),ve=0;ve<J;ve++)de[ve]=arguments[ve+2];L.children=de}return U(M.type,V,L)},et.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:i,_context:M},M},et.createElement=function(M,q,F){var L,V={},J=null;if(q!=null)for(L in q.key!==void 0&&(J=""+q.key),q)P.call(q,L)&&L!=="key"&&L!=="__self"&&L!=="__source"&&(V[L]=q[L]);var de=arguments.length-2;if(de===1)V.children=F;else if(1<de){for(var ve=Array(de),Ie=0;Ie<de;Ie++)ve[Ie]=arguments[Ie+2];V.children=ve}if(M&&M.defaultProps)for(L in de=M.defaultProps,de)V[L]===void 0&&(V[L]=de[L]);return U(M,J,V)},et.createRef=function(){return{current:null}},et.forwardRef=function(M){return{$$typeof:u,render:M}},et.isValidElement=z,et.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:Y}},et.memo=function(M,q){return{$$typeof:f,type:M,compare:q===void 0?null:q}},et.startTransition=function(M){var q=N.T,F={};N.T=F;try{var L=M(),V=N.S;V!==null&&V(F,L),typeof L=="object"&&L!==null&&typeof L.then=="function"&&L.then(I,pe)}catch(J){pe(J)}finally{q!==null&&F.types!==null&&(q.types=F.types),N.T=q}},et.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},et.use=function(M){return N.H.use(M)},et.useActionState=function(M,q,F){return N.H.useActionState(M,q,F)},et.useCallback=function(M,q){return N.H.useCallback(M,q)},et.useContext=function(M){return N.H.useContext(M)},et.useDebugValue=function(){},et.useDeferredValue=function(M,q){return N.H.useDeferredValue(M,q)},et.useEffect=function(M,q){return N.H.useEffect(M,q)},et.useEffectEvent=function(M){return N.H.useEffectEvent(M)},et.useId=function(){return N.H.useId()},et.useImperativeHandle=function(M,q,F){return N.H.useImperativeHandle(M,q,F)},et.useInsertionEffect=function(M,q){return N.H.useInsertionEffect(M,q)},et.useLayoutEffect=function(M,q){return N.H.useLayoutEffect(M,q)},et.useMemo=function(M,q){return N.H.useMemo(M,q)},et.useOptimistic=function(M,q){return N.H.useOptimistic(M,q)},et.useReducer=function(M,q,F){return N.H.useReducer(M,q,F)},et.useRef=function(M){return N.H.useRef(M)},et.useState=function(M){return N.H.useState(M)},et.useSyncExternalStore=function(M,q,F){return N.H.useSyncExternalStore(M,q,F)},et.useTransition=function(){return N.H.useTransition()},et.version="19.2.4",et}var GR;function Zs(){return GR||(GR=1,yy.exports=FD()),yy.exports}var _y={exports:{}},fr={};var ZR;function BD(){if(ZR)return fr;ZR=1;var e=Zs();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)f+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(d,f,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:p==null?null:""+p,children:d,containerInfo:f,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return fr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,fr.createPortal=function(d,f){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return i(d,f,null,m)},fr.flushSync=function(d){var f=l.T,m=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=m,r.d.f()}},fr.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},fr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},fr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;m==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:y}):m==="script"&&r.d.X(d,{crossOrigin:p,integrity:g,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},fr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var m=u(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},fr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var m=f.as,p=u(m,f.crossOrigin);r.d.L(d,m,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},fr.preloadModule=function(d,f){if(typeof d=="string")if(f){var m=u(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},fr.requestFormReset=function(d){r.d.r(d)},fr.unstable_batchedUpdates=function(d,f){return d(f)},fr.useFormState=function(d,f,m){return l.H.useFormState(d,f,m)},fr.useFormStatus=function(){return l.H.useHostTransitionStatus()},fr.version="19.2.4",fr}var KR;function UC(){if(KR)return _y.exports;KR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),_y.exports=BD(),_y.exports}var WR;function qD(){if(WR)return pu;WR=1;var e=VD(),t=Zs(),n=UC();function r(o){var s="https://react.dev/errors/"+o;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+o+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var s=o,c=o;if(o.alternate)for(;s.return;)s=s.return;else{o=s;do s=o,(s.flags&4098)!==0&&(c=s.return),o=s.return;while(o)}return s.tag===3?c:null}function l(o){if(o.tag===13){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function u(o){if(o.tag===31){var s=o.memoizedState;if(s===null&&(o=o.alternate,o!==null&&(s=o.memoizedState)),s!==null)return s.dehydrated}return null}function d(o){if(i(o)!==o)throw Error(r(188))}function f(o){var s=o.alternate;if(!s){if(s=i(o),s===null)throw Error(r(188));return s!==o?null:o}for(var c=o,h=s;;){var v=c.return;if(v===null)break;var _=v.alternate;if(_===null){if(h=v.return,h!==null){c=h;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===c)return d(v),o;if(_===h)return d(v),s;_=_.sibling}throw Error(r(188))}if(c.return!==h.return)c=v,h=_;else{for(var k=!1,j=v.child;j;){if(j===c){k=!0,c=v,h=_;break}if(j===h){k=!0,h=v,c=_;break}j=j.sibling}if(!k){for(j=_.child;j;){if(j===c){k=!0,c=_,h=v;break}if(j===h){k=!0,h=_,c=v;break}j=j.sibling}if(!k)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?o:s}function m(o){var s=o.tag;if(s===5||s===26||s===27||s===6)return o;for(o=o.child;o!==null;){if(s=m(o),s!==null)return s;o=o.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function Z(o){return o===null||typeof o!="object"?null:(o=z&&o[z]||o["@@iterator"],typeof o=="function"?o:null)}var $=Symbol.for("react.client.reference");function X(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===$?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case w:return"Fragment";case E:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case I:return"SuspenseList";case U:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case S:return"Portal";case T:return o.displayName||"Context";case R:return(o._context.displayName||"Context")+".Consumer";case O:var s=o.render;return o=o.displayName,o||(o=s.displayName||s.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case N:return s=o.displayName||null,s!==null?s:X(o.type)||"Memo";case P:s=o._payload,o=o._init;try{return X(o(s))}catch{}}return null}var le=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},pe=[],ae=-1;function M(o){return{current:o}}function q(o){0>ae||(o.current=pe[ae],pe[ae]=null,ae--)}function F(o,s){ae++,pe[ae]=o.current,o.current=s}var L=M(null),V=M(null),J=M(null),de=M(null);function ve(o,s){switch(F(J,s),F(V,o),F(L,null),s.nodeType){case 9:case 11:o=(o=s.documentElement)&&(o=o.namespaceURI)?cR(o):0;break;default:if(o=s.tagName,s=s.namespaceURI)s=cR(s),o=uR(s,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}q(L),F(L,o)}function Ie(){q(L),q(V),q(J)}function Ae(o){o.memoizedState!==null&&F(de,o);var s=L.current,c=uR(s,o.type);s!==c&&(F(V,o),F(L,c))}function H(o){V.current===o&&(q(L),q(V)),de.current===o&&(q(de),cu._currentValue=Y)}var ne,_e;function se(o){if(ne===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);ne=s&&s[1]||"",_e=-1<c.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+ne+o+_e}var ue=!1;function Oe(o,s){if(!o||ue)return"";ue=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var Te=function(){throw Error()};if(Object.defineProperty(Te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Te,[])}catch(ge){var me=ge}Reflect.construct(o,[],Te)}else{try{Te.call()}catch(ge){me=ge}o.call(Te.prototype)}}else{try{throw Error()}catch(ge){me=ge}(Te=o())&&typeof Te.catch=="function"&&Te.catch(function(){})}}catch(ge){if(ge&&me&&typeof ge.stack=="string")return[ge.stack,me.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),k=_[0],j=_[1];if(k&&j){var Q=k.split(`
@@ -171,4 +171,4 @@ ${r}
171
171
  `;break;case"id":u=b.includes("\0")?void 0:b;break;case"retry":/^\d+$/.test(b)?r(parseInt(b,10)):n(new pC(`Invalid \`retry\` value: "${b}"`,{type:"invalid-retry",value:b,line:E}));break;default:n(new pC(`Unknown field "${w.length>20?`${w.slice(0,20)}…`:w}"`,{type:"unknown-field",field:w,value:b,line:E}));break}}function y(){d.length>0&&t({id:u,event:f||void 0,data:d.endsWith(`
172
172
  `)?d.slice(0,-1):d}),u=void 0,d="",f=""}function S(w={}){i&&w.consume&&p(i),l=!0,u=void 0,d="",f="",i=""}return{feed:m,reset:S}}function Bee(e){const t=[];let n="",r=0;for(;r<e.length;){const a=e.indexOf("\r",r),i=e.indexOf(`
173
173
  `,r);let l=-1;if(a!==-1&&i!==-1?l=Math.min(a,i):a!==-1?a===e.length-1?l=-1:l=a:i!==-1&&(l=i),l===-1){n=e.slice(r);break}else{const u=e.slice(r,l);t.push(u),r=l+1,e[r-1]==="\r"&&e[r]===`
174
- `&&r++}}return[t,n]}class mC extends Event{constructor(t,n){var r,a;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(a=n?.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(gC(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(gC(this),n)}}function qee(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function D_(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(D_).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${D_(e.cause)}`:e.message:`${e}`}function gC(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var lP=e=>{throw TypeError(e)},q1=(e,t,n)=>t.has(e)||lP("Cannot "+n),yt=(e,t,n)=>(q1(e,t,"read from private field"),n?n.call(e):t.get(e)),zn=(e,t,n)=>t.has(e)?lP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),an=(e,t,n,r)=>(q1(e,t,"write to private field"),t.set(e,n),n),qa=(e,t,n)=>(q1(e,t,"access private method"),n),Ur,Ri,ql,Sp,cm,Zu,Ql,Ku,Ms,Hl,oc,Gl,Du,jo,L_,j_,$_,vC,U_,z_,Lu,V_,F_;class Ep extends EventTarget{constructor(t,n){var r,a;super(),zn(this,jo),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,zn(this,Ur),zn(this,Ri),zn(this,ql),zn(this,Sp),zn(this,cm),zn(this,Zu),zn(this,Ql),zn(this,Ku,null),zn(this,Ms),zn(this,Hl),zn(this,oc,null),zn(this,Gl,null),zn(this,Du,null),zn(this,j_,async i=>{var l;yt(this,Hl).reset();const{body:u,redirected:d,status:f,headers:m}=i;if(f===204){qa(this,jo,Lu).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?an(this,ql,new URL(i.url)):an(this,ql,void 0),f!==200){qa(this,jo,Lu).call(this,`Non-200 status code (${f})`,f);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){qa(this,jo,Lu).call(this,'Invalid content type, expected "text/event-stream"',f);return}if(yt(this,Ur)===this.CLOSED)return;an(this,Ur,this.OPEN);const p=new Event("open");if((l=yt(this,Du))==null||l.call(this,p),this.dispatchEvent(p),typeof u!="object"||!u||!("getReader"in u)){qa(this,jo,Lu).call(this,"Invalid response body, expected a web ReadableStream",f),this.close();return}const g=new TextDecoder,y=u.getReader();let S=!0;do{const{done:w,value:b}=await y.read();b&&yt(this,Hl).feed(g.decode(b,{stream:!w})),w&&(S=!1,yt(this,Hl).reset(),qa(this,jo,V_).call(this))}while(S)}),zn(this,$_,i=>{an(this,Ms,void 0),!(i.name==="AbortError"||i.type==="aborted")&&qa(this,jo,V_).call(this,D_(i))}),zn(this,U_,i=>{typeof i.id=="string"&&an(this,Ku,i.id);const l=new MessageEvent(i.event||"message",{data:i.data,origin:yt(this,ql)?yt(this,ql).origin:yt(this,Ri).origin,lastEventId:i.id||""});yt(this,Gl)&&(!i.event||i.event==="message")&&yt(this,Gl).call(this,l),this.dispatchEvent(l)}),zn(this,z_,i=>{an(this,Zu,i)}),zn(this,F_,()=>{an(this,Ql,void 0),yt(this,Ur)===this.CONNECTING&&qa(this,jo,L_).call(this)});try{if(t instanceof URL)an(this,Ri,t);else if(typeof t=="string")an(this,Ri,new URL(t,Hee()));else throw new Error("Invalid URL")}catch{throw qee("An invalid or illegal string was specified")}an(this,Hl,iP({onEvent:yt(this,U_),onRetry:yt(this,z_)})),an(this,Ur,this.CONNECTING),an(this,Zu,3e3),an(this,cm,(r=n?.fetch)!=null?r:globalThis.fetch),an(this,Sp,(a=n?.withCredentials)!=null?a:!1),qa(this,jo,L_).call(this)}get readyState(){return yt(this,Ur)}get url(){return yt(this,Ri).href}get withCredentials(){return yt(this,Sp)}get onerror(){return yt(this,oc)}set onerror(t){an(this,oc,t)}get onmessage(){return yt(this,Gl)}set onmessage(t){an(this,Gl,t)}get onopen(){return yt(this,Du)}set onopen(t){an(this,Du,t)}addEventListener(t,n,r){const a=n;super.addEventListener(t,a,r)}removeEventListener(t,n,r){const a=n;super.removeEventListener(t,a,r)}close(){yt(this,Ql)&&clearTimeout(yt(this,Ql)),yt(this,Ur)!==this.CLOSED&&(yt(this,Ms)&&yt(this,Ms).abort(),an(this,Ur,this.CLOSED),an(this,Ms,void 0))}}Ur=new WeakMap,Ri=new WeakMap,ql=new WeakMap,Sp=new WeakMap,cm=new WeakMap,Zu=new WeakMap,Ql=new WeakMap,Ku=new WeakMap,Ms=new WeakMap,Hl=new WeakMap,oc=new WeakMap,Gl=new WeakMap,Du=new WeakMap,jo=new WeakSet,L_=function(){an(this,Ur,this.CONNECTING),an(this,Ms,new AbortController),yt(this,cm)(yt(this,Ri),qa(this,jo,vC).call(this)).then(yt(this,j_)).catch(yt(this,$_))},j_=new WeakMap,$_=new WeakMap,vC=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...yt(this,Ku)?{"Last-Event-ID":yt(this,Ku)}:void 0},cache:"no-store",signal:(e=yt(this,Ms))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},U_=new WeakMap,z_=new WeakMap,Lu=function(e,t){var n;yt(this,Ur)!==this.CLOSED&&an(this,Ur,this.CLOSED);const r=new mC("error",{code:t,message:e});(n=yt(this,oc))==null||n.call(this,r),this.dispatchEvent(r)},V_=function(e,t){var n;if(yt(this,Ur)===this.CLOSED)return;an(this,Ur,this.CONNECTING);const r=new mC("error",{code:t,message:e});(n=yt(this,oc))==null||n.call(this,r),this.dispatchEvent(r),an(this,Ql,setTimeout(yt(this,F_),yt(this,Zu)))},F_=new WeakMap,Ep.CONNECTING=0,Ep.OPEN=1,Ep.CLOSED=2;function Hee(){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}function um(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function cP(e=fetch,t){return t?async(n,r)=>{const a={...t,...r,headers:r?.headers?{...um(t.headers),...um(r.headers)}:t.headers};return e(n,a)}:e}let H1;H1=globalThis.crypto;async function Gee(e){return(await H1).getRandomValues(new Uint8Array(e))}async function Zee(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const a=await Gee(e-r.length);for(const i of a)i<n&&(r+=t[i%t.length])}return r}async function Kee(e){return await Zee(e)}async function Wee(e){const t=await(await H1).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Yee(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await Kee(e),n=await Wee(t);return{code_verifier:t,code_challenge:n}}const rr=w7().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:dz.custom,message:"URL must be parseable",fatal:!0}),R$}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Qee=ar({resource:D().url(),authorization_servers:we(rr).optional(),jwks_uri:D().url().optional(),scopes_supported:we(D()).optional(),bearer_methods_supported:we(D()).optional(),resource_signing_alg_values_supported:we(D()).optional(),resource_name:D().optional(),resource_documentation:D().optional(),resource_policy_uri:D().url().optional(),resource_tos_uri:D().url().optional(),tls_client_certificate_bound_access_tokens:ut().optional(),authorization_details_types_supported:we(D()).optional(),dpop_signing_alg_values_supported:we(D()).optional(),dpop_bound_access_tokens_required:ut().optional()}),uP=ar({issuer:D(),authorization_endpoint:rr,token_endpoint:rr,registration_endpoint:rr.optional(),scopes_supported:we(D()).optional(),response_types_supported:we(D()),response_modes_supported:we(D()).optional(),grant_types_supported:we(D()).optional(),token_endpoint_auth_methods_supported:we(D()).optional(),token_endpoint_auth_signing_alg_values_supported:we(D()).optional(),service_documentation:rr.optional(),revocation_endpoint:rr.optional(),revocation_endpoint_auth_methods_supported:we(D()).optional(),revocation_endpoint_auth_signing_alg_values_supported:we(D()).optional(),introspection_endpoint:D().optional(),introspection_endpoint_auth_methods_supported:we(D()).optional(),introspection_endpoint_auth_signing_alg_values_supported:we(D()).optional(),code_challenge_methods_supported:we(D()).optional(),client_id_metadata_document_supported:ut().optional()}),Xee=ar({issuer:D(),authorization_endpoint:rr,token_endpoint:rr,userinfo_endpoint:rr.optional(),jwks_uri:rr,registration_endpoint:rr.optional(),scopes_supported:we(D()).optional(),response_types_supported:we(D()),response_modes_supported:we(D()).optional(),grant_types_supported:we(D()).optional(),acr_values_supported:we(D()).optional(),subject_types_supported:we(D()),id_token_signing_alg_values_supported:we(D()),id_token_encryption_alg_values_supported:we(D()).optional(),id_token_encryption_enc_values_supported:we(D()).optional(),userinfo_signing_alg_values_supported:we(D()).optional(),userinfo_encryption_alg_values_supported:we(D()).optional(),userinfo_encryption_enc_values_supported:we(D()).optional(),request_object_signing_alg_values_supported:we(D()).optional(),request_object_encryption_alg_values_supported:we(D()).optional(),request_object_encryption_enc_values_supported:we(D()).optional(),token_endpoint_auth_methods_supported:we(D()).optional(),token_endpoint_auth_signing_alg_values_supported:we(D()).optional(),display_values_supported:we(D()).optional(),claim_types_supported:we(D()).optional(),claims_supported:we(D()).optional(),service_documentation:D().optional(),claims_locales_supported:we(D()).optional(),ui_locales_supported:we(D()).optional(),claims_parameter_supported:ut().optional(),request_parameter_supported:ut().optional(),request_uri_parameter_supported:ut().optional(),require_request_uri_registration:ut().optional(),op_policy_uri:rr.optional(),op_tos_uri:rr.optional(),client_id_metadata_document_supported:ut().optional()}),Jee=ce({...Xee.shape,...uP.pick({code_challenge_methods_supported:!0}).shape}),ete=ce({access_token:D(),id_token:D().optional(),token_type:D(),expires_in:JI().optional(),scope:D().optional(),refresh_token:D().optional()}).strip(),tte=ce({error:D(),error_description:D().optional(),error_uri:D().optional()}),yC=rr.optional().or(je("").transform(()=>{})),nte=ce({redirect_uris:we(rr),token_endpoint_auth_method:D().optional(),grant_types:we(D()).optional(),response_types:we(D()).optional(),client_name:D().optional(),client_uri:rr.optional(),logo_uri:yC,scope:D().optional(),contacts:we(D()).optional(),tos_uri:yC,policy_uri:D().optional(),jwks_uri:rr.optional(),jwks:eo().optional(),software_id:D().optional(),software_version:D().optional(),software_statement:D().optional()}).strip(),rte=ce({client_id:D(),client_secret:D().optional(),client_id_issued_at:Ze().optional(),client_secret_expires_at:Ze().optional()}).strip(),ote=nte.merge(rte);ce({error:D(),error_description:D().optional()}).strip();ce({token:D(),token_type_hint:D().optional()}).strip();function ate(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function ste({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class Wn extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class B_ extends Wn{}B_.errorCode="invalid_request";class dm extends Wn{}dm.errorCode="invalid_client";class fm extends Wn{}fm.errorCode="invalid_grant";class hm extends Wn{}hm.errorCode="unauthorized_client";class q_ extends Wn{}q_.errorCode="unsupported_grant_type";class H_ extends Wn{}H_.errorCode="invalid_scope";class G_ extends Wn{}G_.errorCode="access_denied";class hc extends Wn{}hc.errorCode="server_error";class Z_ extends Wn{}Z_.errorCode="temporarily_unavailable";class K_ extends Wn{}K_.errorCode="unsupported_response_type";class W_ extends Wn{}W_.errorCode="unsupported_token_type";class Y_ extends Wn{}Y_.errorCode="invalid_token";class Q_ extends Wn{}Q_.errorCode="method_not_allowed";class X_ extends Wn{}X_.errorCode="too_many_requests";class pm extends Wn{}pm.errorCode="invalid_client_metadata";class J_ extends Wn{}J_.errorCode="insufficient_scope";class eb extends Wn{}eb.errorCode="invalid_target";const ite={[B_.errorCode]:B_,[dm.errorCode]:dm,[fm.errorCode]:fm,[hm.errorCode]:hm,[q_.errorCode]:q_,[H_.errorCode]:H_,[G_.errorCode]:G_,[hc.errorCode]:hc,[Z_.errorCode]:Z_,[K_.errorCode]:K_,[W_.errorCode]:W_,[Y_.errorCode]:Y_,[Q_.errorCode]:Q_,[X_.errorCode]:X_,[pm.errorCode]:pm,[J_.errorCode]:J_,[eb.errorCode]:eb};class Uo extends Error{constructor(t){super(t??"Unauthorized")}}function lte(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const $0="code",U0="S256";function cte(e,t){const n=e.client_secret!==void 0;return t.length===0?n?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&lte(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function ute(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":dte(a,i,n);return;case"client_secret_post":fte(a,i,r);return;case"none":hte(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function dte(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function fte(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function hte(e,t){t.set("client_id",e)}async function dP(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=tte.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:l}=r,u=ite[a]||hc;return new u(i||"",l)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new hc(a)}}async function Ci(e,t){try{return await z0(e,t)}catch(n){if(n instanceof dm||n instanceof hm)return await e.invalidateCredentials?.("all"),await z0(e,t);if(n instanceof fm)return await e.invalidateCredentials?.("tokens"),await z0(e,t);throw n}}async function z0(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){let l,u;try{l=await gte(t,{resourceMetadataUrl:a},i),l.authorization_servers&&l.authorization_servers.length>0&&(u=l.authorization_servers[0])}catch{}u||(u=new URL("/",t));const d=await mte(t,e,l),f=await wte(u,{fetchFn:i});let m=await Promise.resolve(e.clientInformation());if(!m){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const b=f?.client_id_metadata_document_supported===!0,E=e.clientMetadataUrl;if(E&&!pte(E))throw new pm(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${E}`);if(b&&E)m={client_id:E},await e.saveClientInformation?.(m);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const T=await xte(u,{metadata:f,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(T),m=T}}const p=!e.redirectUrl;if(n!==void 0||p){const b=await Rte(e,u,{metadata:f,resource:d,authorizationCode:n,fetchFn:i});return await e.saveTokens(b),"AUTHORIZED"}const g=await e.tokens();if(g?.refresh_token)try{const b=await Ete(u,{metadata:f,clientInformation:m,refreshToken:g.refresh_token,resource:d,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(b),"AUTHORIZED"}catch(b){if(!(!(b instanceof Wn)||b instanceof hc))throw b}const y=e.state?await e.state():void 0,{authorizationUrl:S,codeVerifier:w}=await Ste(u,{metadata:f,clientInformation:m,state:y,redirectUrl:e.redirectUrl,scope:r||l?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:d});return await e.saveCodeVerifier(w),await e.redirectToAuthorization(S),"REDIRECT"}function pte(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function mte(e,t,n){const r=ate(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!ste({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function mm(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=V0(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const l=V0(e,"scope")||void 0,u=V0(e,"error")||void 0;return{resourceMetadataUrl:i,scope:l,error:u}}function V0(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function gte(e,t,n=fetch){const r=await _te(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Qee.parse(await r.json())}async function G1(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?G1(e,void 0,n):void 0;throw r}}function vte(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function _C(e,t,n=fetch){return await G1(e,{"MCP-Protocol-Version":t},n)}function yte(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function _te(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??Ym;let l;if(r?.metadataUrl)l=new URL(r.metadataUrl);else{const d=vte(t,a.pathname);l=new URL(d,r?.metadataServerUrl??a),l.search=a.search}let u=await _C(l,i,n);if(!r?.metadataUrl&&yte(u,a.pathname)){const d=new URL(`/.well-known/${t}`,a);u=await _C(d,i,n)}return u}function bte(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function wte(e,{fetchFn:t=fetch,protocolVersion:n=Ym}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=bte(e);for(const{url:i,type:l}of a){const u=await G1(i,r,t);if(u){if(!u.ok){if(await u.body?.cancel(),u.status>=400&&u.status<500)continue;throw new Error(`HTTP ${u.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return l==="oauth"?uP.parse(await u.json()):Jee.parse(await u.json())}}}async function Ste(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:l}){let u;if(t){if(u=new URL(t.authorization_endpoint),!t.response_types_supported.includes($0))throw new Error(`Incompatible auth server: does not support response type ${$0}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(U0))throw new Error(`Incompatible auth server: does not support code challenge method ${U0}`)}else u=new URL("/authorize",e);const d=await Yee(),f=d.code_verifier,m=d.code_challenge;return u.searchParams.set("response_type",$0),u.searchParams.set("client_id",n.client_id),u.searchParams.set("code_challenge",m),u.searchParams.set("code_challenge_method",U0),u.searchParams.set("redirect_uri",String(r)),i&&u.searchParams.set("state",i),a&&u.searchParams.set("scope",a),a?.includes("offline_access")&&u.searchParams.append("prompt","consent"),l&&u.searchParams.set("resource",l.href),{authorizationUrl:u,codeVerifier:f}}function fP(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function Z1(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:l}){const u=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),d=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(d,n,u,t);else if(r){const m=t?.token_endpoint_auth_methods_supported??[],p=cte(r,m);ute(p,r,d,n)}const f=await(l??fetch)(u,{method:"POST",headers:d,body:n});if(!f.ok)throw await dP(f);return ete.parse(await f.json())}async function moe(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:l,addClientAuthentication:u,fetchFn:d}){const f=fP(r,a,i);return Z1(e,{metadata:t,tokenRequestParams:f,clientInformation:n,addClientAuthentication:u,resource:l,fetchFn:d})}async function Ete(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:l}){const u=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),d=await Z1(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:l});return{refresh_token:r,...d}}async function Rte(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const l=e.clientMetadata.scope;let u;if(e.prepareTokenRequest&&(u=await e.prepareTokenRequest(l)),!u){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const f=await e.codeVerifier();u=fP(a,f,e.redirectUrl)}const d=await e.clientInformation();return Z1(t,{metadata:n,tokenRequestParams:u,clientInformation:d??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function xte(e,{metadata:t,clientMetadata:n,fetchFn:r}){let a;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");a=new URL(t.registration_endpoint)}else a=new URL("/register",e);const i=await(r??fetch)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw await dP(i);return ote.parse(await i.json())}class Tte extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class Ote{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=cP(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new Uo("No auth provider");let t;try{t=await Ci(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 Uo;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=um(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 Ep(this._url.href,{...this._eventSourceInit,fetch:async(a,i)=>{const l=await this._commonHeaders();l.set("Accept","text/event-stream");const u=await t(a,{...i,headers:l});if(u.status===401&&u.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:f}=mm(u);this._resourceMetadataUrl=d,this._scope=f}return u}}),this._abortController=new AbortController,this._eventSource.onerror=a=>{if(a.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const i=new Tte(a.code,a.message,a);r(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",a=>{const i=a;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(l){r(l),this.onerror?.(l),this.close();return}n()}),this._eventSource.onmessage=a=>{const i=a;let l;try{l=Gu.parse(JSON.parse(i.data))}catch(u){this.onerror?.(u);return}this.onmessage?.(l)}})}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 Uo("No auth provider");if(await Ci(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Uo("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},a=await(this._fetch??fetch)(this._endpoint,r);if(!a.ok){const i=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){const{resourceMetadataUrl:l,scope:u}=mm(a);if(this._resourceMetadataUrl=l,this._scope=u,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Uo;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${a.status}): ${i}`)}await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const Cte="mcp";class Ate{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,Cte),this._socket.onerror=r=>{const a="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(a),this.onerror?.(a)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let a;try{a=Gu.parse(JSON.parse(r.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(a)}})}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 Ite extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let a;super({start(i){a=iP({onEvent:l=>{i.enqueue(l)},onError(l){t==="terminate"?i.error(l):typeof t=="function"&&t(l)},onRetry:n,onComment:r})},transform(i){a.feed(i)}})}}const Nte={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Vl extends Error{constructor(t,n){super(`Streamable HTTP error: ${n}`),this.code=t}}let kte=class{constructor(t,n){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=cP(n?.fetch,n?.requestInit),this._sessionId=n?.sessionId,this._reconnectionOptions=n?.reconnectionOptions??Nte}async _authThenStart(){if(!this._authProvider)throw new Uo("No auth provider");let t;try{t=await Ci(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 Uo;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=um(this._requestInit?.headers);return new Headers({...t,...n})}async _startOrAuthSse(t){const{resumptionToken:n}=t;try{const r=await this._commonHeaders();r.set("Accept","text/event-stream"),n&&r.set("last-event-id",n);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:r,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Vl(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,t,!0)}catch(r){throw this.onerror?.(r),r}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const n=this._reconnectionOptions.initialReconnectionDelay,r=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(n*Math.pow(r,t),a)}_scheduleReconnection(t,n=0){const r=this._reconnectionOptions.maxRetries;if(n>=r){this.onerror?.(new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const a=this._getNextReconnectionDelay(n);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,n+1)})},a)}_handleSseStream(t,n,r){if(!t)return;const{onresumptiontoken:a,replayMessageId:i}=n;let l,u=!1,d=!1;(async()=>{try{const m=t.pipeThrough(new TextDecoderStream).pipeThrough(new Ite({onRetry:y=>{this._serverRetryMs=y}})).getReader();for(;;){const{value:y,done:S}=await m.read();if(S)break;if(y.id&&(l=y.id,u=!0,a?.(y.id)),!!y.data&&(!y.event||y.event==="message"))try{const w=Gu.parse(JSON.parse(y.data));Pu(w)&&(d=!0,i!==void 0&&(w.id=i)),this.onmessage?.(w)}catch(w){this.onerror?.(w)}}(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(m){if(this.onerror?.(new Error(`SSE stream disconnected: ${m}`)),(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(y){this.onerror?.(new Error(`Failed to reconnect: ${y instanceof Error?y.message:String(y)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new Uo("No auth provider");if(await Ci(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Uo("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,n){try{const{resumptionToken:r,onresumptiontoken:a}=n||{};if(r){this._startOrAuthSse({resumptionToken:r,replayMessageId:P_(t)?t.id:void 0}).catch(g=>this.onerror?.(g));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const l={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},u=await(this._fetch??fetch)(this._url,l),d=u.headers.get("mcp-session-id");if(d&&(this._sessionId=d),!u.ok){const g=await u.text().catch(()=>null);if(u.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Vl(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:y,scope:S}=mm(u);if(this._resourceMetadataUrl=y,this._scope=S,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Uo;return this._hasCompletedAuthFlow=!0,this.send(t)}if(u.status===403&&this._authProvider){const{resourceMetadataUrl:y,scope:S,error:w}=mm(u);if(w==="insufficient_scope"){const b=u.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===b)throw new Vl(403,"Server returned 403 after trying upscoping");if(S&&(this._scope=S),y&&(this._resourceMetadataUrl=y),this._lastUpscopingHeader=b??void 0,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new Uo;return this.send(t)}}throw new Vl(u.status,`Error POSTing to endpoint: ${g}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,u.status===202){await u.body?.cancel(),lX(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(g=>this.onerror?.(g));return}const m=(Array.isArray(t)?t:[t]).filter(g=>"method"in g&&"id"in g&&g.id!==void 0).length>0,p=u.headers.get("content-type");if(m)if(p?.includes("text/event-stream"))this._handleSseStream(u.body,{onresumptiontoken:a},!1);else if(p?.includes("application/json")){const g=await u.json(),y=Array.isArray(g)?g.map(S=>Gu.parse(S)):[Gu.parse(g)];for(const S of y)this.onmessage?.(S)}else throw await u.body?.cancel(),new Vl(-1,`Unexpected content type: ${p}`);else await u.body?.cancel()}catch(r){throw this.onerror?.(r),r}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const t=await this._commonHeaders(),n={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},r=await(this._fetch??fetch)(this._url,n);if(await r.body?.cancel(),!r.ok&&r.status!==405)throw new Vl(r.status,`Failed to terminate session: ${r.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,n){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:n?.onresumptiontoken})}};class Mte extends kte{constructor(t,n){super(t,n)}send(t,n){const r=Pte(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function Pte(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 Dte extends sP{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},z1,n)}}const Lte=async(e,t,n)=>{const r=jte(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const a=new Dte({name:e?.name??"MCP Client",version:"1.0.0"});return await a.connect(r),{client:a,callStreamableTool:(i,l,u)=>{if(e.connection.type!=="HTTP")throw new Error("HTTP connection required");const d=new Headers(n);d.has("Authorization")||d.set("Authorization",`Bearer ${e.connection.token}`);for(const[p,g]of Object.entries(e.connection.headers??{}))d.set(p,g);const f=new URL(e.connection.url),m=f.pathname.replace(/\/+$/,"")||"/";return f.pathname=`${m}/call-tool/${encodeURIComponent(i)}`,fetch(f.href,{method:"POST",redirect:"manual",body:JSON.stringify(l),headers:d,signal:u})}}},jte=(e,t,n)=>{if(e.type==="Websocket")return new Ate(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const a={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const i={requestInit:{headers:a,signal:t}};return e.token&&(i.eventSourceInit={fetch:(l,u)=>fetch(l,{...u,headers:{...a,Accept:"text/event-stream"},signal:t})}),new Ote(new URL(e.url),i)}return new Mte(new URL(e.url),{requestInit:{headers:a,signal:t,credentials:"include"}})},$te=e=>{try{return JSON.parse(e)}catch{return e}},up=new Map,bC=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?mr(e.inputSchema):void 0,outputSchema:e.outputSchema?mr(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function Ute(e){const t=n=>"connection"in e?Lte({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 u;async function a(d,f=r){const m=e?.debugId?.(),p=m?{"x-trace-debug-id":m}:void 0,{client:g,callStreamableTool:y}=await t(p);if(e?.streamable?.[String(f)])return y(String(f),d);const{structuredContent:S,isError:w,content:b}=await g.callTool({name:String(f),arguments:d});if(w){const E=b?.[0]?.text,R=typeof E=="string"?$te(E):null,T=R?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(R.code,R.message,R.traceId):null;throw T||new Error(`Tool ${String(f)} returned an error: ${JSON.stringify(S??b)}`)}return S}async function i(){const{client:d}=await t(),{tools:f}=await d.listTools();return f}async function l(){if(!("connection"in e))return i();const d=e.connection,f=JSON.stringify(d);try{return up.has(f)||up.set(f,i()),await up.get(f)}catch(m){console.error("Failed to list tools",m),up.delete(f);return}}async function u(){return(await l()??[]).map(f=>bC(f,a))}return a.asTool=async()=>{const f=(await l()??[]).find(m=>m.name===r);if(!f)throw new Error(`Tool ${r} not found`);return bC(f,a)},a}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>zte({connection:n}):global[t]}});function zte(e){return Ute(e)}const Vte=ce({id:D().describe("Unique identifier for the entity"),title:D().describe("Human-readable title for the entity"),description:D().nullish().describe("Description of the entity"),created_at:D().datetime(),updated_at:D().datetime(),created_by:D().optional(),updated_by:D().optional()}),Fte=ce({field:we(D()),operator:$t(["eq","gt","gte","lt","lte","in","like","contains"]),value:St()}),hP=pa(()=>Lt([Fte,ce({operator:$t(["and","or","not"]),conditions:we(hP)})])),Bte=ce({field:we(D()),direction:$t(["asc","desc"]),nulls:$t(["first","last"]).optional()}),qte=ce({where:hP.optional().describe("Filter expression"),orderBy:we(Bte).optional().describe("Sort expressions"),limit:Ze().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:Ze().int().min(0).optional().describe("Number of items to skip")});function Hte(e){return ce({items:we(e).describe("Array of collection items"),totalCount:Ze().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:ut().optional().describe("Whether there are more items available")})}const Gte=ce({id:D().describe("ID of the entity to retrieve")});function Zte(e){return ce({item:e.nullable().describe("The retrieved item, or null if not found")})}function Kte(e){return ce({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function Wte(e){return ce({item:e.describe("The created entity with generated id")})}function Yte(e){return ce({id:D().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function Qte(e){return ce({item:e.describe("The updated entity")})}const Xte=ce({id:D().describe("ID of the entity to delete")});function Jte(e){return ce({item:e.describe("The deleted entity")})}function ene(e,t,n){const r=e.toUpperCase(),a=n?.readOnly??!1,i=[{name:`COLLECTION_${r}_LIST`,inputSchema:qte,outputSchema:Hte(t)},{name:`COLLECTION_${r}_GET`,inputSchema:Gte,outputSchema:Zte(t)}];return a||i.push({name:`COLLECTION_${r}_CREATE`,inputSchema:Kte(t),outputSchema:Wte(t),opt:!0},{name:`COLLECTION_${r}_UPDATE`,inputSchema:Yte(t),outputSchema:Qte(t),opt:!0},{name:`COLLECTION_${r}_DELETE`,inputSchema:Xte,outputSchema:Jte(t),opt:!0}),i}const tne=ce({id:D(),name:D(),description:D().optional(),inputSchema:xt(D(),St()),outputSchema:xt(D(),St()).optional()}),nne=Vte.extend({_meta:ce({"io.decocms":ce({id:D(),verified:ut(),scopeName:D(),appName:D(),friendlyName:D().nullable().optional(),metadata:xt(D(),St()).nullable().optional(),publishedAt:D().datetime().optional(),updatedAt:D().datetime().optional(),tools:we(tne).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:ce({$schema:D().optional(),_meta:xt(D(),St()).optional(),name:D().describe("The server name (scope/app)"),title:D().optional().describe("User-friendly title"),description:D().optional().describe("Server description"),icons:we(ce({src:D(),mimeType:D().optional(),sizes:we(D()).optional(),theme:$t(["light","dark"]).optional()})).optional(),remotes:we(ce({type:$t(["http","stdio","sse"]),url:D().optional(),headers:we(St()).optional()})).optional(),packages:we(St()).optional(),repository:ce({url:D(),source:D().optional(),subfolder:D().optional()}).optional(),version:D().optional(),websiteUrl:D().optional()})});ene("registry_app",nne,{readOnly:!0});const rne=ce({specversion:je("1.0").describe("CloudEvents specification version"),id:D().describe("Unique identifier for this event (UUID recommended)"),source:D().describe("Connection ID of the event publisher"),type:D().describe("Event type (e.g., 'order.created', 'user.signup')"),time:D().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:D().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:D().optional().default("application/json").describe("Content type of the data attribute"),dataschema:D().url().optional().describe("URI to the schema for the data attribute"),data:St().optional().describe("Event payload (any JSON value)")});ce({events:we(rne).min(1).describe("Batch of CloudEvents to process")});const one=ce({success:ut().optional().describe("Whether this event was processed successfully"),error:D().optional().describe("Error message for this event"),retryAfter:Ze().int().positive().optional().describe("Re-deliver this event after this many ms")});ce({success:ut().optional().describe("Batch success - applies to events not in results"),error:D().optional().describe("Batch error message - applies to events not in results"),processedCount:Ze().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:Ze().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:xt(D(),one).optional().describe("Per-event results keyed by event ID")});ce({type:D().min(1).max(255).describe("Event type identifier"),subject:D().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:St().optional().describe("Event payload"),deliverAt:D().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:D().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")});ce({id:D().describe("Unique event ID"),type:D().describe("Event type"),source:D().describe("Source connection ID"),time:D().describe("Event timestamp")});ce({eventType:D().min(1).max(255).describe("Event type to subscribe to"),publisher:D().optional().describe("Filter events by publisher connection ID"),filter:D().max(1e3).optional().describe("JSONPath filter expression on event data")});ce({subscription:ce({id:D().describe("Subscription ID"),connectionId:D().describe("Subscriber connection ID"),eventType:D().describe("Event type pattern"),publisher:D().nullable().describe("Publisher connection filter"),filter:D().nullable().describe("JSONPath filter expression"),enabled:ut().describe("Whether subscription is enabled"),createdAt:D().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:D().datetime().describe("Updated timestamp (ISO 8601)")})});const ane=ce({eventType:D().min(1).max(255).describe("Event type to subscribe to"),publisher:D().optional().describe("Filter events by publisher connection ID"),filter:D().max(1e3).optional().describe("JSONPath filter expression on event data")}),sne=ce({id:D().describe("Subscription ID"),connectionId:D().describe("Subscriber connection ID"),eventType:D().describe("Event type pattern"),publisher:D().nullable().describe("Publisher connection filter"),filter:D().nullable().describe("JSONPath filter expression"),enabled:ut().describe("Whether subscription is enabled"),createdAt:D().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:D().datetime().describe("Updated timestamp (ISO 8601)")});ce({subscriptions:we(ane).describe("Desired subscriptions - system will create/update/delete to match")});ce({created:Ze().int().min(0).describe("Number of subscriptions created"),updated:Ze().int().min(0).describe("Number of subscriptions with filter updated"),deleted:Ze().int().min(0).describe("Number of subscriptions removed"),unchanged:Ze().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:we(sne).describe("Current subscriptions after sync")});ce({subscriptionId:D().describe("Subscription ID to remove")});ce({success:ut().describe("Whether unsubscribe was successful"),subscriptionId:D().describe("Subscription ID that was removed")});ce({eventId:D().describe("Event ID to cancel")});ce({success:ut().describe("Whether cancellation was successful"),eventId:D().describe("Event ID that was cancelled")});ce({eventId:D().describe("Event ID to acknowledge")});ce({success:ut().describe("Whether ACK was successful"),eventId:D().describe("Event ID that was acknowledged")});const ine=ce({prefix:D().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:Ze().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:D().optional().describe("Token for pagination from previous response"),delimiter:D().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")}),lne=ce({objects:we(ce({key:D().describe("Object key/path"),size:Ze().describe("Object size in bytes"),lastModified:D().describe("Last modified timestamp"),etag:D().describe("Entity tag for the object")})),nextContinuationToken:D().optional().describe("Token for fetching next page of results"),isTruncated:ut().describe("Whether there are more results available"),commonPrefixes:we(D()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")}),cne=ce({key:D().describe("Object key/path to get metadata for")}),une=ce({contentType:D().optional().describe("MIME type of the object"),contentLength:Ze().describe("Size of the object in bytes"),lastModified:D().describe("Last modified timestamp"),etag:D().describe("Entity tag for the object"),metadata:xt(D(),D()).optional().describe("Custom metadata key-value pairs")}),dne=ce({key:D().describe("Object key/path to generate URL for"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)")}),fne=ce({url:D().describe("Presigned URL for downloading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),hne=ce({key:D().describe("Object key/path for the upload"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:D().optional().describe("MIME type for the object being uploaded")}),pne=ce({url:D().describe("Presigned URL for uploading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),mne=ce({key:D().describe("Object key/path to delete")}),gne=ce({success:ut().describe("Whether the deletion was successful"),key:D().describe("The key that was deleted")}),vne=ce({keys:we(D()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")}),yne=ce({deleted:we(D()).describe("Array of successfully deleted keys"),errors:we(ce({key:D(),message:D()})).describe("Array of errors for failed deletions")}),_ne=[{name:"LIST_OBJECTS",inputSchema:ine,outputSchema:lne},{name:"GET_OBJECT_METADATA",inputSchema:cne,outputSchema:une},{name:"GET_PRESIGNED_URL",inputSchema:dne,outputSchema:fne},{name:"PUT_PRESIGNED_URL",inputSchema:hne,outputSchema:pne},{name:"DELETE_OBJECT",inputSchema:mne,outputSchema:gne},{name:"DELETE_OBJECTS",inputSchema:vne,outputSchema:yne}],pP=({size:e=24,color:t="currentColor",...n})=>A.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},A.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Z"}));pP.displayName="Folder";function wC(e,t,n){return e?e.startsWith("/")?`/${t}/${n}${e}`:e:`/${t}/${n}`}function bne(e){return{createRoutes:e,useParams:t=>Xl({strict:!1}),useSearch:t=>xm({strict:!1}),useNavigate:()=>{const t=yc(),{org:n,pluginId:r}=Xl({strict:!1});return a=>{const i=wC(a.to,n,r);return t({...a,to:i,params:{org:n,pluginId:r,...a.params}})}},useLocation:()=>pL(),Link:function(n){const{org:r,pluginId:a}=Xl({strict:!1}),i=wC(n.to,r,a);return x.jsx(Om,{...n,to:i,params:{org:r,pluginId:a,...n.params}})},_types:{routes:void 0,routeIds:void 0}}}const mP=A.createContext(null);function voe(e){const t=Ui.c(3),{value:n,children:r}=e,a=n;let i;return t[0]!==r||t[1]!==a?(i=x.jsx(mP.Provider,{value:a,children:r}),t[0]=r,t[1]=a,t[2]=i):i=t[2],i}function yoe(e){const t=A.useContext(mP);if(!t)throw new Error("usePluginContext must be used within a PluginContextProvider");if(!t.connectionId||!t.connection||!t.toolCaller)throw new Error("usePluginContext requires a valid connection. Use { partial: true } in empty state components.");return t}var Mt;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const l of a)i[l]=l;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),l={};for(const u of i)l[u]=a[u];return e.objectValues(l)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&i.push(l);return i},e.find=(a,i)=>{for(const l of a)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Mt||(Mt={}));var SC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(SC||(SC={}));const Ve=Mt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ns=e=>{switch(typeof e){case"undefined":return Ve.undefined;case"string":return Ve.string;case"number":return Number.isNaN(e)?Ve.nan:Ve.number;case"boolean":return Ve.boolean;case"function":return Ve.function;case"bigint":return Ve.bigint;case"symbol":return Ve.symbol;case"object":return Array.isArray(e)?Ve.array:e===null?Ve.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ve.promise:typeof Map<"u"&&e instanceof Map?Ve.map:typeof Set<"u"&&e instanceof Set?Ve.set:typeof Date<"u"&&e instanceof Date?Ve.date:Ve.object;default:return Ve.unknown}},Ne=Mt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Za extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let u=r,d=0;for(;d<l.path.length;){const f=l.path[d];d===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(l))):u[f]=u[f]||{_errors:[]},u=u[f],d++}}};return a(this),r}static assert(t){if(!(t instanceof Za))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Mt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Za.create=e=>new Za(e);const tb=(e,t)=>{let n;switch(e.code){case Ne.invalid_type:e.received===Ve.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Mt.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${Mt.joinValues(e.keys,", ")}`;break;case Ne.invalid_union:n="Invalid input";break;case Ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Mt.joinValues(e.options)}`;break;case Ne.invalid_enum_value:n=`Invalid enum value. Expected ${Mt.joinValues(e.options)}, received '${e.received}'`;break;case Ne.invalid_arguments:n="Invalid function arguments";break;case Ne.invalid_return_type:n="Invalid function return type";break;case Ne.invalid_date:n="Invalid date";break;case Ne.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Mt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ne.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ne.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ne.custom:n="Invalid input";break;case Ne.invalid_intersection_types:n="Intersection results could not be merged";break;case Ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,Mt.assertNever(e)}return{message:n}};let wne=tb;function Sne(){return wne}const Ene=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],l={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let u="";const d=r.filter(f=>!!f).slice().reverse();for(const f of d)u=f(l,{data:t,defaultError:u}).message;return{...a,path:i,message:u}};function De(e,t){const n=Sne(),r=Ene({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===tb?void 0:tb].filter(a=>!!a)});e.common.issues.push(r)}class oo{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return tt;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,l=await a.value;r.push({key:i,value:l})}return oo.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:l}=a;if(i.status==="aborted"||l.status==="aborted")return tt;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(r[i.value]=l.value)}return{status:t.value,value:r}}}const tt=Object.freeze({status:"aborted"}),ju=e=>({status:"dirty",value:e}),Co=e=>({status:"valid",value:e}),EC=e=>e.status==="aborted",RC=e=>e.status==="dirty",pc=e=>e.status==="valid",gm=e=>typeof Promise<"u"&&e instanceof Promise;var Ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ge||(Ge={}));class Hs{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const xC=(e,t)=>{if(pc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Za(e.common.issues);return this._error=n,this._error}}};function mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(l,u)=>{const{message:d}=e;return l.code==="invalid_enum_value"?{message:d??u.defaultError}:typeof u.data>"u"?{message:d??r??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:d??n??u.defaultError}},description:a}}class Ot{get description(){return this._def.description}_getType(t){return Ns(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ns(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new oo,ctx:{common:t.parent.common,data:t.data,parsedType:Ns(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(gm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ns(t)},a=this._parseSync({data:t,path:r.path,parent:r});return xC(r,a)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ns(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return pc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>pc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ns(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(gm(a)?a:Promise.resolve(a));return xC(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const l=t(a),u=()=>i.addIssue({code:Ne.custom,...r(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new gc({schema:this,typeName:nt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Vs.create(this,this._def)}nullable(){return vc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return da.create(this)}promise(){return bm.create(this,this._def)}or(t){return ym.create([this,t],this._def)}and(t){return _m.create(this,t,this._def)}transform(t){return new gc({...mt(this._def),schema:this,typeName:nt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ob({...mt(this._def),innerType:this,defaultValue:n,typeName:nt.ZodDefault})}brand(){return new Gne({typeName:nt.ZodBranded,type:this,...mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new ab({...mt(this._def),innerType:this,catchValue:n,typeName:nt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return K1.create(this,t)}readonly(){return sb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Rne=/^c[^\s-]{8,}$/i,xne=/^[0-9a-z]+$/,Tne=/^[0-9A-HJKMNP-TV-Z]{26}$/i,One=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Cne=/^[a-z0-9_-]{21}$/i,Ane=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ine=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Nne=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kne="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let F0;const Mne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Dne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Lne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jne=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$ne=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Une=new RegExp(`^${gP}$`);function vP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function zne(e){return new RegExp(`^${vP(e)}$`)}function Vne(e){let t=`${gP}T${vP(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Fne(e,t){return!!((t==="v4"||!t)&&Mne.test(e)||(t==="v6"||!t)&&Dne.test(e))}function Bne(e,t){if(!Ane.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function qne(e,t){return!!((t==="v4"||!t)&&Pne.test(e)||(t==="v6"||!t)&&Lne.test(e))}class Ds extends Ot{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ve.string){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.string,received:i.parsedType}),tt}const r=new oo;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,u=t.data.length<i.value;(l||u)&&(a=this._getOrReturnCtx(t,a),l?De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Nne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"email",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")F0||(F0=new RegExp(kne,"u")),F0.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"emoji",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")One.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"uuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Cne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"nanoid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Rne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")xne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid2",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Tne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ulid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),De(a,{validation:"url",code:Ne.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"regex",code:Ne.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Vne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Une.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?zne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Ine.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"duration",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Fne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ip",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Bne(t.data,i.alg)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"jwt",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?qne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cidr",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?jne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?$ne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64url",code:Ne.invalid_string,message:i.message}),r.dirty()):Mt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:Ne.invalid_string,...Ge.errToObj(r)})}_addCheck(t){return new Ds({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ge.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ge.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ge.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ge.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ge.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ge.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ge.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ge.errToObj(n)})}nonempty(t){return this.min(1,Ge.errToObj(t))}trim(){return new Ds({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ds({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ds({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ds.create=e=>new Ds({checks:[],typeName:nt.ZodString,coerce:e?.coerce??!1,...mt(e)});function Hne(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(e.toFixed(a).replace(".","")),l=Number.parseInt(t.toFixed(a).replace(".",""));return i%l/10**a}class dd extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ve.number){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.number,received:i.parsedType}),tt}let r;const a=new oo;for(const i of this._def.checks)i.kind==="int"?Mt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Hne(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_finite,message:i.message}),a.dirty()):Mt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new dd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new dd({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Mt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}dd.create=e=>new dd({checks:[],typeName:nt.ZodNumber,coerce:e?.coerce||!1,...mt(e)});class fd extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ve.bigint)return this._getInvalidInput(t);let r;const a=new oo;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Mt.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Ve.bigint,received:n.parsedType}),tt}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new fd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new fd({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}fd.create=e=>new fd({checks:[],typeName:nt.ZodBigInt,coerce:e?.coerce??!1,...mt(e)});class nb extends Ot{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ve.boolean){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.boolean,received:r.parsedType}),tt}return Co(t.data)}}nb.create=e=>new nb({typeName:nt.ZodBoolean,coerce:e?.coerce||!1,...mt(e)});class vm extends Ot{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ve.date){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.date,received:i.parsedType}),tt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_date}),tt}const r=new oo;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Mt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new vm({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ge.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ge.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}vm.create=e=>new vm({checks:[],coerce:e?.coerce||!1,typeName:nt.ZodDate,...mt(e)});class TC extends Ot{_parse(t){if(this._getType(t)!==Ve.symbol){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.symbol,received:r.parsedType}),tt}return Co(t.data)}}TC.create=e=>new TC({typeName:nt.ZodSymbol,...mt(e)});class OC extends Ot{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.undefined,received:r.parsedType}),tt}return Co(t.data)}}OC.create=e=>new OC({typeName:nt.ZodUndefined,...mt(e)});class CC extends Ot{_parse(t){if(this._getType(t)!==Ve.null){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.null,received:r.parsedType}),tt}return Co(t.data)}}CC.create=e=>new CC({typeName:nt.ZodNull,...mt(e)});class AC extends Ot{constructor(){super(...arguments),this._any=!0}_parse(t){return Co(t.data)}}AC.create=e=>new AC({typeName:nt.ZodAny,...mt(e)});class IC extends Ot{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Co(t.data)}}IC.create=e=>new IC({typeName:nt.ZodUnknown,...mt(e)});class Gs extends Ot{_parse(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Ve.never,received:n.parsedType}),tt}}Gs.create=e=>new Gs({typeName:nt.ZodNever,...mt(e)});class NC extends Ot{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.void,received:r.parsedType}),tt}return Co(t.data)}}NC.create=e=>new NC({typeName:nt.ZodVoid,...mt(e)});class da extends Ot{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Ve.array)return De(n,{code:Ne.invalid_type,expected:Ve.array,received:n.parsedType}),tt;if(a.exactLength!==null){const l=n.data.length>a.exactLength.value,u=n.data.length<a.exactLength.value;(l||u)&&(De(n,{code:l?Ne.too_big:Ne.too_small,minimum:u?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(De(n,{code:Ne.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(De(n,{code:Ne.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>a.type._parseAsync(new Hs(n,l,n.path,u)))).then(l=>oo.mergeArray(r,l));const i=[...n.data].map((l,u)=>a.type._parseSync(new Hs(n,l,n.path,u)));return oo.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new da({...this._def,minLength:{value:t,message:Ge.toString(n)}})}max(t,n){return new da({...this._def,maxLength:{value:t,message:Ge.toString(n)}})}length(t,n){return new da({...this._def,exactLength:{value:t,message:Ge.toString(n)}})}nonempty(t){return this.min(1,t)}}da.create=(e,t)=>new da({type:e,minLength:null,maxLength:null,exactLength:null,typeName:nt.ZodArray,...mt(t)});function Zl(e){if(e instanceof Pn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Vs.create(Zl(r))}return new Pn({...e._def,shape:()=>t})}else return e instanceof da?new da({...e._def,type:Zl(e.element)}):e instanceof Vs?Vs.create(Zl(e.unwrap())):e instanceof vc?vc.create(Zl(e.unwrap())):e instanceof $i?$i.create(e.items.map(t=>Zl(t))):e}class Pn extends Ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Mt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ve.object){const f=this._getOrReturnCtx(t);return De(f,{code:Ne.invalid_type,expected:Ve.object,received:f.parsedType}),tt}const{status:r,ctx:a}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof Gs&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||u.push(f);const d=[];for(const f of l){const m=i[f],p=a.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new Hs(a,p,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof Gs){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)d.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(f==="strict")u.length>0&&(De(a,{code:Ne.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const p=a.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new Hs(a,p,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of d){const p=await m.key,g=await m.value;f.push({key:p,value:g,alwaysSet:m.alwaysSet})}return f}).then(f=>oo.mergeObjectSync(r,f)):oo.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Ge.errToObj,new Pn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const a=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Ge.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Pn({...this._def,unknownKeys:"strip"})}passthrough(){return new Pn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Pn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Pn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:nt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Pn({...this._def,catchall:t})}pick(t){const n={};for(const r of Mt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Pn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Mt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Pn({...this._def,shape:()=>n})}deepPartial(){return Zl(this)}partial(t){const n={};for(const r of Mt.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Pn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Mt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Vs;)i=i._def.innerType;n[r]=i}return new Pn({...this._def,shape:()=>n})}keyof(){return yP(Mt.objectKeys(this.shape))}}Pn.create=(e,t)=>new Pn({shape:()=>e,unknownKeys:"strip",catchall:Gs.create(),typeName:nt.ZodObject,...mt(t)});Pn.strictCreate=(e,t)=>new Pn({shape:()=>e,unknownKeys:"strict",catchall:Gs.create(),typeName:nt.ZodObject,...mt(t)});Pn.lazycreate=(e,t)=>new Pn({shape:e,unknownKeys:"strip",catchall:Gs.create(),typeName:nt.ZodObject,...mt(t)});class ym extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const l=i.map(u=>new Za(u.ctx.common.issues));return De(n,{code:Ne.invalid_union,unionErrors:l}),tt}if(n.common.async)return Promise.all(r.map(async i=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(a);{let i;const l=[];for(const d of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=d._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=l.map(d=>new Za(d));return De(n,{code:Ne.invalid_union,unionErrors:u}),tt}}get options(){return this._def.options}}ym.create=(e,t)=>new ym({options:e,typeName:nt.ZodUnion,...mt(t)});function rb(e,t){const n=Ns(e),r=Ns(t);if(e===t)return{valid:!0,data:e};if(n===Ve.object&&r===Ve.object){const a=Mt.objectKeys(t),i=Mt.objectKeys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...t};for(const u of i){const d=rb(e[u],t[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(n===Ve.array&&r===Ve.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const l=e[i],u=t[i],d=rb(l,u);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return n===Ve.date&&r===Ve.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class _m extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,l)=>{if(EC(i)||EC(l))return tt;const u=rb(i.value,l.value);return u.valid?((RC(i)||RC(l))&&n.dirty(),{status:n.value,value:u.data}):(De(r,{code:Ne.invalid_intersection_types}),tt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,l])=>a(i,l)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_m.create=(e,t,n)=>new _m({left:e,right:t,typeName:nt.ZodIntersection,...mt(n)});class $i extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.array)return De(r,{code:Ne.invalid_type,expected:Ve.array,received:r.parsedType}),tt;if(r.data.length<this._def.items.length)return De(r,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tt;!this._def.rest&&r.data.length>this._def.items.length&&(De(r,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((l,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new Hs(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(i).then(l=>oo.mergeArray(n,l)):oo.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new $i({...this._def,rest:t})}}$i.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $i({items:e,typeName:nt.ZodTuple,rest:null,...mt(t)})};class kC extends Ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.map)return De(r,{code:Ne.invalid_type,expected:Ve.map,received:r.parsedType}),tt;const a=this._def.keyType,i=this._def.valueType,l=[...r.data.entries()].map(([u,d],f)=>({key:a._parse(new Hs(r,u,r.path,[f,"key"])),value:i._parse(new Hs(r,d,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of l){const f=await d.key,m=await d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const d of l){const f=d.key,m=d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}kC.create=(e,t,n)=>new kC({valueType:t,keyType:e,typeName:nt.ZodMap,...mt(n)});class hd extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.set)return De(r,{code:Ne.invalid_type,expected:Ve.set,received:r.parsedType}),tt;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(De(r,{code:Ne.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(De(r,{code:Ne.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function l(d){const f=new Set;for(const m of d){if(m.status==="aborted")return tt;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((d,f)=>i._parse(new Hs(r,d,r.path,f)));return r.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(t,n){return new hd({...this._def,minSize:{value:t,message:Ge.toString(n)}})}max(t,n){return new hd({...this._def,maxSize:{value:t,message:Ge.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}hd.create=(e,t)=>new hd({valueType:e,minSize:null,maxSize:null,typeName:nt.ZodSet,...mt(t)});class MC extends Ot{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}MC.create=(e,t)=>new MC({getter:e,typeName:nt.ZodLazy,...mt(t)});class PC extends Ot{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return De(n,{received:n.data,code:Ne.invalid_literal,expected:this._def.value}),tt}return{status:"valid",value:t.data}}get value(){return this._def.value}}PC.create=(e,t)=>new PC({value:e,typeName:nt.ZodLiteral,...mt(t)});function yP(e,t){return new mc({values:e,typeName:nt.ZodEnum,...mt(t)})}class mc extends Ot{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{expected:Mt.joinValues(r),received:n.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{received:n.data,code:Ne.invalid_enum_value,options:r}),tt}return Co(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return mc.create(t,{...this._def,...n})}exclude(t,n=this._def){return mc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}mc.create=yP;class DC extends Ot{_parse(t){const n=Mt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ve.string&&r.parsedType!==Ve.number){const a=Mt.objectValues(n);return De(r,{expected:Mt.joinValues(a),received:r.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(Mt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Mt.objectValues(n);return De(r,{received:r.data,code:Ne.invalid_enum_value,options:a}),tt}return Co(t.data)}get enum(){return this._def.values}}DC.create=(e,t)=>new DC({values:e,typeName:nt.ZodNativeEnum,...mt(t)});class bm extends Ot{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ve.promise&&n.common.async===!1)return De(n,{code:Ne.invalid_type,expected:Ve.promise,received:n.parsedType}),tt;const r=n.parsedType===Ve.promise?n.data:Promise.resolve(n.data);return Co(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}bm.create=(e,t)=>new bm({type:e,typeName:nt.ZodPromise,...mt(t)});class gc extends Ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===nt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:l=>{De(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const l=a.transform(r.data,i);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return tt;const d=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return d.status==="aborted"?tt:d.status==="dirty"||n.value==="dirty"?ju(d.value):d});{if(n.value==="aborted")return tt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?tt:u.status==="dirty"||n.value==="dirty"?ju(u.value):u}}if(a.type==="refinement"){const l=u=>{const d=a.refinement(u,i);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(a.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!pc(l))return tt;const u=a.transform(l.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>pc(l)?Promise.resolve(a.transform(l.value,i)).then(u=>({status:n.value,value:u})):tt);Mt.assertNever(a)}}gc.create=(e,t,n)=>new gc({schema:e,typeName:nt.ZodEffects,effect:t,...mt(n)});gc.createWithPreprocess=(e,t,n)=>new gc({schema:t,effect:{type:"preprocess",transform:e},typeName:nt.ZodEffects,...mt(n)});class Vs extends Ot{_parse(t){return this._getType(t)===Ve.undefined?Co(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Vs.create=(e,t)=>new Vs({innerType:e,typeName:nt.ZodOptional,...mt(t)});class vc extends Ot{_parse(t){return this._getType(t)===Ve.null?Co(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}vc.create=(e,t)=>new vc({innerType:e,typeName:nt.ZodNullable,...mt(t)});class ob extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ve.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ob.create=(e,t)=>new ob({innerType:e,typeName:nt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...mt(t)});class ab extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return gm(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Za(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Za(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ab.create=(e,t)=>new ab({innerType:e,typeName:nt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...mt(t)});class LC extends Ot{_parse(t){if(this._getType(t)!==Ve.nan){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.nan,received:r.parsedType}),tt}return{status:"valid",value:t.data}}}LC.create=e=>new LC({typeName:nt.ZodNaN,...mt(e)});class Gne extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class K1 extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?tt:i.status==="dirty"?(n.dirty(),ju(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?tt:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new K1({in:t,out:n,typeName:nt.ZodPipeline})}}class sb extends Ot{_parse(t){const n=this._def.innerType._parse(t),r=a=>(pc(a)&&(a.value=Object.freeze(a.value)),a);return gm(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}sb.create=(e,t)=>new sb({innerType:e,typeName:nt.ZodReadonly,...mt(t)});var nt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(nt||(nt={}));const Zne=Ds.create,Kne=nb.create;Gs.create;da.create;const Wne=Pn.create;ym.create;_m.create;$i.create;const Yne=mc.create;bm.create;Vs.create;vc.create;const Qne=Wne({path:Zne().optional().default(""),flat:Kne().optional().default(!1),view:Yne(["table","grid"]).optional().default("grid")}),Xne=bne(e=>{const{createRoute:t,lazyRouteComponent:n}=e.routing;return[t({getParentRoute:()=>e.parentRoute,path:"/",component:n(()=>ln(()=>import("./file-browser-2RP-n1Xp.js").then(a=>a.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),validateSearch:Qne})]}),Jne=A.lazy(()=>ln(()=>import("./plugin-header-e5FObvvx.js"),__vite__mapDeps([15,5,16]))),ere=A.lazy(()=>ln(()=>import("./plugin-empty-state-Df2LAyPv.js"),[])),tre={id:"object-storage",description:"Browse and manage files in S3-compatible object storage",binding:_ne,renderHeader:e=>x.jsx(Jne,{...e}),renderEmptyState:()=>x.jsx(ere,{}),setup:e=>{const{registerRootSidebarItem:t,registerPluginRoutes:n}=e;t({icon:x.jsx(pP,{size:20}),label:"Files"});const r=Xne.createRoutes(e);n(r)}},nre="user-sandbox",rre="Create embeddable integration flows for platform end-users";var ore=(e,t,n,r,a,i,l,u)=>{let d=document.documentElement,f=["light","dark"];function m(y){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",b=w&&i?a.map(E=>i[E]||E):a;w?(d.classList.remove(...b),d.classList.add(i&&i[y]?i[y]:y)):d.setAttribute(S,y)}),p(y)}function p(y){u&&f.includes(y)&&(d.style.colorScheme=y)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)m(r);else try{let y=localStorage.getItem(t)||n,S=l&&y==="system"?g():y;m(S)}catch{}},are=A.createContext(void 0),sre={setTheme:e=>{},themes:[]},_oe=()=>{var e;return(e=A.useContext(are))!=null?e:sre};A.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:l,themes:u,nonce:d,scriptProps:f})=>{let m=JSON.stringify([n,t,i,e,u,l,r,a]).slice(1,-1);return A.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${ore.toString()})(${m})`}})});const jC="org-admin",ire={from({org:e,project:t}){if(e?.includes("/")||t.includes("/"))throw new Error("Org or project cannot contain slashes");return`${e}/${t}`},parse(e){e.startsWith("/")&&(e=e.slice(1));const[t,n]=e.split("/");if(!t||!n)throw new Error("Invalid locator");return{org:t,project:n}},isOrgAdminProject(e){return e.split("/")[1]===jC},adminProject(e){return`${e}/${jC}`}},_P=A.createContext(void 0),boe=()=>{const e=A.useContext(_P);if(!e)throw new Error("useProjectContext must be used within a ProjectContextProvider");return e},woe=e=>{const t=Ui.c(10),{children:n,org:r,project:a}=e;let i;t[0]!==r.slug||t[1]!==a.slug?(i=ire.from({org:r.slug,project:a.slug}),t[0]=r.slug,t[1]=a.slug,t[2]=i):i=t[2];const l=i;let u;t[3]!==l||t[4]!==r||t[5]!==a?(u={org:r,project:a,locator:l},t[3]=l,t[4]=r,t[5]=a,t[6]=u):u=t[6];const d=u;let f;return t[7]!==n||t[8]!==d?(f=x.jsx(_P.Provider,{value:d,children:n}),t[7]=n,t[8]=d,t[9]=f):f=t[9],f},lre=ce({authorizationEndpoint:D().url(),tokenEndpoint:D().url(),introspectionEndpoint:D().url().optional(),clientId:D(),clientSecret:D().optional(),scopes:we(D()),grantType:$t(["authorization_code","client_credentials"])}),cre=ce({name:D(),description:D().optional(),inputSchema:xt(D(),St()),outputSchema:xt(D(),St()).optional()}),ure=ce({headers:xt(D(),D()).optional()}),dre=ce({command:D().describe("Command to run (e.g., 'npx', 'node')"),args:we(D()).optional().describe("Command arguments"),cwd:D().optional().describe("Working directory"),envVars:xt(D(),D()).optional().describe("Environment variables (encrypted in storage)")}),bP=ce({id:D().describe("Unique identifier for the connection"),title:D().describe("Human-readable name for the connection"),created_at:D().describe("When the connection was created"),updated_at:D().describe("When the connection was last updated"),created_by:D().describe("User ID who created the connection"),updated_by:D().optional().describe("User ID who last updated the connection"),organization_id:D().describe("Organization ID this connection belongs to"),description:D().nullable().describe("Description of the connection"),icon:D().nullable().describe("Icon URL for the connection"),app_name:D().nullable().describe("Associated app name"),app_id:D().nullable().describe("Associated app ID"),connection_type:$t(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:D().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:D().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:Lt([dre,ure]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:lre.nullable().describe("OAuth configuration"),configuration_state:xt(D(),St()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:we(D()).nullable().optional().describe("Configuration scopes"),metadata:xt(D(),St()).nullable().describe("Additional metadata (includes repository info)"),tools:we(cre).nullable().describe("Discovered tools from MCP"),bindings:we(D()).nullable().describe("Detected bindings"),status:$t(["active","inactive","error"]).describe("Current status")});bP.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});bP.partial();function Soe(e){return e!=null&&"command"in e}function Eoe(e){return!e||!e.startsWith("virtual://")?null:e.replace("virtual://","")}const fre=ce({connection_id:D().describe("Connection ID"),selected_tools:we(D()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:we(D()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:we(D()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")}),Roe=ce({id:D().describe("Unique identifier for the virtual MCP"),title:D().describe("Human-readable name for the virtual MCP"),description:D().nullable().describe("Description of the virtual MCP"),icon:D().nullable().describe("Icon URL for the virtual MCP"),created_at:D().describe("When the virtual MCP was created"),updated_at:D().describe("When the virtual MCP was last updated"),created_by:D().describe("User ID who created the virtual MCP"),updated_by:D().optional().describe("User ID who last updated the virtual MCP"),organization_id:D().describe("Organization ID this virtual MCP belongs to"),status:$t(["active","inactive"]).describe("Current status"),metadata:ce({instructions:D().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:we(fre).describe("Connections with their selected tools, resources, and prompts")});ce({title:D().min(1).max(255).describe("Name for the virtual MCP"),description:D().nullable().optional().describe("Optional description"),icon:D().nullable().optional().describe("Optional icon URL"),status:$t(["active","inactive"]).optional().default("active").describe("Initial status"),metadata:ce({instructions:D().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:we(ce({connection_id:D().describe("Connection ID"),selected_tools:we(D()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:we(D()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:we(D()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});ce({title:D().min(1).max(255).optional().describe("New name"),description:D().nullable().optional().describe("New description (null to clear)"),icon:D().nullable().optional().describe("New icon URL (null to clear)"),status:$t(["active","inactive"]).optional().describe("New status"),metadata:ce({instructions:D().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:we(ce({connection_id:D().describe("Connection ID"),selected_tools:we(D()).nullable().optional().describe("Selected tool names (null/undefined = all tools included)"),selected_resources:we(D()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources included)"),selected_prompts:we(D()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts included)")})).optional().describe("New connections (replaces existing)")});var $C;(function(e){e.Completable="McpCompletable"})($C||($C={}));const hre=[],pre={id:nre,description:rre,binding:hre},mre=[tre,pre],qi=tL({component:()=>x.jsxs(aQ,{children:[x.jsx(A.Suspense,{fallback:x.jsx(S4,{}),children:x.jsx(_A,{})}),x.jsx(sQ,{})]})}),gre=dn({getParentRoute:()=>qi,path:"/login",component:vn(()=>ln(()=>import("./login-BFXWEB6t.js"),__vite__mapDeps([17,14,3,18]))),validateSearch:pa(()=>ce({next:D().optional(),client_id:D().optional(),redirect_uri:D().optional(),response_type:D().optional(),state:D().optional(),scope:D().optional(),code_challenge:D().optional(),code_challenge_method:D().optional()}))}),vre=dn({getParentRoute:()=>qi,path:"/auth/$pathname",component:vn(()=>ln(()=>import("./auth-catchall-CTOFzXVU.js"),[]))}),yre=dn({getParentRoute:()=>qi,path:"/connect/$sessionId",component:vn(()=>ln(()=>import("./connect-DYIKCRWy.js"),__vite__mapDeps([19,20,14,3,21,22,23])))}),_re=dn({getParentRoute:()=>qi,path:"/store/$appName",component:vn(()=>ln(()=>import("./store-invite-BErtY6PV.js"),[])),validateSearch:pa(()=>ce({serverName:D().optional()}))}),xr=dn({getParentRoute:()=>qi,id:"shell",component:vn(()=>ln(()=>import("./shell-layout-BfC0vVyw.js"),__vite__mapDeps([24,3,25,26,5,27,28,29,30,31,32,33,18,34,35,36,37,38,39,14,20,40,41,42,43,2,44,45,46,16,7,47,48,49,50,51,6,52,53,54,55,56,57,12,58,59,60,9,61,62,63,64,65,66,67,68])))}),bre=dn({getParentRoute:()=>xr,path:"/",component:vn(()=>ln(()=>import("./home-CZ1MSx2E.js"),__vite__mapDeps([69,21,3,63,6,5,59,34,28,18,61,62,50,44,14])))}),wre=dn({getParentRoute:()=>xr,path:"/$org",component:vn(()=>ln(()=>import("./page-D-IBJ4SW.js"),__vite__mapDeps([70,36,3,31,37,38,39,14,20,40,41,42,43,2,44,45,18,25,46,35,5,16,30,7,47,34,48,29,49,50,51,6,52,53,54,55,56,57,12,58,59,33,71,72])))}),Sre=dn({getParentRoute:()=>xr,path:"/$org/members",component:vn(()=>ln(()=>import("./members-C3Nvqq2t.js"),__vite__mapDeps([73,74,75,3,64,7,52,5,10,35,76,77,78,11,34,18,79,80,51,4,81,40,39,14,20,37,82,63,26,62,49,31,83,84,59,12,66,29,50,46,16,85,21,86,87,28])))}),Ere=dn({getParentRoute:()=>xr,path:"/$org/mcps",component:vn(()=>ln(()=>import("./connections-dluTnyJM.js"),__vite__mapDeps([88,74,75,3,64,7,52,5,10,35,76,77,78,11,34,18,79,89,21,51,29,41,42,90,32,39,14,20,37,40,62,26,49,31,50,86,91,56,12,46,16,85,57,92,59]))),validateSearch:pa(()=>ce({action:$t(["create"]).optional()}))}),Rre=dn({getParentRoute:()=>xr,path:"/$org/settings",component:vn(()=>ln(()=>import("./settings-cRTESMAX.js"),__vite__mapDeps([93,74,75,3,64,7,52,5,10,35,76,77,14,50,18,13,31])))}),xre=dn({getParentRoute:()=>xr,path:"/$org/settings/plugins",component:vn(()=>ln(()=>import("./plugins-BOsIh96E.js"),__vite__mapDeps([94,74,75,3,64,7,52,5,10,35,76,77,60,14,37,66,81])))}),Tre=dn({getParentRoute:()=>xr,path:"/$org/monitoring",component:vn(()=>ln(()=>import("./monitoring-AmN2oTrM.js"),__vite__mapDeps([95,74,75,3,64,7,52,5,10,35,76,77,78,11,34,18,51,29,26,16,25,55,8,96,87,97,43,2,44,98,82,40,39,14,20,37,38,67,59,12,4,46,85,99,54]))),validateSearch:pa(()=>ce({tab:$t(["logs","analytics"]).default("logs"),from:D().default("now-24h"),to:D().default("now"),connectionId:we(D()).optional().default([]),virtualMcpId:we(D()).optional().default([]),tool:D().default(""),status:$t(["all","success","errors"]).default("all"),search:D().default(""),page:Ze().optional(),streaming:ut().default(!0),propertyFilters:D().default("")}))}),wP=dn({getParentRoute:()=>xr,path:"/$org/store",component:vn(()=>ln(()=>import("./page-BcZkyr2a.js"),__vite__mapDeps([100,74,75,3,64,7,52,5,10,35,76,96,27,11,34,1,2,91,37,40,39,14,20,101,78,18,102,84,59,56,21,51,103,25,16,28,46,41,42,45])))}),Ore=dn({getParentRoute:()=>wP,path:"/$appName",component:vn(()=>ln(()=>import("./mcp-server-detail-CuItqIIY.js"),__vite__mapDeps([104,6,11,3,81,51,105,106,103,91,37,57,16,59,64,7,65,107,20,30,75,52,5,10,35,76,78,34,18,79,21,108,109,99,26,102,84,56,41,42,39,14,40,45,101,110]))),validateSearch:pa(()=>ce({registryId:D().optional(),serverName:D().optional(),itemId:D().optional()}))}),Cre=dn({getParentRoute:()=>xr,path:"/$org/mcps/$connectionId",component:vn(()=>ln(()=>import("./connection-detail-D3-I_W38.js"),__vite__mapDeps([111,51,3,29,41,42,112,22,92,18,59,12,39,14,20,37,40,113,35,71,60,30,87,11,108,81,26,64,7,50,46,5,16,105,106,103,91,57,56,54,38,114,98,23,36,31,43,2,44,45,25,47,34,48,49,6,52,53,55,58,99,115,75,10,76,78,21,86,90,32,79,116,27,63,62,107,109]))),validateSearch:pa(()=>ce({tab:D().optional()}))}),Are=dn({getParentRoute:()=>xr,path:"/$org/mcps/$connectionId/$collectionName/$itemId",component:vn(()=>ln(()=>import("./collection-detail-B_qs3xwg.js"),__vite__mapDeps([117,51,3,29,39,14,20,37,113,35,71,60,50,18,85,118,108,81,46,5,16,6,43,2,44,67,55,11,97,28,112,22,92,59,12,41,42,40,30,87,26,64,7,105,106,103,91,57,56,54,38,114,98,23,36,31,45,25,47,34,48,49,52,53,58,116,68,76,83]))),validateSearch:pa(()=>ce({replayId:D().optional()}))}),Ire=dn({getParentRoute:()=>xr,path:"/$org/agents",component:vn(()=>ln(()=>import("./agents-4MJAHJGV.js"),__vite__mapDeps([119,74,75,3,64,7,52,5,10,35,76,77,78,11,34,18,79,89,21,51,29,90,32,58,38,39,14,20,37,62,26,86,12,54]))),validateSearch:pa(()=>ce({action:$t(["create"]).optional()}))}),Nre=dn({getParentRoute:()=>xr,path:"/$org/agents/$agentId",component:vn(()=>ln(()=>import("./agent-detail-nBBUtMd0.js"),__vite__mapDeps([120,51,3,29,4,5,81,40,39,14,20,37,78,11,34,18,59,31,113,35,71,60,80,114,48,38,101,26,49,50,99,66,85,67,55,118,110,72,54,108]))),validateSearch:pa(()=>ce({tab:D().optional()}))}),kre=dn({getParentRoute:()=>xr,path:"/$org/workflows",component:vn(()=>ln(()=>import("./workflow-pPSpZECL.js"),__vite__mapDeps([121,37,115,57,75,3,64,7,52,5,10,35,76,78,11,34,18,21,51,55,86,53,90,32,12,79,116,27,63,20,113,71,60,14,39,40,106,62,59,108,81,74,41,42])))}),SP=dn({getParentRoute:()=>xr,path:"/$org/$pluginId",component:vn(()=>ln(()=>import("./dynamic-plugin-layout-DrCIvG61.js"),__vite__mapDeps([122,11,42,45,20,14,40,39,37])))}),Mre=[],EP=[];mre.forEach(e=>{if(!e.setup)return;const t={parentRoute:SP,routing:{createRoute:dn,lazyRouteComponent:vn},registerRootSidebarItem:n=>Mre.push({pluginId:e.id,...n}),registerPluginRoutes:n=>{EP.push(...n)}};e.setup(t)});const Pre=SP.addChildren(EP),Dre=dn({getParentRoute:()=>qi,path:"/oauth/callback",component:vn(()=>ln(()=>import("./oauth-callback-BO8hRY4t.js"),__vite__mapDeps([123,11,22])))}),Lre=wP.addChildren([Ore]),jre=xr.addChildren([bre,wre,Sre,Ere,Ire,Nre,Tre,Lre,Rre,xre,kre,Cre,Are,Pre]),$re=qi.addChildren([jre,gre,vre,Dre,yre,_re]),Ure=uL({routeTree:$re}),zre=document.getElementById("root");GD.createRoot(zre).render(x.jsx(A.StrictMode,{children:x.jsx(hL,{router:Ure})}));export{pP as $,coe as A,wN as B,bP as C,eoe as D,Kre as E,Vte as F,ZG as G,KG as H,WG as I,YG as J,QC as K,ire as L,QG as M,Zre as N,jC as O,woe as P,aoe as Q,ZB as R,S4 as S,XB as T,soe as U,Roe as V,ioe as W,ooe as X,y5 as Y,Tm as Z,$t as _,Xl as a,VC as a$,N5 as a0,u5 as a1,ix as a2,qre as a3,Bre as a4,RM as a5,TM as a6,gte as a7,wte as a8,moe as a9,TZ as aA,mk as aB,eZ as aC,YV as aD,KV as aE,WV as aF,fN as aG,uZ as aH,dZ as aI,cZ as aJ,Jre as aK,Xre as aL,Qre as aM,voe as aN,_A as aO,mre as aP,E$ as aQ,kA as aR,pd as aS,q0 as aT,Wu as aU,p5 as aV,or as aW,jr as aX,r5 as aY,Mre as aZ,ib as a_,Ci as aa,hT as ab,Om as ac,ut as ad,xt as ae,St as af,Lt as ag,bd as ah,Tk as ai,Us as aj,Bn as ak,hn as al,it as am,wH as an,Qa as ao,Vb as ap,vk as aq,LN as ar,Fb as as,Fi as at,rd as au,ON as av,zb as aw,Ub as ax,SH as ay,EH as az,uoe as b,Wre as b$,b5 as b0,E5 as b1,C5 as b2,R5 as b3,x5 as b4,I5 as b5,lx as b6,A5 as b7,T5 as b8,ek as b9,Td as bA,_d as bB,Fre as bC,O5 as bD,ee as bE,KW as bF,loe as bG,fY as bH,vr as bI,Gre as bJ,BV as bK,VV as bL,jV as bM,GV as bN,zJ as bO,oP as bP,pt as bQ,kee as bR,Vre as bS,pA as bT,Zs as bU,Ga as bV,Ite as bW,d7 as bX,Yre as bY,XI as bZ,ZI as b_,PH as ba,DH as bb,Ck as bc,ht as bd,Go as be,JN as bf,Zo as bg,kte as bh,sP as bi,Rr as bj,ene as bk,eo as bl,VI as bm,ar as bn,Ze as bo,je as bp,pa as bq,gd as br,mr as bs,zr as bt,yoe as bu,Xne as bv,ln as bw,_oe as bx,aV as by,Ka as bz,Ui as c,Qq as c0,Yq as c1,Wq as c2,sO as c3,Xq as c4,noe as c5,Jq as c6,roe as c7,tH as c8,rZ as c9,gA as ca,nO as cb,oH as cc,Yo as cd,od as ce,Qb as cf,uc as cg,qs as ch,ha as ci,Qo as cj,ak as ck,sH as cl,cH as cm,iH as cn,Kq as co,poe as cp,doe as d,foe as e,xm as f,Dj as g,ga as h,Soe as i,x as j,ma as k,yc as l,Hre as m,we as n,ce as o,Eoe as p,YC as q,A as r,D as s,yF as t,boe as u,QB as v,WB as w,YB as x,KB as y,toe as z};
174
+ `&&r++}}return[t,n]}class mC extends Event{constructor(t,n){var r,a;super(t),this.code=(r=n?.code)!=null?r:void 0,this.message=(a=n?.message)!=null?a:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(gC(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(gC(this),n)}}function qee(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function D_(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(D_).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${D_(e.cause)}`:e.message:`${e}`}function gC(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var lP=e=>{throw TypeError(e)},q1=(e,t,n)=>t.has(e)||lP("Cannot "+n),yt=(e,t,n)=>(q1(e,t,"read from private field"),n?n.call(e):t.get(e)),zn=(e,t,n)=>t.has(e)?lP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),an=(e,t,n,r)=>(q1(e,t,"write to private field"),t.set(e,n),n),qa=(e,t,n)=>(q1(e,t,"access private method"),n),Ur,Ri,ql,Sp,cm,Zu,Ql,Ku,Ms,Hl,oc,Gl,Du,jo,L_,j_,$_,vC,U_,z_,Lu,V_,F_;class Ep extends EventTarget{constructor(t,n){var r,a;super(),zn(this,jo),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,zn(this,Ur),zn(this,Ri),zn(this,ql),zn(this,Sp),zn(this,cm),zn(this,Zu),zn(this,Ql),zn(this,Ku,null),zn(this,Ms),zn(this,Hl),zn(this,oc,null),zn(this,Gl,null),zn(this,Du,null),zn(this,j_,async i=>{var l;yt(this,Hl).reset();const{body:u,redirected:d,status:f,headers:m}=i;if(f===204){qa(this,jo,Lu).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(d?an(this,ql,new URL(i.url)):an(this,ql,void 0),f!==200){qa(this,jo,Lu).call(this,`Non-200 status code (${f})`,f);return}if(!(m.get("content-type")||"").startsWith("text/event-stream")){qa(this,jo,Lu).call(this,'Invalid content type, expected "text/event-stream"',f);return}if(yt(this,Ur)===this.CLOSED)return;an(this,Ur,this.OPEN);const p=new Event("open");if((l=yt(this,Du))==null||l.call(this,p),this.dispatchEvent(p),typeof u!="object"||!u||!("getReader"in u)){qa(this,jo,Lu).call(this,"Invalid response body, expected a web ReadableStream",f),this.close();return}const g=new TextDecoder,y=u.getReader();let S=!0;do{const{done:w,value:b}=await y.read();b&&yt(this,Hl).feed(g.decode(b,{stream:!w})),w&&(S=!1,yt(this,Hl).reset(),qa(this,jo,V_).call(this))}while(S)}),zn(this,$_,i=>{an(this,Ms,void 0),!(i.name==="AbortError"||i.type==="aborted")&&qa(this,jo,V_).call(this,D_(i))}),zn(this,U_,i=>{typeof i.id=="string"&&an(this,Ku,i.id);const l=new MessageEvent(i.event||"message",{data:i.data,origin:yt(this,ql)?yt(this,ql).origin:yt(this,Ri).origin,lastEventId:i.id||""});yt(this,Gl)&&(!i.event||i.event==="message")&&yt(this,Gl).call(this,l),this.dispatchEvent(l)}),zn(this,z_,i=>{an(this,Zu,i)}),zn(this,F_,()=>{an(this,Ql,void 0),yt(this,Ur)===this.CONNECTING&&qa(this,jo,L_).call(this)});try{if(t instanceof URL)an(this,Ri,t);else if(typeof t=="string")an(this,Ri,new URL(t,Hee()));else throw new Error("Invalid URL")}catch{throw qee("An invalid or illegal string was specified")}an(this,Hl,iP({onEvent:yt(this,U_),onRetry:yt(this,z_)})),an(this,Ur,this.CONNECTING),an(this,Zu,3e3),an(this,cm,(r=n?.fetch)!=null?r:globalThis.fetch),an(this,Sp,(a=n?.withCredentials)!=null?a:!1),qa(this,jo,L_).call(this)}get readyState(){return yt(this,Ur)}get url(){return yt(this,Ri).href}get withCredentials(){return yt(this,Sp)}get onerror(){return yt(this,oc)}set onerror(t){an(this,oc,t)}get onmessage(){return yt(this,Gl)}set onmessage(t){an(this,Gl,t)}get onopen(){return yt(this,Du)}set onopen(t){an(this,Du,t)}addEventListener(t,n,r){const a=n;super.addEventListener(t,a,r)}removeEventListener(t,n,r){const a=n;super.removeEventListener(t,a,r)}close(){yt(this,Ql)&&clearTimeout(yt(this,Ql)),yt(this,Ur)!==this.CLOSED&&(yt(this,Ms)&&yt(this,Ms).abort(),an(this,Ur,this.CLOSED),an(this,Ms,void 0))}}Ur=new WeakMap,Ri=new WeakMap,ql=new WeakMap,Sp=new WeakMap,cm=new WeakMap,Zu=new WeakMap,Ql=new WeakMap,Ku=new WeakMap,Ms=new WeakMap,Hl=new WeakMap,oc=new WeakMap,Gl=new WeakMap,Du=new WeakMap,jo=new WeakSet,L_=function(){an(this,Ur,this.CONNECTING),an(this,Ms,new AbortController),yt(this,cm)(yt(this,Ri),qa(this,jo,vC).call(this)).then(yt(this,j_)).catch(yt(this,$_))},j_=new WeakMap,$_=new WeakMap,vC=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...yt(this,Ku)?{"Last-Event-ID":yt(this,Ku)}:void 0},cache:"no-store",signal:(e=yt(this,Ms))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},U_=new WeakMap,z_=new WeakMap,Lu=function(e,t){var n;yt(this,Ur)!==this.CLOSED&&an(this,Ur,this.CLOSED);const r=new mC("error",{code:t,message:e});(n=yt(this,oc))==null||n.call(this,r),this.dispatchEvent(r)},V_=function(e,t){var n;if(yt(this,Ur)===this.CLOSED)return;an(this,Ur,this.CONNECTING);const r=new mC("error",{code:t,message:e});(n=yt(this,oc))==null||n.call(this,r),this.dispatchEvent(r),an(this,Ql,setTimeout(yt(this,F_),yt(this,Zu)))},F_=new WeakMap,Ep.CONNECTING=0,Ep.OPEN=1,Ep.CLOSED=2;function Hee(){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}function um(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function cP(e=fetch,t){return t?async(n,r)=>{const a={...t,...r,headers:r?.headers?{...um(t.headers),...um(r.headers)}:t.headers};return e(n,a)}:e}let H1;H1=globalThis.crypto;async function Gee(e){return(await H1).getRandomValues(new Uint8Array(e))}async function Zee(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",n=Math.pow(2,8)-Math.pow(2,8)%t.length;let r="";for(;r.length<e;){const a=await Gee(e-r.length);for(const i of a)i<n&&(r+=t[i%t.length])}return r}async function Kee(e){return await Zee(e)}async function Wee(e){const t=await(await H1).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function Yee(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await Kee(e),n=await Wee(t);return{code_verifier:t,code_challenge:n}}const rr=w7().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:dz.custom,message:"URL must be parseable",fatal:!0}),R$}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Qee=ar({resource:D().url(),authorization_servers:we(rr).optional(),jwks_uri:D().url().optional(),scopes_supported:we(D()).optional(),bearer_methods_supported:we(D()).optional(),resource_signing_alg_values_supported:we(D()).optional(),resource_name:D().optional(),resource_documentation:D().optional(),resource_policy_uri:D().url().optional(),resource_tos_uri:D().url().optional(),tls_client_certificate_bound_access_tokens:ut().optional(),authorization_details_types_supported:we(D()).optional(),dpop_signing_alg_values_supported:we(D()).optional(),dpop_bound_access_tokens_required:ut().optional()}),uP=ar({issuer:D(),authorization_endpoint:rr,token_endpoint:rr,registration_endpoint:rr.optional(),scopes_supported:we(D()).optional(),response_types_supported:we(D()),response_modes_supported:we(D()).optional(),grant_types_supported:we(D()).optional(),token_endpoint_auth_methods_supported:we(D()).optional(),token_endpoint_auth_signing_alg_values_supported:we(D()).optional(),service_documentation:rr.optional(),revocation_endpoint:rr.optional(),revocation_endpoint_auth_methods_supported:we(D()).optional(),revocation_endpoint_auth_signing_alg_values_supported:we(D()).optional(),introspection_endpoint:D().optional(),introspection_endpoint_auth_methods_supported:we(D()).optional(),introspection_endpoint_auth_signing_alg_values_supported:we(D()).optional(),code_challenge_methods_supported:we(D()).optional(),client_id_metadata_document_supported:ut().optional()}),Xee=ar({issuer:D(),authorization_endpoint:rr,token_endpoint:rr,userinfo_endpoint:rr.optional(),jwks_uri:rr,registration_endpoint:rr.optional(),scopes_supported:we(D()).optional(),response_types_supported:we(D()),response_modes_supported:we(D()).optional(),grant_types_supported:we(D()).optional(),acr_values_supported:we(D()).optional(),subject_types_supported:we(D()),id_token_signing_alg_values_supported:we(D()),id_token_encryption_alg_values_supported:we(D()).optional(),id_token_encryption_enc_values_supported:we(D()).optional(),userinfo_signing_alg_values_supported:we(D()).optional(),userinfo_encryption_alg_values_supported:we(D()).optional(),userinfo_encryption_enc_values_supported:we(D()).optional(),request_object_signing_alg_values_supported:we(D()).optional(),request_object_encryption_alg_values_supported:we(D()).optional(),request_object_encryption_enc_values_supported:we(D()).optional(),token_endpoint_auth_methods_supported:we(D()).optional(),token_endpoint_auth_signing_alg_values_supported:we(D()).optional(),display_values_supported:we(D()).optional(),claim_types_supported:we(D()).optional(),claims_supported:we(D()).optional(),service_documentation:D().optional(),claims_locales_supported:we(D()).optional(),ui_locales_supported:we(D()).optional(),claims_parameter_supported:ut().optional(),request_parameter_supported:ut().optional(),request_uri_parameter_supported:ut().optional(),require_request_uri_registration:ut().optional(),op_policy_uri:rr.optional(),op_tos_uri:rr.optional(),client_id_metadata_document_supported:ut().optional()}),Jee=ce({...Xee.shape,...uP.pick({code_challenge_methods_supported:!0}).shape}),ete=ce({access_token:D(),id_token:D().optional(),token_type:D(),expires_in:JI().optional(),scope:D().optional(),refresh_token:D().optional()}).strip(),tte=ce({error:D(),error_description:D().optional(),error_uri:D().optional()}),yC=rr.optional().or(je("").transform(()=>{})),nte=ce({redirect_uris:we(rr),token_endpoint_auth_method:D().optional(),grant_types:we(D()).optional(),response_types:we(D()).optional(),client_name:D().optional(),client_uri:rr.optional(),logo_uri:yC,scope:D().optional(),contacts:we(D()).optional(),tos_uri:yC,policy_uri:D().optional(),jwks_uri:rr.optional(),jwks:eo().optional(),software_id:D().optional(),software_version:D().optional(),software_statement:D().optional()}).strip(),rte=ce({client_id:D(),client_secret:D().optional(),client_id_issued_at:Ze().optional(),client_secret_expires_at:Ze().optional()}).strip(),ote=nte.merge(rte);ce({error:D(),error_description:D().optional()}).strip();ce({token:D(),token_type_hint:D().optional()}).strip();function ate(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function ste({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class Wn extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class B_ extends Wn{}B_.errorCode="invalid_request";class dm extends Wn{}dm.errorCode="invalid_client";class fm extends Wn{}fm.errorCode="invalid_grant";class hm extends Wn{}hm.errorCode="unauthorized_client";class q_ extends Wn{}q_.errorCode="unsupported_grant_type";class H_ extends Wn{}H_.errorCode="invalid_scope";class G_ extends Wn{}G_.errorCode="access_denied";class hc extends Wn{}hc.errorCode="server_error";class Z_ extends Wn{}Z_.errorCode="temporarily_unavailable";class K_ extends Wn{}K_.errorCode="unsupported_response_type";class W_ extends Wn{}W_.errorCode="unsupported_token_type";class Y_ extends Wn{}Y_.errorCode="invalid_token";class Q_ extends Wn{}Q_.errorCode="method_not_allowed";class X_ extends Wn{}X_.errorCode="too_many_requests";class pm extends Wn{}pm.errorCode="invalid_client_metadata";class J_ extends Wn{}J_.errorCode="insufficient_scope";class eb extends Wn{}eb.errorCode="invalid_target";const ite={[B_.errorCode]:B_,[dm.errorCode]:dm,[fm.errorCode]:fm,[hm.errorCode]:hm,[q_.errorCode]:q_,[H_.errorCode]:H_,[G_.errorCode]:G_,[hc.errorCode]:hc,[Z_.errorCode]:Z_,[K_.errorCode]:K_,[W_.errorCode]:W_,[Y_.errorCode]:Y_,[Q_.errorCode]:Q_,[X_.errorCode]:X_,[pm.errorCode]:pm,[J_.errorCode]:J_,[eb.errorCode]:eb};class Uo extends Error{constructor(t){super(t??"Unauthorized")}}function lte(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const $0="code",U0="S256";function cte(e,t){const n=e.client_secret!==void 0;return t.length===0?n?"client_secret_post":"none":"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&lte(e.token_endpoint_auth_method)&&t.includes(e.token_endpoint_auth_method)?e.token_endpoint_auth_method:n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function ute(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":dte(a,i,n);return;case"client_secret_post":fte(a,i,r);return;case"none":hte(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function dte(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function fte(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function hte(e,t){t.set("client_id",e)}async function dP(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=tte.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:l}=r,u=ite[a]||hc;return new u(i||"",l)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new hc(a)}}async function Ci(e,t){try{return await z0(e,t)}catch(n){if(n instanceof dm||n instanceof hm)return await e.invalidateCredentials?.("all"),await z0(e,t);if(n instanceof fm)return await e.invalidateCredentials?.("tokens"),await z0(e,t);throw n}}async function z0(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){let l,u;try{l=await gte(t,{resourceMetadataUrl:a},i),l.authorization_servers&&l.authorization_servers.length>0&&(u=l.authorization_servers[0])}catch{}u||(u=new URL("/",t));const d=await mte(t,e,l),f=await wte(u,{fetchFn:i});let m=await Promise.resolve(e.clientInformation());if(!m){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const b=f?.client_id_metadata_document_supported===!0,E=e.clientMetadataUrl;if(E&&!pte(E))throw new pm(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${E}`);if(b&&E)m={client_id:E},await e.saveClientInformation?.(m);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const T=await xte(u,{metadata:f,clientMetadata:e.clientMetadata,fetchFn:i});await e.saveClientInformation(T),m=T}}const p=!e.redirectUrl;if(n!==void 0||p){const b=await Rte(e,u,{metadata:f,resource:d,authorizationCode:n,fetchFn:i});return await e.saveTokens(b),"AUTHORIZED"}const g=await e.tokens();if(g?.refresh_token)try{const b=await Ete(u,{metadata:f,clientInformation:m,refreshToken:g.refresh_token,resource:d,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(b),"AUTHORIZED"}catch(b){if(!(!(b instanceof Wn)||b instanceof hc))throw b}const y=e.state?await e.state():void 0,{authorizationUrl:S,codeVerifier:w}=await Ste(u,{metadata:f,clientInformation:m,state:y,redirectUrl:e.redirectUrl,scope:r||l?.scopes_supported?.join(" ")||e.clientMetadata.scope,resource:d});return await e.saveCodeVerifier(w),await e.redirectToAuthorization(S),"REDIRECT"}function pte(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function mte(e,t,n){const r=ate(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!ste({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function mm(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=V0(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const l=V0(e,"scope")||void 0,u=V0(e,"error")||void 0;return{resourceMetadataUrl:i,scope:l,error:u}}function V0(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function gte(e,t,n=fetch){const r=await _te(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Qee.parse(await r.json())}async function G1(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?G1(e,void 0,n):void 0;throw r}}function vte(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function _C(e,t,n=fetch){return await G1(e,{"MCP-Protocol-Version":t},n)}function yte(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function _te(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??Ym;let l;if(r?.metadataUrl)l=new URL(r.metadataUrl);else{const d=vte(t,a.pathname);l=new URL(d,r?.metadataServerUrl??a),l.search=a.search}let u=await _C(l,i,n);if(!r?.metadataUrl&&yte(u,a.pathname)){const d=new URL(`/.well-known/${t}`,a);u=await _C(d,i,n)}return u}function bte(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function wte(e,{fetchFn:t=fetch,protocolVersion:n=Ym}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=bte(e);for(const{url:i,type:l}of a){const u=await G1(i,r,t);if(u){if(!u.ok){if(await u.body?.cancel(),u.status>=400&&u.status<500)continue;throw new Error(`HTTP ${u.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return l==="oauth"?uP.parse(await u.json()):Jee.parse(await u.json())}}}async function Ste(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:l}){let u;if(t){if(u=new URL(t.authorization_endpoint),!t.response_types_supported.includes($0))throw new Error(`Incompatible auth server: does not support response type ${$0}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(U0))throw new Error(`Incompatible auth server: does not support code challenge method ${U0}`)}else u=new URL("/authorize",e);const d=await Yee(),f=d.code_verifier,m=d.code_challenge;return u.searchParams.set("response_type",$0),u.searchParams.set("client_id",n.client_id),u.searchParams.set("code_challenge",m),u.searchParams.set("code_challenge_method",U0),u.searchParams.set("redirect_uri",String(r)),i&&u.searchParams.set("state",i),a&&u.searchParams.set("scope",a),a?.includes("offline_access")&&u.searchParams.append("prompt","consent"),l&&u.searchParams.set("resource",l.href),{authorizationUrl:u,codeVerifier:f}}function fP(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function Z1(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:l}){const u=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),d=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(d,n,u,t);else if(r){const m=t?.token_endpoint_auth_methods_supported??[],p=cte(r,m);ute(p,r,d,n)}const f=await(l??fetch)(u,{method:"POST",headers:d,body:n});if(!f.ok)throw await dP(f);return ete.parse(await f.json())}async function moe(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:l,addClientAuthentication:u,fetchFn:d}){const f=fP(r,a,i);return Z1(e,{metadata:t,tokenRequestParams:f,clientInformation:n,addClientAuthentication:u,resource:l,fetchFn:d})}async function Ete(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:l}){const u=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),d=await Z1(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:l});return{refresh_token:r,...d}}async function Rte(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const l=e.clientMetadata.scope;let u;if(e.prepareTokenRequest&&(u=await e.prepareTokenRequest(l)),!u){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const f=await e.codeVerifier();u=fP(a,f,e.redirectUrl)}const d=await e.clientInformation();return Z1(t,{metadata:n,tokenRequestParams:u,clientInformation:d??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function xte(e,{metadata:t,clientMetadata:n,fetchFn:r}){let a;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");a=new URL(t.registration_endpoint)}else a=new URL("/register",e);const i=await(r??fetch)(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!i.ok)throw await dP(i);return ote.parse(await i.json())}class Tte extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class Ote{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=cP(n?.fetch,n?.requestInit)}async _authThenStart(){if(!this._authProvider)throw new Uo("No auth provider");let t;try{t=await Ci(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 Uo;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=um(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 Ep(this._url.href,{...this._eventSourceInit,fetch:async(a,i)=>{const l=await this._commonHeaders();l.set("Accept","text/event-stream");const u=await t(a,{...i,headers:l});if(u.status===401&&u.headers.has("www-authenticate")){const{resourceMetadataUrl:d,scope:f}=mm(u);this._resourceMetadataUrl=d,this._scope=f}return u}}),this._abortController=new AbortController,this._eventSource.onerror=a=>{if(a.code===401&&this._authProvider){this._authThenStart().then(n,r);return}const i=new Tte(a.code,a.message,a);r(i),this.onerror?.(i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",a=>{const i=a;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(l){r(l),this.onerror?.(l),this.close();return}n()}),this._eventSource.onmessage=a=>{const i=a;let l;try{l=Gu.parse(JSON.parse(i.data))}catch(u){this.onerror?.(u);return}this.onmessage?.(l)}})}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 Uo("No auth provider");if(await Ci(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Uo("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},a=await(this._fetch??fetch)(this._endpoint,r);if(!a.ok){const i=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){const{resourceMetadataUrl:l,scope:u}=mm(a);if(this._resourceMetadataUrl=l,this._scope=u,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Uo;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${a.status}): ${i}`)}await a.body?.cancel()}catch(n){throw this.onerror?.(n),n}}setProtocolVersion(t){this._protocolVersion=t}}const Cte="mcp";class Ate{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,Cte),this._socket.onerror=r=>{const a="error"in r?r.error:new Error(`WebSocket error: ${JSON.stringify(r)}`);n(a),this.onerror?.(a)},this._socket.onopen=()=>{t()},this._socket.onclose=()=>{this.onclose?.()},this._socket.onmessage=r=>{let a;try{a=Gu.parse(JSON.parse(r.data))}catch(i){this.onerror?.(i);return}this.onmessage?.(a)}})}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 Ite extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let a;super({start(i){a=iP({onEvent:l=>{i.enqueue(l)},onError(l){t==="terminate"?i.error(l):typeof t=="function"&&t(l)},onRetry:n,onComment:r})},transform(i){a.feed(i)}})}}const Nte={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Vl extends Error{constructor(t,n){super(`Streamable HTTP error: ${n}`),this.code=t}}let kte=class{constructor(t,n){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=n?.requestInit,this._authProvider=n?.authProvider,this._fetch=n?.fetch,this._fetchWithInit=cP(n?.fetch,n?.requestInit),this._sessionId=n?.sessionId,this._reconnectionOptions=n?.reconnectionOptions??Nte}async _authThenStart(){if(!this._authProvider)throw new Uo("No auth provider");let t;try{t=await Ci(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 Uo;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){const t={};if(this._authProvider){const r=await this._authProvider.tokens();r&&(t.Authorization=`Bearer ${r.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=um(this._requestInit?.headers);return new Headers({...t,...n})}async _startOrAuthSse(t){const{resumptionToken:n}=t;try{const r=await this._commonHeaders();r.set("Accept","text/event-stream"),n&&r.set("last-event-id",n);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:r,signal:this._abortController?.signal});if(!a.ok){if(await a.body?.cancel(),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Vl(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,t,!0)}catch(r){throw this.onerror?.(r),r}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const n=this._reconnectionOptions.initialReconnectionDelay,r=this._reconnectionOptions.reconnectionDelayGrowFactor,a=this._reconnectionOptions.maxReconnectionDelay;return Math.min(n*Math.pow(r,t),a)}_scheduleReconnection(t,n=0){const r=this._reconnectionOptions.maxRetries;if(n>=r){this.onerror?.(new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const a=this._getNextReconnectionDelay(n);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{this.onerror?.(new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,n+1)})},a)}_handleSseStream(t,n,r){if(!t)return;const{onresumptiontoken:a,replayMessageId:i}=n;let l,u=!1,d=!1;(async()=>{try{const m=t.pipeThrough(new TextDecoderStream).pipeThrough(new Ite({onRetry:y=>{this._serverRetryMs=y}})).getReader();for(;;){const{value:y,done:S}=await m.read();if(S)break;if(y.id&&(l=y.id,u=!0,a?.(y.id)),!!y.data&&(!y.event||y.event==="message"))try{const w=Gu.parse(JSON.parse(y.data));Pu(w)&&(d=!0,i!==void 0&&(w.id=i)),this.onmessage?.(w)}catch(w){this.onerror?.(w)}}(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(m){if(this.onerror?.(new Error(`SSE stream disconnected: ${m}`)),(r||u)&&!d&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:l,onresumptiontoken:a,replayMessageId:i},0)}catch(y){this.onerror?.(new Error(`Failed to reconnect: ${y instanceof Error?y.message:String(y)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(t){if(!this._authProvider)throw new Uo("No auth provider");if(await Ci(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Uo("Failed to authorize")}async close(){this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),this._abortController?.abort(),this.onclose?.()}async send(t,n){try{const{resumptionToken:r,onresumptiontoken:a}=n||{};if(r){this._startOrAuthSse({resumptionToken:r,replayMessageId:P_(t)?t.id:void 0}).catch(g=>this.onerror?.(g));return}const i=await this._commonHeaders();i.set("content-type","application/json"),i.set("accept","application/json, text/event-stream");const l={...this._requestInit,method:"POST",headers:i,body:JSON.stringify(t),signal:this._abortController?.signal},u=await(this._fetch??fetch)(this._url,l),d=u.headers.get("mcp-session-id");if(d&&(this._sessionId=d),!u.ok){const g=await u.text().catch(()=>null);if(u.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Vl(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:y,scope:S}=mm(u);if(this._resourceMetadataUrl=y,this._scope=S,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Uo;return this._hasCompletedAuthFlow=!0,this.send(t)}if(u.status===403&&this._authProvider){const{resourceMetadataUrl:y,scope:S,error:w}=mm(u);if(w==="insufficient_scope"){const b=u.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===b)throw new Vl(403,"Server returned 403 after trying upscoping");if(S&&(this._scope=S),y&&(this._resourceMetadataUrl=y),this._lastUpscopingHeader=b??void 0,await Ci(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new Uo;return this.send(t)}}throw new Vl(u.status,`Error POSTing to endpoint: ${g}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,u.status===202){await u.body?.cancel(),lX(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(g=>this.onerror?.(g));return}const m=(Array.isArray(t)?t:[t]).filter(g=>"method"in g&&"id"in g&&g.id!==void 0).length>0,p=u.headers.get("content-type");if(m)if(p?.includes("text/event-stream"))this._handleSseStream(u.body,{onresumptiontoken:a},!1);else if(p?.includes("application/json")){const g=await u.json(),y=Array.isArray(g)?g.map(S=>Gu.parse(S)):[Gu.parse(g)];for(const S of y)this.onmessage?.(S)}else throw await u.body?.cancel(),new Vl(-1,`Unexpected content type: ${p}`);else await u.body?.cancel()}catch(r){throw this.onerror?.(r),r}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{const t=await this._commonHeaders(),n={...this._requestInit,method:"DELETE",headers:t,signal:this._abortController?.signal},r=await(this._fetch??fetch)(this._url,n);if(await r.body?.cancel(),!r.ok&&r.status!==405)throw new Vl(r.status,`Failed to terminate session: ${r.statusText}`);this._sessionId=void 0}catch(t){throw this.onerror?.(t),t}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,n){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:n?.onresumptiontoken})}};class Mte extends kte{constructor(t,n){super(t,n)}send(t,n){const r=Pte(t);return r?.type==="emit"?(this.onmessage?.(r.message),Promise.resolve()):r?.type==="suppress"?Promise.resolve():super.send(t,n)}}function Pte(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 Dte extends sP{constructor(t,n){super(t,n)}async listTools(t,n){return await this.request({method:"tools/list",params:t},z1,n)}}const Lte=async(e,t,n)=>{const r=jte(e.connection,t,n);if(!r)throw new Error("Unknown MCP connection type");const a=new Dte({name:e?.name??"MCP Client",version:"1.0.0"});return await a.connect(r),{client:a,callStreamableTool:(i,l,u)=>{if(e.connection.type!=="HTTP")throw new Error("HTTP connection required");const d=new Headers(n);d.has("Authorization")||d.set("Authorization",`Bearer ${e.connection.token}`);for(const[p,g]of Object.entries(e.connection.headers??{}))d.set(p,g);const f=new URL(e.connection.url),m=f.pathname.replace(/\/+$/,"")||"/";return f.pathname=`${m}/call-tool/${encodeURIComponent(i)}`,fetch(f.href,{method:"POST",redirect:"manual",body:JSON.stringify(l),headers:d,signal:u})}}},jte=(e,t,n)=>{if(e.type==="Websocket")return new Ate(new URL(e.url));if(e.type!=="SSE"&&e.type!=="HTTP")return null;const a={...e.token?{authorization:`Bearer ${e.token}`}:{},...n??{},..."headers"in e?e.headers||{}:{}};if(e.type==="SSE"){const i={requestInit:{headers:a,signal:t}};return e.token&&(i.eventSourceInit={fetch:(l,u)=>fetch(l,{...u,headers:{...a,Accept:"text/event-stream"},signal:t})}),new Ote(new URL(e.url),i)}return new Mte(new URL(e.url),{requestInit:{headers:a,signal:t,credentials:"include"}})},$te=e=>{try{return JSON.parse(e)}catch{return e}},up=new Map,bC=(e,t)=>({...e,id:e.name,inputSchema:e.inputSchema?mr(e.inputSchema):void 0,outputSchema:e.outputSchema?mr(e.outputSchema):void 0,execute:n=>t(n.context,e.name)});function Ute(e){const t=n=>"connection"in e?Lte({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 u;async function a(d,f=r){const m=e?.debugId?.(),p=m?{"x-trace-debug-id":m}:void 0,{client:g,callStreamableTool:y}=await t(p);if(e?.streamable?.[String(f)])return y(String(f),d);const{structuredContent:S,isError:w,content:b}=await g.callTool({name:String(f),arguments:d});if(w){const E=b?.[0]?.text,R=typeof E=="string"?$te(E):null,T=R?.code&&typeof e?.getErrorByStatusCode=="function"?e.getErrorByStatusCode(R.code,R.message,R.traceId):null;throw T||new Error(`Tool ${String(f)} returned an error: ${JSON.stringify(S??b)}`)}return S}async function i(){const{client:d}=await t(),{tools:f}=await d.listTools();return f}async function l(){if(!("connection"in e))return i();const d=e.connection,f=JSON.stringify(d);try{return up.has(f)||up.set(f,i()),await up.get(f)}catch(m){console.error("Failed to list tools",m),up.delete(f);return}}async function u(){return(await l()??[]).map(f=>bC(f,a))}return a.asTool=async()=>{const f=(await l()??[]).find(m=>m.name===r);if(!f)throw new Error(`Tool ${r} not found`);return bC(f,a)},a}})}new Proxy({},{get(e,t){return t==="toJSON"?null:t==="forConnection"?n=>zte({connection:n}):global[t]}});function zte(e){return Ute(e)}const Vte=ce({id:D().describe("Unique identifier for the entity"),title:D().describe("Human-readable title for the entity"),description:D().nullish().describe("Description of the entity"),created_at:D().datetime(),updated_at:D().datetime(),created_by:D().optional(),updated_by:D().optional()}),Fte=ce({field:we(D()),operator:$t(["eq","gt","gte","lt","lte","in","like","contains"]),value:St()}),hP=pa(()=>Lt([Fte,ce({operator:$t(["and","or","not"]),conditions:we(hP)})])),Bte=ce({field:we(D()),direction:$t(["asc","desc"]),nulls:$t(["first","last"]).optional()}),qte=ce({where:hP.optional().describe("Filter expression"),orderBy:we(Bte).optional().describe("Sort expressions"),limit:Ze().int().min(1).max(1e3).optional().describe("Maximum number of items to return"),offset:Ze().int().min(0).optional().describe("Number of items to skip")});function Hte(e){return ce({items:we(e).describe("Array of collection items"),totalCount:Ze().int().min(0).optional().describe("Total number of matching items (if available)"),hasMore:ut().optional().describe("Whether there are more items available")})}const Gte=ce({id:D().describe("ID of the entity to retrieve")});function Zte(e){return ce({item:e.nullable().describe("The retrieved item, or null if not found")})}function Kte(e){return ce({data:e.partial().describe("Data for the new entity (id may be auto-generated)")})}function Wte(e){return ce({item:e.describe("The created entity with generated id")})}function Yte(e){return ce({id:D().describe("ID of the entity to update"),data:e.partial().describe("Partial entity data to update")})}function Qte(e){return ce({item:e.describe("The updated entity")})}const Xte=ce({id:D().describe("ID of the entity to delete")});function Jte(e){return ce({item:e.describe("The deleted entity")})}function ene(e,t,n){const r=e.toUpperCase(),a=n?.readOnly??!1,i=[{name:`COLLECTION_${r}_LIST`,inputSchema:qte,outputSchema:Hte(t)},{name:`COLLECTION_${r}_GET`,inputSchema:Gte,outputSchema:Zte(t)}];return a||i.push({name:`COLLECTION_${r}_CREATE`,inputSchema:Kte(t),outputSchema:Wte(t),opt:!0},{name:`COLLECTION_${r}_UPDATE`,inputSchema:Yte(t),outputSchema:Qte(t),opt:!0},{name:`COLLECTION_${r}_DELETE`,inputSchema:Xte,outputSchema:Jte(t),opt:!0}),i}const tne=ce({id:D(),name:D(),description:D().optional(),inputSchema:xt(D(),St()),outputSchema:xt(D(),St()).optional()}),nne=Vte.extend({_meta:ce({"io.decocms":ce({id:D(),verified:ut(),scopeName:D(),appName:D(),friendlyName:D().nullable().optional(),metadata:xt(D(),St()).nullable().optional(),publishedAt:D().datetime().optional(),updatedAt:D().datetime().optional(),tools:we(tne).nullable().optional().describe("Available tools exposed by this app")}).optional()}).optional(),server:ce({$schema:D().optional(),_meta:xt(D(),St()).optional(),name:D().describe("The server name (scope/app)"),title:D().optional().describe("User-friendly title"),description:D().optional().describe("Server description"),icons:we(ce({src:D(),mimeType:D().optional(),sizes:we(D()).optional(),theme:$t(["light","dark"]).optional()})).optional(),remotes:we(ce({type:$t(["http","stdio","sse"]),url:D().optional(),headers:we(St()).optional()})).optional(),packages:we(St()).optional(),repository:ce({url:D(),source:D().optional(),subfolder:D().optional()}).optional(),version:D().optional(),websiteUrl:D().optional()})});ene("registry_app",nne,{readOnly:!0});const rne=ce({specversion:je("1.0").describe("CloudEvents specification version"),id:D().describe("Unique identifier for this event (UUID recommended)"),source:D().describe("Connection ID of the event publisher"),type:D().describe("Event type (e.g., 'order.created', 'user.signup')"),time:D().datetime().optional().describe("Timestamp of when the event occurred (ISO 8601)"),subject:D().optional().describe("Subject/resource identifier (e.g., order ID, user ID)"),datacontenttype:D().optional().default("application/json").describe("Content type of the data attribute"),dataschema:D().url().optional().describe("URI to the schema for the data attribute"),data:St().optional().describe("Event payload (any JSON value)")});ce({events:we(rne).min(1).describe("Batch of CloudEvents to process")});const one=ce({success:ut().optional().describe("Whether this event was processed successfully"),error:D().optional().describe("Error message for this event"),retryAfter:Ze().int().positive().optional().describe("Re-deliver this event after this many ms")});ce({success:ut().optional().describe("Batch success - applies to events not in results"),error:D().optional().describe("Batch error message - applies to events not in results"),processedCount:Ze().int().min(0).optional().describe("Number of events successfully processed"),retryAfter:Ze().int().positive().optional().describe("Batch retryAfter - applies to events not in results"),results:xt(D(),one).optional().describe("Per-event results keyed by event ID")});ce({type:D().min(1).max(255).describe("Event type identifier"),subject:D().max(255).optional().describe("Subject/resource identifier (e.g., order ID)"),data:St().optional().describe("Event payload"),deliverAt:D().datetime().optional().describe("Scheduled delivery time (ISO 8601). Omit for immediate delivery."),cron:D().max(100).optional().describe("Cron expression for recurring delivery. Use EVENT_CANCEL to stop.")});ce({id:D().describe("Unique event ID"),type:D().describe("Event type"),source:D().describe("Source connection ID"),time:D().describe("Event timestamp")});ce({eventType:D().min(1).max(255).describe("Event type to subscribe to"),publisher:D().optional().describe("Filter events by publisher connection ID"),filter:D().max(1e3).optional().describe("JSONPath filter expression on event data")});ce({subscription:ce({id:D().describe("Subscription ID"),connectionId:D().describe("Subscriber connection ID"),eventType:D().describe("Event type pattern"),publisher:D().nullable().describe("Publisher connection filter"),filter:D().nullable().describe("JSONPath filter expression"),enabled:ut().describe("Whether subscription is enabled"),createdAt:D().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:D().datetime().describe("Updated timestamp (ISO 8601)")})});const ane=ce({eventType:D().min(1).max(255).describe("Event type to subscribe to"),publisher:D().optional().describe("Filter events by publisher connection ID"),filter:D().max(1e3).optional().describe("JSONPath filter expression on event data")}),sne=ce({id:D().describe("Subscription ID"),connectionId:D().describe("Subscriber connection ID"),eventType:D().describe("Event type pattern"),publisher:D().nullable().describe("Publisher connection filter"),filter:D().nullable().describe("JSONPath filter expression"),enabled:ut().describe("Whether subscription is enabled"),createdAt:D().datetime().describe("Created timestamp (ISO 8601)"),updatedAt:D().datetime().describe("Updated timestamp (ISO 8601)")});ce({subscriptions:we(ane).describe("Desired subscriptions - system will create/update/delete to match")});ce({created:Ze().int().min(0).describe("Number of subscriptions created"),updated:Ze().int().min(0).describe("Number of subscriptions with filter updated"),deleted:Ze().int().min(0).describe("Number of subscriptions removed"),unchanged:Ze().int().min(0).describe("Number of subscriptions unchanged"),subscriptions:we(sne).describe("Current subscriptions after sync")});ce({subscriptionId:D().describe("Subscription ID to remove")});ce({success:ut().describe("Whether unsubscribe was successful"),subscriptionId:D().describe("Subscription ID that was removed")});ce({eventId:D().describe("Event ID to cancel")});ce({success:ut().describe("Whether cancellation was successful"),eventId:D().describe("Event ID that was cancelled")});ce({eventId:D().describe("Event ID to acknowledge")});ce({success:ut().describe("Whether ACK was successful"),eventId:D().describe("Event ID that was acknowledged")});const ine=ce({prefix:D().optional().describe("Filter objects by prefix (e.g., 'folder/' for folder contents)"),maxKeys:Ze().optional().default(1e3).describe("Maximum number of keys to return (default: 1000)"),continuationToken:D().optional().describe("Token for pagination from previous response"),delimiter:D().optional().describe("Delimiter for grouping keys (typically '/'). When set, commonPrefixes returns folder paths.")}),lne=ce({objects:we(ce({key:D().describe("Object key/path"),size:Ze().describe("Object size in bytes"),lastModified:D().describe("Last modified timestamp"),etag:D().describe("Entity tag for the object")})),nextContinuationToken:D().optional().describe("Token for fetching next page of results"),isTruncated:ut().describe("Whether there are more results available"),commonPrefixes:we(D()).optional().describe("Folder paths when delimiter is used (e.g., ['photos/2024/', 'photos/2025/'])")}),cne=ce({key:D().describe("Object key/path to get metadata for")}),une=ce({contentType:D().optional().describe("MIME type of the object"),contentLength:Ze().describe("Size of the object in bytes"),lastModified:D().describe("Last modified timestamp"),etag:D().describe("Entity tag for the object"),metadata:xt(D(),D()).optional().describe("Custom metadata key-value pairs")}),dne=ce({key:D().describe("Object key/path to generate URL for"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)")}),fne=ce({url:D().describe("Presigned URL for downloading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),hne=ce({key:D().describe("Object key/path for the upload"),expiresIn:Ze().optional().describe("URL expiration time in seconds (default: from state config or 3600)"),contentType:D().optional().describe("MIME type for the object being uploaded")}),pne=ce({url:D().describe("Presigned URL for uploading the object"),expiresIn:Ze().describe("Expiration time in seconds that was used")}),mne=ce({key:D().describe("Object key/path to delete")}),gne=ce({success:ut().describe("Whether the deletion was successful"),key:D().describe("The key that was deleted")}),vne=ce({keys:we(D()).max(1e3).describe("Array of object keys/paths to delete (max 1000)")}),yne=ce({deleted:we(D()).describe("Array of successfully deleted keys"),errors:we(ce({key:D(),message:D()})).describe("Array of errors for failed deletions")}),_ne=[{name:"LIST_OBJECTS",inputSchema:ine,outputSchema:lne},{name:"GET_OBJECT_METADATA",inputSchema:cne,outputSchema:une},{name:"GET_PRESIGNED_URL",inputSchema:dne,outputSchema:fne},{name:"PUT_PRESIGNED_URL",inputSchema:hne,outputSchema:pne},{name:"DELETE_OBJECT",inputSchema:mne,outputSchema:gne},{name:"DELETE_OBJECTS",inputSchema:vne,outputSchema:yne}],pP=({size:e=24,color:t="currentColor",...n})=>A.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},A.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Z"}));pP.displayName="Folder";function wC(e,t,n){return e?e.startsWith("/")?`/${t}/${n}${e}`:e:`/${t}/${n}`}function bne(e){return{createRoutes:e,useParams:t=>Xl({strict:!1}),useSearch:t=>xm({strict:!1}),useNavigate:()=>{const t=yc(),{org:n,pluginId:r}=Xl({strict:!1});return a=>{const i=wC(a.to,n,r);return t({...a,to:i,params:{org:n,pluginId:r,...a.params}})}},useLocation:()=>pL(),Link:function(n){const{org:r,pluginId:a}=Xl({strict:!1}),i=wC(n.to,r,a);return x.jsx(Om,{...n,to:i,params:{org:r,pluginId:a,...n.params}})},_types:{routes:void 0,routeIds:void 0}}}const mP=A.createContext(null);function voe(e){const t=Ui.c(3),{value:n,children:r}=e,a=n;let i;return t[0]!==r||t[1]!==a?(i=x.jsx(mP.Provider,{value:a,children:r}),t[0]=r,t[1]=a,t[2]=i):i=t[2],i}function yoe(e){const t=A.useContext(mP);if(!t)throw new Error("usePluginContext must be used within a PluginContextProvider");if(!t.connectionId||!t.connection||!t.toolCaller)throw new Error("usePluginContext requires a valid connection. Use { partial: true } in empty state components.");return t}var Mt;(function(e){e.assertEqual=a=>{};function t(a){}e.assertIs=t;function n(a){throw new Error}e.assertNever=n,e.arrayToEnum=a=>{const i={};for(const l of a)i[l]=l;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),l={};for(const u of i)l[u]=a[u];return e.objectValues(l)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const l in a)Object.prototype.hasOwnProperty.call(a,l)&&i.push(l);return i},e.find=(a,i)=>{for(const l of a)if(i(l))return l},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function r(a,i=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Mt||(Mt={}));var SC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(SC||(SC={}));const Ve=Mt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ns=e=>{switch(typeof e){case"undefined":return Ve.undefined;case"string":return Ve.string;case"number":return Number.isNaN(e)?Ve.nan:Ve.number;case"boolean":return Ve.boolean;case"function":return Ve.function;case"bigint":return Ve.bigint;case"symbol":return Ve.symbol;case"object":return Array.isArray(e)?Ve.array:e===null?Ve.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ve.promise:typeof Map<"u"&&e instanceof Map?Ve.map:typeof Set<"u"&&e instanceof Set?Ve.set:typeof Date<"u"&&e instanceof Date?Ve.date:Ve.object;default:return Ve.unknown}},Ne=Mt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Za extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(i){return i.message},r={_errors:[]},a=i=>{for(const l of i.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)r._errors.push(n(l));else{let u=r,d=0;for(;d<l.path.length;){const f=l.path[d];d===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(l))):u[f]=u[f]||{_errors:[]},u=u[f],d++}}};return a(this),r}static assert(t){if(!(t instanceof Za))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Mt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];n[i]=n[i]||[],n[i].push(t(a))}else r.push(t(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Za.create=e=>new Za(e);const tb=(e,t)=>{let n;switch(e.code){case Ne.invalid_type:e.received===Ve.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Mt.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${Mt.joinValues(e.keys,", ")}`;break;case Ne.invalid_union:n="Invalid input";break;case Ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Mt.joinValues(e.options)}`;break;case Ne.invalid_enum_value:n=`Invalid enum value. Expected ${Mt.joinValues(e.options)}, received '${e.received}'`;break;case Ne.invalid_arguments:n="Invalid function arguments";break;case Ne.invalid_return_type:n="Invalid function return type";break;case Ne.invalid_date:n="Invalid date";break;case Ne.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Mt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ne.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ne.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ne.custom:n="Invalid input";break;case Ne.invalid_intersection_types:n="Intersection results could not be merged";break;case Ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,Mt.assertNever(e)}return{message:n}};let wne=tb;function Sne(){return wne}const Ene=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,i=[...n,...a.path||[]],l={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let u="";const d=r.filter(f=>!!f).slice().reverse();for(const f of d)u=f(l,{data:t,defaultError:u}).message;return{...a,path:i,message:u}};function De(e,t){const n=Sne(),r=Ene({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===tb?void 0:tb].filter(a=>!!a)});e.common.issues.push(r)}class oo{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const a of n){if(a.status==="aborted")return tt;a.status==="dirty"&&t.dirty(),r.push(a.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const a of n){const i=await a.key,l=await a.value;r.push({key:i,value:l})}return oo.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const a of n){const{key:i,value:l}=a;if(i.status==="aborted"||l.status==="aborted")return tt;i.status==="dirty"&&t.dirty(),l.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(r[i.value]=l.value)}return{status:t.value,value:r}}}const tt=Object.freeze({status:"aborted"}),ju=e=>({status:"dirty",value:e}),Co=e=>({status:"valid",value:e}),EC=e=>e.status==="aborted",RC=e=>e.status==="dirty",pc=e=>e.status==="valid",gm=e=>typeof Promise<"u"&&e instanceof Promise;var Ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ge||(Ge={}));class Hs{constructor(t,n,r,a){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const xC=(e,t)=>{if(pc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Za(e.common.issues);return this._error=n,this._error}}};function mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(l,u)=>{const{message:d}=e;return l.code==="invalid_enum_value"?{message:d??u.defaultError}:typeof u.data>"u"?{message:d??r??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:d??n??u.defaultError}},description:a}}class Ot{get description(){return this._def.description}_getType(t){return Ns(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ns(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new oo,ctx:{common:t.parent.common,data:t.data,parsedType:Ns(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(gm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ns(t)},a=this._parseSync({data:t,path:r.path,parent:r});return xC(r,a)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ns(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return pc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>pc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ns(t)},a=this._parse({data:t,path:r.path,parent:r}),i=await(gm(a)?a:Promise.resolve(a));return xC(r,i)}refine(t,n){const r=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,i)=>{const l=t(a),u=()=>i.addIssue({code:Ne.custom,...r(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(d=>d?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,a)=>t(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(t){return new gc({schema:this,typeName:nt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Vs.create(this,this._def)}nullable(){return vc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return da.create(this)}promise(){return bm.create(this,this._def)}or(t){return ym.create([this,t],this._def)}and(t){return _m.create(this,t,this._def)}transform(t){return new gc({...mt(this._def),schema:this,typeName:nt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ob({...mt(this._def),innerType:this,defaultValue:n,typeName:nt.ZodDefault})}brand(){return new Gne({typeName:nt.ZodBranded,type:this,...mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new ab({...mt(this._def),innerType:this,catchValue:n,typeName:nt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return K1.create(this,t)}readonly(){return sb.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Rne=/^c[^\s-]{8,}$/i,xne=/^[0-9a-z]+$/,Tne=/^[0-9A-HJKMNP-TV-Z]{26}$/i,One=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Cne=/^[a-z0-9_-]{21}$/i,Ane=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ine=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Nne=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kne="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let F0;const Mne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Pne=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Dne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Lne=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jne=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$ne=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gP="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Une=new RegExp(`^${gP}$`);function vP(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function zne(e){return new RegExp(`^${vP(e)}$`)}function Vne(e){let t=`${gP}T${vP(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Fne(e,t){return!!((t==="v4"||!t)&&Mne.test(e)||(t==="v6"||!t)&&Dne.test(e))}function Bne(e,t){if(!Ane.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||t&&a.alg!==t)}catch{return!1}}function qne(e,t){return!!((t==="v4"||!t)&&Pne.test(e)||(t==="v6"||!t)&&Lne.test(e))}class Ds extends Ot{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ve.string){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.string,received:i.parsedType}),tt}const r=new oo;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const l=t.data.length>i.value,u=t.data.length<i.value;(l||u)&&(a=this._getOrReturnCtx(t,a),l?De(a,{code:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&De(a,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Nne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"email",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")F0||(F0=new RegExp(kne,"u")),F0.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"emoji",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")One.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"uuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Cne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"nanoid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Rne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")xne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cuid2",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Tne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ulid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),De(a,{validation:"url",code:Ne.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"regex",code:Ne.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Vne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Une.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?zne(i).test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Ine.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"duration",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Fne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"ip",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?Bne(t.data,i.alg)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"jwt",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?qne(t.data,i.version)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"cidr",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?jne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?$ne.test(t.data)||(a=this._getOrReturnCtx(t,a),De(a,{validation:"base64url",code:Ne.invalid_string,message:i.message}),r.dirty()):Mt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(a=>t.test(a),{validation:n,code:Ne.invalid_string,...Ge.errToObj(r)})}_addCheck(t){return new Ds({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ge.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ge.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ge.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ge.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ge.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ge.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ge.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ge.errToObj(n)})}nonempty(t){return this.min(1,Ge.errToObj(t))}trim(){return new Ds({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ds({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ds({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ds.create=e=>new Ds({checks:[],typeName:nt.ZodString,coerce:e?.coerce??!1,...mt(e)});function Hne(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r,i=Number.parseInt(e.toFixed(a).replace(".","")),l=Number.parseInt(t.toFixed(a).replace(".",""));return i%l/10**a}class dd extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ve.number){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.number,received:i.parsedType}),tt}let r;const a=new oo;for(const i of this._def.checks)i.kind==="int"?Mt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?Hne(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_finite,message:i.message}),a.dirty()):Mt.assertNever(i);return{status:a.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new dd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new dd({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ge.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Mt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}dd.create=e=>new dd({checks:[],typeName:nt.ZodNumber,coerce:e?.coerce||!1,...mt(e)});class fd extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ve.bigint)return this._getInvalidInput(t);let r;const a=new oo;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Mt.assertNever(i);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Ve.bigint,received:n.parsedType}),tt}gte(t,n){return this.setLimit("min",t,!0,Ge.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ge.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ge.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ge.toString(n))}setLimit(t,n,r,a){return new fd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ge.toString(a)}]})}_addCheck(t){return new fd({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ge.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ge.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}fd.create=e=>new fd({checks:[],typeName:nt.ZodBigInt,coerce:e?.coerce??!1,...mt(e)});class nb extends Ot{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ve.boolean){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.boolean,received:r.parsedType}),tt}return Co(t.data)}}nb.create=e=>new nb({typeName:nt.ZodBoolean,coerce:e?.coerce||!1,...mt(e)});class vm extends Ot{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ve.date){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_type,expected:Ve.date,received:i.parsedType}),tt}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return De(i,{code:Ne.invalid_date}),tt}const r=new oo;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),De(a,{code:Ne.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Mt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new vm({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ge.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ge.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}vm.create=e=>new vm({checks:[],coerce:e?.coerce||!1,typeName:nt.ZodDate,...mt(e)});class TC extends Ot{_parse(t){if(this._getType(t)!==Ve.symbol){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.symbol,received:r.parsedType}),tt}return Co(t.data)}}TC.create=e=>new TC({typeName:nt.ZodSymbol,...mt(e)});class OC extends Ot{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.undefined,received:r.parsedType}),tt}return Co(t.data)}}OC.create=e=>new OC({typeName:nt.ZodUndefined,...mt(e)});class CC extends Ot{_parse(t){if(this._getType(t)!==Ve.null){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.null,received:r.parsedType}),tt}return Co(t.data)}}CC.create=e=>new CC({typeName:nt.ZodNull,...mt(e)});class AC extends Ot{constructor(){super(...arguments),this._any=!0}_parse(t){return Co(t.data)}}AC.create=e=>new AC({typeName:nt.ZodAny,...mt(e)});class IC extends Ot{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Co(t.data)}}IC.create=e=>new IC({typeName:nt.ZodUnknown,...mt(e)});class Gs extends Ot{_parse(t){const n=this._getOrReturnCtx(t);return De(n,{code:Ne.invalid_type,expected:Ve.never,received:n.parsedType}),tt}}Gs.create=e=>new Gs({typeName:nt.ZodNever,...mt(e)});class NC extends Ot{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.void,received:r.parsedType}),tt}return Co(t.data)}}NC.create=e=>new NC({typeName:nt.ZodVoid,...mt(e)});class da extends Ot{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),a=this._def;if(n.parsedType!==Ve.array)return De(n,{code:Ne.invalid_type,expected:Ve.array,received:n.parsedType}),tt;if(a.exactLength!==null){const l=n.data.length>a.exactLength.value,u=n.data.length<a.exactLength.value;(l||u)&&(De(n,{code:l?Ne.too_big:Ne.too_small,minimum:u?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(De(n,{code:Ne.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(De(n,{code:Ne.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((l,u)=>a.type._parseAsync(new Hs(n,l,n.path,u)))).then(l=>oo.mergeArray(r,l));const i=[...n.data].map((l,u)=>a.type._parseSync(new Hs(n,l,n.path,u)));return oo.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new da({...this._def,minLength:{value:t,message:Ge.toString(n)}})}max(t,n){return new da({...this._def,maxLength:{value:t,message:Ge.toString(n)}})}length(t,n){return new da({...this._def,exactLength:{value:t,message:Ge.toString(n)}})}nonempty(t){return this.min(1,t)}}da.create=(e,t)=>new da({type:e,minLength:null,maxLength:null,exactLength:null,typeName:nt.ZodArray,...mt(t)});function Zl(e){if(e instanceof Pn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Vs.create(Zl(r))}return new Pn({...e._def,shape:()=>t})}else return e instanceof da?new da({...e._def,type:Zl(e.element)}):e instanceof Vs?Vs.create(Zl(e.unwrap())):e instanceof vc?vc.create(Zl(e.unwrap())):e instanceof $i?$i.create(e.items.map(t=>Zl(t))):e}class Pn extends Ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Mt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ve.object){const f=this._getOrReturnCtx(t);return De(f,{code:Ne.invalid_type,expected:Ve.object,received:f.parsedType}),tt}const{status:r,ctx:a}=this._processInputParams(t),{shape:i,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof Gs&&this._def.unknownKeys==="strip"))for(const f in a.data)l.includes(f)||u.push(f);const d=[];for(const f of l){const m=i[f],p=a.data[f];d.push({key:{status:"valid",value:f},value:m._parse(new Hs(a,p,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof Gs){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of u)d.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(f==="strict")u.length>0&&(De(a,{code:Ne.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of u){const p=a.data[m];d.push({key:{status:"valid",value:m},value:f._parse(new Hs(a,p,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of d){const p=await m.key,g=await m.value;f.push({key:p,value:g,alwaysSet:m.alwaysSet})}return f}).then(f=>oo.mergeObjectSync(r,f)):oo.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Ge.errToObj,new Pn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const a=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Ge.errToObj(t).message??a}:{message:a}}}:{}})}strip(){return new Pn({...this._def,unknownKeys:"strip"})}passthrough(){return new Pn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Pn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Pn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:nt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Pn({...this._def,catchall:t})}pick(t){const n={};for(const r of Mt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Pn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Mt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Pn({...this._def,shape:()=>n})}deepPartial(){return Zl(this)}partial(t){const n={};for(const r of Mt.objectKeys(this.shape)){const a=this.shape[r];t&&!t[r]?n[r]=a:n[r]=a.optional()}return new Pn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Mt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Vs;)i=i._def.innerType;n[r]=i}return new Pn({...this._def,shape:()=>n})}keyof(){return yP(Mt.objectKeys(this.shape))}}Pn.create=(e,t)=>new Pn({shape:()=>e,unknownKeys:"strip",catchall:Gs.create(),typeName:nt.ZodObject,...mt(t)});Pn.strictCreate=(e,t)=>new Pn({shape:()=>e,unknownKeys:"strict",catchall:Gs.create(),typeName:nt.ZodObject,...mt(t)});Pn.lazycreate=(e,t)=>new Pn({shape:e,unknownKeys:"strip",catchall:Gs.create(),typeName:nt.ZodObject,...mt(t)});class ym extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function a(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const l=i.map(u=>new Za(u.ctx.common.issues));return De(n,{code:Ne.invalid_union,unionErrors:l}),tt}if(n.common.async)return Promise.all(r.map(async i=>{const l={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:l}),ctx:l}})).then(a);{let i;const l=[];for(const d of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=d._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&l.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=l.map(d=>new Za(d));return De(n,{code:Ne.invalid_union,unionErrors:u}),tt}}get options(){return this._def.options}}ym.create=(e,t)=>new ym({options:e,typeName:nt.ZodUnion,...mt(t)});function rb(e,t){const n=Ns(e),r=Ns(t);if(e===t)return{valid:!0,data:e};if(n===Ve.object&&r===Ve.object){const a=Mt.objectKeys(t),i=Mt.objectKeys(e).filter(u=>a.indexOf(u)!==-1),l={...e,...t};for(const u of i){const d=rb(e[u],t[u]);if(!d.valid)return{valid:!1};l[u]=d.data}return{valid:!0,data:l}}else if(n===Ve.array&&r===Ve.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const l=e[i],u=t[i],d=rb(l,u);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return n===Ve.date&&r===Ve.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class _m extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(i,l)=>{if(EC(i)||EC(l))return tt;const u=rb(i.value,l.value);return u.valid?((RC(i)||RC(l))&&n.dirty(),{status:n.value,value:u.data}):(De(r,{code:Ne.invalid_intersection_types}),tt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,l])=>a(i,l)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_m.create=(e,t,n)=>new _m({left:e,right:t,typeName:nt.ZodIntersection,...mt(n)});class $i extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.array)return De(r,{code:Ne.invalid_type,expected:Ve.array,received:r.parsedType}),tt;if(r.data.length<this._def.items.length)return De(r,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tt;!this._def.rest&&r.data.length>this._def.items.length&&(De(r,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((l,u)=>{const d=this._def.items[u]||this._def.rest;return d?d._parse(new Hs(r,l,r.path,u)):null}).filter(l=>!!l);return r.common.async?Promise.all(i).then(l=>oo.mergeArray(n,l)):oo.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new $i({...this._def,rest:t})}}$i.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $i({items:e,typeName:nt.ZodTuple,rest:null,...mt(t)})};class kC extends Ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.map)return De(r,{code:Ne.invalid_type,expected:Ve.map,received:r.parsedType}),tt;const a=this._def.keyType,i=this._def.valueType,l=[...r.data.entries()].map(([u,d],f)=>({key:a._parse(new Hs(r,u,r.path,[f,"key"])),value:i._parse(new Hs(r,d,r.path,[f,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const d of l){const f=await d.key,m=await d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const d of l){const f=d.key,m=d.value;if(f.status==="aborted"||m.status==="aborted")return tt;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),u.set(f.value,m.value)}return{status:n.value,value:u}}}}kC.create=(e,t,n)=>new kC({valueType:t,keyType:e,typeName:nt.ZodMap,...mt(n)});class hd extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.set)return De(r,{code:Ne.invalid_type,expected:Ve.set,received:r.parsedType}),tt;const a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(De(r,{code:Ne.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(De(r,{code:Ne.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const i=this._def.valueType;function l(d){const f=new Set;for(const m of d){if(m.status==="aborted")return tt;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const u=[...r.data.values()].map((d,f)=>i._parse(new Hs(r,d,r.path,f)));return r.common.async?Promise.all(u).then(d=>l(d)):l(u)}min(t,n){return new hd({...this._def,minSize:{value:t,message:Ge.toString(n)}})}max(t,n){return new hd({...this._def,maxSize:{value:t,message:Ge.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}hd.create=(e,t)=>new hd({valueType:e,minSize:null,maxSize:null,typeName:nt.ZodSet,...mt(t)});class MC extends Ot{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}MC.create=(e,t)=>new MC({getter:e,typeName:nt.ZodLazy,...mt(t)});class PC extends Ot{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return De(n,{received:n.data,code:Ne.invalid_literal,expected:this._def.value}),tt}return{status:"valid",value:t.data}}get value(){return this._def.value}}PC.create=(e,t)=>new PC({value:e,typeName:nt.ZodLiteral,...mt(t)});function yP(e,t){return new mc({values:e,typeName:nt.ZodEnum,...mt(t)})}class mc extends Ot{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{expected:Mt.joinValues(r),received:n.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{received:n.data,code:Ne.invalid_enum_value,options:r}),tt}return Co(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return mc.create(t,{...this._def,...n})}exclude(t,n=this._def){return mc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}mc.create=yP;class DC extends Ot{_parse(t){const n=Mt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ve.string&&r.parsedType!==Ve.number){const a=Mt.objectValues(n);return De(r,{expected:Mt.joinValues(a),received:r.parsedType,code:Ne.invalid_type}),tt}if(this._cache||(this._cache=new Set(Mt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const a=Mt.objectValues(n);return De(r,{received:r.data,code:Ne.invalid_enum_value,options:a}),tt}return Co(t.data)}get enum(){return this._def.values}}DC.create=(e,t)=>new DC({values:e,typeName:nt.ZodNativeEnum,...mt(t)});class bm extends Ot{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ve.promise&&n.common.async===!1)return De(n,{code:Ne.invalid_type,expected:Ve.promise,received:n.parsedType}),tt;const r=n.parsedType===Ve.promise?n.data:Promise.resolve(n.data);return Co(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}bm.create=(e,t)=>new bm({type:e,typeName:nt.ZodPromise,...mt(t)});class gc extends Ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===nt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:l=>{De(r,l),l.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const l=a.transform(r.data,i);if(r.common.async)return Promise.resolve(l).then(async u=>{if(n.value==="aborted")return tt;const d=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return d.status==="aborted"?tt:d.status==="dirty"||n.value==="dirty"?ju(d.value):d});{if(n.value==="aborted")return tt;const u=this._def.schema._parseSync({data:l,path:r.path,parent:r});return u.status==="aborted"?tt:u.status==="dirty"||n.value==="dirty"?ju(u.value):u}}if(a.type==="refinement"){const l=u=>{const d=a.refinement(u,i);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?tt:(u.status==="dirty"&&n.dirty(),l(u.value).then(()=>({status:n.value,value:u.value}))))}if(a.type==="transform")if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!pc(l))return tt;const u=a.transform(l.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>pc(l)?Promise.resolve(a.transform(l.value,i)).then(u=>({status:n.value,value:u})):tt);Mt.assertNever(a)}}gc.create=(e,t,n)=>new gc({schema:e,typeName:nt.ZodEffects,effect:t,...mt(n)});gc.createWithPreprocess=(e,t,n)=>new gc({schema:t,effect:{type:"preprocess",transform:e},typeName:nt.ZodEffects,...mt(n)});class Vs extends Ot{_parse(t){return this._getType(t)===Ve.undefined?Co(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Vs.create=(e,t)=>new Vs({innerType:e,typeName:nt.ZodOptional,...mt(t)});class vc extends Ot{_parse(t){return this._getType(t)===Ve.null?Co(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}vc.create=(e,t)=>new vc({innerType:e,typeName:nt.ZodNullable,...mt(t)});class ob extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ve.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ob.create=(e,t)=>new ob({innerType:e,typeName:nt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...mt(t)});class ab extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return gm(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Za(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Za(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ab.create=(e,t)=>new ab({innerType:e,typeName:nt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...mt(t)});class LC extends Ot{_parse(t){if(this._getType(t)!==Ve.nan){const r=this._getOrReturnCtx(t);return De(r,{code:Ne.invalid_type,expected:Ve.nan,received:r.parsedType}),tt}return{status:"valid",value:t.data}}}LC.create=e=>new LC({typeName:nt.ZodNaN,...mt(e)});class Gne extends Ot{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class K1 extends Ot{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?tt:i.status==="dirty"?(n.dirty(),ju(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?tt:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(t,n){return new K1({in:t,out:n,typeName:nt.ZodPipeline})}}class sb extends Ot{_parse(t){const n=this._def.innerType._parse(t),r=a=>(pc(a)&&(a.value=Object.freeze(a.value)),a);return gm(n)?n.then(a=>r(a)):r(n)}unwrap(){return this._def.innerType}}sb.create=(e,t)=>new sb({innerType:e,typeName:nt.ZodReadonly,...mt(t)});var nt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(nt||(nt={}));const Zne=Ds.create,Kne=nb.create;Gs.create;da.create;const Wne=Pn.create;ym.create;_m.create;$i.create;const Yne=mc.create;bm.create;Vs.create;vc.create;const Qne=Wne({path:Zne().optional().default(""),flat:Kne().optional().default(!1),view:Yne(["table","grid"]).optional().default("grid")}),Xne=bne(e=>{const{createRoute:t,lazyRouteComponent:n}=e.routing;return[t({getParentRoute:()=>e.parentRoute,path:"/",component:n(()=>ln(()=>import("./file-browser-DWYmbjoP.js").then(a=>a.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),validateSearch:Qne})]}),Jne=A.lazy(()=>ln(()=>import("./plugin-header-CAC6QLaV.js"),__vite__mapDeps([16,5,17]))),ere=A.lazy(()=>ln(()=>import("./plugin-empty-state-Dr-6CK5g.js"),[])),tre={id:"object-storage",description:"Browse and manage files in S3-compatible object storage",binding:_ne,renderHeader:e=>x.jsx(Jne,{...e}),renderEmptyState:()=>x.jsx(ere,{}),setup:e=>{const{registerRootSidebarItem:t,registerPluginRoutes:n}=e;t({icon:x.jsx(pP,{size:20}),label:"Files"});const r=Xne.createRoutes(e);n(r)}},nre="user-sandbox",rre="Create embeddable integration flows for platform end-users";var ore=(e,t,n,r,a,i,l,u)=>{let d=document.documentElement,f=["light","dark"];function m(y){(Array.isArray(e)?e:[e]).forEach(S=>{let w=S==="class",b=w&&i?a.map(E=>i[E]||E):a;w?(d.classList.remove(...b),d.classList.add(i&&i[y]?i[y]:y)):d.setAttribute(S,y)}),p(y)}function p(y){u&&f.includes(y)&&(d.style.colorScheme=y)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)m(r);else try{let y=localStorage.getItem(t)||n,S=l&&y==="system"?g():y;m(S)}catch{}},are=A.createContext(void 0),sre={setTheme:e=>{},themes:[]},_oe=()=>{var e;return(e=A.useContext(are))!=null?e:sre};A.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:l,themes:u,nonce:d,scriptProps:f})=>{let m=JSON.stringify([n,t,i,e,u,l,r,a]).slice(1,-1);return A.createElement("script",{...f,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${ore.toString()})(${m})`}})});const jC="org-admin",ire={from({org:e,project:t}){if(e?.includes("/")||t.includes("/"))throw new Error("Org or project cannot contain slashes");return`${e}/${t}`},parse(e){e.startsWith("/")&&(e=e.slice(1));const[t,n]=e.split("/");if(!t||!n)throw new Error("Invalid locator");return{org:t,project:n}},isOrgAdminProject(e){return e.split("/")[1]===jC},adminProject(e){return`${e}/${jC}`}},_P=A.createContext(void 0),boe=()=>{const e=A.useContext(_P);if(!e)throw new Error("useProjectContext must be used within a ProjectContextProvider");return e},woe=e=>{const t=Ui.c(10),{children:n,org:r,project:a}=e;let i;t[0]!==r.slug||t[1]!==a.slug?(i=ire.from({org:r.slug,project:a.slug}),t[0]=r.slug,t[1]=a.slug,t[2]=i):i=t[2];const l=i;let u;t[3]!==l||t[4]!==r||t[5]!==a?(u={org:r,project:a,locator:l},t[3]=l,t[4]=r,t[5]=a,t[6]=u):u=t[6];const d=u;let f;return t[7]!==n||t[8]!==d?(f=x.jsx(_P.Provider,{value:d,children:n}),t[7]=n,t[8]=d,t[9]=f):f=t[9],f},lre=ce({authorizationEndpoint:D().url(),tokenEndpoint:D().url(),introspectionEndpoint:D().url().optional(),clientId:D(),clientSecret:D().optional(),scopes:we(D()),grantType:$t(["authorization_code","client_credentials"])}),cre=ce({name:D(),description:D().optional(),inputSchema:xt(D(),St()),outputSchema:xt(D(),St()).optional()}),ure=ce({headers:xt(D(),D()).optional()}),dre=ce({command:D().describe("Command to run (e.g., 'npx', 'node')"),args:we(D()).optional().describe("Command arguments"),cwd:D().optional().describe("Working directory"),envVars:xt(D(),D()).optional().describe("Environment variables (encrypted in storage)")}),bP=ce({id:D().describe("Unique identifier for the connection"),title:D().describe("Human-readable name for the connection"),created_at:D().describe("When the connection was created"),updated_at:D().describe("When the connection was last updated"),created_by:D().describe("User ID who created the connection"),updated_by:D().optional().describe("User ID who last updated the connection"),organization_id:D().describe("Organization ID this connection belongs to"),description:D().nullable().describe("Description of the connection"),icon:D().nullable().describe("Icon URL for the connection"),app_name:D().nullable().describe("Associated app name"),app_id:D().nullable().describe("Associated app ID"),connection_type:$t(["HTTP","SSE","Websocket","STDIO","VIRTUAL"]).describe("Type of connection"),connection_url:D().nullable().describe("URL for HTTP/SSE/WebSocket connections. virtual://$id for VIRTUAL. Null for STDIO."),connection_token:D().nullable().describe("Authentication token (for HTTP connections)"),connection_headers:Lt([dre,ure]).nullable().describe("Connection parameters. HTTP: { headers }. STDIO: { command, args, cwd, envVars }"),oauth_config:lre.nullable().describe("OAuth configuration"),configuration_state:xt(D(),St()).nullable().describe("Configuration state (decrypted)"),configuration_scopes:we(D()).nullable().optional().describe("Configuration scopes"),metadata:xt(D(),St()).nullable().describe("Additional metadata (includes repository info)"),tools:we(cre).nullable().describe("Discovered tools from MCP"),bindings:we(D()).nullable().describe("Detected bindings"),status:$t(["active","inactive","error"]).describe("Current status")});bP.omit({created_at:!0,updated_at:!0,created_by:!0,updated_by:!0,organization_id:!0,tools:!0,bindings:!0,status:!0}).partial({id:!0,description:!0,icon:!0,app_name:!0,app_id:!0,connection_url:!0,connection_token:!0,connection_headers:!0,oauth_config:!0,configuration_state:!0,configuration_scopes:!0,metadata:!0});bP.partial();function Soe(e){return e!=null&&"command"in e}function Eoe(e){return!e||!e.startsWith("virtual://")?null:e.replace("virtual://","")}const fre=ce({connection_id:D().describe("Connection ID"),selected_tools:we(D()).nullable().describe("Selected tool names. null = all tools included, array = only these tools included"),selected_resources:we(D()).nullable().describe("Selected resource URIs or patterns. Supports * and ** wildcards for pattern matching. null = all resources included, array = only these resources included"),selected_prompts:we(D()).nullable().describe("Selected prompt names. null = all prompts included, array = only these prompts included")});ce({id:D().describe("Unique identifier for the virtual MCP"),title:D().describe("Human-readable name for the virtual MCP"),description:D().nullable().describe("Description of the virtual MCP"),icon:D().nullable().describe("Icon URL for the virtual MCP"),created_at:D().describe("When the virtual MCP was created"),updated_at:D().describe("When the virtual MCP was last updated"),created_by:D().describe("User ID who created the virtual MCP"),updated_by:D().optional().describe("User ID who last updated the virtual MCP"),organization_id:D().describe("Organization ID this virtual MCP belongs to"),status:$t(["active","inactive"]).describe("Current status"),metadata:ce({instructions:D().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:we(fre).describe("Connections with their selected tools, resources, and prompts")});ce({title:D().min(1).max(255).describe("Name for the virtual MCP"),description:D().nullable().optional().describe("Optional description"),icon:D().nullable().optional().describe("Optional icon URL"),status:$t(["active","inactive"]).optional().default("active").describe("Initial status"),metadata:ce({instructions:D().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:we(ce({connection_id:D().describe("Connection ID"),selected_tools:we(D()).nullable().optional().describe("Selected tool names (null/undefined = all tools or full exclusion)"),selected_resources:we(D()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources)"),selected_prompts:we(D()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts or full exclusion)")})).describe("Connections to include/exclude (can be empty for exclusion mode)")});ce({title:D().min(1).max(255).optional().describe("New name"),description:D().nullable().optional().describe("New description (null to clear)"),icon:D().nullable().optional().describe("New icon URL (null to clear)"),status:$t(["active","inactive"]).optional().describe("New status"),metadata:ce({instructions:D().optional().describe("MCP server instructions")}).nullable().optional().describe("Additional metadata including MCP server instructions"),connections:we(ce({connection_id:D().describe("Connection ID"),selected_tools:we(D()).nullable().optional().describe("Selected tool names (null/undefined = all tools included)"),selected_resources:we(D()).nullable().optional().describe("Selected resource URIs or patterns with * and ** wildcards (null/undefined = all resources included)"),selected_prompts:we(D()).nullable().optional().describe("Selected prompt names (null/undefined = all prompts included)")})).optional().describe("New connections (replaces existing)")});var $C;(function(e){e.Completable="McpCompletable"})($C||($C={}));const hre=[],pre={id:nre,description:rre,binding:hre},mre=[tre,pre],qi=tL({component:()=>x.jsxs(aQ,{children:[x.jsx(A.Suspense,{fallback:x.jsx(S4,{}),children:x.jsx(_A,{})}),x.jsx(sQ,{})]})}),gre=dn({getParentRoute:()=>qi,path:"/login",component:vn(()=>ln(()=>import("./login-D61ut3BQ.js"),__vite__mapDeps([18,15,3,19]))),validateSearch:pa(()=>ce({next:D().optional(),client_id:D().optional(),redirect_uri:D().optional(),response_type:D().optional(),state:D().optional(),scope:D().optional(),code_challenge:D().optional(),code_challenge_method:D().optional()}))}),vre=dn({getParentRoute:()=>qi,path:"/auth/$pathname",component:vn(()=>ln(()=>import("./auth-catchall-COlMpx6Y.js"),[]))}),yre=dn({getParentRoute:()=>qi,path:"/connect/$sessionId",component:vn(()=>ln(()=>import("./connect-Dx3Myol5.js"),__vite__mapDeps([20,21,15,3,22,23,24])))}),_re=dn({getParentRoute:()=>qi,path:"/store/$appName",component:vn(()=>ln(()=>import("./store-invite-DnYGNBjx.js"),[])),validateSearch:pa(()=>ce({serverName:D().optional()}))}),xr=dn({getParentRoute:()=>qi,id:"shell",component:vn(()=>ln(()=>import("./shell-layout-C-8OlUFV.js"),__vite__mapDeps([25,26,3,27,28,29,30,31,15,21,32,33,34,35,2,36,19,37,38,39,5,17,40,7,41,42,43,44,45,46,47,48,6,49,50,51,52,53,54,55,13,56,57,58,59,60,61,62,63,64,10,65,66,67,68,69,70,71,72])))}),bre=dn({getParentRoute:()=>xr,path:"/",component:vn(()=>ln(()=>import("./home-Dh3O7N9x.js"),__vite__mapDeps([73,22,3,67,6,5,57,42,62,19,65,66,47,43,15])))}),wre=dn({getParentRoute:()=>xr,path:"/$org",component:vn(()=>ln(()=>import("./page-BQkgsSw9.js"),__vite__mapDeps([74,26,3,27,28,29,30,31,15,21,32,33,34,35,2,36,19,37,38,39,5,17,40,7,41,42,43,44,45,46,47,48,6,49,50,51,52,53,54,55,13,56,57,59,75,76])))}),Sre=dn({getParentRoute:()=>xr,path:"/$org/members",component:vn(()=>ln(()=>import("./members-DqAGtLhZ.js"),__vite__mapDeps([77,78,79,3,68,7,49,5,11,39,80,81,82,12,42,19,83,48,4,84,32,31,15,21,29,85,67,60,66,46,27,86,87,57,13,70,45,47,38,17,88,22,89,90,62])))}),Ere=dn({getParentRoute:()=>xr,path:"/$org/mcps",component:vn(()=>ln(()=>import("./connections-xwpD87cp.js"),__vite__mapDeps([91,78,79,3,68,7,49,5,11,39,80,81,82,12,42,19,83,92,22,48,45,33,34,93,63,31,15,21,29,32,66,60,46,27,47,89,94,53,13,38,17,88,55,95,57]))),validateSearch:pa(()=>ce({action:$t(["create"]).optional()}))}),Rre=dn({getParentRoute:()=>xr,path:"/$org/settings",component:vn(()=>ln(()=>import("./settings-zvu2qyde.js"),__vite__mapDeps([96,78,79,3,68,7,49,5,11,39,80,81,15,47,19,14,27])))}),xre=dn({getParentRoute:()=>xr,path:"/$org/settings/plugins",component:vn(()=>ln(()=>import("./plugins-57qT4Dil.js"),__vite__mapDeps([97,78,79,3,68,7,49,5,11,39,80,81,64,15,29,70,84])))}),Tre=dn({getParentRoute:()=>xr,path:"/$org/monitoring",component:vn(()=>ln(()=>import("./monitoring-DkEahA8B.js"),__vite__mapDeps([98,78,79,3,68,7,49,5,11,39,80,81,82,12,42,19,48,45,60,17,37,52,8,99,90,100,54,43,101,85,35,2,32,31,15,21,29,30,71,57,13,4,38,102,88,103,51]))),validateSearch:pa(()=>ce({tab:$t(["logs","analytics"]).default("logs"),from:D().default("now-24h"),to:D().default("now"),connectionId:we(D()).optional().default([]),virtualMcpId:we(D()).optional().default([]),tool:D().default(""),status:$t(["all","success","errors"]).default("all"),search:D().default(""),page:Ze().optional(),streaming:ut().default(!0),propertyFilters:D().default("")}))}),wP=dn({getParentRoute:()=>xr,path:"/$org/store",component:vn(()=>ln(()=>import("./page-DWOf0lbq.js"),__vite__mapDeps([104,78,79,3,68,7,49,5,11,39,80,99,61,12,42,1,2,94,29,32,31,15,21,105,82,19,106,87,57,53,22,48,107,37,17,62,38,33,34,36])))}),Ore=dn({getParentRoute:()=>wP,path:"/$appName",component:vn(()=>ln(()=>import("./mcp-server-detail-Bq0lDMH3.js"),__vite__mapDeps([108,6,12,3,84,48,109,110,107,94,29,55,17,57,68,7,69,111,21,40,79,49,5,11,39,80,82,42,19,83,22,112,113,103,60,106,87,53,33,34,31,15,32,36,105,114]))),validateSearch:pa(()=>ce({registryId:D().optional(),serverName:D().optional(),itemId:D().optional()}))}),Cre=dn({getParentRoute:()=>xr,path:"/$org/mcps/$connectionId",component:vn(()=>ln(()=>import("./connection-detail-BAO1w9SL.js"),__vite__mapDeps([115,48,3,45,33,34,116,23,95,19,57,13,31,15,21,29,32,117,39,75,64,40,90,12,112,84,60,68,7,47,38,5,17,109,110,107,94,55,53,51,30,101,24,118,26,27,28,35,2,36,37,41,42,43,44,46,6,49,50,52,54,56,103,119,79,11,80,82,22,89,93,63,83,120,61,67,66,111,113]))),validateSearch:pa(()=>ce({tab:D().optional()}))}),Are=dn({getParentRoute:()=>xr,path:"/$org/mcps/$connectionId/$collectionName/$itemId",component:vn(()=>ln(()=>import("./collection-detail-CeAvZaUS.js"),__vite__mapDeps([121,48,3,45,31,15,21,29,117,39,75,64,47,19,88,122,112,84,38,5,17,6,54,43,71,52,12,100,62,116,23,95,57,13,33,34,32,40,90,60,68,7,109,110,107,94,55,53,51,30,101,24,118,26,27,28,35,2,36,37,41,42,44,46,49,50,56,120,72,80,102,86]))),validateSearch:pa(()=>ce({replayId:D().optional()}))}),Ire=dn({getParentRoute:()=>xr,path:"/$org/agents",component:vn(()=>ln(()=>import("./agents-DepniFRU.js"),__vite__mapDeps([123,78,79,3,68,7,49,5,11,39,80,81,82,12,42,19,83,92,22,48,45,93,63,56,30,31,15,21,29,66,60,89,13,51]))),validateSearch:pa(()=>ce({action:$t(["create"]).optional()}))}),Nre=dn({getParentRoute:()=>xr,path:"/$org/agents/$agentId",component:vn(()=>ln(()=>import("./agent-detail-pV-lC3Zh.js"),__vite__mapDeps([124,28,29,30,31,15,21,32,33,34,35,2,36,3,19,37,38,39,5,17,40,7,41,42,48,45,117,75,64,58,60,70,88,9,122,12,100,57,76,112,84,82,4,46,27,44,105,118,71,52,114]))),validateSearch:pa(()=>ce({tab:D().optional()}))}),kre=dn({getParentRoute:()=>xr,path:"/$org/workflows",component:vn(()=>ln(()=>import("./workflow-BuhbYm_s.js"),__vite__mapDeps([125,29,119,55,79,3,68,7,49,5,11,39,80,82,12,42,19,22,48,52,89,50,93,63,13,83,120,61,67,21,117,75,64,15,31,32,110,66,57,112,84,78,33,34])))}),SP=dn({getParentRoute:()=>xr,path:"/$org/$pluginId",component:vn(()=>ln(()=>import("./dynamic-plugin-layout-D5OcFZH0.js"),__vite__mapDeps([126,12,34,36,21,15,32,31,29])))}),Mre=[],EP=[];mre.forEach(e=>{if(!e.setup)return;const t={parentRoute:SP,routing:{createRoute:dn,lazyRouteComponent:vn},registerRootSidebarItem:n=>Mre.push({pluginId:e.id,...n}),registerPluginRoutes:n=>{EP.push(...n)}};e.setup(t)});const Pre=SP.addChildren(EP),Dre=dn({getParentRoute:()=>qi,path:"/oauth/callback",component:vn(()=>ln(()=>import("./oauth-callback-C_OPSpWp.js"),__vite__mapDeps([127,12,23])))}),Lre=wP.addChildren([Ore]),jre=xr.addChildren([bre,wre,Sre,Ere,Ire,Nre,Tre,Lre,Rre,xre,kre,Cre,Are,Pre]),$re=qi.addChildren([jre,gre,vre,Dre,yre,_re]),Ure=uL({routeTree:$re}),zre=document.getElementById("root");GD.createRoot(zre).render(x.jsx(A.StrictMode,{children:x.jsx(hL,{router:Ure})}));export{Kre as $,coe as A,Ck as B,bP as C,Qa as D,Fi as E,TZ as F,mk as G,ZB as H,DH as I,QB as J,QC as K,ire as L,eoe as M,Zre as N,jC as O,woe as P,WB as Q,PH as R,S4 as S,XB as T,YB as U,KB as V,toe as W,N5 as X,O5 as Y,wN as Z,$t as _,Xl as a,jr as a$,Vte as a0,ZG as a1,KG as a2,WG as a3,YG as a4,QG as a5,aoe as a6,soe as a7,ioe as a8,ooe as a9,wH as aA,Vb as aB,vk as aC,LN as aD,Fb as aE,rd as aF,ON as aG,zb as aH,Ub as aI,SH as aJ,EH as aK,uZ as aL,dZ as aM,cZ as aN,Jre as aO,Xre as aP,Qre as aQ,voe as aR,_A as aS,mre as aT,E$ as aU,kA as aV,pd as aW,q0 as aX,Wu as aY,p5 as aZ,or as a_,y5 as aa,Tm as ab,pP as ac,RM as ad,TM as ae,u5 as af,ix as ag,qre as ah,Bre as ai,gte as aj,wte as ak,moe as al,Ci as am,hT as an,Om as ao,ut as ap,xt as aq,St as ar,Lt as as,eZ as at,YV as au,KV as av,WV as aw,fN as ax,Tk as ay,Us as az,uoe as b,Qq as b$,r5 as b0,Mre as b1,ib as b2,ht as b3,Go as b4,JN as b5,Zo as b6,kte as b7,sP as b8,Rr as b9,KW as bA,loe as bB,fY as bC,vr as bD,Gre as bE,BV as bF,VV as bG,jV as bH,VC as bI,b5 as bJ,E5 as bK,C5 as bL,R5 as bM,x5 as bN,I5 as bO,lx as bP,A5 as bQ,T5 as bR,GV as bS,zJ as bT,oP as bU,pt as bV,kee as bW,Vre as bX,pA as bY,Zs as bZ,Ga as b_,ene as ba,eo as bb,VI as bc,ar as bd,Ze as be,je as bf,pa as bg,gd as bh,mr as bi,yoe as bj,Xne as bk,ln as bl,zr as bm,_oe as bn,aV as bo,Ka as bp,Td as bq,_d as br,Fre as bs,ee as bt,Ite as bu,d7 as bv,Yre as bw,XI as bx,ZI as by,Wre as bz,Ui as c,Yq as c0,Wq as c1,sO as c2,Xq as c3,noe as c4,Jq as c5,roe as c6,tH as c7,rZ as c8,gA as c9,nO as ca,oH as cb,Yo as cc,od as cd,Qb as ce,uc as cf,qs as cg,ha as ch,Qo as ci,ak as cj,sH as ck,cH as cl,iH as cm,Kq as cn,poe as co,doe as d,foe as e,xm as f,Dj as g,ga as h,Soe as i,x as j,ma as k,yc as l,Hre as m,we as n,ce as o,Eoe as p,YC as q,A as r,D as s,yF as t,boe as u,ek as v,bd as w,hn as x,Bn as y,it as z};