decocms 3.36.0 → 3.36.2

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 (237) hide show
  1. package/dist/client/assets/{AlertCircle-sZfVKKIU.js → AlertCircle-Bdl8L7il.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-CnGG2N1Q.js → ArrowUpRight-C4gNBzMY.js} +1 -1
  3. package/dist/client/assets/{Check-eedT9M4f.js → Check-Cb8huOHH.js} +1 -1
  4. package/dist/client/assets/{CheckCircle-CAOK_nhg.js → CheckCircle-CGJnw6dP.js} +1 -1
  5. package/dist/client/assets/{ChevronDown-D6-hnD5Z.js → ChevronDown-D_ybfzhh.js} +1 -1
  6. package/dist/client/assets/{ChevronLeft-k-DiQ61D.js → ChevronLeft-CBi5hL_n.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-CBibu88R.js → ChevronRight-D0iMeTJ5.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-D19kYmIs.js → ChevronUp-BXLaNqVW.js} +1 -1
  9. package/dist/client/assets/{Container-Z2j0OuNG.js → Container-BGdfxKsK.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-tAZhaZW5.js → DotsVertical-BhoFPdMN.js} +1 -1
  11. package/dist/client/assets/{Eye-BMnHz-k1.js → Eye-DcL-kKgm.js} +1 -1
  12. package/dist/client/assets/{FilterLines-K_WBOHf8.js → FilterLines-DSwseOu_.js} +1 -1
  13. package/dist/client/assets/{Globe01-KlLmxZ2g.js → Globe01-BX4SSb6A.js} +1 -1
  14. package/dist/client/assets/{HardDrive-C7yJ_w8P.js → HardDrive-DcbBi9w_.js} +1 -1
  15. package/dist/client/assets/{Key01-CckfZB0A.js → Key01-R_z_EgAZ.js} +1 -1
  16. package/dist/client/assets/{LayoutLeft-ZmlpRdpE.js → LayoutLeft-hGFocSnW.js} +1 -1
  17. package/dist/client/assets/{LinkExternal01-N2hkztS6.js → LinkExternal01-DQiI5oxv.js} +1 -1
  18. package/dist/client/assets/{Monitor01-Bn333I91.js → Monitor01-CRf7BSF8.js} +1 -1
  19. package/dist/client/assets/{Palette-CcCpCoEe.js → Palette-EMfX7hNs.js} +1 -1
  20. package/dist/client/assets/{Play-CsIlBltu.js → Play-mcRrv0lp.js} +1 -1
  21. package/dist/client/assets/{Plus-D9X97D1u.js → Plus-_ThoLvvV.js} +1 -1
  22. package/dist/client/assets/{RefreshCcw01-DaIOSJey.js → RefreshCcw01-CyAHVf6q.js} +1 -1
  23. package/dist/client/assets/{SearchMd-DuNbf8h_.js → SearchMd-D6F8AHrW.js} +1 -1
  24. package/dist/client/assets/{Settings02-Dg39zp7t.js → Settings02-B100KruV.js} +1 -1
  25. package/dist/client/assets/{Shield01-MKov2U7D.js → Shield01-DxJYzxVh.js} +1 -1
  26. package/dist/client/assets/{Star01-5MkCH9IF.js → Star01-DgOBkoy7.js} +1 -1
  27. package/dist/client/assets/{Stars01-BAVDvS6u.js → Stars01-CF50N3iu.js} +1 -1
  28. package/dist/client/assets/{Stars02-DHgD3n9i.js → Stars02-AWskXgtc.js} +1 -1
  29. package/dist/client/assets/{Sun-DY49aLCe.js → Sun-Ddl5HYpL.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-BuDlamMt.js → SwitchHorizontal01-DHHfKBMD.js} +1 -1
  31. package/dist/client/assets/{Tool01-CiezpOWI.js → Tool01-BLdHAOru.js} +1 -1
  32. package/dist/client/assets/{Trash01-DLl5cvJP.js → Trash01-4Tg-x6Q1.js} +1 -1
  33. package/dist/client/assets/{Upload01-CXSIztYx.js → Upload01-CBpPl05N.js} +1 -1
  34. package/dist/client/assets/{User01-eSBkatOS.js → User01-CChZgMNn.js} +1 -1
  35. package/dist/client/assets/{Users01-BYl8o0Rk.js → Users01-CxX1e6cq.js} +1 -1
  36. package/dist/client/assets/{Users03--pS_AKxh.js → Users03-DE6tDcyz.js} +1 -1
  37. package/dist/client/assets/{X-Br2l6mA-.js → X-BRH2Y8Wq.js} +1 -1
  38. package/dist/client/assets/{XCircle-RMZbZptd.js → XCircle-CShXLucc.js} +1 -1
  39. package/dist/client/assets/{XClose-WgHqvoCp.js → XClose-BFJ573RS.js} +1 -1
  40. package/dist/client/assets/{Zap-04Dx-3Fy.js → Zap-ZgVQTmT-.js} +1 -1
  41. package/dist/client/assets/{ZapSquare-B5l4FlG5.js → ZapSquare-Cz0n89qc.js} +1 -1
  42. package/dist/client/assets/{ZoomOut-rJJ-xaWS.js → ZoomOut-CqeB-Ycx.js} +1 -1
  43. package/dist/client/assets/{access-gate-BfYLjAxI.js → access-gate-qCShaDhO.js} +1 -1
  44. package/dist/client/assets/{accordion-VLPWQbMf.js → accordion-QuD2RrzW.js} +1 -1
  45. package/dist/client/assets/{add-section-modal-DwhDzMiU.js → add-section-modal-Xr54wDg5.js} +1 -1
  46. package/dist/client/assets/{agent-capabilities-Bp0VRyoH.js → agent-capabilities-CFJ9p-mV.js} +1 -1
  47. package/dist/client/assets/{agent-icon-DWieO6vE.js → agent-icon-rbRaklR8.js} +1 -1
  48. package/dist/client/assets/{agents-list-vq1mZM9e.js → agents-list-Dcl00RIN.js} +1 -1
  49. package/dist/client/assets/{ai-providers-MJsvCa64.js → ai-providers-B3fmOzya.js} +1 -1
  50. package/dist/client/assets/{alert-HqJ_IB4U.js → alert-NPCB1uGq.js} +1 -1
  51. package/dist/client/assets/{alert-dialog-DieQSpJJ.js → alert-dialog-DU_hTH_e.js} +1 -1
  52. package/dist/client/assets/app-editor-vPhjMJAN.js +1 -0
  53. package/dist/client/assets/{auth-CEd3xQ2M.js → auth-DOEa4Xg-.js} +1 -1
  54. package/dist/client/assets/{auth-catchall-C-8kcQ7W.js → auth-catchall-C9GzLyRU.js} +1 -1
  55. package/dist/client/assets/{auth-split-layout-CX30rRHT.js → auth-split-layout-D-gXvj1z.js} +1 -1
  56. package/dist/client/assets/{automation-list-row-Ch8kIzZ2.js → automation-list-row-BmMbzVcz.js} +1 -1
  57. package/dist/client/assets/{automation-runs-C8idnx0B.js → automation-runs-CHOhgiKg.js} +1 -1
  58. package/dist/client/assets/{automations-jJXUtE3E.js → automations-vinGS7sH.js} +1 -1
  59. package/dist/client/assets/{avatar-C15JHojT.js → avatar-BqZJEvBP.js} +1 -1
  60. package/dist/client/assets/{badge-JwkDS5Iu.js → badge-B2khBz0-.js} +1 -1
  61. package/dist/client/assets/{brand-context-BT47WAzQ.js → brand-context-B_nK7LrX.js} +1 -1
  62. package/dist/client/assets/{buckets-CyuvSdAu.js → buckets-B0he9ykT.js} +1 -1
  63. package/dist/client/assets/{calendar-CWIwfYwe.js → calendar-DTQK53My.js} +1 -1
  64. package/dist/client/assets/{capability-load-error-BKOu-NPD.js → capability-load-error-ErUeqyMr.js} +1 -1
  65. package/dist/client/assets/{card-CgBn2dE1.js → card-C0ZJxFoq.js} +1 -1
  66. package/dist/client/assets/{chat-context-DqZ1Ibm0.js → chat-context-D-8AD0J7.js} +1 -1
  67. package/dist/client/assets/{checkbox-qrM9_H9O.js → checkbox-DxApZ9yh.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Bs1vaEZW.js → cli-auth-success-D_1gXhC0.js} +1 -1
  69. package/dist/client/assets/{collection-detail-gZtr1UQJ.js → collection-detail-7xb9CmFQ.js} +1 -1
  70. package/dist/client/assets/{collection-display-button-DLfQMrjc.js → collection-display-button-BAzLR9Of.js} +1 -1
  71. package/dist/client/assets/{collection-search-D1oAy2sU.js → collection-search-DTKnEcQS.js} +1 -1
  72. package/dist/client/assets/{collection-table-wrapper-C2gSo7v5.js → collection-table-wrapper-injrdYM-.js} +1 -1
  73. package/dist/client/assets/{collection-tabs-BIQAfryC.js → collection-tabs-BDWQ17XJ.js} +1 -1
  74. package/dist/client/assets/{collections-D0YZfwq6.js → collections-DFjqouMx.js} +1 -1
  75. package/dist/client/assets/{command-BLE2ssDn.js → command-DYklD3Up.js} +1 -1
  76. package/dist/client/assets/{connect-desktop-dialog-CrC9Oh0l.js → connect-desktop-dialog-C4HCeyrm.js} +1 -1
  77. package/dist/client/assets/{connection-card-CHJN3shf.js → connection-card-BjkWUX4T.js} +1 -1
  78. package/dist/client/assets/{connection-detail-C48cRXbS.js → connection-detail-S0rM47Fu.js} +1 -1
  79. package/dist/client/assets/{connection-form-helpers-Drt7n4SC.js → connection-form-helpers-DTy5Iwrw.js} +1 -1
  80. package/dist/client/assets/{connections-4mKaz-pj.js → connections-C9XIC_5l.js} +1 -1
  81. package/dist/client/assets/{decopilot-DvM9Gb5y.js → decopilot-D05Xyy-k.js} +1 -1
  82. package/dist/client/assets/decopilot-sse-pool-Bs8CtAgZ.js +1 -0
  83. package/dist/client/assets/{dialog-DK12sdoJ.js → dialog-B2mbqsst.js} +1 -1
  84. package/dist/client/assets/{domain-settings-BlIFrkY9.js → domain-settings-BGmkBDeq.js} +1 -1
  85. package/dist/client/assets/{drawer-CIXkng7i.js → drawer-iJV16qgy.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-BLKuf1Kf.js → dropdown-menu-D2SV-kWF.js} +1 -1
  87. package/dist/client/assets/{dynamic-plugin-layout-Cao3Fk3O.js → dynamic-plugin-layout-BI5KEXy_.js} +1 -1
  88. package/dist/client/assets/{empty-state-BbCSQSCb.js → empty-state-BvWByj-2.js} +1 -1
  89. package/dist/client/assets/{empty-state-tzNEOnER.js → empty-state-C_DVBzcU.js} +1 -1
  90. package/dist/client/assets/{extract-connection-data-CQzU46AZ.js → extract-connection-data-bssph-WQ.js} +1 -1
  91. package/dist/client/assets/{features-DdBVqCME.js → features-iKNVVztW.js} +1 -1
  92. package/dist/client/assets/{file-explorer-DnZXmyKJ.js → file-explorer-jTZzWDYA.js} +1 -1
  93. package/dist/client/assets/{file-type-icon-BQHeWto0.js → file-type-icon-C6U2veNU.js} +1 -1
  94. package/dist/client/assets/{files-BsjLUCm4.js → files-BMloqr5Z.js} +1 -1
  95. package/dist/client/assets/{form-FCvC7hbQ.js → form-CU3vQdRi.js} +1 -1
  96. package/dist/client/assets/{general-Dd6sqRin.js → general-BgdjTbWO.js} +1 -1
  97. package/dist/client/assets/{generate-id-zSg_956X.js → generate-id-yj5Hc06j.js} +1 -1
  98. package/dist/client/assets/{github-repo-picker-CTRiJHmK.js → github-repo-picker-Bp_Rai-x.js} +1 -1
  99. package/dist/client/assets/{header-tab-button-B1HaLlT-.js → header-tab-button-D3vC9cXp.js} +1 -1
  100. package/dist/client/assets/{hover-card-D0jPa1wE.js → hover-card-BUcaRmlM.js} +1 -1
  101. package/dist/client/assets/{image-field-mUCDr9Zc.js → image-field-FQeZHP_K.js} +1 -1
  102. package/dist/client/assets/{index-CaaIYkny.js → index--7JSPThb.js} +1 -1
  103. package/dist/client/assets/{index-DElySjov.js → index-3ttoiVWU.js} +3 -3
  104. package/dist/client/assets/{index-BD1xF-xP.js → index-B0th8sGF.js} +1 -1
  105. package/dist/client/assets/{index-DiZRyNnN.js → index-B3hxsYs6.js} +1 -1
  106. package/dist/client/assets/{index-tV6K0vzd.js → index-BZhcIh0y.js} +1 -1
  107. package/dist/client/assets/{index-D8rSD1e2.js → index-C1Lwsift.js} +1 -1
  108. package/dist/client/assets/{index-CeLy70Xu.js → index-C7sErToY.js} +1 -1
  109. package/dist/client/assets/{index-C8Oy1v-k.js → index-COSo4xcs.js} +1 -1
  110. package/dist/client/assets/{index-DOUSj-_V.js → index-CZzfDV_a.js} +1 -1
  111. package/dist/client/assets/{index-B-btDb3P.js → index-CeYNxCgl.js} +1 -1
  112. package/dist/client/assets/{index-jep-xxRB.js → index-DusmqmHr.js} +1 -1
  113. package/dist/client/assets/{index-BaVV-6LB.js → index-DyEqkA0D.js} +1 -1
  114. package/dist/client/assets/{index-8TuYuCCk.js → index-RSpfYKVW.js} +1 -1
  115. package/dist/client/assets/{index-p33ao2cf.js → index-TaHJgDzY.js} +1 -1
  116. package/dist/client/assets/{index-redirect-C9ZhbisF.js → index-redirect-B3cJS778.js} +1 -1
  117. package/dist/client/assets/{index-zawK8irL.js → index-xWbPmICt.js} +4 -4
  118. package/dist/client/assets/{input-Cdm1NEie.js → input-DVih3Sjm.js} +1 -1
  119. package/dist/client/assets/{integration-icon-hz4amrfY.js → integration-icon-BRZNp1S0.js} +1 -1
  120. package/dist/client/assets/{label-Vh7XtQX1.js → label-C0uUNmvX.js} +1 -1
  121. package/dist/client/assets/{layout-C4bROUGO.js → layout-BP4_ZWgl.js} +1 -1
  122. package/dist/client/assets/{login-BbHLsX9y.js → login-rd7n3mUN.js} +1 -1
  123. package/dist/client/assets/{mcp-oauth-DIztaHu2.js → mcp-oauth-BQWbsE1s.js} +1 -1
  124. package/dist/client/assets/{members-uiNPsB6a.js → members-D60AKUfH.js} +1 -1
  125. package/dist/client/assets/{monaco-editor-CzCLI82l.js → monaco-editor-D-Xn_h_i.js} +1 -1
  126. package/dist/client/assets/{monitoring-stats-row-BS4JmiNh.js → monitoring-stats-row-DIUkTh7Z.js} +1 -1
  127. package/dist/client/assets/{oauth-callback-C-boMM2j.js → oauth-callback-CN_Q3L8-.js} +1 -1
  128. package/dist/client/assets/{oauth-callback-ai-provider-b_VkYeBz.js → oauth-callback-ai-provider-CXBvt-3U.js} +1 -1
  129. package/dist/client/assets/{onboarding-B4lsc8p6.js → onboarding-4vgLSBnB.js} +1 -1
  130. package/dist/client/assets/{org-install-BqE8DCpi.js → org-install-BAfI3ABO.js} +1 -1
  131. package/dist/client/assets/{org-layout-CuY9xdZF.js → org-layout-BX9VaywI.js} +1 -1
  132. package/dist/client/assets/{org-plugin-layout-BoXoiIeY.js → org-plugin-layout-CPX7c1_z.js} +1 -1
  133. package/dist/client/assets/{page-seo-form-BAxbjdXf.js → page-seo-form-BQBXyb0O.js} +1 -1
  134. package/dist/client/assets/page-seo-sheet-DoMYq7bJ.js +1 -0
  135. package/dist/client/assets/{pair-BMgj9p8o.js → pair-vWhfM9EW.js} +1 -1
  136. package/dist/client/assets/{plugin-empty-state-DEB-1M8s.js → plugin-empty-state-e0Wbrqvl.js} +1 -1
  137. package/dist/client/assets/{plugin-header-tcd0nLNy.js → plugin-header-wAvZu5-j.js} +1 -1
  138. package/dist/client/assets/{plugin-layout-Ba8uQ5F9.js → plugin-layout-BYUyfvt2.js} +1 -1
  139. package/dist/client/assets/{popover-CQUbCY9L.js → popover-CydIugVg.js} +1 -1
  140. package/dist/client/assets/{post-editor-h8Kl9Dat.js → post-editor--xRkfN-u.js} +1 -1
  141. package/dist/client/assets/{primitives-DMqPWXCZ.js → primitives-D1vGUoIn.js} +1 -1
  142. package/dist/client/assets/{profile-BX6NyJ96.js → profile-L6NxK-ky.js} +1 -1
  143. package/dist/client/assets/project-app-view-BZMnBtvK.js +1 -0
  144. package/dist/client/assets/record-editor-DV9l-O7a.js +1 -0
  145. package/dist/client/assets/registry-HfyP6hgN.js +2 -0
  146. package/dist/client/assets/{registry-layout-Dr55jSnu.js → registry-layout-lkoxfdjb.js} +1 -1
  147. package/dist/client/assets/{require-capability-CMu5fNDT.js → require-capability-ctj3w0Hy.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-D9j7jy0d.js → required-auth-layout-1KnSml1h.js} +1 -1
  149. package/dist/client/assets/{reset-password-neZebU-f.js → reset-password-Cncp0vG1.js} +1 -1
  150. package/dist/client/assets/{resizable-_yQxq9nx.js → resizable-DUax5XQL.js} +1 -1
  151. package/dist/client/assets/{roles-B4FWWYZy.js → roles-CX88Wo-B.js} +1 -1
  152. package/dist/client/assets/save-referenced-block-BCkoUa1r.js +1 -0
  153. package/dist/client/assets/{save-status-C6xYTbl3.js → save-status-CilJNEDS.js} +1 -1
  154. package/dist/client/assets/{schema-form-DAx4_84I.js → schema-form-36ITxJTs.js} +1 -1
  155. package/dist/client/assets/{scroll-area-C_pJDhCx.js → scroll-area-G2D-rhCe.js} +1 -1
  156. package/dist/client/assets/{search-input-wftXnsYu.js → search-input-DZtcJZGI.js} +1 -1
  157. package/dist/client/assets/{secrets-C0HtJ-0L.js → secrets-B-dXGiHw.js} +1 -1
  158. package/dist/client/assets/{sections-editor-CQQfy9r_.js → sections-editor-Bh4-voaV.js} +1 -1
  159. package/dist/client/assets/{select-CvY3LM8v.js → select-C8qI9qzJ.js} +1 -1
  160. package/dist/client/assets/{select-model-DzBvb94i.js → select-model-CJrkcp8L.js} +1 -1
  161. package/dist/client/assets/{seo-editor-BPGCTV6C.js → seo-editor-CTlhny9b.js} +1 -1
  162. package/dist/client/assets/{settings-layout-DY5er7_5.js → settings-layout-CpbacBmZ.js} +1 -1
  163. package/dist/client/assets/{settings-section-bgBc23Sj.js → settings-section-7sN_1nHI.js} +1 -1
  164. package/dist/client/assets/{sheet-CUbQ8u3K.js → sheet-B6uVK7Gd.js} +1 -1
  165. package/dist/client/assets/{shell-controls-Cz7KRwiK.js → shell-controls-BrMNTCJc.js} +1 -1
  166. package/dist/client/assets/{shell-layout-CTILiI6W.js → shell-layout-B0RfVT3C.js} +1 -1
  167. package/dist/client/assets/shell-route-loading-BdonEPNR.js +1 -0
  168. package/dist/client/assets/{sidebar-DUDIX5oW.js → sidebar-CeOOq5ye.js} +1 -1
  169. package/dist/client/assets/{skeleton-DOuDuLeH.js → skeleton-vEwazeas.js} +1 -1
  170. package/dist/client/assets/{sortable.esm-BRp5_cYM.js → sortable.esm-CH8RPvw-.js} +1 -1
  171. package/dist/client/assets/{spinner-Ct4FnHpR.js → spinner-2N-kj7x0.js} +1 -1
  172. package/dist/client/assets/{sso-BdyN6bt5.js → sso-Wq5ejlq_.js} +1 -1
  173. package/dist/client/assets/{store-B1cXtP5r.js → store-CvprJD_R.js} +1 -1
  174. package/dist/client/assets/store-registry-BzpUZbWs.js +2 -0
  175. package/dist/client/assets/{studio-tools-BniDnWv9.js → studio-tools-C7SlPTsZ.js} +1 -1
  176. package/dist/client/assets/{switch-DKWXZfes.js → switch-DDUT3a8C.js} +1 -1
  177. package/dist/client/assets/{tab-id-CidWBQZm.js → tab-id-rjh-jKlB.js} +1 -1
  178. package/dist/client/assets/{table-Dey_Txdo.js → table-CXgtsUd4.js} +1 -1
  179. package/dist/client/assets/{tabs-Hef74NAR.js → tabs-DkUWsc-a.js} +1 -1
  180. package/dist/client/assets/{task-status-CMI8T9Bj.js → task-status-DczQDaYF.js} +1 -1
  181. package/dist/client/assets/{textarea-DI0l_iOE.js → textarea-RmWXPTvx.js} +1 -1
  182. package/dist/client/assets/{toggle-group-CKd_s4i6.js → toggle-group-CBraKNJ7.js} +1 -1
  183. package/dist/client/assets/{toolbar-I4LrNcZp.js → toolbar-CE9gJtYo.js} +1 -1
  184. package/dist/client/assets/{tools-list-BqO9ZnTK.js → tools-list-yuhbQkhw.js} +1 -1
  185. package/dist/client/assets/{tooltip-BJIwJ20V.js → tooltip-FBNw4nVO.js} +1 -1
  186. package/dist/client/assets/{types-DkSHL0JO.js → types-n2YDSxA4.js} +1 -1
  187. package/dist/client/assets/{use-ai-providers-BgB6wf9K.js → use-ai-providers-suUCAMGx.js} +1 -1
  188. package/dist/client/assets/{use-automations-C2phvVRr.js → use-automations-F8sxpovP.js} +1 -1
  189. package/dist/client/assets/{use-capability-C2a1p0-_.js → use-capability-CVFP3WhT.js} +1 -1
  190. package/dist/client/assets/{use-clock-tick-BsB0gkiC.js → use-clock-tick-DervAiLh.js} +1 -1
  191. package/dist/client/assets/{use-collections-CSzXbKpT.js → use-collections-BENY1kCP.js} +1 -1
  192. package/dist/client/assets/{use-connection-DWiJ60zQ.js → use-connection-DYg5H00C.js} +1 -1
  193. package/dist/client/assets/{use-copy-B92V5YyR.js → use-copy-CeVxNpud.js} +1 -1
  194. package/dist/client/assets/{use-create-virtual-mcp-CznuB8H8.js → use-create-virtual-mcp-izJw-zXR.js} +1 -1
  195. package/dist/client/assets/{use-debounced-autosave-Dlx1T484.js → use-debounced-autosave-DSCKWvQF.js} +1 -1
  196. package/dist/client/assets/{use-delete-connection-DflATvAp.js → use-delete-connection-DP7dz4xf.js} +1 -1
  197. package/dist/client/assets/{use-file-configs-SLkVSBqH.js → use-file-configs-B9X5drJT.js} +1 -1
  198. package/dist/client/assets/{use-infinite-scroll-BovhyqJC.js → use-infinite-scroll--_mmqYnT.js} +1 -1
  199. package/dist/client/assets/{use-list-state-Bq0IeuWL.js → use-list-state-DsyTKO23.js} +1 -1
  200. package/dist/client/assets/{use-mcp-client-4hZRsKeH.js → use-mcp-client-CLwLq9Vl.js} +1 -1
  201. package/dist/client/assets/{use-mcp-prompts-DW6p58bx.js → use-mcp-prompts-B267X-_C.js} +1 -1
  202. package/dist/client/assets/{use-mcp-tools-DahL_-yT.js → use-mcp-tools-D4ZIO9iv.js} +1 -1
  203. package/dist/client/assets/{use-members-CJ3raof8.js → use-members-CPWF2UIp.js} +1 -1
  204. package/dist/client/assets/{use-navigate-to-agent-CG5oz4s3.js → use-navigate-to-agent-B002vpC6.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-CUK5hmPG.js → use-org-auth-client-bsfac5xt.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-B2AgOe3M.js → use-org-sso-C1kwoIRD.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-k4iypw0t.js → use-organization-roles-_DPpq5Wg.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-C5AMVC8s.js → use-organization-settings-25l1s_BF.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-YslMFzn6.js → use-registry-connections-CMrhWNW5.js} +1 -1
  210. package/dist/client/assets/{use-secrets-D9xuZ4ne.js → use-secrets-B00xpt4M.js} +1 -1
  211. package/dist/client/assets/{use-status-sounds-BZklskfJ.js → use-status-sounds-C7cE6rna.js} +1 -1
  212. package/dist/client/assets/{use-view-mode-D5aD93Zo.js → use-view-mode-BrzlZey1.js} +1 -1
  213. package/dist/client/assets/{use-virtual-mcp-Csq3tX42.js → use-virtual-mcp-BgfAZ5Jr.js} +1 -1
  214. package/dist/client/assets/useInfiniteQuery-mF7h7Kib.js +1 -0
  215. package/dist/client/assets/{useRouterState-C9mG29tS.js → useRouterState-CcHttnTA.js} +1 -1
  216. package/dist/client/assets/useSuspenseInfiniteQuery-D6t37oXN.js +1 -0
  217. package/dist/client/assets/{user-BLO2fGFf.js → user-D2mv81pj.js} +1 -1
  218. package/dist/client/assets/{view-mode-toggle-4w01MVLK.js → view-mode-toggle-dEyORvRn.js} +1 -1
  219. package/dist/client/assets/{watch-sse-pool-DpnWhDEt.js → watch-sse-pool-ymdzZonG.js} +1 -1
  220. package/dist/client/assets/{workflow-D13SKBQn.js → workflow-BhoGGrwE.js} +1 -1
  221. package/dist/client/assets/workflow-detail-y0Js5k1o.js +1 -0
  222. package/dist/client/index.html +1 -1
  223. package/dist/server/cli.js +69 -69
  224. package/dist/server/server.js +102 -102
  225. package/package.json +1 -1
  226. package/dist/client/assets/app-editor-8FQlu5Bg.js +0 -1
  227. package/dist/client/assets/decopilot-sse-pool-BvjD1ex-.js +0 -1
  228. package/dist/client/assets/page-seo-sheet-BmI1u_IU.js +0 -1
  229. package/dist/client/assets/project-app-view-C-BhQ4Z6.js +0 -1
  230. package/dist/client/assets/record-editor-vpJHbkV7.js +0 -1
  231. package/dist/client/assets/registry-B-LobrAM.js +0 -2
  232. package/dist/client/assets/save-referenced-block-D7Am-8ol.js +0 -1
  233. package/dist/client/assets/shell-route-loading-ByskgJGc.js +0 -1
  234. package/dist/client/assets/store-registry-DmabX9qc.js +0 -2
  235. package/dist/client/assets/useInfiniteQuery-DFIrNW-C.js +0 -1
  236. package/dist/client/assets/useSuspenseInfiniteQuery-kjS8l72l.js +0 -1
  237. package/dist/client/assets/workflow-detail-W7As-1ka.js +0 -1
