decocms 4.122.14 → 4.122.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/dist/client/assets/{AlertCircle-NpBTsyur.js → AlertCircle-D-kVAi-Y.js} +1 -1
  2. package/dist/client/assets/{AreaChart-D9QiJ_A8.js → AreaChart-Due5BuRL.js} +1 -1
  3. package/dist/client/assets/{ArrowRight-B7AyzR7S.js → ArrowRight-Bx7KGV_m.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-qgV92UI1.js → ArrowUp-YGSD34FZ.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-B-e4_EGK.js → ArrowUpRight-CStnlhwF.js} +1 -1
  6. package/dist/client/assets/{Check-DYGof06e.js → Check-Bjh_dZaN.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BNOoSOay.js → CheckCircle-CzMlZY1r.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-DtyBrD4r.js → ChevronDown-DR-XGc_o.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-4_ZxuH5F.js → ChevronRight-bT3DGPuC.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-BV_GK5UR.js → ChevronUp-CybHO04j.js} +1 -1
  11. package/dist/client/assets/{Copy01-DbXmJwJZ.js → Copy01-Cfl5jLwI.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-CaxtIyQ7.js → DotsVertical-CJlRJVmq.js} +1 -1
  13. package/dist/client/assets/{Eye-C7cdT0dB.js → Eye-CU7q62eA.js} +1 -1
  14. package/dist/client/assets/{FilterLines--Gwm6PA_.js → FilterLines-BwUgA4op.js} +1 -1
  15. package/dist/client/assets/{Globe01-RRbwaUoS.js → Globe01-CmLdKvRa.js} +1 -1
  16. package/dist/client/assets/{Globe04-DXDerniV.js → Globe04-vZKWGzyN.js} +1 -1
  17. package/dist/client/assets/{HardDrive-DnSSkKdI.js → HardDrive-C1QTwNTd.js} +1 -1
  18. package/dist/client/assets/{Image01-BGThpaTh.js → Image01-WjnT3vkg.js} +1 -1
  19. package/dist/client/assets/{Key01-Cso8bvpk.js → Key01-hthPwawD.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-Bh2cGcTG.js → LayoutLeft-uWnld18c.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BxDjkEys.js → LinkExternal01-DHLpwU3P.js} +1 -1
  22. package/dist/client/assets/{LogOut01-DmoDtG9D.js → LogOut01-D33cHmr7.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DSgVJ17-.js → Monitor01-BDyMPMJl.js} +1 -1
  24. package/dist/client/assets/{Package-D3YmTpaa.js → Package-CM9iNlE1.js} +1 -1
  25. package/dist/client/assets/{Palette-CnFfAbW6.js → Palette-BjZJtLWZ.js} +1 -1
  26. package/dist/client/assets/{Play-sn_BiPQh.js → Play-Cxf_pwqN.js} +1 -1
  27. package/dist/client/assets/{Plus-DVa_q09h.js → Plus-DgckXwlY.js} +1 -1
  28. package/dist/client/assets/{SearchLg-sw3czIeU.js → SearchLg-BEDaeAtc.js} +1 -1
  29. package/dist/client/assets/{SearchMd-iKYTv-N-.js → SearchMd-C1lYDFim.js} +1 -1
  30. package/dist/client/assets/{Settings02-yINpcEQ5.js → Settings02-DoG1Nfyp.js} +1 -1
  31. package/dist/client/assets/{Shield01-D6fd1DU1.js → Shield01-CddFs9bt.js} +1 -1
  32. package/dist/client/assets/{Star01-D5KjiGdp.js → Star01-DMJ78lDH.js} +1 -1
  33. package/dist/client/assets/{Stars01-D61WxwZ_.js → Stars01-DR2nHN0i.js} +1 -1
  34. package/dist/client/assets/{Stars02-CpzjjQDL.js → Stars02-Ct5ox9m0.js} +1 -1
  35. package/dist/client/assets/{Sun-BrYUeB1D.js → Sun-fdN8_9W7.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-DVmEnIpu.js → SwitchHorizontal01-CYCGBS4I.js} +1 -1
  37. package/dist/client/assets/{Tool01-D7vBh4XH.js → Tool01-DmVRDemn.js} +1 -1
  38. package/dist/client/assets/{Tool02-pdUH4Bu_.js → Tool02-DV3o4Bnz.js} +1 -1
  39. package/dist/client/assets/{Trash01-CSWJgO6z.js → Trash01-C6wUgBxF.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-CgM7ZV0W.js → TrendUp01-BQpQm7d5.js} +1 -1
  41. package/dist/client/assets/{Upload01-DTbWLNWj.js → Upload01-Doh6auBX.js} +1 -1
  42. package/dist/client/assets/{User01-Dk69C-Jt.js → User01-DWPfaa-w.js} +1 -1
  43. package/dist/client/assets/{Users01-Dr4GlwyL.js → Users01-DH6fVMuj.js} +1 -1
  44. package/dist/client/assets/{Users03-BBn0Ff6d.js → Users03-kyrWgYJ0.js} +1 -1
  45. package/dist/client/assets/{X-DZX3xH4r.js → X-D4lv3UFg.js} +1 -1
  46. package/dist/client/assets/{XCircle-k_KiCLEF.js → XCircle-DUZC4nO5.js} +1 -1
  47. package/dist/client/assets/{XClose-C3p2ksqx.js → XClose-BPb7jDBm.js} +1 -1
  48. package/dist/client/assets/{Zap-C9pB5ojL.js → Zap-DSDfhd90.js} +1 -1
  49. package/dist/client/assets/{ZapSquare-DnOzaqYG.js → ZapSquare-b6EsRHI9.js} +1 -1
  50. package/dist/client/assets/{ZoomOut-DPkOxVPp.js → ZoomOut-CkXpjAt8.js} +1 -1
  51. package/dist/client/assets/{access-gate-CK2ZugXE.js → access-gate-C-mDJUbr.js} +1 -1
  52. package/dist/client/assets/{add-section-modal-kn8byDuW.js → add-section-modal-CtOaTdAH.js} +1 -1
  53. package/dist/client/assets/{agent-icon-wSfqa-He.js → agent-icon-D3vHoY7x.js} +1 -1
  54. package/dist/client/assets/{agents-list-3MUqWrph.js → agents-list-BqEPvDzr.js} +1 -1
  55. package/dist/client/assets/{ai-providers-BPlaVsB0.js → ai-providers-CKDmIAT-.js} +1 -1
  56. package/dist/client/assets/{alert-Dde4RqiL.js → alert-BgKAv3i-.js} +1 -1
  57. package/dist/client/assets/{alert-dialog-DTwaKao-.js → alert-dialog-DIXXqsEe.js} +1 -1
  58. package/dist/client/assets/{app-editor-DkbJjWBR.js → app-editor-DPaFBucH.js} +1 -1
  59. package/dist/client/assets/{auth-l_8B14Xw.js → auth-BOcqkMNE.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-10V78VDP.js → auth-catchall-Dw1XE9Mk.js} +1 -1
  61. package/dist/client/assets/{auth-entry-BHT9zkVP.js → auth-entry-DWHQSPFq.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-D6RPIk4b.js → auth-split-layout-V-tq689J.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-QjyaYjrw.js → authenticate-and-persist-oauth-DVE-CAJ6.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-B_nww4lM.js → automation-list-row-CAjA07xU.js} +1 -1
  65. package/dist/client/assets/{automation-runs-yw01cblZ.js → automation-runs-DbOiSGDh.js} +1 -1
  66. package/dist/client/assets/{automations-Buv__m9w.js → automations-DEP2HCqR.js} +1 -1
  67. package/dist/client/assets/{autosend-JiAR1s1F.js → autosend-D9fZMd9O.js} +1 -1
  68. package/dist/client/assets/{avatar-DzV5kKzz.js → avatar-CMD9GLeQ.js} +1 -1
  69. package/dist/client/assets/{badge-B3krVD3K.js → badge-DKtY9IW6.js} +1 -1
  70. package/dist/client/assets/{block-document-D2u3ES-A.js → block-document-DFhk9ngM.js} +1 -1
  71. package/dist/client/assets/{brand-context-CZWiP2-l.js → brand-context-BiZA_O2X.js} +1 -1
  72. package/dist/client/assets/{buckets-BWgLvUD0.js → buckets-s2dPn_w0.js} +1 -1
  73. package/dist/client/assets/{bulk-category-panel-BeDaeYee.js → bulk-category-panel-C6B8CUI6.js} +1 -1
  74. package/dist/client/assets/{calendar-DjbCBX-L.js → calendar-BnMP5V4l.js} +1 -1
  75. package/dist/client/assets/{capability-load-error-D-jxJm8P.js → capability-load-error-CZOvWXEn.js} +1 -1
  76. package/dist/client/assets/{card-BY-jwgUt.js → card-CrxWnI-4.js} +1 -1
  77. package/dist/client/assets/{category-editor-Bcr7IpfM.js → category-editor-Ccgg-Mts.js} +1 -1
  78. package/dist/client/assets/{chat-context-CQ8VLWJn.js → chat-context-njYRRmzi.js} +1 -1
  79. package/dist/client/assets/{checkbox-UAJUnPhd.js → checkbox-CLC3kfwf.js} +1 -1
  80. package/dist/client/assets/{cli-auth-success-BSn8clDQ.js → cli-auth-success-Cgtrd8UN.js} +1 -1
  81. package/dist/client/assets/{collection-detail-PFX_0D6f.js → collection-detail-wfS7L-0_.js} +1 -1
  82. package/dist/client/assets/{collection-display-button-cznTFIyk.js → collection-display-button-B-TaNCuZ.js} +1 -1
  83. package/dist/client/assets/{collection-search-DMRdeF9A.js → collection-search-taKBbIAW.js} +1 -1
  84. package/dist/client/assets/{collection-table-wrapper-DfZedsSC.js → collection-table-wrapper-DqDqwzee.js} +1 -1
  85. package/dist/client/assets/{collection-tabs-XO23Zsii.js → collection-tabs-CYp4_eql.js} +1 -1
  86. package/dist/client/assets/{command-DPFmPmav.js → command-ZwIO9DXw.js} +1 -1
  87. package/dist/client/assets/{commerce-onboarding-hxx4gRkY.js → commerce-onboarding-DT8SjtIF.js} +1 -1
  88. package/dist/client/assets/{companions-core-Di5R5Qlg.js → companions-core-dEWHjb4N.js} +1 -1
  89. package/dist/client/assets/{connect-DMTE6jeZ.js → connect-CGrlkYzs.js} +1 -1
  90. package/dist/client/assets/{connect-desktop-dialog-DbR0F4Uf.js → connect-desktop-dialog-DABBuHti.js} +1 -1
  91. package/dist/client/assets/{connection-B_WFK_LV.js → connection-ILH258gL.js} +1 -1
  92. package/dist/client/assets/{connection-card-BncCSfZi.js → connection-card-CoaNSqo2.js} +1 -1
  93. package/dist/client/assets/{connection-detail-DSx5qf3O.js → connection-detail-BzEYZKx8.js} +1 -1
  94. package/dist/client/assets/{connection-form-helpers-CE0fzpQ4.js → connection-form-helpers-BOFrInIU.js} +1 -1
  95. package/dist/client/assets/{connections-BSRcTfyB.js → connections-DMRTjjzC.js} +1 -1
  96. package/dist/client/assets/{decopilot-sse-pool-CbJrYvte.js → decopilot-sse-pool-DKwWkMzg.js} +1 -1
  97. package/dist/client/assets/{dialog-BjKYnhNA.js → dialog-CiGDoXc-.js} +1 -1
  98. package/dist/client/assets/{domain-settings-D_qdgTR6.js → domain-settings-jlGSSGF3.js} +1 -1
  99. package/dist/client/assets/{drawer-Jn3sV0qT.js → drawer-je3oSUrj.js} +1 -1
  100. package/dist/client/assets/{dropdown-menu-DJTcFS8b.js → dropdown-menu-Z83H3jjh.js} +1 -1
  101. package/dist/client/assets/{empty-state-BonGhub_.js → empty-state-FTzOr3sY.js} +1 -1
  102. package/dist/client/assets/{extract-connection-data-ccePCpvZ.js → extract-connection-data-COcBONcq.js} +1 -1
  103. package/dist/client/assets/{file-explorer-DxOUVjlS.js → file-explorer-DC_Ra5V_.js} +1 -1
  104. package/dist/client/assets/{file-type-icon-B91brOKF.js → file-type-icon-DjREOPtP.js} +1 -1
  105. package/dist/client/assets/{files-D6dz8n7w.js → files-CUNjEsUB.js} +1 -1
  106. package/dist/client/assets/{form-DBMnEAEB.js → form-DpPK2Pnk.js} +1 -1
  107. package/dist/client/assets/{general-_WjmZ3Dr.js → general-Cud0BvLc.js} +1 -1
  108. package/dist/client/assets/{github-repo-picker-CbZmP4XJ.js → github-repo-picker-BDXi1DOh.js} +1 -1
  109. package/dist/client/assets/{hooks-BVR29cJW.js → hooks-UkRTM6J8.js} +1 -1
  110. package/dist/client/assets/{index-CTYe9Eji.js → index-1-zojyBg.js} +1 -1
  111. package/dist/client/assets/{index-BurssIYb.js → index-2c3KmaQC.js} +1 -1
  112. package/dist/client/assets/{index-EEpg-cDs.js → index-BCL76Pwn.js} +1 -1
  113. package/dist/client/assets/{index-D7SctC2t.js → index-BDffj4K8.js} +3 -3
  114. package/dist/client/assets/{index-DFHhUNdO.js → index-BEnpNMGG.js} +1 -1
  115. package/dist/client/assets/{index-CQdjJHdz.js → index-BIk2FObe.js} +1 -1
  116. package/dist/client/assets/{index-CYwYXuVz.js → index-CpHnUY5r.js} +26 -26
  117. package/dist/client/assets/{index-5Lvjqa__.js → index-CzfKXFrq.js} +1 -1
  118. package/dist/client/assets/{index-BZwxEMj6.js → index-DAkMdwdo.js} +1 -1
  119. package/dist/client/assets/{index-ClxyGqRx.js → index-DTyCp6qN.js} +1 -1
  120. package/dist/client/assets/{index-V-37Xuf_.js → index-Dqlz9zwJ.js} +3 -3
  121. package/dist/client/assets/{index-BT6aOFuI.js → index-elhaeXja.js} +1 -1
  122. package/dist/client/assets/{index-redirect-BbagRyyC.js → index-redirect-40G9IiKo.js} +1 -1
  123. package/dist/client/assets/{index-C7-Q8B2W.js → index-svA6YuJW.js} +1 -1
  124. package/dist/client/assets/{input-CF402O8H.js → input-CHRRtUw8.js} +1 -1
  125. package/dist/client/assets/{integration-icon-zEsDSX_D.js → integration-icon-BPI3lzxT.js} +1 -1
  126. package/dist/client/assets/{invite-member-dialog-BZR4__Js.js → invite-member-dialog-CwqN6n_o.js} +1 -1
  127. package/dist/client/assets/{label-BIa388-H.js → label-euFZVchF.js} +1 -1
  128. package/dist/client/assets/{layout-CkD-mafg.js → layout-DR4AVxTh.js} +1 -1
  129. package/dist/client/assets/{login-B0kSoPc_.js → login-BwkXDAIX.js} +1 -1
  130. package/dist/client/assets/{mcp-oauth-CA8QvGZS.js → mcp-oauth-GLfIVmi3.js} +1 -1
  131. package/dist/client/assets/{members-DwjWsIL4.js → members-PHm2C2xK.js} +1 -1
  132. package/dist/client/assets/{monaco-editor-D5Si7jnT.js → monaco-editor-BysypzbM.js} +1 -1
  133. package/dist/client/assets/{monitoring-stats-row-DBH-5QGj.js → monitoring-stats-row-Bsp7aDsw.js} +1 -1
  134. package/dist/client/assets/{multi-select-B3rmHQQg.js → multi-select-Dz4OLcU-.js} +1 -1
  135. package/dist/client/assets/{oauth-callback-bgALLFYt.js → oauth-callback-CC2wFIet.js} +1 -1
  136. package/dist/client/assets/{oauth-callback-ai-provider-I6cCd7bD.js → oauth-callback-ai-provider-CUCvuq7E.js} +1 -1
  137. package/dist/client/assets/{onboarding-Br37gERG.js → onboarding-CdMFRdUO.js} +1 -1
  138. package/dist/client/assets/{org-install-CCV47UFD.js → org-install-Yu3bdOp5.js} +1 -1
  139. package/dist/client/assets/{org-layout-C3rorOq5.js → org-layout-CFDOUW5j.js} +1 -1
  140. package/dist/client/assets/{organization-choice-CXoIiUJe.js → organization-choice-DaPj0aqq.js} +1 -1
  141. package/dist/client/assets/{orgs-ULOcO88g.js → orgs-DRHyhdUj.js} +1 -1
  142. package/dist/client/assets/{page-seo-form-DYgGux1h.js → page-seo-form-yy0g23Pt.js} +1 -1
  143. package/dist/client/assets/page-seo-sheet-DKO1FFOc.js +1 -0
  144. package/dist/client/assets/{popover-CyOwyNZ9.js → popover-BiLcarEK.js} +1 -1
  145. package/dist/client/assets/{post-editor-BAfOgpsu.js → post-editor-B8oKcEtM.js} +1 -1
  146. package/dist/client/assets/{primitives-DuObWUqn.js → primitives-MxRlpWeJ.js} +1 -1
  147. package/dist/client/assets/{profile-DUOC512l.js → profile-BPECEbl4.js} +1 -1
  148. package/dist/client/assets/project-app-view-DHOPCtd6.js +1 -0
  149. package/dist/client/assets/record-editor-D3P9uvFH.js +1 -0
  150. package/dist/client/assets/{redirect-editor-B6XpuDYk.js → redirect-editor-CFJ5YPmj.js} +1 -1
  151. package/dist/client/assets/registry-DG506Tu4.js +2 -0
  152. package/dist/client/assets/{registry-layout-BwFVQpaM.js → registry-layout-B2mYiUXv.js} +1 -1
  153. package/dist/client/assets/{reports-dBK434B0.js → reports-OiD20Nbe.js} +1 -1
  154. package/dist/client/assets/{require-capability-DIpU6kTL.js → require-capability-DMDJuuXK.js} +1 -1
  155. package/dist/client/assets/{required-auth-layout-CBATdr4q.js → required-auth-layout-C-CtZGRc.js} +1 -1
  156. package/dist/client/assets/{reset-password-PBD7xzXm.js → reset-password-DyW1eXUY.js} +1 -1
  157. package/dist/client/assets/{roles-BpBn3FWp.js → roles-BxgJqWfM.js} +1 -1
  158. package/dist/client/assets/{search-input-Bv8nmaGY.js → search-input-CSfMjvfl.js} +1 -1
  159. package/dist/client/assets/{secrets-BoDkq3yS.js → secrets-ClZl8q_l.js} +1 -1
  160. package/dist/client/assets/{sections-editor-o6PXuZpp.js → sections-editor-DU-tynBg.js} +1 -1
  161. package/dist/client/assets/{select-model-DWMTBLvc.js → select-model-DJF2fRvq.js} +1 -1
  162. package/dist/client/assets/{select-Cu8CJmg1.js → select-nJbJ90P6.js} +1 -1
  163. package/dist/client/assets/{self-tool-result-Cc1KiWen.js → self-tool-result-Q767nooR.js} +1 -1
  164. package/dist/client/assets/{seo-editor-DWiFkRgR.js → seo-editor-CjFG7rIB.js} +1 -1
  165. package/dist/client/assets/{settings-layout-B7uhGwFe.js → settings-layout-KlsByyPx.js} +1 -1
  166. package/dist/client/assets/{settings-section-BEJvi8St.js → settings-section-zIf9-0kB.js} +1 -1
  167. package/dist/client/assets/{shell-controls-D3ALdnOv.js → shell-controls-BGpGRFdi.js} +1 -1
  168. package/dist/client/assets/{shell-layout-u0H-VozI.js → shell-layout-NIXGxo0w.js} +1 -1
  169. package/dist/client/assets/{sidebar-DTkb3k7d.js → sidebar-C1458ulp.js} +1 -1
  170. package/dist/client/assets/{skeleton-8SHwxHVp.js → skeleton-B8U3ZcNj.js} +1 -1
  171. package/dist/client/assets/{sso-BkjbrUee.js → sso-B62tSn-Z.js} +1 -1
  172. package/dist/client/assets/{store-CIoA_Zyb.js → store-DOUIWk6t.js} +1 -1
  173. package/dist/client/assets/store-registry-C3jZCXRg.js +2 -0
  174. package/dist/client/assets/{studio-tools-ACBDJhU7.js → studio-tools-DTZoa0OH.js} +1 -1
  175. package/dist/client/assets/{switch-DaCBz20z.js → switch-CKtXd1ah.js} +1 -1
  176. package/dist/client/assets/{table-CsEQiN_t.js → table-BbujZgA3.js} +1 -1
  177. package/dist/client/assets/{tabs-TsrqklR9.js → tabs-DQE77bfY.js} +1 -1
  178. package/dist/client/assets/{textarea-DjN_F4k9.js → textarea-Bw3tH400.js} +1 -1
  179. package/dist/client/assets/{toggle-group-DGmOhs9j.js → toggle-group-DUMUXjh6.js} +1 -1
  180. package/dist/client/assets/{toolbar-CCqpTsyi.js → toolbar-Wb_J3S9t.js} +1 -1
  181. package/dist/client/assets/{toolbar-icon-button-87kQULI0.js → toolbar-icon-button-31x5z4uU.js} +1 -1
  182. package/dist/client/assets/{tooltip-Bn0JTM4_.js → tooltip-CMkhKk3x.js} +1 -1
  183. package/dist/client/assets/{use-ai-providers-5IJwU5Y-.js → use-ai-providers-C343O16l.js} +1 -1
  184. package/dist/client/assets/{use-api-keys-BmxQIYv0.js → use-api-keys-D7V1SozP.js} +1 -1
  185. package/dist/client/assets/{use-automations-D3p9Jw08.js → use-automations-C3demvog.js} +1 -1
  186. package/dist/client/assets/{use-autosave-Dyb-dWtM.js → use-autosave-DYsbBRA1.js} +1 -1
  187. package/dist/client/assets/{use-capability-C6148RUP.js → use-capability-RA6a5MMs.js} +1 -1
  188. package/dist/client/assets/{use-clock-tick-432SbhH_.js → use-clock-tick-DC2K9Wg5.js} +1 -1
  189. package/dist/client/assets/{use-connection-DKtzpgoI.js → use-connection-OIiba3pD.js} +1 -1
  190. package/dist/client/assets/{use-copy-8HLRGQzl.js → use-copy-BTLcQMH2.js} +1 -1
  191. package/dist/client/assets/{use-create-virtual-mcp-DWCCLir6.js → use-create-virtual-mcp-DDBw4EhB.js} +1 -1
  192. package/dist/client/assets/{use-debounced-autosave-DJmwe53G.js → use-debounced-autosave-yoQIg0QR.js} +1 -1
  193. package/dist/client/assets/{use-debounced-value-SMuQSfNj.js → use-debounced-value-CoqiqSmi.js} +1 -1
  194. package/dist/client/assets/{use-deco-credits-B0jIAHzs.js → use-deco-credits-CyPJl-yU.js} +1 -1
  195. package/dist/client/assets/{use-decopilot-events-CtmV52fj.js → use-decopilot-events-CCKxlKDg.js} +1 -1
  196. package/dist/client/assets/{use-delete-connection-C0dN20pW.js → use-delete-connection-2PS5Ug52.js} +1 -1
  197. package/dist/client/assets/{use-deployment-admin-CPQyeFhI.js → use-deployment-admin-B1G1LNDa.js} +1 -1
  198. package/dist/client/assets/{use-file-configs-B95qlAFM.js → use-file-configs-DMjlzMvX.js} +1 -1
  199. package/dist/client/assets/{use-infinite-scroll-BIMv83Zk.js → use-infinite-scroll-CxCSWx2V.js} +1 -1
  200. package/dist/client/assets/{use-join-requests-CxnR2-3T.js → use-join-requests-CNXCdDqI.js} +1 -1
  201. package/dist/client/assets/{use-mcp-auth-status-Csbh020h.js → use-mcp-auth-status-CNpHsLDq.js} +1 -1
  202. package/dist/client/assets/{use-mcp-client-RZHGKzHm.js → use-mcp-client-W9jPPMhB.js} +1 -1
  203. package/dist/client/assets/{use-mcp-tools-BzQDVVBi.js → use-mcp-tools-krS0V_oW.js} +1 -1
  204. package/dist/client/assets/{use-members-BIcTshg_.js → use-members-D6JLN6iy.js} +1 -1
  205. package/dist/client/assets/{use-mobile-CUaS8-kb.js → use-mobile-BeFZRUdQ.js} +1 -1
  206. package/dist/client/assets/{use-navigate-to-agent-BKCW_gvh.js → use-navigate-to-agent-DuvgSFBW.js} +1 -1
  207. package/dist/client/assets/{use-org-auth-client-CTOiCgoS.js → use-org-auth-client-Dz17AxV5.js} +1 -1
  208. package/dist/client/assets/{use-org-sso-CnbJTDU6.js → use-org-sso-D-6b5I-z.js} +1 -1
  209. package/dist/client/assets/{use-organization-roles-DXfD-RJE.js → use-organization-roles-D2xtRoGd.js} +1 -1
  210. package/dist/client/assets/{use-organization-settings-CH-htQ1J.js → use-organization-settings-CyQxkosV.js} +1 -1
  211. package/dist/client/assets/{use-registry-app-BthdH2ea.js → use-registry-app-CSbbfigq.js} +1 -1
  212. package/dist/client/assets/{use-registry-connections-BIal8PBT.js → use-registry-connections-00ED1_4f.js} +1 -1
  213. package/dist/client/assets/{use-secrets-_YVbySB1.js → use-secrets-m1_T0t4-.js} +1 -1
  214. package/dist/client/assets/{use-status-sounds-clWHVS3M.js → use-status-sounds-XGsloIX3.js} +1 -1
  215. package/dist/client/assets/{use-view-mode-BahD1lRp.js → use-view-mode-Cp-5_Di5.js} +1 -1
  216. package/dist/client/assets/{use-virtual-mcp-DK3H6vtn.js → use-virtual-mcp-BmI1O-A5.js} +1 -1
  217. package/dist/client/assets/useInfiniteQuery-C-cdJvnh.js +1 -0
  218. package/dist/client/assets/{useQueries-AO3SD8q_.js → useQueries-BVIPfm08.js} +1 -1
  219. package/dist/client/assets/{useRouterState-CFfc3Bvj.js → useRouterState-BmlY6WIR.js} +1 -1
  220. package/dist/client/assets/useSuspenseInfiniteQuery-BH9Prwkk.js +1 -0
  221. package/dist/client/assets/{users-DLwvMWGf.js → users-CJrjAmlP.js} +1 -1
  222. package/dist/client/assets/{variant-calendar-JK0q88ZG.js → variant-calendar-Dfe_pwwp.js} +1 -1
  223. package/dist/client/assets/{view-mode-toggle-gIoo4dmO.js → view-mode-toggle-Bf3qhasj.js} +1 -1
  224. package/dist/client/index.html +1 -1
  225. package/dist/server/cli.js +171 -169
  226. package/dist/server/server.js +2 -1
  227. package/package.json +1 -1
  228. package/dist/client/assets/page-seo-sheet-B7l-ddo5.js +0 -1
  229. package/dist/client/assets/project-app-view-0vEJCjGh.js +0 -1
  230. package/dist/client/assets/record-editor-B2osw4Ud.js +0 -1
  231. package/dist/client/assets/registry-DGlJ0Qoi.js +0 -2
  232. package/dist/client/assets/store-registry-D9pZlOOW.js +0 -2
  233. package/dist/client/assets/useInfiniteQuery-Dtz-1iXn.js +0 -1
  234. package/dist/client/assets/useSuspenseInfiniteQuery-B0cjFAnj.js +0 -1
