decocms 3.18.4 → 3.18.5

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 (230) hide show
  1. package/dist/client/assets/{AlertCircle-DBLUz--u.js → AlertCircle-CslgXeHr.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-l-GcKPYK.js → ArrowUpRight-D_DImXhK.js} +1 -1
  3. package/dist/client/assets/{Check-BxIVbrMR.js → Check-C4hca_-Y.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-rFqh1KDn.js → CheckCircle-HpSNY8ij.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-P5aorJ8-.js → ChevronDown-Dxt-1uCb.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-e8a25ahy.js → ChevronLeft-B5zdF1BR.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-WB5knV5A.js → ChevronRight-CyvrXAe0.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-nQBmktAW.js → ChevronUp-aKq1AYju.js} +1 -1
  9. package/dist/client/assets/{Container-Dls_ClFq.js → Container-DXqMOloC.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-CxHHcGx6.js → DotsVertical-Bo9Tm-x1.js} +1 -1
  11. package/dist/client/assets/{Eye-EKPlnsLc.js → Eye-CBgMpWUe.js} +1 -1
  12. package/dist/client/assets/{FilterLines-DqQIAzT9.js → FilterLines-CWMZctUn.js} +1 -1
  13. package/dist/client/assets/{Globe01-Tm1ARX4Z.js → Globe01-BgNeS-t5.js} +1 -1
  14. package/dist/client/assets/{HardDrive-JzeH-CyJ.js → HardDrive-skQdR31x.js} +1 -1
  15. package/dist/client/assets/{Key01-CeoBFgZd.js → Key01-CxukwP00.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-xp2y9xUi.js → LayoutLeft-CmXWN8pg.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-BrCQL34C.js → LinkExternal01-l_9oMYRN.js} +1 -1
  18. package/dist/client/assets/{Monitor01-DhIohKdB.js → Monitor01-DIoPLr7l.js} +1 -1
  19. package/dist/client/assets/{Palette-DcvO-xme.js → Palette-BTCzP1Gm.js} +1 -1
  20. package/dist/client/assets/{Play-Cl-75oPS.js → Play-DSJB4Nw2.js} +1 -1
  21. package/dist/client/assets/{Plus-DMk97-_x.js → Plus-BUBMXRTd.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-BKQsxntF.js → RefreshCcw01-JqGzzm_-.js} +1 -1
  23. package/dist/client/assets/{SearchMd-D5J9uZcf.js → SearchMd-CGISNeet.js} +1 -1
  24. package/dist/client/assets/{Settings02-VViB9t6t.js → Settings02-C4ziU-d4.js} +1 -1
  25. package/dist/client/assets/{Shield01-D5gYDa2-.js → Shield01-IwIv25Jp.js} +1 -1
  26. package/dist/client/assets/{Star01--s8ZFg64.js → Star01-J_T9yrd1.js} +1 -1
  27. package/dist/client/assets/{Stars01-BidgaxVI.js → Stars01-BjgHV0Ah.js} +1 -1
  28. package/dist/client/assets/{Stars02-CIMeB8Tw.js → Stars02-CUXVM8eC.js} +1 -1
  29. package/dist/client/assets/{Sun-F5_OmHwF.js → Sun-BzriIyyb.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-BDAEnkfq.js → SwitchHorizontal01-CxiFSSn6.js} +1 -1
  31. package/dist/client/assets/{Tool01-BgJ0N26M.js → Tool01-BO2C1HmC.js} +1 -1
  32. package/dist/client/assets/{Trash01-C7l0NheK.js → Trash01-DeyjRbcU.js} +1 -1
  33. package/dist/client/assets/{Upload01-BpTwEhwN.js → Upload01-C4K5hWSL.js} +1 -1
  34. package/dist/client/assets/{User01-61G-I9Nt.js → User01-CyAUnciz.js} +1 -1
  35. package/dist/client/assets/{Users01-DedWtozu.js → Users01-CCUr4Yur.js} +1 -1
  36. package/dist/client/assets/{Users03-DhyPNTfH.js → Users03-Cwd2CyYY.js} +1 -1
  37. package/dist/client/assets/{X-gpy8SRoe.js → X-BoM0MLQn.js} +1 -1
  38. package/dist/client/assets/{XCircle-B8hhQ7We.js → XCircle-DZ20_zb3.js} +1 -1
  39. package/dist/client/assets/{XClose-BIl1LPyR.js → XClose-BLi9vIRd.js} +1 -1
  40. package/dist/client/assets/{Zap-DRW8v7hZ.js → Zap-CrVhQ07E.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-DwVlJ80d.js → ZapSquare-CqyHqTSv.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-CTra4wHa.js → ZoomOut-D1C0CDzK.js} +1 -1
  43. package/dist/client/assets/{access-gate-uwoZnAgx.js → access-gate-rgO__BFd.js} +1 -1
  44. package/dist/client/assets/{accordion-B0fd1tnF.js → accordion-CAJ4g4RV.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-DiKHi0M1.js → add-section-modal-fGEm5qce.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-BjTqE21c.js → agent-capabilities-Dl7XXwpG.js} +1 -1
  47. package/dist/client/assets/{agent-icon-DZCJD2_a.js → agent-icon-C7paq9nL.js} +1 -1
  48. package/dist/client/assets/{agent-icons-jN-Zyl-6.js → agent-icons-hJ9xtdfo.js} +1 -1
  49. package/dist/client/assets/{agents-list-B-auSMeU.js → agents-list-BuXi88Zq.js} +1 -1
  50. package/dist/client/assets/{ai-providers-9z8nTePs.js → ai-providers-C_J38hfO.js} +1 -1
  51. package/dist/client/assets/{alert-CXw2R1J0.js → alert-1jxJJFv9.js} +1 -1
  52. package/dist/client/assets/{alert-dialog-BEqZ9uGO.js → alert-dialog-DOf1CDFG.js} +1 -1
  53. package/dist/client/assets/app-editor-B9HEmwg1.js +1 -0
  54. package/dist/client/assets/{auth-catchall-Bfw73AGa.js → auth-catchall-CAKyNWmQ.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-BReVBoRk.js → auth-split-layout-DDzFkzzL.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-DijFSvDw.js → automation-list-row-D730hoTt.js} +1 -1
  57. package/dist/client/assets/{automation-runs-hCC2W9Z-.js → automation-runs-BeoB4dd9.js} +1 -1
  58. package/dist/client/assets/{automations-CmCVzo7I.js → automations-3aEV0B6i.js} +1 -1
  59. package/dist/client/assets/{avatar-Bcbs0fiL.js → avatar-BOZs09SE.js} +1 -1
  60. package/dist/client/assets/{badge-BARx7FvE.js → badge-Cf9p2KiH.js} +1 -1
  61. package/dist/client/assets/{brand-context-DdQzgdZa.js → brand-context-70H_l0C5.js} +1 -1
  62. package/dist/client/assets/{buckets-uoDmahjJ.js → buckets-AML8oaPV.js} +1 -1
  63. package/dist/client/assets/{calendar-B30GJXaY.js → calendar-BO9tcRYu.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-ClqXQbgV.js → capability-load-error-atGCCjOU.js} +1 -1
  65. package/dist/client/assets/{card-opRPZv32.js → card-wIb7H0Z4.js} +1 -1
  66. package/dist/client/assets/{chat-context-BbbKc5EF.js → chat-context-D4Cm-d6A.js} +1 -1
  67. package/dist/client/assets/{checkbox-wlYL0b3G.js → checkbox-BwSTMmic.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Bs1_vcy6.js → cli-auth-success-CCe8_B5U.js} +1 -1
  69. package/dist/client/assets/{collection-detail-C2S9fIG-.js → collection-detail-DS8OFm3e.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-Cay-ZdpD.js → collection-display-button-DUh8mQez.js} +1 -1
  71. package/dist/client/assets/{collection-search-C3Lp1ZRv.js → collection-search-CUV3pFhw.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-BnCe5cyI.js → collection-table-wrapper-afuL1hQ0.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-BoQd-dND.js → collection-tabs-CGllLoge.js} +1 -1
  74. package/dist/client/assets/{collections-BaDzxzwW.js → collections-D8RfaH_g.js} +1 -1
  75. package/dist/client/assets/{command-DWpPyJE7.js → command-C-yJHbpu.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-Cy-b1jPM.js → connect-desktop-dialog-hVZb8AY9.js} +1 -1
  77. package/dist/client/assets/{connection-card-BI-CSazh.js → connection-card-vgtnONDT.js} +1 -1
  78. package/dist/client/assets/{connection-detail-OEPQ1Wwv.js → connection-detail-3pdA1O-Y.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-CbxXqT_u.js → connection-form-helpers-oCzpRzHj.js} +1 -1
  80. package/dist/client/assets/{connections-XD7RqsTp.js → connections-kCOJLbco.js} +1 -1
  81. package/dist/client/assets/{constants-Cee8XKoZ.js → constants-CnOnAK7r.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DiOxs3f4.js → decopilot-sse-pool-Bdv0H274.js} +1 -1
  83. package/dist/client/assets/{dialog-CFcYm0YL.js → dialog-CvEIov2R.js} +1 -1
  84. package/dist/client/assets/{domain-settings-BeRCH_mn.js → domain-settings-DOArz2KT.js} +1 -1
  85. package/dist/client/assets/{drawer-CG7DFuyM.js → drawer-B_9l3ZhB.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-CKTrR8YS.js → dropdown-menu-BGgFPqgI.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-7IcBH65R.js → dynamic-plugin-layout-Bx-gzGnq.js} +1 -1
  88. package/dist/client/assets/{empty-state-74R-YcQz.js → empty-state-BWGtqxUL.js} +1 -1
  89. package/dist/client/assets/{empty-state-D653N76e.js → empty-state-Db1HVS3F.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-BpQPulqJ.js → extract-connection-data-CaeplLEr.js} +1 -1
  91. package/dist/client/assets/{features-DC4Mx65d.js → features-PxgwX_yM.js} +1 -1
  92. package/dist/client/assets/{file-explorer-DI37WbgR.js → file-explorer-D4X9mNUX.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-fKTDY3M7.js → file-type-icon-CUYwtPob.js} +1 -1
  94. package/dist/client/assets/{files-ermEyeeq.js → files-BrehNRKw.js} +1 -1
  95. package/dist/client/assets/{form-BOkSmTHo.js → form-BRW-mO5v.js} +1 -1
  96. package/dist/client/assets/{general-CIbzkCUo.js → general-BZO56fxW.js} +1 -1
  97. package/dist/client/assets/{generate-id-CvWg9hET.js → generate-id-CdTqgONK.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-qlUkWRPg.js → github-repo-picker-hw4e_RVO.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-C4vmTyQ-.js → header-tab-button-IP2RhXhm.js} +1 -1
  100. package/dist/client/assets/{hover-card-BQqzA1_o.js → hover-card-BMrhboDz.js} +1 -1
  101. package/dist/client/assets/{image-field-DKZ33h0l.js → image-field-BhWuARh_.js} +1 -1
  102. package/dist/client/assets/{index-6hdndQvf.js → index-37PxaG4U.js} +1 -1
  103. package/dist/client/assets/{index-DAqM6n6y.js → index-BHdQPz7N.js} +1 -1
  104. package/dist/client/assets/{index-CdECG0JX.js → index-Bn8JFywe.js} +1 -1
  105. package/dist/client/assets/{index-o8XwCFMV.js → index-BuKZbcmU.js} +1 -1
  106. package/dist/client/assets/{index-BtYLUKbU.js → index-BvZc_M4M.js} +4 -4
  107. package/dist/client/assets/{index-9yLZw74n.js → index-C9Lj6Jk-.js} +1 -1
  108. package/dist/client/assets/{index-Bp-x4MAC.js → index-CLjpFTJZ.js} +1 -1
  109. package/dist/client/assets/{index-BNRdhvYz.js → index-CNQY6k_W.js} +1 -1
  110. package/dist/client/assets/{index-CcNaSzIS.js → index-CcJv2Spi.js} +1 -1
  111. package/dist/client/assets/{index-DcdwlrBS.js → index-Cueugb-e.js} +1 -1
  112. package/dist/client/assets/{index-DI_C2zjL.js → index-D6_5HAZl.js} +3 -3
  113. package/dist/client/assets/{index-B6UNbCvs.js → index-XuzNc7bG.js} +1 -1
  114. package/dist/client/assets/{index-BEJQhciB.js → index-b-XqjXTb.js} +1 -1
  115. package/dist/client/assets/{index-redirect-Db4r9v6-.js → index-redirect-CG43pYY_.js} +1 -1
  116. package/dist/client/assets/{index-BvVmJXZO.js → index-t0gLDn-a.js} +1 -1
  117. package/dist/client/assets/{index-DKAPjhpZ.js → index-z0IJb09y.js} +1 -1
  118. package/dist/client/assets/{infiniteQueryObserver-UtxmrGCk.js → infiniteQueryObserver-Bc9cuK8G.js} +1 -1
  119. package/dist/client/assets/{input-D6XA36wX.js → input-CL16zv3M.js} +1 -1
  120. package/dist/client/assets/{integration-icon-CDYbzYpO.js → integration-icon-CQ-NchIr.js} +1 -1
  121. package/dist/client/assets/{label-DP3KsQ6l.js → label-DjHnY7oD.js} +1 -1
  122. package/dist/client/assets/{layout-paBHZrq0.js → layout-R7JZk0N_.js} +1 -1
  123. package/dist/client/assets/{login-Dd5gU9xf.js → login-vs48ss5Y.js} +1 -1
  124. package/dist/client/assets/{members-DHkEbny2.js → members-CR6tIRQQ.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-CqS2PrxS.js → monaco-editor-DDa2PYLr.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-D1YkU8mA.js → monitoring-stats-row-B5tYqizL.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-dhWNgkQO.js → oauth-callback-By_kYLzt.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-BXsbx5oM.js → oauth-callback-ai-provider-rjNwAMeL.js} +1 -1
  129. package/dist/client/assets/{onboarding-BeaJ_uSB.js → onboarding-Cp47PQJL.js} +1 -1
  130. package/dist/client/assets/{org-install-Cp2eVvRj.js → org-install-J4BxDvcP.js} +1 -1
  131. package/dist/client/assets/{org-layout-a0K80q4T.js → org-layout-Uzn1aBLq.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-BSiJYore.js → org-plugin-layout-DgjfQM0j.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-3l62DB_T.js → page-seo-form-bcXUoU_e.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-Ds2n8BSC.js +1 -0
  135. package/dist/client/assets/{pair-d72l3oOt.js → pair-CBFiuxUB.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-DJKQIP1H.js → plugin-empty-state-C3zoexBS.js} +1 -1
  137. package/dist/client/assets/{plugin-header-wZ3SAPoW.js → plugin-header-GIzvijnl.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-Bnm1d9fT.js → plugin-layout-Dqb60rkf.js} +1 -1
  139. package/dist/client/assets/{popover-LMWhCL8q.js → popover-CS_iXBnY.js} +1 -1
  140. package/dist/client/assets/{post-editor-DYc1KPrG.js → post-editor-CkT9Hn5n.js} +1 -1
  141. package/dist/client/assets/{primitives-DKgG_RLP.js → primitives-CA9Kk0m9.js} +1 -1
  142. package/dist/client/assets/{profile-sY3vkifi.js → profile-Cl9Tf5eQ.js} +1 -1
  143. package/dist/client/assets/project-app-view-QqyHF6pe.js +1 -0
  144. package/dist/client/assets/record-editor-CuWJY7pj.js +1 -0
  145. package/dist/client/assets/registry-BfO0HF8o.js +2 -0
  146. package/dist/client/assets/{registry-layout-DICcLMZ-.js → registry-layout-DMqbdOK4.js} +1 -1
  147. package/dist/client/assets/{require-capability-BaEq85xc.js → require-capability-Ca6ka1Sn.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-ctnrloiI.js → required-auth-layout-aQSUe2N_.js} +1 -1
  149. package/dist/client/assets/{reset-password-QZaqz6_E.js → reset-password-BT-2N_qd.js} +1 -1
  150. package/dist/client/assets/{resizable-Ctmig1x8.js → resizable-B-Kg7sz_.js} +1 -1
  151. package/dist/client/assets/{roles-l3bqeHe8.js → roles-BJ71aLLv.js} +1 -1
  152. package/dist/client/assets/{save-status-CCYbhtqv.js → save-status-CGb2Biez.js} +1 -1
  153. package/dist/client/assets/{schema-form-CYyNLLkP.js → schema-form-BRIUengr.js} +1 -1
  154. package/dist/client/assets/{scroll-area-ChLxDxAv.js → scroll-area-CpcNn-v-.js} +1 -1
  155. package/dist/client/assets/{search-input-DlQucyGn.js → search-input-BmjJ0rJ1.js} +1 -1
  156. package/dist/client/assets/{secrets-DUz1PrMw.js → secrets-hp_Tfdyj.js} +1 -1
  157. package/dist/client/assets/{sections-editor-CjgAxmAC.js → sections-editor-DabUHooM.js} +1 -1
  158. package/dist/client/assets/{select-DiczE1GW.js → select-C81zuvtp.js} +1 -1
  159. package/dist/client/assets/{select-model-BwFIV8qg.js → select-model-CzLBWXoY.js} +1 -1
  160. package/dist/client/assets/{seo-editor-SK8O4TOZ.js → seo-editor-BU2d4emZ.js} +1 -1
  161. package/dist/client/assets/{settings-layout-B-mK5baR.js → settings-layout-Ck0n7ap9.js} +1 -1
  162. package/dist/client/assets/{settings-section-COvXOm16.js → settings-section-B7fIZ_m0.js} +1 -1
  163. package/dist/client/assets/{sheet-B1_zl6Wy.js → sheet-D9O2scBf.js} +1 -1
  164. package/dist/client/assets/{shell-controls-F9PQTaJd.js → shell-controls-B1uFpggl.js} +1 -1
  165. package/dist/client/assets/{shell-layout-CVo7gBu0.js → shell-layout-B5mx8HCW.js} +1 -1
  166. package/dist/client/assets/{shell-route-loading-DlXSyVMe.js → shell-route-loading-Nvrm4NyQ.js} +1 -1
  167. package/dist/client/assets/{sidebar-D_9iQq6y.js → sidebar-DELjK07K.js} +1 -1
  168. package/dist/client/assets/{skeleton-DvAAEHK-.js → skeleton-CGcndXpH.js} +1 -1
  169. package/dist/client/assets/{sortable.esm-BcW2lbKS.js → sortable.esm-Cc5wE8Md.js} +1 -1
  170. package/dist/client/assets/{spinner-CIGunEVj.js → spinner-DPcimsxj.js} +1 -1
  171. package/dist/client/assets/{sso-BkO-JF6F.js → sso-CgUG1GPv.js} +1 -1
  172. package/dist/client/assets/{store-BP-9ENq2.js → store-DQ2V7yio.js} +1 -1
  173. package/dist/client/assets/store-registry-6BuBNha1.js +2 -0
  174. package/dist/client/assets/{switch-CvANR6OB.js → switch-D26GKac4.js} +1 -1
  175. package/dist/client/assets/{tab-id-Bjr6GpO9.js → tab-id-B_7JAjTL.js} +1 -1
  176. package/dist/client/assets/{table-6ZxoVDj9.js → table-DP9s7KR8.js} +1 -1
  177. package/dist/client/assets/{tabs-BXch7lF5.js → tabs-Jop0evx4.js} +1 -1
  178. package/dist/client/assets/{task-status-FrpiwVZ0.js → task-status-VzGHvxK_.js} +1 -1
  179. package/dist/client/assets/{textarea-CTP7aZSb.js → textarea-C_ciKAYv.js} +1 -1
  180. package/dist/client/assets/{toggle-group-5ZT1fa--.js → toggle-group-CQHGgo0W.js} +1 -1
  181. package/dist/client/assets/{toolbar-Ct5Db6Po.js → toolbar-CO7J3Qlp.js} +1 -1
  182. package/dist/client/assets/{tools-list-BlrRNNBe.js → tools-list-CNevt541.js} +1 -1
  183. package/dist/client/assets/{tooltip-KdhQZ3ej.js → tooltip-DjK_xTiM.js} +1 -1
  184. package/dist/client/assets/{types-Dw4nSNDC.js → types-BRYvxHV0.js} +1 -1
  185. package/dist/client/assets/{use-ai-providers-D_ipcxZj.js → use-ai-providers-CfNPOGmz.js} +1 -1
  186. package/dist/client/assets/{use-automations-ByYKrwPE.js → use-automations-_NxkdQLG.js} +1 -1
  187. package/dist/client/assets/{use-capability-DySoFAxN.js → use-capability-CGr-3r92.js} +1 -1
  188. package/dist/client/assets/{use-collections-XA0KebJY.js → use-collections-ClKr7eLP.js} +1 -1
  189. package/dist/client/assets/{use-connection-wp_lbmMU.js → use-connection-QL9Osw0s.js} +1 -1
  190. package/dist/client/assets/{use-copy-BWvpIWuf.js → use-copy-DR1yGhlv.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-W4rKr9xF.js → use-create-virtual-mcp-B7FzzrhS.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-DWajIZmJ.js → use-debounced-autosave-StOJyK5k.js} +1 -1
  193. package/dist/client/assets/{use-delete-connection-C7S2ugSQ.js → use-delete-connection-ka_zCpHH.js} +1 -1
  194. package/dist/client/assets/{use-file-configs-C-sgICQR.js → use-file-configs-bSRypY4D.js} +1 -1
  195. package/dist/client/assets/{use-infinite-scroll-Bk8f-w0n.js → use-infinite-scroll-D369zKBP.js} +1 -1
  196. package/dist/client/assets/{use-list-state-DCu2_qcV.js → use-list-state-BFEd8KAZ.js} +1 -1
  197. package/dist/client/assets/{use-mcp-prompts-GwuiMx2k.js → use-mcp-prompts-BthLsr-5.js} +1 -1
  198. package/dist/client/assets/{use-mcp-tools-BJM8Ch_b.js → use-mcp-tools-DKqH2jvx.js} +1 -1
  199. package/dist/client/assets/{use-members-BFSN3QPN.js → use-members-CARBs-BO.js} +1 -1
  200. package/dist/client/assets/{use-navigate-to-agent-D_yYvurh.js → use-navigate-to-agent-bL0bZjvs.js} +1 -1
  201. package/dist/client/assets/{use-org-auth-client-D8sE5x8D.js → use-org-auth-client-B-7f7gTM.js} +1 -1
  202. package/dist/client/assets/{use-org-sso-CDLauwp2.js → use-org-sso-CQo4DX7V.js} +1 -1
  203. package/dist/client/assets/{use-organization-roles-Cr7Rw0vS.js → use-organization-roles-D1jilN1C.js} +1 -1
  204. package/dist/client/assets/{use-organization-settings-DZ2KDW5r.js → use-organization-settings-Ba_pVlZU.js} +1 -1
  205. package/dist/client/assets/{use-registry-connections-CkLpetCN.js → use-registry-connections-GFs4i1bK.js} +1 -1
  206. package/dist/client/assets/{use-secrets-BCTkTNAt.js → use-secrets-ChWP1SbP.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-DuoYs6Rs.js → use-status-sounds-BecbYKFZ.js} +1 -1
  208. package/dist/client/assets/{use-view-mode-DUw7PprD.js → use-view-mode-BC-pIybW.js} +1 -1
  209. package/dist/client/assets/{use-virtual-mcp-BE7Deo6L.js → use-virtual-mcp-B_JQogr5.js} +1 -1
  210. package/dist/client/assets/useInfiniteQuery-BdAfpOZ8.js +1 -0
  211. package/dist/client/assets/{useRouterState-nKULYO8g.js → useRouterState-VRTDPwLh.js} +1 -1
  212. package/dist/client/assets/useSuspenseInfiniteQuery-BNJvF6Td.js +1 -0
  213. package/dist/client/assets/{user-DXVwfRLH.js → user-DFXkwuvu.js} +1 -1
  214. package/dist/client/assets/{view-mode-toggle-GVqZ4OkD.js → view-mode-toggle-B2R8JuP1.js} +1 -1
  215. package/dist/client/assets/{workflow-C6bXXXmh.js → workflow-ChJtcD9q.js} +1 -1
  216. package/dist/client/assets/workflow-detail-soUgf3vg.js +1 -0
  217. package/dist/client/index.html +1 -1
  218. package/dist/server/cli.js +369 -363
  219. package/dist/server/migrate.js +1 -1
  220. package/dist/server/server.js +245 -245
  221. package/package.json +1 -1
  222. package/dist/client/assets/app-editor-L6xg0gr0.js +0 -1
  223. package/dist/client/assets/page-seo-sheet-BKqm5eyl.js +0 -1
  224. package/dist/client/assets/project-app-view-DZbc50FT.js +0 -1
  225. package/dist/client/assets/record-editor-CQX_ONN9.js +0 -1
  226. package/dist/client/assets/registry-Z2xBxz0q.js +0 -2
  227. package/dist/client/assets/store-registry-BTGA7RTa.js +0 -2
  228. package/dist/client/assets/useInfiniteQuery-DTZY836s.js +0 -1
  229. package/dist/client/assets/useSuspenseInfiniteQuery-BZcmZLll.js +0 -1
  230. package/dist/client/assets/workflow-detail-B7TlrPBG.js +0 -1
@@ -1,4 +1,4 @@
1
- import{cF as ce,cG as le,cH as ue,c2 as de,cI as he,bH as p,bI as w,cJ as fe,cK as pe,cL as me,cM as M,cN as _e,cO as F,cP as ge,cQ as q,cR as we,cS as U,cT as Te,cU as ye,cV as ke,cW as W,bC as ve,cX as Se,cY as Ce,bZ as X,ca as be,cg as Re,ce as Ie,cZ as Ee,c_ as qe,c$ as Pe,d0 as $,d1 as Ae,d2 as Me,cf as $e,cb as He,cc as Oe,cd as Ne,c9 as xe,d3 as De,d4 as Fe,d5 as Ue,c4 as Le,d6 as je,d7 as Ve,d8 as P,d9 as H,da as Q,db as We,ch as x,e as ee,s as te,aO as j}from"./index-DI_C2zjL.js";function N(a){return!!a._zod}function b(a,e){return N(a)?ce(a,e):a.safeParse(e)}function se(a){if(!a)return;let e;if(N(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Qe(a){if(N(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function z(a){const t=se(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Qe(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function G(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const ze=6e4;class Ge{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const d=i.message,f=d.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(d);else{const h=d,m=new p(h.error.code,h.error.message,h.error.data);l(m)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new p(w.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new p(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new p(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new p(w.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new p(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof p?r:new p(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),p.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):ge(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=p.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=we(e.params)?e.params.task:void 0,d=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,f={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,m)=>{if(n.signal.aborted)throw new p(w.ConnectionClosed,"Request was cancelled");const g={...m,relatedRequestId:e.id};o&&!g.relatedTask&&(g.relatedTask={taskId:o});const y=g.relatedTask?.taskId??o;return y&&d&&await d.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:d,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,f)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(d){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(d);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new p(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=p.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,U,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new p(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new p(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new p(w.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const d=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,d)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:d}=s??{};return new Promise((f,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};s?.onprogress&&(this._progressHandlers.set(m,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),i&&(g.params={...g.params,task:i}),d&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:d}});const y=c=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof p?c:new p(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(m,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?f(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??ze,k=()=>y(p.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(m,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const u=d?.taskId;if(u){const c=_=>{const v=this._responseHandlers.get(m);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,c),this._enqueueTaskMessage(u,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(m),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(m),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(d=>this._onerror(d))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=z(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=G(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=z(e);this._notificationHandlers.set(s,r=>{const o=G(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new p(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new p(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new p(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const d=W.parse({method:"notifications/tasks/status",params:i});await this.notification(d),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new p(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new p(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const d=await s.getTask(r,t);if(d){const f=W.parse({method:"notifications/tasks/status",params:d});await this.notification(f),R(d.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function K(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ke(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];K(n)&&K(o)?t[r]={...n,...o}:t[r]=o}return t}var Je=Se();const Ze=ve(Je);function Ye(){const a=new Ze({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class Be{constructor(e){this._ajv=e??Ye()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class Xe{constructor(e){this._client=e}async*callToolStream(e,t=X,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const d of n){if(d.type==="result"&&i){const f=d.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.structuredContent);if(!l.valid){yield{type:"error",error:new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof p){yield{type:"error",error:l};return}yield{type:"error",error:new p(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield d}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function et(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function tt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function st(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let rt=class extends Ge{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Be,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Xe(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(this._capabilities,e)}setRequestHandler(e,t){const r=se(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(N(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(d,f)=>{const l=b(Fe,d);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:m,supportsUrlMode:g}=st(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new p(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new p(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(d,f));if(h.task){const c=b(U,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new p(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Ue,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,u=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&u&&this._capabilities.elicitation?.form?.applyDefaults)try{O(u,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(d,f)=>{const l=b(Le,d);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,m=await Promise.resolve(t(d,f));if(h.task){const k=b(U,m);if(!k.success){const u=k.error instanceof Error?k.error.message:String(k.error);throw new p(w.InvalidParams,`Invalid task creation result: ${u}`)}return k.data}const y=h.tools||h.toolChoice?je:Ve,T=b(y,m);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){et(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&tt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},$,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},$,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},$e,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},$,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},$,t)}async callTool(e,t=X,s){if(this.isToolTaskRequired(e.name))throw new p(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof p?n:new p(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},xe,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=De.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:d}=s,f=async()=>{if(!n){d(null,null);return}try{const h=await r();d(null,h)}catch(h){const m=h instanceof Error?h:new Error(String(h));d(m,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const m=setTimeout(f,i);this._listChangedDebounceTimers.set(e,m)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function at(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class J extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,ot=13,I=32;function D(a){}function nt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=D,onError:t=D,onRetry:s=D,onComment:r}=a,o=[];let n=!0,i,d="",f=0,l;function h(u){if(n&&(n=!1,u.charCodeAt(0)===239&&u.charCodeAt(1)===187&&u.charCodeAt(2)===191&&(u=u.slice(3))),o.length===0){const v=m(u);v!==""&&o.push(v);return}if(u.indexOf(`
1
+ import{cF as ce,cG as le,cH as ue,c2 as de,cI as he,bH as p,bI as w,cJ as fe,cK as pe,cL as me,cM as M,cN as _e,cO as F,cP as ge,cQ as q,cR as we,cS as U,cT as Te,cU as ye,cV as ke,cW as W,bC as ve,cX as Se,cY as Ce,bZ as X,ca as be,cg as Re,ce as Ie,cZ as Ee,c_ as qe,c$ as Pe,d0 as $,d1 as Ae,d2 as Me,cf as $e,cb as He,cc as Oe,cd as Ne,c9 as xe,d3 as De,d4 as Fe,d5 as Ue,c4 as Le,d6 as je,d7 as Ve,d8 as P,d9 as H,da as Q,db as We,ch as x,e as ee,s as te,aO as j}from"./index-D6_5HAZl.js";function N(a){return!!a._zod}function b(a,e){return N(a)?ce(a,e):a.safeParse(e)}function se(a){if(!a)return;let e;if(N(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Qe(a){if(N(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function z(a){const t=se(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Qe(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function G(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const ze=6e4;class Ge{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const d=i.message,f=d.id,l=this._requestResolvers.get(f);if(l)if(this._requestResolvers.delete(f),i.type==="response")l(d);else{const h=d,m=new p(h.error.code,h.error.message,h.error.data);l(m)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${f}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new p(w.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new p(w.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new p(w.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new p(w.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new p(w.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof p?r:new p(w.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),p.fromError(w.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):ge(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=p.fromError(w.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:w.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=we(e.params)?e.params.task:void 0,d=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,f={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,m)=>{if(n.signal.aborted)throw new p(w.ConnectionClosed,"Request was cancelled");const g={...m,relatedRequestId:e.id};o&&!g.relatedTask&&(g.relatedTask={taskId:o});const y=g.relatedTask?.taskId??o;return y&&d&&await d.updateTaskStatus(y,"input_required"),await this.request(l,h,g)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:d,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,f)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:w.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(d){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(d);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new p(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=p.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}return}let o;try{const n=await this.request(e,U,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new p(w.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new p(w.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new p(w.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const d=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(f=>setTimeout(f,d)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof p?n:new p(w.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:d}=s??{};return new Promise((f,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};s?.onprogress&&(this._progressHandlers.set(m,s.onprogress),g.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),i&&(g.params={...g.params,task:i}),d&&(g.params={...g.params,_meta:{...g.params?._meta||{},[q]:d}});const y=c=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof p?c:new p(w.RequestTimeout,String(c));l(_)};this._responseHandlers.set(m,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?f(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??ze,k=()=>y(p.fromError(w.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(m,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const u=d?.taskId;if(u){const c=_=>{const v=this._responseHandlers.get(m);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,c),this._enqueueTaskMessage(u,{type:"request",message:g,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(m),l(_)})}else this._transport.send(g,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(m),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(d=>this._onerror(d))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=z(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=G(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=z(e);this._notificationHandlers.set(s,r=>{const o=G(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new p(w.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new p(w.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new p(w.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new p(w.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const d=W.parse({method:"notifications/tasks/status",params:i});await this.notification(d),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new p(w.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new p(w.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const d=await s.getTask(r,t);if(d){const f=W.parse({method:"notifications/tasks/status",params:d});await this.notification(f),R(d.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function K(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ke(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];K(n)&&K(o)?t[r]={...n,...o}:t[r]=o}return t}var Je=Se();const Ze=ve(Je);function Ye(){const a=new Ze({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class Be{constructor(e){this._ajv=e??Ye()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class Xe{constructor(e){this._client=e}async*callToolStream(e,t=X,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const d of n){if(d.type==="result"&&i){const f=d.result;if(!f.structuredContent&&!f.isError){yield{type:"error",error:new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(f.structuredContent)try{const l=i(f.structuredContent);if(!l.valid){yield{type:"error",error:new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof p){yield{type:"error",error:l};return}yield{type:"error",error:new p(w.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield d}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function et(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function tt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function st(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let rt=class extends Ge{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Be,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new Xe(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ke(this._capabilities,e)}setRequestHandler(e,t){const r=se(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(N(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(d,f)=>{const l=b(Fe,d);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:m,supportsUrlMode:g}=st(this._capabilities.elicitation);if(h.mode==="form"&&!m)throw new p(w.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!g)throw new p(w.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(d,f));if(h.task){const c=b(U,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new p(w.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Ue,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,u=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&u&&this._capabilities.elicitation?.form?.applyDefaults)try{O(u,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(d,f)=>{const l=b(Le,d);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new p(w.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,m=await Promise.resolve(t(d,f));if(h.task){const k=b(U,m);if(!k.success){const u=k.error instanceof Error?k.error.message:String(k.error);throw new p(w.InvalidParams,`Invalid task creation result: ${u}`)}return k.data}const y=h.tools||h.toolChoice?je:Ve,T=b(y,m);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new p(w.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){et(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&tt(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},$,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},Ae,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},$,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},$e,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},Ne,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},$,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},$,t)}async callTool(e,t=X,s){if(this.isToolTaskRequired(e.name))throw new p(w.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new p(w.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new p(w.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof p?n:new p(w.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},xe,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=De.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:d}=s,f=async()=>{if(!n){d(null,null);return}try{const h=await r();d(null,h)}catch(h){const m=h instanceof Error?h:new Error(String(h));d(m,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const m=setTimeout(f,i);this._listChangedDebounceTimers.set(e,m)}else f()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function at(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class J extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,ot=13,I=32;function D(a){}function nt(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=D,onError:t=D,onRetry:s=D,onComment:r}=a,o=[];let n=!0,i,d="",f=0,l;function h(u){if(n&&(n=!1,u.charCodeAt(0)===239&&u.charCodeAt(1)===187&&u.charCodeAt(2)===191&&(u=u.slice(3))),o.length===0){const v=m(u);v!==""&&o.push(v);return}if(u.indexOf(`
2
2
  `)===-1&&u.indexOf("\r")===-1){o.push(u);return}o.push(u);const c=o.join("");o.length=0;const _=m(c);_!==""&&o.push(_)}function m(u){let c=0;if(u.indexOf("\r")===-1){let _=u.indexOf(`
3
3
  `,c);for(;_!==-1;){if(c===_){f>0&&e({id:i,event:l,data:d}),i=void 0,d="",f=0,l=void 0,c=_+1,_=u.indexOf(`
4
4
  `,c);continue}const v=u.charCodeAt(c);if(Y(u,c,v)){const S=u.charCodeAt(c+5)===I?c+6:c+5,C=u.slice(S,_);if(f===0&&u.charCodeAt(_+1)===Z){e({id:i,event:l,data:C}),i=void 0,d="",l=void 0,c=_+2,_=u.indexOf(`
@@ -1 +1 @@
1
- import"./index-DI_C2zjL.js";import{c as s}from"./create-sse-subscription-BS5983N4.js";const c={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},t=Object.values(c),n=s({buildUrl:o=>{const e=t.join(",");return`/api/${encodeURIComponent(o)}/watch?types=${e}`},eventTypes:[...t]});export{c as D,n as d};
1
+ import"./index-D6_5HAZl.js";import{c as s}from"./create-sse-subscription-BS5983N4.js";const c={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},t=Object.values(c),n=s({buildUrl:o=>{const e=t.join(",");return`/api/${encodeURIComponent(o)}/watch?types=${e}`},eventTypes:[...t]});export{c as D,n as d};
@@ -1 +1 @@
1
- import{e as n,j as i,cx as u,c,bE as m,dc as x,dd as j,cy as N,cz as b,de as g,df as D}from"./index-DI_C2zjL.js";import{i as h}from"./X-gpy8SRoe.js";function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{_ as D,T as a,E as b,B as c,R as d,O as e,w as f,v as g,y as h,k as i};
1
+ import{e as n,j as i,cx as u,c,bE as m,dc as x,dd as j,cy as N,cz as b,de as g,df as D}from"./index-D6_5HAZl.js";import{i as h}from"./X-BoM0MLQn.js";function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{_ as D,T as a,E as b,B as c,R as d,O as e,w as f,v as g,y as h,k as i};
@@ -1 +1 @@
1
- import{e as B,q as U,b as $,G as Y,K as J,n as H,a as G,j as s,B as L,t as p,o as A}from"./index-DI_C2zjL.js";import{u as M}from"./unwrap-tool-result-BYXdCQMg.js";import{S as V,u as W}from"./constants-Cee8XKoZ.js";import{S as X}from"./switch-CvANR6OB.js";import{S as ii,a as k,b as P}from"./settings-section-COvXOm16.js";function si(){const i=B.c(62),{org:t}=U(),{data:K}=$.useSession(),R=Y();let z;i[0]!==t.id||i[1]!==t.slug?(z={connectionId:V,orgId:t.id,orgSlug:t.slug},i[0]=t.id,i[1]=t.slug,i[2]=z):z=i[2];const a=W(z);let r;i[3]!==t.id?(r=J.organizationDomain(t.id),i[3]=t.id,i[4]=r):r=i[4];let d;i[5]!==a?(d=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return M(e)},i[5]=a,i[6]=d):d=i[6];let h;i[7]!==r||i[8]!==d?(h={queryKey:r,queryFn:d},i[7]=r,i[8]=d,i[9]=h):h=i[9];const{data:q,isPending:Z}=H(h),b=K?.user?.email??"";let I;i[10]!==b?(I=b.split("@")[1]?.toLowerCase()??"",i[10]=b,i[11]=I):I=i[11];const o=I,n=q?.domain??null,F=q?.autoJoinEnabled??!1,v=o&&o!==n;let x;i[12]!==t.id||i[13]!==R?(x=()=>R.invalidateQueries({queryKey:J.organizationDomain(t.id)}),i[12]=t.id,i[13]=R,i[14]=x):x=i[14];const l=x;let c;i[15]!==a||i[16]!==o?(c=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:o,autoJoinEnabled:!1}});return M(e)},i[15]=a,i[16]=o,i[17]=c):c=i[17];let m;i[18]!==l||i[19]!==t.id||i[20]!==o?(m=()=>{p("organization_domain_claimed",{organization_id:t.id,email_domain:o}),l(),A.success("Domain claimed")},i[18]=l,i[19]=t.id,i[20]=o,i[21]=m):m=i[21];let u;i[22]!==t.id||i[23]!==o?(u=e=>{p("organization_domain_claim_failed",{organization_id:t.id,email_domain:o,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to claim domain")},i[22]=t.id,i[23]=o,i[24]=u):u=i[24];let D;i[25]!==c||i[26]!==m||i[27]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[25]=c,i[26]=m,i[27]=u,i[28]=D):D=i[28];const C=G(D);let g;i[29]!==a?(g=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return M(e)},i[29]=a,i[30]=g):g=i[30];let f;i[31]!==n||i[32]!==l||i[33]!==t.id?(f=()=>{p("organization_domain_cleared",{organization_id:t.id,email_domain:n}),l(),A.success("Domain removed")},i[31]=n,i[32]=l,i[33]=t.id,i[34]=f):f=i[34];let _;i[35]!==n||i[36]!==t.id?(_=e=>{p("organization_domain_clear_failed",{organization_id:t.id,email_domain:n,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to remove domain")},i[35]=n,i[36]=t.id,i[37]=_):_=i[37];let y;i[38]!==g||i[39]!==f||i[40]!==_?(y={mutationFn:g,onSuccess:f,onError:_},i[38]=g,i[39]=f,i[40]=_,i[41]=y):y=i[41];const N=G(y);let E;i[42]!==a||i[43]!==n||i[44]!==t.id?(E=async e=>{if(!n)return;p("organization_auto_join_toggled",{organization_id:t.id,enabled:e});const Q=await a.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:e}});return M(Q)},i[42]=a,i[43]=n,i[44]=t.id,i[45]=E):E=i[45];let S;i[46]!==l?(S=()=>{l(),A.success("Auto-join setting updated")},i[46]=l,i[47]=S):S=i[47];let j;i[48]!==t.id?(j=e=>{p("organization_auto_join_toggle_failed",{organization_id:t.id,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to update auto-join")},i[48]=t.id,i[49]=j):j=i[49];let w;i[50]!==E||i[51]!==S||i[52]!==j?(w={mutationFn:E,onSuccess:S,onError:j},i[50]=E,i[51]=S,i[52]=j,i[53]=w):w=i[53];const O=G(w);if(Z)return null;let T;return i[54]!==F||i[55]!==v||i[56]!==N||i[57]!==n||i[58]!==C||i[59]!==O||i[60]!==o?(T=s.jsx(ii,{title:"Email domain",children:n?s.jsxs(k,{children:[s.jsx(P,{title:n,description:"Claimed domain",action:s.jsx(L,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(P,{title:"Auto-join",description:`Users with @${n} emails will automatically join this organization on signup.`,action:s.jsx(X,{checked:F,onCheckedChange:e=>O.mutate(e),disabled:O.isPending})})]}):v?s.jsx(k,{children:s.jsx(P,{title:o,description:"Let new users with matching emails auto-join this org.",action:s.jsx(L,{size:"sm",onClick:()=>C.mutate(),disabled:C.isPending,children:C.isPending?"Claiming...":"Claim domain"})})}):s.jsx(k,{children:s.jsx(P,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[54]=F,i[55]=v,i[56]=N,i[57]=n,i[58]=C,i[59]=O,i[60]=o,i[61]=T):T=i[61],T}export{si as D};
1
+ import{e as B,q as U,b as $,G as Y,K as J,n as H,a as G,j as s,B as L,t as p,o as A}from"./index-D6_5HAZl.js";import{u as M}from"./unwrap-tool-result-BYXdCQMg.js";import{S as V,u as W}from"./constants-CnOnAK7r.js";import{S as X}from"./switch-D26GKac4.js";import{S as ii,a as k,b as P}from"./settings-section-B7fIZ_m0.js";function si(){const i=B.c(62),{org:t}=U(),{data:K}=$.useSession(),R=Y();let z;i[0]!==t.id||i[1]!==t.slug?(z={connectionId:V,orgId:t.id,orgSlug:t.slug},i[0]=t.id,i[1]=t.slug,i[2]=z):z=i[2];const a=W(z);let r;i[3]!==t.id?(r=J.organizationDomain(t.id),i[3]=t.id,i[4]=r):r=i[4];let d;i[5]!==a?(d=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_GET",arguments:{}});return M(e)},i[5]=a,i[6]=d):d=i[6];let h;i[7]!==r||i[8]!==d?(h={queryKey:r,queryFn:d},i[7]=r,i[8]=d,i[9]=h):h=i[9];const{data:q,isPending:Z}=H(h),b=K?.user?.email??"";let I;i[10]!==b?(I=b.split("@")[1]?.toLowerCase()??"",i[10]=b,i[11]=I):I=i[11];const o=I,n=q?.domain??null,F=q?.autoJoinEnabled??!1,v=o&&o!==n;let x;i[12]!==t.id||i[13]!==R?(x=()=>R.invalidateQueries({queryKey:J.organizationDomain(t.id)}),i[12]=t.id,i[13]=R,i[14]=x):x=i[14];const l=x;let c;i[15]!==a||i[16]!==o?(c=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_SET",arguments:{domain:o,autoJoinEnabled:!1}});return M(e)},i[15]=a,i[16]=o,i[17]=c):c=i[17];let m;i[18]!==l||i[19]!==t.id||i[20]!==o?(m=()=>{p("organization_domain_claimed",{organization_id:t.id,email_domain:o}),l(),A.success("Domain claimed")},i[18]=l,i[19]=t.id,i[20]=o,i[21]=m):m=i[21];let u;i[22]!==t.id||i[23]!==o?(u=e=>{p("organization_domain_claim_failed",{organization_id:t.id,email_domain:o,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to claim domain")},i[22]=t.id,i[23]=o,i[24]=u):u=i[24];let D;i[25]!==c||i[26]!==m||i[27]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[25]=c,i[26]=m,i[27]=u,i[28]=D):D=i[28];const C=G(D);let g;i[29]!==a?(g=async()=>{const e=await a.callTool({name:"ORGANIZATION_DOMAIN_CLEAR",arguments:{}});return M(e)},i[29]=a,i[30]=g):g=i[30];let f;i[31]!==n||i[32]!==l||i[33]!==t.id?(f=()=>{p("organization_domain_cleared",{organization_id:t.id,email_domain:n}),l(),A.success("Domain removed")},i[31]=n,i[32]=l,i[33]=t.id,i[34]=f):f=i[34];let _;i[35]!==n||i[36]!==t.id?(_=e=>{p("organization_domain_clear_failed",{organization_id:t.id,email_domain:n,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to remove domain")},i[35]=n,i[36]=t.id,i[37]=_):_=i[37];let y;i[38]!==g||i[39]!==f||i[40]!==_?(y={mutationFn:g,onSuccess:f,onError:_},i[38]=g,i[39]=f,i[40]=_,i[41]=y):y=i[41];const N=G(y);let E;i[42]!==a||i[43]!==n||i[44]!==t.id?(E=async e=>{if(!n)return;p("organization_auto_join_toggled",{organization_id:t.id,enabled:e});const Q=await a.callTool({name:"ORGANIZATION_DOMAIN_UPDATE",arguments:{autoJoinEnabled:e}});return M(Q)},i[42]=a,i[43]=n,i[44]=t.id,i[45]=E):E=i[45];let S;i[46]!==l?(S=()=>{l(),A.success("Auto-join setting updated")},i[46]=l,i[47]=S):S=i[47];let j;i[48]!==t.id?(j=e=>{p("organization_auto_join_toggle_failed",{organization_id:t.id,error:e instanceof Error?e.message:String(e)}),A.error(e instanceof Error?e.message:"Failed to update auto-join")},i[48]=t.id,i[49]=j):j=i[49];let w;i[50]!==E||i[51]!==S||i[52]!==j?(w={mutationFn:E,onSuccess:S,onError:j},i[50]=E,i[51]=S,i[52]=j,i[53]=w):w=i[53];const O=G(w);if(Z)return null;let T;return i[54]!==F||i[55]!==v||i[56]!==N||i[57]!==n||i[58]!==C||i[59]!==O||i[60]!==o?(T=s.jsx(ii,{title:"Email domain",children:n?s.jsxs(k,{children:[s.jsx(P,{title:n,description:"Claimed domain",action:s.jsx(L,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(P,{title:"Auto-join",description:`Users with @${n} emails will automatically join this organization on signup.`,action:s.jsx(X,{checked:F,onCheckedChange:e=>O.mutate(e),disabled:O.isPending})})]}):v?s.jsx(k,{children:s.jsx(P,{title:o,description:"Let new users with matching emails auto-join this org.",action:s.jsx(L,{size:"sm",onClick:()=>C.mutate(),disabled:C.isPending,children:C.isPending?"Claiming...":"Claim domain"})})}):s.jsx(k,{children:s.jsx(P,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[54]=F,i[55]=v,i[56]=N,i[57]=n,i[58]=C,i[59]=O,i[60]=o,i[61]=T):T=i[61],T}export{si as D};
@@ -1 +1 @@
1
- import{e as d,j as s,cm as i,c}from"./index-DI_C2zjL.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(w,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(m,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
1
+ import{e as d,j as s,cm as i,c}from"./index-D6_5HAZl.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(w,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(m,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{e as c,j as i,dG as f,dH as m,c as u,dI as g,dJ as x,dK as v,dL as b,dM as h,dN as w,dO as j,dP as N,dQ as z,dR as _,dS as y,dT as p}from"./index-DI_C2zjL.js";import{i as $}from"./Check-BxIVbrMR.js";import{i as D}from"./ChevronRight-WB5knV5A.js";import{a as M}from"./DotsVertical-CxHHcGx6.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function G(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function L(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function O(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function H(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function J(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function K(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function Q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function q(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,G as b,L as c,J as d,K as e,Q as f,q as g,H as h,E as i,P as j,O as k};
1
+ import{e as c,j as i,dG as f,dH as m,c as u,dI as g,dJ as x,dK as v,dL as b,dM as h,dN as w,dO as j,dP as N,dQ as z,dR as _,dS as y,dT as p}from"./index-D6_5HAZl.js";import{i as $}from"./Check-C4hca_-Y.js";import{i as D}from"./ChevronRight-CyvrXAe0.js";import{a as M}from"./DotsVertical-Bo9Tm-x1.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function G(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let d;return e[6]!==s||e[7]!==n||e[8]!==r?(d=i.jsx(x,{children:i.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=d):d=e[9],d}function L(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let d;e[5]!==t?(d=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=d):d=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==d||e[10]!==r?(l=i.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:d,...o}),e[7]=s,e[8]=o,e[9]=d,e[10]=r,e[11]=l):l=e[11],l}function O(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx($,{className:"size-4"})})}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=i.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[d,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function E(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:i.jsx(p,{children:i.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let d;return e[7]!==t||e[8]!==o||e[9]!==n?(d=i.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=d):d=e[10],d}function H(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=i.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function J(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function K(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function Q(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(D,{className:"ml-auto size-4"}),e[7]=d):d=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=i.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,d]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function q(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=i.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,G as b,L as c,J as d,K as e,Q as f,q as g,H as h,E as i,P as j,O as k};
@@ -1 +1 @@
1
- import{e as d,g as p,ck as l,j as s,O as u}from"./index-DI_C2zjL.js";import{P as c}from"./plugin-layout-Bnm1d9fT.js";import"./use-connection-wp_lbmMU.js";import"./use-collections-XA0KebJY.js";import"./constants-Cee8XKoZ.js";import"./Settings02-VViB9t6t.js";import"./index-BNRdhvYz.js";import"./sidebar-D_9iQq6y.js";import"./LayoutLeft-xp2y9xUi.js";import"./tooltip-KdhQZ3ej.js";import"./sheet-B1_zl6Wy.js";import"./X-gpy8SRoe.js";function _(){const e=d.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:a}=p(n);let i;e[1]!==a?(i=l.find(r=>r.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let m;return e[8]!==o?(m=s.jsx(o,{}),e[8]=o,e[9]=m):m=e[9],m}export{_ as default};
1
+ import{e as d,g as p,ck as l,j as s,O as u}from"./index-D6_5HAZl.js";import{P as c}from"./plugin-layout-Dqb60rkf.js";import"./use-connection-QL9Osw0s.js";import"./use-collections-ClKr7eLP.js";import"./constants-CnOnAK7r.js";import"./Settings02-C4ziU-d4.js";import"./index-CNQY6k_W.js";import"./sidebar-DELjK07K.js";import"./LayoutLeft-CmXWN8pg.js";import"./tooltip-DjK_xTiM.js";import"./sheet-D9O2scBf.js";import"./X-BoM0MLQn.js";function _(){const e=d.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:a}=p(n);let i;e[1]!==a?(i=l.find(r=>r.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let m;return e[8]!==o?(m=s.jsx(o,{}),e[8]=o,e[9]=m):m=e[9],m}export{_ as default};
@@ -1 +1 @@
1
- import{e as b,c as h,j as t,B as g}from"./index-DI_C2zjL.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
1
+ import{e as b,c as h,j as t,B as g}from"./index-D6_5HAZl.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
@@ -1 +1 @@
1
- import{e as v,c as N,j as t}from"./index-DI_C2zjL.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{e as v,c as N,j as t}from"./index-D6_5HAZl.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import{g as O}from"./generate-id-CvWg9hET.js";import"./index-DI_C2zjL.js";import{W as T,c as x}from"./constants-Cee8XKoZ.js";const U="mcp.mesh";function H(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function L(e){const t=H(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function Y(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return Y(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(e){return e?D[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a,r){const o=await x({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[U],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||L(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[A]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${$(c)})`:l&&N&&(g=` (${K(l)})`);const E=I+g;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{L as a,B as b,J as c,Q as e,q as f,j as g,F as i};
1
+ import{g as O}from"./generate-id-CdTqgONK.js";import"./index-D6_5HAZl.js";import{W as T,c as x}from"./constants-CnOnAK7r.js";const U="mcp.mesh";function H(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function L(e){const t=H(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function Y(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return Y(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(e){return e?D[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a,r){const o=await x({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[U],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||L(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[A]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${$(c)})`:l&&N&&(g=` (${K(l)})`);const E=I+g;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{L as a,B as b,J as c,Q as e,q as f,j as g,F as i};
@@ -1 +1 @@
1
- import{e as b,q as k,G as q,ck as P,j as n,cl as E,b7 as R,K as S,o as K}from"./index-DI_C2zjL.js";import{P as j}from"./index-BNRdhvYz.js";import{d as _}from"./use-organization-settings-DZ2KDW5r.js";import{S as I}from"./switch-CvANR6OB.js";import{n as Q}from"./Container-Dls_ClFq.js";import{b as w,S as z,a as F,c as N}from"./settings-section-COvXOm16.js";import{R as T}from"./require-capability-BaEq85xc.js";import"./sidebar-D_9iQq6y.js";import"./LayoutLeft-xp2y9xUi.js";import"./tooltip-KdhQZ3ej.js";import"./sheet-B1_zl6Wy.js";import"./X-gpy8SRoe.js";import"./constants-Cee8XKoZ.js";import"./card-opRPZv32.js";import"./ArrowUpRight-l-GcKPYK.js";import"./use-capability-DySoFAxN.js";import"./access-gate-uwoZnAgx.js";import"./capability-load-error-ClqXQbgV.js";function U(){const e=b.c(17),{org:t,project:s}=k(),r=q();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const a=d,l=_();let m;e[2]!==t||e[3]!==s.slug||e[4]!==r?(m=()=>{r.invalidateQueries({queryKey:S.project(t.id,s.slug)}),r.invalidateQueries({queryKey:S.projects(t.id)}),r.invalidateQueries({predicate:i=>{const o=i.queryKey;return o[1]===t.id&&o[3]==="collection"&&o[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=r,e[5]=m):m=e[5];const x=m;let p;e[6]!==x||e[7]!==l||e[8]!==a?(p=(i,o)=>{const u=new Set(a);o?u.add(i):u.delete(i),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:x,onError:G})},e[6]=x,e[7]=l,e[8]=a,e[9]=p):p=e[9];const g=p,y=D,C=A;if(P.length===0){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=i):i=e[10],i}let c;e[11]!==g||e[12]!==l||e[13]!==a?(c=P.map(i=>{const o=y(i.id),u=C(i.id),h=a.includes(i.id);return n.jsx(w,{title:o?.label??i.id,description:u??void 0,icon:n.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:o?.icon??n.jsx(Q,{size:14})}),onClick:()=>!l.isPending&&g(i.id,!h),action:n.jsx(I,{checked:h,onCheckedChange:v=>g(i.id,v),disabled:l.isPending,onClick:$})},i.id)}),e[11]=g,e[12]=l,e[13]=a,e[14]=c):c=e[14];let f;return e[15]!==c?(f=n.jsx(z,{children:n.jsx(F,{children:c})}),e[15]=c,e[16]=f):f=e[16],f}function $(e){return e.stopPropagation()}function A(e){return P.find(s=>s.id===e)?.description??null}function D(e){const t=E.find(r=>r.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=R.find(r=>r.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function G(e){K.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function M(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(j,{children:n.jsx(j.Content,{children:n.jsx(j.Body,{children:n.jsxs(N,{children:[n.jsx(j.Title,{children:"Plugins"}),n.jsx(U,{})]})})})}),e[0]=t):t=e[0],t}function ae(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(T,{capability:"org:manage",area:"plugins",children:n.jsx(M,{})}),e[0]=t):t=e[0],t}export{ae as default};
1
+ import{e as b,q as k,G as q,ck as P,j as n,cl as E,b7 as R,K as S,o as K}from"./index-D6_5HAZl.js";import{P as j}from"./index-CNQY6k_W.js";import{d as _}from"./use-organization-settings-Ba_pVlZU.js";import{S as I}from"./switch-D26GKac4.js";import{n as Q}from"./Container-DXqMOloC.js";import{b as w,S as z,a as F,c as N}from"./settings-section-B7fIZ_m0.js";import{R as T}from"./require-capability-Ca6ka1Sn.js";import"./sidebar-DELjK07K.js";import"./LayoutLeft-CmXWN8pg.js";import"./tooltip-DjK_xTiM.js";import"./sheet-D9O2scBf.js";import"./X-BoM0MLQn.js";import"./constants-CnOnAK7r.js";import"./card-wIb7H0Z4.js";import"./ArrowUpRight-D_DImXhK.js";import"./use-capability-CGr-3r92.js";import"./access-gate-rgO__BFd.js";import"./capability-load-error-atGCCjOU.js";function U(){const e=b.c(17),{org:t,project:s}=k(),r=q();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const a=d,l=_();let m;e[2]!==t||e[3]!==s.slug||e[4]!==r?(m=()=>{r.invalidateQueries({queryKey:S.project(t.id,s.slug)}),r.invalidateQueries({queryKey:S.projects(t.id)}),r.invalidateQueries({predicate:i=>{const o=i.queryKey;return o[1]===t.id&&o[3]==="collection"&&o[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=r,e[5]=m):m=e[5];const x=m;let p;e[6]!==x||e[7]!==l||e[8]!==a?(p=(i,o)=>{const u=new Set(a);o?u.add(i):u.delete(i),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:x,onError:G})},e[6]=x,e[7]=l,e[8]=a,e[9]=p):p=e[9];const g=p,y=D,C=A;if(P.length===0){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=i):i=e[10],i}let c;e[11]!==g||e[12]!==l||e[13]!==a?(c=P.map(i=>{const o=y(i.id),u=C(i.id),h=a.includes(i.id);return n.jsx(w,{title:o?.label??i.id,description:u??void 0,icon:n.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:o?.icon??n.jsx(Q,{size:14})}),onClick:()=>!l.isPending&&g(i.id,!h),action:n.jsx(I,{checked:h,onCheckedChange:v=>g(i.id,v),disabled:l.isPending,onClick:$})},i.id)}),e[11]=g,e[12]=l,e[13]=a,e[14]=c):c=e[14];let f;return e[15]!==c?(f=n.jsx(z,{children:n.jsx(F,{children:c})}),e[15]=c,e[16]=f):f=e[16],f}function $(e){return e.stopPropagation()}function A(e){return P.find(s=>s.id===e)?.description??null}function D(e){const t=E.find(r=>r.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=R.find(r=>r.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function G(e){K.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function M(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(j,{children:n.jsx(j.Content,{children:n.jsx(j.Body,{children:n.jsxs(N,{children:[n.jsx(j.Title,{children:"Plugins"}),n.jsx(U,{})]})})})}),e[0]=t):t=e[0],t}function ae(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(T,{capability:"org:manage",area:"plugins",children:n.jsx(M,{})}),e[0]=t):t=e[0],t}export{ae as default};
@@ -1,2 +1,2 @@
1
- import{e as Ke,r as l,j as i,l as re,B as fe,c as Ve,G as ut,o as $,K as Te}from"./index-DI_C2zjL.js";import{F as mt,l as pt}from"./index-6hdndQvf.js";import{Z as ht,aq as xt,ar as gt,as as ae,at as yt,G as $e}from"./agent-icon-DZCJD2_a.js";import{a as wt}from"./Tool01-BgJ0N26M.js";import{s as jt}from"./XClose-BIl1LPyR.js";import{S as bt}from"./scroll-area-ChLxDxAv.js";import{b as Re,T as Oe,a as ze}from"./tooltip-KdhQZ3ej.js";import{A as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,f as Ft,g as Lt}from"./alert-dialog-BEqZ9uGO.js";import{a as Et}from"./chat-context-BbbKc5EF.js";import{u as Pt}from"./shell-layout-CVo7gBu0.js";import{a1 as le,a2 as Ae,a3 as Tt}from"./index-BtYLUKbU.js";import{c as $t,e as Rt,b as Ot,d as zt,a as At,D as Wt}from"./dialog-CFcYm0YL.js";import{I as We}from"./input-D6XA36wX.js";import{C as It,c as _,d as Ie,e as Mt,f as Kt}from"./shell-route-loading-DlXSyVMe.js";import{t as Vt}from"./ChevronDown-P5aorJ8-.js";import{i as Bt}from"./ChevronRight-WB5knV5A.js";import{a as Gt}from"./ZoomOut-CTra4wHa.js";import{E as qt,m as Me,n as he,o as Qt,p as Ut,q as Ht,t as M,r as ce,g as xe,s as ge,v as Jt,w as Xt,x as ye,y as de,z as we,A as Yt,B as Zt}from"./header-tab-button-C4vmTyQ-.js";import"./AlertCircle-DBLUz--u.js";import"./SwitchHorizontal01-BDAEnkfq.js";import"./RefreshCcw01-BKQsxntF.js";import"./XCircle-B8hhQ7We.js";import"./ArrowUpRight-l-GcKPYK.js";import"./ZapSquare-DwVlJ80d.js";import"./Users03-DhyPNTfH.js";import"./CheckCircle-rFqh1KDn.js";import"./Check-BxIVbrMR.js";import"./ChevronLeft-e8a25ahy.js";import"./ChevronUp-nQBmktAW.js";import"./DotsVertical-CxHHcGx6.js";import"./Container-Dls_ClFq.js";import"./Eye-EKPlnsLc.js";import"./Globe01-Tm1ARX4Z.js";import"./FilterLines-DqQIAzT9.js";import"./Star01--s8ZFg64.js";import"./Palette-DcvO-xme.js";import"./HardDrive-JzeH-CyJ.js";import"./Stars02-CIMeB8Tw.js";import"./Key01-CeoBFgZd.js";import"./LayoutLeft-xp2y9xUi.js";import"./LinkExternal01-BrCQL34C.js";import"./Monitor01-DhIohKdB.js";import"./Sun-F5_OmHwF.js";import"./Play-Cl-75oPS.js";import"./Plus-DMk97-_x.js";import"./SearchMd-D5J9uZcf.js";import"./Settings02-VViB9t6t.js";import"./Shield01-D5gYDa2-.js";import"./Stars01-BidgaxVI.js";import"./Trash01-C7l0NheK.js";import"./Upload01-BpTwEhwN.js";import"./User01-61G-I9Nt.js";import"./Users01-DedWtozu.js";import"./X-gpy8SRoe.js";import"./Zap-DRW8v7hZ.js";import"./select-DiczE1GW.js";import"./tab-id-Bjr6GpO9.js";import"./constants-Cee8XKoZ.js";import"./decopilot-sse-pool-DiOxs3f4.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-BE7Deo6L.js";import"./use-collections-XA0KebJY.js";import"./use-ai-providers-D_ipcxZj.js";import"./use-organization-settings-DZ2KDW5r.js";import"./avatar-Bcbs0fiL.js";import"./required-auth-layout-ctnrloiI.js";import"./useRouterState-nKULYO8g.js";import"./use-org-sso-CDLauwp2.js";import"./agent-capabilities-BjTqE21c.js";import"./pair-d72l3oOt.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BWvpIWuf.js";import"./file-type-icon-fKTDY3M7.js";import"./content-blocks-o63cs2vh.js";import"./types-Dw4nSNDC.js";import"./integration-icon-CDYbzYpO.js";import"./use-navigate-to-agent-D_yYvurh.js";import"./use-connection-wp_lbmMU.js";import"./use-mcp-prompts-GwuiMx2k.js";import"./form-BOkSmTHo.js";import"./label-DP3KsQ6l.js";import"./spinner-CIGunEVj.js";import"./drawer-CG7DFuyM.js";import"./collection-search-C3Lp1ZRv.js";import"./tabs-BXch7lF5.js";import"./toggle-group-5ZT1fa--.js";import"./connect-desktop-dialog-Cy-b1jPM.js";import"./agent-icons-jN-Zyl-6.js";import"./checkbox-wlYL0b3G.js";import"./skeleton-DvAAEHK-.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-COvXOm16.js";import"./card-opRPZv32.js";import"./popover-LMWhCL8q.js";import"./command-DWpPyJE7.js";import"./index-B6UNbCvs.js";import"./useInfiniteQuery-DTZY836s.js";import"./infiniteQueryObserver-UtxmrGCk.js";import"./sortable.esm-BcW2lbKS.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BI-CSazh.js";import"./use-registry-connections-CkLpetCN.js";import"./extract-connection-data-BpQPulqJ.js";import"./generate-id-CvWg9hET.js";import"./collections-BaDzxzwW.js";import"./collection-tabs-BoQd-dND.js";import"./badge-BARx7FvE.js";import"./textarea-CTP7aZSb.js";import"./connection-form-helpers-CbxXqT_u.js";import"./use-infinite-scroll-Bk8f-w0n.js";import"./useSuspenseInfiniteQuery-BZcmZLll.js";import"./index-CdECG0JX.js";import"./dropdown-menu-CKTrR8YS.js";import"./question-004-sINsf4GQ.js";import"./sidebar-D_9iQq6y.js";import"./sheet-B1_zl6Wy.js";import"./use-status-sounds-DuoYs6Rs.js";import"./empty-state-D653N76e.js";import"./toolbar-Ct5Db6Po.js";import"./resizable-Ctmig1x8.js";import"./use-mcp-tools-BJM8Ch_b.js";import"./use-capability-DySoFAxN.js";import"./user-DXVwfRLH.js";import"./tools-list-BlrRNNBe.js";import"./switch-CvANR6OB.js";import"./use-debounced-autosave-DWajIZmJ.js";import"./index-BNRdhvYz.js";import"./search-input-DlQucyGn.js";import"./use-secrets-BCTkTNAt.js";import"./github-repo-picker-qlUkWRPg.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-B0fd1tnF.js";import"./view-mode-toggle-GVqZ4OkD.js";import"./select-model-BwFIV8qg.js";import"./use-automations-ByYKrwPE.js";import"./monaco-editor-CqS2PrxS.js";import"./automation-runs-hCC2W9Z-.js";import"./table-6ZxoVDj9.js";import"./use-members-BFSN3QPN.js";import"./use-org-auth-client-D8sE5x8D.js";import"./task-status-FrpiwVZ0.js";import"./automation-list-row-DijFSvDw.js";import"./use-create-virtual-mcp-W4rKr9xF.js";import"./index-DKAPjhpZ.js";import"./hover-card-BQqzA1_o.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>R(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Qi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){O(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,H]=l.useState(null),[J,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),H(null),me(n)}async function He(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),H(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Jt(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=J?qe(J.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
1
+ import{e as Ke,r as l,j as i,l as re,B as fe,c as Ve,G as ut,o as $,K as Te}from"./index-D6_5HAZl.js";import{F as mt,l as pt}from"./index-37PxaG4U.js";import{Z as ht,aq as xt,ar as gt,as as ae,at as yt,G as $e}from"./agent-icon-C7paq9nL.js";import{a as wt}from"./Tool01-BO2C1HmC.js";import{s as jt}from"./XClose-BLi9vIRd.js";import{S as bt}from"./scroll-area-CpcNn-v-.js";import{b as Re,T as Oe,a as ze}from"./tooltip-DjK_xTiM.js";import{A as vt,a as Ct,b as Nt,c as St,d as Dt,e as kt,f as Ft,g as Lt}from"./alert-dialog-DOf1CDFG.js";import{a as Et}from"./chat-context-D4Cm-d6A.js";import{u as Pt}from"./shell-layout-B5mx8HCW.js";import{a1 as le,a2 as Ae,a3 as Tt}from"./index-BvZc_M4M.js";import{c as $t,e as Rt,b as Ot,d as zt,a as At,D as Wt}from"./dialog-CvEIov2R.js";import{I as We}from"./input-CL16zv3M.js";import{C as It,c as _,d as Ie,e as Mt,f as Kt}from"./shell-route-loading-Nvrm4NyQ.js";import{t as Vt}from"./ChevronDown-Dxt-1uCb.js";import{i as Bt}from"./ChevronRight-CyvrXAe0.js";import{a as Gt}from"./ZoomOut-D1C0CDzK.js";import{E as qt,m as Me,n as he,o as Qt,p as Ut,q as Ht,t as M,r as ce,g as xe,s as ge,v as Jt,w as Xt,x as ye,y as de,z as we,A as Yt,B as Zt}from"./header-tab-button-IP2RhXhm.js";import"./AlertCircle-CslgXeHr.js";import"./SwitchHorizontal01-CxiFSSn6.js";import"./RefreshCcw01-JqGzzm_-.js";import"./XCircle-DZ20_zb3.js";import"./ArrowUpRight-D_DImXhK.js";import"./ZapSquare-CqyHqTSv.js";import"./Users03-Cwd2CyYY.js";import"./CheckCircle-HpSNY8ij.js";import"./Check-C4hca_-Y.js";import"./ChevronLeft-B5zdF1BR.js";import"./ChevronUp-aKq1AYju.js";import"./DotsVertical-Bo9Tm-x1.js";import"./Container-DXqMOloC.js";import"./Eye-CBgMpWUe.js";import"./Globe01-BgNeS-t5.js";import"./FilterLines-CWMZctUn.js";import"./Star01-J_T9yrd1.js";import"./Palette-BTCzP1Gm.js";import"./HardDrive-skQdR31x.js";import"./Stars02-CUXVM8eC.js";import"./Key01-CxukwP00.js";import"./LayoutLeft-CmXWN8pg.js";import"./LinkExternal01-l_9oMYRN.js";import"./Monitor01-DIoPLr7l.js";import"./Sun-BzriIyyb.js";import"./Play-DSJB4Nw2.js";import"./Plus-BUBMXRTd.js";import"./SearchMd-CGISNeet.js";import"./Settings02-C4ziU-d4.js";import"./Shield01-IwIv25Jp.js";import"./Stars01-BjgHV0Ah.js";import"./Trash01-DeyjRbcU.js";import"./Upload01-C4K5hWSL.js";import"./User01-CyAUnciz.js";import"./Users01-CCUr4Yur.js";import"./X-BoM0MLQn.js";import"./Zap-CrVhQ07E.js";import"./select-C81zuvtp.js";import"./tab-id-B_7JAjTL.js";import"./constants-CnOnAK7r.js";import"./decopilot-sse-pool-Bdv0H274.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-B_JQogr5.js";import"./use-collections-ClKr7eLP.js";import"./use-ai-providers-CfNPOGmz.js";import"./use-organization-settings-Ba_pVlZU.js";import"./avatar-BOZs09SE.js";import"./required-auth-layout-aQSUe2N_.js";import"./useRouterState-VRTDPwLh.js";import"./use-org-sso-CQo4DX7V.js";import"./agent-capabilities-Dl7XXwpG.js";import"./pair-CBFiuxUB.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DR1yGhlv.js";import"./file-type-icon-CUYwtPob.js";import"./content-blocks-o63cs2vh.js";import"./types-BRYvxHV0.js";import"./integration-icon-CQ-NchIr.js";import"./use-navigate-to-agent-bL0bZjvs.js";import"./use-connection-QL9Osw0s.js";import"./use-mcp-prompts-BthLsr-5.js";import"./form-BRW-mO5v.js";import"./label-DjHnY7oD.js";import"./spinner-DPcimsxj.js";import"./drawer-B_9l3ZhB.js";import"./collection-search-CUV3pFhw.js";import"./tabs-Jop0evx4.js";import"./toggle-group-CQHGgo0W.js";import"./connect-desktop-dialog-hVZb8AY9.js";import"./agent-icons-hJ9xtdfo.js";import"./checkbox-BwSTMmic.js";import"./skeleton-CGcndXpH.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-B7fIZ_m0.js";import"./card-wIb7H0Z4.js";import"./popover-CS_iXBnY.js";import"./command-C-yJHbpu.js";import"./index-XuzNc7bG.js";import"./useInfiniteQuery-BdAfpOZ8.js";import"./infiniteQueryObserver-Bc9cuK8G.js";import"./sortable.esm-Cc5wE8Md.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-vgtnONDT.js";import"./use-registry-connections-GFs4i1bK.js";import"./extract-connection-data-CaeplLEr.js";import"./generate-id-CdTqgONK.js";import"./collections-D8RfaH_g.js";import"./collection-tabs-CGllLoge.js";import"./badge-Cf9p2KiH.js";import"./textarea-C_ciKAYv.js";import"./connection-form-helpers-oCzpRzHj.js";import"./use-infinite-scroll-D369zKBP.js";import"./useSuspenseInfiniteQuery-BNJvF6Td.js";import"./index-Bn8JFywe.js";import"./dropdown-menu-BGgFPqgI.js";import"./question-004-sINsf4GQ.js";import"./sidebar-DELjK07K.js";import"./sheet-D9O2scBf.js";import"./use-status-sounds-BecbYKFZ.js";import"./empty-state-Db1HVS3F.js";import"./toolbar-CO7J3Qlp.js";import"./resizable-B-Kg7sz_.js";import"./use-mcp-tools-DKqH2jvx.js";import"./use-capability-CGr-3r92.js";import"./user-DFXkwuvu.js";import"./tools-list-CNevt541.js";import"./switch-D26GKac4.js";import"./use-debounced-autosave-StOJyK5k.js";import"./index-CNQY6k_W.js";import"./search-input-BmjJ0rJ1.js";import"./use-secrets-ChWP1SbP.js";import"./github-repo-picker-hw4e_RVO.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-CAJ4g4RV.js";import"./view-mode-toggle-B2R8JuP1.js";import"./select-model-CzLBWXoY.js";import"./use-automations-_NxkdQLG.js";import"./monaco-editor-DDa2PYLr.js";import"./automation-runs-BeoB4dd9.js";import"./table-DP9s7KR8.js";import"./use-members-CARBs-BO.js";import"./use-org-auth-client-B-7f7gTM.js";import"./task-status-VzGHvxK_.js";import"./automation-list-row-D730hoTt.js";import"./use-create-virtual-mcp-B7FzzrhS.js";import"./index-z0IJb09y.js";import"./hover-card-BMrhboDz.js";const _t={"new-file":{title:"New File",description:"Enter a name for the new file.",submit:"Create",placeholder:"filename.ts"},"new-folder":{title:"New Folder",description:"Enter a name for the new folder.",submit:"Create",placeholder:"folder-name"},rename:{title:"Rename",description:"Enter a new name for this item.",submit:"Rename",placeholder:"new-name"}};function en(y){const e=Ke.c(51),{open:c,mode:K,initialName:X,parentLabel:Q,isPending:A,onSubmit:V,onOpenChange:P}=y,W=X===void 0?"":X,o=A===void 0?!1:A,[p,R]=l.useState(W),[I,B]=l.useState(c),f=_t[K];c!==I&&(B(c),c&&R(W));let F;e[0]!==o||e[1]!==P?(F=E=>{!E&&!o&&P(!1)},e[0]=o,e[1]=P,e[2]=F):F=e[2];const U=F;let G;e[3]!==o||e[4]!==p||e[5]!==V?(G=async E=>{E.preventDefault();const z=p.trim();!z||o||await V(z)},e[3]=o,e[4]=p,e[5]=V,e[6]=G):G=e[6];const q=G;let L;e[7]!==f.title?(L=i.jsx($t,{children:f.title}),e[7]=f.title,e[8]=L):L=e[8];let N;e[9]!==f.description?(N=i.jsx(Rt,{children:f.description}),e[9]=f.description,e[10]=N):N=e[10];let O;e[11]!==L||e[12]!==N?(O=i.jsxs(Ot,{children:[L,N]}),e[11]=L,e[12]=N,e[13]=O):O=e[13];let S;e[14]!==Q?(S=Q&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Location"}),i.jsx(We,{value:Q,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[14]=Q,e[15]=S):S=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:"Name"}),e[16]=D):D=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=E=>R(E.target.value),e[17]=j):j=e[17];let b;e[18]!==f.placeholder||e[19]!==o||e[20]!==p?(b=i.jsxs("div",{className:"space-y-1.5",children:[D,i.jsx(We,{id:"file-explorer-name",value:p,onChange:j,placeholder:f.placeholder,autoFocus:!0,disabled:o})]}),e[18]=f.placeholder,e[19]=o,e[20]=p,e[21]=b):b=e[21];let h;e[22]!==b||e[23]!==S?(h=i.jsxs("div",{className:"space-y-4 py-4",children:[S,b]}),e[22]=b,e[23]=S,e[24]=h):h=e[24];let x;e[25]!==P?(x=()=>P(!1),e[25]=P,e[26]=x):x=e[26];let v;e[27]!==o||e[28]!==x?(v=i.jsx(fe,{type:"button",variant:"outline",onClick:x,disabled:o,children:"Cancel"}),e[27]=o,e[28]=x,e[29]=v):v=e[29];let C;e[30]!==o||e[31]!==p?(C=!p.trim()||o,e[30]=o,e[31]=p,e[32]=C):C=e[32];let u;e[33]!==f.submit||e[34]!==o?(u=o?i.jsxs(i.Fragment,{children:[i.jsx(re,{size:14,className:"animate-spin"}),"Saving…"]}):f.submit,e[33]=f.submit,e[34]=o,e[35]=u):u=e[35];let k;e[36]!==C||e[37]!==u?(k=i.jsx(fe,{type:"submit",disabled:C,children:u}),e[36]=C,e[37]=u,e[38]=k):k=e[38];let m;e[39]!==v||e[40]!==k?(m=i.jsxs(zt,{children:[v,k]}),e[39]=v,e[40]=k,e[41]=m):m=e[41];let g;e[42]!==q||e[43]!==h||e[44]!==m||e[45]!==O?(g=i.jsx(At,{className:"sm:max-w-md",children:i.jsxs("form",{onSubmit:q,children:[O,h,m]})}),e[42]=q,e[43]=h,e[44]=m,e[45]=O,e[46]=g):g=e[46];let T;return e[47]!==U||e[48]!==c||e[49]!==g?(T=i.jsx(Wt,{open:c,onOpenChange:U,children:g}),e[47]=U,e[48]=c,e[49]=g,e[50]=T):T=e[50],T}const tn="#d9a441";function nn(y){const e=Ke.c(45),{node:c,depth:K,isExpanded:X,isSelected:Q,isLoading:A,fileVisual:V,onOpen:P,onSelect:W,onNewFile:o,onNewFolder:p,onCopyPath:R,onCopyRelativePath:I,onRename:B,onDelete:f}=y,F=A===void 0?!1:A,U=c.kind==="directory",{Icon:G,color:q}=V,L=Q&&"bg-accent";let N;e[0]!==L?(N=Ve("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",L),e[0]=L,e[1]=N):N=e[1];const O=`${K*14+8}px`;let S;e[2]!==O?(S={paddingLeft:O},e[2]=O,e[3]=S):S=e[3];let D;e[4]!==P||e[5]!==W?(D=()=>{W(),P()},e[4]=P,e[5]=W,e[6]=D):D=e[6];let j;e[7]!==G||e[8]!==q||e[9]!==U||e[10]!==X||e[11]!==F?(j=U?i.jsxs(i.Fragment,{children:[F?i.jsx(re,{size:14,className:"shrink-0 animate-spin text-muted-foreground"}):X?i.jsx(Vt,{size:14,className:"shrink-0 text-muted-foreground"}):i.jsx(Bt,{size:14,className:"shrink-0 text-muted-foreground"}),i.jsx(Gt,{size:16,className:"shrink-0",style:{color:tn}})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"w-3.5 shrink-0"}),i.jsx(G,{size:16,className:"shrink-0",style:{color:q}})]}),e[7]=G,e[8]=q,e[9]=U,e[10]=X,e[11]=F,e[12]=j):j=e[12];let b;e[13]!==c.name?(b=i.jsx("span",{className:"truncate",children:c.name}),e[13]=c.name,e[14]=b):b=e[14];let h;e[15]!==N||e[16]!==S||e[17]!==D||e[18]!==j||e[19]!==b?(h=i.jsx(It,{asChild:!0,children:i.jsxs("button",{type:"button",className:N,style:S,onClick:D,children:[j,b]})}),e[15]=N,e[16]=S,e[17]=D,e[18]=j,e[19]=b,e[20]=h):h=e[20];let x;e[21]!==o?(x=i.jsx(_,{onSelect:o,children:"New File"}),e[21]=o,e[22]=x):x=e[22];let v;e[23]!==p?(v=i.jsx(_,{onSelect:p,children:"New Folder"}),e[23]=p,e[24]=v):v=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ie,{}),e[25]=C):C=e[25];let u;e[26]!==R?(u=i.jsx(_,{onSelect:R,children:"Copy Path"}),e[26]=R,e[27]=u):u=e[27];let k;e[28]!==I?(k=i.jsx(_,{onSelect:I,children:"Copy Relative Path"}),e[28]=I,e[29]=k):k=e[29];let m;e[30]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(Ie,{}),e[30]=m):m=e[30];let g;e[31]!==B?(g=i.jsx(_,{onSelect:B,children:"Rename"}),e[31]=B,e[32]=g):g=e[32];let T;e[33]!==f?(T=i.jsx(_,{variant:"destructive",onSelect:f,children:"Delete"}),e[33]=f,e[34]=T):T=e[34];let E;e[35]!==x||e[36]!==v||e[37]!==u||e[38]!==k||e[39]!==g||e[40]!==T?(E=i.jsxs(Mt,{className:"w-52",children:[x,v,C,u,k,m,g,T]}),e[35]=x,e[36]=v,e[37]=u,e[38]=k,e[39]=g,e[40]=T,e[41]=E):E=e[41];let z;return e[42]!==E||e[43]!==h?(z=i.jsxs(Kt,{children:[h,E]}),e[42]=E,e[43]=h,e[44]=z):z=e[44],z}pt.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});function je(y,e,c,K){return`/api/${y}/sandbox/${encodeURIComponent(e)}/${encodeURIComponent(c)}/${K}`}function rn(y){const e=M(y);return!e||e.includes("..")||e.includes("\\")?!1:e.startsWith(".deco/blocks/")||!e.startsWith("/")&&!e.includes("://")}const sn="#94a3b8";function on(y){const e=y.toLowerCase();return e.endsWith(".tsx")||e.endsWith(".ts")?{Icon:ae,color:"#3b82f6"}:e.endsWith(".jsx")||e.endsWith(".js")||e.endsWith(".mjs")||e.endsWith(".cjs")?{Icon:ae,color:"#d9a441"}:e.endsWith(".json")?{Icon:yt,color:"#cb9b3f"}:e.endsWith(".css")||e.endsWith(".scss")?{Icon:ae,color:"#06b6d4"}:e.endsWith(".html")||e.endsWith(".xml")?{Icon:ae,color:"#f97316"}:/\.(png|jpe?g|gif|webp|avif|ico|svg)$/.test(e)?{Icon:wt,color:"#a855f7"}:e.endsWith(".md")||e.endsWith(".mdx")?{Icon:$e,color:"#64748b"}:{Icon:$e,color:sn}}function Qi({orgSlug:y,virtualMcpId:e,branch:c,openPath:K}){const[X,Q]=l.useState({files:[],directories:[],truncated:!1}),{files:A,directories:V}=X,[P,W]=l.useState(new Set),[o,p]=l.useState(null),[R,I]=l.useState(null),[B,f]=l.useState([]),[F,U]=l.useState(""),[G,q]=l.useState(!1),[L,N]=l.useState(!1),[,O]=l.useState(new Set),[S,D]=l.useState(new Set),j=l.useRef(0),b=l.useRef(null),h=l.useRef(new Set),x=l.useRef(new Map);function v(t){O(n=>{const r=typeof t=="function"?t(n):t;return h.current=r,r})}const[C,u]=l.useState(new Map),k=l.useRef(null),[m,g]=l.useState(null),{sendMessage:T}=Et(),{setChatOpen:E}=Pt(),z=ut(),[w,H]=l.useState(null),[J,ue]=l.useState(null),[ee,ie]=l.useState(!1);async function te(t,n){const r=await fetch(je(y,e,c,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const s=await r.json().catch(()=>({}));throw new Error(s.error??`Request failed (${r.status})`)}return r.json()}async function se(){z.invalidateQueries({queryKey:Ae(y,e,c)})}function be(t,n){navigator.clipboard.writeText(n).then(()=>$.success(`${t} copied`),()=>$.error(`Failed to copy ${t.toLowerCase()}`))}function Be(t){const n=Yt(t);if(!n)return;const r=`${y}/${e}/${c}`;z.setQueryData(Te.decofile(r),s=>{if(!s)return s;const{[n]:a,...d}=s;return d}),z.invalidateQueries({queryKey:Te.liveMeta(r)})}function Ge(t){const n=t.kind==="file"?[t.path]:A.filter(r=>r.startsWith(".deco/blocks/")).map(r=>ce(r)).filter(r=>r===t.path||r.startsWith(`${t.path}/`));for(const r of n)Be(r)}function qe(t){const n=ce(t);return B.filter(r=>{if(r!==n&&!r.startsWith(`${n}/`))return!1;const s=C.get(r);return!!(s?.loaded&&s.editorValue!==s.savedContent)})}function ve(t){f(n=>n.map(r=>t(r)).filter(r=>r!==null)),p(n=>n&&t(n)),u(n=>{const r=new Map;for(const[s,a]of n){const d=t(s);d&&r.set(d,a)}return r}),I(n=>{if(!n)return n;const r=t(n.path);return r?r===n.path?n:{...n,path:r,name:r.split("/").pop()??r}:null})}function Qe(t){const n=ce(t);I(r=>r&&(r.path===n||r.path.startsWith(`${n}/`)?null:r)),ve(r=>r===n||r.startsWith(`${n}/`)?null:r)}async function Ue(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);await te("write",{path:M(n),content:""}),await ne(),await se(),H(null),me(n)}async function He(t){if(!w)return;const n=de(w.parentDir,t);if(we(n,A,V))throw new Error(`"${t}" already exists`);const r=M(n);await te("mkdir",{path:r}),Q(s=>({...s,directories:s.directories.includes(r)?s.directories:[...s.directories,r]})),await ne(),await se(),H(null),W(s=>{const a=new Set(s);for(const d of he(n))a.add(d);return a.add(n),a}),I({name:t,path:n,kind:"directory",children:[]})}async function Je(t){if(!w)return;const n=w.node.path,r=ye(n),s=de(r,t);if(s===n){H(null);return}if(we(s,A,V))throw new Error(`"${t}" already exists`);await te("rename",{from:M(n),to:M(s)}),ve(a=>a===n?s:a.startsWith(`${n}/`)?de(s,a.slice(n.length+1)):a),await ne(),await se(),H(null)}async function Xe(t){ie(!0);try{await te("unlink",{path:M(t.path),recursive:t.kind==="directory"}),Ge(t),Qe(t.path),await ne(),await se(),ue(null),$.success(`Deleted "${t.name}"`)}catch(n){$.error(n instanceof Error?n.message:"Delete failed")}finally{ie(!1)}}async function Ye(t){const n=Xt(t);if(n){$.error(n);return}ie(!0);try{w?.mode==="new-file"?(await Ue(t),$.success(`Created "${t}"`)):w?.mode==="new-folder"?(await He(t),$.success(`Created folder "${t}"`)):w?.mode==="rename"&&(await Je(t),$.success(`Renamed to "${t}"`))}catch(r){$.error(r instanceof Error?r.message:"Operation failed")}finally{ie(!1)}}const Ce=l.useRef(!1);Ce.current||(Ce.current=!0,b.current=ne());const[Ze,_e]=l.useState(null);if(K&&K!==Ze){_e(K);const t=K;queueMicrotask(()=>{rn(t)&&me(t).catch(n=>{$.error(n instanceof Error?n.message:"Failed to open file")})})}async function Ne(t){const n=await te("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function Se(t,n,r){if(r!==j.current)return!1;let s=!1;return Q(a=>{const d=n?Zt(a.files,a.directories,t,a.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return s=!!d.truncated,{files:d.files,directories:d.directories,truncated:s}}),s&&$.warning("File list truncated — some files may be hidden"),s}async function et(t){const n=x.current.get(t);if(n)return n;const r=j.current,s=(async()=>{const a=await Ne({pattern:"**/*",path:M(t),limit:Me}),d=Se(a,!0,r);return!d&&r===j.current&&v(Y=>{const oe=new Set(Y);return oe.add(t),oe}),d})();x.current.set(t,s);try{return await s}finally{x.current.delete(t)}}async function De(t){if(!ge(t,h.current))return!1;D(n=>new Set(n).add(t));try{return await et(t)}finally{D(n=>{const r=new Set(n);return r.delete(t),r})}}async function tt(t){const n=new Set(h.current);for(const r of he(t)){if(!ge(r,n))continue;if(await De(r))throw new Error("Folder listing truncated — expand again to load more");n.add(r)}}async function ne(){const t=++j.current;x.current.clear(),q(!0),v(new Set),W(new Set),D(new Set);try{const n=await Ne({pattern:"**/*",limit:Me,maxDepth:qt});Se(n,!1,t),N(!0)}catch{L&&$.error("Failed to refresh file tree")}finally{q(!1)}}async function ke(t){if(!C.get(t)?.loaded){u(r=>{const s=new Map(r);return s.set(t,{savedContent:"",editorValue:"",loaded:!1}),s});try{const r=await fetch(je(y,e,c,"read"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),full:!0})});if(!r.ok)return;const s=await r.json(),a=Jt(s.content??"");u(d=>{const Y=new Map(d);return Y.set(t,{savedContent:a,editorValue:a,loaded:!0}),Y})}catch{}}}async function nt(t,n){try{const r=await fetch(je(y,e,c,"write"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:M(t),content:n})});if(!r.ok){le("file save failed",{path:t,status:r.status});return}le("file saved via sandbox /write",{path:t}),z.invalidateQueries({queryKey:Ae(y,e,c)});try{const s=await Tt(y,e,c);le("git status after save",s)}catch(s){le("git status after save failed",{path:t,error:s instanceof Error?s.message:String(s)})}u(s=>{const a=new Map(s),d=a.get(t);return d&&a.set(t,{...d,savedContent:n}),a})}catch{}}function rt(t){p(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),g(null),B.includes(t)||f(n=>[...n,t]),ke(t)}function it(t){f(n=>{const r=n.filter(s=>s!==t);return o===t&&p(r[r.length-1]??null),r}),u(n=>{const r=new Map(n);return r.delete(t),r})}function Fe(t){W(n=>{const r=new Set(n);return r.has(t)?r.delete(t):r.add(t),r})}async function st(t){if(ge(t,h.current))try{if(await De(t))return}catch(n){$.error(n instanceof Error?n.message:"Failed to load folder");return}Fe(t)}async function ot(t,n){if(n){Fe(t);return}await st(t)}async function me(t){await b.current,await tt(t);const n=he(t);W(r=>{const s=new Set(r);for(const a of n)s.add(a);return s}),rt(t)}function at(){return R?.kind==="directory"?R.path:R?.kind==="file"?ye(R.path):o?ye(o):"/"}function Le(t){const n=at();H({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const lt=Qt(A,V),Ee=Ut(lt,P),Pe=F?Ee.filter(t=>t.node.name.toLowerCase().includes(F.toLowerCase())):Ee,Z=o?C.get(o):null,ct=Z?.loaded&&Z.editorValue!==Z.savedContent,pe=J?qe(J.path):[],dt=(t,n)=>{k.current=t,t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!o)return;const r=t.getValue();await nt(o,r)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const r=t.getSelection(),s=t.getModel();if(!r||!s||!o)return;const a=s.getValueInRange(r);g({filePath:o,lineStart:r.startLineNumber,lineEnd:r.endLineNumber,selectedCode:a})})};function ft(t){if(!m)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${m.filePath}\``,`**Lines:** ${m.lineStart}–${m.lineEnd}`];if(m.selectedCode){const r=xe(m.filePath),s=m.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+r,s,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),E(!0),T({parts:[{type:"text",text:n.join(`
2
2
  `)}]}),g(null)}return G&&!L?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[i.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[i.jsxs("div",{className:"relative min-w-0 flex-1",children:[i.jsx(ht,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),i.jsx("input",{type:"text",value:F,onChange:t=>U(t.target.value),placeholder:"Search files...","aria-label":"Search files",className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New file",onClick:()=>Le("new-file"),children:i.jsx(xt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New file"})]}),i.jsxs(Re,{children:[i.jsx(Oe,{asChild:!0,children:i.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":"New folder",onClick:()=>Le("new-folder"),children:i.jsx(gt,{size:14})})}),i.jsx(ze,{side:"bottom",children:"New folder"})]})]}),i.jsx(bt,{className:"flex-1",children:i.jsxs("div",{className:"py-1",children:[Pe.map(t=>{const{node:n,depth:r}=t,s=n.kind==="directory",a=P.has(n.path),d=R?.path===n.path,Y=Ht(n.path,n.kind),oe=s&&S.has(n.path);return i.jsx(nn,{node:n,depth:r,isExpanded:a,isSelected:d,isLoading:oe,fileVisual:on(n.name),onSelect:()=>I(n),onOpen:()=>{s?ot(n.path,a):me(n.path)},onNewFile:()=>H({mode:"new-file",node:n,parentDir:Y}),onNewFolder:()=>H({mode:"new-folder",node:n,parentDir:Y}),onCopyPath:()=>be("Path",ce(n.path)),onCopyRelativePath:()=>be("Relative path",M(n.path)),onRename:()=>H({mode:"rename",node:n,parentDir:Y}),onDelete:()=>ue(n)},n.path)}),L&&Pe.length===0&&i.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:F?`No files match "${F}"`:"No files found"})]})})]}),i.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[B.length>0&&i.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:B.map(t=>{const n=C.get(t),r=n?.loaded&&n.editorValue!==n.savedContent,s=o===t,a=t.split("/").pop()??t;return i.jsxs("div",{className:Ve("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",s?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{p(t),ke(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":s,children:[i.jsx("span",{className:"truncate max-w-32",children:a}),r&&i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),i.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:d=>{d.stopPropagation(),it(t)},children:i.jsx(jt,{size:12})})]},t)})}),m&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:i.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const r=t.currentTarget.elements.namedItem("askAiInput");r.value.trim()&&ft(r.value)},children:[i.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:"Ask the AI...",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&g(null)}}),i.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:"Send",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[i.jsx("title",{children:"Send"}),i.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),i.jsx("div",{className:"flex-1 overflow-hidden",children:o&&Z?.loaded?i.jsx(mt,{language:xe(o),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:Z.editorValue,path:o,onChange:t=>{const n=o;n&&u(r=>{const s=new Map(r),a=s.get(n);return a&&s.set(n,{...a,editorValue:t??""}),s})},onMount:dt,loading:i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},o):o&&!Z?.loaded?i.jsx("div",{className:"flex items-center justify-center h-full w-full",children:i.jsx(re,{size:20,className:"animate-spin text-muted-foreground"})}):i.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:"Select a file to edit"})}),o&&i.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[i.jsx("span",{className:"truncate",children:o}),i.jsxs("span",{children:[ct?"Modified":"Saved"," ·"," ",xe(o)]})]})]}),i.jsx(en,{open:w!==null,mode:w?.mode??"new-file",initialName:w?.mode==="rename"?w.node.name:"",parentLabel:w&&w.mode!=="rename"?w.parentDir==="/"?"/":M(w.parentDir):void 0,isPending:ee,onSubmit:Ye,onOpenChange:t=>{!t&&!ee&&H(null)}}),i.jsx(vt,{open:J!==null,onOpenChange:t=>{!t&&!ee&&ue(null)},children:i.jsxs(Ct,{children:[i.jsxs(Nt,{children:[i.jsxs(St,{children:["Delete ",J?.kind==="directory"?"folder":"file","?"]}),i.jsxs(Dt,{children:["This will permanently delete"," ",i.jsx("span",{className:"font-mono",children:J?.name}),J?.kind==="directory"?" and everything inside it.":".",pe.length>0&&i.jsxs(i.Fragment,{children:[" ",pe.length===1?"One open file has unsaved changes that will be lost.":`${pe.length} open files have unsaved changes that will be lost.`]})]})]}),i.jsxs(kt,{children:[i.jsx(Ft,{disabled:ee,children:"Cancel"}),i.jsx(Lt,{disabled:ee||!J,onClick:t=>{t.preventDefault(),J&&Xe(J)},children:"Delete"})]})]})})]})}export{Qi as FileExplorer};
@@ -1,4 +1,4 @@
1
- import{bC as $l,j as z,b5 as gt,bD as $n,r as mt,bE as l0,c as c0,e as kt,B as Ub}from"./index-DI_C2zjL.js";import{i as Hb}from"./Check-BxIVbrMR.js";import{a as qb}from"./Eye-EKPlnsLc.js";import{D as d0,g as p0,h as f0,c as g0}from"./dialog-CFcYm0YL.js";import{n as m0}from"./Globe01-Tm1ARX4Z.js";import{g as h0,n as b0}from"./ZoomOut-CTra4wHa.js";function zl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Rt=zl();function Gb(e){Rt=e}var un={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},E0=/^(?:[ \t]*(?:\n|$))+/,T0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,S0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,An=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,y0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jl=/(?:[*+-]|\d{1,9}[.)])/,$b=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zb=le($b).replace(/bull/g,jl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),A0=le($b).replace(/bull/g,jl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Vl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_0=/^[^\n]+/,Yl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,I0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),k0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jl).getRegex(),Jn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,R0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Wl).replace("tag",Jn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jb=le(Vl).replace("hr",An).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jn).getRegex(),N0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jb).getRegex(),Kl={blockquote:N0,code:T0,def:I0,fences:S0,heading:y0,hr:An,html:R0,lheading:zb,list:k0,newline:E0,paragraph:jb,table:un,text:_0},Lc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",An).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jn).getRegex(),C0={...Kl,lheading:A0,table:Lc,paragraph:le(Vl).replace("hr",An).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Lc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jn).getRegex()},v0={...Kl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:un,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Vl).replace("hr",An).replace("heading",` *#{1,6} *[^
1
+ import{bC as $l,j as z,b5 as gt,bD as $n,r as mt,bE as l0,c as c0,e as kt,B as Ub}from"./index-D6_5HAZl.js";import{i as Hb}from"./Check-C4hca_-Y.js";import{a as qb}from"./Eye-CBgMpWUe.js";import{D as d0,g as p0,h as f0,c as g0}from"./dialog-CvEIov2R.js";import{n as m0}from"./Globe01-BgNeS-t5.js";import{g as h0,n as b0}from"./ZoomOut-D1C0CDzK.js";function zl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Rt=zl();function Gb(e){Rt=e}var un={exec:()=>null};function le(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(a,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(xe.caret,"$1"),n=n.replace(a,o),r},getRegex:()=>new RegExp(n,t)};return r}var xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},E0=/^(?:[ \t]*(?:\n|$))+/,T0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,S0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,An=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,y0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jl=/(?:[*+-]|\d{1,9}[.)])/,$b=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zb=le($b).replace(/bull/g,jl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),A0=le($b).replace(/bull/g,jl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Vl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_0=/^[^\n]+/,Yl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,I0=le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Yl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),k0=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,jl).getRegex(),Jn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,R0=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Wl).replace("tag",Jn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jb=le(Vl).replace("hr",An).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jn).getRegex(),N0=le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jb).getRegex(),Kl={blockquote:N0,code:T0,def:I0,fences:S0,heading:y0,hr:An,html:R0,lheading:zb,list:k0,newline:E0,paragraph:jb,table:un,text:_0},Lc=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",An).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jn).getRegex(),C0={...Kl,lheading:A0,table:Lc,paragraph:le(Vl).replace("hr",An).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Lc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jn).getRegex()},v0={...Kl,html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:un,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(Vl).replace("hr",An).replace("heading",` *#{1,6} *[^
2
2
  ]`).replace("lheading",zb).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},w0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,x0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vb=/^( {2,}|\\)\n(?!\s*$)/,O0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,er=/[\p{P}\p{S}]/u,Xl=/[\s\p{P}\p{S}]/u,Yb=/[^\s\p{P}\p{S}]/u,L0=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xl).getRegex(),Wb=/(?!~)[\p{P}\p{S}]/u,D0=/(?!~)[\s\p{P}\p{S}]/u,M0=/(?:[^\s\p{P}\p{S}]|~)/u,P0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Kb=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,F0=le(Kb,"u").replace(/punct/g,er).getRegex(),B0=le(Kb,"u").replace(/punct/g,Wb).getRegex(),Xb="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",U0=le(Xb,"gu").replace(/notPunctSpace/g,Yb).replace(/punctSpace/g,Xl).replace(/punct/g,er).getRegex(),H0=le(Xb,"gu").replace(/notPunctSpace/g,M0).replace(/punctSpace/g,D0).replace(/punct/g,Wb).getRegex(),q0=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yb).replace(/punctSpace/g,Xl).replace(/punct/g,er).getRegex(),G0=le(/\\(punct)/,"gu").replace(/punct/g,er).getRegex(),$0=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),z0=le(Wl).replace("(?:-->|$)","-->").getRegex(),j0=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",z0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),zn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,V0=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",zn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Zb=le(/^!?\[(label)\]\[(ref)\]/).replace("label",zn).replace("ref",Yl).getRegex(),Qb=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Yl).getRegex(),Y0=le("reflink|nolink(?!\\()","g").replace("reflink",Zb).replace("nolink",Qb).getRegex(),Zl={_backpedal:un,anyPunctuation:G0,autolink:$0,blockSkip:P0,br:Vb,code:x0,del:un,emStrongLDelim:F0,emStrongRDelimAst:U0,emStrongRDelimUnd:q0,escape:w0,link:V0,nolink:Qb,punctuation:L0,reflink:Zb,reflinkSearch:Y0,tag:j0,text:O0,url:un},W0={...Zl,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",zn).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",zn).getRegex()},Al={...Zl,emStrongRDelimAst:H0,emStrongLDelim:B0,url:le(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},K0={...Al,br:le(Vb).replace("{2,}","*").getRegex(),text:le(Al.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},wn={normal:Kl,gfm:C0,pedantic:v0},Qt={normal:Zl,gfm:Al,breaks:K0,pedantic:W0},X0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Dc=e=>X0[e];function Ze(e,t){if(t){if(xe.escapeTest.test(e))return e.replace(xe.escapeReplace,Dc)}else if(xe.escapeTestNoEncode.test(e))return e.replace(xe.escapeReplaceNoEncode,Dc);return e}function Mc(e){try{e=encodeURI(e).replace(xe.percentDecode,"%")}catch{return null}return e}function Pc(e,t){const n=e.replace(xe.findPipe,(i,o,s)=>{let u=!1,l=o;for(;--l>=0&&s[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(xe.splitPipe);let a=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(xe.slashPipe,"|");return r}function Jt(e,t,n){const r=e.length;if(r===0)return"";let a=0;for(;a<r&&e.charAt(r-a-1)===t;)a++;return e.slice(0,r-a)}function Z0(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Fc(e,t,n,r,a){const i=t.href,o=t.title||null,s=e[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,u}function Q0(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const a=r[1];return t.split(`
3
3
  `).map(i=>{const o=i.match(n.other.beginningSpace);if(o===null)return i;const[s]=o;return s.length>=a.length?i.slice(a.length):i}).join(`
4
4
  `)}var jn=class{options;rules;lexer;constructor(e){this.options=e||Rt}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Jt(n,`
@@ -1 +1 @@
1
- import{e as a,g as o,j as i,N as l}from"./index-DI_C2zjL.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
1
+ import{e as a,g as o,j as i,N as l}from"./index-D6_5HAZl.js";function m(){const e=a.c(3);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={strict:!1},e[0]=t):t=e[0];const{org:r}=o(t);let s;return e[1]!==r?(s=i.jsx(l,{to:"/$org/files",params:{org:r},replace:!0}),e[1]=r,e[2]=s):s=e[2],s}export{m as default};
@@ -1 +1 @@
1
- import{cB as C,e as f,j as c,D as j,r as d,c as p,bn as b,cC as v,cD as h}from"./index-DI_C2zjL.js";import{L as N}from"./label-DP3KsQ6l.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};
1
+ import{cB as C,e as f,j as c,D as j,r as d,c as p,bn as b,cC as v,cD as h}from"./index-D6_5HAZl.js";import{L as N}from"./label-DjHnY7oD.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{M as F,E as a,w as b,L as c,P as d,y as e,R as f};