@@ -1 +1 @@
1
- import{e as ce,j as t,E as tt,r as X,l as le,p as ke,f as De,d as nt,b as Ae,u as st,o as ot,L as it,G as at,H as ct,B as M,t as ne,F as rt,c as de,n as W,K as lt}from"./index-DElySjov.js";import{g as dt}from"./generate-id-zSg_956X.js";import{C as mt}from"./collection-display-button-DLfQMrjc.js";import{S as ut}from"./search-input-wftXnsYu.js";import{C as pt}from"./collection-tabs-BIQAfryC.js";import{u as ht,a as we,g as xt,C as ve}from"./connection-card-CHJN3shf.js";import{E as gt}from"./empty-state-tzNEOnER.js";import{I as ft}from"./integration-icon-hz4amrfY.js";import{P as pe}from"./index-BD1xF-xP.js";import{u as jt,D as yt}from"./use-delete-connection-DflATvAp.js";import{u as Ce}from"./use-capability-C2a1p0-_.js";import{u as Ct}from"./use-infinite-scroll-BovhyqJC.js";import{u as vt}from"./use-list-state-Bq0IeuWL.js";import{g as Te,a as _t,e as bt}from"./extract-connection-data-CQzU46AZ.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as ze,a as Ee,A as Me}from"./alert-dialog-DieQSpJJ.js";import{C as Fe}from"./checkbox-qrM9_H9O.js";import{D as Ve,a as Be,b as Ue,c as He,e as Re,d as Ke}from"./dialog-DK12sdoJ.js";import{b as St,a as Nt,c as kt,D as Dt,d as At,e as wt,f as Tt}from"./drawer-CIXkng7i.js";import{u as It}from"./tooltip-BJIwJ20V.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-BLKuf1Kf.js";import{F as Y,b as J,c as Z,d as ee,f as te,a as Se}from"./form-FCvC7hbQ.js";import{I as ie}from"./input-Cdm1NEie.js";import{d as Pt,S as Lt,a as Ot,b as $t,c as re}from"./select-CvY3LM8v.js";import{T as zt}from"./textarea-DI0l_iOE.js";import{b as Ge,u as Et}from"./use-connection-DWiJ60zQ.js";import{a as Mt}from"./use-virtual-mcp-Csq3tX42.js";import{i as Ft,a as Vt}from"./mcp-oauth-DIztaHu2.js";import{u as Bt}from"./studio-tools-BniDnWv9.js";import{S as Ut,a6 as Ht,u as Rt,r as Kt}from"./agent-icon-DWieO6vE.js";import{n as ge}from"./Container-Z2j0OuNG.js";import{i as Qe}from"./DotsVertical-tAZhaZW5.js";import{s as Ye}from"./Eye-BMnHz-k1.js";import{s as ye}from"./Star01-5MkCH9IF.js";import{s as Je}from"./Plus-D9X97D1u.js";import{s as Ze}from"./Trash01-DLl5cvJP.js";import{s as et}from"./XClose-WgHqvoCp.js";import{i as he,a as Ne,E as Wt,c as Xt,p as qt,b as Gt,d as Qt}from"./connection-form-helpers-Drt7n4SC.js";import"./collections-D0YZfwq6.js";import"./SwitchHorizontal01-BuDlamMt.js";import"./Check-eedT9M4f.js";import"./view-mode-toggle-4w01MVLK.js";import"./badge-JwkDS5Iu.js";import"./SearchMd-DuNbf8h_.js";import"./use-registry-connections-YslMFzn6.js";import"./use-mcp-client-4hZRsKeH.js";import"./auth-CEd3xQ2M.js";import"./use-organization-settings-C5AMVC8s.js";import"./useInfiniteQuery-DFIrNW-C.js";import"./card-CgBn2dE1.js";import"./sidebar-DUDIX5oW.js";import"./LayoutLeft-ZmlpRdpE.js";import"./sheet-CUbQ8u3K.js";import"./X-Br2l6mA-.js";import"./use-view-mode-D5aD93Zo.js";import"./ChevronRight-CBibu88R.js";import"./label-Vh7XtQX1.js";import"./ChevronDown-D6-hnD5Z.js";import"./ChevronUp-D19kYmIs.js";import"./use-collections-CSzXbKpT.js";import"./AlertCircle-sZfVKKIU.js";import"./Tool01-CiezpOWI.js";import"./RefreshCcw01-DaIOSJey.js";import"./XCircle-RMZbZptd.js";import"./ArrowUpRight-CnGG2N1Q.js";import"./ZapSquare-B5l4FlG5.js";import"./Users03--pS_AKxh.js";import"./CheckCircle-CAOK_nhg.js";import"./ChevronLeft-k-DiQ61D.js";import"./ZoomOut-rJJ-xaWS.js";import"./Globe01-KlLmxZ2g.js";import"./FilterLines-K_WBOHf8.js";import"./Palette-CcCpCoEe.js";import"./HardDrive-C7yJ_w8P.js";import"./Stars02-DHgD3n9i.js";import"./Key01-CckfZB0A.js";import"./LinkExternal01-N2hkztS6.js";import"./Monitor01-Bn333I91.js";import"./Sun-DY49aLCe.js";import"./Play-CsIlBltu.js";import"./Settings02-Dg39zp7t.js";import"./Shield01-MKov2U7D.js";import"./Stars01-BAVDvS6u.js";import"./Upload01-CXSIztYx.js";import"./User01-eSBkatOS.js";import"./Users01-BYl8o0Rk.js";import"./Zap-04Dx-3Fy.js";function Yt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:l}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,S=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(N={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=N):N=e[13];let c;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==l||e[18]!==m||e[19]!==u?(c=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=l,e[18]=m,e[19]=u,e[20]=c):c=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==l||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=g,e[26]=n.connections,e[27]=l,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=de("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zt,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Ye,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Jt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==c||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:c,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=c,e[49]=k,e[50]=B):B=e[50],B}function Jt(v){return v.stopPropagation()}function Zt(v){return v.stopPropagation()}function en(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:l,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:S}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let c;e[2]!==n||e[3]!==h||e[4]!==l||e[5]!==p?(c=n<p?t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",p,")"]}):t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=l,e[5]=p,e[6]=c):c=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Je,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(M,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==S?(_=t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:S,children:k}),e[15]=S,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==c||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,c,j,d,_]})}),e[17]=N,e[18]=c,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function tn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[l,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Ue,{children:[t.jsx(He,{children:"Add to Agent"}),t.jsx(Re,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==l?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(ft,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=l,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let S;e[6]!==p?(S=t.jsx(M,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=S):S=e[7];const N=!l;let c;e[8]!==m||e[9]!==p||e[10]!==l?(c=()=>{l&&(m(l),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=l,e[11]=c):c=e[11];let j;e[12]!==N||e[13]!==c?(j=t.jsx(M,{disabled:N,onClick:c,children:"Add"}),e[12]=N,e[13]=c,e[14]=j):j=e[14];let d;e[15]!==S||e[16]!==j?(d=t.jsxs(Ke,{children:[S,j]}),e[15]=S,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function nn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,l=u!==1?"s":"";let h;e[0]!==u||e[1]!==l?(h=t.jsxs(Ie,{children:["Delete ",u," connection",l,"?"]}),e[0]=u,e[1]=l,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Oe,{children:"Cancel"}),e[8]=S):S=e[8];const N=u!==1?"s":"";let c;e[9]!==u||e[10]!==m||e[11]!==N?(c=t.jsxs($e,{children:[S,t.jsxs(ze,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=c):c=e[12];let j;e[13]!==x||e[14]!==c?(j=t.jsxs(Ee,{children:[x,c]}),e[13]=x,e[14]=c,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function sn(v){return v._registryId?.includes("community-registry")===!0}function on(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:l,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[S,N]=X.useState(null);let c,j;e[0]!==m||e[1]!==n?(c=Te(n)??"",j=m.has(c),e[0]=m,e[1]=n,e[2]=c,e[3]=j):(c=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||_t(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==c){let b;e[10]!==c?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===c,e[10]=c,e[11]=b):b=e[11],s=u.filter(b),e[7]=u,e[8]=c,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=sn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const b=A[0];b&&h(b);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==S?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),S==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=S,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let q;e[35]!==p||e[36]!==l||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(M,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:l!==null,onClick:b=>{b.stopPropagation(),L()},children:l===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=l,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==R||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[R,q]}),e[41]=R,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Oe,{children:"Cancel"}),e[49]=H):H=e[49];let z;e[50]!==C?(z=t.jsxs(Ee,{children:[O,t.jsxs($e,{children:[H,t.jsx(ze,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=z):z=e[51];let r;e[52]!==y||e[53]!==z?(r=t.jsx(Me,{open:y,onOpenChange:x,children:z}),e[52]=y,e[53]=z,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function an({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:l}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),S=Et(v),N=jt(),{granted:c}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,U]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Mt(),w=S.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=xt(w),B=o=>{k(a=>{const E=new Set(a);return E.has(o)?E.delete(o):E.add(o),E})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,R=Ct(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(S.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],H=e==="connected"||f?L:[],z=async o=>{if(!(!l||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=bt(o,l.id,y.user.id,{remoteIndex:0}),E=a.connection_type==="STDIO",T=!!a.connection_url,G=E&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${l.slug}/mcp/${K}`,window.location.origin),be=await Ft({url:_e.href,token:null,orgId:l.id});if(be.supportsOAuth&&!be.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await Vt({connectionId:K,orgSlug:l.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${l.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:lt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Bt(),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===l.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},b=async()=>{U(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const E of o)try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:E,force:!0}),a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let E=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),E++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${E} connection${E!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const E=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!E.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:o,data:{connections:[...a.connections,...T]}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===l.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...N}),t.jsx(nn,{open:D,onOpenChange:U,count:d.size,onConfirm:b}),t.jsx(tn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:c?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(o=>{if(o.type==="group")return t.jsx(Yt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,E=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),className:de(E&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:E,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}})},children:[t.jsx(Ye,{size:16}),"Open"]}),(c||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),c&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Rt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Kt,{size:16}),"Enable"]})),c&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(on,{item:o,canManage:c,allConnections:S,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),onConnect:z},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(en,{count:d.size,total:w.length,canManage:c,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function cn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=It(),{granted:l}=Ce("connections:manage"),h=vt({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[S,N]=X.useState("ALL"),[c,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=ht(),U=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(Xt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:U}),L=l&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,H=null,z=null;i.ui_type==="NPX"?(f="STDIO",O="",z=Gt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",z=Qt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",H=i.connection_token||null);const r=dt("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:z,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},R=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,z=!!s.formState.dirtyFields.env_vars,r=b=>{if(b&&(!O&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!z&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=b.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=qt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const b=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:b,connectionUrl:f})??Ne({uiType:b,connectionUrl:f,registryItems:U}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(M,{variant:"outline",onClick:B,children:[t.jsx(Je,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Y,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Pt,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx(Lt,{children:t.jsx(Ot,{})})}),t.jsxs($t,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(Y,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Y,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(Y,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Y,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Wt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(Y,{control:s.control,name:"title",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"description",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(zt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),z=L;return m?t.jsx(St,{open:z,onOpenChange:Q,children:t.jsxs(Nt,{className:"max-h-[90vh]",children:[t.jsx(kt,{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(Dt,{children:i}),t.jsx(At,{className:"mt-1",children:f})]}),t.jsx(wt,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(Tt,{children:t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:z,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(He,{children:i}),t.jsx(Re,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ke,{children:[t.jsx(M,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(mt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:S,onChange:i=>N(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:c,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(pt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(an,{listState:h,activeTab:y,typeFilter:S,statusFilter:c,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Us(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(cn,{})})}),v[0]=e):e=v[0],e}export{Us as default};
1
+ import{e as ce,j as t,E as tt,r as X,l as le,p as ke,f as De,d as nt,b as Ae,u as st,o as ot,L as it,G as at,H as ct,B as M,t as ne,F as rt,c as de,n as W,K as lt}from"./index-3ttoiVWU.js";import{g as dt}from"./generate-id-yj5Hc06j.js";import{C as mt}from"./collection-display-button-BAzLR9Of.js";import{S as ut}from"./search-input-DZtcJZGI.js";import{C as pt}from"./collection-tabs-BDWQ17XJ.js";import{u as ht,a as we,g as xt,C as ve}from"./connection-card-BjkWUX4T.js";import{E as gt}from"./empty-state-C_DVBzcU.js";import{I as ft}from"./integration-icon-BRZNp1S0.js";import{P as pe}from"./index-B0th8sGF.js";import{u as jt,D as yt}from"./use-delete-connection-DP7dz4xf.js";import{u as Ce}from"./use-capability-CVFP3WhT.js";import{u as Ct}from"./use-infinite-scroll--_mmqYnT.js";import{u as vt}from"./use-list-state-DsyTKO23.js";import{g as Te,a as _t,e as bt}from"./extract-connection-data-bssph-WQ.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Oe,e as $e,g as ze,a as Ee,A as Me}from"./alert-dialog-DU_hTH_e.js";import{C as Fe}from"./checkbox-DxApZ9yh.js";import{D as Ve,a as Be,b as Ue,c as He,e as Re,d as Ke}from"./dialog-B2mbqsst.js";import{b as St,a as Nt,c as kt,D as Dt,d as At,e as wt,f as Tt}from"./drawer-iJV16qgy.js";import{u as It}from"./tooltip-FBNw4nVO.js";import{D as We,a as Xe,b as qe,c as ae}from"./dropdown-menu-D2SV-kWF.js";import{F as Y,b as J,c as Z,d as ee,f as te,a as Se}from"./form-CU3vQdRi.js";import{I as ie}from"./input-DVih3Sjm.js";import{d as Pt,S as Lt,a as Ot,b as $t,c as re}from"./select-C8qI9qzJ.js";import{T as zt}from"./textarea-RmWXPTvx.js";import{b as Ge,u as Et}from"./use-connection-DYg5H00C.js";import{a as Mt}from"./use-virtual-mcp-BgfAZ5Jr.js";import{i as Ft,a as Vt}from"./mcp-oauth-BQWbsE1s.js";import{u as Bt}from"./studio-tools-C7SlPTsZ.js";import{S as Ut,a6 as Ht,u as Rt,r as Kt}from"./agent-icon-rbRaklR8.js";import{n as ge}from"./Container-BGdfxKsK.js";import{i as Qe}from"./DotsVertical-BhoFPdMN.js";import{s as Ye}from"./Eye-DcL-kKgm.js";import{s as ye}from"./Star01-DgOBkoy7.js";import{s as Je}from"./Plus-_ThoLvvV.js";import{s as Ze}from"./Trash01-4Tg-x6Q1.js";import{s as et}from"./XClose-BFJ573RS.js";import{i as he,a as Ne,E as Wt,c as Xt,p as qt,b as Gt,d as Qt}from"./connection-form-helpers-DTy5Iwrw.js";import"./collections-DFjqouMx.js";import"./SwitchHorizontal01-DHHfKBMD.js";import"./Check-Cb8huOHH.js";import"./view-mode-toggle-dEyORvRn.js";import"./badge-B2khBz0-.js";import"./SearchMd-D6F8AHrW.js";import"./use-registry-connections-CMrhWNW5.js";import"./use-mcp-client-CLwLq9Vl.js";import"./auth-DOEa4Xg-.js";import"./use-organization-settings-25l1s_BF.js";import"./useInfiniteQuery-mF7h7Kib.js";import"./card-C0ZJxFoq.js";import"./sidebar-CeOOq5ye.js";import"./LayoutLeft-hGFocSnW.js";import"./sheet-B6uVK7Gd.js";import"./X-BRH2Y8Wq.js";import"./use-view-mode-BrzlZey1.js";import"./ChevronRight-D0iMeTJ5.js";import"./label-C0uUNmvX.js";import"./ChevronDown-D_ybfzhh.js";import"./ChevronUp-BXLaNqVW.js";import"./use-collections-BENY1kCP.js";import"./AlertCircle-Bdl8L7il.js";import"./Tool01-BLdHAOru.js";import"./RefreshCcw01-CyAHVf6q.js";import"./XCircle-CShXLucc.js";import"./ArrowUpRight-C4gNBzMY.js";import"./ZapSquare-Cz0n89qc.js";import"./Users03-DE6tDcyz.js";import"./CheckCircle-CGJnw6dP.js";import"./ChevronLeft-CBi5hL_n.js";import"./ZoomOut-CqeB-Ycx.js";import"./Globe01-BX4SSb6A.js";import"./FilterLines-DSwseOu_.js";import"./Palette-EMfX7hNs.js";import"./HardDrive-DcbBi9w_.js";import"./Stars02-AWskXgtc.js";import"./Key01-R_z_EgAZ.js";import"./LinkExternal01-DQiI5oxv.js";import"./Monitor01-CRf7BSF8.js";import"./Sun-Ddl5HYpL.js";import"./Play-mcRrv0lp.js";import"./Settings02-B100KruV.js";import"./Shield01-DxJYzxVh.js";import"./Stars01-CF50N3iu.js";import"./Upload01-CBpPl05N.js";import"./User01-CChZgMNn.js";import"./Users01-CxX1e6cq.js";import"./Zap-ZgVQTmT-.js";function Yt(v){const e=ce.c(51),{group:n,onOpen:p,selectionMode:u,selectedIds:m,onToggleSelect:l}=v;let h;if(e[0]!==n.connections||e[1]!==m){let C;e[3]!==m?(C=P=>m.has(P.id),e[3]=m,e[4]=C):C=e[4],h=n.connections.every(C),e[0]=n.connections,e[1]=m,e[2]=h}else h=e[2];const g=h;let y;if(e[5]!==n.connections||e[6]!==m){let C;e[8]!==m?(C=P=>m.has(P.id),e[8]=m,e[9]=C):C=e[9],y=n.connections.some(C),e[5]=n.connections,e[6]=m,e[7]=y}else y=e[7];const x=y,S=`${n.connections.length} instances`;let N;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(N={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=N):N=e[13];let c;e[14]!==g||e[15]!==n.connections||e[16]!==p||e[17]!==l||e[18]!==m||e[19]!==u?(c=()=>u?(()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)})():p(),e[14]=g,e[15]=n.connections,e[16]=p,e[17]=l,e[18]=m,e[19]=u,e[20]=c):c=e[20];const j=u&&g&&"ring-2 ring-primary",d=u&&x&&!g&&"ring-1 ring-primary/50";let k;e[21]!==j||e[22]!==d?(k=de(j,d),e[21]=j,e[22]=d,e[23]=k):k=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==g||e[26]!==n.connections||e[27]!==l||e[28]!==m||e[29]!==u||e[30]!==x?(D=u?t.jsx(Fe,{checked:g?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)g?m.has(C.id)&&l(C.id):m.has(C.id)||l(C.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=g,e[26]=n.connections,e[27]=l,e[28]=m,e[29]=u,e[30]=x,e[31]=D):D=e[31];const U=u?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let F;e[32]!==U?(F=de("overflow-hidden transition-all duration-150 ease-out",U),e[32]=U,e[33]=F):F=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Zt,children:t.jsx(Qe,{size:20})})}),e[34]=s):s=e[34];let A;e[35]!==p?(A=C=>{C.stopPropagation(),p()},e[35]=p,e[36]=A):A=e[36];let V;e[37]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(Ye,{size:16}),e[37]=V):V=e[37];let $;e[38]!==A?($=t.jsxs(We,{children:[s,t.jsx(qe,{align:"end",onClick:Jt,children:t.jsxs(ae,{onClick:A,children:[V,"Open"]})})]}),e[38]=A,e[39]=$):$=e[39];let w;e[40]!==F||e[41]!==$?(w=t.jsx("div",{className:F,children:$}),e[40]=F,e[41]=$,e[42]=w):w=e[42];let L;e[43]!==D||e[44]!==w?(L=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=L):L=e[45];let B;return e[46]!==L||e[47]!==N||e[48]!==c||e[49]!==k?(B=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:N,onClick:c,className:k,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:L})}),e[46]=L,e[47]=N,e[48]=c,e[49]=k,e[50]=B):B=e[50],B}function Jt(v){return v.stopPropagation()}function Zt(v){return v.stopPropagation()}function en(v){const e=ce.c(23),{count:n,total:p,canManage:u,canManageAgents:m,onSelectAll:l,onDeselectAll:h,onDelete:g,onAddToAgent:y,onToggleStatus:x,onCancel:S}=v;if(n===0)return null;let N;e[0]!==n?(N=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=N):N=e[1];let c;e[2]!==n||e[3]!==h||e[4]!==l||e[5]!==p?(c=n<p?t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",p,")"]}):t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:"Clear selection"}),e[2]=n,e[3]=h,e[4]=l,e[5]=p,e[6]=c):c=e[6];let j;e[7]!==m||e[8]!==y?(j=m&&t.jsxs(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:y,children:[t.jsx(Je,{size:13}),"Add to Agent"]}),e[7]=m,e[8]=y,e[9]=j):j=e[9];let d;e[10]!==u||e[11]!==g||e[12]!==x?(d=u&&t.jsxs(t.Fragment,{children:[t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("active"),children:"Enable"}),t.jsx(M,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>x("inactive"),children:"Disable"}),t.jsxs(M,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:[t.jsx(Ze,{size:13}),"Delete"]})]}),e[10]=u,e[11]=g,e[12]=x,e[13]=d):d=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(et,{size:13}),e[14]=k):k=e[14];let _;e[15]!==S?(_=t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:S,children:k}),e[15]=S,e[16]=_):_=e[16];let D;return e[17]!==N||e[18]!==c||e[19]!==j||e[20]!==d||e[21]!==_?(D=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[N,c,j,d,_]})}),e[17]=N,e[18]=c,e[19]=j,e[20]=d,e[21]=_,e[22]=D):D=e[22],D}function tn(v){const e=ce.c(25),{open:n,onOpenChange:p,agents:u,onConfirm:m}=v,[l,h]=X.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsxs(Ue,{children:[t.jsx(He,{children:"Add to Agent"}),t.jsx(Re,{children:"Select an agent to add the selected connections to."})]}),e[0]=g):g=e[0];let y;e[1]!==u||e[2]!==l?(y=u.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):u.map(D=>t.jsxs("button",{type:"button",onClick:()=>h(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(ft,{icon:D.icon,name:D.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[1]=u,e[2]=l,e[3]=y):y=e[3];let x;e[4]!==y?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:y}),e[4]=y,e[5]=x):x=e[5];let S;e[6]!==p?(S=t.jsx(M,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=S):S=e[7];const N=!l;let c;e[8]!==m||e[9]!==p||e[10]!==l?(c=()=>{l&&(m(l),p(!1),h(null))},e[8]=m,e[9]=p,e[10]=l,e[11]=c):c=e[11];let j;e[12]!==N||e[13]!==c?(j=t.jsx(M,{disabled:N,onClick:c,children:"Add"}),e[12]=N,e[13]=c,e[14]=j):j=e[14];let d;e[15]!==S||e[16]!==j?(d=t.jsxs(Ke,{children:[S,j]}),e[15]=S,e[16]=j,e[17]=d):d=e[17];let k;e[18]!==x||e[19]!==d?(k=t.jsxs(Be,{className:"sm:max-w-[400px]",children:[g,x,d]}),e[18]=x,e[19]=d,e[20]=k):k=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==k?(_=t.jsx(Ve,{open:n,onOpenChange:p,children:k}),e[21]=p,e[22]=n,e[23]=k,e[24]=_):_=e[24],_}function nn(v){const e=ce.c(20),{open:n,onOpenChange:p,count:u,onConfirm:m}=v,l=u!==1?"s":"";let h;e[0]!==u||e[1]!==l?(h=t.jsxs(Ie,{children:["Delete ",u," connection",l,"?"]}),e[0]=u,e[1]=l,e[2]=h):h=e[2];const g=u!==1?"s":"";let y;e[3]!==g?(y=t.jsxs(Pe,{children:["This will permanently delete the selected connection",g,". This action cannot be undone."]}),e[3]=g,e[4]=y):y=e[4];let x;e[5]!==h||e[6]!==y?(x=t.jsxs(Le,{children:[h,y]}),e[5]=h,e[6]=y,e[7]=x):x=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Oe,{children:"Cancel"}),e[8]=S):S=e[8];const N=u!==1?"s":"";let c;e[9]!==u||e[10]!==m||e[11]!==N?(c=t.jsxs($e,{children:[S,t.jsxs(ze,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",u," connection",N]})]}),e[9]=u,e[10]=m,e[11]=N,e[12]=c):c=e[12];let j;e[13]!==x||e[14]!==c?(j=t.jsxs(Ee,{children:[x,c]}),e[13]=x,e[14]=c,e[15]=j):j=e[15];let d;return e[16]!==p||e[17]!==n||e[18]!==j?(d=t.jsx(Me,{open:n,onOpenChange:p,children:j}),e[16]=p,e[17]=n,e[18]=j,e[19]=d):d=e[19],d}function sn(v){return v._registryId?.includes("community-registry")===!0}function on(v){const e=ce.c(58),{item:n,canManage:p,allConnections:u,connectedAppNames:m,connectingItemId:l,onNavigateConnected:h,onConnect:g}=v,[y,x]=X.useState(!1),[S,N]=X.useState(null);let c,j;e[0]!==m||e[1]!==n?(c=Te(n)??"",j=m.has(c),e[0]=m,e[1]=n,e[2]=c,e[3]=j):(c=e[2],j=e[3]);const d=j,k=n._meta?.["mcp.mesh"],_=k?.friendlyName||k?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let U;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(U=n.server?.icons?.[0]?.src||_t(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=U):U=e[6];const F=U;let s;if(e[7]!==u||e[8]!==c){let b;e[10]!==c?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===c,e[10]=c,e[11]=b):b=e[11],s=u.filter(b),e[7]=u,e[8]=c,e[9]=s}else s=e[9];const A=s;let V;e[12]!==n?(V=sn(n),e[12]=n,e[13]=V):V=e[13];const $=V;let w,L;e[14]!==A||e[15]!==p||e[16]!==$||e[17]!==d||e[18]!==n||e[19]!==g||e[20]!==h?(w=()=>{if(d){const b=A[0];b&&h(b);return}p&&L()},L=()=>{$?(N("connect"),x(!0)):g(n)},e[14]=A,e[15]=p,e[16]=$,e[17]=d,e[18]=n,e[19]=g,e[20]=h,e[21]=w,e[22]=L):(w=e[21],L=e[22]);let B;e[23]!==n||e[24]!==g||e[25]!==S?(B=()=>{ne("connections_community_warning_confirmed",{registry_item_id:n.id}),x(!1),S==="connect"&&g(n),N(null)},e[23]=n,e[24]=g,e[25]=S,e[26]=B):B=e[26];const C=B;let P;e[27]!==D||e[28]!==F||e[29]!==_?(P={title:_,description:D,icon:F},e[27]=D,e[28]=F,e[29]=_,e[30]=P):P=e[30];let Q;e[31]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ge,{}),e[31]=Q):Q=e[31];let R;e[32]!==$||e[33]!==n._sourceIcon?(R=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=$,e[33]=n._sourceIcon,e[34]=R):R=e[34];let q;e[35]!==p||e[36]!==l||e[37]!==L||e[38]!==d||e[39]!==n.id?(q=d?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(M,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:l!==null,onClick:b=>{b.stopPropagation(),L()},children:l===n.id?t.jsx(le,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=l,e[37]=L,e[38]=d,e[39]=n.id,e[40]=q):q=e[40];let i;e[41]!==R||e[42]!==q?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[R,q]}),e[41]=R,e[42]=q,e[43]=i):i=e[43];let f;e[44]!==w||e[45]!==i||e[46]!==P?(f=t.jsx(ve,{connection:P,fallbackIcon:Q,onClick:w,headerActionsAlwaysVisible:!0,headerActions:i}),e[44]=w,e[45]=i,e[46]=P,e[47]=f):f=e[47];let O;e[48]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsxs(Le,{children:[t.jsx(Ie,{children:"Community MCP Server"}),t.jsx(Pe,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[48]=O):O=e[48];let H;e[49]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(Oe,{children:"Cancel"}),e[49]=H):H=e[49];let z;e[50]!==C?(z=t.jsxs(Ee,{children:[O,t.jsxs($e,{children:[H,t.jsx(ze,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=z):z=e[51];let r;e[52]!==y||e[53]!==z?(r=t.jsx(Me,{open:y,onOpenChange:x,children:z}),e[52]=y,e[53]=z,e[54]=r):r=e[54];let I;return e[55]!==f||e[56]!==r?(I=t.jsxs(t.Fragment,{children:[f,r]}),e[55]=f,e[56]=r,e[57]=I):I=e[57],I}function an({listState:v,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:u,enabledRegistries:m}){const{org:l}=ke(),h=rt(),g=De(),{data:y}=Ae.useSession(),x=Ge(),S=Et(v),N=jt(),{granted:c}=Ce("connections:manage"),{granted:j}=Ce("agents:manage"),[d,k]=X.useState(new Set),_=d.size>0,[D,U]=X.useState(!1),[F,s]=X.useState(!1),[A,V]=X.useState(null),$=Mt(),w=S.filter(o=>!(n!=="ALL"&&o.connection_type!==n||p!=="ALL"&&o.status!==p)),L=xt(w),B=o=>{k(a=>{const E=new Set(a);return E.has(o)?E.delete(o):E.add(o),E})},C=()=>{k(new Set)},P=we(m,v.searchTerm),Q=P.items,R=Ct(P.loadMore,P.hasMore,P.isLoadingMore),q=new Set(S.filter(o=>o.app_name).map(o=>o.app_name)),i=u==="ALL"||m.some(o=>o.id===u)?u:"ALL",f=v.search.length>0,O=e==="all"||f?Q.filter(o=>{if(i!=="ALL"&&o._registryId!==i)return!1;if(f){const a=Te(o);if(a&&q.has(a))return!1}return!0}):[],H=e==="connected"||f?L:[],z=async o=>{if(!(!l||!y?.user?.id)){ne("connection_add_clicked",{action:"connect_new",registry_item_id:o.id,source:"connections_page"}),V(o.id);try{const a=bt(o,l.id,y.user.id,{remoteIndex:0}),E=a.connection_type==="STDIO",T=!!a.connection_url,G=E&&a.connection_headers&&typeof a.connection_headers=="object"&&"command"in a.connection_headers;if(!T&&!G){W.error("This MCP Server cannot be connected: no connection method available"),V(null);return}const{id:K}=await x.create.mutateAsync(a),_e=new URL(`/api/${l.slug}/mcp/${K}`,window.location.origin),be=await Ft({url:_e.href,token:null,orgId:l.id});if(be.supportsOAuth&&!be.isAuthenticated){const{token:ue,tokenInfo:oe,error:je}=await Vt({connectionId:K,orgSlug:l.slug,scope:"offline_access"});if(je||!ue){ne("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:je??"no_token"}),W.error(`Authentication failed: ${je??"no token received"}`);return}else{if(ne("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),oe)try{(await fetch(`/api/${l.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:oe.accessToken,refreshToken:oe.refreshToken,expiresIn:oe.expiresIn,scope:oe.scope,clientId:oe.clientId,clientSecret:oe.clientSecret,tokenEndpoint:oe.tokenEndpoint})})).ok?await x.update.mutateAsync({id:K,data:{}}):await x.update.mutateAsync({id:K,data:{connection_token:ue}})}catch{await x.update.mutateAsync({id:K,data:{connection_token:ue}})}else await x.update.mutateAsync({id:K,data:{connection_token:ue}});await h.invalidateQueries({queryKey:lt.isMCPAuthenticated(_e.href,null)}),W.success("Authentication successful")}}W.success("Connected successfully")}catch(a){W.error(`Failed to connect: ${a instanceof Error?a.message:String(a)}`)}finally{V(null)}}},r=Bt(),I=()=>{h.invalidateQueries({predicate:o=>{const a=o.queryKey;return a[1]===l.id&&a[3]==="collection"&&a[4]==="CONNECTIONS"}})},b=async()=>{U(!1);const o=[...d];ne("connections_bulk_delete",{count:o.length});let a=0;for(const E of o)try{await r.call("COLLECTION_CONNECTIONS_DELETE",{id:E,force:!0}),a++}catch{}I(),W.success(`Deleted ${a} connection${a!==1?"s":""}`),C()},se=async(o,a)=>{try{await x.update.mutateAsync({id:o,data:{status:a}}),I(),W.success(a==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},fe=async o=>{const a=[...d];ne("connections_bulk_status_toggled",{count:a.length,to_status:o});let E=0;for(const T of a)try{await x.update.mutateAsync({id:T,data:{status:o}}),E++}catch{}I(),W.success(`${o==="active"?"Enabled":"Disabled"} ${E} connection${E!==1?"s":""}`),C()},me=async o=>{const a=$.find(G=>G.id===o);if(!a)return;ne("connections_bulk_add_to_agent",{agent_id:o,count:d.size});const E=new Set(a.connections.map(G=>G.connection_id)),T=[...d].filter(G=>!E.has(G)).map(G=>({connection_id:G,selected_tools:null,selected_resources:null,selected_prompts:null}));if(T.length===0){W.info("All selected connections are already in that agent");return}try{await r.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:o,data:{connections:[...a.connections,...T]}}),h.invalidateQueries({predicate:G=>{const K=G.queryKey;return K[1]===l.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),W.success(`Added ${T.length} connection${T.length!==1?"s":""} to "${a.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...N}),t.jsx(nn,{open:D,onOpenChange:U,count:d.size,onConfirm:b}),t.jsx(tn,{open:F,onOpenChange:s,agents:$,onConfirm:me}),P.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(f?O.length===0&&w.length===0:e==="all"?O.length===0:w.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:v.search?`No Connections match "${v.search}"`:c?"Create a connection to get started.":"Ask an organization admin to add one."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[H.map(o=>{if(o.type==="group")return t.jsx(Yt,{group:o,onOpen:()=>{g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:o.key}})},selectionMode:_,selectedIds:d,onToggleSelect:B},o.key);const a=o.connection,E=d.has(a.id);return t.jsx(ve,{connection:a,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?B(a.id):g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),className:de(E&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:E,onCheckedChange:()=>B(a.id),onClick:T=>T.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:de("overflow-hidden transition-all duration-150 ease-out",_?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(We,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:T=>T.stopPropagation(),children:t.jsx(Qe,{size:20})})}),t.jsxs(qe,{align:"end",onClick:T=>T.stopPropagation(),children:[t.jsxs(ae,{onClick:T=>{T.stopPropagation(),g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}})},children:[t.jsx(Ye,{size:16}),"Open"]}),(c||j)&&t.jsxs(ae,{onClick:T=>{T.stopPropagation(),B(a.id)},children:[t.jsx(Ht,{size:16}),"Select"]}),c&&(a.status==="active"?t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"inactive")},children:[t.jsx(Rt,{size:16}),"Disable"]}):t.jsxs(ae,{onClick:T=>{T.stopPropagation(),se(a.id,"active")},children:[t.jsx(Kt,{size:16}),"Enable"]})),c&&t.jsxs(ae,{variant:"destructive",onClick:T=>{T.stopPropagation(),N.requestDelete(a)},children:[t.jsx(Ze,{size:16}),"Delete"]})]})]})})]})},a.id)}),O.map(o=>t.jsx(on,{item:o,canManage:c,allConnections:S,connectedAppNames:q,connectingItemId:A,onNavigateConnected:a=>g({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(a)}}),onConnect:z},`catalog-${o._registryId}:${o.id}`)),(e==="all"||f)&&m.length>0&&t.jsx("div",{ref:R,className:"col-span-full h-4"}),(e==="all"||f)&&P.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(le,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(en,{count:d.size,total:w.length,canManage:c,canManageAgents:j,onSelectAll:()=>{k(new Set(w.map(o=>o.id)))},onDeselectAll:()=>k(new Set),onDelete:()=>U(!0),onAddToAgent:()=>s(!0),onToggleStatus:fe,onCancel:C})]})}function cn(){const{org:v}=ke(),e=De(),n=nt({strict:!1}),{data:p}=Ae.useSession(),{stdioEnabled:u}=st(),m=It(),{granted:l}=Ce("connections:manage"),h=vt({namespace:v.slug,resource:"connections"}),g=Ge(),[y,x]=ot(it.connectionsTab(v.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[S,N]=X.useState("ALL"),[c,j]=X.useState("ALL"),[d,k]=X.useState("ALL"),_=ht(),U=we(_,h.searchTerm).items,F=h.search!==h.searchTerm,s=at({resolver:ct(Xt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),A=s.watch("ui_type"),V=s.watch("connection_url"),$=s.watch("npx_package"),w=he({uiType:A,connectionUrl:V??"",npxPackage:$??""})??Ne({uiType:A,connectionUrl:V??"",registryItems:U}),L=l&&n.action==="create",B=()=>{ne("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:v.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:v.slug},search:{}})},P=async i=>{let f,O=null,H=null,z=null;i.ui_type==="NPX"?(f="STDIO",O="",z=Gt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(f="STDIO",O="",z=Qt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(f=i.ui_type,O=i.connection_url||"",H=i.connection_token||null);const r=dt("conn");ne("connection_custom_created",{connection_type:f,ui_type:i.ui_type}),await g.create.mutateAsync({id:r,title:i.title,description:i.description||null,connection_type:f,connection_url:O,connection_token:H,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:v.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:z,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),C(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:v.slug,appSlug:xe({app_name:null,connection_url:O,title:i.title,id:r})}})},Q=i=>{i||(L&&C(),s.reset())},R=i=>{const f=i.trim();if(!f)return;const O=!!s.formState.dirtyFields.title,H=!!s.formState.dirtyFields.description,z=!!s.formState.dirtyFields.env_vars,r=b=>{if(b&&(!O&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!H&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!z&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],fe=new Set(se.map(o=>o.key)),me=b.envVarKeys.filter(o=>!fe.has(o));me.length>0&&s.setValue("env_vars",[...se,...me.map(o=>({key:o,value:""}))],{shouldDirty:!0})}},I=qt(f);if(I&&u){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",I.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),r(he({uiType:"NPX",npxPackage:I.packageName}));return}if(f.startsWith("http://")||f.startsWith("https://")){const b=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",f,{shouldDirty:!0}),r(he({uiType:b,connectionUrl:f})??Ne({uiType:b,connectionUrl:f,registryItems:U}));return}A==="NPX"&&r(he({uiType:"NPX",npxPackage:f}))},q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(M,{variant:"outline",onClick:B,children:[t.jsx(Je,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const i="Create Connection",f="Create a custom connection in your organization. Fill in the details below.",O=s.formState.isSubmitting?"Saving...":"Create Connection",H=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Y,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Type *"}),t.jsxs(Pt,{value:r.value,onValueChange:r.onChange,children:[t.jsx(ee,{children:t.jsx(Lt,{children:t.jsx(Ot,{})})}),t.jsxs($t,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(te,{})]})}),A==="NPX"&&t.jsx(Y,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"NPM Package *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Y,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Command *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"node, bun, python...",...r,value:r.value??""})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Arguments"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...r,value:r.value??""})}),t.jsx(te,{})]})})]}),t.jsx(Y,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Working Directory"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...r,value:r.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(te,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Y,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Environment Variables"}),t.jsx(ee,{children:t.jsx(Wt,{value:r.value??[],onChange:r.onChange})}),t.jsx(te,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{control:s.control,name:"connection_url",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"URL *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...r,value:r.value??"",onPaste:I=>{const b=I.clipboardData.getData("text");b&&(I.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),R(b))},onBlur:I=>{R(I.target.value),r.onBlur()}})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:w?.token?.label??"Token (optional)"}),t.jsx(ee,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...r,value:r.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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:"Open GitHub PAT settings"})]})]}),t.jsx(te,{})]})})]}),t.jsx(Y,{control:s.control,name:"title",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Name *"}),t.jsx(ee,{children:t.jsx(ie,{placeholder:"My Connection",...r})}),t.jsx(te,{})]})}),t.jsx(Y,{control:s.control,name:"description",render:({field:r})=>t.jsxs(J,{children:[t.jsx(Z,{children:"Description"}),t.jsx(ee,{children:t.jsx(zt,{placeholder:"A brief description of this connection",rows:3,...r,value:r.value??""})}),t.jsx(te,{})]})})]}),z=L;return m?t.jsx(St,{open:z,onOpenChange:Q,children:t.jsxs(Nt,{className:"max-h-[90vh]",children:[t.jsx(kt,{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(Dt,{children:i}),t.jsx(At,{className:"mt-1",children:f})]}),t.jsx(wt,{asChild:!0,children:t.jsx(M,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(et,{size:16})})})]})}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:H}),t.jsx(Tt,{children:t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:O})})]})})]})}):t.jsx(Ve,{open:z,onOpenChange:Q,children:t.jsxs(Be,{className:"sm:max-w-[525px]",children:[t.jsxs(Ue,{children:[t.jsx(He,{children:i}),t.jsx(Re,{children:f})]}),t.jsx(Se,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:H}),t.jsxs(Ke,{children:[t.jsx(M,{type:"button",variant:"outline",onClick:()=>Q(!1),children:"Cancel"}),t.jsx(M,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:O})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ut,{value:h.search,onChange:h.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(h.setSearch(""),i.target.blur())}}),t.jsx(mt,{sortKey:h.sortKey,sortDirection:h.sortDirection,onSort:h.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:S,onChange:i=>N(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:c,onChange:i=>j(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:d,onChange:i=>k(i||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),q]}),t.jsx(pt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:y,onTabChange:i=>{const f=i;f!==y&&ne("connections_page_tab_changed",{to_tab:f}),x(f)}}),t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:F?.5:1,transition:F?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:F?"none":"auto"},children:t.jsx(an,{listState:h,activeTab:y,typeFilter:S,statusFilter:c,registryFilter:d,enabledRegistries:_})})})]})})})]})})}function Us(){const v=ce.c(1);let e;return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(tt,{children:t.jsx(X.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(le,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(cn,{})})}),v[0]=e):e=v[0],e}export{Us as default};
@@ -1,4 +1,4 @@
1
- import{r as L,aR as Qe,e as V,j as s,P as Te,R as re,p as le,F as me,H as Re,G as ze,a as de,K as te,n as Q,B as ee,t as X,u as Je,c as ue,m as Ze,f as et,E as tt,s as st}from"./index-DElySjov.js";import{C as it}from"./checkbox-qrM9_H9O.js";import{I as ne}from"./input-Cdm1NEie.js";import{d as nt,S as lt,a as ot,b as rt,c as at}from"./select-CvY3LM8v.js";import{S as q}from"./skeleton-DOuDuLeH.js";import{a as Pe,i as Le,b as ct,s as dt}from"./RefreshCcw01-DaIOSJey.js";import{b as ut,a as mt,c as ht,d as ft}from"./Tool01-CiezpOWI.js";import{i as pt}from"./Key01-CckfZB0A.js";import{i as $e}from"./SearchMd-DuNbf8h_.js";import{a as xt}from"./Settings02-Dg39zp7t.js";import{c as he,u as gt,b as vt}from"./use-ai-providers-BgB6wf9K.js";import{u as bt,c as yt}from"./chat-context-DqZ1Ibm0.js";import{g as fe}from"./ai-providers-logos-DD3qZ33J.js";import{i as jt}from"./Monitor01-Bn333I91.js";import{i as St}from"./AlertCircle-sZfVKKIU.js";import{d as Fe,D as Nt,a as kt,b as _t,c as wt,e as Ct}from"./dialog-DK12sdoJ.js";import{S as be}from"./spinner-Ct4FnHpR.js";import{a as pe,u as xe}from"./use-mcp-client-4hZRsKeH.js";import{i as It}from"./ChevronRight-CBibu88R.js";import{A as Et}from"./avatar-C15JHojT.js";import{S as ye,a as je,b as Ke}from"./settings-section-bgBc23Sj.js";import{s as De}from"./Eye-BMnHz-k1.js";import{u as Mt}from"./studio-tools-BniDnWv9.js";import{C as Ot}from"./connect-desktop-dialog-CrC9Oh0l.js";import{t as Se}from"./ChevronDown-D6-hnD5Z.js";import{t as At}from"./Stars01-BAVDvS6u.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const p=i();if(!(p.length!==n.length||p.some((v,g)=>n[g]!==v)))return l;n=p;let h;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(h=Date.now()),l=e(...p),t.key&&((d=t.debug)!=null&&d.call(t))){const v=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-h)*100)/100,S=g/16,j=(_,w)=>{for(_=String(_);_.length<w;)_=" "+_;return _};console.info(`%c⏱ ${j(g,5)} /${j(v,5)} ms`,`
1
+ import{r as L,aR as Qe,e as V,j as s,P as Te,R as re,p as le,F as me,H as Re,G as ze,a as de,K as te,n as Q,B as ee,t as X,u as Je,c as ue,m as Ze,f as et,E as tt,s as st}from"./index-3ttoiVWU.js";import{C as it}from"./checkbox-DxApZ9yh.js";import{I as ne}from"./input-DVih3Sjm.js";import{d as nt,S as lt,a as ot,b as rt,c as at}from"./select-C8qI9qzJ.js";import{S as q}from"./skeleton-vEwazeas.js";import{a as Pe,i as Le,b as ct,s as dt}from"./RefreshCcw01-CyAHVf6q.js";import{b as ut,a as mt,c as ht,d as ft}from"./Tool01-BLdHAOru.js";import{i as pt}from"./Key01-R_z_EgAZ.js";import{i as $e}from"./SearchMd-D6F8AHrW.js";import{a as xt}from"./Settings02-B100KruV.js";import{c as he,u as gt,b as vt}from"./use-ai-providers-suUCAMGx.js";import{u as bt,c as yt}from"./chat-context-D-8AD0J7.js";import{g as fe}from"./ai-providers-logos-DD3qZ33J.js";import{i as jt}from"./Monitor01-CRf7BSF8.js";import{i as St}from"./AlertCircle-Bdl8L7il.js";import{d as Fe,D as Nt,a as kt,b as _t,c as wt,e as Ct}from"./dialog-B2mbqsst.js";import{S as be}from"./spinner-2N-kj7x0.js";import{a as pe,u as xe}from"./use-mcp-client-CLwLq9Vl.js";import{i as It}from"./ChevronRight-D0iMeTJ5.js";import{A as Et}from"./avatar-BqZJEvBP.js";import{S as ye,a as je,b as Ke}from"./settings-section-7sN_1nHI.js";import{s as De}from"./Eye-DcL-kKgm.js";import{u as Mt}from"./studio-tools-C7SlPTsZ.js";import{C as Ot}from"./connect-desktop-dialog-C4HCeyrm.js";import{t as Se}from"./ChevronDown-D_ybfzhh.js";import{t as At}from"./Stars01-CF50N3iu.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const p=i();if(!(p.length!==n.length||p.some((v,g)=>n[g]!==v)))return l;n=p;let h;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(h=Date.now()),l=e(...p),t.key&&((d=t.debug)!=null&&d.call(t))){const v=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-h)*100)/100,S=g/16,j=(_,w)=>{for(_=String(_);_.length<w;)_=" "+_;return _};console.info(`%c⏱ ${j(g,5)} /${j(v,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(l),o=!1,l}return r.updateDeps=a=>{n=a},r}function Ne(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Tt=(i,e)=>Math.abs(i-e)<1.01,Rt=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},ke=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},zt=i=>i,Pt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let l=e;l<=t;l++)n.push(l);return n},Lt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const l=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(l(ke(t)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){l({width:d.inlineSize,height:d.blockSize});return}}l(ke(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},_e={passive:!0},we=typeof window>"u"?!0:"onscrollend"in window,$t=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const o=i.options.useScrollendEvent&&we?()=>{}:Rt(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:p,isRtl:f}=i.options;l=p?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(l,u)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,_e);const d=i.options.useScrollendEvent&&we;return d&&t.addEventListener("scrollend",c,_e),()=>{t.removeEventListener("scroll",a),d&&t.removeEventListener("scrollend",c)}},Ft=(i,e,t)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Kt=(i,{adjustments:e=0,behavior:t},n)=>{var l,o;const r=i+e;(o=(l=n.scrollElement)==null?void 0:l.scrollTo)==null||o.call(l,{[n.options.horizontal?"left":"top"]:r,behavior:t})};class Dt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,n,l;return((l=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:l.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var l;(l=n())==null||l.disconnect(),t=null},observe:l=>{var o;return(o=n())==null?void 0:o.observe(l,{box:"border-box"})},unobserve:l=>{var o;return(o=n())==null?void 0:o.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,l])=>{typeof l>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:zt,rangeExtractor:Pt,onChange:()=>{},measureElement:Ft,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var n,l;(l=(n=this.options).onChange)==null||l.call(n,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const l=new Map,o=new Map;for(let r=n-1;r>=0;r--){const a=t[r];if(l.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&l.set(a.lane,!0),l.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,l,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const h of this.laneAssignments.keys())h>=t&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let h=0;h<u;h++){const v=p[h];v&&(f[v.lane]=h)}for(let h=u;h<t;h++){const v=o(h),g=this.laneAssignments.get(h);let S,j;const _=c==="estimate"||d.has(v);if(g!==void 0&&this.options.lanes>1){S=g;const x=f[S],N=x!==void 0?p[x]:void 0;j=N?N.end+this.options.gap:n+l}else{const x=this.options.lanes===1?p[h-1]:this.getFurthestMeasurement(p,h);j=x?x.end+this.options.gap:n+l,S=x?x.lane:h%this.options.lanes,this.options.lanes>1&&_&&this.laneAssignments.set(h,S)}const w=d.get(v),k=typeof w=="number"?w:this.options.estimateSize(h),T=j+k;p[h]={index:h,start:j,size:k,end:T,key:v,lane:S},f[S]=h}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,l,o)=>this.range=t.length>0&&n>0?Ut({measurements:t,outerSize:n,scrollOffset:l,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,n=null;const l=this.calculateRange();return l&&(t=l.startIndex,n=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,l,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:n,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,l=t.getAttribute(n);return l?parseInt(l,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(l!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,l-o),a=Math.min(this.options.count-1,l+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const n=this.indexFromElement(t),l=this.options.getItemKey(n),o=this.elementsCache.get(l);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var l;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=n-r;a!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const l=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=n[a];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return Ne(n[Ue(0,n.length-1,l=>Ne(n[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,l=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=t>=r+o?"end":"start"),n==="center"?t+=(l-o)/2:n==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(n==="auto")if(r.end>=o+l-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,r.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:l="auto"}={})=>{const o=this.getOffsetForAlignment(t,n),r=this.now();this.scrollState={index:null,align:n,behavior:l,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,n);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:l,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const l=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let l;if(n.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=n[n.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&o.some(a=>a===null);){const a=n[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}l=Math.max(...o.filter(a=>a!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=n?n[0]:this.scrollState.lastTargetOffset,o=1,r=l!==this.scrollState.lastTargetOffset;if(!r&&Tt(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ue=(i,e,t,n)=>{for(;i<=e;){const l=(i+e)/2|0,o=t(l);if(o<n)i=l+1;else if(o>n)e=l-1;else return l}return i>0?i-1:0};function Ut({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const l=i.length-1,o=c=>i[c].start;if(i.length<=n)return{startIndex:0,endIndex:l};let r=Ue(0,l,o,t),a=r;if(n===1)for(;a<l&&i[a].end<t+e;)a++;else if(n>1){const c=Array(n).fill(0);for(;a<l&&c.some(u=>u<t+e);){const u=i[a];c[u.lane]=u.end,a++}const d=Array(n).fill(t+e);for(;r>=0&&d.some(u=>u>=t);){const u=i[r];d[u.lane]=u.start,r--}r=Math.max(0,r-r%n),a=Math.min(l,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const Ce=typeof document<"u"?L.useLayoutEffect:L.useEffect;function Bt({useFlushSync:i=!0,...e}){const t=L.useReducer(()=>({}),{})[1],n={...e,onChange:(o,r)=>{var a;i&&r?Qe.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[l]=L.useState(()=>new Dt(n));return l.setOptions(n),Ce(()=>l._didMount(),[]),Ce(()=>l._willUpdate()),l}function Wt(i){return Bt({observeElementRect:Lt,observeElementOffset:$t,scrollToFn:Kt,...i})}const ae=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function Ie(i){if(i)return ae.find(e=>e.id===i)}const Ee=4;function oe(i){const e=V.c(8),{logo:t,name:n,description:l,onClick:o}=i;let r;e[0]!==t||e[1]!==n?(r=t?s.jsx("img",{src:t,alt:n,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Et,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=n,e[2]=r):r=e[2];let a;return e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx(Ke,{onClick:o,icon:r,title:n,description:l}),e[3]=l,e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Be(i){const e=V.c(32),{providers:t,onSelect:n,onShowAll:l}=i;let o;e[0]!==t?(o=t.find(Yt),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,anthropic:1,google:2},e[2]=a):a=e[2];const c=a;let d;if(e[3]!==n||e[4]!==t){let w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w=(b,A)=>{const E=c[b.id]??Number.MAX_SAFE_INTEGER,O=c[A.id]??Number.MAX_SAFE_INTEGER;return E-O},e[6]=w):w=e[6];const k=t.filter(Gt).sort(w);let T;e[7]!==t?(T=t.find(qt),e[7]=t,e[8]=T):T=e[8];const x=T;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=ae.find(Ht),e[9]=N):N=e[9];const C=N;let I;e[10]!==n?(I=b=>s.jsx(oe,{logo:b.logo,name:b.name,description:b.description,onClick:()=>n({kind:"provider",provider:b})},b.id),e[10]=n,e[11]=I):I=e[11];let m,y;e[12]!==n||e[13]!==x?(m=x&&C?[s.jsx(oe,{logo:C.logo,name:C.name,description:C.description,onClick:()=>n({kind:"openai-compatible",provider:x,preset:C})},C.id)]:[],y=x?[...ae.filter(Vt).map(b=>s.jsx(oe,{logo:b.logo,name:b.name,description:b.description,onClick:()=>n({kind:"openai-compatible",provider:x,preset:b})},b.id)),s.jsx(oe,{logo:x.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[12]=n,e[13]=x,e[14]=m,e[15]=y):(m=e[14],y=e[15]),d=[...k.map(I),...m,...y],e[3]=n,e[4]=t,e[5]=d}else d=e[5];const u=d,p=u.length-Ee,f=!!l&&p>0;let h;e[16]!==u||e[17]!==f?(h=f?u.slice(0,Ee):u,e[16]=u,e[17]=f,e[18]=h):h=e[18];const v=h;let g;e[19]!==r||e[20]!==n?(g=r&&s.jsx(ye,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(je,{className:"relative",children:s.jsx(oe,{logo:r.logo,name:r.name,description:r.description,onClick:()=>n({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=n,e[21]=g):g=e[21];let S;e[22]!==p||e[23]!==l||e[24]!==f?(S=f&&s.jsx(Ke,{onClick:l,title:`${p} more provider${p===1?"":"s"}`,action:s.jsx(It,{size:16,className:"text-muted-foreground"})}),e[22]=p,e[23]=l,e[24]=f,e[25]=S):S=e[25];let j;e[26]!==S||e[27]!==v?(j=s.jsx(ye,{children:s.jsxs(je,{children:[v,S]})}),e[26]=S,e[27]=v,e[28]=j):j=e[28];let _;return e[29]!==g||e[30]!==j?(_=s.jsxs("div",{className:"flex flex-col gap-6",children:[g,j]}),e[29]=g,e[30]=j,e[31]=_):_=e[31],_}function Vt(i){return i.id!=="openai"}function Ht(i){return i.id==="openai"}function qt(i){return i.id==="openai-compatible"}function Gt(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function Yt(i){return i.id==="deco"}const Xt=Te({label:re().optional(),apiKey:re().min(1,"API key is required")});function Qt(i){const e=V.c(62),{providerId:t,onCancel:n,onSuccess:l}=i,{org:o}=le();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:pe,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=xe(r),c=me(),[d,u]=L.useState(!1);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={resolver:Re(Xt),defaultValues:{label:"",apiKey:""}},e[3]=p):p=e[3];const{register:f,handleSubmit:h,formState:v}=ze(p),{errors:g}=v;let S;e[4]!==a||e[5]!==t?(S=async H=>{await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:t,label:H.label||"Personal key",apiKey:H.apiKey}})},e[4]=a,e[5]=t,e[6]=S):S=e[6];let j;e[7]!==l||e[8]!==o.id||e[9]!==c?(j=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:te.aiProviders(o.id)}),Q.success("Key saved successfully"),l()},e[7]=l,e[8]=o.id,e[9]=c,e[10]=j):j=e[10];let _;e[11]!==S||e[12]!==j?(_={mutationFn:S,onSuccess:j,onError:Jt},e[11]=S,e[12]=j,e[13]=_):_=e[13];const{mutate:w,isPending:k,error:T}=de(_);let x;e[14]!==w?(x=H=>w(H),e[14]=w,e[15]=x):x=e[15];let N;e[16]!==h||e[17]!==x?(N=h(x),e[16]=h,e[17]=x,e[18]=N):N=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[19]=C):C=e[19];let I;e[20]!==f?(I=f("label"),e[20]=f,e[21]=I):I=e[21];let m;e[22]!==I?(m=s.jsxs("div",{className:"space-y-1",children:[C,s.jsx(ne,{placeholder:"e.g. Personal key",...I,className:"h-8 text-sm"})]}),e[22]=I,e[23]=m):m=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[24]=y):y=e[24];const b=d?"text":"password";let A;e[25]!==f?(A=f("apiKey"),e[25]=f,e[26]=A):A=e[26];let E;e[27]!==b||e[28]!==A?(E=s.jsx(ne,{type:b,placeholder:"sk-...",...A,className:"ph-no-capture h-8 text-sm pr-8"}),e[27]=b,e[28]=A,e[29]=E):E=e[29];let O;e[30]!==d?(O=()=>u(!d),e[30]=d,e[31]=O):O=e[31];let R;e[32]!==d?(R=d?s.jsx(Pe,{size:14}):s.jsx(De,{size:14}),e[32]=d,e[33]=R):R=e[33];let F;e[34]!==O||e[35]!==R?(F=s.jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:R}),e[34]=O,e[35]=R,e[36]=F):F=e[36];let B;e[37]!==E||e[38]!==F?(B=s.jsxs("div",{className:"relative",children:[E,F]}),e[37]=E,e[38]=F,e[39]=B):B=e[39];let z;e[40]!==g.apiKey?(z=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[40]=g.apiKey,e[41]=z):z=e[41];let K;e[42]!==B||e[43]!==z?(K=s.jsxs("div",{className:"space-y-1",children:[y,B,z]}),e[42]=B,e[43]=z,e[44]=K):K=e[44];let $;e[45]!==T?($=T&&s.jsx("p",{className:"text-xs text-destructive",children:T.message}),e[45]=T,e[46]=$):$=e[46];let D;e[47]!==k||e[48]!==n?(D=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:k,children:"Cancel"}),e[47]=k,e[48]=n,e[49]=D):D=e[49];const W=k?"Saving...":"Save Key";let P;e[50]!==k||e[51]!==W?(P=s.jsx(ee,{type:"submit",size:"sm",disabled:k,children:W}),e[50]=k,e[51]=W,e[52]=P):P=e[52];let U;e[53]!==D||e[54]!==P?(U=s.jsxs(Fe,{children:[D,P]}),e[53]=D,e[54]=P,e[55]=U):U=e[55];let M;return e[56]!==m||e[57]!==K||e[58]!==$||e[59]!==U||e[60]!==N?(M=s.jsxs("form",{onSubmit:N,className:"space-y-3",children:[m,K,$,U]}),e[56]=m,e[57]=K,e[58]=$,e[59]=U,e[60]=N,e[61]=M):M=e[61],M}function Jt(i){Q.error(`Failed to save key: ${i.message}`)}const Zt=Te({label:re().optional(),baseUrl:re().min(1,"Base URL is required"),apiKey:re().optional()});function es(i){const e=V.c(73),{preset:t,onCancel:n,onSuccess:l}=i,{org:o}=le();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:pe,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=xe(r),c=me(),[d,u]=L.useState(!1);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=Re(Zt),e[3]=p):p=e[3];const f=t?.defaultBaseUrl??"";let h;e[4]!==f?(h={resolver:p,defaultValues:{label:"",baseUrl:f,apiKey:""}},e[4]=f,e[5]=h):h=e[5];const{register:v,handleSubmit:g,formState:S}=ze(h),{errors:j}=S;let _;e[6]!==a||e[7]!==t?(_=async se=>{const Xe=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Xe,...t?{presetId:t.id}:{}}})},e[6]=a,e[7]=t,e[8]=_):_=e[8];let w;e[9]!==l||e[10]!==o.id||e[11]!==c?(w=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:te.aiProviders(o.id)}),Q.success("Connection saved successfully"),l()},e[9]=l,e[10]=o.id,e[11]=c,e[12]=w):w=e[12];let k;e[13]!==_||e[14]!==w?(k={mutationFn:_,onSuccess:w,onError:ts},e[13]=_,e[14]=w,e[15]=k):k=e[15];const{mutate:T,isPending:x,error:N}=de(k),C=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",I=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let m;e[16]!==T?(m=se=>T(se),e[16]=T,e[17]=m):m=e[17];let y;e[18]!==g||e[19]!==m?(y=g(m),e[18]=g,e[19]=m,e[20]=y):y=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[21]=b):b=e[21];let A;e[22]!==v?(A=v("label"),e[22]=v,e[23]=A):A=e[23];let E;e[24]!==C||e[25]!==A?(E=s.jsxs("div",{className:"space-y-1",children:[b,s.jsx(ne,{placeholder:C,...A,className:"h-8 text-sm"})]}),e[24]=C,e[25]=A,e[26]=E):E=e[26];let O;e[27]!==I||e[28]!==j||e[29]!==t?.defaultBaseUrl||e[30]!==v?(O=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...v("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ne,{type:"url",placeholder:I,...v("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[27]=I,e[28]=j,e[29]=t?.defaultBaseUrl,e[30]=v,e[31]=O):O=e[31];const R=t?.apiKeyRecommended?"recommended":"optional";let F;e[32]!==R?(F=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",R,")"]})]}),e[32]=R,e[33]=F):F=e[33];const B=d?"text":"password";let z;e[34]!==v?(z=v("apiKey"),e[34]=v,e[35]=z):z=e[35];let K;e[36]!==B||e[37]!==z?(K=s.jsx(ne,{type:B,placeholder:"sk-...",...z,className:"ph-no-capture h-8 text-sm pr-8"}),e[36]=B,e[37]=z,e[38]=K):K=e[38];let $;e[39]!==d?($=()=>u(!d),e[39]=d,e[40]=$):$=e[40];let D;e[41]!==d?(D=d?s.jsx(Pe,{size:14}):s.jsx(De,{size:14}),e[41]=d,e[42]=D):D=e[42];let W;e[43]!==$||e[44]!==D?(W=s.jsx("button",{type:"button",onClick:$,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:D}),e[43]=$,e[44]=D,e[45]=W):W=e[45];let P;e[46]!==K||e[47]!==W?(P=s.jsxs("div",{className:"relative",children:[K,W]}),e[46]=K,e[47]=W,e[48]=P):P=e[48];let U;e[49]!==F||e[50]!==P?(U=s.jsxs("div",{className:"space-y-1",children:[F,P]}),e[49]=F,e[50]=P,e[51]=U):U=e[51];let M;e[52]!==t?(M=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[52]=t,e[53]=M):M=e[53];let H;e[54]!==N?(H=N&&s.jsx("p",{className:"text-xs text-destructive",children:N.message}),e[54]=N,e[55]=H):H=e[55];let G;e[56]!==x||e[57]!==n?(G=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:x,children:"Cancel"}),e[56]=x,e[57]=n,e[58]=G):G=e[58];const J=x?"Saving...":"Save Connection";let Y;e[59]!==x||e[60]!==J?(Y=s.jsx(ee,{type:"submit",size:"sm",disabled:x,children:J}),e[59]=x,e[60]=J,e[61]=Y):Y=e[61];let Z;e[62]!==G||e[63]!==Y?(Z=s.jsxs(Fe,{children:[G,Y]}),e[62]=G,e[63]=Y,e[64]=Z):Z=e[64];let ce;return e[65]!==y||e[66]!==E||e[67]!==O||e[68]!==U||e[69]!==M||e[70]!==H||e[71]!==Z?(ce=s.jsxs("form",{onSubmit:y,className:"space-y-3",children:[E,O,U,M,H,Z]}),e[65]=y,e[66]=E,e[67]=O,e[68]=U,e[69]=M,e[70]=H,e[71]=Z,e[72]=ce):ce=e[72],ce}function ts(i){Q.error(`Failed to save connection: ${i.message}`)}const ss={kind:"closed"};function is(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function ns(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ls({open:i,onOpenChange:e,initialProvider:t}){const l=he()?.providers??[],{org:o}=le(),r=xe({connectionId:pe,orgId:o.id,orgSlug:o.slug}),a=me(),[c,d]=L.useReducer(is,ss),u=L.useRef(!1);L.useEffect(()=>{i&&c.kind==="closed"?d({type:"open"}):!i&&c.kind!=="closed"&&d({type:"close"})},[i,c.kind]);const p=()=>{u.current=!1,d({type:"close"}),e(!1)},f=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)})},{mutate:h}=de({mutationFn:async({providerId:m,code:y,stateToken:b,label:A})=>{const E=await r.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:m,code:y,stateToken:b,label:A}});if(E?.isError)throw new Error(E.content?.[0]?.text??"OAuth exchange failed");return m},onSuccess:m=>{X("ai_provider_oauth_succeeded",{provider_id:m}),f();const y=l.find(b=>b.id===m);Q.success(`${y?.name??"Provider"} connected successfully`),p()},onError:(m,y)=>{X("ai_provider_oauth_failed",{provider_id:y.providerId,error:m.message}),Q.error(`OAuth connection failed: ${m.message}`),d({type:"oauth-failed"})}}),{mutate:v}=de({mutationFn:async m=>{const y=await r.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:m}});if(y?.isError)throw new Error(y.content?.[0]?.text??"Key provisioning failed");return m},onSuccess:m=>{X("ai_provider_provision_succeeded",{provider_id:m}),f();const y=l.find(b=>b.id===m);Q.success(`${y?.name??"Provider"} connected successfully`),p()},onError:(m,y)=>{X("ai_provider_provision_failed",{provider_id:y,error:m.message}),d({type:"provision-error",error:m.message})}}),g=async m=>{const{provider:y}=m,b=m.kind==="openai-compatible"?m.preset?.id??null:null,A=y.supportedMethods.includes("oauth-pkce"),E=y.supportedMethods.includes("api-key");if(y.supportsProvision===!0){X("ai_provider_connect_clicked",{provider_id:y.id,method:"provision"}),d({type:"select-provision",providerId:y.id}),v(y.id);return}if(A){X("ai_provider_connect_clicked",{provider_id:y.id,method:"oauth-pkce"});try{const R=await r.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:y.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(!R.structuredContent)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");d({type:"select-oauth",providerId:y.id,stateToken:R.structuredContent.stateToken}),window.open(R.structuredContent.url,"AiProviderOAuth","width=600,height=700")}catch(R){Q.error(`Failed to start OAuth: ${R instanceof Error?R.message:String(R)}`)}return}E&&(X("ai_provider_connect_clicked",{provider_id:y.id,...b!==null?{preset_id:b}:{},method:"api-key"}),d({type:"select-form",providerId:y.id,presetId:b}))},S=L.useRef(g);S.current=g;const j=L.useRef(t);j.current=t,L.useEffect(()=>{!j.current||c.kind!=="grid"||u.current||(u.current=!0,S.current(j.current))},[c.kind]);const _=c.kind==="oauth-pending"?c.stateToken:null,w=c.kind==="oauth-pending"?c.providerId:null;L.useEffect(()=>{if(c.kind!=="oauth-pending")return;let m=!1;const y=c.stateToken,b=c.providerId,A=O=>{if(O.origin!==window.location.origin||O.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:R,stateToken:F}=O.data;if(F!==y){Q.error("Security check failed: State token mismatch"),d({type:"oauth-failed"});return}m=!0;const B=l.find(z=>z.id===b);h({providerId:b,code:R,stateToken:y,label:B?.name??b})};window.addEventListener("message",A);const E=setTimeout(()=>{m||(X("ai_provider_oauth_timeout",{provider_id:b}),d({type:"oauth-failed"}),Q.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",A),clearTimeout(E)}},[c.kind,_,w,h]);const k=ns(c),T=k?l.find(m=>m.id===k):null,N=(c.kind==="form"&&c.presetId?ae.find(m=>m.id===c.presetId):null)?.name??T?.name??"Connect an AI provider",C=c.kind!=="grid"&&c.kind!=="closed",I=()=>{t?p():d({type:"back"})};return s.jsx(Nt,{open:c.kind!=="closed",onOpenChange:m=>!m&&p(),children:s.jsxs(kt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(_t,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[C&&s.jsx(ee,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:I,children:s.jsx(Le,{size:16})}),s.jsx(wt,{children:N})]}),c.kind==="grid"&&!t&&s.jsx(Ct,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(Be,{providers:l,onSelect:g}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(es,{preset:c.presetId?ae.find(m=>m.id===c.presetId):void 0,onCancel:()=>d({type:"back"}),onSuccess:()=>{f(),p()}}):s.jsx(Qt,{providerId:c.providerId,onCancel:()=>d({type:"back"}),onSuccess:()=>{f(),p()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(be,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(be,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(St,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>d({type:"back"}),children:"Back"}),s.jsx(ee,{size:"sm",onClick:()=>{d({type:"retry-provision"}),v(c.providerId)},children:"Retry"})]})]})]})})}function os(){const i=V.c(7),{org:e}=le(),t=Mt();let n;i[0]!==e.id?(n=te.defaultBrand(e.id),i[0]=e.id,i[1]=n):n=i[1];let l;i[2]!==t?(l=async()=>{const{items:a}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(a)?a:[]).find(rs)??null},i[2]=t,i[3]=l):l=i[3];let o;i[4]!==n||i[5]!==l?(o={queryKey:n,queryFn:l},i[4]=n,i[5]=l,i[6]=o):o=i[6];const{data:r}=Ze(o);return r??null}function rs(i){return i.isDefault&&!i.archivedAt}function as(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),n=t?t.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function cs(i){const e=V.c(39);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:n,description:l}=t,{org:o}=le(),{localMode:r}=Je(),a=os(),c=bt(),[d,u]=L.useState(null),[p,f]=L.useState(!1),[h,v]=L.useState(!1),g=he();let S;e[2]!==g?.providers?(S=g?.providers??[],e[2]=g?.providers,e[3]=S):S=e[3];const j=S,_=o.name;let w;e[4]!==a?(w=a?as(a):null,e[4]=a,e[5]=w):w=e[5];const k=w,T=a?.favicon??a?.logo??null,x=n??(_?`${_} is ready for agents`:"Your agents are almost ready"),N=l??(r?"Connect a provider, or run `bunx decocms@latest link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms@latest link` on your desktop to use Claude Code, Codex, or your local files."),C=!!(T||k);let I;e[6]!==k?(I=k?{backgroundColor:`${k}18`,borderColor:`${k}30`}:void 0,e[6]=k,e[7]=I):I=e[7];const m=I,y=C?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let b;e[8]!==y||e[9]!==m||e[10]!==T||e[11]!==c||e[12]!==k?(b=T?s.jsx("div",{className:y,style:m,children:s.jsx("img",{src:T,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>v(!0),"aria-label":c.online?"Desktop linked":"Connect your desktop",className:ue(y,"cursor-pointer transition-colors hover:bg-accent"),style:m,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(jt,{size:24,style:k?{color:k}:void 0,className:ue(!k&&"text-muted-foreground")}),c.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[8]=y,e[9]=m,e[10]=T,e[11]=c,e[12]=k,e[13]=b):b=e[13];let A;e[14]!==x?(A=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:x}),e[14]=x,e[15]=A):A=e[15];let E;e[16]!==N?(E=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:N}),e[16]=N,e[17]=E):E=e[17];let O;e[18]!==A||e[19]!==E?(O=s.jsxs("div",{className:"space-y-2",children:[A,E]}),e[18]=A,e[19]=E,e[20]=O):O=e[20];let R;e[21]!==b||e[22]!==O?(R=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[b,O]}),e[21]=b,e[22]=O,e[23]=R):R=e[23];let F,B;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=M=>u(M),B=()=>f(!0),e[24]=F,e[25]=B):(F=e[24],B=e[25]);let z;e[26]!==j?(z=s.jsx("div",{className:"w-full",children:s.jsx(Be,{providers:j,onSelect:F,onShowAll:B})}),e[26]=j,e[27]=z):z=e[27];const K=d!==null||p;let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=M=>{M||(u(null),f(!1))},e[28]=$):$=e[28];const D=d??void 0;let W;e[29]!==K||e[30]!==D?(W=s.jsx(ls,{open:K,onOpenChange:$,initialProvider:D}),e[29]=K,e[30]=D,e[31]=W):W=e[31];let P;e[32]!==h?(P=s.jsx(Ot,{open:h,onOpenChange:v}),e[32]=h,e[33]=P):P=e[33];let U;return e[34]!==z||e[35]!==W||e[36]!==P||e[37]!==R?(U=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[R,z,W,P]}),e[34]=z,e[35]=W,e[36]=P,e[37]=R,e[38]=U):U=e[38],U}function ge(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function ds(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const us=["bg-destructive","bg-warning","bg-success","bg-success"],ms=["text-success","text-warning","text-warning","text-destructive"];function hs(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function fs(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const ps={text:{icon:s.jsx(ht,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(mt,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(ct,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(ut,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(At,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx($e,{className:"size-3.5"}),label:"Web search"}};function xs(i){const e=V.c(5),{capability:t}=i;let n;e[0]!==t?(n=ps[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=n):n=e[1];const l=n;let o;return e[2]!==l.icon||e[3]!==l.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=o):o=e[4],o}function gs(i){const e=V.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=x):x=e[0],x}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=ge(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:d}=a;if(l){let x;e[3]!==t.limits?(x=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=x):x=e[4];let N;e[5]!==o?(N=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let C;e[7]!==r?(C=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=C):C=e[8];let I;e[9]!==t.limits?(I=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=I):I=e[10];let m;return e[11]!==x||e[12]!==N||e[13]!==C||e[14]!==I?(m=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,N,C,I]}),e[11]=x,e[12]=N,e[13]=C,e[14]=I,e[15]=m):m=e[15],m}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let p;e[18]!==t.logo||e[19]!==t.title?(p=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=p):p=e[20];let f;e[21]!==d?(f=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=f):f=e[22];let h;e[23]!==p||e[24]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2.5",children:[p,f]}),e[23]=p,e[24]=f,e[25]=h):h=e[25];let v;e[26]!==t.modelId?(v=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=v):v=e[27];let g;e[28]!==u||e[29]!==h||e[30]!==v?(g=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,h,v]}),e[28]=u,e[29]=h,e[30]=v,e[31]=g):g=e[31];let S;e[32]!==t.capabilities?(S=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(vs)}),e[32]=t.capabilities,e[33]=S):S=e[33];let j;e[34]!==t.limits?(j=t.limits?.contextWindow&&(()=>{const{level:x,label:N,description:C}=ds(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(I=>s.jsx("div",{className:ue("w-2 h-2 rounded-full",I<=x?us[x-1]:"bg-muted")},I))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",C]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=j):j=e[35];let _;e[36]!==t.limits?(_=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:hs(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=_):_=e[37];let w;e[38]!==o||e[39]!==r?(w=(o!=null||r!=null)&&(()=>{const{level:x,label:N}=o!=null?fs(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>s.jsx("span",{className:ue("text-sm font-bold leading-none",C<=x?ms[x-1]:"text-muted-foreground/20"),children:"$"},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=w):w=e[40];let k;e[41]!==j||e[42]!==_||e[43]!==w?(k=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,_,w]}),e[41]=j,e[42]=_,e[43]=w,e[44]=k):k=e[44];let T;return e[45]!==k||e[46]!==g||e[47]!==S?(T=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[g,S,k]}),e[45]=k,e[46]=g,e[47]=S,e[48]=T):T=e[48],T}function vs(i){return s.jsx(xs,{capability:i},i)}function fi(i){const e=V.c(19),{model:t,placeholder:n,isLoading:l}=i,o=n===void 0?"Select model":n;if(l===void 0?!1:l){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(q,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(q,{className:"w-16 h-3 hidden md:block"})]}),e[0]=g):g=e[0],g}if(!t){let g;e[1]!==o?(g=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=g):g=e[2];let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Se,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=S):S=e[3];let j;return e[4]!==g?(j=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,S]}),e[4]=g,e[5]=j):j=e[5],j}let a;e[6]!==t?(a=ge(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let d;e[8]!==t?(d=fe(t),e[8]=t,e[9]=d):d=e[9];const u=d;let p;e[10]!==t.title||e[11]!==u?(p=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=p):p=e[12];let f;e[13]!==c?(f=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=f):f=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Se,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=h):h=e[15];let v;return e[16]!==p||e[17]!==f?(v=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[p,f,h]}),e[16]=p,e[17]=f,e[18]=v):v=e[18],v}const bs=["vision","image","file","audio","video"],We=["image/png","image/jpeg","image/gif","image/webp"],Ve=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function ve(i){const e=i?.capabilities;return e?bs.some(t=>e.includes(t)):!1}function pi(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],n=t.includes("vision")||t.includes("image"),l=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(n&&We.includes(i)||l&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||ve(e)&&Ve.includes(i))}function xi(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...We),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),ve(i)&&t.push(...Ve),t.join(",")}function gi(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),ve(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const He=["smarter","faster","cheaper"],qe={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},ys=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],js=ys.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),Ss="google/gemini-2.5-pro",Me=new Map;function Ns(i){const e=Me.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else for(const{tier:n,prefix:l}of js)if(i.startsWith(l)){if(l===Ss&&i.length>l.length&&i[l.length]==="-"){const r=i[l.length+1];if(!r||!/\d/.test(r))continue}t=n;break}return Me.set(i,t),t}function Oe(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=Ns(t.modelId);e[n??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((n,l)=>n.title.localeCompare(l.title));return e}const Ge="mesh:model-shortlist:",ks=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function _s(i){try{const e=localStorage.getItem(Ge+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function ws(i,e){localStorage.setItem(Ge+i,JSON.stringify([...e]))}function Cs(i){const e=V.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=ge(t),e[0]=t,e[1]=l):l=e[1];const{displayName:o,provider:r}=l;let a;e[2]!==t?(a=fe(t),e[2]=t,e[3]=a):a=e[3];const c=a;let d;e[4]!==t||e[5]!==n?(d=()=>n(t),e[4]=t,e[5]=n,e[6]=d):d=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let p;e[10]!==o?(p=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=p):p=e[11];let f;e[12]!==r?(f=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=f):f=e[13];let h;e[14]!==p||e[15]!==f?(h=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[p,f]}),e[14]=p,e[15]=f,e[16]=h):h=e[16];let v;return e[17]!==d||e[18]!==u||e[19]!==h?(v=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[u,h]}),e[17]=d,e[18]=u,e[19]=h,e[20]=v):v=e[20],v}function Is(i){const e=V.c(10),{error:t,onRetry:n}=i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(st,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(dt,{className:"size-3.5"}),e[4]=c):c=e[4];let d;e[5]!==n?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ee,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,a,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9],u}function Es(){const i=V.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Ms)}),i[0]=e):e=i[0],e}function Ms(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(q,{className:"flex-1 h-4"}),s.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ae(i){const e=V.c(12),{label:t,models:n,onSelect:l,onHover:o}=i;if(n.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==n||e[3]!==o||e[4]!==l){let d;e[6]!==o||e[7]!==l?(d=u=>s.jsx("div",{onClick:()=>l(u),className:"cursor-pointer",children:s.jsx(Cs,{model:u,onHover:o})},u.modelId),e[6]=o,e[7]=l,e[8]=d):d=e[8],a=n.map(d),e[2]=n,e[3]=o,e[4]=l,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Os(i){const e=V.c(21),{model:t,isChecked:n,onToggle:l,onHover:o}=i,[r,a]=L.useState(n);r!==n&&a(n);let c;e[0]!==t?(c=fe(t),e[0]=t,e[1]=c):c=e[1];const d=c;let u;e[2]!==t||e[3]!==o?(u=()=>o(t),e[2]=t,e[3]=o,e[4]=u):u=e[4];let p;e[5]!==t.modelId||e[6]!==l?(p=()=>{a(As),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==r||e[9]!==p?(f=s.jsx(it,{checked:r,onCheckedChange:p}),e[8]=r,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==d||e[12]!==t.title?(h=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=h):h=e[13];let v;e[14]!==t.title?(v=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=v):v=e[15];let g;return e[16]!==u||e[17]!==f||e[18]!==h||e[19]!==v?(g=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[f,h,v]}),e[16]=u,e[17]=f,e[18]=h,e[19]=v,e[20]=g):g=e[20],g}function As(i){return!i}function Ts(i){const e=[];for(const t of He)if(i[t].length>0){e.push({type:"header",label:qe[t]});for(const n of i[t])e.push({type:"model",model:n})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function Rs({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=L.useRef(null),o=Wt({count:i.length,getScrollElement:()=>l.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Os,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:n})},r.key):null})})})}function zs(i){const e=V.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:d}=vt(t),u=c?d.filter(c):d.filter(Ps);let p;e[0]!==t?(p=()=>(t?_s(t):null)??ks,e[0]=t,e[1]=p):p=e[1];const[f,h]=L.useState(p),[,v]=L.useTransition();let g;e[2]!==t||e[3]!==v?(g=m=>{t&&v(()=>{h(y=>{const b=new Set(y);return b.has(m)?b.delete(m):b.add(m),ws(t,b),b})})},e[2]=t,e[3]=v,e[4]=g):g=e[4];const S=g,j=n.toLowerCase().trim(),_=m=>j?m.filter(y=>y.title.toLowerCase().includes(j)||y.modelId.toLowerCase().includes(j)):m;if(r){const m=Oe(_(u)),y=Ts(m);let b;e[5]!==f?(b=R=>f.has(R.modelId),e[5]=f,e[6]=b):b=e[6];const A=u.filter(b).length;let E;e[7]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(Le,{size:14}),e[7]=E):E=e[7];let O;return e[8]!==a?(O=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[E,"Back"]}),e[8]=a,e[9]=O):O=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[O,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[A," selected"]})]}),s.jsx(Rs,{items:y,shortlistSet:f,onToggle:S,onHover:l})]})}let w;e[10]!==f?(w=m=>f.has(m.modelId),e[10]=f,e[11]=w):w=e[11];const k=u.filter(w),T=k.length>0?k:u,x=Oe(_(T));let N;e[12]!==x||e[13]!==l||e[14]!==o?(N=He.map(m=>s.jsx(Ae,{label:qe[m],models:x[m],onSelect:o,onHover:l},m)),e[12]=x,e[13]=l,e[14]=o,e[15]=N):N=e[15];let C;e[16]!==x.other||e[17]!==l||e[18]!==o?(C=s.jsx(Ae,{label:"Other",models:x.other,onSelect:o,onHover:l}),e[16]=x.other,e[17]=l,e[18]=o,e[19]=C):C=e[19];let I;return e[20]!==N||e[21]!==C?(I=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,C]}),e[20]=N,e[21]=C,e[22]=I):I=e[22],I}function Ps(i){return i.asyncResearch!==!0}function vi(){const i=V.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(q,{className:"size-4 shrink-0"}),s.jsx(q,{className:"flex-1 h-6"}),s.jsx(q,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Ls)})]}),i[1]=t):t=i[1];let n;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(q,{className:"size-6 shrink-0"}),s.jsx(q,{className:"h-6 w-32"})]}),i[2]=n):n=i[2];let l;i[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(q,{className:"h-6 w-20 rounded-md"}),s.jsx(q,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=l):l=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(q,{className:"h-4 w-24"}),s.jsx(q,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(q,{className:"h-4 w-16"}),s.jsx(q,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function Ls(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(q,{className:"flex-1 h-4"}),s.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ye(i){const e=V.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,d]=L.useState(null),[u,p]=L.useState(""),[f,h]=L.useState(!1),v=L.useRef(null),g=he(),S=gt();let j;e[0]!==g?.providers?(j=Object.fromEntries((g?.providers??[]).map(Ks)),e[0]=g?.providers,e[1]=j):j=e[1];const _=j,w=et(),{org:k}=le();let T;e[2]!==l?(T=M=>{l(M),d(null)},e[2]=l,e[3]=T):T=e[3];const x=T;let N;e[4]!==n||e[5]!==t||e[6]!==r?(N=M=>{n&&(r(M),p(""),t())},e[4]=n,e[5]=t,e[6]=r,e[7]=N):N=e[7];const C=N;if(S.length===0){let M;return e[8]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(cs,{})}),e[8]=M):M=e[8],M}let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx($e,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=I):I=e[9];const m=f?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=M=>p(M.target.value),e[10]=y):y=e[10];let b;e[11]!==u||e[12]!==m?(b=s.jsx(ne,{ref:v,type:"text",placeholder:m,value:u,onChange:y,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=u,e[12]=m,e[13]=b):b=e[13];let A;e[14]!==n||e[15]!==x||e[16]!==S||e[17]!==_?(A=S.length>0&&s.jsxs(nt,{value:n??"",onValueChange:x,children:[s.jsxs(lt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Fs,children:[s.jsx(ot,{placeholder:"Key",children:(()=>{const M=S.find(Z=>Z.id===n),H=M?_[M.providerId]:void 0,G=Ie(M?.presetId),J=G?.logo??H?.logo,Y=G?.name??H?.name??M?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[J?s.jsx("img",{src:J,alt:Y,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:Y.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:Y})]})})()}),s.jsx(ft,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(rt,{children:S.map(M=>{const H=_[M.providerId],G=Ie(M.presetId),J=G?.logo??H?.logo,Y=G?.name??H?.name??M.providerId;return s.jsx(at,{value:M.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[J?s.jsx("img",{src:J,alt:Y,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:Y.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[Y," — ",M.label]})]})},M.id)})})]}),e[14]=n,e[15]=x,e[16]=S,e[17]=_,e[18]=A):A=e[18];let E;e[19]!==b||e[20]!==A?(E=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[I,b,A]})}),e[19]=b,e[20]=A,e[21]=E):E=e[21];let O;e[22]!==n?(O=M=>{const{error:H,resetError:G}=M;return s.jsx(Is,{error:H,onRetry:G,credentialId:n??void 0})},e[22]=n,e[23]=O):O=e[23];let R;e[24]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Es,{}),e[24]=R):R=e[24];const F=n??void 0;let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=()=>h($s),e[25]=B):B=e[25];let z;e[26]!==a||e[27]!==C||e[28]!==f||e[29]!==u||e[30]!==F?(z=s.jsx(L.Suspense,{fallback:R,children:s.jsx(zs,{keyId:F,searchTerm:u,onHover:d,onModelSelect:C,managing:f,onToggleManage:B,filterModels:a})}),e[26]=a,e[27]=C,e[28]=f,e[29]=u,e[30]=F,e[31]=z):z=e[31];let K;e[32]!==n||e[33]!==O||e[34]!==z?(K=s.jsx(tt,{fallback:O,children:z},n),e[32]=n,e[33]=O,e[34]=z,e[35]=K):K=e[35];let $;e[36]!==f||e[37]!==w||e[38]!==k?($=!f&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>L.startTransition(()=>h(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(xt,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>w({to:"/$org/settings/ai-providers",params:{org:k.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(pt,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=f,e[37]=w,e[38]=k,e[39]=$):$=e[39];let D;e[40]!==K||e[41]!==$||e[42]!==E?(D=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[E,K,$]}),e[40]=K,e[41]=$,e[42]=E,e[43]=D):D=e[43];const W=c??o??null;let P;e[44]!==W?(P=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(gs,{model:W})}),e[44]=W,e[45]=P):P=e[45];let U;return e[46]!==D||e[47]!==P?(U=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[D,P]}),e[46]=D,e[47]=P,e[48]=U):U=e[48],U}function $s(i){return!i}function Fs(i){return i.stopPropagation()}function Ks(i){return[i.id,i]}function Ds(i){const e=V.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:o,setModel:r}=yt();let a;e[0]!==l?(a=u=>{X("chat_credential_changed",{credential_id:u}),l(u)},e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n||e[3]!==o?.modelId||e[4]!==r?(c=u=>{n&&(X("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:n}),r({...u,keyId:n}))},e[2]=n,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==n||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsx(Ye,{onClose:t,credentialId:n,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=n,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function bi(i){const e=V.c(2),{onClose:t}=i;let n;return e[0]!==t?(n=s.jsx(Ds,{onClose:t}),e[0]=t,e[1]=n):n=e[1],n}function yi(i){const e=V.c(2);let t;return e[0]!==i?(t=s.jsx(Ye,{...i}),e[0]=i,e[1]=t):t=e[1],t}export{ls as C,yi as D,vi as M,cs as N,ae as O,Be as P,fi as S,xi as a,bi as b,gi as g,pi as i,ve as m};
@@ -0,0 +1 @@
1
+ import{d as o}from"./watch-sse-pool-ymdzZonG.js";const c=o;export{c as d};
@@ -1 +1 @@
1
- import{e as n,j as i,cw as u,c,bB as m,dm as x,dn as j,cx as N,cy as b,dp as g,dq as D}from"./index-DElySjov.js";import{i as h}from"./X-Br2l6mA-.js";function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{w as D,T as a,B as b,E as c,R as d,O as e,k as f,v as g,y as h,z as i};
1
+ import{e as n,j as i,cw as u,c,bB as m,dm as x,dn as j,cx as N,cy as b,dp as g,dq as D}from"./index-3ttoiVWU.js";import{i as h}from"./X-BRH2Y8Wq.js";function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{w as D,T as a,B as b,E as c,R as d,O as e,k as f,v as g,y as h,z as i};
@@ -1 +1 @@
1
- import{e as Z,p as L,b as Q,F as B,K as G,m as U,a as P,j as s,B as J,t as p,n as z}from"./index-DElySjov.js";import{u as $}from"./studio-tools-BniDnWv9.js";import{S as Y}from"./switch-DKWXZfes.js";import{S as H,a as v,b as F}from"./settings-section-bgBc23Sj.js";function ei(){const i=Z.c(59),{org:e}=L(),{data:q}=Q.useSession(),M=B(),a=$();let r;i[0]!==e.id?(r=G.organizationDomain(e.id),i[0]=e.id,i[1]=r):r=i[1];let d;i[2]!==a?(d=()=>a.call("ORGANIZATION_DOMAIN_GET",{}),i[2]=a,i[3]=d):d=i[3];let A;i[4]!==r||i[5]!==d?(A={queryKey:r,queryFn:d},i[4]=r,i[5]=d,i[6]=A):A=i[6];const{data:k,isPending:K}=U(A),R=q?.user?.email??"";let x;i[7]!==R?(x=R.split("@")[1]?.toLowerCase()??"",i[7]=R,i[8]=x):x=i[8];const n=x,o=k?.domain??null,T=k?.autoJoinEnabled??!1,w=n&&n!==o;let C;i[9]!==e.id||i[10]!==M?(C=()=>M.invalidateQueries({queryKey:G.organizationDomain(e.id)}),i[9]=e.id,i[10]=M,i[11]=C):C=i[11];const l=C;let c;i[12]!==a||i[13]!==n?(c=()=>a.call("ORGANIZATION_DOMAIN_SET",{domain:n,autoJoinEnabled:!1}),i[12]=a,i[13]=n,i[14]=c):c=i[14];let m;i[15]!==l||i[16]!==e.id||i[17]!==n?(m=()=>{p("organization_domain_claimed",{organization_id:e.id,email_domain:n}),l(),z.success("Domain claimed")},i[15]=l,i[16]=e.id,i[17]=n,i[18]=m):m=i[18];let u;i[19]!==e.id||i[20]!==n?(u=t=>{p("organization_domain_claim_failed",{organization_id:e.id,email_domain:n,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to claim domain")},i[19]=e.id,i[20]=n,i[21]=u):u=i[21];let D;i[22]!==c||i[23]!==m||i[24]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[22]=c,i[23]=m,i[24]=u,i[25]=D):D=i[25];const h=P(D);let g;i[26]!==a?(g=()=>a.call("ORGANIZATION_DOMAIN_CLEAR",{}),i[26]=a,i[27]=g):g=i[27];let f;i[28]!==o||i[29]!==l||i[30]!==e.id?(f=()=>{p("organization_domain_cleared",{organization_id:e.id,email_domain:o}),l(),z.success("Domain removed")},i[28]=o,i[29]=l,i[30]=e.id,i[31]=f):f=i[31];let _;i[32]!==o||i[33]!==e.id?(_=t=>{p("organization_domain_clear_failed",{organization_id:e.id,email_domain:o,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to remove domain")},i[32]=o,i[33]=e.id,i[34]=_):_=i[34];let I;i[35]!==f||i[36]!==_||i[37]!==g?(I={mutationFn:g,onSuccess:f,onError:_},i[35]=f,i[36]=_,i[37]=g,i[38]=I):I=i[38];const N=P(I);let E;i[39]!==o||i[40]!==e.id||i[41]!==a?(E=async t=>{if(o)return p("organization_auto_join_toggled",{organization_id:e.id,enabled:t}),a.call("ORGANIZATION_DOMAIN_UPDATE",{autoJoinEnabled:t})},i[39]=o,i[40]=e.id,i[41]=a,i[42]=E):E=i[42];let j;i[43]!==l?(j=()=>{l(),z.success("Auto-join setting updated")},i[43]=l,i[44]=j):j=i[44];let S;i[45]!==e.id?(S=t=>{p("organization_auto_join_toggle_failed",{organization_id:e.id,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to update auto-join")},i[45]=e.id,i[46]=S):S=i[46];let O;i[47]!==E||i[48]!==j||i[49]!==S?(O={mutationFn:E,onSuccess:j,onError:S},i[47]=E,i[48]=j,i[49]=S,i[50]=O):O=i[50];const y=P(O);if(K)return null;let b;return i[51]!==T||i[52]!==w||i[53]!==N||i[54]!==o||i[55]!==h||i[56]!==y||i[57]!==n?(b=s.jsx(H,{title:"Email domain",children:o?s.jsxs(v,{children:[s.jsx(F,{title:o,description:"Claimed domain",action:s.jsx(J,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(F,{title:"Auto-join",description:`Users with @${o} emails will automatically join this organization on signup.`,action:s.jsx(Y,{checked:T,onCheckedChange:t=>y.mutate(t),disabled:y.isPending})})]}):w?s.jsx(v,{children:s.jsx(F,{title:n,description:"Let new users with matching emails auto-join this org.",action:s.jsx(J,{size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,children:h.isPending?"Claiming...":"Claim domain"})})}):s.jsx(v,{children:s.jsx(F,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[51]=T,i[52]=w,i[53]=N,i[54]=o,i[55]=h,i[56]=y,i[57]=n,i[58]=b):b=i[58],b}export{ei as D};
1
+ import{e as Z,p as L,b as Q,F as B,K as G,m as U,a as P,j as s,B as J,t as p,n as z}from"./index-3ttoiVWU.js";import{u as $}from"./studio-tools-C7SlPTsZ.js";import{S as Y}from"./switch-DDUT3a8C.js";import{S as H,a as v,b as F}from"./settings-section-7sN_1nHI.js";function ei(){const i=Z.c(59),{org:e}=L(),{data:q}=Q.useSession(),M=B(),a=$();let r;i[0]!==e.id?(r=G.organizationDomain(e.id),i[0]=e.id,i[1]=r):r=i[1];let d;i[2]!==a?(d=()=>a.call("ORGANIZATION_DOMAIN_GET",{}),i[2]=a,i[3]=d):d=i[3];let A;i[4]!==r||i[5]!==d?(A={queryKey:r,queryFn:d},i[4]=r,i[5]=d,i[6]=A):A=i[6];const{data:k,isPending:K}=U(A),R=q?.user?.email??"";let x;i[7]!==R?(x=R.split("@")[1]?.toLowerCase()??"",i[7]=R,i[8]=x):x=i[8];const n=x,o=k?.domain??null,T=k?.autoJoinEnabled??!1,w=n&&n!==o;let C;i[9]!==e.id||i[10]!==M?(C=()=>M.invalidateQueries({queryKey:G.organizationDomain(e.id)}),i[9]=e.id,i[10]=M,i[11]=C):C=i[11];const l=C;let c;i[12]!==a||i[13]!==n?(c=()=>a.call("ORGANIZATION_DOMAIN_SET",{domain:n,autoJoinEnabled:!1}),i[12]=a,i[13]=n,i[14]=c):c=i[14];let m;i[15]!==l||i[16]!==e.id||i[17]!==n?(m=()=>{p("organization_domain_claimed",{organization_id:e.id,email_domain:n}),l(),z.success("Domain claimed")},i[15]=l,i[16]=e.id,i[17]=n,i[18]=m):m=i[18];let u;i[19]!==e.id||i[20]!==n?(u=t=>{p("organization_domain_claim_failed",{organization_id:e.id,email_domain:n,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to claim domain")},i[19]=e.id,i[20]=n,i[21]=u):u=i[21];let D;i[22]!==c||i[23]!==m||i[24]!==u?(D={mutationFn:c,onSuccess:m,onError:u},i[22]=c,i[23]=m,i[24]=u,i[25]=D):D=i[25];const h=P(D);let g;i[26]!==a?(g=()=>a.call("ORGANIZATION_DOMAIN_CLEAR",{}),i[26]=a,i[27]=g):g=i[27];let f;i[28]!==o||i[29]!==l||i[30]!==e.id?(f=()=>{p("organization_domain_cleared",{organization_id:e.id,email_domain:o}),l(),z.success("Domain removed")},i[28]=o,i[29]=l,i[30]=e.id,i[31]=f):f=i[31];let _;i[32]!==o||i[33]!==e.id?(_=t=>{p("organization_domain_clear_failed",{organization_id:e.id,email_domain:o,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to remove domain")},i[32]=o,i[33]=e.id,i[34]=_):_=i[34];let I;i[35]!==f||i[36]!==_||i[37]!==g?(I={mutationFn:g,onSuccess:f,onError:_},i[35]=f,i[36]=_,i[37]=g,i[38]=I):I=i[38];const N=P(I);let E;i[39]!==o||i[40]!==e.id||i[41]!==a?(E=async t=>{if(o)return p("organization_auto_join_toggled",{organization_id:e.id,enabled:t}),a.call("ORGANIZATION_DOMAIN_UPDATE",{autoJoinEnabled:t})},i[39]=o,i[40]=e.id,i[41]=a,i[42]=E):E=i[42];let j;i[43]!==l?(j=()=>{l(),z.success("Auto-join setting updated")},i[43]=l,i[44]=j):j=i[44];let S;i[45]!==e.id?(S=t=>{p("organization_auto_join_toggle_failed",{organization_id:e.id,error:t instanceof Error?t.message:String(t)}),z.error(t instanceof Error?t.message:"Failed to update auto-join")},i[45]=e.id,i[46]=S):S=i[46];let O;i[47]!==E||i[48]!==j||i[49]!==S?(O={mutationFn:E,onSuccess:j,onError:S},i[47]=E,i[48]=j,i[49]=S,i[50]=O):O=i[50];const y=P(O);if(K)return null;let b;return i[51]!==T||i[52]!==w||i[53]!==N||i[54]!==o||i[55]!==h||i[56]!==y||i[57]!==n?(b=s.jsx(H,{title:"Email domain",children:o?s.jsxs(v,{children:[s.jsx(F,{title:o,description:"Claimed domain",action:s.jsx(J,{variant:"outline",size:"sm",onClick:()=>N.mutate(),disabled:N.isPending,children:"Remove"})}),s.jsx(F,{title:"Auto-join",description:`Users with @${o} emails will automatically join this organization on signup.`,action:s.jsx(Y,{checked:T,onCheckedChange:t=>y.mutate(t),disabled:y.isPending})})]}):w?s.jsx(v,{children:s.jsx(F,{title:n,description:"Let new users with matching emails auto-join this org.",action:s.jsx(J,{size:"sm",onClick:()=>h.mutate(),disabled:h.isPending,children:h.isPending?"Claiming...":"Claim domain"})})}):s.jsx(v,{children:s.jsx(F,{title:"No domain detected",description:"Sign in with a corporate email to claim a domain for your organization."})})}),i[51]=T,i[52]=w,i[53]=N,i[54]=o,i[55]=h,i[56]=y,i[57]=n,i[58]=b):b=i[58],b}export{ei as D};
@@ -1 +1 @@
1
- import{e as d,j as s,cl as i,c}from"./index-DElySjov.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
1
+ import{e as d,j as s,cl as i,c}from"./index-3ttoiVWU.js";function x(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Root,{"data-slot":"drawer",...t}),e[2]=t,e[3]=a):a=e[3],a}function v(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Trigger,{"data-slot":"drawer-trigger",...t}),e[2]=t,e[3]=a):a=e[3],a}function w(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Portal,{"data-slot":"drawer-portal",...t}),e[2]=t,e[3]=a):a=e[3],a}function b(l){const e=d.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let a;return e[2]!==t?(a=s.jsx(i.Close,{"data-slot":"drawer-close",...t}),e[2]=t,e[3]=a):a=e[3],a}function m(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Overlay,{"data-slot":"drawer-overlay",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function g(l){const e=d.c(12);let t,a,r;e[0]!==l?({className:a,children:t,...r}=l,e[0]=l,e[1]=t,e[2]=a,e[3]=r):(t=e[1],a=e[2],r=e[3]);let o;e[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(m,{}),e[4]=o):o=e[4];let n;e[5]!==a?(n=c("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[95vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",a),e[5]=a,e[6]=n):n=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=f):f=e[7];let u;return e[8]!==t||e[9]!==r||e[10]!==n?(u=s.jsxs(w,{"data-slot":"drawer-portal",children:[o,s.jsxs(i.Content,{"data-slot":"drawer-content",className:n,...r,children:[f,t]})]}),e[8]=t,e[9]=r,e[10]=n,e[11]=u):u=e[11],u}function h(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("flex flex-col gap-1.5 px-4 py-2",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-header",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function j(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("mt-auto flex flex-col gap-2 p-4",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx("div",{"data-slot":"drawer-footer",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function D(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-foreground font-semibold",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Title,{"data-slot":"drawer-title",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}function N(l){const e=d.c(8);let t,a;e[0]!==l?({className:t,...a}=l,e[0]=l,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let r;e[3]!==t?(r=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=r):r=e[4];let o;return e[5]!==a||e[6]!==r?(o=s.jsx(i.Description,{"data-slot":"drawer-description",className:r,...a}),e[5]=a,e[6]=r,e[7]=o):o=e[7],o}export{D,g as a,x as b,h as c,N as d,b as e,j as f,v as g};
@@ -1 +1 @@
1
- import{e as c,j as d,dQ as f,dR as m,c as u,dS as g,dT as x,dU as v,dV as b,dW as h,dX as w,dY as j,dZ as N,d_ as z,d$ as _,e0 as y,e1 as p}from"./index-DElySjov.js";import{i as $}from"./Check-eedT9M4f.js";import{i as D}from"./ChevronRight-CBibu88R.js";import{a as M}from"./DotsVertical-tAZhaZW5.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,V as d,W as e,X as f,U as g,O as h,P as i,Q as j,L as k};
1
+ import{e as c,j as d,dQ as f,dR as m,c as u,dS as g,dT as x,dU as v,dV as b,dW as h,dX as w,dY as j,dZ as N,d_ as z,d$ as _,e0 as y,e1 as p}from"./index-3ttoiVWU.js";import{i as $}from"./Check-Cb8huOHH.js";import{i as D}from"./ChevronRight-D0iMeTJ5.js";import{a as M}from"./DotsVertical-BhoFPdMN.js";function C(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(f,{"data-slot":"dropdown-menu",...t}),e[2]=t,e[3]=s):s=e[3],s}function T(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(m,{"data-slot":"dropdown-menu-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function E(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,sideOffset:o,...s}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);const n=o===void 0?4:o;let r;e[4]!==t?(r=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border p-1 shadow-md",t),e[4]=t,e[5]=r):r=e[5];let i;return e[6]!==s||e[7]!==n||e[8]!==r?(i=d.jsx(x,{children:d.jsx(v,{"data-slot":"dropdown-menu-content",sideOffset:n,className:r,...s})}),e[6]=s,e[7]=n,e[8]=r,e[9]=i):i=e[9],i}function G(a){const e=c.c(12);let t,s,o,n;e[0]!==a?({className:t,inset:s,variant:n,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);const r=n===void 0?"default":n;let i;e[5]!==t?(i=u("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[5]=t,e[6]=i):i=e[6];let l;return e[7]!==s||e[8]!==o||e[9]!==i||e[10]!==r?(l=d.jsx(g,{"data-slot":"dropdown-menu-item","data-inset":s,"data-variant":r,className:i,...o}),e[7]=s,e[8]=o,e[9]=i,e[10]=r,e[11]=l):l=e[11],l}function L(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:o,children:s,checked:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==o?(r=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx($,{className:"size-4"})})}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==s||e[10]!==n||e[11]!==r?(l=d.jsxs(h,{"data-slot":"dropdown-menu-checkbox-item",className:r,checked:t,...n,children:[i,s]}),e[8]=t,e[9]=s,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function O(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(_,{"data-slot":"dropdown-menu-radio-group",...t}),e[2]=t,e[3]=s):s=e[3],s}function P(a){const e=c.c(11);let t,s,o;e[0]!==a?({className:s,children:t,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==s?(n=u("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-lg py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[4]=s,e[5]=n):n=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=d.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:d.jsx(p,{children:d.jsx(M,{className:"size-2 fill-current"})})}),e[6]=r):r=e[6];let i;return e[7]!==t||e[8]!==o||e[9]!==n?(i=d.jsxs(y,{"data-slot":"dropdown-menu-radio-item",className:n,...o,children:[r,t]}),e[7]=t,e[8]=o,e[9]=n,e[10]=i):i=e[10],i}function Q(a){const e=c.c(10);let t,s,o;e[0]!==a?({className:t,inset:s,...o}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o):(t=e[1],s=e[2],o=e[3]);let n;e[4]!==t?(n=u("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),e[4]=t,e[5]=n):n=e[5];let r;return e[6]!==s||e[7]!==o||e[8]!==n?(r=d.jsx(b,{"data-slot":"dropdown-menu-label","data-inset":s,className:n,...o}),e[6]=s,e[7]=o,e[8]=n,e[9]=r):r=e[9],r}function U(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-border -mx-1 my-1 h-px",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(w,{"data-slot":"dropdown-menu-separator",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}function V(a){const e=c.c(4);let t;e[0]!==a?({...t}=a,e[0]=a,e[1]=t):t=e[1];let s;return e[2]!==t?(s=d.jsx(j,{"data-slot":"dropdown-menu-sub",...t}),e[2]=t,e[3]=s):s=e[3],s}function W(a){const e=c.c(13);let t,s,o,n;e[0]!==a?({className:s,inset:o,children:t,...n}=a,e[0]=a,e[1]=t,e[2]=s,e[3]=o,e[4]=n):(t=e[1],s=e[2],o=e[3],n=e[4]);let r;e[5]!==s?(r=u("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-lg px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",s),e[5]=s,e[6]=r):r=e[6];let i;e[7]===Symbol.for("react.memo_cache_sentinel")?(i=d.jsx(D,{className:"ml-auto size-4"}),e[7]=i):i=e[7];let l;return e[8]!==t||e[9]!==o||e[10]!==n||e[11]!==r?(l=d.jsxs(N,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:r,...n,children:[t,i]}),e[8]=t,e[9]=o,e[10]=n,e[11]=r,e[12]=l):l=e[12],l}function X(a){const e=c.c(8);let t,s;e[0]!==a?({className:t,...s}=a,e[0]=a,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let o;e[3]!==t?(o=u("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),e[3]=t,e[4]=o):o=e[4];let n;return e[5]!==s||e[6]!==o?(n=d.jsx(z,{"data-slot":"dropdown-menu-sub-content",className:o,...s}),e[5]=s,e[6]=o,e[7]=n):n=e[7],n}export{C as D,T as a,E as b,G as c,V as d,W as e,X as f,U as g,O as h,P as i,Q as j,L as k};
@@ -1 +1 @@
1
- import{e as p,g as d,cj as l,j as s,O as u}from"./index-DElySjov.js";import{P as c}from"./plugin-layout-Ba8uQ5F9.js";import"./use-connection-DWiJ60zQ.js";import"./use-collections-CSzXbKpT.js";import"./use-mcp-client-4hZRsKeH.js";import"./auth-CEd3xQ2M.js";import"./studio-tools-BniDnWv9.js";import"./Settings02-Dg39zp7t.js";import"./index-BD1xF-xP.js";import"./sidebar-DUDIX5oW.js";import"./LayoutLeft-ZmlpRdpE.js";import"./tooltip-BJIwJ20V.js";import"./sheet-CUbQ8u3K.js";import"./X-Br2l6mA-.js";function h(){const e=p.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:a}=d(n);let i;e[1]!==a?(i=l.find(r=>r.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let m;return e[8]!==o?(m=s.jsx(o,{}),e[8]=o,e[9]=m):m=e[9],m}export{h as default};
1
+ import{e as p,g as d,cj as l,j as s,O as u}from"./index-3ttoiVWU.js";import{P as c}from"./plugin-layout-BYUyfvt2.js";import"./use-connection-DYg5H00C.js";import"./use-collections-BENY1kCP.js";import"./use-mcp-client-CLwLq9Vl.js";import"./auth-DOEa4Xg-.js";import"./studio-tools-C7SlPTsZ.js";import"./Settings02-B100KruV.js";import"./index-B0th8sGF.js";import"./sidebar-CeOOq5ye.js";import"./LayoutLeft-hGFocSnW.js";import"./tooltip-FBNw4nVO.js";import"./sheet-B6uVK7Gd.js";import"./X-BRH2Y8Wq.js";function h(){const e=p.c(10);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/shell/$org/$taskId/$pluginId"},e[0]=n):n=e[0];const{pluginId:a}=d(n);let i;e[1]!==a?(i=l.find(r=>r.id===a),e[1]=a,e[2]=i):i=e[2];const t=i;if(t?.renderHeader&&t?.renderEmptyState&&t?.bindingName){let r;return e[3]!==t.bindingName||e[4]!==t.renderEmptyState||e[5]!==t.renderHeader?(r=s.jsx(c,{bindingName:t.bindingName,renderHeader:t.renderHeader,renderEmptyState:t.renderEmptyState}),e[3]=t.bindingName,e[4]=t.renderEmptyState,e[5]=t.renderHeader,e[6]=r):r=e[6],r}const o=t?.LayoutComponent;if(!o){let r;return e[7]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(u,{}),e[7]=r):r=e[7],r}let m;return e[8]!==o?(m=s.jsx(o,{}),e[8]=o,e[9]=m):m=e[9],m}export{h as default};
@@ -1 +1 @@
1
- import{e as b,c as h,j as t,B as g}from"./index-DElySjov.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
1
+ import{e as b,c as h,j as t,B as g}from"./index-3ttoiVWU.js";function y(N){const e=b.c(21),{icon:o,illustration:a,title:u,description:d,buttonProps:s,buttonComponent:x,className:j,children:p}=N;let l;e[0]!==j?(l=h("flex flex-col items-center justify-center py-16 text-center",j),e[0]=j,e[1]=l):l=e[1];let i;e[2]!==o||e[3]!==a?(i=a?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:a}):o?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:o}):null,e[2]=o,e[3]=a,e[4]=i):i=e[4];let n;e[5]!==u?(n=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[5]=u,e[6]=n):n=e[6];let c;e[7]!==d?(c=d&&t.jsx("div",{className:"text-sm text-muted-foreground",children:d}),e[7]=d,e[8]=c):c=e[8];let r;e[9]!==n||e[10]!==c?(r=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[n,c]}),e[9]=n,e[10]=c,e[11]=r):r=e[11];let m;e[12]!==x||e[13]!==s?(m=(x??s)&&t.jsx("div",{className:"mt-4",children:x??(s&&t.jsx(g,{size:"sm",className:h(s?.className),...s}))}),e[12]=x,e[13]=s,e[14]=m):m=e[14];let f;return e[15]!==p||e[16]!==l||e[17]!==i||e[18]!==r||e[19]!==m?(f=t.jsxs("div",{className:l,children:[i,r,m,p]}),e[15]=p,e[16]=l,e[17]=i,e[18]=r,e[19]=m,e[20]=f):f=e[20],f}export{y as E};
@@ -1 +1 @@
1
- import{e as v,c as N,j as t}from"./index-DElySjov.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
1
+ import{e as v,c as N,j as t}from"./index-3ttoiVWU.js";function y(){const x=v.c(1);let e;return x[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("img",{src:"/empty-state-cards.png",alt:"",width:336,height:320,"aria-hidden":"true"}),x[0]=e):e=x[0],e}function C(x){const e=v.c(24),{image:f,title:p,description:u,actions:o,className:h,descriptionClassName:j,actionsClassName:g}=x;let s;e[0]!==h?(s=N("flex flex-1 flex-col items-center justify-center gap-8 p-4",h),e[0]=h,e[1]=s):s=e[1];let l;e[2]!==f?(l=f!==null&&t.jsx("div",{className:"flex items-center justify-center",children:f??t.jsx(y,{})}),e[2]=f,e[3]=l):l=e[3];let i;e[4]!==p?(i=t.jsx("h3",{className:"text-lg font-medium text-foreground",children:p}),e[4]=p,e[5]=i):i=e[5];let c;e[6]!==j?(c=N("text-sm text-muted-foreground text-center max-w-[300px]",j),e[6]=j,e[7]=c):c=e[7];let a;e[8]!==u||e[9]!==c?(a=t.jsx("div",{className:c,children:u}),e[8]=u,e[9]=c,e[10]=a):a=e[10];let n;e[11]!==i||e[12]!==a?(n=t.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i,a]}),e[11]=i,e[12]=a,e[13]=n):n=e[13];let r;e[14]!==o||e[15]!==g?(r=o&&t.jsx("div",{className:N("flex items-center gap-2",g),children:o}),e[14]=o,e[15]=g,e[16]=r):r=e[16];let m;e[17]!==n||e[18]!==r?(m=t.jsxs("div",{className:"flex flex-col items-center gap-4",children:[n,r]}),e[17]=n,e[18]=r,e[19]=m):m=e[19];let d;return e[20]!==s||e[21]!==l||e[22]!==m?(d=t.jsxs("div",{className:s,children:[l,m]}),e[20]=s,e[21]=l,e[22]=m,e[23]=d):d=e[23],d}export{C as E};
@@ -1 +1 @@
1
- import{g as O}from"./generate-id-zSg_956X.js";import"./index-DElySjov.js";import{W as T,c as x}from"./use-mcp-client-4hZRsKeH.js";const U="mcp.mesh";function H(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function L(e){const t=H(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function Y(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return Y(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(e){return e?D[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a,r){const o=await x({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[U],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||L(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[A]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${$(c)})`:l&&N&&(g=` (${K(l)})`);const E=I+g;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{L as a,B as b,J as c,Q as e,q as f,j as g,F as i};
1
+ import{g as O}from"./generate-id-yj5Hc06j.js";import"./index-3ttoiVWU.js";import{W as T,c as x}from"./use-mcp-client-CLwLq9Vl.js";const U="mcp.mesh";function H(e){if(!e)return null;const t=typeof e=="string"?e:e.url;if(!t)return null;const n=t.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return n?{owner:n[1]||"",repo:n[2]||""}:null}function L(e){const t=H(e);if(!t)return null;const n=`https://github.com/${t.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(n)}&output=webp`}function Y(e,t){return e===T.REGISTRY(t)||e===T.COMMUNITY_REGISTRY(t)}function F(e,t){return Y(e,t)?"COLLECTION_REGISTRY_APP_LIST":"REGISTRY_ITEM_LIST"}function q(e){if(!e)return[];const t=[];for(const n of e){let a=[];if(Array.isArray(n))a=n;else if(typeof n=="object"&&n!==null){const r=Object.keys(n).find(o=>Array.isArray(n[o]));r&&(a=n[r])}t.push(...a)}return t}const D={"streamable-http":"HTTP",http:"HTTP",sse:"SSE",stdio:"STDIO",websocket:"Websocket"};function G(e){return e?D[e]??e.toUpperCase():null}function B(e){if(!e)return[];if(Array.isArray(e))return e;if(typeof e=="object"&&e!==null){const t=Object.keys(e).find(n=>Array.isArray(e[n]));if(t)return e[t]}return[]}async function J(e,t,n,a,r){const o=await x({connectionId:e,orgId:t,orgSlug:n});try{const s=await o.callTool({name:a,arguments:r});return s.structuredContent??s}finally{await o.close().catch(console.error)}}function j(e){return e._meta?.["mcp.mesh"]?.appName||e.server?.name||null}function K(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function $(e){const t=e?.identifier||e?.name;return t?t.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,a=>a.toUpperCase()):"Unknown"}function Q(e,t,n,a){const r=e.server,o=e._meta?.[U],s=new Date().toISOString(),I=o?.friendlyName||o?.friendly_name||e.title||r?.title||r?.name||"Unnamed MCP Server",k=r?.description||null,C=r?.icons?.[0]?.src||L(r?.repository)||null,i=o?.oauth_config,R=i&&typeof i.authorizationEndpoint=="string"&&typeof i.tokenEndpoint=="string"&&typeof i.clientId=="string"&&Array.isArray(i.scopes)&&(i.grantType==="authorization_code"||i.grantType==="client_credentials")?i:null,P=o?.configuration_state,v=o?.configuration_scopes,w=r?.repository?{url:r.repository.url,source:r.repository.source,subfolder:r.repository.subfolder}:null,p=r?.packages??[],d=r?.remotes??[],A=a?.packageIndex??0,S=a?.remoteIndex??0,y=p.length>0&&a?.packageIndex!==void 0,c=y?p[A]:null,l=y?null:d[S];let u,f,h=null;if(c){const _=c.identifier||c.name;u="STDIO",f="";const m={};if(c.environmentVariables)for(const b of c.environmentVariables)b.name&&(m[b.name]="");h={command:"npx",args:_?["-y",_]:[],...Object.keys(m).length>0&&{envVars:m}}}else l?(u=G(l.type)||"HTTP",f=l.url||""):(u="HTTP",f="");const N=d.length>1,M=p.length>1;let g="";c&&M?g=` (${$(c)})`:l&&N&&(g=` (${K(l)})`);const E=I+g;return{id:O("conn"),title:E,description:k,icon:C,app_name:j(e),app_id:o?.id||e.id||null,connection_type:u,connection_url:f,connection_token:null,connection_headers:h,oauth_config:R,configuration_state:P??null,configuration_scopes:v??null,metadata:{source:"store",registry_item_id:e.id,verified:o?.verified??!1,scopeName:o?.scopeName??null,toolsCount:o?.tools?.length??0,publishedAt:o?.publishedAt??null,repository:w},created_at:s,updated_at:s,created_by:n,organization_id:t,tools:null,bindings:null,status:"inactive"}}export{L as a,B as b,J as c,Q as e,q as f,j as g,F as i};
@@ -1 +1 @@
1
- import{e as b,p as k,F as E,cj as P,j as n,ck as R,b4 as q,K as S,n as K}from"./index-DElySjov.js";import{P as j}from"./index-BD1xF-xP.js";import{d as _}from"./use-organization-settings-C5AMVC8s.js";import{S as F}from"./switch-DKWXZfes.js";import{n as I}from"./Container-Z2j0OuNG.js";import{b as Q,S as w,a as z,c as N}from"./settings-section-bgBc23Sj.js";import{R as T}from"./require-capability-CMu5fNDT.js";import"./sidebar-DUDIX5oW.js";import"./LayoutLeft-ZmlpRdpE.js";import"./tooltip-BJIwJ20V.js";import"./sheet-CUbQ8u3K.js";import"./X-Br2l6mA-.js";import"./use-mcp-client-4hZRsKeH.js";import"./auth-CEd3xQ2M.js";import"./card-CgBn2dE1.js";import"./ArrowUpRight-CnGG2N1Q.js";import"./use-capability-C2a1p0-_.js";import"./access-gate-BfYLjAxI.js";import"./capability-load-error-BKOu-NPD.js";function U(){const e=b.c(17),{org:t,project:s}=k(),r=E();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const a=d,l=_();let m;e[2]!==t||e[3]!==s.slug||e[4]!==r?(m=()=>{r.invalidateQueries({queryKey:S.project(t.id,s.slug)}),r.invalidateQueries({queryKey:S.projects(t.id)}),r.invalidateQueries({predicate:i=>{const o=i.queryKey;return o[1]===t.id&&o[3]==="collection"&&o[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=r,e[5]=m):m=e[5];const x=m;let p;e[6]!==x||e[7]!==l||e[8]!==a?(p=(i,o)=>{const u=new Set(a);o?u.add(i):u.delete(i),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:x,onError:M})},e[6]=x,e[7]=l,e[8]=a,e[9]=p):p=e[9];const g=p,y=D,C=A;if(P.length===0){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=i):i=e[10],i}let c;e[11]!==g||e[12]!==l||e[13]!==a?(c=P.map(i=>{const o=y(i.id),u=C(i.id),h=a.includes(i.id);return n.jsx(Q,{title:o?.label??i.id,description:u??void 0,icon:n.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:o?.icon??n.jsx(I,{size:14})}),onClick:()=>!l.isPending&&g(i.id,!h),action:n.jsx(F,{checked:h,onCheckedChange:v=>g(i.id,v),disabled:l.isPending,onClick:$})},i.id)}),e[11]=g,e[12]=l,e[13]=a,e[14]=c):c=e[14];let f;return e[15]!==c?(f=n.jsx(w,{children:n.jsx(z,{children:c})}),e[15]=c,e[16]=f):f=e[16],f}function $(e){return e.stopPropagation()}function A(e){return P.find(s=>s.id===e)?.description??null}function D(e){const t=R.find(r=>r.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=q.find(r=>r.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function M(e){K.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function B(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(j,{children:n.jsx(j.Content,{children:n.jsx(j.Body,{children:n.jsxs(N,{children:[n.jsx(j.Title,{children:"Plugins"}),n.jsx(U,{})]})})})}),e[0]=t):t=e[0],t}function ce(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(T,{capability:"org:manage",area:"plugins",children:n.jsx(B,{})}),e[0]=t):t=e[0],t}export{ce as default};
1
+ import{e as b,p as k,F as E,cj as P,j as n,ck as R,b4 as q,K as S,n as K}from"./index-3ttoiVWU.js";import{P as j}from"./index-B0th8sGF.js";import{d as _}from"./use-organization-settings-25l1s_BF.js";import{S as F}from"./switch-DDUT3a8C.js";import{n as I}from"./Container-BGdfxKsK.js";import{b as Q,S as w,a as z,c as N}from"./settings-section-7sN_1nHI.js";import{R as T}from"./require-capability-ctj3w0Hy.js";import"./sidebar-CeOOq5ye.js";import"./LayoutLeft-hGFocSnW.js";import"./tooltip-FBNw4nVO.js";import"./sheet-B6uVK7Gd.js";import"./X-BRH2Y8Wq.js";import"./use-mcp-client-CLwLq9Vl.js";import"./auth-DOEa4Xg-.js";import"./card-C0ZJxFoq.js";import"./ArrowUpRight-C4gNBzMY.js";import"./use-capability-CVFP3WhT.js";import"./access-gate-qCShaDhO.js";import"./capability-load-error-ErUeqyMr.js";function U(){const e=b.c(17),{org:t,project:s}=k(),r=E();let d;e[0]!==s.enabledPlugins?(d=s.enabledPlugins??[],e[0]=s.enabledPlugins,e[1]=d):d=e[1];const a=d,l=_();let m;e[2]!==t||e[3]!==s.slug||e[4]!==r?(m=()=>{r.invalidateQueries({queryKey:S.project(t.id,s.slug)}),r.invalidateQueries({queryKey:S.projects(t.id)}),r.invalidateQueries({predicate:i=>{const o=i.queryKey;return o[1]===t.id&&o[3]==="collection"&&o[4]==="VIRTUAL_MCP"}})},e[2]=t,e[3]=s.slug,e[4]=r,e[5]=m):m=e[5];const x=m;let p;e[6]!==x||e[7]!==l||e[8]!==a?(p=(i,o)=>{const u=new Set(a);o?u.add(i):u.delete(i),l.mutate({enabled_plugins:Array.from(u)},{onSuccess:x,onError:M})},e[6]=x,e[7]=l,e[8]=a,e[9]=p):p=e[9];const g=p,y=D,C=A;if(P.length===0){let i;return e[10]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("p",{className:"text-sm text-muted-foreground",children:"No plugins available."}),e[10]=i):i=e[10],i}let c;e[11]!==g||e[12]!==l||e[13]!==a?(c=P.map(i=>{const o=y(i.id),u=C(i.id),h=a.includes(i.id);return n.jsx(Q,{title:o?.label??i.id,description:u??void 0,icon:n.jsx("span",{className:"text-muted-foreground [&>svg]:size-4",children:o?.icon??n.jsx(I,{size:14})}),onClick:()=>!l.isPending&&g(i.id,!h),action:n.jsx(F,{checked:h,onCheckedChange:v=>g(i.id,v),disabled:l.isPending,onClick:$})},i.id)}),e[11]=g,e[12]=l,e[13]=a,e[14]=c):c=e[14];let f;return e[15]!==c?(f=n.jsx(w,{children:n.jsx(z,{children:c})}),e[15]=c,e[16]=f):f=e[16],f}function $(e){return e.stopPropagation()}function A(e){return P.find(s=>s.id===e)?.description??null}function D(e){const t=R.find(r=>r.pluginId===e);if(t)return{label:t.label,icon:t.items[0]?.icon};const s=q.find(r=>r.pluginId===e);return s?{label:s.label,icon:s.icon}:null}function M(e){K.error("Failed to update plugin: "+(e instanceof Error?e.message:"Unknown error"))}function B(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(j,{children:n.jsx(j.Content,{children:n.jsx(j.Body,{children:n.jsxs(N,{children:[n.jsx(j.Title,{children:"Plugins"}),n.jsx(U,{})]})})})}),e[0]=t):t=e[0],t}function ce(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(T,{capability:"org:manage",area:"plugins",children:n.jsx(B,{})}),e[0]=t):t=e[0],t}export{ce as default};