@@ -1 +1 @@
1
- import{r as v,j as d,bA as k,ax as p,bD as M,bC as y,bB as P,aD as T,az as S,aC as D,aA as F,aE as V,c as x,m as g}from"./index-V-37Xuf_.js";var m="Tabs",[G]=S(m,[y]),C=y(),[L,h]=G(m),w=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,onValueChange:r,defaultValue:s,orientation:o="horizontal",dir:i,activationMode:l="automatic",...f}=n,u=D(i),[c,b]=F({prop:t,onChange:r,defaultProp:s??"",caller:m});return d.jsx(L,{scope:a,baseId:V(),value:c,onValueChange:b,orientation:o,dir:u,activationMode:l,children:d.jsx(p.div,{dir:u,"data-orientation":o,...f,ref:e})})});w.displayName=m;var N="TabsList",j=v.forwardRef((n,e)=>{const{__scopeTabs:a,loop:t=!0,...r}=n,s=h(N,a),o=C(a);return d.jsx(k,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:t,children:d.jsx(p.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});j.displayName=N;var I="TabsTrigger",_=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,disabled:r=!1,...s}=n,o=h(I,a),i=C(a),l=E(o.baseId,t),f=$(o.baseId,t),u=t===o.value;return d.jsx(P,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":f,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:e,onMouseDown:T(n.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?o.onValueChange(t):c.preventDefault()}),onKeyDown:T(n.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&o.onValueChange(t)}),onFocus:T(n.onFocus,()=>{const c=o.activationMode!=="manual";!u&&!r&&c&&o.onValueChange(t)})})})});_.displayName=I;var A="TabsContent",R=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,forceMount:r,children:s,...o}=n,i=h(A,a),l=E(i.baseId,t),f=$(i.baseId,t),u=t===i.value,c=v.useRef(u);return v.useEffect(()=>{const b=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(M,{present:r||u,children:({present:b})=>d.jsx(p.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:f,tabIndex:0,...o,ref:e,style:{...n.style,animationDuration:c.current?"0s":void 0},children:b&&s})})});R.displayName=A;function E(n,e){return`${n}-trigger-${e}`}function $(n,e){return`${n}-content-${e}`}var z=w,B=j,K=_,q=R;function O(n){const e=x.c(10);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r===void 0?"pill":r;let o;e[4]!==a?(o=g("flex flex-col gap-2",a),e[4]=a,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==o||e[8]!==s?(i=d.jsx(z,{"data-slot":"tabs","data-variant":s,className:o,...t}),e[6]=t,e[7]=o,e[8]=s,e[9]=i):i=e[9],i}function J(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex h-[52px] items-center border-b border-border":s==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(B,{"data-slot":"tabs-list","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function Q(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":s==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(K,{"data-slot":"tabs-trigger","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function U(n){const e=x.c(8);let a,t;e[0]!==n?({className:a,...t}=n,e[0]=n,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let r;e[3]!==a?(r=g("flex-1 outline-none h-full",a),e[3]=a,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=d.jsx(q,{"data-slot":"tabs-content",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{U as T,O as a,Q as b,J as c};
1
+ import{r as v,j as d,bA as k,ax as p,bD as M,bC as y,bB as P,aD as T,az as S,aC as D,aA as F,aE as V,c as x,m as g}from"./index-Dqlz9zwJ.js";var m="Tabs",[G]=S(m,[y]),C=y(),[L,h]=G(m),w=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,onValueChange:r,defaultValue:s,orientation:o="horizontal",dir:i,activationMode:l="automatic",...f}=n,u=D(i),[c,b]=F({prop:t,onChange:r,defaultProp:s??"",caller:m});return d.jsx(L,{scope:a,baseId:V(),value:c,onValueChange:b,orientation:o,dir:u,activationMode:l,children:d.jsx(p.div,{dir:u,"data-orientation":o,...f,ref:e})})});w.displayName=m;var N="TabsList",j=v.forwardRef((n,e)=>{const{__scopeTabs:a,loop:t=!0,...r}=n,s=h(N,a),o=C(a);return d.jsx(k,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:t,children:d.jsx(p.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:e})})});j.displayName=N;var I="TabsTrigger",_=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,disabled:r=!1,...s}=n,o=h(I,a),i=C(a),l=E(o.baseId,t),f=$(o.baseId,t),u=t===o.value;return d.jsx(P,{asChild:!0,...i,focusable:!r,active:u,children:d.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":f,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:e,onMouseDown:T(n.onMouseDown,c=>{!r&&c.button===0&&c.ctrlKey===!1?o.onValueChange(t):c.preventDefault()}),onKeyDown:T(n.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&o.onValueChange(t)}),onFocus:T(n.onFocus,()=>{const c=o.activationMode!=="manual";!u&&!r&&c&&o.onValueChange(t)})})})});_.displayName=I;var A="TabsContent",R=v.forwardRef((n,e)=>{const{__scopeTabs:a,value:t,forceMount:r,children:s,...o}=n,i=h(A,a),l=E(i.baseId,t),f=$(i.baseId,t),u=t===i.value,c=v.useRef(u);return v.useEffect(()=>{const b=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(b)},[]),d.jsx(M,{present:r||u,children:({present:b})=>d.jsx(p.div,{"data-state":u?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!b,id:f,tabIndex:0,...o,ref:e,style:{...n.style,animationDuration:c.current?"0s":void 0},children:b&&s})})});R.displayName=A;function E(n,e){return`${n}-trigger-${e}`}function $(n,e){return`${n}-content-${e}`}var z=w,B=j,K=_,q=R;function O(n){const e=x.c(10);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r===void 0?"pill":r;let o;e[4]!==a?(o=g("flex flex-col gap-2",a),e[4]=a,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==o||e[8]!==s?(i=d.jsx(z,{"data-slot":"tabs","data-variant":s,className:o,...t}),e[6]=t,e[7]=o,e[8]=s,e[9]=i):i=e[9],i}function J(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex h-[52px] items-center border-b border-border":s==="canvas"?"flex h-10 items-center bg-background relative":"bg-muted text-muted-foreground inline-flex h-10 w-fit items-center justify-center rounded-xl p-[3px]";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(B,{"data-slot":"tabs-list","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function Q(n){const e=x.c(11);let a,t,r;e[0]!==n?({className:a,variant:r,...t}=n,e[0]=n,e[1]=a,e[2]=t,e[3]=r):(a=e[1],t=e[2],r=e[3]);const s=r||"pill",o=s==="underline"?"flex items-center h-full px-3 relative text-sm whitespace-nowrap border-b-2 mb-[-1px] transition-all text-muted-foreground border-transparent hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary disabled:pointer-events-none disabled:opacity-50":s==="canvas"?"flex items-center h-full px-3 gap-2.5 text-sm whitespace-nowrap transition-all border-r border-b border-border [&>*]:opacity-50 data-[state=active]:[&>*]:opacity-100 data-[state=active]:border-b-0 last:border-r-0 disabled:pointer-events-none max-w-2xs":"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";let i;e[4]!==a||e[5]!==o?(i=g(o,a),e[4]=a,e[5]=o,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==t||e[9]!==i?(l=d.jsx(K,{"data-slot":"tabs-trigger","data-variant":s,className:i,...t}),e[7]=s,e[8]=t,e[9]=i,e[10]=l):l=e[10],l}function U(n){const e=x.c(8);let a,t;e[0]!==n?({className:a,...t}=n,e[0]=n,e[1]=a,e[2]=t):(a=e[1],t=e[2]);let r;e[3]!==a?(r=g("flex-1 outline-none h-full",a),e[3]=a,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=d.jsx(q,{"data-slot":"tabs-content",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{U as T,O as a,Q as b,J as c};
@@ -1 +1 @@
1
- import{c as o,m as l,j as n}from"./index-V-37Xuf_.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
1
+ import{c as o,m as l,j as n}from"./index-Dqlz9zwJ.js";function c(s){const e=o.c(8);let i,r;e[0]!==s?({className:i,...r}=s,e[0]=s,e[1]=i,e[2]=r):(i=e[1],r=e[2]);let t;e[3]!==i?(t=l("placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-xl bg-background dark:bg-input/30 px-3 py-2 text-sm transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:cursor-not-allowed disabled:opacity-50",i),e[3]=i,e[4]=t):t=e[4];let a;return e[5]!==r||e[6]!==t?(a=n.jsx("textarea",{"data-slot":"textarea",className:t,...r}),e[5]=r,e[6]=t,e[7]=a):a=e[7],a}export{c as T};
@@ -1 +1 @@
1
- import{r as x,aA as b,j as c,ax as m,aD as k,aw as p,bB as A,bC as T,aC as M,bA as S,az as D,bt as F,c as C,m as P}from"./index-V-37Xuf_.js";var j="Toggle",_=x.forwardRef((a,e)=>{const{pressed:l,defaultPressed:s,onPressedChange:n,...r}=a,[t,o]=b({prop:l,onChange:n,defaultProp:s??!1,caller:j});return c.jsx(m.button,{type:"button","aria-pressed":t,"data-state":t?"on":"off","data-disabled":a.disabled?"":void 0,...r,ref:e,onClick:k(a.onClick,()=>{a.disabled||o(!t)})})});_.displayName=j;var v="ToggleGroup",[w]=D(v,[T]),z=T(),h=p.forwardRef((a,e)=>{const{type:l,...s}=a;if(l==="single"){const n=s;return c.jsx($,{...n,ref:e})}if(l==="multiple"){const n=s;return c.jsx(B,{...n,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${v}\``)});h.displayName=v;var[I,y]=w(v),$=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=b({prop:l,defaultProp:s??"",onChange:n,caller:v});return c.jsx(I,{scope:a.__scopeToggleGroup,type:"single",value:p.useMemo(()=>t?[t]:[],[t]),onItemActivate:o,onItemDeactivate:p.useCallback(()=>o(""),[o]),children:c.jsx(R,{...r,ref:e})})}),B=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=b({prop:l,defaultProp:s??[],onChange:n,caller:v}),i=p.useCallback(u=>o((g=[])=>[...g,u]),[o]),d=p.useCallback(u=>o((g=[])=>g.filter(V=>V!==u)),[o]);return c.jsx(I,{scope:a.__scopeToggleGroup,type:"multiple",value:t,onItemActivate:i,onItemDeactivate:d,children:c.jsx(R,{...r,ref:e})})});h.displayName=v;var[O,H]=w(v),R=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,disabled:s=!1,rovingFocus:n=!0,orientation:r,dir:t,loop:o=!0,...i}=a,d=z(l),u=M(t),g={role:"group",dir:u,...i};return c.jsx(O,{scope:l,rovingFocus:n,disabled:s,children:n?c.jsx(S,{asChild:!0,...d,orientation:r,dir:u,loop:o,children:c.jsx(m.div,{...g,ref:e})}):c.jsx(m.div,{...g,ref:e})})}),f="ToggleGroupItem",N=p.forwardRef((a,e)=>{const l=y(f,a.__scopeToggleGroup),s=H(f,a.__scopeToggleGroup),n=z(a.__scopeToggleGroup),r=l.value.includes(a.value),t=s.disabled||a.disabled,o={...a,pressed:r,disabled:t},i=p.useRef(null);return s.rovingFocus?c.jsx(A,{asChild:!0,...n,focusable:!t,active:r,ref:i,children:c.jsx(G,{...o,ref:e})}):c.jsx(G,{...o,ref:e})});N.displayName=f;var G=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,value:s,...n}=a,r=y(f,l),t={role:"radio","aria-checked":a.pressed,"aria-pressed":void 0},o=r.type==="single"?t:void 0;return c.jsx(_,{...o,...n,ref:e,onPressedChange:i=>{i?r.onItemActivate(s):r.onItemDeactivate(s)}})}),L=h,U=N;const q=F("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),E=x.createContext({size:"default",variant:"default"});function K(a){const e=C.c(20);let l,s,n,r,t;e[0]!==a?({className:s,variant:t,size:r,children:l,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);let o;e[6]!==s?(o=P("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",s),e[6]=s,e[7]=o):o=e[7];let i;e[8]!==r||e[9]!==t?(i={variant:t,size:r},e[8]=r,e[9]=t,e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==i?(d=c.jsx(E.Provider,{value:i,children:l}),e[11]=l,e[12]=i,e[13]=d):d=e[13];let u;return e[14]!==n||e[15]!==r||e[16]!==o||e[17]!==d||e[18]!==t?(u=c.jsx(L,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:o,...n,children:d}),e[14]=n,e[15]=r,e[16]=o,e[17]=d,e[18]=t,e[19]=u):u=e[19],u}function Q(a){const e=C.c(18);let l,s,n,r,t;e[0]!==a?({className:s,children:l,variant:t,size:r,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);const o=x.useContext(E),i=o.variant||t,d=o.size||r;let u;e[6]!==s||e[7]!==o.size||e[8]!==o.variant||e[9]!==r||e[10]!==t?(u=P(q({variant:o.variant||t,size:o.size||r}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",s),e[6]=s,e[7]=o.size,e[8]=o.variant,e[9]=r,e[10]=t,e[11]=u):u=e[11];let g;return e[12]!==l||e[13]!==n||e[14]!==i||e[15]!==d||e[16]!==u?(g=c.jsx(U,{"data-slot":"toggle-group-item","data-variant":i,"data-size":d,className:u,...n,children:l}),e[12]=l,e[13]=n,e[14]=i,e[15]=d,e[16]=u,e[17]=g):g=e[17],g}export{Q as T,K as a};
1
+ import{r as x,aA as b,j as c,ax as m,aD as k,aw as p,bB as A,bC as T,aC as M,bA as S,az as D,bt as F,c as C,m as P}from"./index-Dqlz9zwJ.js";var j="Toggle",_=x.forwardRef((a,e)=>{const{pressed:l,defaultPressed:s,onPressedChange:n,...r}=a,[t,o]=b({prop:l,onChange:n,defaultProp:s??!1,caller:j});return c.jsx(m.button,{type:"button","aria-pressed":t,"data-state":t?"on":"off","data-disabled":a.disabled?"":void 0,...r,ref:e,onClick:k(a.onClick,()=>{a.disabled||o(!t)})})});_.displayName=j;var v="ToggleGroup",[w]=D(v,[T]),z=T(),h=p.forwardRef((a,e)=>{const{type:l,...s}=a;if(l==="single"){const n=s;return c.jsx($,{...n,ref:e})}if(l==="multiple"){const n=s;return c.jsx(B,{...n,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${v}\``)});h.displayName=v;var[I,y]=w(v),$=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=b({prop:l,defaultProp:s??"",onChange:n,caller:v});return c.jsx(I,{scope:a.__scopeToggleGroup,type:"single",value:p.useMemo(()=>t?[t]:[],[t]),onItemActivate:o,onItemDeactivate:p.useCallback(()=>o(""),[o]),children:c.jsx(R,{...r,ref:e})})}),B=p.forwardRef((a,e)=>{const{value:l,defaultValue:s,onValueChange:n=()=>{},...r}=a,[t,o]=b({prop:l,defaultProp:s??[],onChange:n,caller:v}),i=p.useCallback(u=>o((g=[])=>[...g,u]),[o]),d=p.useCallback(u=>o((g=[])=>g.filter(V=>V!==u)),[o]);return c.jsx(I,{scope:a.__scopeToggleGroup,type:"multiple",value:t,onItemActivate:i,onItemDeactivate:d,children:c.jsx(R,{...r,ref:e})})});h.displayName=v;var[O,H]=w(v),R=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,disabled:s=!1,rovingFocus:n=!0,orientation:r,dir:t,loop:o=!0,...i}=a,d=z(l),u=M(t),g={role:"group",dir:u,...i};return c.jsx(O,{scope:l,rovingFocus:n,disabled:s,children:n?c.jsx(S,{asChild:!0,...d,orientation:r,dir:u,loop:o,children:c.jsx(m.div,{...g,ref:e})}):c.jsx(m.div,{...g,ref:e})})}),f="ToggleGroupItem",N=p.forwardRef((a,e)=>{const l=y(f,a.__scopeToggleGroup),s=H(f,a.__scopeToggleGroup),n=z(a.__scopeToggleGroup),r=l.value.includes(a.value),t=s.disabled||a.disabled,o={...a,pressed:r,disabled:t},i=p.useRef(null);return s.rovingFocus?c.jsx(A,{asChild:!0,...n,focusable:!t,active:r,ref:i,children:c.jsx(G,{...o,ref:e})}):c.jsx(G,{...o,ref:e})});N.displayName=f;var G=p.forwardRef((a,e)=>{const{__scopeToggleGroup:l,value:s,...n}=a,r=y(f,l),t={role:"radio","aria-checked":a.pressed,"aria-pressed":void 0},o=r.type==="single"?t:void 0;return c.jsx(_,{...o,...n,ref:e,onPressedChange:i=>{i?r.onItemActivate(s):r.onItemDeactivate(s)}})}),L=h,U=N;const q=F("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/20 focus-visible:ring-[2px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-2 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),E=x.createContext({size:"default",variant:"default"});function K(a){const e=C.c(20);let l,s,n,r,t;e[0]!==a?({className:s,variant:t,size:r,children:l,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);let o;e[6]!==s?(o=P("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",s),e[6]=s,e[7]=o):o=e[7];let i;e[8]!==r||e[9]!==t?(i={variant:t,size:r},e[8]=r,e[9]=t,e[10]=i):i=e[10];let d;e[11]!==l||e[12]!==i?(d=c.jsx(E.Provider,{value:i,children:l}),e[11]=l,e[12]=i,e[13]=d):d=e[13];let u;return e[14]!==n||e[15]!==r||e[16]!==o||e[17]!==d||e[18]!==t?(u=c.jsx(L,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:o,...n,children:d}),e[14]=n,e[15]=r,e[16]=o,e[17]=d,e[18]=t,e[19]=u):u=e[19],u}function Q(a){const e=C.c(18);let l,s,n,r,t;e[0]!==a?({className:s,children:l,variant:t,size:r,...n}=a,e[0]=a,e[1]=l,e[2]=s,e[3]=n,e[4]=r,e[5]=t):(l=e[1],s=e[2],n=e[3],r=e[4],t=e[5]);const o=x.useContext(E),i=o.variant||t,d=o.size||r;let u;e[6]!==s||e[7]!==o.size||e[8]!==o.variant||e[9]!==r||e[10]!==t?(u=P(q({variant:o.variant||t,size:o.size||r}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",s),e[6]=s,e[7]=o.size,e[8]=o.variant,e[9]=r,e[10]=t,e[11]=u):u=e[11];let g;return e[12]!==l||e[13]!==n||e[14]!==i||e[15]!==d||e[16]!==u?(g=c.jsx(U,{"data-slot":"toggle-group-item","data-variant":i,"data-size":d,className:u,...n,children:l}),e[12]=l,e[13]=n,e[14]=i,e[15]=d,e[16]=u,e[17]=g):g=e[17],g}export{Q as T,K as a};
@@ -1 +1 @@
1
- import{c as i,r as g,j as c,m as T,b as j,f as L,af as p,L as N,a9 as $,aY as y}from"./index-V-37Xuf_.js";const S=g.createContext(null);function h(){const t=g.use(S);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function E(t){const e=i.c(8),{children:s}=t,[l,o]=g.useState(null),[n,r]=g.useState(null),[a,f]=g.useState(null),[m,b]=g.useState(null);let d;e[0]!==a||e[1]!==m||e[2]!==n||e[3]!==l?(d={togglesEl:l,setTogglesEl:o,tabsEl:n,setTabsEl:r,centerEl:a,setCenterEl:f,rightEl:m,setRightEl:b},e[0]=a,e[1]=m,e[2]=n,e[3]=l,e[4]=d):d=e[4];let x;return e[5]!==s||e[6]!==d?(x=c.jsx(S,{value:d,children:s}),e[5]=s,e[6]=d,e[7]=x):x=e[7],x}function u(t){const e=i.c(2),{children:s}=t;let l;return e[0]!==s?(l=c.jsx(E,{children:c.jsx("div",{className:"flex flex-col h-full min-h-0",children:s})}),e[0]=s,e[1]=l):l=e[1],l}function C(t){const e=i.c(10);let s,l,o;e[0]!==t?({children:s,className:l,...o}=t,e[0]=t,e[1]=s,e[2]=l,e[3]=o):(s=e[1],l=e[2],o=e[3]);let n;e[4]!==l?(n=T("app-titlebar wco-drag relative z-10 shrink-0 grid grid-cols-3 items-center pl-1 pr-2 h-12 bg-sidebar",l),e[4]=l,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=c.jsx("div",{className:n,...o,children:s}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function v(t){const e=i.c(2),{children:s}=t;let l;return e[0]!==s?(l=c.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:s}),e[0]=s,e[1]=l):l=e[1],l}function w(t){const e=i.c(2),{children:s}=t;let l;return e[0]!==s?(l=c.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:s}),e[0]=s,e[1]=l):l=e[1],l}function R(){const t=i.c(13),e=j(),l=$().logo??y,o=typeof l=="string"?l:l.light,n=typeof l=="string"?l:l.dark;let r;t[0]!==e?(r=e("agentShellLayout.toolbar.logo"),t[0]=e,t[1]=r):r=t[1];let a;t[2]!==o||t[3]!==r?(a=c.jsx("img",{src:o,alt:r,className:"size-6 object-contain dark:hidden"}),t[2]=o,t[3]=r,t[4]=a):a=t[4];let f;t[5]!==e?(f=e("agentShellLayout.toolbar.logo"),t[5]=e,t[6]=f):f=t[6];let m;t[7]!==n||t[8]!==f?(m=c.jsx("img",{src:n,alt:f,className:"size-6 object-contain hidden dark:block"}),t[7]=n,t[8]=f,t[9]=m):m=t[9];let b;return t[10]!==a||t[11]!==m?(b=c.jsxs("span",{className:"wco-hide flex items-center shrink-0 px-2",children:[a,m]}),t[10]=a,t[11]=m,t[12]=b):b=t[12],b}function k(){const t=i.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(g.Suspense,{fallback:c.jsx("span",{className:"wco-hide shrink-0 size-6 mx-2"}),children:c.jsx(R,{})}),t[0]=e):e=t[0],e}function _(){const t=i.c(12),e=j();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},t[0]=s):s=t[0];const{org:l}=L(s);let o;t[1]!==l?(o={org:l},t[1]=l,t[2]=o):o=t[2];let n;t[3]!==e?(n=e("agentShellLayout.toolbar.backToHome"),t[3]=e,t[4]=n):n=t[4];let r;t[5]!==e?(r=e("agentShellLayout.toolbar.backToHome"),t[5]=e,t[6]=r):r=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(k,{}),t[7]=a):a=t[7];let f;return t[8]!==o||t[9]!==n||t[10]!==r?(f=c.jsx(N,{to:"/$org",params:o,"aria-label":n,title:r,className:"wco-no-drag flex items-center shrink-0 cursor-pointer pl-1",children:a}),t[8]=o,t[9]=n,t[10]=r,t[11]=f):f=t[11],f}function P(){const t=i.c(2),{setCenterEl:e}=h();let s;return t[0]!==e?(s=c.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=s):s=t[1],s}function z(t){const e=i.c(3),{children:s}=t,{centerEl:l}=h();if(!l)return null;let o;return e[0]!==l||e[1]!==s?(o=p.createPortal(s,l),e[0]=l,e[1]=s,e[2]=o):o=e[2],o}function H(t){const e=i.c(5),{className:s}=t,{setTabsEl:l}=h();let o;e[0]!==s?(o=T("shrink-0 flex items-center",s),e[0]=s,e[1]=o):o=e[1];let n;return e[2]!==l||e[3]!==o?(n=c.jsx("div",{ref:l,className:o}),e[2]=l,e[3]=o,e[4]=n):n=e[4],n}function D(t){const e=i.c(3),{children:s}=t,{tabsEl:l}=h();if(!l)return null;let o;return e[0]!==s||e[1]!==l?(o=p.createPortal(s,l),e[0]=s,e[1]=l,e[2]=o):o=e[2],o}function I(t){const e=i.c(5),{className:s}=t,{setTogglesEl:l}=h();let o;e[0]!==s?(o=T("contents",s),e[0]=s,e[1]=o):o=e[1];let n;return e[2]!==l||e[3]!==o?(n=c.jsx("div",{ref:l,className:o}),e[2]=l,e[3]=o,e[4]=n):n=e[4],n}function O(){const t=i.c(2),{setRightEl:e}=h();let s;return t[0]!==e?(s=c.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=s):s=t[1],s}u.Provider=E;u.Header=C;u.LeftColumn=v;u.RightColumn=w;u.Logo=k;u.LogoLink=_;u.CenterSlot=P;u.Center=z;u.TabsSlot=H;u.Tabs=D;u.TogglesSlot=I;u.RightSlot=O;export{u as T};
1
+ import{c as i,r as g,j as c,m as T,b as j,f as L,af as p,L as N,a9 as $,aY as y}from"./index-Dqlz9zwJ.js";const S=g.createContext(null);function h(){const t=g.use(S);if(!t)throw new Error("Toolbar.* must be used inside <Toolbar>");return t}function E(t){const e=i.c(8),{children:s}=t,[l,o]=g.useState(null),[n,r]=g.useState(null),[a,f]=g.useState(null),[m,b]=g.useState(null);let d;e[0]!==a||e[1]!==m||e[2]!==n||e[3]!==l?(d={togglesEl:l,setTogglesEl:o,tabsEl:n,setTabsEl:r,centerEl:a,setCenterEl:f,rightEl:m,setRightEl:b},e[0]=a,e[1]=m,e[2]=n,e[3]=l,e[4]=d):d=e[4];let x;return e[5]!==s||e[6]!==d?(x=c.jsx(S,{value:d,children:s}),e[5]=s,e[6]=d,e[7]=x):x=e[7],x}function u(t){const e=i.c(2),{children:s}=t;let l;return e[0]!==s?(l=c.jsx(E,{children:c.jsx("div",{className:"flex flex-col h-full min-h-0",children:s})}),e[0]=s,e[1]=l):l=e[1],l}function C(t){const e=i.c(10);let s,l,o;e[0]!==t?({children:s,className:l,...o}=t,e[0]=t,e[1]=s,e[2]=l,e[3]=o):(s=e[1],l=e[2],o=e[3]);let n;e[4]!==l?(n=T("app-titlebar wco-drag relative z-10 shrink-0 grid grid-cols-3 items-center pl-1 pr-2 h-12 bg-sidebar",l),e[4]=l,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=c.jsx("div",{className:n,...o,children:s}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function v(t){const e=i.c(2),{children:s}=t;let l;return e[0]!==s?(l=c.jsx("div",{className:"flex items-center gap-0.5 min-w-0 justify-self-start",children:s}),e[0]=s,e[1]=l):l=e[1],l}function w(t){const e=i.c(2),{children:s}=t;let l;return e[0]!==s?(l=c.jsx("div",{className:"flex items-center justify-end gap-0.5 min-w-0 justify-self-end",children:s}),e[0]=s,e[1]=l):l=e[1],l}function R(){const t=i.c(13),e=j(),l=$().logo??y,o=typeof l=="string"?l:l.light,n=typeof l=="string"?l:l.dark;let r;t[0]!==e?(r=e("agentShellLayout.toolbar.logo"),t[0]=e,t[1]=r):r=t[1];let a;t[2]!==o||t[3]!==r?(a=c.jsx("img",{src:o,alt:r,className:"size-6 object-contain dark:hidden"}),t[2]=o,t[3]=r,t[4]=a):a=t[4];let f;t[5]!==e?(f=e("agentShellLayout.toolbar.logo"),t[5]=e,t[6]=f):f=t[6];let m;t[7]!==n||t[8]!==f?(m=c.jsx("img",{src:n,alt:f,className:"size-6 object-contain hidden dark:block"}),t[7]=n,t[8]=f,t[9]=m):m=t[9];let b;return t[10]!==a||t[11]!==m?(b=c.jsxs("span",{className:"wco-hide flex items-center shrink-0 px-2",children:[a,m]}),t[10]=a,t[11]=m,t[12]=b):b=t[12],b}function k(){const t=i.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx(g.Suspense,{fallback:c.jsx("span",{className:"wco-hide shrink-0 size-6 mx-2"}),children:c.jsx(R,{})}),t[0]=e):e=t[0],e}function _(){const t=i.c(12),e=j();let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s={from:"/shell/$org"},t[0]=s):s=t[0];const{org:l}=L(s);let o;t[1]!==l?(o={org:l},t[1]=l,t[2]=o):o=t[2];let n;t[3]!==e?(n=e("agentShellLayout.toolbar.backToHome"),t[3]=e,t[4]=n):n=t[4];let r;t[5]!==e?(r=e("agentShellLayout.toolbar.backToHome"),t[5]=e,t[6]=r):r=t[6];let a;t[7]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(k,{}),t[7]=a):a=t[7];let f;return t[8]!==o||t[9]!==n||t[10]!==r?(f=c.jsx(N,{to:"/$org",params:o,"aria-label":n,title:r,className:"wco-no-drag flex items-center shrink-0 cursor-pointer pl-1",children:a}),t[8]=o,t[9]=n,t[10]=r,t[11]=f):f=t[11],f}function P(){const t=i.c(2),{setCenterEl:e}=h();let s;return t[0]!==e?(s=c.jsx("div",{ref:e,className:"min-w-0 flex items-center justify-center gap-2"}),t[0]=e,t[1]=s):s=t[1],s}function z(t){const e=i.c(3),{children:s}=t,{centerEl:l}=h();if(!l)return null;let o;return e[0]!==l||e[1]!==s?(o=p.createPortal(s,l),e[0]=l,e[1]=s,e[2]=o):o=e[2],o}function H(t){const e=i.c(5),{className:s}=t,{setTabsEl:l}=h();let o;e[0]!==s?(o=T("shrink-0 flex items-center",s),e[0]=s,e[1]=o):o=e[1];let n;return e[2]!==l||e[3]!==o?(n=c.jsx("div",{ref:l,className:o}),e[2]=l,e[3]=o,e[4]=n):n=e[4],n}function D(t){const e=i.c(3),{children:s}=t,{tabsEl:l}=h();if(!l)return null;let o;return e[0]!==s||e[1]!==l?(o=p.createPortal(s,l),e[0]=s,e[1]=l,e[2]=o):o=e[2],o}function I(t){const e=i.c(5),{className:s}=t,{setTogglesEl:l}=h();let o;e[0]!==s?(o=T("contents",s),e[0]=s,e[1]=o):o=e[1];let n;return e[2]!==l||e[3]!==o?(n=c.jsx("div",{ref:l,className:o}),e[2]=l,e[3]=o,e[4]=n):n=e[4],n}function O(){const t=i.c(2),{setRightEl:e}=h();let s;return t[0]!==e?(s=c.jsx("div",{ref:e,className:"flex items-center justify-end gap-0.5 shrink-0"}),t[0]=e,t[1]=s):s=t[1],s}u.Provider=E;u.Header=C;u.LeftColumn=v;u.RightColumn=w;u.Logo=k;u.LogoLink=_;u.CenterSlot=P;u.Center=z;u.TabsSlot=H;u.Tabs=D;u.TogglesSlot=I;u.RightSlot=O;export{u as T};
@@ -1 +1 @@
1
- import{c as d,m as f,j as b}from"./index-V-37Xuf_.js";function x(l){const e=d.c(14);let n,t,s,o,r;e[0]!==l?({active:n,className:t,ref:o,type:r,...s}=l,e[0]=l,e[1]=n,e[2]=t,e[3]=s,e[4]=o,e[5]=r):(n=e[1],t=e[2],s=e[3],o=e[4],r=e[5]);const a=r===void 0?"button":r,u=n?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let i;e[6]!==t||e[7]!==u?(i=f("relative flex size-10 md:size-7 shrink-0 items-center justify-center rounded-md transition-colors","max-md:[&_svg]:size-5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",u,t),e[6]=t,e[7]=u,e[8]=i):i=e[8];let c;return e[9]!==s||e[10]!==o||e[11]!==i||e[12]!==a?(c=b.jsx("button",{ref:o,type:a,className:i,...s}),e[9]=s,e[10]=o,e[11]=i,e[12]=a,e[13]=c):c=e[13],c}export{x as T};
1
+ import{c as d,m as f,j as b}from"./index-Dqlz9zwJ.js";function x(l){const e=d.c(14);let n,t,s,o,r;e[0]!==l?({active:n,className:t,ref:o,type:r,...s}=l,e[0]=l,e[1]=n,e[2]=t,e[3]=s,e[4]=o,e[5]=r):(n=e[1],t=e[2],s=e[3],o=e[4],r=e[5]);const a=r===void 0?"button":r,u=n?"bg-sidebar-accent text-sidebar-foreground":"text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground";let i;e[6]!==t||e[7]!==u?(i=f("relative flex size-10 md:size-7 shrink-0 items-center justify-center rounded-md transition-colors","max-md:[&_svg]:size-5","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",u,t),e[6]=t,e[7]=u,e[8]=i):i=e[8];let c;return e[9]!==s||e[10]!==o||e[11]!==i||e[12]!==a?(c=b.jsx("button",{ref:o,type:a,className:i,...s}),e[9]=s,e[10]=o,e[11]=i,e[12]=a,e[13]=c):c=e[13],c}export{x as T};
@@ -1 +1 @@
1
- import{r as a,j as c,ax as M,aE as Q,aA as J,cO as Z,aB as H,cP as ee,aD as C,bD as $,cQ as te,cR as G,cS as oe,cT as re,az as ne,cU as se,cV as ae,c as j,m as ie}from"./index-V-37Xuf_.js";var le=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ce="VisuallyHidden",V=a.forwardRef((o,e)=>c.jsx(M.span,{...o,ref:e,style:{...le,...o.style}}));V.displayName=ce;var ue=V,[D]=ne("Tooltip",[G]),O=G(),z="TooltipProvider",de=700,A="tooltip.open",[pe,k]=D(z),F=o=>{const{__scopeTooltip:e,delayDuration:t=de,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=a.useRef(!0),d=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const p=i.current;return()=>window.clearTimeout(p)},[]),c.jsx(pe,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};F.displayName=z;var R="Tooltip",[fe,_]=D(R),B=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,i=k(R,o.__scopeTooltip),p=O(e),[u,v]=a.useState(null),x=Q(),f=a.useRef(0),h=l??i.disableHoverableContent,T=d??i.delayDuration,g=a.useRef(!1),[y,m]=J({prop:r,defaultProp:n??!1,onChange:I=>{I?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(I)},caller:R}),w=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,m(!0)},[m]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,m(!1)},[m]),S=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,m(!0),f.current=0},T)},[T,m]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(Z,{...p,children:c.jsx(fe,{scope:e,contentId:x,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?S():E()},[i.isOpenDelayedRef,S,E]),onTriggerLeave:a.useCallback(()=>{h?P():(window.clearTimeout(f.current),f.current=0)},[P,h]),onOpen:E,onClose:P,disableHoverableContent:h,children:t})})};B.displayName=R;var L="TooltipTrigger",U=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(L,t),s=k(L,t),l=O(t),d=a.useRef(null),i=H(e,d,n.onTriggerChange),p=a.useRef(!1),u=a.useRef(!1),v=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(ee,{asChild:!0,...l,children:c.jsx(M.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});U.displayName=L;var N="TooltipPortal",[ve,xe]=D(N,{forceMount:void 0}),Y=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return c.jsx(ve,{scope:e,forceMount:t,children:c.jsx($,{present:t||s.open,children:c.jsx(te,{asChild:!0,container:n,children:r})})})};Y.displayName=N;var b="TooltipContent",q=a.forwardRef((o,e)=>{const t=xe(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return c.jsx($,{present:r||l.open,children:l.disableHoverableContent?c.jsx(W,{side:n,...s,ref:e}):c.jsx(he,{side:n,...s,ref:e})})}),he=a.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=a.useRef(null),s=H(e,n),[l,d]=a.useState(null),{trigger:i,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{d(null),v(!1)},[v]),f=a.useCallback((h,T)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},m=ye(y,g.getBoundingClientRect()),w=Ce(y,m),E=be(T.getBoundingClientRect()),P=Ee([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&u){const h=g=>f(g,u),T=g=>f(g,i);return i.addEventListener("pointerleave",h),u.addEventListener("pointerleave",T),()=>{i.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",T)}}},[i,u,f,x]),a.useEffect(()=>{if(l){const h=T=>{const g=T.target,y={x:T.clientX,y:T.clientY},m=i?.contains(g)||u?.contains(g),w=!we(y,l);m?x():w&&(x(),p())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,u,l,p,x]),c.jsx(W,{...o,ref:s})}),[ge,Te]=D(R,{isInside:!1}),me=se("TooltipContent"),W=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,i=_(b,t),p=O(t),{onClose:u}=i;return a.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,u]),c.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(re,{"data-state":i.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(me,{children:r}),c.jsx(ge,{scope:t,isInside:!0,children:c.jsx(ue,{id:i.contentId,role:"tooltip",children:n||r})})]})})});q.displayName=b;var X="TooltipArrow",K=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=O(t);return Te(X,t).isInside?null:c.jsx(ae,{...n,...r,ref:e})});K.displayName=X;function ye(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ce(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function be(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function we(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],i=e[l],p=d.x,u=d.y,v=i.x,x=i.y;u>r!=x>r&&t<(v-p)*(r-u)/(x-u)+p&&(n=!n)}return n}function Ee(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),Pe(e)}function Pe(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Re=F,_e=B,je=U,De=Y,Oe=q,Ae=K;function Le(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(Re,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Ne(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Le,{children:c.jsx(_e,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Se(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(je,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Ie(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==r?(d=ie("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(Ae,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==d?(p=c.jsx(De,{children:c.jsxs(Oe,{"data-slot":"tooltip-content",sideOffset:l,className:d,...n,children:[t,i]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=d,e[12]=p):p=e[12],p}export{Se as T,le as V,Ie as a,Le as b,Ne as c};
1
+ import{r as a,j as c,ax as M,aE as Q,aA as J,cO as Z,aB as H,cP as ee,aD as C,bD as $,cQ as te,cR as G,cS as oe,cT as re,az as ne,cU as se,cV as ae,c as j,m as ie}from"./index-Dqlz9zwJ.js";var le=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),ce="VisuallyHidden",V=a.forwardRef((o,e)=>c.jsx(M.span,{...o,ref:e,style:{...le,...o.style}}));V.displayName=ce;var ue=V,[D]=ne("Tooltip",[G]),O=G(),z="TooltipProvider",de=700,A="tooltip.open",[pe,k]=D(z),F=o=>{const{__scopeTooltip:e,delayDuration:t=de,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=a.useRef(!0),d=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const p=i.current;return()=>window.clearTimeout(p)},[]),c.jsx(pe,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(p=>{d.current=p},[]),disableHoverableContent:n,children:s})};F.displayName=z;var R="Tooltip",[fe,_]=D(R),B=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=o,i=k(R,o.__scopeTooltip),p=O(e),[u,v]=a.useState(null),x=Q(),f=a.useRef(0),h=l??i.disableHoverableContent,T=d??i.delayDuration,g=a.useRef(!1),[y,m]=J({prop:r,defaultProp:n??!1,onChange:I=>{I?(i.onOpen(),document.dispatchEvent(new CustomEvent(A))):i.onClose(),s?.(I)},caller:R}),w=a.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),E=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,m(!0)},[m]),P=a.useCallback(()=>{window.clearTimeout(f.current),f.current=0,m(!1)},[m]),S=a.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,m(!0),f.current=0},T)},[T,m]);return a.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),c.jsx(Z,{...p,children:c.jsx(fe,{scope:e,contentId:x,open:y,stateAttribute:w,trigger:u,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?S():E()},[i.isOpenDelayedRef,S,E]),onTriggerLeave:a.useCallback(()=>{h?P():(window.clearTimeout(f.current),f.current=0)},[P,h]),onOpen:E,onClose:P,disableHoverableContent:h,children:t})})};B.displayName=R;var L="TooltipTrigger",U=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(L,t),s=k(L,t),l=O(t),d=a.useRef(null),i=H(e,d,n.onTriggerChange),p=a.useRef(!1),u=a.useRef(!1),v=a.useCallback(()=>p.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),c.jsx(ee,{asChild:!0,...l,children:c.jsx(M.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),u.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),u.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),p.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{p.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});U.displayName=L;var N="TooltipPortal",[ve,xe]=D(N,{forceMount:void 0}),Y=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(N,e);return c.jsx(ve,{scope:e,forceMount:t,children:c.jsx($,{present:t||s.open,children:c.jsx(te,{asChild:!0,container:n,children:r})})})};Y.displayName=N;var b="TooltipContent",q=a.forwardRef((o,e)=>{const t=xe(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return c.jsx($,{present:r||l.open,children:l.disableHoverableContent?c.jsx(W,{side:n,...s,ref:e}):c.jsx(he,{side:n,...s,ref:e})})}),he=a.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=a.useRef(null),s=H(e,n),[l,d]=a.useState(null),{trigger:i,onClose:p}=t,u=n.current,{onPointerInTransitChange:v}=r,x=a.useCallback(()=>{d(null),v(!1)},[v]),f=a.useCallback((h,T)=>{const g=h.currentTarget,y={x:h.clientX,y:h.clientY},m=ye(y,g.getBoundingClientRect()),w=Ce(y,m),E=be(T.getBoundingClientRect()),P=Ee([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>x(),[x]),a.useEffect(()=>{if(i&&u){const h=g=>f(g,u),T=g=>f(g,i);return i.addEventListener("pointerleave",h),u.addEventListener("pointerleave",T),()=>{i.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",T)}}},[i,u,f,x]),a.useEffect(()=>{if(l){const h=T=>{const g=T.target,y={x:T.clientX,y:T.clientY},m=i?.contains(g)||u?.contains(g),w=!we(y,l);m?x():w&&(x(),p())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[i,u,l,p,x]),c.jsx(W,{...o,ref:s})}),[ge,Te]=D(R,{isInside:!1}),me=se("TooltipContent"),W=a.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=o,i=_(b,t),p=O(t),{onClose:u}=i;return a.useEffect(()=>(document.addEventListener(A,u),()=>document.removeEventListener(A,u)),[u]),a.useEffect(()=>{if(i.trigger){const v=x=>{x.target?.contains(i.trigger)&&u()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,u]),c.jsx(oe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:u,children:c.jsxs(re,{"data-state":i.stateAttribute,...p,...d,ref:e,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(me,{children:r}),c.jsx(ge,{scope:t,isInside:!0,children:c.jsx(ue,{id:i.contentId,role:"tooltip",children:n||r})})]})})});q.displayName=b;var X="TooltipArrow",K=a.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=O(t);return Te(X,t).isInside?null:c.jsx(ae,{...n,...r,ref:e})});K.displayName=X;function ye(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ce(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function be(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function we(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const d=e[s],i=e[l],p=d.x,u=d.y,v=i.x,x=i.y;u>r!=x>r&&t<(v-p)*(r-u)/(x-u)+p&&(n=!n)}return n}function Ee(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),Pe(e)}function Pe(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var Re=F,_e=B,je=U,De=Y,Oe=q,Ae=K;function Le(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=c.jsx(Re,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Ne(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(Le,{children:c.jsx(_e,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Se(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=c.jsx(je,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function Ie(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let d;e[5]!==r?(d=ie("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=d):d=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(Ae,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=i):i=e[7];let p;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==d?(p=c.jsx(De,{children:c.jsxs(Oe,{"data-slot":"tooltip-content",sideOffset:l,className:d,...n,children:[t,i]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=d,e[12]=p):p=e[12],p}export{Se as T,le as V,Ie as a,Le as b,Ne as c};
@@ -1 +1 @@
1
- import{c as d,F as f,x as P,K as m,n as K}from"./index-V-37Xuf_.js";import{u as S,c as T}from"./studio-tools-ACBDJhU7.js";function g(s,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await T(s,"AI_PROVIDER_KEY_LIST",{})}}function R(){const s=d.c(7),{org:e}=f(),o=S();let i;s[0]!==e.id?(i=m.aiProviders(e.id),s[0]=e.id,s[1]=i):i=s[1];let t;s[2]!==o?(t=async()=>await o.call("AI_PROVIDERS_LIST",{}),s[2]=o,s[3]=t):t=s[3];let l;s[4]!==i||s[5]!==t?(l={queryKey:i,staleTime:1/0,queryFn:t},s[4]=i,s[5]=t,s[6]=l):l=s[6];const{data:n}=P(l);return n}function p(){const s=d.c(5),{org:e}=f();let o;s[0]!==e.id||s[1]!==e.slug?(o=g(e.slug,e.id),s[0]=e.id,s[1]=e.slug,s[2]=o):o=s[2];const{data:i}=P(o);let t;return s[3]!==i?.keys?(t=i?.keys??[],s[3]=i?.keys,s[4]=t):t=s[4],t}function q(s){const e=d.c(15),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s??""),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];const l=!!s;let n;e[3]!==s||e[4]!==i?(n=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s??""}),e[3]=s,e[4]=i,e[5]=n):n=e[5];let r;e[6]!==t||e[7]!==l||e[8]!==n?(r={queryKey:t,enabled:l,staleTime:6e4,queryFn:n},e[6]=t,e[7]=l,e[8]=n,e[9]=r):r=e[9];const{data:a,isLoading:_}=K(r);let u;e[10]!==a?.models?(u=a?.models??[],e[10]=a?.models,e[11]=u):u=e[11];const y=!!s&&_;let c;return e[12]!==u||e[13]!==y?(c={models:u,isLoading:y},e[12]=u,e[13]=y,e[14]=c):c=e[14],c}function A(s){const e=d.c(11),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];let l;e[3]!==s||e[4]!==i?(l=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let n;e[6]!==t||e[7]!==l?(n={queryKey:t,staleTime:6e4,queryFn:l},e[6]=t,e[7]=l,e[8]=n):n=e[8];const{data:r}=P(n);let a;return e[9]!==r?.models?(a=r?.models??[],e[9]=r?.models,e[10]=a):a=e[10],a}export{q as a,R as b,A as c,p as u};
1
+ import{c as d,F as f,x as P,K as m,n as K}from"./index-Dqlz9zwJ.js";import{u as S,c as T}from"./studio-tools-DTZoa0OH.js";function g(s,e){return{queryKey:m.aiProviderKeys(e),staleTime:6e4,queryFn:async()=>await T(s,"AI_PROVIDER_KEY_LIST",{})}}function R(){const s=d.c(7),{org:e}=f(),o=S();let i;s[0]!==e.id?(i=m.aiProviders(e.id),s[0]=e.id,s[1]=i):i=s[1];let t;s[2]!==o?(t=async()=>await o.call("AI_PROVIDERS_LIST",{}),s[2]=o,s[3]=t):t=s[3];let l;s[4]!==i||s[5]!==t?(l={queryKey:i,staleTime:1/0,queryFn:t},s[4]=i,s[5]=t,s[6]=l):l=s[6];const{data:n}=P(l);return n}function p(){const s=d.c(5),{org:e}=f();let o;s[0]!==e.id||s[1]!==e.slug?(o=g(e.slug,e.id),s[0]=e.id,s[1]=e.slug,s[2]=o):o=s[2];const{data:i}=P(o);let t;return s[3]!==i?.keys?(t=i?.keys??[],s[3]=i?.keys,s[4]=t):t=s[4],t}function q(s){const e=d.c(15),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s??""),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];const l=!!s;let n;e[3]!==s||e[4]!==i?(n=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s??""}),e[3]=s,e[4]=i,e[5]=n):n=e[5];let r;e[6]!==t||e[7]!==l||e[8]!==n?(r={queryKey:t,enabled:l,staleTime:6e4,queryFn:n},e[6]=t,e[7]=l,e[8]=n,e[9]=r):r=e[9];const{data:a,isLoading:_}=K(r);let u;e[10]!==a?.models?(u=a?.models??[],e[10]=a?.models,e[11]=u):u=e[11];const y=!!s&&_;let c;return e[12]!==u||e[13]!==y?(c={models:u,isLoading:y},e[12]=u,e[13]=y,e[14]=c):c=e[14],c}function A(s){const e=d.c(11),{org:o}=f(),i=S();let t;e[0]!==s||e[1]!==o.id?(t=m.aiProviderModels(o.id,s),e[0]=s,e[1]=o.id,e[2]=t):t=e[2];let l;e[3]!==s||e[4]!==i?(l=async()=>await i.call("AI_PROVIDERS_LIST_MODELS",{keyId:s}),e[3]=s,e[4]=i,e[5]=l):l=e[5];let n;e[6]!==t||e[7]!==l?(n={queryKey:t,staleTime:6e4,queryFn:l},e[6]=t,e[7]=l,e[8]=n):n=e[8];const{data:r}=P(n);let a;return e[9]!==r?.models?(a=r?.models??[],e[9]=r?.models,e[10]=a):a=e[10],a}export{q as a,R as b,A as c,p as u};
@@ -1 +1 @@
1
- import{c,F as d,o as p,e as w,K as g,n as I}from"./index-V-37Xuf_.js";import{S as m,u as f}from"./use-mcp-client-RZHGKzHm.js";function K(){return(typeof window>"u"?"":window.location.hostname||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"studio"}function C(e){return`${typeof window>"u"?"http://localhost:3000":window.location.origin}/api/${e}/mcp/self`}function h(e,t){return`claude mcp add --transport http --scope user ${K()} ${C(e)} --header "Authorization: Bearer ${t}"`}function y(e,t){if(e?.isError)throw new Error(e.content?.[0]?.text??t);if(!e.structuredContent)throw new Error(t);return e.structuredContent}function S(){const e=c.c(10),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const r=f(s);let o;e[3]!==t.id?(o=g.apiKeysList(t.id),e[3]=t.id,e[4]=o):o=e[4];let n;e[5]!==r?(n=async()=>{const l=await r.callTool({name:"API_KEY_LIST",arguments:{}});return y(l,"Failed to list API keys").items},e[5]=r,e[6]=n):n=e[6];let i;return e[7]!==o||e[8]!==n?(i={queryKey:o,queryFn:n,staleTime:3e4},e[7]=o,e[8]=n,e[9]=i):i=e[9],I(i)}function L(){const e=c.c(11),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const r=f(s),o=p();let n;e[3]!==r?(n=async a=>{const u=await r.callTool({name:"API_KEY_CREATE",arguments:{name:a.name,permissions:a.permissions??{"*":["*"]}}});return y(u,"Failed to create API key")},e[3]=r,e[4]=n):n=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==n||e[9]!==i?(l={mutationFn:n,onSuccess:i},e[8]=n,e[9]=i,e[10]=l):l=e[10],w(l)}function P(){const e=c.c(11),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const r=f(s),o=p();let n;e[3]!==r?(n=async a=>{const u=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:a}});return y(u,"Failed to delete API key")},e[3]=r,e[4]=n):n=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==n||e[9]!==i?(l={mutationFn:n,onSuccess:i},e[8]=n,e[9]=i,e[10]=l):l=e[10],w(l)}export{K as a,S as b,h as c,P as d,C as m,L as u};
1
+ import{c,F as d,o as p,e as w,K as g,n as I}from"./index-Dqlz9zwJ.js";import{S as m,u as f}from"./use-mcp-client-W9jPPMhB.js";function K(){return(typeof window>"u"?"":window.location.hostname||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"studio"}function C(e){return`${typeof window>"u"?"http://localhost:3000":window.location.origin}/api/${e}/mcp/self`}function h(e,t){return`claude mcp add --transport http --scope user ${K()} ${C(e)} --header "Authorization: Bearer ${t}"`}function y(e,t){if(e?.isError)throw new Error(e.content?.[0]?.text??t);if(!e.structuredContent)throw new Error(t);return e.structuredContent}function S(){const e=c.c(10),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const r=f(s);let o;e[3]!==t.id?(o=g.apiKeysList(t.id),e[3]=t.id,e[4]=o):o=e[4];let n;e[5]!==r?(n=async()=>{const l=await r.callTool({name:"API_KEY_LIST",arguments:{}});return y(l,"Failed to list API keys").items},e[5]=r,e[6]=n):n=e[6];let i;return e[7]!==o||e[8]!==n?(i={queryKey:o,queryFn:n,staleTime:3e4},e[7]=o,e[8]=n,e[9]=i):i=e[9],I(i)}function L(){const e=c.c(11),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const r=f(s),o=p();let n;e[3]!==r?(n=async a=>{const u=await r.callTool({name:"API_KEY_CREATE",arguments:{name:a.name,permissions:a.permissions??{"*":["*"]}}});return y(u,"Failed to create API key")},e[3]=r,e[4]=n):n=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==n||e[9]!==i?(l={mutationFn:n,onSuccess:i},e[8]=n,e[9]=i,e[10]=l):l=e[10],w(l)}function P(){const e=c.c(11),{org:t}=d();let s;e[0]!==t.id||e[1]!==t.slug?(s={connectionId:m,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=s):s=e[2];const r=f(s),o=p();let n;e[3]!==r?(n=async a=>{const u=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:a}});return y(u,"Failed to delete API key")},e[3]=r,e[4]=n):n=e[4];let i;e[5]!==t.id||e[6]!==o?(i=()=>{o.invalidateQueries({queryKey:g.apiKeysList(t.id)})},e[5]=t.id,e[6]=o,e[7]=i):i=e[7];let l;return e[8]!==n||e[9]!==i?(l={mutationFn:n,onSuccess:i},e[8]=n,e[9]=i,e[10]=l):l=e[10],w(l)}export{K as a,S as b,h as c,P as d,C as m,L as u};
@@ -1 +1 @@
1
- import{c as U,F as q,K as T,n as I,o as x,e as y,t as m}from"./index-V-37Xuf_.js";import{S as z,u as J}from"./use-mcp-client-RZHGKzHm.js";import{u as Q}from"./studio-tools-ACBDJhU7.js";function V(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=U.c(12),{org:s}=q(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],I(r)}function it(t){const e=U.c(9),{org:s}=q(),l=Q();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],I(n)}function ot(t){const e=U.c(10),{org:s}=q(),l=Q();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],I(o)}function at(t,e){const s=U.c(12),{org:l}=q(),a=Q();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],I(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=U.c(64),{org:e}=q(),s=Q(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let A;t[13]!==s?(A=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=A):A=t[14];let p;t[15]!==i||t[16]!==o?(p=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=p):p=t[17];let G;t[18]!==A||t[19]!==p?(G={mutationFn:A,onSuccess:p,onError:W},t[18]=A,t[19]=p,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==D||t[57]!==k||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==j?(M={create:D,update:j,remove:k,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=D,t[57]=k,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=j,t[63]=M):M=t[63],M}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
1
+ import{c as U,F as q,K as T,n as I,o as x,e as y,t as m}from"./index-Dqlz9zwJ.js";import{S as z,u as J}from"./use-mcp-client-W9jPPMhB.js";import{u as Q}from"./studio-tools-DTZoa0OH.js";function V(t){if(t.paramsSchema&&typeof t.paramsSchema=="object")return t;const e={};if(Array.isArray(t.params))for(const s of t.params)e[s.name]={type:s.type,description:s.description,enum:s.enum};else t.params&&typeof t.params=="object"&&Object.assign(e,t.params);return{type:t.type,description:t.description,paramsSchema:e}}function st(t){const e=U.c(12),{org:s}=q(),l=t??z;let a;e[0]!==s.id||e[1]!==s.slug||e[2]!==l?(a={connectionId:l,orgId:s.id,orgSlug:s.slug},e[0]=s.id,e[1]=s.slug,e[2]=l,e[3]=a):a=e[3];const i=J(a);let n;e[4]!==t?(n=T.toolCall(t??"","TRIGGER_LIST",""),e[4]=t,e[5]=n):n=e[5];let o;e[6]!==i?(o=async()=>{const d=await i.callTool({name:"TRIGGER_LIST",arguments:{}});return(d.structuredContent??d).triggers.map(V)},e[6]=i,e[7]=o):o=e[7];const c=!!t;let r;return e[8]!==n||e[9]!==o||e[10]!==c?(r={queryKey:n,queryFn:o,enabled:c,staleTime:3e4},e[8]=n,e[9]=o,e[10]=c,e[11]=r):r=e[11],I(r)}function it(t){const e=U.c(9),{org:s}=q(),l=Q();let a;e[0]!==s.id||e[1]!==t?(a=T.automations(s.id,t),e[0]=s.id,e[1]=t,e[2]=a):a=e[2];let i;e[3]!==l||e[4]!==t?(i=async()=>(await l.call("AUTOMATION_LIST",t!=null?{virtual_mcp_id:t}:{})).automations,e[3]=l,e[4]=t,e[5]=i):i=e[5];let n;return e[6]!==a||e[7]!==i?(n={queryKey:a,queryFn:i,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n):n=e[8],I(n)}function ot(t){const e=U.c(10),{org:s}=q(),l=Q();let a;e[0]!==t||e[1]!==s.id?(a=T.automation(s.id,t),e[0]=t,e[1]=s.id,e[2]=a):a=e[2];let i;e[3]!==t||e[4]!==l?(i=async()=>(await l.call("AUTOMATION_GET",{id:t})).automation,e[3]=t,e[4]=l,e[5]=i):i=e[5];const n=!!t;let o;return e[6]!==a||e[7]!==i||e[8]!==n?(o={queryKey:a,queryFn:i,enabled:n,staleTime:1e4},e[6]=a,e[7]=i,e[8]=n,e[9]=o):o=e[9],I(o)}function at(t,e){const s=U.c(12),{org:l}=q(),a=Q();let i;s[0]!==t||s[1]!==l.id||s[2]!==e?(i=T.automationRunStats(l.id,t,JSON.stringify(e??{})),s[0]=t,s[1]=l.id,s[2]=e,s[3]=i):i=s[3];let n;s[4]!==t||s[5]!==e||s[6]!==a?(n=async()=>await a.call("AUTOMATION_RUN_STATS",{automation_id:t,...e?.startDate?{startDate:e.startDate}:{},...e?.endDate?{endDate:e.endDate}:{}}),s[4]=t,s[5]=e,s[6]=a,s[7]=n):n=s[7];const o=!!t;let c;return s[8]!==i||s[9]!==n||s[10]!==o?(c={queryKey:i,queryFn:n,enabled:o,staleTime:3e4},s[8]=i,s[9]=n,s[10]=o,s[11]=c):c=s[11],I(c)}function nt(t){return{name:"New Automation",messages:[],models:{tier:"smart"},temperature:.5,active:!0,virtual_mcp_id:t}}function lt(){const t=U.c(64),{org:e}=q(),s=Q(),l=x();let a;t[0]!==e||t[1]!==l?(a=()=>l.invalidateQueries({queryKey:T.automationsAll(e.id)}),t[0]=e,t[1]=l,t[2]=a):a=t[2];const i=a;let n;t[3]!==e||t[4]!==l?(n=u=>l.invalidateQueries({queryKey:T.automation(e.id,u)}),t[3]=e,t[4]=l,t[5]=n):n=t[5];const o=n;let c;t[6]!==s?(c=async u=>await s.call("AUTOMATION_CREATE",u),t[6]=s,t[7]=c):c=t[7];let r;t[8]!==i?(r=()=>{i(),m.success("Automation created successfully")},t[8]=i,t[9]=r):r=t[9];let d;t[10]!==c||t[11]!==r?(d={mutationFn:c,onSuccess:r,onError:X},t[10]=c,t[11]=r,t[12]=d):d=t[12];const D=y(d);let A;t[13]!==s?(A=async u=>await s.call("AUTOMATION_UPDATE",u),t[13]=s,t[14]=A):A=t[14];let p;t[15]!==i||t[16]!==o?(p=(u,f)=>{i(),typeof f.id=="string"&&o(f.id),m.success("Automation updated successfully")},t[15]=i,t[16]=o,t[17]=p):p=t[17];let G;t[18]!==A||t[19]!==p?(G={mutationFn:A,onSuccess:p,onError:W},t[18]=A,t[19]=p,t[20]=G):G=t[20];const j=y(G);let g;t[21]!==s?(g=async u=>await s.call("AUTOMATION_DELETE",{id:u}),t[21]=s,t[22]=g):g=t[22];let _;t[23]!==i||t[24]!==e||t[25]!==l?(_=(u,f)=>{l.removeQueries({queryKey:T.automation(e.id,f)}),i(),m.success("Automation deleted successfully")},t[23]=i,t[24]=e,t[25]=l,t[26]=_):_=t[26];let $;t[27]!==g||t[28]!==_?($={mutationFn:g,onSuccess:_,onError:H},t[27]=g,t[28]=_,t[29]=$):$=t[29];const k=y($);let S;t[30]!==s?(S=async u=>await s.call("AUTOMATION_TRIGGER_ADD",u),t[30]=s,t[31]=S):S=t[31];let E;t[32]!==i||t[33]!==o?(E=u=>{i(),o(u.automation_id)},t[32]=i,t[33]=o,t[34]=E):E=t[34];let K;t[35]!==S||t[36]!==E?(K={mutationFn:S,onSuccess:E},t[35]=S,t[36]=E,t[37]=K):K=t[37];const P=y(K);let O;t[38]!==s?(O=async u=>await s.call("AUTOMATION_TRIGGER_ROTATE_TOKEN",{trigger_id:u.trigger_id}),t[38]=s,t[39]=O):O=t[39];let R;t[40]!==i||t[41]!==o?(R=(u,f)=>{i(),o(f.automation_id)},t[40]=i,t[41]=o,t[42]=R):R=t[42];let C;t[43]!==O||t[44]!==R?(C={mutationFn:O,onSuccess:R},t[43]=O,t[44]=R,t[45]=C):C=t[45];const h=y(C);let F;t[46]!==s?(F=async u=>await s.call("AUTOMATION_TRIGGER_REMOVE",{trigger_id:u.trigger_id}),t[46]=s,t[47]=F):F=t[47];let N;t[48]!==i||t[49]!==o?(N=(u,f)=>{i(),o(f.automation_id)},t[48]=i,t[49]=o,t[50]=N):N=t[50];let b;t[51]!==F||t[52]!==N?(b={mutationFn:F,onSuccess:N},t[51]=F,t[52]=N,t[53]=b):b=t[53];const v=y(b);let L;t[54]!==s?(L={mutationFn:async u=>await s.call("AUTOMATION_RUN",{id:u}),onSuccess:B,onError:Y},t[54]=s,t[55]=L):L=t[55];const w=y(L);let M;return t[56]!==D||t[57]!==k||t[58]!==w||t[59]!==P||t[60]!==v||t[61]!==h||t[62]!==j?(M={create:D,update:j,remove:k,triggerAdd:P,triggerRemove:v,triggerRotateToken:h,run:w},t[56]=D,t[57]=k,t[58]=w,t[59]=P,t[60]=v,t[61]=h,t[62]=j,t[63]=M):M=t[63],M}function Y(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to run automation: ${e}`)}function B(t){t.skipped?m.info(`Automation skipped: ${t.skipped}`):t.error?m.error(`Automation failed: ${t.error}`):m.success("Automation triggered")}function H(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to delete automation: ${e}`)}function W(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to update automation: ${e}`)}function X(t){const e=t instanceof Error?t.message:String(t);m.error(`Failed to create automation: ${e}`)}export{st as a,ot as b,it as c,nt as d,at as e,lt as u};
@@ -1 +1 @@
1
- import{c as T,r as o}from"./index-V-37Xuf_.js";const y=700;function x(r,l,_){const e=T.c(7),f=y,[a,m]=o.useState(r),[i,S]=o.useState(r),[A,d]=o.useState(!1),t=o.useRef(null);r!==i&&(S(r),A||m(r));let s;e[0]!==f||e[1]!==l?(s=u=>{m(u),d(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,d(!1),l(u)},f)},e[0]=f,e[1]=l,e[2]=s):s=e[2];const p=s;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=u=>{m(u),t.current&&clearTimeout(t.current),t.current=null,d(!1)},e[3]=c):c=e[3];const E=c;let n;return e[4]!==a||e[5]!==p?(n=[a,p,E],e[4]=a,e[5]=p,e[6]=n):n=e[6],n}export{x as u};
1
+ import{c as T,r as o}from"./index-Dqlz9zwJ.js";const y=700;function x(r,l,_){const e=T.c(7),f=y,[a,m]=o.useState(r),[i,S]=o.useState(r),[A,d]=o.useState(!1),t=o.useRef(null);r!==i&&(S(r),A||m(r));let s;e[0]!==f||e[1]!==l?(s=u=>{m(u),d(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,d(!1),l(u)},f)},e[0]=f,e[1]=l,e[2]=s):s=e[2];const p=s;let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=u=>{m(u),t.current&&clearTimeout(t.current),t.current=null,d(!1)},e[3]=c):c=e[3];const E=c;let n;return e[4]!==a||e[5]!==p?(n=[a,p,E],e[4]=a,e[5]=p,e[6]=n):n=e[6],n}export{x as u};
@@ -1 +1 @@
1
- import{c as u,F as m,n as g,K as p}from"./index-V-37Xuf_.js";const b=new Set(["owner","admin"]);function d(){const e=u.c(11),{org:r,locator:c}=m();let o;e[0]!==c?(o=p.myCapabilities(c),e[0]=c,e[1]=o):o=e[1];let a;e[2]!==r?(a=async()=>{const f=await fetch(`/api/auth/custom/my-capabilities/${encodeURIComponent(r.slug)}`,{credentials:"include"});if(!f.ok)throw new Error(`my-capabilities request failed: ${f.status}`);return await f.json()},e[2]=r,e[3]=a):a=e[3];let i;e[4]!==o||e[5]!==a?(i={queryKey:o,queryFn:a,staleTime:3e4,retry:2},e[4]=o,e[5]=a,e[6]=i):i=e[6];const{data:s,isLoading:l,isError:n}=g(i);let t;return e[7]!==s||e[8]!==n||e[9]!==l?(t={data:s,loading:l,error:n},e[7]=s,e[8]=n,e[9]=l,e[10]=t):t=e[10],t}function _(e){const r=u.c(8),{data:c,loading:o,error:a}=d();if(o){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!0,error:!1,reason:"loading"},r[0]=t):t=r[0],t}if(a){let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!0,reason:"error"},r[1]=t):t=r[1],t}const i=c?.role??null;if(!i){let t;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!1,reason:"denied"},r[2]=t):t=r[2],t}if(i==="owner"){let t;return r[3]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"owner"},r[3]=t):t=r[3],t}if(i==="admin"){let t;return r[4]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"admin"},r[4]=t):t=r[4],t}const s=c?.capabilities?.[e]===!0,l=s?"role":"denied";let n;return r[5]!==s||r[6]!==l?(n={granted:s,loading:!1,error:!1,reason:l},r[5]=s,r[6]=l,r[7]=n):n=r[7],n}function S(){const e=u.c(10),{data:r,loading:c,error:o}=d(),a=r?.role??void 0;let i;e[0]!==a?(i=a?b.has(a):!1,e[0]=a,e[1]=i):i=e[1];const s=i;let l;e[2]!==r?.capabilities?(l=r?.capabilities??{},e[2]=r?.capabilities,e[3]=l):l=e[3];const n=l;let t;return e[4]!==o||e[5]!==s||e[6]!==c||e[7]!==a||e[8]!==n?(t={capabilities:n,loading:c,error:o,isPrivileged:s,roleSlug:a},e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=n,e[9]=t):t=e[9],t}export{S as a,_ as u};
1
+ import{c as u,F as m,n as g,K as p}from"./index-Dqlz9zwJ.js";const b=new Set(["owner","admin"]);function d(){const e=u.c(11),{org:r,locator:c}=m();let o;e[0]!==c?(o=p.myCapabilities(c),e[0]=c,e[1]=o):o=e[1];let a;e[2]!==r?(a=async()=>{const f=await fetch(`/api/auth/custom/my-capabilities/${encodeURIComponent(r.slug)}`,{credentials:"include"});if(!f.ok)throw new Error(`my-capabilities request failed: ${f.status}`);return await f.json()},e[2]=r,e[3]=a):a=e[3];let i;e[4]!==o||e[5]!==a?(i={queryKey:o,queryFn:a,staleTime:3e4,retry:2},e[4]=o,e[5]=a,e[6]=i):i=e[6];const{data:s,isLoading:l,isError:n}=g(i);let t;return e[7]!==s||e[8]!==n||e[9]!==l?(t={data:s,loading:l,error:n},e[7]=s,e[8]=n,e[9]=l,e[10]=t):t=e[10],t}function _(e){const r=u.c(8),{data:c,loading:o,error:a}=d();if(o){let t;return r[0]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!0,error:!1,reason:"loading"},r[0]=t):t=r[0],t}if(a){let t;return r[1]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!0,reason:"error"},r[1]=t):t=r[1],t}const i=c?.role??null;if(!i){let t;return r[2]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!1,loading:!1,error:!1,reason:"denied"},r[2]=t):t=r[2],t}if(i==="owner"){let t;return r[3]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"owner"},r[3]=t):t=r[3],t}if(i==="admin"){let t;return r[4]===Symbol.for("react.memo_cache_sentinel")?(t={granted:!0,loading:!1,error:!1,reason:"admin"},r[4]=t):t=r[4],t}const s=c?.capabilities?.[e]===!0,l=s?"role":"denied";let n;return r[5]!==s||r[6]!==l?(n={granted:s,loading:!1,error:!1,reason:l},r[5]=s,r[6]=l,r[7]=n):n=r[7],n}function S(){const e=u.c(10),{data:r,loading:c,error:o}=d(),a=r?.role??void 0;let i;e[0]!==a?(i=a?b.has(a):!1,e[0]=a,e[1]=i):i=e[1];const s=i;let l;e[2]!==r?.capabilities?(l=r?.capabilities??{},e[2]=r?.capabilities,e[3]=l):l=e[3];const n=l;let t;return e[4]!==o||e[5]!==s||e[6]!==c||e[7]!==a||e[8]!==n?(t={capabilities:n,loading:c,error:o,isPrivileged:s,roleSlug:a},e[4]=o,e[5]=s,e[6]=c,e[7]=a,e[8]=n,e[9]=t):t=e[9],t}export{S as a,_ as u};
@@ -1 +1 @@
1
- import{i as a}from"./AlertCircle-NpBTsyur.js";import{i as c}from"./CheckCircle-BNOoSOay.js";import{i as u}from"./DotsVertical-CaxtIyQ7.js";import{aL as m}from"./agent-icon-wSfqa-He.js";import{k as b,c as d,r as f}from"./index-V-37Xuf_.js";import{i as p}from"./XCircle-k_KiCLEF.js";const g={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:a,iconClassName:"text-warning",labelColor:"text-warning"},failed:{label:"Failed",verb:"Something went wrong",icon:p,iconClassName:"text-destructive",labelColor:"text-destructive"},expired:{label:"Timed out",verb:"Stopped responding",icon:m,iconClassName:"text-warning",labelColor:"text-warning"},in_progress:{label:"Running",verb:"Agent is working",icon:b,iconClassName:"text-primary",labelColor:"text-primary"},completed:{label:"Done",verb:"Completed",icon:c,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},v={label:"Unknown",verb:"Unknown status",icon:u,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function y(r){return g[r??"completed"]??v}const i=new Map;function s(r){let t=i.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},i.set(r,t)),t}function x(r,t){const e=s(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const o of e.subscribers)o()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function T(r){const t=d.c(3),e=r===void 0?6e4:r;let o,n;return t[0]!==e?(o=l=>x(e,l),n=()=>s(e).tick,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),f.useSyncExternalStore(o,n,C)}function C(){return 0}export{g as S,y as g,T as u};
1
+ import{i as a}from"./AlertCircle-D-kVAi-Y.js";import{i as c}from"./CheckCircle-CzMlZY1r.js";import{i as u}from"./DotsVertical-CJlRJVmq.js";import{aL as m}from"./agent-icon-D3vHoY7x.js";import{k as b,c as d,r as f}from"./index-Dqlz9zwJ.js";import{i as p}from"./XCircle-DUZC4nO5.js";const g={requires_action:{label:"Needs review",verb:"Waiting for your review",icon:a,iconClassName:"text-warning",labelColor:"text-warning"},failed:{label:"Failed",verb:"Something went wrong",icon:p,iconClassName:"text-destructive",labelColor:"text-destructive"},expired:{label:"Timed out",verb:"Stopped responding",icon:m,iconClassName:"text-warning",labelColor:"text-warning"},in_progress:{label:"Running",verb:"Agent is working",icon:b,iconClassName:"text-primary",labelColor:"text-primary"},completed:{label:"Done",verb:"Completed",icon:c,iconClassName:"text-muted-foreground/50",labelColor:"text-muted-foreground"}},v={label:"Unknown",verb:"Unknown status",icon:u,iconClassName:"text-muted-foreground",labelColor:"text-muted-foreground"};function y(r){return g[r??"completed"]??v}const i=new Map;function s(r){let t=i.get(r);return t||(t={tick:0,subscribers:new Set,intervalId:null},i.set(r,t)),t}function x(r,t){const e=s(r);return e.subscribers.add(t),e.intervalId===null&&(e.intervalId=setInterval(()=>{e.tick+=1;for(const o of e.subscribers)o()},r)),()=>{e.subscribers.delete(t),e.subscribers.size===0&&e.intervalId!==null&&(clearInterval(e.intervalId),e.intervalId=null)}}function T(r){const t=d.c(3),e=r===void 0?6e4:r;let o,n;return t[0]!==e?(o=l=>x(e,l),n=()=>s(e).tick,t[0]=e,t[1]=o,t[2]=n):(o=t[1],n=t[2]),f.useSyncExternalStore(o,n,C)}function C(){return 0}export{g as S,y as g,T as u};
@@ -1 +1 @@
1
- import{c as f,F as C,dQ as S,b4 as p,b3 as T}from"./index-V-37Xuf_.js";import{S as I,u as A}from"./use-mcp-client-RZHGKzHm.js";function v(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let g;o[12]!==e?(g=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=g):g=o[13];let r;o[14]!==s||o[15]!==g?(r={...s,additionalToolArgs:g},o[14]=s,o[15]=g,o[16]=r):r=o[16];const N=r,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:I,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const O=A(a);return S(u.id,"CONNECTIONS",O,N)}function E(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:I,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=A(n);return T(i.id,"CONNECTIONS",t,l)}function _(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:I,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=A(i);return p(o.id,"CONNECTIONS",n)}export{E as a,_ as b,v as u};
1
+ import{c as f,F as C,dQ as S,b4 as p,b3 as T}from"./index-Dqlz9zwJ.js";import{S as I,u as A}from"./use-mcp-client-W9jPPMhB.js";function v(t){const o=f.c(20);let i;o[0]!==t?(i=t===void 0?{}:t,o[0]=t,o[1]=i):i=o[1];const n=i;let l,s,c,d;o[2]!==n?({binding:l,includeVirtual:c,slug:d,...s}=n,o[2]=n,o[3]=l,o[4]=s,o[5]=c,o[6]=d):(l=o[3],s=o[4],c=o[5],d=o[6]);let e;o[7]!==l||o[8]!==s.additionalToolArgs||o[9]!==c||o[10]!==d?(e={...s.additionalToolArgs},l!==void 0&&(e.binding=l),c!==void 0&&(e.include_virtual=c),d!==void 0&&(e.slug=d),o[7]=l,o[8]=s.additionalToolArgs,o[9]=c,o[10]=d,o[11]=e):e=o[11];let g;o[12]!==e?(g=Object.keys(e).length>0?e:void 0,o[12]=e,o[13]=g):g=o[13];let r;o[14]!==s||o[15]!==g?(r={...s,additionalToolArgs:g},o[14]=s,o[15]=g,o[16]=r):r=o[16];const N=r,{org:u}=C();let a;o[17]!==u.id||o[18]!==u.slug?(a={connectionId:I,orgId:u.id,orgSlug:u.slug},o[17]=u.id,o[18]=u.slug,o[19]=a):a=o[19];const O=A(a);return S(u.id,"CONNECTIONS",O,N)}function E(t){const o=f.c(3),{org:i}=C();let n;o[0]!==i.id||o[1]!==i.slug?(n={connectionId:I,orgId:i.id,orgSlug:i.slug},o[0]=i.id,o[1]=i.slug,o[2]=n):n=o[2];const l=A(n);return T(i.id,"CONNECTIONS",t,l)}function _(){const t=f.c(3),{org:o}=C();let i;t[0]!==o.id||t[1]!==o.slug?(i={connectionId:I,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=i):i=t[2];const n=A(i);return p(o.id,"CONNECTIONS",n)}export{E as a,_ as b,v as u};
@@ -1 +1 @@
1
- import{c as i,r as n}from"./index-V-37Xuf_.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
1
+ import{c as i,r as n}from"./index-Dqlz9zwJ.js";function p(){const e=i.c(3),[s,a]=n.useState(!1);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async c=>{await navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),2e3)},e[0]=t):t=e[0];const r=t;let o;return e[1]!==s?(o={handleCopy:r,copied:s},e[1]=s,e[2]=o):o=e[2],o}export{p as u};
@@ -1 +1 @@
1
- import{c as g}from"./index-V-37Xuf_.js";import{b as f}from"./use-virtual-mcp-DK3H6vtn.js";import{c as p}from"./use-navigate-to-agent-BKCW_gvh.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,c=u===void 0?!1:u,t=f(),r=p();let s;e[2]!==t.create||e[3]!==c||e[4]!==r?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return c&&r(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=r,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
1
+ import{c as g}from"./index-Dqlz9zwJ.js";import{b as f}from"./use-virtual-mcp-BmI1O-A5.js";import{c as p}from"./use-navigate-to-agent-DuvgSFBW.js";function A(i){const e=g.c(9);let n;e[0]!==i?(n=i===void 0?{}:i,e[0]=i,e[1]=n):n=e[1];const d=n,{navigateOnCreate:u}=d,c=u===void 0?!1:u,t=f(),r=p();let s;e[2]!==t.create||e[3]!==c||e[4]!==r?(s=async()=>{const l=await t.create.mutateAsync({title:"New Agent",description:"AI-driven assistant designed to handle specific tasks",status:"active",connections:[],pinned:!1});return c&&r(l.id,{search:{main:"instructions"}}),{id:l.id,virtualMcp:l}},e[2]=t.create,e[3]=c,e[4]=r,e[5]=s):s=e[5];const o=s;let a;return e[6]!==t.create.isPending||e[7]!==o?(a={createVirtualMCP:o,isCreating:t.create.isPending},e[6]=t.create.isPending,e[7]=o,e[8]=a):a=e[8],a}export{A as u};
@@ -1 +1 @@
1
- import{r as u}from"./index-V-37Xuf_.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
1
+ import{r as u}from"./index-Dqlz9zwJ.js";function l({save:t,delayMs:n=1e3}){const e=u.useRef(t);e.current=t;const r=u.useRef(null),c=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{r.current=null,e.current()},n)},o=()=>(r.current&&(clearTimeout(r.current),r.current=null),e.current());return u.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null,e.current())},[]),{schedule:c,flush:o}}export{l as u};
@@ -1 +1 @@
1
- import{c as m,r as n}from"./index-V-37Xuf_.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
1
+ import{c as m,r as n}from"./index-Dqlz9zwJ.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
@@ -1 +1 @@
1
- import{W as Ut,X as qt,c as $,b as V,Y as gt,Z as pt,e as Xt,j as t,a as oe,B as ne,r as H,aH as Wt,d as Re,m as X,s as Qt,t as G,w as Yt,k as ke,p as R,F as ae,L as Jt,f as ht,u as xt,D as Zt,I as en,G as tn,K as ot,o as nn,n as sn}from"./index-V-37Xuf_.js";import{t as jt}from"./ChevronDown-DtyBrD4r.js";import{A as vt,h as on,b as an}from"./agent-icon-wSfqa-He.js";import{T as Ce,a as ye,c as Se}from"./tooltip-Bn0JTM4_.js";import{u as bt,d as Ct,c as yt}from"./sidebar-DTkb3k7d.js";import{a as it,i as rn,f as cn,S as ln,u as dn}from"./use-mcp-client-RZHGKzHm.js";import{a as un,u as mn}from"./use-virtual-mcp-DK3H6vtn.js";import{a as Be,b as St,P as wt}from"./popover-CyOwyNZ9.js";import{i as Ee}from"./Check-DYGof06e.js";import{s as we}from"./Plus-DVa_q09h.js";import{i as _t}from"./SearchMd-iKYTv-N-.js";import{s as Nt}from"./XClose-C3p2ksqx.js";import{c as fn,d as gn,b as pn,f as hn,e as xn,a as jn,A as vn}from"./alert-dialog-DTwaKao-.js";import{F as Q,a as st,b as Y,c as J,d as Z,f as bn,e as ee}from"./form-DBMnEAEB.js";import{I as ie}from"./input-CF402O8H.js";import{S as Cn}from"./chat-context-CQ8VLWJn.js";import{T as Dt}from"./toolbar-icon-button-87kQULI0.js";import{S as yn}from"./skeleton-8SHwxHVp.js";import{D as kt,a as At,b as It,c as Sn,d as wn,e as _n,f as Nn}from"./drawer-Jn3sV0qT.js";import{u as Pt}from"./use-mobile-CUaS8-kb.js";import{G as Dn}from"./use-registry-app-BthdH2ea.js";import{G as kn}from"./github-repo-picker-CbZmP4XJ.js";import{b as An,a as Tt}from"./hooks-BVR29cJW.js";import{u as In,g as Pn,a as Tn,b as On}from"./use-navigate-to-agent-BKCW_gvh.js";import{u as Ot}from"./shell-layout-u0H-VozI.js";import{f as zt}from"./reusable-new-chat-CouMjkYR.js";import{C as zn}from"./collection-search-DMRdeF9A.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-ccePCpvZ.js";import{u as Mt,a as $t,g as Bn,C as Je}from"./connection-card-BncCSfZi.js";import{e as Ft,d as Lt,a as Bt,b as Et,h as En,c as Vn}from"./dialog-BjKYnhNA.js";import{S as Rn,a as Hn,b as Gn,c as Kn,d as De}from"./select-Cu8CJmg1.js";import{T as Un}from"./textarea-DjN_F4k9.js";import{b as Vt}from"./use-connection-DKtzpgoI.js";import{n as Le,i as Ze}from"./Tool02-pdUH4Bu_.js";import{s as et}from"./Star01-D5KjiGdp.js";import{c as qn,i as $e,a as dt,E as Xn,p as Wn,b as Qn,d as Yn}from"./connection-form-helpers-CE0fzpQ4.js";import{a as tt}from"./authenticate-and-persist-oauth-QjyaYjrw.js";import{g as Jn}from"./connection-slug-eyAPH6o3.js";import{C as Zn}from"./collection-tabs-XO23Zsii.js";import{u as ut}from"./use-infinite-scroll-BIMv83Zk.js";import{B as Fe}from"./badge-B3krVD3K.js";import{u as es}from"./useSuspenseInfiniteQuery-B0cjFAnj.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ts}from"./studio-tools-ACBDJhU7.js";import{u as ns}from"./use-ai-providers-5IJwU5Y-.js";function mt(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ss=Ut({name:qt().min(2,"Organization name is required")});function os(n){const e=$.c(66),{open:s,onOpenChange:i}=n,o=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:gt(ss),defaultValues:{name:""}},e[0]=r):r=e[0];const a=pt(r);let c;e[1]!==o?(c=async E=>{const M=mt(E.name);if(!M)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const U=await oe.organization.create({name:E.name,slug:M});if(U?.error)throw new Error(U.error.message||o("common.createOrganizationDialog.failedToCreate"));const K=U?.data?.slug??M;if(!K)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:K}},e[1]=o,e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=is,e[3]=d):d=e[3];let m;e[4]!==c?(m={mutationFn:c,onSuccess:d},e[4]=c,e[5]=m):m=e[5];const u=Xt(m);let g;e[6]!==u.error||e[7]!==o?(g=u.error instanceof Error?u.error.message:u.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=o,e[8]=g):g=e[8];const l=g;let p;e[9]!==o?(p=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=p):p=e[10];let C;e[11]!==p?(C=t.jsx(fn,{children:p}),e[11]=p,e[12]=C):C=e[12];let x;e[13]!==o?(x=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=x):x=e[14];let h;e[15]!==x?(h=t.jsx(gn,{children:x}),e[15]=x,e[16]=h):h=e[16];let j;e[17]!==C||e[18]!==h?(j=t.jsxs(pn,{children:[C,h]}),e[17]=C,e[18]=h,e[19]=j):j=e[19];let b;if(e[20]!==u||e[21]!==a){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],b=a.handleSubmit(E),e[20]=u,e[21]=a,e[22]=b}else b=e[22];let y;e[25]!==a.formState.isSubmitting||e[26]!==o?(y=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:o("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{...M,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),t.jsx(bn,{children:o("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",mt(M.value)]})]}),t.jsx(ee,{})]})},e[25]=a.formState.isSubmitting,e[26]=o,e[27]=y):y=e[27];let w;e[28]!==a.control||e[29]!==y?(w=t.jsx(Q,{control:a.control,name:"name",render:y}),e[28]=a.control,e[29]=y,e[30]=w):w=e[30];let N;e[31]!==l?(N=l&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:l}),e[31]=l,e[32]=N):N=e[32];const A=a.formState.isSubmitting;let O;e[33]!==u||e[34]!==a?(O=()=>{u.reset(),a.reset()},e[33]=u,e[34]=a,e[35]=O):O=e[35];let f;e[36]!==o?(f=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=f):f=e[37];let _;e[38]!==a.formState.isSubmitting||e[39]!==O||e[40]!==f?(_=t.jsx(hn,{disabled:A,onClick:O,children:f}),e[38]=a.formState.isSubmitting,e[39]=O,e[40]=f,e[41]=_):_=e[41];const T=!a.formState.isValid||a.formState.isSubmitting;let S;e[42]!==a.formState.isSubmitting||e[43]!==o?(S=a.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Cn,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=a.formState.isSubmitting,e[43]=o,e[44]=S):S=e[44];let v;e[45]!==T||e[46]!==S?(v=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=v):v=e[47];let P;e[48]!==_||e[49]!==v?(P=t.jsxs(xn,{children:[_,v]}),e[48]=_,e[49]=v,e[50]=P):P=e[50];let k;e[51]!==b||e[52]!==w||e[53]!==N||e[54]!==P?(k=t.jsxs("form",{className:"space-y-6",onSubmit:b,autoComplete:"off",children:[w,N,P]}),e[51]=b,e[52]=w,e[53]=N,e[54]=P,e[55]=k):k=e[55];let I;e[56]!==a||e[57]!==k?(I=t.jsx(st,{...a,children:k}),e[56]=a,e[57]=k,e[58]=I):I=e[58];let z;e[59]!==j||e[60]!==I?(z=t.jsxs(jn,{children:[j,I]}),e[59]=j,e[60]=I,e[61]=z):z=e[61];let B;return e[62]!==i||e[63]!==s||e[64]!==z?(B=t.jsx(vn,{open:s,onOpenChange:i,children:z}),e[62]=i,e[63]=s,e[64]=z,e[65]=B):B=e[65],B}function is(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Rt(){const n=H.useContext(Wt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function as(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=$.c(13),{org:s,size:i}=n,o=i===void 0?"sm":i,r=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let c;e[0]!==r?(c=X(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==s.logo||e[3]!==s.name?(d=s.logo?void 0:as(s.name),e[2]=s.logo,e[3]=s.name,e[4]=d):d=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=m):m=e[8];let u;return e[9]!==c||e[10]!==d||e[11]!==m?(u=t.jsx("div",{className:c,style:d,children:m}),e[9]=c,e[10]=d,e[11]=m,e[12]=u):u=e[12],u}function rs({invitation:n,onChanged:e}){const s=V(),[i,o]=H.useState(!1),r=n.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const m=await oe.organization.acceptInvitation({invitationId:n.id});if(m.error){G.error(m.error.message),o(!1);return}}catch{G.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}G.success(s("header.orgSwitcher.joined",{name:r})),Yt();let d;try{d=(await oe.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},c=async()=>{o(!0);try{const d=await oe.organization.rejectInvitation({invitationId:n.id});if(d.error){G.error(d.error.message),o(!1);return}G.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{G.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(at,{org:{name:r},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:r}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(ne,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:c,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:r}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=$.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:o}=n,r=V(),{data:a}=Qt(),{invitations:c,refetch:d}=Rt();let m;e[0]!==s?(m=(k,I)=>k.slug===s?-1:I.slug===s?1:k.name.localeCompare(I.name),e[0]=s,e[1]=m):m=e[1];const u=[...a??[]].sort(m),[g,l]=H.useState(""),p=g.toLowerCase(),C=p?u.filter(k=>k.name.toLowerCase().includes(p)||k.slug.toLowerCase().includes(p)):u;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=k=>l(k.target.value),e[3]=h):h=e[3];let j;e[4]!==g?(j=k=>k.key==="Escape"&&g&&l(""),e[4]=g,e[5]=j):j=e[5];let b;e[6]!==r?(b=r("header.orgSwitcher.searchOrganizations"),e[6]=r,e[7]=b):b=e[7];let y;e[8]!==g||e[9]!==j||e[10]!==b?(y=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:g,onChange:h,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=g,e[9]=j,e[10]=b,e[11]=y):y=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{size:16}),e[12]=w):w=e[12];let N;e[13]!==o?(N=t.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:w}),e[13]=o,e[14]=N):N=e[14];let A;e[15]!==y||e[16]!==N?(A=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,y,N]}),e[15]=y,e[16]=N,e[17]=A):A=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let f;e[18]!==c||e[19]!==g||e[20]!==d?(f=!g&&c.map(k=>t.jsx(rs,{invitation:k,onChanged:d},k.id)),e[18]=c,e[19]=g,e[20]=d,e[21]=f):f=e[21];const _=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:g?r("header.orgSwitcher.noOrganizationsMatch",{query:g}):r("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==i||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=i,e[23]=s,e[24]=T):T=e[24];const S=C.map(T);let v;e[25]!==f||e[26]!==_||e[27]!==S?(v=t.jsxs("div",{className:O,children:[f,_,S]}),e[25]=f,e[26]=_,e[27]=S,e[28]=v):v=e[28];let P;return e[29]!==v||e[30]!==A?(P=t.jsxs(t.Fragment,{children:[A,v]}),e[29]=v,e[30]=A,e[31]=P):P=e[31],P}function ls(n){const e=$.c(22),{trigger:s,orgParam:i,align:o,side:r}=n,a=o===void 0?"start":o,c=r===void 0?"bottom":r,d=Re(),[m,u]=H.useState(!1),[g,l]=H.useState(!1);let p;e[0]!==s?(p=t.jsx(Be,{asChild:!0,children:s}),e[0]=s,e[1]=p):p=e[1];const C=String(m);let x;e[2]!==d?(x=A=>{u(!1),d({to:"/$org",params:{org:A}})},e[2]=d,e[3]=x):x=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{u(!1),l(!0)},e[4]=h):h=e[4];let j;e[5]!==i||e[6]!==C||e[7]!==x?(j=t.jsx(cs,{orgParam:i,onSelectOrg:x,onCreateOrg:h},C),e[5]=i,e[6]=C,e[7]=x,e[8]=j):j=e[8];let b;e[9]!==a||e[10]!==c||e[11]!==j?(b=t.jsx(St,{side:c,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:us,onCloseAutoFocus:ds,children:j}),e[9]=a,e[10]=c,e[11]=j,e[12]=b):b=e[12];let y;e[13]!==m||e[14]!==p||e[15]!==b?(y=t.jsxs(wt,{open:m,onOpenChange:u,children:[p,b]}),e[13]=m,e[14]=p,e[15]=b,e[16]=y):y=e[16];let w;e[17]!==g?(w=t.jsx(os,{open:g,onOpenChange:l}),e[17]=g,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==y?(N=t.jsxs(t.Fragment,{children:[y,w]}),e[19]=w,e[20]=y,e[21]=N):N=e[21],N}function ds(n){return n.preventDefault()}function us(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ms(n){const e=$.c(21),{value:s,onChange:i,placeholder:o,onKeyDown:r,className:a,isSearching:c,disabled:d}=n,m=o===void 0?"Search...":o;let u;e[0]!==a?(u=X("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const g=d?"cursor-not-allowed opacity-50":"cursor-text";let l;e[2]!==g?(l=X("flex items-center gap-2.5 h-12 px-4",g),e[2]=g,e[3]=l):l=e[3];let p;e[4]!==c?(p=c?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(_t,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=p):p=e[5];let C;e[6]!==i?(C=b=>i(b.target.value),e[6]=i,e[7]=C):C=e[7];let x;e[8]!==d||e[9]!==r||e[10]!==m||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:r,placeholder:m,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=m,e[11]=C,e[12]=s,e[13]=x):x=e[13];let h;e[14]!==l||e[15]!==p||e[16]!==x?(h=t.jsxs("label",{className:l,children:[p,x]}),e[14]=l,e[15]=p,e[16]=x,e[17]=h):h=e[17];let j;return e[18]!==u||e[19]!==h?(j=t.jsx("div",{className:u,children:h}),e[18]=u,e[19]=h,e[20]=j):j=e[20],j}function rt(n){const e=n?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const s=e.connectionId;return!!s&&!!n?.connections?.some(r=>r.connection_id===s)?{status:"attached",repo:e,connectionId:s}:!!s||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function $o(n){const e=rt(n);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Ht(n){if(typeof n!="object"||n===null)return!1;const s=n.githubRepo?.url;return typeof s=="string"&&s.length>0}function Fo(n){return rt(n).status==="attached"}function Lo(n){const e=rt(n).status;return e==="attached"||e==="detached"}function fs(n){const e=new Set;for(const s of n??[]){const i=s.metadata?.liveAgentId;typeof i=="string"&&i&&e.add(s.id)}return e}function Bo(n,e){if(!n)return null;const s=n.metadata?.liveAgentId;if(typeof s=="string"&&s)return{mode:"dev",targetId:s};const i=(e??[]).find(o=>o.metadata?.liveAgentId===n.id);return i?{mode:"live",targetId:i.id}:null}function gs(n){const e=$.c(6),{value:s,onChange:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==r||e[4]!==s?(a=t.jsx(ms,{value:s,onChange:i,placeholder:r}),e[2]=i,e[3]=r,e[4]=s,e[5]=a):a=e[5],a}function ps(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function hs(n){const e=$.c(10),{org:s,onClose:i}=n,o=V();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let a;e[2]!==i?(a=()=>i(),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==o?(c=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=c):c=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==c?(d=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Jt,{to:"/$org/settings/agents",params:r,onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=r,e[7]=a,e[8]=c,e[9]=d):d=e[9],d}function xs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(Gt,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function js(n){const e=$.c(11),{onImportFromGithub:s}=n,i=V();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Dn,{className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==i?(r=i("sidebar.agentsSection.import"),e[1]=i,e[2]=r):r=e[2];let a;e[3]!==s||e[4]!==r?(a=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[o,r]}),e[3]=s,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==i?(c=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=c):c=e[7];let d;return e[8]!==a||e[9]!==c?(d=t.jsx(Gt,{action:a,children:c}),e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function vs(n){const e=$.c(11),{setOpen:s,emptyCtaClass:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r):r=e[1];let a;e[2]!==i?(a=X(i),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==s?(c=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{className:"size-4"}),e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==a||e[9]!==c?(m=t.jsx(Dt,{"aria-label":r,className:a,onClick:c,children:d}),e[7]=r,e[8]=a,e[9]=c,e[10]=m):m=e[10],m}function bs(n){const e=$.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==o?(c=X(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(we,{}),e[7]=m):m=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let g;e[10]!==u?(g=t.jsx("span",{children:u}),e[10]=u,e[11]=g):g=e[11];let l;return e[12]!==a||e[13]!==c||e[14]!==d||e[15]!==g?(l=t.jsx(Ct,{children:t.jsxs(yt,{tooltip:a,className:c,onClick:d,children:[m,g]})}),e[12]=a,e[13]=c,e[14]=d,e[15]=g,e[16]=l):l=e[16],l}function Cs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(It,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function ys(n){const e=$.c(8),{emptyCtaClass:s}=n,i=V();let o;e[0]!==i?(o=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==s?(r=X(s),e[2]=s,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{className:"size-4"}),e[4]=a):a=e[4];let c;return e[5]!==o||e[6]!==r?(c=t.jsx(Dt,{"aria-label":o,className:r,children:a}),e[5]=o,e[6]=r,e[7]=c):c=e[7],c}function Ss(n){const e=$.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==o?(c=X(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{}),e[5]=d):d=e[5];let m;e[6]!==r?(m=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsx("span",{children:m}),e[8]=m,e[9]=u):u=e[9];let g;e[10]!==a||e[11]!==c||e[12]!==u?(g=t.jsx(Be,{asChild:!0,children:t.jsxs(yt,{tooltip:a,className:c,children:[d,u]})}),e[10]=a,e[11]=c,e[12]=u,e[13]=g):g=e[13];let l;e[14]!==g||e[15]!==s?(l=s(g),e[14]=g,e[15]=s,e[16]=l):l=e[16];let p;return e[17]!==l?(p=t.jsx(Ct,{children:l}),e[17]=l,e[18]=p):p=e[18],p}function ws(n){const e=$.c(9),{children:s}=n,i=V();let o;e[0]!==s?(o=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=o):o=e[1];let r;e[2]!==i?(r=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=r):r=e[3];let a;e[4]!==r?(a=t.jsx(ye,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=a):a=e[5];let c;return e[6]!==o||e[7]!==a?(c=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[o,a]}),e[6]=o,e[7]=a,e[8]=c):c=e[8],c}function _s(n){const e=$.c(4),s=Re(),{create:i}=An();let o;return e[0]!==i||e[1]!==s||e[2]!==n?(o=async r=>{const a=crypto.randomUUID();try{await i({id:a,virtual_mcp_id:r})}catch{}s({to:"/$org/$taskId",params:{org:n,taskId:a},search:{virtualmcpid:r}})},e[0]=i,e[1]=s,e[2]=n,e[3]=o):o=e[3],o}function nt(n){const e=$.c(20),{agent:s,selected:i,onClick:o}=n,r=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(vt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let d;e[5]!==s.title?(d=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=d):d=e[6];let m;e[7]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=m):m=e[8];let u;e[9]!==d||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,m]}),e[9]=d,e[10]=m,e[11]=u):u=e[11];let g;e[12]!==i?(g=i&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=g):g=e[13];let l;return e[14]!==o||e[15]!==a||e[16]!==c||e[17]!==u||e[18]!==g?(l=t.jsxs("button",{type:"button",onClick:o,className:a,children:[c,u,g]}),e[14]=o,e[15]=a,e[16]=c,e[17]=u,e[18]=g,e[19]=l):l=e[19],l}function Gt(n){const e=$.c(5),{children:s,action:i}=n;let o;e[0]!==s?(o=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,i]}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function Ns(n){const e=$.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:o,onImportFromGithub:r}=n,[a,c]=H.useState(""),d=un(),m=d??[],{org:u}=ae(),{data:g}=oe.useSession(),l=g?.user?.id??"anon",p=Pn(d),C=Tn(),x=_s(u.slug),h=fs(d),j=a.toLowerCase(),b=m.filter(Is).filter(L=>!h.has(L.id)).filter(As).filter(L=>!a||L.title.toLowerCase().includes(j)),y=b.filter(ks),w=b.filter(Ds),N=it(u.id),A=!a||N.title.toLowerCase().includes(j),O=!!(i&&A);let f;e[0]!==s||e[1]!==i?(f=()=>{i?.(null),s(),c("")},e[0]=s,e[1]=i,e[2]=f):f=e[2];const _=f,T=L=>{if(i){i(L.id),s(),c("");return}On({orgId:u.id,userId:l},L.id,p),C(),s(),c(""),x(L.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let v;e[3]!==a?(v=t.jsx(gs,{value:a,onChange:c}),e[3]=a,e[4]=v):v=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=i&&A&&N&&t.jsx(nt,{agent:N,selected:!o||o===N.id,onClick:_}),I=(y.length>0||!a)&&t.jsx(js,{onImportFromGithub:r}),z=y.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id)),B=w.length>0&&t.jsx(xs,{}),E=w.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id));let M;e[5]!==O||e[6]!==a||e[7]!==b.length?(M=b.length===0&&!O&&a&&t.jsx(ps,{}),e[5]=O,e[6]=a,e[7]=b.length,e[8]=M):M=e[8];let U;e[9]!==M||e[10]!==k||e[11]!==I||e[12]!==z||e[13]!==B||e[14]!==E?(U=t.jsxs("div",{className:P,children:[k,I,z,B,E,M]}),e[9]=M,e[10]=k,e[11]=I,e[12]=z,e[13]=B,e[14]=E,e[15]=U):U=e[15];let K;e[16]!==s||e[17]!==u?(K=t.jsx(hs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=K):K=e[18];let de;return e[19]!==U||e[20]!==K||e[21]!==v?(de=t.jsxs("div",{className:S,children:[v,U,K]}),e[19]=U,e[20]=K,e[21]=v,e[22]=de):de=e[22],de}function Ds(n){return!Ht(n.metadata)}function ks(n){return Ht(n.metadata)}function As(n){return!cn(n.id)}function Is(n){return!rn(n.id)}function Ps(n){const e=$.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:o,onSelectAgent:r,selectedAgentId:a,side:c,align:d}=s,m=i===void 0?!1:i,u=c===void 0?"right":c,g=d===void 0?"start":d,[l,p]=H.useState(!1),[C,x]=H.useState(!1),h=Pt(),{setOpenMobile:j}=bt(),b=In(),y=b?"border border-border":void 0;let w;e[2]!==b?(w=I=>b?t.jsx(ws,{children:I}):I,e[2]=b,e[3]=w):w=e[3];const N=w;let A;e[4]!==h||e[5]!==j?(A=()=>{p(!1),h&&j(!1)},e[4]=h,e[5]=j,e[6]=A):A=e[6];const O=A;let f;e[7]!==O?(f=()=>{O(),x(!0)},e[7]=O,e[8]=f):f=e[8];const _=f;let T;e[9]!==O||e[10]!==_||e[11]!==r||e[12]!==l||e[13]!==a?(T=l&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(yn,{className:"h-4 w-24"})}),children:t.jsx(Ns,{onClose:O,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=r,e[12]=l,e[13]=a,e[14]=T):T=e[14];const S=T;let v;e[15]!==g||e[16]!==m||e[17]!==y||e[18]!==b||e[19]!==h||e[20]!==l||e[21]!==S||e[22]!==u||e[23]!==o||e[24]!==N?(v=h?t.jsxs(t.Fragment,{children:[o?t.jsx("button",{type:"button",onClick:()=>p(!0),className:"contents",children:o}):m?N(t.jsx(vs,{setOpen:p,emptyCtaClass:y})):t.jsx(bs,{setOpen:p,highlightEmpty:b,emptyCtaClass:y}),t.jsx(kt,{open:l,onOpenChange:p,direction:"bottom",children:t.jsxs(At,{className:"max-h-[85dvh] p-0",children:[t.jsx(Cs,{}),S]})})]}):t.jsxs(wt,{open:l,onOpenChange:I=>{I&&!l&&R("agent_browser_opened",{surface:"desktop_popover"}),p(I)},children:[o?t.jsx(Be,{asChild:!0,children:o}):m?N(t.jsx(Be,{asChild:!0,children:t.jsx(ys,{emptyCtaClass:y})})):t.jsx(Ss,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:y}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:u,align:g,children:S})]}),e[15]=g,e[16]=m,e[17]=y,e[18]=b,e[19]=h,e[20]=l,e[21]=S,e[22]=u,e[23]=o,e[24]=N,e[25]=v):v=e[25];let P;e[26]!==C?(P=t.jsx(kn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let k;return e[28]!==P||e[29]!==v?(k=t.jsxs(t.Fragment,{children:[v,P]}),e[28]=P,e[29]=v,e[30]=k):k=e[30],k}const Ts="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Os(n){const e=$.c(19),{agentId:s,fallback:i,onOpenHome:o,onPick:r}=n,a=mn(s)??i??null,c=a?.title??"Super Agent",d=`Open ${c} home`,m=a?.icon??null;let u;e[0]!==m||e[1]!==c?(u=t.jsx(vt,{icon:m,name:c,size:"xs"}),e[0]=m,e[1]=c,e[2]=u):u=e[2];let g;e[3]!==o||e[4]!==d||e[5]!==u?(g=t.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u}),e[3]=o,e[4]=d,e[5]=u,e[6]=g):g=e[6];let l;e[7]!==c?(l=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:c}),e[7]=c,e[8]=l):l=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=p):p=e[9];let C;e[10]!==l?(C=t.jsxs("button",{type:"button",className:Ts,children:[l,p]}),e[10]=l,e[11]=C):C=e[11];let x;e[12]!==s||e[13]!==r||e[14]!==C?(x=t.jsx(Ps,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:C}),e[12]=s,e[13]=r,e[14]=C,e[15]=x):x=e[15];let h;return e[16]!==g||e[17]!==x?(h=t.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[g,x]}),e[16]=g,e[17]=x,e[18]=h):h=e[18],h}function Eo(n){const e=$.c(26);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,{org:o}=ae(),{state:r,isMobile:a}=bt(),c=Rt().invitations.length>0,d=r==="collapsed"||a,m=c?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let u;e[2]!==o?(u=t.jsx(at,{org:o,size:"sm"}),e[2]=o,e[3]=u):u=e[3];let g;e[4]!==c||e[5]!==d?(g=c&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=c,e[5]=d,e[6]=g):g=e[6];let l;e[7]!==u||e[8]!==g?(l=t.jsxs("span",{className:"relative inline-flex",children:[u,g]}),e[7]=u,e[8]=g,e[9]=l):l=e[9];let p;e[10]!==o.name||e[11]!==i?(p=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=i,e[12]=p):p=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=C):C=e[13];let x;e[14]!==m||e[15]!==l||e[16]!==p?(x=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[l,p,C]})}),e[14]=m,e[15]=l,e[16]=p,e[17]=x):x=e[17];let h;e[18]!==o.slug||e[19]!==x?(h=t.jsx(ls,{orgParam:o.slug,trigger:x}),e[18]=o.slug,e[19]=x,e[20]=h):h=e[20];let j;e[21]!==o.name?(j=t.jsx(ye,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=j):j=e[22];let b;return e[23]!==j||e[24]!==h?(b=t.jsxs(Se,{children:[h,j]}),e[23]=j,e[24]=h,e[25]=b):b=e[25],b}function Vo(n){const e=$.c(24);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:o}=ae(),r=Re();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const c=ht(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const m=xt(d),{threads:u}=Tt(),{data:g}=oe.useSession(),{setTaskId:l,createNewTask:p}=Ot();let C;e[4]!==o.id?(C=it(o.id),e[4]=o.id,e[5]=C):C=e[5];const x=C,h=x.id,j=c.taskId?m.virtualmcpid??h:h;let b;e[6]!==p||e[7]!==h||e[8]!==r||e[9]!==i||e[10]!==o.slug||e[11]!==g?.user?.id||e[12]!==l||e[13]!==u?(b=f=>{if(!f||f===h){r({to:"/$org",params:{org:o.slug}}),i?.();return}const _=zt(u,f,g?.user?.id);_?l(_.id,f):p(f),i?.()},e[6]=p,e[7]=h,e[8]=r,e[9]=i,e[10]=o.slug,e[11]=g?.user?.id,e[12]=l,e[13]=u,e[14]=b):b=e[14];const y=b;let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=w):w=e[15];const N=j===h?x:void 0;let A;e[16]!==j||e[17]!==y?(A=()=>y(j),e[16]=j,e[17]=y,e[18]=A):A=e[18];let O;return e[19]!==j||e[20]!==y||e[21]!==N||e[22]!==A?(O=t.jsx(H.Suspense,{fallback:w,children:t.jsx(Os,{agentId:j,fallback:N,onOpenHome:A,onPick:y})}),e[19]=j,e[20]=y,e[21]=N,e[22]=A,e[23]=O):O=e[23],O}function Ro(){const n=$.c(23),e=V(),{org:s}=ae();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const o=ht(i);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},n[1]=r):r=n[1];const a=xt(r),{threads:c}=Tt(),{data:d}=oe.useSession(),{setTaskId:m,createNewTask:u}=Ot();let g;n[2]!==s.id?(g=it(s.id),n[2]=s.id,n[3]=g):g=n[3];const l=g.id,p=o.taskId?a.virtualmcpid??l:l;let C;n[4]!==p||n[5]!==u||n[6]!==d?.user?.id||n[7]!==m||n[8]!==c?(C=()=>{const A=zt(c,p,d?.user?.id);A?m(A.id,p):u(p)},n[4]=p,n[5]=u,n[6]=d?.user?.id,n[7]=m,n[8]=c,n[9]=C):C=n[9];const x=C;let h;n[10]!==e?(h=e("sidebar.taskGroupsList.newChat"),n[10]=e,n[11]=h):h=n[11];let j;n[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(on,{size:16}),n[12]=j):j=n[12];let b;n[13]!==x||n[14]!==h?(b=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":h,className:"wco-no-drag flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:j})}),n[13]=x,n[14]=h,n[15]=b):b=n[15];let y;n[16]!==e?(y=e("sidebar.taskGroupsList.newChat"),n[16]=e,n[17]=y):y=n[17];let w;n[18]!==y?(w=t.jsx(ye,{side:"bottom",children:y}),n[18]=y,n[19]=w):w=n[19];let N;return n[20]!==b||n[21]!==w?(N=t.jsxs(Se,{children:[b,w]}),n[20]=b,n[21]=w,n[22]=N):N=n[22],N}function zs({open:n,onOpenChange:e,onCreated:s}){const i=V(),{org:o}=ae(),{data:r}=oe.useSession(),{stdioEnabled:a}=Zt(),c=Pt(),d=Vt(),m=Mt(),g=$t(m,"").items,l=pt({resolver:gt(qn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=l.watch("ui_type"),C=l.watch("connection_url"),x=l.watch("npx_package"),h=$e({uiType:p,connectionUrl:C??"",npxPackage:x??""})??dt({uiType:p,connectionUrl:C??"",registryItems:g}),j=f=>{const _=f.trim();if(!_)return;const T=!!l.formState.dirtyFields.title,S=!!l.formState.dirtyFields.description,v=!!l.formState.dirtyFields.env_vars,P=I=>{if(I&&(!T&&!l.getValues("title").trim()&&I.title&&l.setValue("title",I.title,{shouldDirty:!1}),!S&&!(l.getValues("description")??"").trim()&&I.description&&l.setValue("description",I.description,{shouldDirty:!1}),!v&&I.envVarKeys?.length)){const z=l.getValues("env_vars")??[],B=new Set(z.map(M=>M.key)),E=I.envVarKeys.filter(M=>!B.has(M));E.length>0&&l.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Wn(_);if(k&&a){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",k.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),P($e({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const I=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";l.setValue("ui_type",I,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),P($e({uiType:I,connectionUrl:_})??dt({uiType:I,connectionUrl:_,registryItems:g}));return}p==="NPX"&&P($e({uiType:"NPX",npxPackage:_}))},b=f=>{f||l.reset(),e(f)},y=async f=>{let _,T=null,S=null,v=null;f.ui_type==="NPX"?(_="STDIO",T="",v=Qn(f.npx_package||"",f.env_vars||[])):f.ui_type==="STDIO"?(_="STDIO",T="",v=Yn(f.stdio_command||"",f.stdio_args||"",f.stdio_cwd,f.env_vars||[])):(_=f.ui_type,T=f.connection_url||"",S=f.connection_token||null);const P=Mn("conn");try{await d.create.mutateAsync({id:P,title:f.title,description:f.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:o.id,icon:f.icon??null,app_name:null,app_id:null,connection_headers:v,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),s?.(P)}catch{G.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},w=i("connections.createConnectionDialog.title"),N=i("connections.createConnectionDialog.description"),A=l.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:l.control,name:"ui_type",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(Rn,{value:f.value,onValueChange:f.onChange,children:[t.jsx(Z,{children:t.jsx(Hn,{children:t.jsx(Gn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(an,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),p==="NPX"&&t.jsx(Q,{control:l.control,name:"npx_package",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:l.control,name:"stdio_command",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"stdio_args",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"stdio_cwd",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...f,value:f.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(Q,{control:l.control,name:"env_vars",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Xn,{value:f.value??[],onChange:f.onChange})}),t.jsx(ee,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:l.control,name:"connection_url",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"connection_token",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:h?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:h?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...f,value:f.value??""})}),h?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.token.helperText,h.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"title",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...f})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"description",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Un,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...f,value:f.value??""})}),t.jsx(ee,{})]})})]});return c?t.jsx(kt,{open:n,onOpenChange:b,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(Sn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(It,{children:w}),t.jsx(wn,{className:"mt-1",children:N})]}),t.jsx(_n,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(st,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(y),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(Nn,{children:t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:A})})]})})]})}):t.jsx(Ft,{open:n,onOpenChange:b,children:t.jsxs(Lt,{className:"sm:max-w-[525px]",children:[t.jsxs(Bt,{children:[t.jsx(Et,{children:w}),t.jsx(En,{children:N})]}),t.jsx(st,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(y),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Vn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>b(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:A})]})]})})]})})}function Ms(n){const e=$.c(72),{mode:s,agentId:i,addedConnectionIds:o,onAdd:r,onCloneAndAdd:a,onConnectAndAdd:c,connectingItemId:d,search:m,onCreateConnection:u,onBrowseNavigate:g,defaultTab:l}=n,p=s===void 0?"add":s,C=l===void 0?"connected":l,x=V(),{org:h}=ae(),j=H.useDeferredValue(m),b=m!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const w=y;let N;e[2]!==C?(N=D=>D??C,e[2]=C,e[3]=N):N=e[3];const[A,O]=en(tn.connectionsTab(h.slug)+(C==="all"?":home-modal":":agent-modal"),N);let f;e[4]!==A||e[5]!==O?(f=D=>{D!==A&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=A,e[5]=O,e[6]=f):f=e[6];const _=f;let T;e[7]!==h.id||e[8]!==h.slug?(T={connectionId:ln,orgId:h.id,orgSlug:h.slug},e[7]=h.id,e[8]=h.slug,e[9]=T):T=e[9];const S=dn(T),v=j?.trim().split(/\s+/).filter(Boolean)??[],P=v.length>0?{operator:"or",conditions:v.flatMap(Hs)}:void 0,k={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},I=JSON.stringify(k),{data:z,fetchNextPage:B,hasNextPage:E,isFetchingNextPage:M}=es({queryKey:ot.collectionListInfinite(S,h.id,"","CONNECTIONS",I),queryFn:async D=>{const{pageParam:F}=D,se=F===void 0?0:F;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Vs,staleTime:3e4}),U=z?.pages.flatMap(Es)??[],K=Bn(U),de=new Set(U.filter(Bs).map(Ls)),L=Mt(),re=$t(L,j),He=ut(re.loadMore,re.hasMore,re.isLoadingMore),Ge=ut(B,E??!1,M),W=A==="all"||!!w,ct=W?re.items.filter(D=>{const F=$n(D);if(F&&de.has(F))return!1;if(!w)return!0;const se=Ve(D._meta),ce=[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return v.some(te=>ce.includes(te.toLowerCase()))}):[],_e=ct.filter(Fs),Ne=ct.filter($s);let Ae;e[10]!==o?(Ae=D=>D.some(F=>o.has(F.id)),e[10]=o,e[11]=Ae):Ae=e[11];const Ke=Ae;let Ie;e[12]!==o||e[13]!==i||e[14]!==d||e[15]!==Ke||e[16]!==p||e[17]!==r||e[18]!==g||e[19]!==a||e[20]!==x?(Ie=(D,F,se,ce,te)=>{const Me=Ke(te),be=te.find(le=>!o.has(le.id)),q=te[0];if(p==="browse"){const le=Jn(q);return t.jsx(Je,{connection:{title:F,icon:se,description:te.length>1?`${te.length} instances`:ce??void 0},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),g?.(le)}},D)}return t.jsx(Je,{connection:{title:F,icon:se,description:ce},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),i&&R("agent_connection_attached",{agent_id:i,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),r(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),a(q))},children:x("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=o,e[13]=i,e[14]=d,e[15]=Ke,e[16]=p,e[17]=r,e[18]=g,e[19]=a,e[20]=x,e[21]=Ie):Ie=e[21];const Pe=Ie;let Te;e[22]!==d||e[23]!==p||e[24]!==c||e[25]!==x?(Te=D=>{const F=Ve(D._meta),se=F?.friendlyName||F?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ce=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Fn(D.server?.repository)||null,Me=F?.official===!0,be=F?.verified===!0,q=F?.owner==="deco";return t.jsx(Je,{connection:{title:se,description:ce,icon:te},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[q&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:F?.friendlyName||D.server?.name||D.name||null}),c(D)},children:d===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):x(p==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=d,e[23]=p,e[24]=c,e[25]=x,e[26]=Te):Te=e[26];const lt=Te;let ue;e[27]!==A||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==x?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Zn,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:A,onTabChange:D=>_(D)}),t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{R("connections_dialog_custom_clicked"),u()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=A,e[28]=_,e[29]=u,e[30]=w,e[31]=x,e[32]=ue):ue=e[32];const Ue=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ue?(me=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ue),e[33]=Ue,e[34]=me):me=e[34];const Kt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Oe;e[35]!==Pe?(Oe=D=>{if(D.type==="group")return Pe(D.key,D.title,D.icon,null,D.connections);const F=D.connection;return Pe(F.id,F.title,F.icon,F.description??null,[F])},e[35]=Pe,e[36]=Oe):Oe=e[36];const qe=K.map(Oe);let fe;e[37]!==Ge?(fe=t.jsx("div",{ref:Ge,className:"col-span-full h-1"}),e[37]=Ge,e[38]=fe):fe=e[38];let ge;e[39]!==M?(ge=M&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=M,e[40]=ge):ge=e[40];const Xe=W&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Ze,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=W&&_e.map(lt),Qe=W&&Ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ye=W&&Ne.map(lt);let pe;e[41]!==He||e[42]!==L||e[43]!==W?(pe=W&&L.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=L,e[43]=W,e[44]=pe):pe=e[44];let he;e[45]!==re.isLoadingMore||e[46]!==W?(he=W&&re.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=re.isLoadingMore,e[46]=W,e[47]=he):he=e[47];let xe;e[48]!==qe||e[49]!==fe||e[50]!==ge||e[51]!==Xe||e[52]!==We||e[53]!==Qe||e[54]!==Ye||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Kt,children:[qe,fe,ge,Xe,We,Qe,Ye,pe,he]}),e[48]=qe,e[49]=fe,e[50]=ge,e[51]=Xe,e[52]=We,e[53]=Qe,e[54]=Ye,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==A||e[59]!==K.length||e[60]!==Ne||e[61]!==m||e[62]!==x||e[63]!==_e?(je=K.length===0&&_e.length===0&&Ne.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):x(A==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=A,e[59]=K.length,e[60]=Ne,e[61]=m,e[62]=x,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let ze;return e[69]!==ue||e[70]!==ve?(ze=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=ze):ze=e[71],ze}function $s(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Fs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Bs(n){return n.app_name}function Es(n){return n?.items??[]}function Vs(n,e){if(n?.hasMore)return e.reduce(Rs,0)}function Rs(n,e){return n+(e?.items?.length??0)}function Hs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Ho({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...o}){const r=V(),a=o.mode??"add",c="agentId"in o?o.agentId:void 0,d="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,m="onAdd"in o&&o.onAdd?o.onAdd:S=>{},u=(S,v,P)=>{c&&R("agent_connection_attached",{agent_id:c,connection_id:S,app_name:v,mode:P})},[g,l]=H.useState(null),[p,C]=H.useState(i),[x,h]=H.useState(!1),{org:j}=ae(),{data:b}=oe.useSession(),y=Vt(),w=nn(),N=Re(),A=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const v=S.queryKey;return v[1]===j.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},f=async(S,v)=>{R("connection_oauth_succeeded",{connection_id:S,flow:v});const P=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:ot.isMCPAuthenticated(P.href,null)}),O()},_=async S=>{l(S.app_name??S.id);try{const P=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,I=(await y.create.mutateAsync({title:P,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,z=await tt({connectionId:I,orgId:j.id,orgSlug:j.slug,persistFallback:B=>y.update.mutateAsync({id:I,data:{connection_token:B}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:I,flow:"clone",error:z.error??"no_token"}),G.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await y.delete.mutateAsync(I);return}z.ran&&await f(I,"clone"),u(I,S.app_name??null,"clone"),m(I)}catch(v){console.error("Failed to add connection:",v),G.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},T=async S=>{if(!(!j||!b?.user?.id)){l(S.id);try{const v=Ln(S,j.id,b.user.id,{remoteIndex:0}),P=v.connection_type==="STDIO",k=!!v.connection_url,I=P&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!k&&!I){G.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:z}=await y.create.mutateAsync(v),B=await tt({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>y.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(B.ran&&!B.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:B.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:B.error??"no token received"})}),u(z,v.app_name??null,"new"),m(z);return}B.ran?(await f(z,"connect_new"),G.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):G.success(r("virtualMcp.addConnectionDialog.connected")),u(z,v.app_name??null,"new"),m(z)}catch(v){console.error("Failed to connect:",v),G.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return t.jsxs(Ft,{open:n,onOpenChange:e,children:[t.jsxs(Lt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Bt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Et,{className:"text-base font-semibold",children:r(a==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:p,onChange:C,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ms,{mode:a,agentId:c,addedConnectionIds:d,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:g,search:p,onCreateConnection:()=>h(!0),onBrowseNavigate:A,defaultTab:s})})]}),t.jsx(zs,{open:x,onOpenChange:h,onCreated:async S=>{h(!1);const v=await tt({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:P=>y.update.mutateAsync({id:S,data:{connection_token:P}}).then(()=>{})});if(v.ran&&!v.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:v.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:v.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}v.ran&&await f(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const ft=new Map;function Go(){const{org:n}=ae(),e=ts(),s=ns(),i=s.find(h=>h.providerId==="deco"),{data:o,isLoading:r,refetch:a,isFetching:c}=sn({queryKey:ot.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=o?.balanceCents??null,m=d!=null?d/100:null,u=H.useRef(new Map);if(d!=null){const h=ft.get(n.id);u.current.get(n.id)&&h!=null&&d>h&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:d-h,previous_balance_cents:h,new_balance_cents:d}),ft.set(n.id,d),u.current.set(n.id,!0)}const g=!!i,l=d!=null&&d>0,p=d!=null&&d===0,C=d!=null&&d===200,x=s.length>0&&s.every(h=>h.providerId==="deco");return{hasDecoKey:g,decoKeyId:i?.id??null,balanceCents:d,balanceDollars:m,hasCredits:l,isZeroBalance:p,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:r,isFetching:c,refetch:a}}export{Vo as A,Ro as N,Eo as O,Ho as a,ls as b,at as c,fs as d,Fo as e,Ht as f,$o as g,Bo as h,Lo as i,rt as r,Go as u};
1
+ import{W as Ut,X as qt,c as $,b as V,Y as gt,Z as pt,e as Xt,j as t,a as oe,B as ne,r as H,aH as Wt,d as Re,m as X,s as Qt,t as G,w as Yt,k as ke,p as R,F as ae,L as Jt,f as ht,u as xt,D as Zt,I as en,G as tn,K as ot,o as nn,n as sn}from"./index-Dqlz9zwJ.js";import{t as jt}from"./ChevronDown-DR-XGc_o.js";import{A as vt,h as on,b as an}from"./agent-icon-D3vHoY7x.js";import{T as Ce,a as ye,c as Se}from"./tooltip-CMkhKk3x.js";import{u as bt,d as Ct,c as yt}from"./sidebar-C1458ulp.js";import{a as it,i as rn,f as cn,S as ln,u as dn}from"./use-mcp-client-W9jPPMhB.js";import{a as un,u as mn}from"./use-virtual-mcp-BmI1O-A5.js";import{a as Be,b as St,P as wt}from"./popover-BiLcarEK.js";import{i as Ee}from"./Check-Bjh_dZaN.js";import{s as we}from"./Plus-DgckXwlY.js";import{i as _t}from"./SearchMd-C1lYDFim.js";import{s as Nt}from"./XClose-BPb7jDBm.js";import{c as fn,d as gn,b as pn,f as hn,e as xn,a as jn,A as vn}from"./alert-dialog-DIXXqsEe.js";import{F as Q,a as st,b as Y,c as J,d as Z,f as bn,e as ee}from"./form-DpPK2Pnk.js";import{I as ie}from"./input-CHRRtUw8.js";import{S as Cn}from"./chat-context-njYRRmzi.js";import{T as Dt}from"./toolbar-icon-button-31x5z4uU.js";import{S as yn}from"./skeleton-B8U3ZcNj.js";import{D as kt,a as At,b as It,c as Sn,d as wn,e as _n,f as Nn}from"./drawer-je3oSUrj.js";import{u as Pt}from"./use-mobile-BeFZRUdQ.js";import{G as Dn}from"./use-registry-app-CSbbfigq.js";import{G as kn}from"./github-repo-picker-BDXi1DOh.js";import{b as An,a as Tt}from"./hooks-UkRTM6J8.js";import{u as In,g as Pn,a as Tn,b as On}from"./use-navigate-to-agent-DuvgSFBW.js";import{u as Ot}from"./shell-layout-NIXGxo0w.js";import{f as zt}from"./reusable-new-chat-CouMjkYR.js";import{C as zn}from"./collection-search-taKBbIAW.js";import{g as Mn,a as $n,b as Fn,e as Ln}from"./extract-connection-data-COcBONcq.js";import{u as Mt,a as $t,g as Bn,C as Je}from"./connection-card-CoaNSqo2.js";import{e as Ft,d as Lt,a as Bt,b as Et,h as En,c as Vn}from"./dialog-CiGDoXc-.js";import{S as Rn,a as Hn,b as Gn,c as Kn,d as De}from"./select-nJbJ90P6.js";import{T as Un}from"./textarea-Bw3tH400.js";import{b as Vt}from"./use-connection-OIiba3pD.js";import{n as Le,i as Ze}from"./Tool02-DV3o4Bnz.js";import{s as et}from"./Star01-DMJ78lDH.js";import{c as qn,i as $e,a as dt,E as Xn,p as Wn,b as Qn,d as Yn}from"./connection-form-helpers-BOFrInIU.js";import{a as tt}from"./authenticate-and-persist-oauth-DVE-CAJ6.js";import{g as Jn}from"./connection-slug-eyAPH6o3.js";import{C as Zn}from"./collection-tabs-CYp4_eql.js";import{u as ut}from"./use-infinite-scroll-CxCSWx2V.js";import{B as Fe}from"./badge-DKtY9IW6.js";import{u as es}from"./useSuspenseInfiniteQuery-BH9Prwkk.js";import{g as Ve}from"./metadata-dUsYcpuu.js";import{u as ts}from"./studio-tools-DTZoa0OH.js";import{u as ns}from"./use-ai-providers-C343O16l.js";function mt(n){return n.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ss=Ut({name:qt().min(2,"Organization name is required")});function os(n){const e=$.c(66),{open:s,onOpenChange:i}=n,o=V();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={resolver:gt(ss),defaultValues:{name:""}},e[0]=r):r=e[0];const a=pt(r);let c;e[1]!==o?(c=async E=>{const M=mt(E.name);if(!M)throw new Error(o("common.createOrganizationDialog.invalidSlug"));const U=await oe.organization.create({name:E.name,slug:M});if(U?.error)throw new Error(U.error.message||o("common.createOrganizationDialog.failedToCreate"));const K=U?.data?.slug??M;if(!K)throw new Error(o("common.createOrganizationDialog.failedToCreate"));return{orgSlug:K}},e[1]=o,e[2]=c):c=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=is,e[3]=d):d=e[3];let m;e[4]!==c?(m={mutationFn:c,onSuccess:d},e[4]=c,e[5]=m):m=e[5];const u=Xt(m);let g;e[6]!==u.error||e[7]!==o?(g=u.error instanceof Error?u.error.message:u.error?o("common.createOrganizationDialog.failedToCreateGeneric"):null,e[6]=u.error,e[7]=o,e[8]=g):g=e[8];const l=g;let p;e[9]!==o?(p=o("common.createOrganizationDialog.title"),e[9]=o,e[10]=p):p=e[10];let C;e[11]!==p?(C=t.jsx(fn,{children:p}),e[11]=p,e[12]=C):C=e[12];let x;e[13]!==o?(x=o("common.createOrganizationDialog.description"),e[13]=o,e[14]=x):x=e[14];let h;e[15]!==x?(h=t.jsx(gn,{children:x}),e[15]=x,e[16]=h):h=e[16];let j;e[17]!==C||e[18]!==h?(j=t.jsxs(pn,{children:[C,h]}),e[17]=C,e[18]=h,e[19]=j):j=e[19];let b;if(e[20]!==u||e[21]!==a){let E;e[23]!==u?(E=M=>u.mutateAsync(M),e[23]=u,e[24]=E):E=e[24],b=a.handleSubmit(E),e[20]=u,e[21]=a,e[22]=b}else b=e[22];let y;e[25]!==a.formState.isSubmitting||e[26]!==o?(y=E=>{const{field:M}=E;return t.jsxs(Y,{children:[t.jsx(J,{children:o("common.createOrganizationDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{...M,placeholder:o("common.createOrganizationDialog.namePlaceholder"),disabled:a.formState.isSubmitting})}),t.jsx(bn,{children:o("common.createOrganizationDialog.nameDescription")}),M.value&&t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[o("common.createOrganizationDialog.urlLabel")," ",t.jsxs("span",{className:"font-mono",children:[typeof window<"u"?globalThis.location.origin:"","/",mt(M.value)]})]}),t.jsx(ee,{})]})},e[25]=a.formState.isSubmitting,e[26]=o,e[27]=y):y=e[27];let w;e[28]!==a.control||e[29]!==y?(w=t.jsx(Q,{control:a.control,name:"name",render:y}),e[28]=a.control,e[29]=y,e[30]=w):w=e[30];let N;e[31]!==l?(N=l&&t.jsx("div",{className:"text-destructive text-sm mt-2",children:l}),e[31]=l,e[32]=N):N=e[32];const A=a.formState.isSubmitting;let O;e[33]!==u||e[34]!==a?(O=()=>{u.reset(),a.reset()},e[33]=u,e[34]=a,e[35]=O):O=e[35];let f;e[36]!==o?(f=o("common.createOrganizationDialog.cancel"),e[36]=o,e[37]=f):f=e[37];let _;e[38]!==a.formState.isSubmitting||e[39]!==O||e[40]!==f?(_=t.jsx(hn,{disabled:A,onClick:O,children:f}),e[38]=a.formState.isSubmitting,e[39]=O,e[40]=f,e[41]=_):_=e[41];const T=!a.formState.isValid||a.formState.isSubmitting;let S;e[42]!==a.formState.isSubmitting||e[43]!==o?(S=a.formState.isSubmitting?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Cn,{size:"xs"})," ",o("common.createOrganizationDialog.creating")]}):o("common.createOrganizationDialog.createButton"),e[42]=a.formState.isSubmitting,e[43]=o,e[44]=S):S=e[44];let v;e[45]!==T||e[46]!==S?(v=t.jsx(ne,{type:"submit",variant:"default",disabled:T,children:S}),e[45]=T,e[46]=S,e[47]=v):v=e[47];let P;e[48]!==_||e[49]!==v?(P=t.jsxs(xn,{children:[_,v]}),e[48]=_,e[49]=v,e[50]=P):P=e[50];let k;e[51]!==b||e[52]!==w||e[53]!==N||e[54]!==P?(k=t.jsxs("form",{className:"space-y-6",onSubmit:b,autoComplete:"off",children:[w,N,P]}),e[51]=b,e[52]=w,e[53]=N,e[54]=P,e[55]=k):k=e[55];let I;e[56]!==a||e[57]!==k?(I=t.jsx(st,{...a,children:k}),e[56]=a,e[57]=k,e[58]=I):I=e[58];let z;e[59]!==j||e[60]!==I?(z=t.jsxs(jn,{children:[j,I]}),e[59]=j,e[60]=I,e[61]=z):z=e[61];let B;return e[62]!==i||e[63]!==s||e[64]!==z?(B=t.jsx(vn,{open:s,onOpenChange:i,children:z}),e[62]=i,e[63]=s,e[64]=z,e[65]=B):B=e[65],B}function is(n){const{orgSlug:e}=n;window.location.href=`/${e}`}function Rt(){const n=H.useContext(Wt),{data:e,refetch:s}=n.hooks.useListUserInvitations();return{invitations:(e??[]).filter(o=>o.status==="pending"&&new Date(o.expiresAt)>new Date),refetch:()=>s?.()}}function as(n){let e=0;for(let i=0;i<n.length;i++)e=n.charCodeAt(i)+((e<<5)-e);const s=Math.abs(e)%360;return{backgroundColor:`hsl(${s} 55% 70%)`,color:`hsl(${s} 55% 20%)`}}function at(n){const e=$.c(13),{org:s,size:i}=n,o=i===void 0?"sm":i,r=o==="xs"?"size-5":"size-6",a=o==="xs"?"text-[9px]":"text-xs";let c;e[0]!==r?(c=X(r,"shrink-0 rounded-md flex items-center justify-center border border-border/50 overflow-hidden"),e[0]=r,e[1]=c):c=e[1];let d;e[2]!==s.logo||e[3]!==s.name?(d=s.logo?void 0:as(s.name),e[2]=s.logo,e[3]=s.name,e[4]=d):d=e[4];let m;e[5]!==s.logo||e[6]!==s.name||e[7]!==a?(m=s.logo?t.jsx("img",{src:s.logo,alt:"",className:"size-full object-cover"}):t.jsx("span",{className:X("font-semibold leading-none",a),children:s.name.slice(0,2).toUpperCase()}),e[5]=s.logo,e[6]=s.name,e[7]=a,e[8]=m):m=e[8];let u;return e[9]!==c||e[10]!==d||e[11]!==m?(u=t.jsx("div",{className:c,style:d,children:m}),e[9]=c,e[10]=d,e[11]=m,e[12]=u):u=e[12],u}function rs({invitation:n,onChanged:e}){const s=V(),[i,o]=H.useState(!1),r=n.organizationName??s("header.orgSwitcher.unknownOrganization"),a=async()=>{o(!0);try{const m=await oe.organization.acceptInvitation({invitationId:n.id});if(m.error){G.error(m.error.message),o(!1);return}}catch{G.error(s("header.orgSwitcher.failedToAcceptInvitation")),o(!1);return}G.success(s("header.orgSwitcher.joined",{name:r})),Yt();let d;try{d=(await oe.organization.getFullOrganization({query:{organizationId:n.organizationId}}))?.data?.slug}catch{}window.location.href=d?`/${d}`:"/"},c=async()=>{o(!0);try{const d=await oe.organization.rejectInvitation({invitationId:n.id});if(d.error){G.error(d.error.message),o(!1);return}G.success(s("header.orgSwitcher.invitationDeclined")),o(!1),e()}catch{G.error(s("header.orgSwitcher.failedToDeclineInvitation")),o(!1)}};return t.jsxs("div",{className:"flex items-center gap-3 rounded-md border border-dashed border-border px-3 py-2.5",children:[t.jsx(at,{org:{name:r},size:"sm"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-medium",children:r}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:s("header.orgSwitcher.invitedToJoin")})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsx(ne,{size:"sm",variant:"default",className:"h-7 text-xs",onClick:a,disabled:i,children:s("header.orgSwitcher.accept")}),t.jsx(ne,{size:"icon",variant:"ghost",className:"size-7 text-muted-foreground",onClick:c,disabled:i,"aria-label":s("header.orgSwitcher.declineInvitationTo",{name:r}),children:t.jsx(Nt,{size:14})})]})]})}function cs(n){const e=$.c(32),{orgParam:s,onSelectOrg:i,onCreateOrg:o}=n,r=V(),{data:a}=Qt(),{invitations:c,refetch:d}=Rt();let m;e[0]!==s?(m=(k,I)=>k.slug===s?-1:I.slug===s?1:k.name.localeCompare(I.name),e[0]=s,e[1]=m):m=e[1];const u=[...a??[]].sort(m),[g,l]=H.useState(""),p=g.toLowerCase(),C=p?u.filter(k=>k.name.toLowerCase().includes(p)||k.slug.toLowerCase().includes(p)):u;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(_t,{size:16,className:"shrink-0 text-muted-foreground/60"}),e[2]=x):x=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=k=>l(k.target.value),e[3]=h):h=e[3];let j;e[4]!==g?(j=k=>k.key==="Escape"&&g&&l(""),e[4]=g,e[5]=j):j=e[5];let b;e[6]!==r?(b=r("header.orgSwitcher.searchOrganizations"),e[6]=r,e[7]=b):b=e[7];let y;e[8]!==g||e[9]!==j||e[10]!==b?(y=t.jsx("input",{"data-org-switcher-search":!0,autoFocus:!0,type:"text",value:g,onChange:h,onKeyDown:j,placeholder:b,className:"flex-1 min-w-0 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60"}),e[8]=g,e[9]=j,e[10]=b,e[11]=y):y=e[11];let w;e[12]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(we,{size:16}),e[12]=w):w=e[12];let N;e[13]!==o?(N=t.jsx("button",{type:"button",onClick:o,className:"flex items-center justify-center size-7 rounded-md text-muted-foreground hover:bg-accent/50 hover:text-foreground transition-colors",children:w}),e[13]=o,e[14]=N):N=e[14];let A;e[15]!==y||e[16]!==N?(A=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-b border-border/50",children:[x,y,N]}),e[15]=y,e[16]=N,e[17]=A):A=e[17];const O="flex-1 min-h-0 overflow-y-auto p-1.5 flex flex-col gap-1";let f;e[18]!==c||e[19]!==g||e[20]!==d?(f=!g&&c.map(k=>t.jsx(rs,{invitation:k,onChanged:d},k.id)),e[18]=c,e[19]=g,e[20]=d,e[21]=f):f=e[21];const _=C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-muted-foreground/60 text-center",children:g?r("header.orgSwitcher.noOrganizationsMatch",{query:g}):r("header.orgSwitcher.noOrganizationsAvailable")});let T;e[22]!==i||e[23]!==s?(T=k=>t.jsxs("button",{type:"button",onClick:()=>i(k.slug),className:X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",k.slug===s?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50"),children:[t.jsx(at,{org:k,size:"sm"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:k.name}),t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:k.slug})]}),k.slug===s&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"})]},k.id),e[22]=i,e[23]=s,e[24]=T):T=e[24];const S=C.map(T);let v;e[25]!==f||e[26]!==_||e[27]!==S?(v=t.jsxs("div",{className:O,children:[f,_,S]}),e[25]=f,e[26]=_,e[27]=S,e[28]=v):v=e[28];let P;return e[29]!==v||e[30]!==A?(P=t.jsxs(t.Fragment,{children:[A,v]}),e[29]=v,e[30]=A,e[31]=P):P=e[31],P}function ls(n){const e=$.c(22),{trigger:s,orgParam:i,align:o,side:r}=n,a=o===void 0?"start":o,c=r===void 0?"bottom":r,d=Re(),[m,u]=H.useState(!1),[g,l]=H.useState(!1);let p;e[0]!==s?(p=t.jsx(Be,{asChild:!0,children:s}),e[0]=s,e[1]=p):p=e[1];const C=String(m);let x;e[2]!==d?(x=A=>{u(!1),d({to:"/$org",params:{org:A}})},e[2]=d,e[3]=x):x=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{u(!1),l(!0)},e[4]=h):h=e[4];let j;e[5]!==i||e[6]!==C||e[7]!==x?(j=t.jsx(cs,{orgParam:i,onSelectOrg:x,onCreateOrg:h},C),e[5]=i,e[6]=C,e[7]=x,e[8]=j):j=e[8];let b;e[9]!==a||e[10]!==c||e[11]!==j?(b=t.jsx(St,{side:c,align:a,sideOffset:8,collisionPadding:16,className:"w-[300px] p-0 flex flex-col max-h-[440px]",onOpenAutoFocus:us,onCloseAutoFocus:ds,children:j}),e[9]=a,e[10]=c,e[11]=j,e[12]=b):b=e[12];let y;e[13]!==m||e[14]!==p||e[15]!==b?(y=t.jsxs(wt,{open:m,onOpenChange:u,children:[p,b]}),e[13]=m,e[14]=p,e[15]=b,e[16]=y):y=e[16];let w;e[17]!==g?(w=t.jsx(os,{open:g,onOpenChange:l}),e[17]=g,e[18]=w):w=e[18];let N;return e[19]!==w||e[20]!==y?(N=t.jsxs(t.Fragment,{children:[y,w]}),e[19]=w,e[20]=y,e[21]=N):N=e[21],N}function ds(n){return n.preventDefault()}function us(n){n.preventDefault(),n.currentTarget?.querySelector("[data-org-switcher-search]")?.focus()}function ms(n){const e=$.c(21),{value:s,onChange:i,placeholder:o,onKeyDown:r,className:a,isSearching:c,disabled:d}=n,m=o===void 0?"Search...":o;let u;e[0]!==a?(u=X("shrink-0 w-full border-b border-border h-12",a),e[0]=a,e[1]=u):u=e[1];const g=d?"cursor-not-allowed opacity-50":"cursor-text";let l;e[2]!==g?(l=X("flex items-center gap-2.5 h-12 px-4",g),e[2]=g,e[3]=l):l=e[3];let p;e[4]!==c?(p=c?t.jsx(ke,{size:16,className:"animate-spin text-muted-foreground shrink-0"}):t.jsx(_t,{size:16,className:"text-muted-foreground shrink-0"}),e[4]=c,e[5]=p):p=e[5];let C;e[6]!==i?(C=b=>i(b.target.value),e[6]=i,e[7]=C):C=e[7];let x;e[8]!==d||e[9]!==r||e[10]!==m||e[11]!==C||e[12]!==s?(x=t.jsx("input",{type:"text",value:s,onChange:C,onKeyDown:r,placeholder:m,disabled:d,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[8]=d,e[9]=r,e[10]=m,e[11]=C,e[12]=s,e[13]=x):x=e[13];let h;e[14]!==l||e[15]!==p||e[16]!==x?(h=t.jsxs("label",{className:l,children:[p,x]}),e[14]=l,e[15]=p,e[16]=x,e[17]=h):h=e[17];let j;return e[18]!==u||e[19]!==h?(j=t.jsx("div",{className:u,children:h}),e[18]=u,e[19]=h,e[20]=j):j=e[20],j}function rt(n){const e=n?.metadata?.githubRepo;if(!e?.url)return{status:"none"};const s=e.connectionId;return!!s&&!!n?.connections?.some(r=>r.connection_id===s)?{status:"attached",repo:e,connectionId:s}:!!s||e.installationId!=null?{status:"detached",repo:e}:{status:"public-clone",repo:e}}function $o(n){const e=rt(n);return e.status==="attached"||e.status==="public-clone"?e.repo:null}function Ht(n){if(typeof n!="object"||n===null)return!1;const s=n.githubRepo?.url;return typeof s=="string"&&s.length>0}function Fo(n){return rt(n).status==="attached"}function Lo(n){const e=rt(n).status;return e==="attached"||e==="detached"}function fs(n){const e=new Set;for(const s of n??[]){const i=s.metadata?.liveAgentId;typeof i=="string"&&i&&e.add(s.id)}return e}function Bo(n,e){if(!n)return null;const s=n.metadata?.liveAgentId;if(typeof s=="string"&&s)return{mode:"dev",targetId:s};const i=(e??[]).find(o=>o.metadata?.liveAgentId===n.id);return i?{mode:"live",targetId:i.id}:null}function gs(n){const e=$.c(6),{value:s,onChange:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.searchAgents"),e[0]=o,e[1]=r):r=e[1];let a;return e[2]!==i||e[3]!==r||e[4]!==s?(a=t.jsx(ms,{value:s,onChange:i,placeholder:r}),e[2]=i,e[3]=r,e[4]=s,e[5]=a):a=e[5],a}function ps(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.noAgentsFound"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx("div",{className:"flex items-center justify-center py-6 text-xs text-muted-foreground",children:s}),n[2]=s,n[3]=i):i=n[3],i}function hs(n){const e=$.c(10),{org:s,onClose:i}=n,o=V();let r;e[0]!==s.slug?(r={org:s.slug},e[0]=s.slug,e[1]=r):r=e[1];let a;e[2]!==i?(a=()=>i(),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==o?(c=o("sidebar.agentsSection.seeAllAgents"),e[4]=o,e[5]=c):c=e[5];let d;return e[6]!==r||e[7]!==a||e[8]!==c?(d=t.jsx("div",{className:"border-t border-border px-3 py-2.5",children:t.jsx(Jt,{to:"/$org/settings/agents",params:r,onClick:a,className:"text-xs text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center",children:c})}),e[6]=r,e[7]=a,e[8]=c,e[9]=d):d=e[9],d}function xs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.agents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(Gt,{children:s}),n[2]=s,n[3]=i):i=n[3],i}function js(n){const e=$.c(11),{onImportFromGithub:s}=n,i=V();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Dn,{className:"size-3.5"}),e[0]=o):o=e[0];let r;e[1]!==i?(r=i("sidebar.agentsSection.import"),e[1]=i,e[2]=r):r=e[2];let a;e[3]!==s||e[4]!==r?(a=t.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",children:[o,r]}),e[3]=s,e[4]=r,e[5]=a):a=e[5];let c;e[6]!==i?(c=i("sidebar.agentsSection.codeAgents"),e[6]=i,e[7]=c):c=e[7];let d;return e[8]!==a||e[9]!==c?(d=t.jsx(Gt,{action:a,children:c}),e[8]=a,e[9]=c,e[10]=d):d=e[10],d}function vs(n){const e=$.c(11),{setOpen:s,emptyCtaClass:i}=n,o=V();let r;e[0]!==o?(r=o("sidebar.agentsSection.browseAgents"),e[0]=o,e[1]=r):r=e[1];let a;e[2]!==i?(a=X(i),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==s?(c=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[4]=s,e[5]=c):c=e[5];let d;e[6]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{className:"size-4"}),e[6]=d):d=e[6];let m;return e[7]!==r||e[8]!==a||e[9]!==c?(m=t.jsx(Dt,{"aria-label":r,className:a,onClick:c,children:d}),e[7]=r,e[8]=a,e[9]=c,e[10]=m):m=e[10],m}function bs(n){const e=$.c(17),{setOpen:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==o?(c=X(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]!==s?(d=()=>{R("agent_browser_opened",{surface:"mobile_drawer"}),s(!0)},e[5]=s,e[6]=d):d=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(we,{}),e[7]=m):m=e[7];let u;e[8]!==r?(u=r("sidebar.agentsSection.newAgent"),e[8]=r,e[9]=u):u=e[9];let g;e[10]!==u?(g=t.jsx("span",{children:u}),e[10]=u,e[11]=g):g=e[11];let l;return e[12]!==a||e[13]!==c||e[14]!==d||e[15]!==g?(l=t.jsx(Ct,{children:t.jsxs(yt,{tooltip:a,className:c,onClick:d,children:[m,g]})}),e[12]=a,e[13]=c,e[14]=d,e[15]=g,e[16]=l):l=e[16],l}function Cs(){const n=$.c(4),e=V();let s;n[0]!==e?(s=e("sidebar.agentsSection.browseAgents"),n[0]=e,n[1]=s):s=n[1];let i;return n[2]!==s?(i=t.jsx(It,{className:"sr-only",children:s}),n[2]=s,n[3]=i):i=n[3],i}function ys(n){const e=$.c(8),{emptyCtaClass:s}=n,i=V();let o;e[0]!==i?(o=i("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=o):o=e[1];let r;e[2]!==s?(r=X(s),e[2]=s,e[3]=r):r=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(we,{className:"size-4"}),e[4]=a):a=e[4];let c;return e[5]!==o||e[6]!==r?(c=t.jsx(Dt,{"aria-label":o,className:r,children:a}),e[5]=o,e[6]=r,e[7]=c):c=e[7],c}function Ss(n){const e=$.c(19),{wrapEmptyHint:s,highlightEmpty:i,emptyCtaClass:o}=n,r=V();let a;e[0]!==i||e[1]!==r?(a=i?void 0:r("sidebar.agentsSection.browseAgents"),e[0]=i,e[1]=r,e[2]=a):a=e[2];let c;e[3]!==o?(c=X(o),e[3]=o,e[4]=c):c=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(we,{}),e[5]=d):d=e[5];let m;e[6]!==r?(m=r("sidebar.agentsSection.newAgent"),e[6]=r,e[7]=m):m=e[7];let u;e[8]!==m?(u=t.jsx("span",{children:m}),e[8]=m,e[9]=u):u=e[9];let g;e[10]!==a||e[11]!==c||e[12]!==u?(g=t.jsx(Be,{asChild:!0,children:t.jsxs(yt,{tooltip:a,className:c,children:[d,u]})}),e[10]=a,e[11]=c,e[12]=u,e[13]=g):g=e[13];let l;e[14]!==g||e[15]!==s?(l=s(g),e[14]=g,e[15]=s,e[16]=l):l=e[16];let p;return e[17]!==l?(p=t.jsx(Ct,{children:l}),e[17]=l,e[18]=p):p=e[18],p}function ws(n){const e=$.c(9),{children:s}=n,i=V();let o;e[0]!==s?(o=t.jsx(Ce,{asChild:!0,children:s}),e[0]=s,e[1]=o):o=e[1];let r;e[2]!==i?(r=i("sidebar.agentsSection.selectAnExistingAgent"),e[2]=i,e[3]=r):r=e[3];let a;e[4]!==r?(a=t.jsx(ye,{side:"right",sideOffset:8,children:r}),e[4]=r,e[5]=a):a=e[5];let c;return e[6]!==o||e[7]!==a?(c=t.jsxs(Se,{defaultOpen:!0,delayDuration:0,children:[o,a]}),e[6]=o,e[7]=a,e[8]=c):c=e[8],c}function _s(n){const e=$.c(4),s=Re(),{create:i}=An();let o;return e[0]!==i||e[1]!==s||e[2]!==n?(o=async r=>{const a=crypto.randomUUID();try{await i({id:a,virtual_mcp_id:r})}catch{}s({to:"/$org/$taskId",params:{org:n,taskId:a},search:{virtualmcpid:r}})},e[0]=i,e[1]=s,e[2]=n,e[3]=o):o=e[3],o}function nt(n){const e=$.c(20),{agent:s,selected:i,onClick:o}=n,r=i?"bg-accent text-accent-foreground":"text-foreground hover:bg-accent/50";let a;e[0]!==r?(a=X("flex items-center gap-3 px-3 py-2.5 rounded-md text-sm text-left w-full transition-colors",r),e[0]=r,e[1]=a):a=e[1];let c;e[2]!==s.icon||e[3]!==s.title?(c=t.jsx(vt,{icon:s.icon,name:s.title,size:"xs",className:"shrink-0"}),e[2]=s.icon,e[3]=s.title,e[4]=c):c=e[4];let d;e[5]!==s.title?(d=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[5]=s.title,e[6]=d):d=e[6];let m;e[7]!==s.description?(m=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[7]=s.description,e[8]=m):m=e[8];let u;e[9]!==d||e[10]!==m?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[d,m]}),e[9]=d,e[10]=m,e[11]=u):u=e[11];let g;e[12]!==i?(g=i&&t.jsx(Ee,{size:14,className:"ml-auto text-muted-foreground shrink-0"}),e[12]=i,e[13]=g):g=e[13];let l;return e[14]!==o||e[15]!==a||e[16]!==c||e[17]!==u||e[18]!==g?(l=t.jsxs("button",{type:"button",onClick:o,className:a,children:[c,u,g]}),e[14]=o,e[15]=a,e[16]=c,e[17]=u,e[18]=g,e[19]=l):l=e[19],l}function Gt(n){const e=$.c(5),{children:s,action:i}=n;let o;e[0]!==s?(o=t.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s}),e[0]=s,e[1]=o):o=e[1];let r;return e[2]!==i||e[3]!==o?(r=t.jsxs("div",{className:"flex items-center justify-between px-3 pb-1 pt-2",children:[o,i]}),e[2]=i,e[3]=o,e[4]=r):r=e[4],r}function Ns(n){const e=$.c(23),{onClose:s,onSelectAgent:i,selectedAgentId:o,onImportFromGithub:r}=n,[a,c]=H.useState(""),d=un(),m=d??[],{org:u}=ae(),{data:g}=oe.useSession(),l=g?.user?.id??"anon",p=Pn(d),C=Tn(),x=_s(u.slug),h=fs(d),j=a.toLowerCase(),b=m.filter(Is).filter(L=>!h.has(L.id)).filter(As).filter(L=>!a||L.title.toLowerCase().includes(j)),y=b.filter(ks),w=b.filter(Ds),N=it(u.id),A=!a||N.title.toLowerCase().includes(j),O=!!(i&&A);let f;e[0]!==s||e[1]!==i?(f=()=>{i?.(null),s(),c("")},e[0]=s,e[1]=i,e[2]=f):f=e[2];const _=f,T=L=>{if(i){i(L.id),s(),c("");return}On({orgId:u.id,userId:l},L.id,p),C(),s(),c(""),x(L.id)},S="flex flex-col max-h-[min(640px,80dvh)]";let v;e[3]!==a?(v=t.jsx(gs,{value:a,onChange:c}),e[3]=a,e[4]=v):v=e[4];const P="overflow-y-auto flex-1 min-h-0 p-1.5 flex flex-col gap-0.5",k=i&&A&&N&&t.jsx(nt,{agent:N,selected:!o||o===N.id,onClick:_}),I=(y.length>0||!a)&&t.jsx(js,{onImportFromGithub:r}),z=y.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id)),B=w.length>0&&t.jsx(xs,{}),E=w.map(L=>t.jsx(nt,{agent:L,selected:i?o===L.id:void 0,onClick:()=>T(L)},L.id));let M;e[5]!==O||e[6]!==a||e[7]!==b.length?(M=b.length===0&&!O&&a&&t.jsx(ps,{}),e[5]=O,e[6]=a,e[7]=b.length,e[8]=M):M=e[8];let U;e[9]!==M||e[10]!==k||e[11]!==I||e[12]!==z||e[13]!==B||e[14]!==E?(U=t.jsxs("div",{className:P,children:[k,I,z,B,E,M]}),e[9]=M,e[10]=k,e[11]=I,e[12]=z,e[13]=B,e[14]=E,e[15]=U):U=e[15];let K;e[16]!==s||e[17]!==u?(K=t.jsx(hs,{org:u,onClose:s}),e[16]=s,e[17]=u,e[18]=K):K=e[18];let de;return e[19]!==U||e[20]!==K||e[21]!==v?(de=t.jsxs("div",{className:S,children:[v,U,K]}),e[19]=U,e[20]=K,e[21]=v,e[22]=de):de=e[22],de}function Ds(n){return!Ht(n.metadata)}function ks(n){return Ht(n.metadata)}function As(n){return!cn(n.id)}function Is(n){return!rn(n.id)}function Ps(n){const e=$.c(31);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{compact:i,trigger:o,onSelectAgent:r,selectedAgentId:a,side:c,align:d}=s,m=i===void 0?!1:i,u=c===void 0?"right":c,g=d===void 0?"start":d,[l,p]=H.useState(!1),[C,x]=H.useState(!1),h=Pt(),{setOpenMobile:j}=bt(),b=In(),y=b?"border border-border":void 0;let w;e[2]!==b?(w=I=>b?t.jsx(ws,{children:I}):I,e[2]=b,e[3]=w):w=e[3];const N=w;let A;e[4]!==h||e[5]!==j?(A=()=>{p(!1),h&&j(!1)},e[4]=h,e[5]=j,e[6]=A):A=e[6];const O=A;let f;e[7]!==O?(f=()=>{O(),x(!0)},e[7]=O,e[8]=f):f=e[8];const _=f;let T;e[9]!==O||e[10]!==_||e[11]!==r||e[12]!==l||e[13]!==a?(T=l&&t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx(yn,{className:"h-4 w-24"})}),children:t.jsx(Ns,{onClose:O,onSelectAgent:r,selectedAgentId:a,onImportFromGithub:_})}),e[9]=O,e[10]=_,e[11]=r,e[12]=l,e[13]=a,e[14]=T):T=e[14];const S=T;let v;e[15]!==g||e[16]!==m||e[17]!==y||e[18]!==b||e[19]!==h||e[20]!==l||e[21]!==S||e[22]!==u||e[23]!==o||e[24]!==N?(v=h?t.jsxs(t.Fragment,{children:[o?t.jsx("button",{type:"button",onClick:()=>p(!0),className:"contents",children:o}):m?N(t.jsx(vs,{setOpen:p,emptyCtaClass:y})):t.jsx(bs,{setOpen:p,highlightEmpty:b,emptyCtaClass:y}),t.jsx(kt,{open:l,onOpenChange:p,direction:"bottom",children:t.jsxs(At,{className:"max-h-[85dvh] p-0",children:[t.jsx(Cs,{}),S]})})]}):t.jsxs(wt,{open:l,onOpenChange:I=>{I&&!l&&R("agent_browser_opened",{surface:"desktop_popover"}),p(I)},children:[o?t.jsx(Be,{asChild:!0,children:o}):m?N(t.jsx(Be,{asChild:!0,children:t.jsx(ys,{emptyCtaClass:y})})):t.jsx(Ss,{wrapEmptyHint:N,highlightEmpty:b,emptyCtaClass:y}),t.jsx(St,{className:"w-[380px] p-0 overflow-hidden",side:u,align:g,children:S})]}),e[15]=g,e[16]=m,e[17]=y,e[18]=b,e[19]=h,e[20]=l,e[21]=S,e[22]=u,e[23]=o,e[24]=N,e[25]=v):v=e[25];let P;e[26]!==C?(P=t.jsx(kn,{open:C,onOpenChange:x,mode:"agent"}),e[26]=C,e[27]=P):P=e[27];let k;return e[28]!==P||e[29]!==v?(k=t.jsxs(t.Fragment,{children:[v,P]}),e[28]=P,e[29]=v,e[30]=k):k=e[30],k}const Ts="wco-no-drag inline-flex items-center gap-1.5 min-w-0 rounded-md pl-1 pr-2 py-1.5 text-sm text-foreground hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50";function Os(n){const e=$.c(19),{agentId:s,fallback:i,onOpenHome:o,onPick:r}=n,a=mn(s)??i??null,c=a?.title??"Super Agent",d=`Open ${c} home`,m=a?.icon??null;let u;e[0]!==m||e[1]!==c?(u=t.jsx(vt,{icon:m,name:c,size:"xs"}),e[0]=m,e[1]=c,e[2]=u):u=e[2];let g;e[3]!==o||e[4]!==d||e[5]!==u?(g=t.jsx("button",{type:"button",onClick:o,"aria-label":d,className:"wco-no-drag flex items-center shrink-0 rounded-md p-1 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:u}),e[3]=o,e[4]=d,e[5]=u,e[6]=g):g=e[6];let l;e[7]!==c?(l=t.jsx("span",{className:"truncate font-medium max-w-[8rem]",children:c}),e[7]=c,e[8]=l):l=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[9]=p):p=e[9];let C;e[10]!==l?(C=t.jsxs("button",{type:"button",className:Ts,children:[l,p]}),e[10]=l,e[11]=C):C=e[11];let x;e[12]!==s||e[13]!==r||e[14]!==C?(x=t.jsx(Ps,{side:"bottom",align:"start",selectedAgentId:s,onSelectAgent:r,trigger:C}),e[12]=s,e[13]=r,e[14]=C,e[15]=x):x=e[15];let h;return e[16]!==g||e[17]!==x?(h=t.jsxs("div",{className:"flex min-w-0 items-center gap-0",children:[g,x]}),e[16]=g,e[17]=x,e[18]=h):h=e[18],h}function Eo(n){const e=$.c(26);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{showName:i}=s,{org:o}=ae(),{state:r,isMobile:a}=bt(),c=Rt().invitations.length>0,d=r==="collapsed"||a,m=c?`${o.name} — switch organization (pending invitation)`:`${o.name} — switch organization`;let u;e[2]!==o?(u=t.jsx(at,{org:o,size:"sm"}),e[2]=o,e[3]=u):u=e[3];let g;e[4]!==c||e[5]!==d?(g=c&&t.jsx("span",{className:X("absolute -right-1 size-2.5 rounded-full bg-destructive ring-2 ring-background",d?"-top-1":"top-1/2 -translate-y-1/2")}),e[4]=c,e[5]=d,e[6]=g):g=e[6];let l;e[7]!==u||e[8]!==g?(l=t.jsxs("span",{className:"relative inline-flex",children:[u,g]}),e[7]=u,e[8]=g,e[9]=l):l=e[9];let p;e[10]!==o.name||e[11]!==i?(p=i&&t.jsx("span",{className:"truncate text-sm font-medium text-foreground max-w-[10rem]",children:o.name}),e[10]=o.name,e[11]=i,e[12]=p):p=e[12];let C;e[13]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(jt,{size:14,className:"shrink-0 text-muted-foreground opacity-70"}),e[13]=C):C=e[13];let x;e[14]!==m||e[15]!==l||e[16]!==p?(x=t.jsx(Ce,{asChild:!0,children:t.jsxs("button",{type:"button","aria-label":m,className:"wco-no-drag flex items-center gap-1.5 shrink-0 rounded-lg pl-[5px] pr-1.5 py-1.5 hover:bg-accent/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:[l,p,C]})}),e[14]=m,e[15]=l,e[16]=p,e[17]=x):x=e[17];let h;e[18]!==o.slug||e[19]!==x?(h=t.jsx(ls,{orgParam:o.slug,trigger:x}),e[18]=o.slug,e[19]=x,e[20]=h):h=e[20];let j;e[21]!==o.name?(j=t.jsx(ye,{side:"bottom",children:o.name}),e[21]=o.name,e[22]=j):j=e[22];let b;return e[23]!==j||e[24]!==h?(b=t.jsxs(Se,{children:[h,j]}),e[23]=j,e[24]=h,e[25]=b):b=e[25],b}function Vo(n){const e=$.c(24);let s;e[0]!==n?(s=n===void 0?{}:n,e[0]=n,e[1]=s):s=e[1];const{onNavigate:i}=s,{org:o}=ae(),r=Re();let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[2]=a):a=e[2];const c=ht(a);let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={strict:!1},e[3]=d):d=e[3];const m=xt(d),{threads:u}=Tt(),{data:g}=oe.useSession(),{setTaskId:l,createNewTask:p}=Ot();let C;e[4]!==o.id?(C=it(o.id),e[4]=o.id,e[5]=C):C=e[5];const x=C,h=x.id,j=c.taskId?m.virtualmcpid??h:h;let b;e[6]!==p||e[7]!==h||e[8]!==r||e[9]!==i||e[10]!==o.slug||e[11]!==g?.user?.id||e[12]!==l||e[13]!==u?(b=f=>{if(!f||f===h){r({to:"/$org",params:{org:o.slug}}),i?.();return}const _=zt(u,f,g?.user?.id);_?l(_.id,f):p(f),i?.()},e[6]=p,e[7]=h,e[8]=r,e[9]=i,e[10]=o.slug,e[11]=g?.user?.id,e[12]=l,e[13]=u,e[14]=b):b=e[14];const y=b;let w;e[15]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("span",{className:"h-5 w-24 rounded bg-muted animate-pulse"}),e[15]=w):w=e[15];const N=j===h?x:void 0;let A;e[16]!==j||e[17]!==y?(A=()=>y(j),e[16]=j,e[17]=y,e[18]=A):A=e[18];let O;return e[19]!==j||e[20]!==y||e[21]!==N||e[22]!==A?(O=t.jsx(H.Suspense,{fallback:w,children:t.jsx(Os,{agentId:j,fallback:N,onOpenHome:A,onPick:y})}),e[19]=j,e[20]=y,e[21]=N,e[22]=A,e[23]=O):O=e[23],O}function Ro(){const n=$.c(23),e=V(),{org:s}=ae();let i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},n[0]=i):i=n[0];const o=ht(i);let r;n[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},n[1]=r):r=n[1];const a=xt(r),{threads:c}=Tt(),{data:d}=oe.useSession(),{setTaskId:m,createNewTask:u}=Ot();let g;n[2]!==s.id?(g=it(s.id),n[2]=s.id,n[3]=g):g=n[3];const l=g.id,p=o.taskId?a.virtualmcpid??l:l;let C;n[4]!==p||n[5]!==u||n[6]!==d?.user?.id||n[7]!==m||n[8]!==c?(C=()=>{const A=zt(c,p,d?.user?.id);A?m(A.id,p):u(p)},n[4]=p,n[5]=u,n[6]=d?.user?.id,n[7]=m,n[8]=c,n[9]=C):C=n[9];const x=C;let h;n[10]!==e?(h=e("sidebar.taskGroupsList.newChat"),n[10]=e,n[11]=h):h=n[11];let j;n[12]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(on,{size:16}),n[12]=j):j=n[12];let b;n[13]!==x||n[14]!==h?(b=t.jsx(Ce,{asChild:!0,children:t.jsx("button",{type:"button",onClick:x,"aria-label":h,className:"wco-no-drag flex shrink-0 items-center rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:j})}),n[13]=x,n[14]=h,n[15]=b):b=n[15];let y;n[16]!==e?(y=e("sidebar.taskGroupsList.newChat"),n[16]=e,n[17]=y):y=n[17];let w;n[18]!==y?(w=t.jsx(ye,{side:"bottom",children:y}),n[18]=y,n[19]=w):w=n[19];let N;return n[20]!==b||n[21]!==w?(N=t.jsxs(Se,{children:[b,w]}),n[20]=b,n[21]=w,n[22]=N):N=n[22],N}function zs({open:n,onOpenChange:e,onCreated:s}){const i=V(),{org:o}=ae(),{data:r}=oe.useSession(),{stdioEnabled:a}=Zt(),c=Pt(),d=Vt(),m=Mt(),g=$t(m,"").items,l=pt({resolver:gt(qn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=l.watch("ui_type"),C=l.watch("connection_url"),x=l.watch("npx_package"),h=$e({uiType:p,connectionUrl:C??"",npxPackage:x??""})??dt({uiType:p,connectionUrl:C??"",registryItems:g}),j=f=>{const _=f.trim();if(!_)return;const T=!!l.formState.dirtyFields.title,S=!!l.formState.dirtyFields.description,v=!!l.formState.dirtyFields.env_vars,P=I=>{if(I&&(!T&&!l.getValues("title").trim()&&I.title&&l.setValue("title",I.title,{shouldDirty:!1}),!S&&!(l.getValues("description")??"").trim()&&I.description&&l.setValue("description",I.description,{shouldDirty:!1}),!v&&I.envVarKeys?.length)){const z=l.getValues("env_vars")??[],B=new Set(z.map(M=>M.key)),E=I.envVarKeys.filter(M=>!B.has(M));E.length>0&&l.setValue("env_vars",[...z,...E.map(M=>({key:M,value:""}))],{shouldDirty:!0})}},k=Wn(_);if(k&&a){l.setValue("ui_type","NPX",{shouldDirty:!0}),l.setValue("npx_package",k.packageName,{shouldDirty:!0}),l.setValue("connection_url","",{shouldDirty:!0}),l.setValue("connection_token",null,{shouldDirty:!0}),P($e({uiType:"NPX",npxPackage:k.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const I=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";l.setValue("ui_type",I,{shouldDirty:!0}),l.setValue("connection_url",_,{shouldDirty:!0}),P($e({uiType:I,connectionUrl:_})??dt({uiType:I,connectionUrl:_,registryItems:g}));return}p==="NPX"&&P($e({uiType:"NPX",npxPackage:_}))},b=f=>{f||l.reset(),e(f)},y=async f=>{let _,T=null,S=null,v=null;f.ui_type==="NPX"?(_="STDIO",T="",v=Qn(f.npx_package||"",f.env_vars||[])):f.ui_type==="STDIO"?(_="STDIO",T="",v=Yn(f.stdio_command||"",f.stdio_args||"",f.stdio_cwd,f.env_vars||[])):(_=f.ui_type,T=f.connection_url||"",S=f.connection_token||null);const P=Mn("conn");try{await d.create.mutateAsync({id:P,title:f.title,description:f.description||null,connection_type:_,connection_url:T,connection_token:S,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:o.id,icon:f.icon??null,app_name:null,app_id:null,connection_headers:v,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),l.reset(),e(!1),s?.(P)}catch{G.error(i("connections.createConnectionDialog.failedToCreateConnection"))}},w=i("connections.createConnectionDialog.title"),N=i("connections.createConnectionDialog.description"),A=l.formState.isSubmitting?i("connections.createConnectionDialog.saving"):i("connections.createConnectionDialog.createButton"),O=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:l.control,name:"ui_type",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.typeLabel")}),t.jsxs(Rn,{value:f.value,onValueChange:f.onChange,children:[t.jsx(Z,{children:t.jsx(Hn,{children:t.jsx(Gn,{})})}),t.jsxs(Kn,{children:[t.jsx(De,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.httpType")]})}),t.jsx(De,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.sseType")]})}),t.jsx(De,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(et,{className:"w-4 h-4"}),i("connections.createConnectionDialog.websocketType")]})}),a&&t.jsxs(t.Fragment,{children:[t.jsx(De,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Le,{className:"w-4 h-4"}),i("connections.createConnectionDialog.npxPackageType")]})}),t.jsx(De,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(an,{className:"w-4 h-4"}),i("connections.createConnectionDialog.customCommandType")]})})]})]})]}),t.jsx(ee,{})]})}),p==="NPX"&&t.jsx(Q,{control:l.control,name:"npx_package",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.npmPackageLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.npmPackagePlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("npx_package",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:l.control,name:"stdio_command",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.commandLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.commandPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"stdio_args",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.argumentsLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.argumentsPlaceholder"),...f,value:f.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"stdio_cwd",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.workingDirectoryLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.workingDirectoryPlaceholder"),...f,value:f.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("connections.createConnectionDialog.workingDirectoryDescription")}),t.jsx(ee,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(Q,{control:l.control,name:"env_vars",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.environmentVariablesLabel")}),t.jsx(Z,{children:t.jsx(Xn,{value:f.value??[],onChange:f.onChange})}),t.jsx(ee,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:l.control,name:"connection_url",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.urlLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.urlPlaceholder"),...f,value:f.value??"",onPaste:_=>{const T=_.clipboardData.getData("text");T&&(_.preventDefault(),l.setValue("connection_url",T.trim(),{shouldDirty:!0}),j(T))},onBlur:_=>{j(_.target.value),f.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"connection_token",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:h?.token?.label??i("connections.createConnectionDialog.tokenLabelDefault")}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:h?.token?.placeholder??i("connections.createConnectionDialog.tokenPlaceholderDefault"),className:"ph-no-capture",...f,value:f.value??""})}),h?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.token.helperText,h.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:i("connections.createConnectionDialog.openGitHubPatSettings")})]})]}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:l.control,name:"title",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.nameLabel")}),t.jsx(Z,{children:t.jsx(ie,{placeholder:i("connections.createConnectionDialog.namePlaceholder"),...f})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:l.control,name:"description",render:({field:f})=>t.jsxs(Y,{children:[t.jsx(J,{children:i("connections.createConnectionDialog.descriptionLabel")}),t.jsx(Z,{children:t.jsx(Un,{placeholder:i("connections.createConnectionDialog.descriptionPlaceholder"),rows:3,...f,value:f.value??""})}),t.jsx(ee,{})]})})]});return c?t.jsx(kt,{open:n,onOpenChange:b,children:t.jsxs(At,{className:"max-h-[90vh]",children:[t.jsx(Sn,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(It,{children:w}),t.jsx(wn,{className:"mt-1",children:N})]}),t.jsx(_n,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Nt,{size:16})})})]})}),t.jsx(st,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(y),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:O}),t.jsx(Nn,{children:t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"w-full",children:A})})]})})]})}):t.jsx(Ft,{open:n,onOpenChange:b,children:t.jsxs(Lt,{className:"sm:max-w-[525px]",children:[t.jsxs(Bt,{children:[t.jsx(Et,{children:w}),t.jsx(En,{children:N})]}),t.jsx(st,{...l,children:t.jsxs("form",{onSubmit:l.handleSubmit(y),children:[t.jsx("div",{className:"py-4",children:O}),t.jsxs(Vn,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:()=>b(!1),children:i("connections.createConnectionDialog.cancelButton")}),t.jsx(ne,{type:"submit",disabled:l.formState.isSubmitting,className:"min-w-40",children:A})]})]})})]})})}function Ms(n){const e=$.c(72),{mode:s,agentId:i,addedConnectionIds:o,onAdd:r,onCloneAndAdd:a,onConnectAndAdd:c,connectingItemId:d,search:m,onCreateConnection:u,onBrowseNavigate:g,defaultTab:l}=n,p=s===void 0?"add":s,C=l===void 0?"connected":l,x=V(),{org:h}=ae(),j=H.useDeferredValue(m),b=m!==j;let y;e[0]!==j?(y=j.trim().toLowerCase(),e[0]=j,e[1]=y):y=e[1];const w=y;let N;e[2]!==C?(N=D=>D??C,e[2]=C,e[3]=N):N=e[3];const[A,O]=en(tn.connectionsTab(h.slug)+(C==="all"?":home-modal":":agent-modal"),N);let f;e[4]!==A||e[5]!==O?(f=D=>{D!==A&&R("connections_dialog_tab_changed",{to_tab:D}),O(D)},e[4]=A,e[5]=O,e[6]=f):f=e[6];const _=f;let T;e[7]!==h.id||e[8]!==h.slug?(T={connectionId:ln,orgId:h.id,orgSlug:h.slug},e[7]=h.id,e[8]=h.slug,e[9]=T):T=e[9];const S=dn(T),v=j?.trim().split(/\s+/).filter(Boolean)??[],P=v.length>0?{operator:"or",conditions:v.flatMap(Hs)}:void 0,k={...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:0},I=JSON.stringify(k),{data:z,fetchNextPage:B,hasNextPage:E,isFetchingNextPage:M}=es({queryKey:ot.collectionListInfinite(S,h.id,"","CONNECTIONS",I),queryFn:async D=>{const{pageParam:F}=D,se=F===void 0?0:F;return(await S.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...P&&{where:P},orderBy:[{field:["updated_at"],direction:"asc"}],limit:100,offset:se}})).structuredContent},initialPageParam:0,getNextPageParam:Vs,staleTime:3e4}),U=z?.pages.flatMap(Es)??[],K=Bn(U),de=new Set(U.filter(Bs).map(Ls)),L=Mt(),re=$t(L,j),He=ut(re.loadMore,re.hasMore,re.isLoadingMore),Ge=ut(B,E??!1,M),W=A==="all"||!!w,ct=W?re.items.filter(D=>{const F=$n(D);if(F&&de.has(F))return!1;if(!w)return!0;const se=Ve(D._meta),ce=[D.title,D.description,D.name,D.server?.title,D.server?.description,D.server?.name,se?.friendly_name,se?.friendlyName].filter(Boolean).join(" ").toLowerCase();return v.some(te=>ce.includes(te.toLowerCase()))}):[],_e=ct.filter(Fs),Ne=ct.filter($s);let Ae;e[10]!==o?(Ae=D=>D.some(F=>o.has(F.id)),e[10]=o,e[11]=Ae):Ae=e[11];const Ke=Ae;let Ie;e[12]!==o||e[13]!==i||e[14]!==d||e[15]!==Ke||e[16]!==p||e[17]!==r||e[18]!==g||e[19]!==a||e[20]!==x?(Ie=(D,F,se,ce,te)=>{const Me=Ke(te),be=te.find(le=>!o.has(le.id)),q=te[0];if(p==="browse"){const le=Jn(q);return t.jsx(Je,{connection:{title:F,icon:se,description:te.length>1?`${te.length} instances`:ce??void 0},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.connected")]}),onClick:()=>{R("connection_browse_clicked",{app_name:q.app_name??null,connection_id:q.id,instances_count:te.length}),g?.(le)}},D)}return t.jsx(Je,{connection:{title:F,icon:se,description:ce},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[Me&&t.jsxs(Fe,{variant:"secondary",className:"text-xs gap-1 font-normal",children:[t.jsx(Ee,{size:11})," ",x("virtualMcp.connectionDialogContent.added")]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),be?(R("connection_add_clicked",{action:"use_existing",app_name:q.app_name??null,connection_id:be.id}),i&&R("agent_connection_attached",{agent_id:i,connection_id:be.id,app_name:q.app_name??null,mode:"existing"}),r(be.id)):(R("connection_add_clicked",{action:"clone",app_name:q.app_name??null,base_connection_id:q.id}),a(q))},children:x("virtualMcp.connectionDialogContent.add")})]})},D)},e[12]=o,e[13]=i,e[14]=d,e[15]=Ke,e[16]=p,e[17]=r,e[18]=g,e[19]=a,e[20]=x,e[21]=Ie):Ie=e[21];const Pe=Ie;let Te;e[22]!==d||e[23]!==p||e[24]!==c||e[25]!==x?(Te=D=>{const F=Ve(D._meta),se=F?.friendlyName||F?.friendly_name||D.server?.title||D.title||D.server?.name||D.name||D.id||"",ce=D.server?.description||D.description||null,te=D.server?.icons?.[0]?.src||Fn(D.server?.repository)||null,Me=F?.official===!0,be=F?.verified===!0,q=F?.owner==="deco";return t.jsx(Je,{connection:{title:se,description:ce,icon:te},fallbackIcon:t.jsx(Le,{}),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1.5",children:[q&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center size-5 rounded-md bg-muted shrink-0",children:t.jsx("img",{src:"/logos/deco logo.svg",alt:x("virtualMcp.connectionDialogContent.madeByDeco"),className:"size-3"})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByDeco")})]}),!q&&Me&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.builtByOfficial")})]}),!q&&!Me&&be&&t.jsxs(Se,{children:[t.jsx(Ce,{asChild:!0,children:t.jsx(Fe,{variant:"outline",size:"icon",children:t.jsx(Ze,{})})}),t.jsx(ye,{children:x("virtualMcp.connectionDialogContent.verifiedByDeco")})]}),t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 px-3 text-xs font-medium",disabled:d!==null,onClick:le=>{le.stopPropagation(),R("connection_add_clicked",{action:"connect_new",registry_item_id:D.id,app_name:F?.friendlyName||D.server?.name||D.name||null}),c(D)},children:d===D.id?t.jsx(ke,{size:14,className:"animate-spin"}):x(p==="browse"?"virtualMcp.connectionDialogContent.connect":"virtualMcp.connectionDialogContent.add")})]})},`catalog-${D.id}`)},e[22]=d,e[23]=p,e[24]=c,e[25]=x,e[26]=Te):Te=e[26];const lt=Te;let ue;e[27]!==A||e[28]!==_||e[29]!==u||e[30]!==w||e[31]!==x?(ue=!w&&t.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border shrink-0",children:[t.jsx(Zn,{tabs:[{id:"all",label:x("virtualMcp.connectionDialogContent.tabAll")},{id:"connected",label:x("virtualMcp.connectionDialogContent.tabConnected")}],activeTab:A,onTabChange:D=>_(D)}),t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 px-2 text-sm",onClick:()=>{R("connections_dialog_custom_clicked"),u()},children:[t.jsx(we,{size:12}),x("virtualMcp.connectionDialogContent.customConnection")]})]}),e[27]=A,e[28]=_,e[29]=u,e[30]=w,e[31]=x,e[32]=ue):ue=e[32];const Ue=b&&"opacity-50 pointer-events-none";let me;e[33]!==Ue?(me=X("flex-1 overflow-auto p-5 transition-opacity duration-150",Ue),e[33]=Ue,e[34]=me):me=e[34];const Kt="grid grid-cols-[repeat(auto-fill,minmax(260px,1fr))] gap-4";let Oe;e[35]!==Pe?(Oe=D=>{if(D.type==="group")return Pe(D.key,D.title,D.icon,null,D.connections);const F=D.connection;return Pe(F.id,F.title,F.icon,F.description??null,[F])},e[35]=Pe,e[36]=Oe):Oe=e[36];const qe=K.map(Oe);let fe;e[37]!==Ge?(fe=t.jsx("div",{ref:Ge,className:"col-span-full h-1"}),e[37]=Ge,e[38]=fe):fe=e[38];let ge;e[39]!==M?(ge=M&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[39]=M,e[40]=ge):ge=e[40];const Xe=W&&_e.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx(Ze,{size:13,className:"text-muted-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionVerified")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),We=W&&_e.map(lt),Qe=W&&Ne.length>0&&t.jsxs("div",{className:"col-span-full flex items-center gap-2 mt-2",children:[t.jsx("span",{className:"text-sm font-medium text-muted-foreground whitespace-nowrap",children:x("virtualMcp.connectionDialogContent.sectionAllConnections")}),t.jsx("div",{className:"flex-1 h-px bg-border"})]}),Ye=W&&Ne.map(lt);let pe;e[41]!==He||e[42]!==L||e[43]!==W?(pe=W&&L.length>0&&t.jsx("div",{ref:He,className:"col-span-full h-1"}),e[41]=He,e[42]=L,e[43]=W,e[44]=pe):pe=e[44];let he;e[45]!==re.isLoadingMore||e[46]!==W?(he=W&&re.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),e[45]=re.isLoadingMore,e[46]=W,e[47]=he):he=e[47];let xe;e[48]!==qe||e[49]!==fe||e[50]!==ge||e[51]!==Xe||e[52]!==We||e[53]!==Qe||e[54]!==Ye||e[55]!==pe||e[56]!==he?(xe=t.jsxs("div",{className:Kt,children:[qe,fe,ge,Xe,We,Qe,Ye,pe,he]}),e[48]=qe,e[49]=fe,e[50]=ge,e[51]=Xe,e[52]=We,e[53]=Qe,e[54]=Ye,e[55]=pe,e[56]=he,e[57]=xe):xe=e[57];let je;e[58]!==A||e[59]!==K.length||e[60]!==Ne||e[61]!==m||e[62]!==x||e[63]!==_e?(je=K.length===0&&_e.length===0&&Ne.length===0&&t.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:m?x("virtualMcp.connectionDialogContent.emptyStateSearchNoMatch",{search:m}):x(A==="connected"?"virtualMcp.connectionDialogContent.emptyStateNoConnectionsYet":"virtualMcp.connectionDialogContent.emptyStateNoConnectionsAvailable")}),e[58]=A,e[59]=K.length,e[60]=Ne,e[61]=m,e[62]=x,e[63]=_e,e[64]=je):je=e[64];let ve;e[65]!==me||e[66]!==xe||e[67]!==je?(ve=t.jsxs("div",{className:me,children:[xe,je]}),e[65]=me,e[66]=xe,e[67]=je,e[68]=ve):ve=e[68];let ze;return e[69]!==ue||e[70]!==ve?(ze=t.jsxs(t.Fragment,{children:[ue,ve]}),e[69]=ue,e[70]=ve,e[71]=ze):ze=e[71],ze}function $s(n){return!n.verified&&!Ve(n._meta)?.verified&&!n.meta?.verified}function Fs(n){return n.verified||Ve(n._meta)?.verified||n.meta?.verified}function Ls(n){return n.app_name}function Bs(n){return n.app_name}function Es(n){return n?.items??[]}function Vs(n,e){if(n?.hasMore)return e.reduce(Rs,0)}function Rs(n,e){return n+(e?.items?.length??0)}function Hs(n){return[{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}function Ho({open:n,onOpenChange:e,defaultTab:s,initialSearch:i="",...o}){const r=V(),a=o.mode??"add",c="agentId"in o?o.agentId:void 0,d="addedConnectionIds"in o?o.addedConnectionIds??new Set:new Set,m="onAdd"in o&&o.onAdd?o.onAdd:S=>{},u=(S,v,P)=>{c&&R("agent_connection_attached",{agent_id:c,connection_id:S,app_name:v,mode:P})},[g,l]=H.useState(null),[p,C]=H.useState(i),[x,h]=H.useState(!1),{org:j}=ae(),{data:b}=oe.useSession(),y=Vt(),w=nn(),N=Re(),A=S=>{e(!1),N({to:"/$org/settings/connections/$appSlug",params:{org:j.slug,appSlug:S}})},O=()=>{w.invalidateQueries({predicate:S=>{const v=S.queryKey;return v[1]===j.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},f=async(S,v)=>{R("connection_oauth_succeeded",{connection_id:S,flow:v});const P=new URL(`/api/${j.slug}/mcp/${S}`,window.location.origin);await w.invalidateQueries({queryKey:ot.isMCPAuthenticated(P.href,null)}),O()},_=async S=>{l(S.app_name??S.id);try{const P=`${S.title.replace(/\s*\(\d+\)\s*$/,"")} (${Date.now().toString(36).slice(-4)})`,I=(await y.create.mutateAsync({title:P,description:S.description??null,connection_type:S.connection_type,connection_url:S.connection_url??null,connection_token:null,icon:S.icon??null,app_name:S.app_name??null,app_id:S.app_id??null,connection_headers:S.connection_headers??null})).id,z=await tt({connectionId:I,orgId:j.id,orgSlug:j.slug,persistFallback:B=>y.update.mutateAsync({id:I,data:{connection_token:B}}).then(()=>{})});if(z.ran&&!z.ok){R("connection_oauth_failed",{connection_id:I,flow:"clone",error:z.error??"no_token"}),G.error(r("virtualMcp.addConnectionDialog.authenticationFailedError",{error:z.error??"no token received"})),await y.delete.mutateAsync(I);return}z.ran&&await f(I,"clone"),u(I,S.app_name??null,"clone"),m(I)}catch(v){console.error("Failed to add connection:",v),G.error(r("virtualMcp.addConnectionDialog.failedToAddConnection"))}finally{l(null)}},T=async S=>{if(!(!j||!b?.user?.id)){l(S.id);try{const v=Ln(S,j.id,b.user.id,{remoteIndex:0}),P=v.connection_type==="STDIO",k=!!v.connection_url,I=P&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!k&&!I){G.error(r("virtualMcp.addConnectionDialog.mcpServerConnectionError")),l(null);return}const{id:z}=await y.create.mutateAsync(v),B=await tt({connectionId:z,orgId:j.id,orgSlug:j.slug,persistFallback:E=>y.update.mutateAsync({id:z,data:{connection_token:E}}).then(()=>{})});if(B.ran&&!B.ok){R("connection_oauth_failed",{connection_id:z,flow:"connect_new",error:B.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:B.error??"no token received"})}),u(z,v.app_name??null,"new"),m(z);return}B.ran?(await f(z,"connect_new"),G.success(r("virtualMcp.addConnectionDialog.connectedAuthenticated"))):G.success(r("virtualMcp.addConnectionDialog.connected")),u(z,v.app_name??null,"new"),m(z)}catch(v){console.error("Failed to connect:",v),G.error(r("virtualMcp.addConnectionDialog.failedToConnect"))}finally{l(null)}}};return t.jsxs(Ft,{open:n,onOpenChange:e,children:[t.jsxs(Lt,{className:"sm:max-w-5xl h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[t.jsx(Bt,{className:"px-6 pt-5 pb-0 shrink-0",children:t.jsx(Et,{className:"text-base font-semibold",children:r(a==="browse"?"virtualMcp.addConnectionDialog.connectionsTitle":"virtualMcp.addConnectionDialog.addConnectionTitle")})}),t.jsx("div",{className:"pt-3 shrink-0",children:t.jsx(zn,{value:p,onChange:C,placeholder:r("virtualMcp.addConnectionDialog.searchConnectionsPlaceholder")})}),t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(ke,{size:24,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Ms,{mode:a,agentId:c,addedConnectionIds:d,onAdd:m,onCloneAndAdd:_,onConnectAndAdd:T,connectingItemId:g,search:p,onCreateConnection:()=>h(!0),onBrowseNavigate:A,defaultTab:s})})]}),t.jsx(zs,{open:x,onOpenChange:h,onCreated:async S=>{h(!1);const v=await tt({connectionId:S,orgId:j.id,orgSlug:j.slug,persistFallback:P=>y.update.mutateAsync({id:S,data:{connection_token:P}}).then(()=>{})});if(v.ran&&!v.ok){R("connection_oauth_failed",{connection_id:S,flow:"custom_create",error:v.error??"no_token"}),G.warning(r("virtualMcp.addConnectionDialog.signInFailedTitle"),{description:r("virtualMcp.addConnectionDialog.signInFailedDescription",{error:v.error??"no token received"})}),u(S,null,"custom"),m(S),e(!1);return}v.ran&&await f(S,"custom_create"),u(S,null,"custom"),m(S),e(!1)}})]})}const ft=new Map;function Go(){const{org:n}=ae(),e=ts(),s=ns(),i=s.find(h=>h.providerId==="deco"),{data:o,isLoading:r,refetch:a,isFetching:c}=sn({queryKey:ot.aiProviderCredits(n.id,"deco"),enabled:!!i,staleTime:6e4,queryFn:async()=>{try{return await e.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),d=o?.balanceCents??null,m=d!=null?d/100:null,u=H.useRef(new Map);if(d!=null){const h=ft.get(n.id);u.current.get(n.id)&&h!=null&&d>h&&R("credits_topped_up_detected",{organization_id:n.id,delta_cents:d-h,previous_balance_cents:h,new_balance_cents:d}),ft.set(n.id,d),u.current.set(n.id,!0)}const g=!!i,l=d!=null&&d>0,p=d!=null&&d===0,C=d!=null&&d===200,x=s.length>0&&s.every(h=>h.providerId==="deco");return{hasDecoKey:g,decoKeyId:i?.id??null,balanceCents:d,balanceDollars:m,hasCredits:l,isZeroBalance:p,isInitialFreeCredit:C,hasOnlyDecoProvider:x,isLoading:r,isFetching:c,refetch:a}}export{Vo as A,Ro as N,Eo as O,Ho as a,ls as b,at as c,fs as d,Fo as e,Ht as f,$o as g,Bo as h,Lo as i,rt as r,Go as u};