decocms 4.3.1 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/client/assets/{AlertCircle-B4WPpzHx.js → AlertCircle-BxTbR_B1.js} +1 -1
  2. package/dist/client/assets/{ArrowUpRight-n7J2ORua.js → ArrowUpRight-S4NNBOkv.js} +1 -1
  3. package/dist/client/assets/{CheckCircle-DGqDWZvl.js → CheckCircle-BtIJRHva.js} +1 -1
  4. package/dist/client/assets/{ChevronDown-BzkFMF52.js → ChevronDown-Ee_3Sayw.js} +1 -1
  5. package/dist/client/assets/{ChevronRight-BhZIqa2P.js → ChevronRight-DCf9L0Ls.js} +1 -1
  6. package/dist/client/assets/{ChevronUp-CtzC0jb0.js → ChevronUp-CGE39voI.js} +1 -1
  7. package/dist/client/assets/{DotsVertical-DskMPw9G.js → DotsVertical-fVEXRB26.js} +1 -1
  8. package/dist/client/assets/{Eye-Bkw15G1G.js → Eye-fTf2jKhH.js} +1 -1
  9. package/dist/client/assets/{FilterLines-CTiCp3St.js → FilterLines-Ba5JOCcM.js} +1 -1
  10. package/dist/client/assets/{Globe01-CIvUZBh0.js → Globe01-DYSo0Sr2.js} +1 -1
  11. package/dist/client/assets/{Globe04-By_qGXm-.js → Globe04-3H1XgmQN.js} +1 -1
  12. package/dist/client/assets/{HardDrive-Da-ea-EW.js → HardDrive-JOn6Ez5n.js} +1 -1
  13. package/dist/client/assets/{Key01-DugFMT5_.js → Key01-DV-6LIf3.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-DiQ60pSu.js → LayoutLeft-BtE5tmf6.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-BMDEbMBF.js → LinkExternal01-CALVZhat.js} +1 -1
  16. package/dist/client/assets/{Monitor01-BFD-ivVa.js → Monitor01-CWc8cxQO.js} +1 -1
  17. package/dist/client/assets/{Palette-DrmZY9bB.js → Palette-Dok2NINN.js} +1 -1
  18. package/dist/client/assets/{Play-CiiKZLoa.js → Play-CllDczEk.js} +1 -1
  19. package/dist/client/assets/{Plus-hFZ_SbzL.js → Plus-B6q1KrRb.js} +1 -1
  20. package/dist/client/assets/{SearchLg-D4Hs4YLQ.js → SearchLg-ZiEk0E-L.js} +1 -1
  21. package/dist/client/assets/{SearchMd-RBoojwOu.js → SearchMd-CXYhXBwx.js} +1 -1
  22. package/dist/client/assets/{Settings02-CuT9JazG.js → Settings02-D7AphFkm.js} +1 -1
  23. package/dist/client/assets/{Shield01-D5Fc_Ylv.js → Shield01-DKJBa4Nn.js} +1 -1
  24. package/dist/client/assets/{Star01-BMttIRxb.js → Star01-Bf-FCZNm.js} +1 -1
  25. package/dist/client/assets/{Stars01-HANlppqn.js → Stars01-DlOkHfPH.js} +1 -1
  26. package/dist/client/assets/{Stars02-Call5O4Q.js → Stars02-BQPdDCaK.js} +1 -1
  27. package/dist/client/assets/{Sun-B0JI-Irq.js → Sun-BkeePoRn.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-BcqnyefE.js → SwitchHorizontal01-5oVLoUdS.js} +1 -1
  29. package/dist/client/assets/{Tool01-DFCFgRlB.js → Tool01-CYPQsW1Y.js} +1 -1
  30. package/dist/client/assets/{Trash01-CGEeRKCz.js → Trash01-xnv05M2J.js} +1 -1
  31. package/dist/client/assets/{Upload01-V0qkIpRk.js → Upload01-Cxp7zIDh.js} +1 -1
  32. package/dist/client/assets/{User01-Co_ACiCO.js → User01-DuB-iQs0.js} +1 -1
  33. package/dist/client/assets/{Users01-B-VpMOmx.js → Users01-BkkYER_Z.js} +1 -1
  34. package/dist/client/assets/{Users03-DBa0-LbB.js → Users03-UgyNhO90.js} +1 -1
  35. package/dist/client/assets/{X-DlUiLOPC.js → X-DJbyjHqp.js} +1 -1
  36. package/dist/client/assets/{XCircle-BIxZfFEg.js → XCircle-DaUcrc3Z.js} +1 -1
  37. package/dist/client/assets/{XClose-CEJj7vhn.js → XClose-Dpj0HG8O.js} +1 -1
  38. package/dist/client/assets/{Zap-USVmT42t.js → Zap-3WgTvh1l.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-qeizwUPq.js → ZapSquare-_6Gbk0W4.js} +1 -1
  40. package/dist/client/assets/{ZoomOut-fkR_2hFy.js → ZoomOut-sMdcQ1z1.js} +1 -1
  41. package/dist/client/assets/{access-gate-Dob1Rc1a.js → access-gate-D5zqAUht.js} +1 -1
  42. package/dist/client/assets/{add-section-modal-JApa7Z44.js → add-section-modal-C7LYK9_a.js} +1 -1
  43. package/dist/client/assets/agent-icon-CGghaYK_.js +1 -0
  44. package/dist/client/assets/agents-list-Cr4gcaIM.js +1 -0
  45. package/dist/client/assets/{ai-providers-boT7K-bH.js → ai-providers-DRcnzRGt.js} +1 -1
  46. package/dist/client/assets/{alert-ez0UE1C8.js → alert-82Lday5Z.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-BZ8TrIVu.js → alert-dialog-BS58YIPS.js} +2 -2
  48. package/dist/client/assets/app-editor-C6Aqhesa.js +1 -0
  49. package/dist/client/assets/{auth-CNqDC7uO.js → auth-ThTV5Po4.js} +1 -1
  50. package/dist/client/assets/{auth-catchall-BG9GP_5W.js → auth-catchall-DZl4u1uA.js} +1 -1
  51. package/dist/client/assets/{auth-entry-BAXdJDhh.js → auth-entry-CbD2Yx6O.js} +1 -1
  52. package/dist/client/assets/{auth-split-layout-BQs9JvYd.js → auth-split-layout-CDtLb6rM.js} +1 -1
  53. package/dist/client/assets/{authenticate-and-persist-oauth-Dy2XeMqO.js → authenticate-and-persist-oauth-M7g3Ip6K.js} +1 -1
  54. package/dist/client/assets/{automation-list-row-DO51bU3z.js → automation-list-row-BpAVCpYu.js} +1 -1
  55. package/dist/client/assets/automation-runs-Ct44UxLc.js +1 -0
  56. package/dist/client/assets/automations-kb18v3_J.js +1 -0
  57. package/dist/client/assets/{avatar-Jhd31ejW.js → avatar-DlocwZ2L.js} +1 -1
  58. package/dist/client/assets/{badge-cxwmW2xd.js → badge-D5YEUUHD.js} +1 -1
  59. package/dist/client/assets/{block-document-AtpOGVAy.js → block-document-BRIyZXG2.js} +2 -2
  60. package/dist/client/assets/{brand-context-D-YGjyHl.js → brand-context-BsgCnvPI.js} +1 -1
  61. package/dist/client/assets/{buckets-ByuitLd7.js → buckets-B7WQPWC0.js} +1 -1
  62. package/dist/client/assets/bulk-category-panel-DNM5EmBU.js +1 -0
  63. package/dist/client/assets/{capability-load-error-C00HLz2q.js → capability-load-error-DT9Z3j9_.js} +1 -1
  64. package/dist/client/assets/{card-D3bKVB8y.js → card-Cw03QSbR.js} +1 -1
  65. package/dist/client/assets/category-editor-BmiPat5J.js +1 -0
  66. package/dist/client/assets/{chat-context-B5uEh4ay.js → chat-context-ooWv73sg.js} +4 -4
  67. package/dist/client/assets/{checkbox-PMXW46HN.js → checkbox-B68Qec99.js} +1 -1
  68. package/dist/client/assets/{cli-auth-success-Bo07c76Z.js → cli-auth-success-Ddd6u0XZ.js} +1 -1
  69. package/dist/client/assets/collection-detail-D6Q9VAn2.js +1 -0
  70. package/dist/client/assets/{collection-display-button-Cu6MzTbi.js → collection-display-button-BMNWXm85.js} +1 -1
  71. package/dist/client/assets/{collection-search-CN9TCItb.js → collection-search-3IpRbGNr.js} +1 -1
  72. package/dist/client/assets/{collection-tabs-D5o6VjHd.js → collection-tabs-DddR_OZb.js} +1 -1
  73. package/dist/client/assets/{command-D-t5bmXW.js → command-DwLXEYqP.js} +1 -1
  74. package/dist/client/assets/commerce-onboarding-Bck_AFlf.js +1 -0
  75. package/dist/client/assets/{connect-desktop-dialog-DchtPbuP.js → connect-desktop-dialog-CDwS1V65.js} +1 -1
  76. package/dist/client/assets/{connection-card-BswtsnGE.js → connection-card-DOtnovDK.js} +1 -1
  77. package/dist/client/assets/connection-detail-BahmY-gv.js +1 -0
  78. package/dist/client/assets/{connection-form-helpers-JfkHcTGO.js → connection-form-helpers-DP7j8TIB.js} +1 -1
  79. package/dist/client/assets/connections-CZ4QvltE.js +1 -0
  80. package/dist/client/assets/{context-menu-Dln5uXsN.js → context-menu-CTpu9MH_.js} +1 -1
  81. package/dist/client/assets/{decopilot-CfDwLIyX.js → decopilot-B32iA6AV.js} +1 -1
  82. package/dist/client/assets/{decopilot-sse-pool-DoJkdYBA.js → decopilot-sse-pool-DCtLG819.js} +1 -1
  83. package/dist/client/assets/{dialog-B2cGEuOv.js → dialog-dc-6JiKe.js} +1 -1
  84. package/dist/client/assets/{domain-settings-DNJMc9fW.js → domain-settings-DVO7PCYm.js} +1 -1
  85. package/dist/client/assets/{drawer-Tv6bcT7w.js → drawer-xBBvxQN0.js} +1 -1
  86. package/dist/client/assets/{dropdown-menu-Dw-pnYXI.js → dropdown-menu-DxGNuqoA.js} +1 -1
  87. package/dist/client/assets/{empty-state-D7nJB9UW.js → empty-state-BUpOZfFd.js} +1 -1
  88. package/dist/client/assets/{extract-connection-data-CxK1dunT.js → extract-connection-data-qNy8FwuR.js} +1 -1
  89. package/dist/client/assets/file-explorer-CFShRASg.js +2 -0
  90. package/dist/client/assets/{file-type-icon-W_AZRfzL.js → file-type-icon-CU03wRXW.js} +1 -1
  91. package/dist/client/assets/{files-B0cAPQGO.js → files-DbReNsVo.js} +1 -1
  92. package/dist/client/assets/{form-DI8q6OtF.js → form-BCFMjlpa.js} +1 -1
  93. package/dist/client/assets/{general-bpWfsinD.js → general-DqokVySt.js} +1 -1
  94. package/dist/client/assets/{github-repo-picker-M1TBbLot.js → github-repo-picker-DmmFpG_f.js} +1 -1
  95. package/dist/client/assets/{hooks-DgSrpwcx.js → hooks-BPJw1hei.js} +6 -6
  96. package/dist/client/assets/{import-from-deco-dialog-IZXHkaJ2.js → import-from-deco-dialog-Cqmqz1ZK.js} +1 -1
  97. package/dist/client/assets/{index-CABmrUBB.js → index-BEMAWvDc.js} +1 -1
  98. package/dist/client/assets/{index-CshxsRNd.js → index-BLrDPPMI.js} +1 -1
  99. package/dist/client/assets/index-BcXb7VeZ.css +1 -0
  100. package/dist/client/assets/index-CDodpQIo.js +1 -0
  101. package/dist/client/assets/{index-CO_UO0dQ.js → index-CK3mNMke.js} +1 -1
  102. package/dist/client/assets/{index-BQIJkmZH.js → index-CLce2SDk.js} +2 -2
  103. package/dist/client/assets/{index-5MyNR89x.js → index-CcSfK5lN.js} +3 -3
  104. package/dist/client/assets/{index-Cxp4ZtBG.js → index-Ckv1trie.js} +1 -1
  105. package/dist/client/assets/{index-BWMRVcd2.js → index-DQFapqGr.js} +27 -27
  106. package/dist/client/assets/index-DqI8yCZf.js +1 -0
  107. package/dist/client/assets/{index-5XIJtJJp.js → index-NlBPD228.js} +1 -1
  108. package/dist/client/assets/{index-BgPTCVWL.js → index-R31BplOc.js} +1 -1
  109. package/dist/client/assets/{index-BD4HYlEX.js → index-RTYNd1V2.js} +1 -1
  110. package/dist/client/assets/index-akSYqf8U.js +173 -0
  111. package/dist/client/assets/{index-BFW_K0gJ.js → index-nRRJjntw.js} +1 -1
  112. package/dist/client/assets/{index-redirect-Clw5irxr.js → index-redirect-CZcY1QKs.js} +1 -1
  113. package/dist/client/assets/{input-D9aeO8wK.js → input-DP5SZ5ZB.js} +1 -1
  114. package/dist/client/assets/{integration-icon-CMGCCNyJ.js → integration-icon-DN8Vp_dc.js} +1 -1
  115. package/dist/client/assets/{label-Bj7qsNrz.js → label-BwKyZwbE.js} +1 -1
  116. package/dist/client/assets/{login-BF7DsD8r.js → login-CKE5Qo30.js} +1 -1
  117. package/dist/client/assets/{mcp-oauth-DEfvhjPc.js → mcp-oauth-BwPcgk4Y.js} +1 -1
  118. package/dist/client/assets/{members-5GqN16xx.js → members-Dk5LMfPA.js} +1 -1
  119. package/dist/client/assets/{monaco-editor-B3KzPr3D.js → monaco-editor-DbRZxEyH.js} +2 -2
  120. package/dist/client/assets/{monitoring-stats-row-B6byJzyf.js → monitoring-stats-row-DwWeNnqf.js} +1 -1
  121. package/dist/client/assets/{oauth-callback-xYG2bhs8.js → oauth-callback-C17HjdP4.js} +1 -1
  122. package/dist/client/assets/{oauth-callback-ai-provider-DGwgTWgk.js → oauth-callback-ai-provider-rgF6sNOu.js} +1 -1
  123. package/dist/client/assets/{onboarding-CnEfKMnB.js → onboarding-BNRfMpQ2.js} +1 -1
  124. package/dist/client/assets/{org-install-DfRej3K2.js → org-install-BnZbsTit.js} +1 -1
  125. package/dist/client/assets/{org-layout-Bc9Glt8J.js → org-layout-7GtbTFGB.js} +1 -1
  126. package/dist/client/assets/{organization-choice-DGTNMrAe.js → organization-choice-deKiTsSC.js} +1 -1
  127. package/dist/client/assets/{page-seo-form-CcZ53r1B.js → page-seo-form-DPZN4zKV.js} +1 -1
  128. package/dist/client/assets/page-seo-sheet-Dqa4kKTw.js +1 -0
  129. package/dist/client/assets/popover-B5x5gTCp.js +1 -0
  130. package/dist/client/assets/post-editor-oh2IXwsc.js +1 -0
  131. package/dist/client/assets/{primitives-CAIbeS4G.js → primitives-dzbeBlHQ.js} +1 -1
  132. package/dist/client/assets/{profile-BF9HkmK_.js → profile-Bc0rxORl.js} +1 -1
  133. package/dist/client/assets/project-app-view-LEo1Vn4l.js +1 -0
  134. package/dist/client/assets/record-editor-Gj0bd3Dm.js +1 -0
  135. package/dist/client/assets/registry-DYhqURup.js +2 -0
  136. package/dist/client/assets/{registry-layout-CRS0SBoX.js → registry-layout-BQWFVx3q.js} +1 -1
  137. package/dist/client/assets/{require-capability-BclGG3Lq.js → require-capability-Bh5SW_Rr.js} +1 -1
  138. package/dist/client/assets/{required-auth-layout-CZqB7vUr.js → required-auth-layout-DnZfZ2NE.js} +1 -1
  139. package/dist/client/assets/{reset-password-CKTIPX2L.js → reset-password-BOF0PLif.js} +1 -1
  140. package/dist/client/assets/roles-BHggaHP0.js +1 -0
  141. package/dist/client/assets/{scroll-area-DLqMfi_N.js → scroll-area-KBEcsrNl.js} +54 -54
  142. package/dist/client/assets/{search-input-BXzntIcj.js → search-input-DfY0Idtt.js} +1 -1
  143. package/dist/client/assets/{secrets-D5X-Z3Mv.js → secrets-D-WMYerP.js} +1 -1
  144. package/dist/client/assets/{sections-editor-jc7NLaYJ.js → sections-editor-D_gqV6Dc.js} +2 -2
  145. package/dist/client/assets/select-0LBXKeau.js +1 -0
  146. package/dist/client/assets/{select-model-BLeb_gwV.js → select-model-DHY-fBEi.js} +1 -1
  147. package/dist/client/assets/seo-editor-CPi1zeyc.js +1 -0
  148. package/dist/client/assets/settings-layout-D7Afx7A0.js +1 -0
  149. package/dist/client/assets/{settings-section-Br7JxQz6.js → settings-section-DiijSJ5F.js} +1 -1
  150. package/dist/client/assets/{sheet-M6dgbK60.js → sheet-Ct7wtAfe.js} +1 -1
  151. package/dist/client/assets/shell-controls-DU_OnqdT.js +1 -0
  152. package/dist/client/assets/{shell-layout-CnTaR8UN.js → shell-layout-CDjO22II.js} +1 -1
  153. package/dist/client/assets/shell-route-loading-CqrB-PeS.js +1 -0
  154. package/dist/client/assets/{sidebar-oYab2QX7.js → sidebar-s0ed1fkY.js} +1 -1
  155. package/dist/client/assets/{skeleton-DoPnd-4p.js → skeleton-C_Ikhywu.js} +1 -1
  156. package/dist/client/assets/{sortable.esm-D8GIYMew.js → sortable.esm-7lIk8nOy.js} +2 -2
  157. package/dist/client/assets/{sso-C9l3tEYi.js → sso-CoJgF1-W.js} +1 -1
  158. package/dist/client/assets/{store-DXXRJ_VG.js → store-BPq7Nqia.js} +1 -1
  159. package/dist/client/assets/store-registry-BnNC38bf.js +2 -0
  160. package/dist/client/assets/{studio-tools-4NjxmaVZ.js → studio-tools-HEHEmVw-.js} +1 -1
  161. package/dist/client/assets/{switch-DLNzAYS1.js → switch-D5rba96V.js} +1 -1
  162. package/dist/client/assets/{tab-id-BptcWVWa.js → tab-id-AX1D_RMI.js} +1 -1
  163. package/dist/client/assets/{table-B06cGuvx.js → table-62RfQr_D.js} +1 -1
  164. package/dist/client/assets/{tabs-8VxbUDVb.js → tabs-oM87nUQU.js} +1 -1
  165. package/dist/client/assets/{task-status-Cm29b2AK.js → task-status-CeaMIgEp.js} +1 -1
  166. package/dist/client/assets/{textarea-Bwn2Wdf8.js → textarea-CVXNf-WA.js} +1 -1
  167. package/dist/client/assets/{toggle-group-CndOAl-N.js → toggle-group-BKEhvkzp.js} +1 -1
  168. package/dist/client/assets/toolbar-BupXX3L-.js +1 -0
  169. package/dist/client/assets/toolbar-icon-button-SISLmn3t.js +1 -0
  170. package/dist/client/assets/{tools-list-DL7ip2gg.js → tools-list-DUfNx_di.js} +1 -1
  171. package/dist/client/assets/tooltip-Bmj8PlAJ.js +1 -0
  172. package/dist/client/assets/{types-U3TqUYrY.js → types-Op5a7f4H.js} +4 -4
  173. package/dist/client/assets/{use-ai-providers-D4m0Vu5Q.js → use-ai-providers-la4AIHaF.js} +1 -1
  174. package/dist/client/assets/{use-automations-ChKoVegP.js → use-automations-DEaRUIlF.js} +1 -1
  175. package/dist/client/assets/{use-capability-CQPMPR-5.js → use-capability-BHX3IXJ3.js} +1 -1
  176. package/dist/client/assets/{use-clock-tick-CJO5qoT7.js → use-clock-tick-CFuWOCEr.js} +1 -1
  177. package/dist/client/assets/{use-collections-DAKL2YGx.js → use-collections-CrBZtgZk.js} +1 -1
  178. package/dist/client/assets/{use-connection-BvgL1-Da.js → use-connection-DKlrZD28.js} +1 -1
  179. package/dist/client/assets/{use-copy-WaepYGtr.js → use-copy-Bh4dFYsC.js} +1 -1
  180. package/dist/client/assets/use-create-virtual-mcp-C3Y4h4CF.js +1 -0
  181. package/dist/client/assets/{use-debounced-autosave-mA5Fw-09.js → use-debounced-autosave-Ygvicrk8.js} +1 -1
  182. package/dist/client/assets/{use-debounced-value-cQ7ZQKtl.js → use-debounced-value-2_5DMhS6.js} +1 -1
  183. package/dist/client/assets/{use-decopilot-events-BDkaUhLT.js → use-decopilot-events-CVwOiMhy.js} +1 -1
  184. package/dist/client/assets/{use-delete-connection-B9XKLaZf.js → use-delete-connection-CTv7SwDX.js} +1 -1
  185. package/dist/client/assets/{use-file-configs-Dfeoim5G.js → use-file-configs-D21Ck6kN.js} +1 -1
  186. package/dist/client/assets/{use-infinite-scroll-4tV6tFjB.js → use-infinite-scroll-DuPlVcYm.js} +1 -1
  187. package/dist/client/assets/{use-join-requests-CdAJlpjO.js → use-join-requests-CZlC6_lG.js} +1 -1
  188. package/dist/client/assets/{use-mcp-client-CherrXvD.js → use-mcp-client-CWJJ80Qb.js} +1 -1
  189. package/dist/client/assets/{use-mcp-prompts-BnOdccbh.js → use-mcp-prompts-C9VlrieU.js} +1 -1
  190. package/dist/client/assets/{use-mcp-tools-w6KwNDra.js → use-mcp-tools-CXfsDocs.js} +1 -1
  191. package/dist/client/assets/{use-members-ge80zFlj.js → use-members-BUflZqKM.js} +1 -1
  192. package/dist/client/assets/{use-mobile-lIIxFH5C.js → use-mobile-Cg20Hyt3.js} +1 -1
  193. package/dist/client/assets/{use-navigate-to-agent-BtVHPn7N.js → use-navigate-to-agent-Vbfee0Zl.js} +1 -1
  194. package/dist/client/assets/{use-org-auth-client-Ctxe3HXF.js → use-org-auth-client-C_5ald3U.js} +1 -1
  195. package/dist/client/assets/{use-org-fs-D-40uH2W.js → use-org-fs-BwJ8cmxH.js} +1 -1
  196. package/dist/client/assets/{use-org-sso-BxzKK5rO.js → use-org-sso-BSFJGRQT.js} +1 -1
  197. package/dist/client/assets/{use-organization-roles-DmQYT9Pn.js → use-organization-roles-DChXn0D6.js} +1 -1
  198. package/dist/client/assets/{use-organization-settings-CZfEdu0P.js → use-organization-settings-DJVuBTtS.js} +1 -1
  199. package/dist/client/assets/{use-registry-connections-C_VqH6te.js → use-registry-connections-M3aYVWwj.js} +1 -1
  200. package/dist/client/assets/{use-secrets-Dn4coT0R.js → use-secrets-BJQohwUW.js} +1 -1
  201. package/dist/client/assets/{use-status-sounds-CWHPQWBO.js → use-status-sounds-CGe3HaCo.js} +1 -1
  202. package/dist/client/assets/{use-view-mode--ERDyrf1.js → use-view-mode-DGxdFIYR.js} +1 -1
  203. package/dist/client/assets/{use-virtual-mcp-C5pbd140.js → use-virtual-mcp-CHZDkVtB.js} +1 -1
  204. package/dist/client/assets/useInfiniteQuery-yG_KEAOQ.js +1 -0
  205. package/dist/client/assets/useSuspenseInfiniteQuery-CnJ1E1GC.js +1 -0
  206. package/dist/client/assets/{useSuspenseQueries-CRdXyKYB.js → useSuspenseQueries-DmSeACIV.js} +1 -1
  207. package/dist/client/assets/variant-calendar-Cunl_q8R.js +1 -0
  208. package/dist/client/assets/{view-mode-toggle-BP4LoXpd.js → view-mode-toggle-468Aaag6.js} +1 -1
  209. package/dist/client/index.html +2 -2
  210. package/dist/server/cli.js +2 -2
  211. package/dist/server/server.js +1 -1
  212. package/package.json +1 -1
  213. package/dist/client/assets/ChevronLeft-B-p3uhTp.js +0 -1
  214. package/dist/client/assets/agent-icon-CCm6veEh.js +0 -1
  215. package/dist/client/assets/agents-list-CsmaOmeB.js +0 -1
  216. package/dist/client/assets/app-editor-D5hlOetk.js +0 -1
  217. package/dist/client/assets/automation-runs-CXnAhWiY.js +0 -1
  218. package/dist/client/assets/automations-akz_oClO.js +0 -1
  219. package/dist/client/assets/bulk-category-panel-Bu7vkdyV.js +0 -1
  220. package/dist/client/assets/category-editor-AxaHD2PX.js +0 -1
  221. package/dist/client/assets/collection-detail-DEEAX0DE.js +0 -1
  222. package/dist/client/assets/commerce-onboarding-CljjzqU2.js +0 -1
  223. package/dist/client/assets/connection-detail-Dt-8hGUD.js +0 -1
  224. package/dist/client/assets/connections-D2zRczhs.js +0 -1
  225. package/dist/client/assets/file-explorer-dyfhIxpy.js +0 -2
  226. package/dist/client/assets/index-BqKQnks_.css +0 -1
  227. package/dist/client/assets/index-BvxT8QID.js +0 -1
  228. package/dist/client/assets/index-CU_03aq0.js +0 -1
  229. package/dist/client/assets/index-Db0TT11B.js +0 -169
  230. package/dist/client/assets/page-seo-sheet-D8FULk67.js +0 -1
  231. package/dist/client/assets/popover-DowpnV25.js +0 -1
  232. package/dist/client/assets/post-editor-SVRg54TN.js +0 -1
  233. package/dist/client/assets/preview-dialog-CwTtT7qa.js +0 -5
  234. package/dist/client/assets/project-app-view-BQ4gYl-m.js +0 -1
  235. package/dist/client/assets/record-editor-BNOUgLnP.js +0 -1
  236. package/dist/client/assets/registry-Bo4vnNv4.js +0 -2
  237. package/dist/client/assets/roles-DTMTF-Ml.js +0 -1
  238. package/dist/client/assets/select-CZgnwyj0.js +0 -1
  239. package/dist/client/assets/seo-editor-BCj_Owpk.js +0 -1
  240. package/dist/client/assets/settings-layout-QQo5fqWD.js +0 -1
  241. package/dist/client/assets/shell-controls-CqC5zeBM.js +0 -1
  242. package/dist/client/assets/shell-route-loading-DFu6UBUI.js +0 -1
  243. package/dist/client/assets/store-registry-DuMrJjAm.js +0 -2
  244. package/dist/client/assets/toolbar-ClL4Dhs_.js +0 -1
  245. package/dist/client/assets/tooltip-DvT2WKW9.js +0 -1
  246. package/dist/client/assets/use-create-virtual-mcp-BSTwTG_J.js +0 -1
  247. package/dist/client/assets/useInfiniteQuery-_sl5B1oR.js +0 -1
  248. package/dist/client/assets/useSuspenseInfiniteQuery-_eC9d3ii.js +0 -1
  249. package/dist/client/assets/variant-calendar-Dqcgu1C1.js +0 -1
@@ -1 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,D as $,b1 as k,K as D,l as E,j as x}from"./index-5MyNR89x.js";import{u as K}from"./use-registry-connections-C_VqH6te.js";import{b as Q}from"./use-organization-settings-CZfEdu0P.js";import{S as w,e as F}from"./use-mcp-client-CherrXvD.js";import{u as H}from"./useInfiniteQuery-_sl5B1oR.js";import{i as q,f as G}from"./extract-connection-data-CxK1dunT.js";import{C as U}from"./card-D3bKVB8y.js";import{I as V}from"./integration-icon-CMGCCNyJ.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{c as R,D as $,b0 as k,K as D,l as E,j as x}from"./index-CcSfK5lN.js";import{u as K}from"./use-registry-connections-M3aYVWwj.js";import{b as Q}from"./use-organization-settings-DJVuBTtS.js";import{S as w,e as F}from"./use-mcp-client-CWJJ80Qb.js";import{u as H}from"./useInfiniteQuery-yG_KEAOQ.js";import{i as q,f as G}from"./extract-connection-data-qNy8FwuR.js";import{C as U}from"./card-Cw03QSbR.js";import{I as V}from"./integration-icon-DN8Vp_dc.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function A(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:b}=H({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=q(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await F({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const P=await C.callTool({name:j,arguments:I}),N=P.structuredContent??P,M=N.nextCursor||N.cursor||void 0,L=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:L,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:b,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const b=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==b||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:b,loadMore:a},t[10]=c,t[11]=b,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return A(s)}function Z(s){return!A(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,b=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==b?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",b,d),e[0]=d,e[1]=b,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let P;e[28]!==m?(P=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=P):P=e[29];let N;e[30]!==I||e[31]!==P?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,P]}),e[30]=I,e[31]=P,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
@@ -0,0 +1 @@
1
+ import{o as fe,aF as Ie,b6 as Ae,s as le,aD as De,c as P,j as t,i as ge,B as V,r as G,l as je,D as J,q as $e,K as ne,b as Y,a9 as ce,z as Pe,b7 as Oe,E as ze,e as Me,b8 as Ee,m as Ve,p as Ue,n as Fe,t as q,b9 as Re}from"./index-CcSfK5lN.js";import{a as Le}from"./extract-connection-data-qNy8FwuR.js";import{E as ve}from"./empty-state-BUpOZfFd.js";import{E as Be,c as He,r as We,b as Xe,d as qe}from"./connection-form-helpers-DP7j8TIB.js";import{c as Ge,S as Ke,V as Qe}from"./index-BEMAWvDc.js";import{u as be,T as Je}from"./tools-list-DUfNx_di.js";import{u as Ye}from"./use-members-BUflZqKM.js";import{A as Ze}from"./avatar-DlocwZ2L.js";import{a as Ne,b as ye,u as et}from"./use-connection-DKlrZD28.js";import{u as _e}from"./use-mcp-client-CWJJ80Qb.js";import{a as tt}from"./use-mcp-tools-CXfsDocs.js";import{a as st}from"./use-mcp-prompts-C9VlrieU.js";import{i as nt,a as ot}from"./mcp-oauth-BwPcgk4Y.js";import{I as oe}from"./integration-icon-DN8Vp_dc.js";import{s as it}from"./Plus-B6q1KrRb.js";import{C as at,E as rt,am as lt,ab as ct}from"./agent-icon-CGghaYK_.js";import{a as Ce,s as dt}from"./Settings02-D7AphFkm.js";import{s as ae}from"./Trash01-xnv05M2J.js";import{d as mt,c as ut,b as xt,S as pt,a as ht}from"./sheet-Ct7wtAfe.js";import{F as L,b as B,c as H,d as E,e as W,f as ft,a as gt}from"./form-BCFMjlpa.js";import{I as X}from"./input-DP5SZ5ZB.js";import{u as jt,D as vt}from"./use-delete-connection-CTv7SwDX.js";import{c as bt,C as Nt,B as yt,a as _t,b as Ct,d as St,e as wt}from"./monitoring-stats-row-DwWeNnqf.js";import{u as kt}from"./studio-tools-HEHEmVw-.js";import{u as Tt}from"./use-virtual-mcp-CHZDkVtB.js";import{i as Se}from"./ChevronRight-DCf9L0Ls.js";import{a as we}from"./Users03-UgyNhO90.js";import{b as ee,a as It,c as te,T as At}from"./tabs-oM87nUQU.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{n as Dt}from"./ZapSquare-_6Gbk0W4.js";import{c as $t}from"./Tool01-CYPQsW1Y.js";import{g as re,M as Pt}from"./types-Op5a7f4H.js";import{C as Ot}from"./collection-search-3IpRbGNr.js";import{C as zt}from"./card-Cw03QSbR.js";import{B as Mt}from"./badge-D5YEUUHD.js";import{D as Et,a as Vt,b as Ut,c as de}from"./dropdown-menu-DxGNuqoA.js";import{S as me,a as ue,b as xe,c as pe,d as R}from"./select-0LBXKeau.js";import{i as Ft}from"./CheckCircle-BtIJRHva.js";import{t as Rt}from"./ChevronDown-Ee_3Sayw.js";import{n as Lt}from"./XCircle-DaUcrc3Z.js";import{s as se}from"./Star01-Bf-FCZNm.js";import{s as Bt}from"./XClose-Dpj0HG8O.js";import"./index-BLrDPPMI.js";import"./sidebar-s0ed1fkY.js";import"./LayoutLeft-BtE5tmf6.js";import"./use-mobile-Cg20Hyt3.js";import"./tooltip-Bmj8PlAJ.js";import"./ZoomOut-sMdcQ1z1.js";import"./Key01-DV-6LIf3.js";import"./auth-ThTV5Po4.js";import"./use-registry-connections-M3aYVWwj.js";import"./use-organization-settings-DJVuBTtS.js";import"./index-CK3mNMke.js";import"./index-Ckv1trie.js";import"./index-RTYNd1V2.js";import"./popover-B5x5gTCp.js";import"./ChevronUp-CGE39voI.js";import"./SearchMd-CXYhXBwx.js";import"./use-create-virtual-mcp-C3Y4h4CF.js";import"./use-navigate-to-agent-Vbfee0Zl.js";import"./Eye-fTf2jKhH.js";import"./use-org-auth-client-C_5ald3U.js";import"./User01-DuB-iQs0.js";import"./use-collections-CrBZtgZk.js";import"./AlertCircle-BxTbR_B1.js";import"./SwitchHorizontal01-5oVLoUdS.js";import"./ArrowUpRight-S4NNBOkv.js";import"./DotsVertical-fVEXRB26.js";import"./Stars02-BQPdDCaK.js";import"./Globe01-DYSo0Sr2.js";import"./FilterLines-Ba5JOCcM.js";import"./Globe04-3H1XgmQN.js";import"./HardDrive-JOn6Ez5n.js";import"./LinkExternal01-CALVZhat.js";import"./Monitor01-CWc8cxQO.js";import"./Sun-BkeePoRn.js";import"./Palette-Dok2NINN.js";import"./Play-CllDczEk.js";import"./SearchLg-ZiEk0E-L.js";import"./Shield01-DKJBa4Nn.js";import"./Stars01-DlOkHfPH.js";import"./Upload01-Cxp7zIDh.js";import"./Users01-BkkYER_Z.js";import"./X-DJbyjHqp.js";import"./Zap-3WgTvh1l.js";import"./label-BwKyZwbE.js";import"./alert-dialog-BS58YIPS.js";const Ht=fe({scopes:De(le()).describe("List of scopes available"),stateSchema:Ie(le(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:fe({}),outputSchema:Ht}];function Xt(s){const e=P.c(46),{instance:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i}=s;let c;e[0]!==n.id?(c={connectionId:n.id},e[0]=n.id,e[1]=c):c=e[1];const l=be(c),x=!(n.connection_type==="VIRTUAL")&&l.supportsOAuth&&!l.isAuthenticated,p=n.status!=="active",d=x||p?"border-destructive/50 bg-destructive/5":"border-transparent";let f;e[2]!==d?(f=je("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",d),e[2]=d,e[3]=f):f=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let v;e[7]!==n.title?(v=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=v):v=e[8];let b;e[9]!==n.status||e[10]!==p||e[11]!==x?(b=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?"Disabled (error)":"Disabled"}):null,e[9]=n.status,e[10]=p,e[11]=x,e[12]=b):b=e[12];let j;e[13]!==v||e[14]!==b?(j=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,b]}),e[13]=v,e[14]=b,e[15]=j):j=e[15];let N;e[16]!==n||e[17]!==x||e[18]!==r?(N=x&&t.jsx(V,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>r(n),children:"Authorize"}),e[16]=n,e[17]=x,e[18]=r,e[19]=N):N=e[19];let T;e[20]!==n||e[21]!==p||e[22]!==i?(T=p?t.jsxs(V,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>i(n,"active"),children:[t.jsx(at,{size:13}),"Enable"]}):t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>i(n,"inactive"),title:"Disable",children:t.jsx(rt,{size:13})}),e[20]=n,e[21]=p,e[22]=i,e[23]=T):T=e[23];let S;e[24]!==n||e[25]!==a?(S=()=>a(n),e[24]=n,e[25]=a,e[26]=S):S=e[26];let y;e[27]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Ce,{size:13}),e[27]=y):y=e[27];let I;e[28]!==S?(I=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:S,title:"Configure",children:y}),e[28]=S,e[29]=I):I=e[29];let _;e[30]!==n||e[31]!==o?(_=()=>o(n),e[30]=n,e[31]=o,e[32]=_):_=e[32];let k;e[33]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ae,{size:13}),e[33]=k):k=e[33];let C;e[34]!==_?(C=t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:_,title:"Delete",children:k}),e[34]=_,e[35]=C):C=e[35];let h;e[36]!==I||e[37]!==C||e[38]!==N||e[39]!==T?(h=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[N,T,I,C]}),e[36]=I,e[37]=C,e[38]=N,e[39]=T,e[40]=h):h=e[40];let w;return e[41]!==h||e[42]!==f||e[43]!==g||e[44]!==j?(w=t.jsxs("div",{className:f,children:[g,j,h]}),e[41]=h,e[42]=f,e[43]=g,e[44]=j,e[45]=w):w=e[45],w}function qt(s){const e=P.c(15),{instance:n,onConfigure:a}=s;let r;e[0]!==n.icon||e[1]!==n.title?(r=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=r):r=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>a(n),e[5]=n,e[6]=a,e[7]=i):i=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Ce,{size:13}),e[8]=c):c=e[8];let l;e[9]!==i?(l=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:i,title:"Configure",children:c})}),e[9]=i,e[10]=l):l=e[10];let u;return e[11]!==r||e[12]!==o||e[13]!==l?(u=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[r,o,l]}),e[11]=r,e[12]=o,e[13]=l,e[14]=u):u=e[14],u}function Gt(s){const e=P.c(27),{instances:n,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i,onAdd:c,isAdding:l}=s;if(n.length===0)return null;const u=n.length===1?"Instance":"Instances";let x;e[0]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[0]=u,e[1]=x):x=e[1];let p;e[2]!==l?(p=l?t.jsx(ge,{size:13,className:"animate-spin"}):t.jsx(it,{size:13}),e[2]=l,e[3]=p):p=e[3];let d;e[4]!==l||e[5]!==c||e[6]!==p?(d=t.jsxs(V,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:c,disabled:l,children:[p,"Add instance"]}),e[4]=l,e[5]=c,e[6]=p,e[7]=d):d=e[7];let f;e[8]!==x||e[9]!==d?(f=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,d]}),e[8]=x,e[9]=d,e[10]=f):f=e[10];let g;if(e[11]!==n||e[12]!==r||e[13]!==a||e[14]!==o||e[15]!==i){let j;e[17]!==r||e[18]!==a||e[19]!==o||e[20]!==i?(j=N=>t.jsx(G.Suspense,{fallback:t.jsx(qt,{instance:N,onConfigure:a}),children:t.jsx(Xt,{instance:N,onConfigure:a,onAuthenticate:r,onDelete:o,onToggleStatus:i})},N.id),e[17]=r,e[18]=a,e[19]=o,e[20]=i,e[21]=j):j=e[21],g=n.map(j),e[11]=n,e[12]=r,e[13]=a,e[14]=o,e[15]=i,e[16]=g}else g=e[16];let v;e[22]!==g?(v=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:g}),e[22]=g,e[23]=v):v=e[23];let b;return e[24]!==f||e[25]!==v?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,v]}),e[24]=f,e[25]=v,e[26]=b):b=e[26],b}const Kt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Qt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Jt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Yt(s){const e=P.c(1),{connectionId:n,orgId:a,timeframe:r}=s,o=kt(),i=Qt(r),{data:c}=$e({queryKey:ne.connectionActivity(n,r,a),queryFn:async()=>await o.call("MONITORING_LOGS_LIST",{startDate:i.startDate.toISOString(),endDate:i.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),l=bt(c?.logs??[],i),u=l.data,x=l.totalCalls>0;let p;return e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[0]=p):p=e[0],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:l.totalCalls.toLocaleString()}),p]}),l.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:l.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),l.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(l.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),x?t.jsxs("div",{children:[t.jsx(Nt,{config:Jt,className:"h-16 w-full",children:t.jsxs(yt,{data:u,barCategoryGap:"4%",children:[t.jsx(_t,{content:t.jsx(Ct,{labelFormatter:es}),cursor:{fill:"var(--muted)"}}),t.jsx(St,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:u.map(Zt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:u[u.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Zt(s,e){return t.jsx(wt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function es(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function ts(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ss(s){const e=P.c(13),{connectionId:n}=s,[a,r]=G.useState("14d"),{org:o}=J();let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=i):i=e[0];let c;e[1]!==a?(c=Kt.map(d=>t.jsx("button",{type:"button",onClick:()=>r(d.value),className:je("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===d.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:d.label},d.value)),e[1]=a,e[2]=c):c=e[2];let l;e[3]!==c?(l=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[i,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=l):l=e[4];let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ts,{}),e[5]=u):u=e[5];let x;e[6]!==n||e[7]!==o.id||e[8]!==a?(x=t.jsx(G.Suspense,{fallback:u,children:t.jsx(Yt,{connectionId:n,orgId:o.id,timeframe:a})}),e[6]=n,e[7]=o.id,e[8]=a,e[9]=x):x=e[9];let p;return e[10]!==l||e[11]!==x?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,x]}),e[10]=l,e[11]=x,e[12]=p):p=e[12],p}function ns(s){const e=P.c(15),{virtualMcp:n,org:a}=s,r=Y();let o;e[0]!==r||e[1]!==a||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();r({to:"/$org/$taskId",params:{org:a,taskId:p},search:{virtualmcpid:n.id}})},e[0]=r,e[1]=a,e[2]=n.id,e[3]=o):o=e[3];let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(we,{size:16}),e[4]=i):i=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:i}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let l;e[8]!==n.title?(l=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let u;e[10]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Se,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=u):u=e[10];let x;return e[11]!==o||e[12]!==c||e[13]!==l?(x=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,l,u]}),e[11]=o,e[12]=c,e[13]=l,e[14]=x):x=e[14],x}function os(s){const e=P.c(7),{virtualMcps:n,org:a}=s;let r;if(e[0]!==a||e[1]!==n){let i;e[3]!==a?(i=c=>t.jsx(ns,{virtualMcp:c,org:a},c.id),e[3]=a,e[4]=i):i=e[4],r=n.map(i),e[0]=a,e[1]=n,e[2]=r}else r=e[2];let o;return e[5]!==r?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:r})}),e[5]=r,e[6]=o):o=e[6],o}function is(s){const e=P.c(7),{connection:n}=s,{org:a}=J();let r;e[0]!==n.id?(r={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=r):r=e[1];const o=Tt(r);if(!(o.length>0)){let u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(t.Fragment,{}),e[2]=u):u=e[2],u}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let l;return e[4]!==a.slug||e[5]!==o?(l=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(os,{virtualMcps:o,org:a.slug})})]}),e[4]=a.slug,e[5]=o,e[6]=l):l=e[6],l}function as(s){const e=P.c(31),{tools:n,connectionId:a,org:r}=s,o=Y(),{org:i}=J();let c;e[0]!==a||e[1]!==i.id||e[2]!==i.slug?(c={connectionId:a,orgId:i.id,orgSlug:i.slug},e[0]=a,e[1]=i.id,e[2]=i.slug,e[3]=c):c=e[3];const l=_e(c),u=Ne(a);let x;e[4]!==u||e[5]!==a?(x=u?ke(u):a,e[4]=u,e[5]=a,e[6]=x):x=e[6];const p=x,[d,f]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==d||e[12]!==n){const S=(n??[]).filter(rs),y=d.toLowerCase().trim(),I=y?S.filter(h=>h.name.toLowerCase().includes(y)||h.description&&h.description.toLowerCase().includes(y)):S;let _;e[17]!==p||e[18]!==o||e[19]!==r?(_=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=r,e[20]=_):_=e[20];const k=_;b="flex flex-col h-full overflow-hidden";let C;e[21]===Symbol.for("react.memo_cache_sentinel")?(C=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=C):C=e[21],e[22]!==d?(j=t.jsx(Ot,{value:d,onChange:f,placeholder:"Search apps...",onKeyDown:C}),e[22]=d,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=I.length===0?t.jsx(ve,{image:null,title:d?"No apps found":"No apps available",description:d?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:I.map(h=>{const w=re(h._meta);return t.jsxs(zt,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>k(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Pt,{resourceURI:w,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:l})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=l,e[9]=o,e[10]=r,e[11]=d,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let N;e[24]!==g||e[25]!==v?(N=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=N):N=e[26];let T;return e[27]!==b||e[28]!==j||e[29]!==N?(T=t.jsxs("div",{className:b,children:[j,N]}),e[27]=b,e[28]=j,e[29]=N,e[30]=T):T=e[30],T}function rs(s){return!!re(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=i=>i.charAt(0).toUpperCase()+i.slice(1),a=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),r=e.map(n),o=e[e.length-1];return r.length>=2&&o&&a.has(o)?[r.pop(),...r].join(" "):r.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let a;return e[0]!==n?(a=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=a):a=e[1],a}function ls(s){const e=P.c(50),{tools:n,prompts:a,resources:r,connectionId:o,org:i}=s;let c;e[0]!==a?(c=a===void 0?[]:a,e[0]=a,e[1]=c):c=e[1];const l=c;let u;e[2]!==r?(u=r===void 0?[]:r,e[2]=r,e[3]=u):u=e[3];const x=u,p=Y(),d=Ne(o??"");let f;e[4]!==d||e[5]!==o?(f=d?ke(d):o,e[4]=d,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==i?(v=function(D){!o||!i||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=i,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==i||e[14]!==n?(j=o&&i&&n.some(ms),e[12]=o,e[13]=i,e[14]=n,e[15]=j):j=e[15];const N=j;if(n.length+l.length+x.length===0){let m;return e[16]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=m):m=e[16],m}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let y;e[19]!==N?(y=N&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=N,e[20]=y):y=e[20];let I,_;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),_=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=I,e[22]=_):(I=e[21],_=e[22]);let k;e[23]!==S||e[24]!==y?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(It,{variant:"underline",className:"gap-1",children:[S,y,I,_]})}),e[23]=S,e[24]=y,e[25]=k):k=e[25];let C;e[26]!==b||e[27]!==n?(C=n.length>0?n.map(m=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(m.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx($t,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(m.name)}),m.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:m.description})]}),t.jsx(Se,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},m.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=C):C=e[28];let h;e[29]!==C?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:C})}),e[29]=C,e[30]=h):h=e[30];let w;e[31]!==o||e[32]!==N||e[33]!==i||e[34]!==n?(w=N&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(as,{tools:n,connectionId:o,org:i})}),e[31]=o,e[32]=N,e[33]=i,e[34]=n,e[35]=w):w=e[35];let z;e[36]!==l?(z=l.length>0?l.map(ds):t.jsx(ie,{label:"prompts"}),e[36]=l,e[37]=z):z=e[37];let O;e[38]!==z?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[38]=z,e[39]=O):O=e[39];let A;e[40]!==x?(A=x.length>0?x.map(cs):t.jsx(ie,{label:"resources"}),e[40]=x,e[41]=A):A=e[41];let M;e[42]!==A?(M=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[42]=A,e[43]=M):M=e[43];let U;return e[44]!==k||e[45]!==h||e[46]!==w||e[47]!==O||e[48]!==M?(U=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(At,{defaultValue:"tools",variant:"underline",children:[k,h,w,O,M]})}),e[44]=k,e[45]=h,e[46]=w,e[47]=O,e[48]=M,e[49]=U):U=e[49],U}function cs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(lt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ds(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Dt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function ms(s){return re(s._meta)}function us(s){const e=P.c(13),{connection:n,displayTitle:a}=s,r=a??n.title;let o;e[0]!==n.icon||e[1]!==r?(o=t.jsx(oe,{icon:n.icon,name:r,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=r,e[2]=o):o=e[2];let i;e[3]!==r?(i=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:r})}),e[3]=r,e[4]=i):i=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let l;e[7]!==i||e[8]!==c?(l=t.jsxs("div",{className:"flex-1 min-w-0",children:[i,c]}),e[7]=i,e[8]=c,e[9]=l):l=e[9];let u;return e[10]!==o||e[11]!==l?(u=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,l]}),e[10]=o,e[11]=l,e[12]=u):u=e[12],u}function xs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:a,onRemoveOAuth:r}){const o=ce({control:s.control,name:"ui_type"}),i=ce({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),l=(()=>{if(typeof i!="string"||!i)return!1;try{const d=new URL(i);return d.hostname==="api.githubcopilot.com"&&d.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=c||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",p=x?Oe(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Type"}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(L,{control:s.control,name:"ui_type",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsxs(ue,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(xe,{})]})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:"HTTP"}),t.jsx(R,{value:"SSE",children:"SSE"}),t.jsx(R,{value:"Websocket",children:"Websocket"}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:"NPX Package"}),t.jsx(R,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(L,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(B,{className:"flex-1 min-w-0",children:t.jsx(E,{children:t.jsx(X,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(me,{value:d.value,onValueChange:d.onChange,children:[t.jsx(E,{children:t.jsx(ue,{className:"h-10",children:t.jsx(xe,{})})}),t.jsxs(pe,{children:[t.jsx(R,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(R,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(R,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(R,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Lt,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(R,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ct,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(W,{})]})}),o==="NPX"&&t.jsx(L,{control:s.control,name:"npx_package",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(E,{children:t.jsx(X,{placeholder:"@perplexity-ai/mcp-server",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(L,{control:s.control,name:"stdio_command",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(E,{children:t.jsx(X,{placeholder:"node, bun, python...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(L,{control:s.control,name:"stdio_args",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(E,{children:t.jsx(X,{placeholder:"arg1 arg2 --flag value",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(W,{})]})})]}),t.jsx(L,{control:s.control,name:"stdio_cwd",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(E,{children:t.jsx(X,{placeholder:"/path/to/project (optional)",...d,value:d.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(L,{control:s.control,name:"env_vars",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(E,{children:t.jsx(Be,{value:d.value??[],onChange:d.onChange})}),t.jsx(W,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(L,{control:s.control,name:"connection_token",render:({field:d})=>t.jsxs(B,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:l?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Et,{children:[t.jsx(Vt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Mt,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),"Authenticated via OAuth",t.jsx(Rt,{size:12})]})})}),t.jsxs(Ut,{align:"start",children:[t.jsxs(de,{onClick:a,children:[t.jsx(dt,{size:16}),"Re-authenticate"]}),t.jsxs(de,{variant:"destructive",onClick:r,children:[t.jsx(ae,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&d.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>d.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:"Clear and replace token",children:t.jsx(Bt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(E,{children:t.jsx(X,{type:"password",placeholder:l?"Paste your GitHub PAT":"Enter access token...",...d,value:d.value||"",className:"h-10 rounded-lg"})}),l&&t.jsxs(ft,{children:["Create a PAT at"," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function ps(s){return s.command==="npx"}function hs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function fs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Re(s.connection_headers)){const a=s.connection_headers,r=We(a.envVars);if(ps(a)){const i=hs(a);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:i,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:r}}const o=fs(a);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:r}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function gs(s){let e,n=null,a=null,r=null;return s.ui_type==="NPX"?(e="STDIO",n="",r=Xe(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",r=qe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",a=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...a&&{connection_token:a},...r&&{connection_headers:r},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function js({connection:s,connectionId:e,org:n,isUpdating:a,tools:r,prompts:o,resources:i,siblings:c}){const l=Y({from:"/$org/settings/connections/$appSlug"}),u=Ve(),x=ye(),{org:p}=J(),d=jt({onSuccess:()=>{c.length<=1&&l({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=G.useState(null),[v,b]=G.useState(!1),j=be({connectionId:e}),{data:N}=Ye(),T=N?.data?.members??[],S=f??s,y=T.find(m=>m.userId===S.created_by),_=s?.connection_type==="VIRTUAL"||j.isAuthenticated,k={...s,tools:r},C=Ge(k,Wt),h=Ue({resolver:Fe(He),values:he(f??s)}),w=h.formState.isDirty,z=async()=>{if(!await h.trigger())return;const D=h.getValues(),$=gs(D),F=f?.id??e;await x.update.mutateAsync({id:F,data:$}),h.reset(D)},O=()=>{h.reset(he(f??s))},A=async m=>{const{token:D,tokenInfo:$,error:F}=await ot({connectionId:m,orgSlug:p.slug,scope:"offline_access"});if(F||!D){q.error(`Authentication failed: ${F}`);return}if($)try{const K=await fetch(`/api/${p.slug}/connections/${m}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!K.ok)console.error("Failed to save OAuth token:",await K.text()),await x.update.mutateAsync({id:m,data:{connection_token:D}});else try{await x.update.mutateAsync({id:m,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(K){console.error("Error saving OAuth token:",K),await x.update.mutateAsync({id:m,data:{connection_token:D}})}else await x.update.mutateAsync({id:m,data:{connection_token:D}});const Q=new URL(`/api/${p.slug}/mcp/${m}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ne.mcpClientPrefix()}),q.success("Authentication successful")},M=()=>A(s.id),U=async()=>{try{const m=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!m.ok){const $=await m.text();q.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(m){console.error("Error removing OAuth token:",m),q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(vt,{...d}),t.jsx(mt,{open:f!==null,onOpenChange:m=>{m||g(null)},children:t.jsxs(ut,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(xt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(pt,{className:"text-base",children:f?.title??s.title}),t.jsx(ht,{className:"text-xs",children:"Update URL, authentication, and other settings"}),y&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:y.user?.image??void 0,fallback:y.user?.name??y.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:y.user?.name||y.user?.email})]})]}),t.jsxs(gt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(L,{control:h.control,name:"title",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Name"}),t.jsx(E,{children:t.jsx(X,{...m})}),t.jsx(W,{})]})}),t.jsx(L,{control:h.control,name:"description",render:({field:m})=>t.jsxs(B,{children:[t.jsx(H,{children:"Description"}),t.jsx(E,{children:t.jsx(X,{...m,value:m.value||""})}),t.jsx(W,{})]})})]}),t.jsx(xs,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:M,onRemoveOAuth:U}),t.jsx(Ke,{connection:f??s,form:h,hasMcpBinding:C,isMCPAuthenticated:_,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:M,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(V,{onClick:z,disabled:!w||a,className:"flex-1",children:a?"Saving…":"Save changes"}),w&&t.jsx(V,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(V,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const m=f??s;g(null),d.requestDelete(m)},children:[t.jsx(ae,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(Qe,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(us,{connection:s,displayTitle:(()=>{const m=c[0]??s;return m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ss,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Gt,{instances:c,onConfigure:m=>g(m),onAuthenticate:m=>A(m.id),onDelete:m=>d.requestDelete(m),onToggleStatus:async(m,D)=>{try{await x.update.mutateAsync({id:m.id,data:{status:D}}),q.success(D==="active"?"Connection enabled":"Connection disabled")}catch{q.error("Failed to update connection")}},isAdding:v,onAdd:async()=>{b(!0);try{const m=c[0]??s,D=m.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,F=`${D} (${$})`,Q=Le("conn");await x.create.mutateAsync({id:Q,title:F,description:m.description??null,connection_type:m.connection_type,connection_url:m.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:m.created_by,organization_id:m.organization_id,icon:m.icon??null,app_name:m.app_name??null,app_id:m.app_id??null,connection_headers:m.connection_headers??null,oauth_config:null,configuration_state:m.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const K=new URL(`/api/${p.slug}/mcp/${Q}`,window.location.origin),Z=await nt({url:K.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await A(Q)}finally{b(!1)}}}),t.jsx(is,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(ls,{tools:r,prompts:o,resources:i,connectionId:e,org:n})})]})})]})})]})}function vs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:r,org:o}=Me(a),{org:i}=J(),c=ye();let l;s[2]!==r?(l={slug:r},s[2]=r,s[3]=l):l=s[3];const u=et(l),x=u[0]??null,p=x?.id??"",d=p||null;let f;s[4]!==i.id||s[5]!==i.slug||s[6]!==d?(f={connectionId:d,orgId:i.id,orgSlug:i.slug},s[4]=i.id,s[5]=i.slug,s[6]=d,s[7]=f):f=s[7];const g=_e(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=tt(v);let j;if(s[10]!==x?.tools||s[11]!==p||s[12]!==u||s[13]!==b){const A=b?b.tools.map(Ss):(x?.tools??[]).map(Cs);e:{if(u.length<=1){j=A;break e}const M=new Set,U=[],m=ys;for(const D of u){const $=D.id===p?A:m(D.tools);for(const F of $)M.has(F.name)||(M.add(F.name),U.push(F))}j=U.length>0?U:A}s[10]=x?.tools,s[11]=p,s[12]=u,s[13]=b,s[14]=j}else j=s[14];const N=j;let T;s[15]!==g?(T={client:g},s[15]=g,s[16]=T):T=s[16];const{data:S}=st(T);let y;s[17]!==g?(y={client:g},s[17]=g,s[18]=y):y=s[18];const{data:I}=Ee(y);let _;s[19]!==S?.prompts?(_=S?.prompts??[],s[19]=S?.prompts,s[20]=_):_=s[20];let k;s[21]!==_?(k=_.map(Ns),s[21]=_,s[22]=k):k=s[22];const C=k;let h;s[23]!==I?.resources?(h=I?.resources??[],s[23]=I?.resources,s[24]=h):h=s[24];let w;s[25]!==h?(w=h.map(bs),s[25]=h,s[26]=w):w=s[26];const z=w;if(!x){let A;return s[27]!==n||s[28]!==o?(A=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(ve,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(V,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=A):A=s[29],A}let O;return s[30]!==c.update.isPending||s[31]!==N||s[32]!==x||s[33]!==p||s[34]!==o||s[35]!==C||s[36]!==z||s[37]!==u?(O=t.jsx(js,{org:o,connection:x,connectionId:p,isUpdating:c.update.isPending,tools:N,prompts:C,resources:z,siblings:u}),s[30]=c.update.isPending,s[31]=N,s[32]=x,s[33]=p,s[34]=o,s[35]=C,s[36]=z,s[37]=u,s[38]=O):O=s[38],O}function bs(s){return{name:s.name,description:s.description,uri:s.uri}}function Ns(s){return{name:s.name,description:s.description}}function ys(s){return(s??[]).map(_s)}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Cs(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ws(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ze,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ge,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(vs,{})})}),s[0]=e):e=s[0],e}function ro(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ws,{}),s[0]=e):e=s[0],e}export{ro as default};
@@ -1 +1 @@
1
- import{o as R,aG as A,b8 as I,s as a,aE as j,aF as z,c as L,j as u,B as C}from"./index-5MyNR89x.js";import{I as H}from"./input-D9aeO8wK.js";import{s as W}from"./Plus-hFZ_SbzL.js";import{s as q}from"./Trash01-CGEeRKCz.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:A(a(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function F(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function D(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,D as p,F as r};
1
+ import{o as R,aF as A,b6 as I,s as a,aD as j,aE as z,c as L,j as u,B as C}from"./index-CcSfK5lN.js";import{I as H}from"./input-DP5SZ5ZB.js";import{s as W}from"./Plus-B6q1KrRb.js";import{s as q}from"./Trash01-xnv05M2J.js";const K=R({key:a().min(1,"Key is required"),value:a()}),M=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:A(a(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,M as c,Z as d,Y as i,F as p,D as r};
@@ -0,0 +1 @@
1
+ import{r as E,c as oe,j as t,E as Ye,i as ce,D as be,b as _e,u as Ze,a as Ne,z as et,C as tt,L as nt,p as st,n as ot,B as U,v as te,m as it,l as de,t as W,K as rt}from"./index-CcSfK5lN.js";import{a as lt,b as De,g as at,e as ct}from"./extract-connection-data-qNy8FwuR.js";import{C as dt}from"./collection-display-button-BMNWXm85.js";import{S as mt}from"./search-input-DfY0Idtt.js";import{C as ut}from"./collection-tabs-DddR_OZb.js";import{u as pt,a as ke,g as ht,C as Ce}from"./connection-card-DOtnovDK.js";import{E as gt}from"./empty-state-BUpOZfFd.js";import{I as xt}from"./integration-icon-DN8Vp_dc.js";import{P as ue}from"./index-BLrDPPMI.js";import{u as ft,D as jt}from"./use-delete-connection-CTv7SwDX.js";import{u as ye}from"./use-capability-BHX3IXJ3.js";import{u as yt}from"./use-infinite-scroll-DuPlVcYm.js";import{u as Ct}from"./use-view-mode-DGxdFIYR.js";import{g as he}from"./connection-slug-eyAPH6o3.js";import{c as Ae,d as we,b as Te,A as Ie,e as Pe,g as $e,a as Le,f as Oe}from"./alert-dialog-BS58YIPS.js";import{C as Fe}from"./checkbox-B68Qec99.js";import{e as Me,d as ze,c as Ve,a as Ee,b as Be,D as Ke}from"./dialog-dc-6JiKe.js";import{D as vt,a as St,c as bt,b as _t,d as Nt,e as Dt,f as kt}from"./drawer-xBBvxQN0.js";import{u as At}from"./use-mobile-Cg20Hyt3.js";import{D as Ue,a as Re,b as He,c as re}from"./dropdown-menu-DxGNuqoA.js";import{F as Q,b as J,c as Y,d as Z,e as ee,a as ve}from"./form-BCFMjlpa.js";import{I as ie}from"./input-DP5SZ5ZB.js";import{S as wt,a as Tt,b as It,c as Pt,d as ae}from"./select-0LBXKeau.js";import{T as $t}from"./textarea-CVXNf-WA.js";import{b as We,u as Lt}from"./use-connection-DKlrZD28.js";import{u as Ot}from"./use-virtual-mcp-CHZDkVtB.js";import{u as Ft}from"./studio-tools-HEHEmVw-.js";import{ab as Mt,al as zt,E as Vt,C as Et}from"./agent-icon-CGghaYK_.js";import{n as ge}from"./XCircle-DaUcrc3Z.js";import{i as Xe}from"./DotsVertical-fVEXRB26.js";import{s as qe}from"./Eye-fTf2jKhH.js";import{s as je}from"./Star01-Bf-FCZNm.js";import{s as Ge}from"./Plus-B6q1KrRb.js";import{s as Qe}from"./Trash01-xnv05M2J.js";import{s as Je}from"./XClose-Dpj0HG8O.js";import{i as pe,a as Se,E as Bt,c as Kt,p as Ut,b as Rt,d as Ht}from"./connection-form-helpers-DP7j8TIB.js";import{a as Wt}from"./authenticate-and-persist-oauth-M7g3Ip6K.js";import"./use-mcp-client-CWJJ80Qb.js";import"./auth-ThTV5Po4.js";import"./SwitchHorizontal01-5oVLoUdS.js";import"./ChevronUp-CGE39voI.js";import"./tooltip-Bmj8PlAJ.js";import"./view-mode-toggle-468Aaag6.js";import"./badge-D5YEUUHD.js";import"./SearchMd-CXYhXBwx.js";import"./use-registry-connections-M3aYVWwj.js";import"./use-organization-settings-DJVuBTtS.js";import"./useInfiniteQuery-yG_KEAOQ.js";import"./card-Cw03QSbR.js";import"./sidebar-s0ed1fkY.js";import"./LayoutLeft-BtE5tmf6.js";import"./sheet-Ct7wtAfe.js";import"./X-DJbyjHqp.js";import"./ChevronRight-DCf9L0Ls.js";import"./label-BwKyZwbE.js";import"./ChevronDown-Ee_3Sayw.js";import"./use-collections-CrBZtgZk.js";import"./AlertCircle-BxTbR_B1.js";import"./Tool01-CYPQsW1Y.js";import"./Settings02-D7AphFkm.js";import"./ArrowUpRight-S4NNBOkv.js";import"./ZapSquare-_6Gbk0W4.js";import"./Users03-UgyNhO90.js";import"./CheckCircle-BtIJRHva.js";import"./Stars02-BQPdDCaK.js";import"./ZoomOut-sMdcQ1z1.js";import"./Globe01-DYSo0Sr2.js";import"./FilterLines-Ba5JOCcM.js";import"./Globe04-3H1XgmQN.js";import"./HardDrive-JOn6Ez5n.js";import"./Key01-DV-6LIf3.js";import"./LinkExternal01-CALVZhat.js";import"./Monitor01-CWc8cxQO.js";import"./Sun-BkeePoRn.js";import"./Palette-Dok2NINN.js";import"./Play-CllDczEk.js";import"./SearchLg-ZiEk0E-L.js";import"./Shield01-DKJBa4Nn.js";import"./Stars01-DlOkHfPH.js";import"./Upload01-Cxp7zIDh.js";import"./User01-DuB-iQs0.js";import"./Users01-BkkYER_Z.js";import"./Zap-3WgTvh1l.js";import"./mcp-oauth-BwPcgk4Y.js";function Xt(f){const e=`deco-filters-${f}`,[n,p]=E.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{p(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(i){console.error("Failed to save filters:",i)}}]}function qt(f){const e=oe.c(7),[n,p]=E.useState(f),[l,o]=E.useState(f?"desc":null);let i;e[0]!==l||e[1]!==n?(i=j=>{n!==j?(p(j),o("asc")):l==="asc"?o("desc"):l==="desc"&&(p(void 0),o(null))},e[0]=l,e[1]=n,e[2]=i):i=e[2];const g=i;let h;return e[3]!==g||e[4]!==l||e[5]!==n?(h={sortKey:n,sortDirection:l,handleSort:g},e[3]=g,e[4]=l,e[5]=n,e[6]=h):h=e[6],h}function Gt(f){const e=oe.c(20),{namespace:n,resource:p,defaultSortKey:l,defaultViewMode:o}=f,i=l===void 0?"title":l,g=o===void 0?"table":o,[h,j]=E.useState(""),y=E.useDeferredValue(h),N=`${n}-${p}`,[b,a]=Xt(N),x=`mesh-${p}-filter-visible-${n}`;let m;e[0]!==x?(m=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=m):m=e[1];const[v,_]=E.useState(m);let D;e[2]!==x?(D=T=>{_(T),globalThis.localStorage?.setItem(x,String(T))},e[2]=x,e[3]=D):D=e[3];const L=D;let O;e[4]!==v||e[5]!==L?(O=()=>{L(!v)},e[4]=v,e[5]=L,e[6]=O):O=e[6];const s=O,[A,F]=Ct(`mesh-${p}-${n}`,g),{sortKey:M,sortDirection:w,handleSort:P}=qt(i),z=M;let C;return e[7]!==v||e[8]!==b||e[9]!==P||e[10]!==h||e[11]!==y||e[12]!==L||e[13]!==a||e[14]!==F||e[15]!==w||e[16]!==z||e[17]!==s||e[18]!==A?(C={search:h,searchTerm:y,setSearch:j,filters:b,setFilters:a,filterBarVisible:v,setFilterBarVisible:L,toggleFilterBar:s,viewMode:A,setViewMode:F,sortKey:z,sortDirection:w,handleSort:P},e[7]=v,e[8]=b,e[9]=P,e[10]=h,e[11]=y,e[12]=L,e[13]=a,e[14]=F,e[15]=w,e[16]=z,e[17]=s,e[18]=A,e[19]=C):C=e[19],C}function Qt(f){const e=oe.c(51),{group:n,onOpen:p,selectionMode:l,selectedIds:o,onToggleSelect:i}=f;let g;if(e[0]!==n.connections||e[1]!==o){let C;e[3]!==o?(C=T=>o.has(T.id),e[3]=o,e[4]=C):C=e[4],g=n.connections.every(C),e[0]=n.connections,e[1]=o,e[2]=g}else g=e[2];const h=g;let j;if(e[5]!==n.connections||e[6]!==o){let C;e[8]!==o?(C=T=>o.has(T.id),e[8]=o,e[9]=C):C=e[9],j=n.connections.some(C),e[5]=n.connections,e[6]=o,e[7]=j}else j=e[7];const y=j,N=`${n.connections.length} instances`;let b;e[10]!==n.icon||e[11]!==n.title||e[12]!==N?(b={title:n.title,icon:n.icon,description:N},e[10]=n.icon,e[11]=n.title,e[12]=N,e[13]=b):b=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==p||e[17]!==i||e[18]!==o||e[19]!==l?(a=()=>l?(()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(C.id)})():p(),e[14]=h,e[15]=n.connections,e[16]=p,e[17]=i,e[18]=o,e[19]=l,e[20]=a):a=e[20];const x=l&&h&&"ring-2 ring-primary",m=l&&y&&!h&&"ring-1 ring-primary/50";let v;e[21]!==x||e[22]!==m?(v=de(x,m),e[21]=x,e[22]=m,e[23]=v):v=e[23];let _;e[24]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ge,{}),e[24]=_):_=e[24];let D;e[25]!==h||e[26]!==n.connections||e[27]!==i||e[28]!==o||e[29]!==l||e[30]!==y?(D=l?t.jsx(Fe,{checked:h?!0:y?"indeterminate":!1,onCheckedChange:()=>{for(const C of n.connections)h?o.has(C.id)&&i(C.id):o.has(C.id)||i(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]=h,e[26]=n.connections,e[27]=i,e[28]=o,e[29]=l,e[30]=y,e[31]=D):D=e[31];const L=l?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let O;e[32]!==L?(O=de("overflow-hidden transition-all duration-150 ease-out",L),e[32]=L,e[33]=O):O=e[33];let s;e[34]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Yt,children:t.jsx(Xe,{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 F;e[37]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(qe,{size:16}),e[37]=F):F=e[37];let M;e[38]!==A?(M=t.jsxs(Ue,{children:[s,t.jsx(He,{align:"end",onClick:Jt,children:t.jsxs(re,{onClick:A,children:[F,"Open"]})})]}),e[38]=A,e[39]=M):M=e[39];let w;e[40]!==O||e[41]!==M?(w=t.jsx("div",{className:O,children:M}),e[40]=O,e[41]=M,e[42]=w):w=e[42];let P;e[43]!==D||e[44]!==w?(P=t.jsxs("div",{className:"flex items-center gap-1",children:[D,w]}),e[43]=D,e[44]=w,e[45]=P):P=e[45];let z;return e[46]!==P||e[47]!==b||e[48]!==a||e[49]!==v?(z=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:b,onClick:a,className:v,fallbackIcon:_,headerActionsAlwaysVisible:!0,headerActions:P})}),e[46]=P,e[47]=b,e[48]=a,e[49]=v,e[50]=z):z=e[50],z}function Jt(f){return f.stopPropagation()}function Yt(f){return f.stopPropagation()}function Zt(f){const e=oe.c(23),{count:n,total:p,canManage:l,canManageAgents:o,onSelectAll:i,onDeselectAll:g,onDelete:h,onAddToAgent:j,onToggleStatus:y,onCancel:N}=f;if(n===0)return null;let b;e[0]!==n?(b=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=b):b=e[1];let a;e[2]!==n||e[3]!==g||e[4]!==i||e[5]!==p?(a=n<p?t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:i,children:["Select all (",p,")"]}):t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:"Clear selection"}),e[2]=n,e[3]=g,e[4]=i,e[5]=p,e[6]=a):a=e[6];let x;e[7]!==o||e[8]!==j?(x=o&&t.jsxs(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:j,children:[t.jsx(Ge,{size:13}),"Add to Agent"]}),e[7]=o,e[8]=j,e[9]=x):x=e[9];let m;e[10]!==l||e[11]!==h||e[12]!==y?(m=l&&t.jsxs(t.Fragment,{children:[t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("active"),children:"Enable"}),t.jsx(U,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>y("inactive"),children:"Disable"}),t.jsxs(U,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[t.jsx(Qe,{size:13}),"Delete"]})]}),e[10]=l,e[11]=h,e[12]=y,e[13]=m):m=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(Je,{size:13}),e[14]=v):v=e[14];let _;e[15]!==N?(_=t.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:N,children:v}),e[15]=N,e[16]=_):_=e[16];let D;return e[17]!==b||e[18]!==a||e[19]!==x||e[20]!==m||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:[b,a,x,m,_]})}),e[17]=b,e[18]=a,e[19]=x,e[20]=m,e[21]=_,e[22]=D):D=e[22],D}function en(f){const e=oe.c(25),{open:n,onOpenChange:p,agents:l,onConfirm:o}=f,[i,g]=E.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Ve,{children:[t.jsx(Ee,{children:"Add to Agent"}),t.jsx(Be,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let j;e[1]!==l||e[2]!==i?(j=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(D=>t.jsxs("button",{type:"button",onClick:()=>g(D.id),className:de("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",i===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{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]=l,e[2]=i,e[3]=j):j=e[3];let y;e[4]!==j?(y=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:j}),e[4]=j,e[5]=y):y=e[5];let N;e[6]!==p?(N=t.jsx(U,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e[6]=p,e[7]=N):N=e[7];const b=!i;let a;e[8]!==o||e[9]!==p||e[10]!==i?(a=()=>{i&&(o(i),p(!1),g(null))},e[8]=o,e[9]=p,e[10]=i,e[11]=a):a=e[11];let x;e[12]!==b||e[13]!==a?(x=t.jsx(U,{disabled:b,onClick:a,children:"Add"}),e[12]=b,e[13]=a,e[14]=x):x=e[14];let m;e[15]!==N||e[16]!==x?(m=t.jsxs(Ke,{children:[N,x]}),e[15]=N,e[16]=x,e[17]=m):m=e[17];let v;e[18]!==y||e[19]!==m?(v=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,y,m]}),e[18]=y,e[19]=m,e[20]=v):v=e[20];let _;return e[21]!==p||e[22]!==n||e[23]!==v?(_=t.jsx(Me,{open:n,onOpenChange:p,children:v}),e[21]=p,e[22]=n,e[23]=v,e[24]=_):_=e[24],_}function tn(f){const e=oe.c(20),{open:n,onOpenChange:p,count:l,onConfirm:o}=f,i=l!==1?"s":"";let g;e[0]!==l||e[1]!==i?(g=t.jsxs(Ae,{children:["Delete ",l," connection",i,"?"]}),e[0]=l,e[1]=i,e[2]=g):g=e[2];const h=l!==1?"s":"";let j;e[3]!==h?(j=t.jsxs(we,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=j):j=e[4];let y;e[5]!==g||e[6]!==j?(y=t.jsxs(Te,{children:[g,j]}),e[5]=g,e[6]=j,e[7]=y):y=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Ie,{children:"Cancel"}),e[8]=N):N=e[8];const b=l!==1?"s":"";let a;e[9]!==l||e[10]!==o||e[11]!==b?(a=t.jsxs(Pe,{children:[N,t.jsxs($e,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",b]})]}),e[9]=l,e[10]=o,e[11]=b,e[12]=a):a=e[12];let x;e[13]!==y||e[14]!==a?(x=t.jsxs(Le,{children:[y,a]}),e[13]=y,e[14]=a,e[15]=x):x=e[15];let m;return e[16]!==p||e[17]!==n||e[18]!==x?(m=t.jsx(Oe,{open:n,onOpenChange:p,children:x}),e[16]=p,e[17]=n,e[18]=x,e[19]=m):m=e[19],m}function nn(f){return f._registryId?.includes("community-registry")===!0}function sn(f){const e=oe.c(58),{item:n,canManage:p,allConnections:l,connectedAppNames:o,connectingItemId:i,onNavigateConnected:g,onConnect:h}=f,[j,y]=E.useState(!1),[N,b]=E.useState(null);let a,x;e[0]!==o||e[1]!==n?(a=De(n)??"",x=o.has(a),e[0]=o,e[1]=n,e[2]=a,e[3]=x):(a=e[2],x=e[3]);const m=x,v=n._meta?.["mcp.mesh"],_=v?.friendlyName||v?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",D=n.server?.description||n.description||null;let L;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(L=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=L):L=e[6];const O=L;let s;if(e[7]!==l||e[8]!==a){let k;e[10]!==a?(k=se=>se.connection_type!=="VIRTUAL"&&se.app_name===a,e[10]=a,e[11]=k):k=e[11],s=l.filter(k),e[7]=l,e[8]=a,e[9]=s}else s=e[9];const A=s;let F;e[12]!==n?(F=nn(n),e[12]=n,e[13]=F):F=e[13];const M=F;let w,P;e[14]!==A||e[15]!==p||e[16]!==M||e[17]!==m||e[18]!==n||e[19]!==h||e[20]!==g?(w=()=>{if(m){const k=A[0];k&&g(k);return}p&&P()},P=()=>{M?(b("connect"),y(!0)):h(n)},e[14]=A,e[15]=p,e[16]=M,e[17]=m,e[18]=n,e[19]=h,e[20]=g,e[21]=w,e[22]=P):(w=e[21],P=e[22]);let z;e[23]!==n||e[24]!==h||e[25]!==N?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),y(!1),N==="connect"&&h(n),b(null)},e[23]=n,e[24]=h,e[25]=N,e[26]=z):z=e[26];const C=z;let T;e[27]!==D||e[28]!==O||e[29]!==_?(T={title:_,description:D,icon:O},e[27]=D,e[28]=O,e[29]=_,e[30]=T):T=e[30];let G;e[31]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(ge,{}),e[31]=G):G=e[31];let H;e[32]!==M||e[33]!==n._sourceIcon?(H=M&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[32]=M,e[33]=n._sourceIcon,e[34]=H):H=e[34];let X;e[35]!==p||e[36]!==i||e[37]!==P||e[38]!==m||e[39]!==n.id?(X=m?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):p&&t.jsx(U,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i!==null,onClick:k=>{k.stopPropagation(),P()},children:i===n.id?t.jsx(ce,{size:14,className:"animate-spin"}):"Connect"}),e[35]=p,e[36]=i,e[37]=P,e[38]=m,e[39]=n.id,e[40]=X):X=e[40];let c;e[41]!==H||e[42]!==X?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[41]=H,e[42]=X,e[43]=c):c=e[43];let S;e[44]!==w||e[45]!==c||e[46]!==T?(S=t.jsx(Ce,{connection:T,fallbackIcon:G,onClick:w,headerActionsAlwaysVisible:!0,headerActions:c}),e[44]=w,e[45]=c,e[46]=T,e[47]=S):S=e[47];let V;e[48]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(Te,{children:[t.jsx(Ae,{children:"Community MCP Server"}),t.jsx(we,{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]=V):V=e[48];let R;e[49]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Ie,{children:"Cancel"}),e[49]=R):R=e[49];let B;e[50]!==C?(B=t.jsxs(Le,{children:[V,t.jsxs(Pe,{children:[R,t.jsx($e,{onClick:C,children:"Continue"})]})]}),e[50]=C,e[51]=B):B=e[51];let u;e[52]!==j||e[53]!==B?(u=t.jsx(Oe,{open:j,onOpenChange:y,children:B}),e[52]=j,e[53]=B,e[54]=u):u=e[54];let $;return e[55]!==S||e[56]!==u?($=t.jsxs(t.Fragment,{children:[S,u]}),e[55]=S,e[56]=u,e[57]=$):$=e[57],$}function on({listState:f,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:l,enabledRegistries:o}){const{org:i}=be(),g=it(),h=_e(),{data:j}=Ne.useSession(),y=We(),N=Lt(f),b=ft(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[m,v]=E.useState(new Set),_=m.size>0,[D,L]=E.useState(!1),[O,s]=E.useState(!1),[A,F]=E.useState(null),M=Ot(),w=N.filter(r=>!(n!=="ALL"&&r.connection_type!==n||p!=="ALL"&&r.status!==p)),P=ht(w),z=r=>{v(d=>{const K=new Set(d);return K.has(r)?K.delete(r):K.add(r),K})},C=()=>{v(new Set)},T=ke(o,f.searchTerm),G=T.items,H=yt(T.loadMore,T.hasMore,T.isLoadingMore),X=new Set(N.filter(r=>r.app_name).map(r=>r.app_name)),c=l==="ALL"||o.some(r=>r.id===l)?l:"ALL",S=f.search.length>0,V=e==="all"||S?G.filter(r=>{if(c!=="ALL"&&r._registryId!==c)return!1;if(S){const d=De(r);if(d&&X.has(d))return!1}return!0}):[],R=e==="connected"||S?P:[],B=async r=>{if(!(!i||!j?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),F(r.id);try{const d=ct(r,i.id,j.user.id,{remoteIndex:0}),K=d.connection_type==="STDIO",I=!!d.connection_url,q=K&&d.connection_headers&&typeof d.connection_headers=="object"&&"command"in d.connection_headers;if(!I&&!q){W.error("This MCP Server cannot be connected: no connection method available"),F(null);return}const{id:ne}=await y.create.mutateAsync(d),le=await Wt({connectionId:ne,orgId:i.id,orgSlug:i.slug,persistFallback:fe=>y.update.mutateAsync({id:ne,data:{connection_token:fe}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ne,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(`Authentication failed: ${le.error??"no token received"}`);return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ne,flow:"connections_page_connect"});const fe=new URL(`/api/${i.slug}/mcp/${ne}`,window.location.origin);await g.invalidateQueries({queryKey:rt.isMCPAuthenticated(fe.href,null)}),$(),W.success("Authentication successful")}W.success("Connected successfully")}catch(d){W.error(`Failed to connect: ${d instanceof Error?d.message:String(d)}`)}finally{F(null)}}},u=Ft(),$=()=>{g.invalidateQueries({predicate:r=>{const d=r.queryKey;return d[1]===i.id&&d[3]==="collection"&&d[4]==="CONNECTIONS"}})},k=async()=>{L(!1);const r=[...m];te("connections_bulk_delete",{count:r.length});let d=0;for(const K of r)try{await u.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0}),d++}catch{}$(),W.success(`Deleted ${d} connection${d!==1?"s":""}`),C()},se=async(r,d)=>{try{await y.update.mutateAsync({id:r,data:{status:d}}),$(),W.success(d==="active"?"Connection enabled":"Connection disabled")}catch{W.error("Failed to update connection")}},xe=async r=>{const d=[...m];te("connections_bulk_status_toggled",{count:d.length,to_status:r});let K=0;for(const I of d)try{await y.update.mutateAsync({id:I,data:{status:r}}),K++}catch{}$(),W.success(`${r==="active"?"Enabled":"Disabled"} ${K} connection${K!==1?"s":""}`),C()},me=async r=>{const d=M.find(q=>q.id===r);if(!d)return;te("connections_bulk_add_to_agent",{agent_id:r,count:m.size});const K=new Set(d.connections.map(q=>q.connection_id)),I=[...m].filter(q=>!K.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(I.length===0){W.info("All selected connections are already in that agent");return}try{await u.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:r,data:{connections:[...d.connections,...I]}}),g.invalidateQueries({predicate:q=>{const ne=q.queryKey;return ne[1]===i.id&&ne[3]==="collection"&&ne[4]==="VIRTUAL_MCP"}}),W.success(`Added ${I.length} connection${I.length!==1?"s":""} to "${d.title}"`),C()}catch{W.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(jt,{...b}),t.jsx(tn,{open:D,onOpenChange:L,count:m.size,onConfirm:k}),t.jsx(en,{open:O,onOpenChange:s,agents:M,onConfirm:me}),T.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(S?V.length===0&&w.length===0:e==="all"?V.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:f.search?`No Connections match "${f.search}"`:a?"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:[R.map(r=>{if(r.type==="group")return t.jsx(Qt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:r.key}})},selectionMode:_,selectedIds:m,onToggleSelect:z},r.key);const d=r.connection,K=m.has(d.id);return t.jsx(Ce,{connection:d,fallbackIcon:t.jsx(ge,{}),onClick:()=>_?z(d.id):h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),className:de(K&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[_?t.jsx(Fe,{checked:K,onCheckedChange:()=>z(d.id),onClick:I=>I.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(Ue,{children:[t.jsx(Re,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:I=>I.stopPropagation(),children:t.jsx(Xe,{size:20})})}),t.jsxs(He,{align:"end",onClick:I=>I.stopPropagation(),children:[t.jsxs(re,{onClick:I=>{I.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}})},children:[t.jsx(qe,{size:16}),"Open"]}),(a||x)&&t.jsxs(re,{onClick:I=>{I.stopPropagation(),z(d.id)},children:[t.jsx(zt,{size:16}),"Select"]}),a&&(d.status==="active"?t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"inactive")},children:[t.jsx(Vt,{size:16}),"Disable"]}):t.jsxs(re,{onClick:I=>{I.stopPropagation(),se(d.id,"active")},children:[t.jsx(Et,{size:16}),"Enable"]})),a&&t.jsxs(re,{variant:"destructive",onClick:I=>{I.stopPropagation(),b.requestDelete(d)},children:[t.jsx(Qe,{size:16}),"Delete"]})]})]})})]})},d.id)}),V.map(r=>t.jsx(sn,{item:r,canManage:a,allConnections:N,connectedAppNames:X,connectingItemId:A,onNavigateConnected:d=>h({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:he(d)}}),onConnect:B},`catalog-${r._registryId}:${r.id}`)),(e==="all"||S)&&o.length>0&&t.jsx("div",{ref:H,className:"col-span-full h-4"}),(e==="all"||S)&&T.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ce,{size:24,className:"animate-spin text-muted-foreground"})})]})}),_&&t.jsx(Zt,{count:m.size,total:w.length,canManage:a,canManageAgents:x,onSelectAll:()=>{v(new Set(w.map(r=>r.id)))},onDeselectAll:()=>v(new Set),onDelete:()=>L(!0),onAddToAgent:()=>s(!0),onToggleStatus:xe,onCancel:C})]})}function rn(){const{org:f}=be(),e=_e(),n=Ze({strict:!1}),{data:p}=Ne.useSession(),{stdioEnabled:l}=et(),o=At(),{granted:i}=ye("connections:manage"),g=Gt({namespace:f.slug,resource:"connections"}),h=We(),[j,y]=tt(nt.connectionsTab(f.slug),c=>n.tab==="all"||n.tab==="connected"?n.tab:c??"all"),[N,b]=E.useState("ALL"),[a,x]=E.useState("ALL"),[m,v]=E.useState("ALL"),_=pt(),L=ke(_,g.searchTerm).items,O=g.search!==g.searchTerm,s=st({resolver:ot(Kt),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"),F=s.watch("connection_url"),M=s.watch("npx_package"),w=pe({uiType:A,connectionUrl:F??"",npxPackage:M??""})??Se({uiType:A,connectionUrl:F??"",registryItems:L}),P=i&&n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:f.slug},search:{action:"create"}})},C=()=>{e({to:"/$org/settings/connections",params:{org:f.slug},search:{}})},T=async c=>{let S,V=null,R=null,B=null;c.ui_type==="NPX"?(S="STDIO",V="",B=Rt(c.npx_package||"",c.env_vars||[])):c.ui_type==="STDIO"?(S="STDIO",V="",B=Ht(c.stdio_command||"",c.stdio_args||"",c.stdio_cwd,c.env_vars||[])):(S=c.ui_type,V=c.connection_url||"",R=c.connection_token||null);const u=lt("conn");te("connection_custom_created",{connection_type:S,ui_type:c.ui_type}),await h.create.mutateAsync({id:u,title:c.title,description:c.description||null,connection_type:S,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p?.user?.id||"system",organization_id:f.id,icon:c.icon??null,app_name:null,app_id:null,connection_headers:B,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:f.slug,appSlug:he({app_name:null,connection_url:V,title:c.title,id:u})}})},G=c=>{c||(P&&C(),s.reset())},H=c=>{const S=c.trim();if(!S)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,B=!!s.formState.dirtyFields.env_vars,u=k=>{if(k&&(!V&&!s.getValues("title").trim()&&k.title&&s.setValue("title",k.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&k.description&&s.setValue("description",k.description,{shouldDirty:!1}),!B&&k.envVarKeys?.length)){const se=s.getValues("env_vars")??[],xe=new Set(se.map(r=>r.key)),me=k.envVarKeys.filter(r=>!xe.has(r));me.length>0&&s.setValue("env_vars",[...se,...me.map(r=>({key:r,value:""}))],{shouldDirty:!0})}},$=Ut(S);if($&&l){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",$.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),u(pe({uiType:"NPX",npxPackage:$.packageName}));return}if(S.startsWith("http://")||S.startsWith("https://")){const k=A==="HTTP"||A==="SSE"||A==="Websocket"?A:"HTTP";s.setValue("ui_type",k,{shouldDirty:!0}),s.setValue("connection_url",S,{shouldDirty:!0}),u(pe({uiType:k,connectionUrl:S})??Se({uiType:k,connectionUrl:S,registryItems:L}));return}A==="NPX"&&u(pe({uiType:"NPX",npxPackage:S}))},X=i?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(U,{variant:"outline",onClick:z,children:[t.jsx(Ge,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(ue,{children:[(()=>{const c="Create Connection",S="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Type *"}),t.jsxs(wt,{value:u.value,onValueChange:u.onChange,children:[t.jsx(Z,{children:t.jsx(Tt,{children:t.jsx(It,{})})}),t.jsxs(Pt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(je,{className:"w-4 h-4"}),"Websocket"]})}),l&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{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(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),A==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"@perplexity-ai/mcp-server",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("npx_package",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),A==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Command *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"node, bun, python...",...u,value:u.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"arg1 arg2 --flag value",...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"/path/to/project (optional)",...u,value:u.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(A==="NPX"||A==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:u.value??[],onChange:u.onChange})}),t.jsx(ee,{})]})}),A!=="NPX"&&A!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"URL *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"https://example.com/mcp",...u,value:u.value??"",onPaste:$=>{const k=$.clipboardData.getData("text");k&&($.preventDefault(),s.setValue("connection_url",k.trim(),{shouldDirty:!0}),H(k))},onBlur:$=>{H($.target.value),u.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:w?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(ie,{type:"password",placeholder:w?.token?.placeholder??"Bearer token or API key",...u,value:u.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(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Name *"}),t.jsx(Z,{children:t.jsx(ie,{placeholder:"My Connection",...u})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:u})=>t.jsxs(J,{children:[t.jsx(Y,{children:"Description"}),t.jsx(Z,{children:t.jsx($t,{placeholder:"A brief description of this connection",rows:3,...u,value:u.value??""})}),t.jsx(ee,{})]})})]}),B=P;return o?t.jsx(vt,{open:B,onOpenChange:G,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{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(_t,{children:c}),t.jsx(Nt,{className:"mt-1",children:S})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(U,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Je,{size:16})})})]})}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(kt,{children:t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Me,{open:B,onOpenChange:G,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Ve,{children:[t.jsx(Ee,{children:c}),t.jsx(Be,{children:S})]}),t.jsx(ve,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(T),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Ke,{children:[t.jsx(U,{type:"button",variant:"outline",onClick:()=>G(!1),children:"Cancel"}),t.jsx(U,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(ue.Content,{children:t.jsx(ue.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ue.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(mt,{value:g.search,onChange:g.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:c=>{c.key==="Escape"&&(g.setSearch(""),c.target.blur())}}),t.jsx(dt,{sortKey:g.sortKey,sortDirection:g.sortDirection,onSort:g.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:N,onChange:c=>b(c||"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:a,onChange:c=>x(c||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},..._.length>1?[{label:"Registry",value:m,onChange:c=>v(c||"ALL"),options:[{id:"ALL",label:"All registries"},..._.map(c=>({id:c.id,label:c.id.includes("community-registry")?"Community MCP Registry":c.title}))]}]:[]]})]}),X]}),t.jsx(ut,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:j,onTabChange:c=>{const S=c;S!==j&&te("connections_page_tab_changed",{to_tab:S}),y(S)}}),t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:O?.5:1,transition:O?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:O?"none":"auto"},children:t.jsx(on,{listState:g,activeTab:j,typeFilter:N,statusFilter:a,registryFilter:m,enabledRegistries:_})})})]})})})]})})}function Ms(){const f=oe.c(1);let e;return f[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(E.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ce,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(rn,{})})}),f[0]=e):e=f[0],e}export{Ms as default};
@@ -1 +1 @@
1
- import{r as i,j as a,dH as y,V as T,W as v,dI as O,dJ as j,dK as G,dL as $,bS as k,dM as D,dN as _,Y as U,dO as L,dP as z,dQ as B,dR as W,dS as F,dT as H,dU as X,dV as K,dW as V,c as C,l as g}from"./index-5MyNR89x.js";var h="ContextMenu",[Y]=U(h,[_]),u=_(),[J,R]=Y(h),N=n=>{const{__scopeContextMenu:e,children:o,onOpenChange:t,dir:r,modal:s=!0}=n,[d,c]=i.useState(!1),x=u(e),m=k(t),l=i.useCallback(f=>{c(f),m(f)},[m]);return a.jsx(J,{scope:e,open:d,onOpenChange:l,modal:s,children:a.jsx(D,{...x,dir:r,open:d,onOpenChange:l,modal:s,children:o})})};N.displayName=h;var b="ContextMenuTrigger",P=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,disabled:t=!1,...r}=n,s=R(b,o),d=u(o),c=i.useRef({x:0,y:0}),x=i.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),m=i.useRef(0),l=i.useCallback(()=>window.clearTimeout(m.current),[]),f=p=>{c.current={x:p.clientX,y:p.clientY},s.onOpenChange(!0)};return i.useEffect(()=>l,[l]),i.useEffect(()=>{t&&l()},[t,l]),a.jsxs(a.Fragment,{children:[a.jsx(y,{...d,virtualRef:x}),a.jsx(T.span,{"data-state":s.open?"open":"closed","data-disabled":t?"":void 0,...r,ref:e,style:{WebkitTouchCallout:"none",...n.style},onContextMenu:t?n.onContextMenu:v(n.onContextMenu,p=>{l(),f(p),p.preventDefault()}),onPointerDown:t?n.onPointerDown:v(n.onPointerDown,M(p=>{l(),m.current=window.setTimeout(()=>f(p),700)})),onPointerMove:t?n.onPointerMove:v(n.onPointerMove,M(l)),onPointerCancel:t?n.onPointerCancel:v(n.onPointerCancel,M(l)),onPointerUp:t?n.onPointerUp:v(n.onPointerUp,M(l))})]})});P.displayName=b;var Q="ContextMenuPortal",w=n=>{const{__scopeContextMenu:e,...o}=n,t=u(e);return a.jsx(G,{...t,...o})};w.displayName=Q;var S="ContextMenuContent",I=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=R(S,o),s=u(o),d=i.useRef(!1);return a.jsx($,{...s,...t,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{n.onCloseAutoFocus?.(c),!c.defaultPrevented&&d.current&&c.preventDefault(),d.current=!1},onInteractOutside:c=>{n.onInteractOutside?.(c),!c.defaultPrevented&&!r.modal&&(d.current=!0)},style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});I.displayName=S;var q="ContextMenuGroup",Z=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(L,{...r,...t,ref:e})});Z.displayName=q;var ee="ContextMenuLabel",te=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(z,{...r,...t,ref:e})});te.displayName=ee;var ne="ContextMenuItem",E=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(O,{...r,...t,ref:e})});E.displayName=ne;var oe="ContextMenuCheckboxItem",re=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(B,{...r,...t,ref:e})});re.displayName=oe;var ae="ContextMenuRadioGroup",se=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(W,{...r,...t,ref:e})});se.displayName=ae;var ie="ContextMenuRadioItem",ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(F,{...r,...t,ref:e})});ce.displayName=ie;var ue="ContextMenuItemIndicator",de=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(H,{...r,...t,ref:e})});de.displayName=ue;var le="ContextMenuSeparator",A=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(j,{...r,...t,ref:e})});A.displayName=le;var xe="ContextMenuArrow",pe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(X,{...r,...t,ref:e})});pe.displayName=xe;var me="ContextMenuSubTrigger",fe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(K,{...r,...t,ref:e})});fe.displayName=me;var ve="ContextMenuSubContent",Ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(V,{...r,...t,ref:e,style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ce.displayName=ve;function M(n){return e=>e.pointerType!=="mouse"?n(e):void 0}var Me=N,ge=P,he=w,_e=I,Re=E,Ne=A;function Pe(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(Me,{"data-slot":"context-menu",...o}),e[2]=o,e[3]=t):t=e[3],t}function we(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(ge,{"data-slot":"context-menu-trigger",...o}),e[2]=o,e[3]=t):t=e[3],t}function Se(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("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-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(he,{children:a.jsx(_e,{"data-slot":"context-menu-content",className:r,...t})}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}function Ie(n){const e=C.c(12);let o,t,r,s;e[0]!==n?({className:o,inset:t,variant:s,...r}=n,e[0]=n,e[1]=o,e[2]=t,e[3]=r,e[4]=s):(o=e[1],t=e[2],r=e[3],s=e[4]);const d=s===void 0?"default":s;let c;e[5]!==o?(c=g("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-default items-center gap-2 rounded-sm 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",o),e[5]=o,e[6]=c):c=e[6];let x;return e[7]!==t||e[8]!==r||e[9]!==c||e[10]!==d?(x=a.jsx(Re,{"data-slot":"context-menu-item","data-inset":t,"data-variant":d,className:c,...r}),e[7]=t,e[8]=r,e[9]=c,e[10]=d,e[11]=x):x=e[11],x}function Ee(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("bg-border -mx-1 my-1 h-px",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(Ne,{"data-slot":"context-menu-separator",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{Ie as C,Ee as a,we as b,Se as c,Pe as d};
1
+ import{r as i,j as a,dI as y,U as T,V as v,dJ as O,dK as j,dL as G,dM as $,bR as k,dN as U,dO as _,X as D,dP as L,dQ as z,dR as B,dS as X,dT as F,dU as W,dV as H,dW as K,dX as V,c as C,l as g}from"./index-CcSfK5lN.js";var h="ContextMenu",[J]=D(h,[_]),u=_(),[Q,R]=J(h),N=n=>{const{__scopeContextMenu:e,children:o,onOpenChange:t,dir:r,modal:s=!0}=n,[d,c]=i.useState(!1),x=u(e),m=k(t),l=i.useCallback(f=>{c(f),m(f)},[m]);return a.jsx(Q,{scope:e,open:d,onOpenChange:l,modal:s,children:a.jsx(U,{...x,dir:r,open:d,onOpenChange:l,modal:s,children:o})})};N.displayName=h;var b="ContextMenuTrigger",P=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,disabled:t=!1,...r}=n,s=R(b,o),d=u(o),c=i.useRef({x:0,y:0}),x=i.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),m=i.useRef(0),l=i.useCallback(()=>window.clearTimeout(m.current),[]),f=p=>{c.current={x:p.clientX,y:p.clientY},s.onOpenChange(!0)};return i.useEffect(()=>l,[l]),i.useEffect(()=>{t&&l()},[t,l]),a.jsxs(a.Fragment,{children:[a.jsx(y,{...d,virtualRef:x}),a.jsx(T.span,{"data-state":s.open?"open":"closed","data-disabled":t?"":void 0,...r,ref:e,style:{WebkitTouchCallout:"none",...n.style},onContextMenu:t?n.onContextMenu:v(n.onContextMenu,p=>{l(),f(p),p.preventDefault()}),onPointerDown:t?n.onPointerDown:v(n.onPointerDown,M(p=>{l(),m.current=window.setTimeout(()=>f(p),700)})),onPointerMove:t?n.onPointerMove:v(n.onPointerMove,M(l)),onPointerCancel:t?n.onPointerCancel:v(n.onPointerCancel,M(l)),onPointerUp:t?n.onPointerUp:v(n.onPointerUp,M(l))})]})});P.displayName=b;var Y="ContextMenuPortal",w=n=>{const{__scopeContextMenu:e,...o}=n,t=u(e);return a.jsx(G,{...t,...o})};w.displayName=Y;var I="ContextMenuContent",S=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=R(I,o),s=u(o),d=i.useRef(!1);return a.jsx($,{...s,...t,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:c=>{n.onCloseAutoFocus?.(c),!c.defaultPrevented&&d.current&&c.preventDefault(),d.current=!1},onInteractOutside:c=>{n.onInteractOutside?.(c),!c.defaultPrevented&&!r.modal&&(d.current=!0)},style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});S.displayName=I;var q="ContextMenuGroup",Z=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(L,{...r,...t,ref:e})});Z.displayName=q;var ee="ContextMenuLabel",te=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(z,{...r,...t,ref:e})});te.displayName=ee;var ne="ContextMenuItem",E=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(O,{...r,...t,ref:e})});E.displayName=ne;var oe="ContextMenuCheckboxItem",re=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(B,{...r,...t,ref:e})});re.displayName=oe;var ae="ContextMenuRadioGroup",se=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(X,{...r,...t,ref:e})});se.displayName=ae;var ie="ContextMenuRadioItem",ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(F,{...r,...t,ref:e})});ce.displayName=ie;var ue="ContextMenuItemIndicator",de=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(W,{...r,...t,ref:e})});de.displayName=ue;var le="ContextMenuSeparator",A=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(j,{...r,...t,ref:e})});A.displayName=le;var xe="ContextMenuArrow",pe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(H,{...r,...t,ref:e})});pe.displayName=xe;var me="ContextMenuSubTrigger",fe=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(K,{...r,...t,ref:e})});fe.displayName=me;var ve="ContextMenuSubContent",Ce=i.forwardRef((n,e)=>{const{__scopeContextMenu:o,...t}=n,r=u(o);return a.jsx(V,{...r,...t,ref:e,style:{...n.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Ce.displayName=ve;function M(n){return e=>e.pointerType!=="mouse"?n(e):void 0}var Me=N,ge=P,he=w,_e=S,Re=E,Ne=A;function Pe(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(Me,{"data-slot":"context-menu",...o}),e[2]=o,e[3]=t):t=e[3],t}function we(n){const e=C.c(4);let o;e[0]!==n?({...o}=n,e[0]=n,e[1]=o):o=e[1];let t;return e[2]!==o?(t=a.jsx(ge,{"data-slot":"context-menu-trigger",...o}),e[2]=o,e[3]=t):t=e[3],t}function Ie(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("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-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(he,{children:a.jsx(_e,{"data-slot":"context-menu-content",className:r,...t})}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}function Se(n){const e=C.c(12);let o,t,r,s;e[0]!==n?({className:o,inset:t,variant:s,...r}=n,e[0]=n,e[1]=o,e[2]=t,e[3]=r,e[4]=s):(o=e[1],t=e[2],r=e[3],s=e[4]);const d=s===void 0?"default":s;let c;e[5]!==o?(c=g("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-default items-center gap-2 rounded-sm 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",o),e[5]=o,e[6]=c):c=e[6];let x;return e[7]!==t||e[8]!==r||e[9]!==c||e[10]!==d?(x=a.jsx(Re,{"data-slot":"context-menu-item","data-inset":t,"data-variant":d,className:c,...r}),e[7]=t,e[8]=r,e[9]=c,e[10]=d,e[11]=x):x=e[11],x}function Ee(n){const e=C.c(8);let o,t;e[0]!==n?({className:o,...t}=n,e[0]=n,e[1]=o,e[2]=t):(o=e[1],t=e[2]);let r;e[3]!==o?(r=g("bg-border -mx-1 my-1 h-px",o),e[3]=o,e[4]=r):r=e[4];let s;return e[5]!==t||e[6]!==r?(s=a.jsx(Ne,{"data-slot":"context-menu-separator",className:r,...t}),e[5]=t,e[6]=r,e[7]=s):s=e[7],s}export{Se as C,Ee as a,we as b,Ie as c,Pe as d};
@@ -1,4 +1,4 @@
1
- import{r as L,an as Ye,c as V,j as s,o as Oe,s as re,D as le,m as me,n as Ae,p as Te,d as ce,K as ee,t as J,B as Z,v as Q,z as Xe,l as de,k as Qe,b as Je,E as Ze,a8 as et}from"./index-5MyNR89x.js";import{C as tt}from"./checkbox-PMXW46HN.js";import{I as ne}from"./input-D9aeO8wK.js";import{d as st,b as it,c as nt,S as lt,a as ot}from"./select-CZgnwyj0.js";import{S as H}from"./skeleton-DoPnd-4p.js";import{i as ze,b as Re,c as rt,a as at,s as ct}from"./Settings02-CuT9JazG.js";import{c as dt,a as ut,d as mt,i as ht}from"./Tool01-DFCFgRlB.js";import{i as ft}from"./Key01-DugFMT5_.js";import{i as Pe}from"./SearchMd-RBoojwOu.js";import{c as he,u as pt,b as xt}from"./use-ai-providers-D4m0Vu5Q.js";import{S as ge,b as gt}from"./chat-context-B5uEh4ay.js";import{g as fe}from"./ai-providers-logos-DD3qZ33J.js";import{i as vt}from"./Monitor01-BFD-ivVa.js";import{i as bt}from"./AlertCircle-B4WPpzHx.js";import{D as Le,e as yt,d as jt,c as St,a as Nt,b as kt}from"./dialog-B2cGEuOv.js";import{u as ue}from"./studio-tools-4NjxmaVZ.js";import{i as wt}from"./ChevronRight-BhZIqa2P.js";import{A as _t}from"./avatar-Jhd31ejW.js";import{S as ve,a as be,b as $e}from"./settings-section-Br7JxQz6.js";import{s as Fe}from"./Eye-Bkw15G1G.js";import{u as Ct,C as It}from"./connect-desktop-dialog-DchtPbuP.js";import{t as ye}from"./ChevronDown-BzkFMF52.js";import{t as Et}from"./Stars01-HANlppqn.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=i();if(!(f.length!==n.length||f.some((b,g)=>n[g]!==b)))return l;n=f;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),l=e(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const b=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-m)*100)/100,y=g/16,j=(_,N)=>{for(_=String(_);_.length<N;)_=" "+_;return _};console.info(`%c⏱ ${j(g,5)} /${j(b,5)} ms`,`
1
+ import{r as L,al as Ye,c as V,j as s,o as Oe,s as re,D as le,m as me,n as Ae,p as Te,d as ce,K as ee,t as J,B as Z,v as Q,z as Xe,l as de,k as Qe,b as Je,E as Ze,a6 as et}from"./index-CcSfK5lN.js";import{C as tt}from"./checkbox-B68Qec99.js";import{I as ne}from"./input-DP5SZ5ZB.js";import{S as st,a as it,b as nt,c as lt,d as ot}from"./select-0LBXKeau.js";import{S as H}from"./skeleton-C_Ikhywu.js";import{i as ze,b as Re,c as rt,a as at,s as ct}from"./Settings02-D7AphFkm.js";import{c as dt,a as ut,d as mt,i as ht}from"./Tool01-CYPQsW1Y.js";import{i as ft}from"./Key01-DV-6LIf3.js";import{i as Pe}from"./SearchMd-CXYhXBwx.js";import{c as he,u as pt,b as xt}from"./use-ai-providers-la4AIHaF.js";import{S as ge,b as gt}from"./chat-context-ooWv73sg.js";import{g as fe}from"./ai-providers-logos-DD3qZ33J.js";import{i as vt}from"./Monitor01-CWc8cxQO.js";import{i as bt}from"./AlertCircle-BxTbR_B1.js";import{D as Le,e as yt,d as jt,c as St,a as Nt,b as kt}from"./dialog-dc-6JiKe.js";import{u as ue}from"./studio-tools-HEHEmVw-.js";import{i as wt}from"./ChevronRight-DCf9L0Ls.js";import{A as _t}from"./avatar-DlocwZ2L.js";import{S as ve,a as be,b as $e}from"./settings-section-DiijSJ5F.js";import{s as Fe}from"./Eye-fTf2jKhH.js";import{u as Ct,C as It}from"./connect-desktop-dialog-CDwS1V65.js";import{t as ye}from"./ChevronDown-Ee_3Sayw.js";import{t as Et}from"./Stars01-DlOkHfPH.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=i();if(!(f.length!==n.length||f.some((b,g)=>n[g]!==b)))return l;n=f;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),l=e(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const b=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-m)*100)/100,y=g/16,j=(_,N)=>{for(_=String(_);_.length<N;)_=" "+_;return _};console.info(`%c⏱ ${j(g,5)} /${j(b,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*y,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 je(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Mt=(i,e)=>Math.abs(i-e)<1.01,Ot=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},Se=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},At=i=>i,Tt=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},zt=(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(Se(t)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const u=c.borderBoxSize[0];if(u){l({width:u.inlineSize,height:u.blockSize});return}}l(Se(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Ne={passive:!0},ke=typeof window>"u"?!0:"onscrollend"in window,Rt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const o=i.options.useScrollendEvent&&ke?()=>{}:Ot(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),r=d=>()=>{const{horizontal:f,isRtl:p}=i.options;l=f?t.scrollLeft*(p&&-1||1):t.scrollTop,o(),e(l,d)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,Ne);const u=i.options.useScrollendEvent&&ke;return u&&t.addEventListener("scrollend",c,Ne),()=>{t.removeEventListener("scroll",a),u&&t.removeEventListener("scrollend",c)}},Pt=(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"]},Lt=(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 $t{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:At,rangeExtractor:Tt,onChange:()=>{},measureElement:Pt,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},u)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const m of this.laneAssignments.keys())m>=t&&this.laneAssignments.delete(m);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(m=>{this.itemSizeCache.set(m.key,m.size)}));const d=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const f=this.measurementsCache.slice(0,d),p=new Array(a).fill(void 0);for(let m=0;m<d;m++){const b=f[m];b&&(p[b.lane]=m)}for(let m=d;m<t;m++){const b=o(m),g=this.laneAssignments.get(m);let y,j;const _=c==="estimate"||u.has(b);if(g!==void 0&&this.options.lanes>1){y=g;const v=p[y],k=v!==void 0?f[v]:void 0;j=k?k.end+this.options.gap:n+l}else{const v=this.options.lanes===1?f[m-1]:this.getFurthestMeasurement(f,m);j=v?v.end+this.options.gap:n+l,y=v?v.lane:m%this.options.lanes,this.options.lanes>1&&_&&this.laneAssignments.set(m,y)}const N=u.get(b),I=typeof N=="number"?N:this.options.estimateSize(m),E=j+I;f[m]={index:m,start:j,size:I,end:E,key:b,lane:y},p[y]=m}return this.measurementsCache=f,f},{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?Ft({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 je(n[Ke(0,n.length-1,l=>je(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&&Mt(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 Ke=(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 Ft({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=Ke(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(d=>d<t+e);){const d=i[a];c[d.lane]=d.end,a++}const u=Array(n).fill(t+e);for(;r>=0&&u.some(d=>d>=t);){const d=i[r];u[d.lane]=d.start,r--}r=Math.max(0,r-r%n),a=Math.min(l,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const we=typeof document<"u"?L.useLayoutEffect:L.useEffect;function Kt({useFlushSync:i=!0,...e}){const t=L.useReducer(()=>({}),{})[1],n={...e,onChange:(o,r)=>{var a;i&&r?Ye.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[l]=L.useState(()=>new $t(n));return l.setOptions(n),we(()=>l._didMount(),[]),we(()=>l._willUpdate()),l}function Dt(i){return Kt({observeElementRect:zt,observeElementOffset:Rt,scrollToFn:Lt,...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 _e(i){if(i)return ae.find(e=>e.id===i)}const Ce=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(_t,{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($e,{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 De(i){const e=V.c(32),{providers:t,onSelect:n,onShowAll:l}=i;let o;e[0]!==t?(o=t.find(Ht),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,llmapi:1,anthropic:2,google:3},e[2]=a):a=e[2];const c=a;let u;if(e[3]!==n||e[4]!==t){let N;e[6]===Symbol.for("react.memo_cache_sentinel")?(N=(x,O)=>{const A=c[x.id]??Number.MAX_SAFE_INTEGER,z=c[O.id]??Number.MAX_SAFE_INTEGER;return A-z},e[6]=N):N=e[6];const I=t.filter(Vt).sort(N);let E;e[7]!==t?(E=t.find(Wt),e[7]=t,e[8]=E):E=e[8];const v=E;let k;e[9]===Symbol.for("react.memo_cache_sentinel")?(k=ae.find(Bt),e[9]=k):k=e[9];const C=k;let w;e[10]!==n?(w=x=>s.jsx(oe,{logo:x.logo,name:x.name,description:x.description,onClick:()=>n({kind:"provider",provider:x})},x.id),e[10]=n,e[11]=w):w=e[11];let h,S;e[12]!==n||e[13]!==v?(h=v&&C?[s.jsx(oe,{logo:C.logo,name:C.name,description:C.description,onClick:()=>n({kind:"openai-compatible",provider:v,preset:C})},C.id)]:[],S=v?[...ae.filter(Ut).map(x=>s.jsx(oe,{logo:x.logo,name:x.name,description:x.description,onClick:()=>n({kind:"openai-compatible",provider:v,preset:x})},x.id)),s.jsx(oe,{logo:v.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:v,preset:null})},"custom")]:[],e[12]=n,e[13]=v,e[14]=h,e[15]=S):(h=e[14],S=e[15]),u=[...I.map(w),...h,...S],e[3]=n,e[4]=t,e[5]=u}else u=e[5];const d=u,f=d.length-Ce,p=!!l&&f>0;let m;e[16]!==d||e[17]!==p?(m=p?d.slice(0,Ce):d,e[16]=d,e[17]=p,e[18]=m):m=e[18];const b=m;let g;e[19]!==r||e[20]!==n?(g=r&&s.jsx(ve,{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(be,{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 y;e[22]!==f||e[23]!==l||e[24]!==p?(y=p&&s.jsx($e,{onClick:l,title:`${f} more provider${f===1?"":"s"}`,action:s.jsx(wt,{size:16,className:"text-muted-foreground"})}),e[22]=f,e[23]=l,e[24]=p,e[25]=y):y=e[25];let j;e[26]!==y||e[27]!==b?(j=s.jsx(ve,{children:s.jsxs(be,{children:[b,y]})}),e[26]=y,e[27]=b,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 Ut(i){return i.id!=="openai"}function Bt(i){return i.id==="openai"}function Wt(i){return i.id==="openai-compatible"}function Vt(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function Ht(i){return i.id==="deco"}const qt=Oe({label:re().optional(),apiKey:re().min(1,"API key is required")});function Gt(i){const e=V.c(59),{providerId:t,onCancel:n,onSuccess:l}=i,{org:o}=le(),r=ue(),a=me(),[c,u]=L.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={resolver:Ae(qt),defaultValues:{label:"",apiKey:""}},e[0]=d):d=e[0];const{register:f,handleSubmit:p,formState:m}=Te(d),{errors:b}=m;let g;e[1]!==t||e[2]!==r?(g=async M=>{await r.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:M.label||"Personal key",apiKey:M.apiKey})},e[1]=t,e[2]=r,e[3]=g):g=e[3];let y;e[4]!==l||e[5]!==o||e[6]!==a?(y=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)}),J.success("Key saved successfully"),l()},e[4]=l,e[5]=o,e[6]=a,e[7]=y):y=e[7];let j;e[8]!==g||e[9]!==y?(j={mutationFn:g,onSuccess:y,onError:Yt},e[8]=g,e[9]=y,e[10]=j):j=e[10];const{mutate:_,isPending:N,error:I}=ce(j);let E;e[11]!==_?(E=M=>_(M),e[11]=_,e[12]=E):E=e[12];let v;e[13]!==p||e[14]!==E?(v=p(E),e[13]=p,e[14]=E,e[15]=v):v=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[16]=k):k=e[16];let C;e[17]!==f?(C=f("label"),e[17]=f,e[18]=C):C=e[18];let w;e[19]!==C?(w=s.jsxs("div",{className:"space-y-1",children:[k,s.jsx(ne,{placeholder:"e.g. Personal key",...C,className:"h-8 text-sm"})]}),e[19]=C,e[20]=w):w=e[20];let h;e[21]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[21]=h):h=e[21];const S=c?"text":"password";let x;e[22]!==f?(x=f("apiKey"),e[22]=f,e[23]=x):x=e[23];let O;e[24]!==S||e[25]!==x?(O=s.jsx(ne,{type:S,placeholder:"sk-...",...x,className:"ph-no-capture h-8 text-sm pr-8"}),e[24]=S,e[25]=x,e[26]=O):O=e[26];let A;e[27]!==c?(A=()=>u(!c),e[27]=c,e[28]=A):A=e[28];let z;e[29]!==c?(z=c?s.jsx(ze,{size:14}):s.jsx(Fe,{size:14}),e[29]=c,e[30]=z):z=e[30];let T;e[31]!==A||e[32]!==z?(T=s.jsx("button",{type:"button",onClick:A,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:z}),e[31]=A,e[32]=z,e[33]=T):T=e[33];let U;e[34]!==O||e[35]!==T?(U=s.jsxs("div",{className:"relative",children:[O,T]}),e[34]=O,e[35]=T,e[36]=U):U=e[36];let $;e[37]!==b.apiKey?($=b.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:b.apiKey.message}),e[37]=b.apiKey,e[38]=$):$=e[38];let R;e[39]!==U||e[40]!==$?(R=s.jsxs("div",{className:"space-y-1",children:[h,U,$]}),e[39]=U,e[40]=$,e[41]=R):R=e[41];let K;e[42]!==I?(K=I&&s.jsx("p",{className:"text-xs text-destructive",children:I.message}),e[42]=I,e[43]=K):K=e[43];let F;e[44]!==N||e[45]!==n?(F=s.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:N,children:"Cancel"}),e[44]=N,e[45]=n,e[46]=F):F=e[46];const B=N?"Saving...":"Save Key";let D;e[47]!==N||e[48]!==B?(D=s.jsx(Z,{type:"submit",size:"sm",disabled:N,children:B}),e[47]=N,e[48]=B,e[49]=D):D=e[49];let P;e[50]!==F||e[51]!==D?(P=s.jsxs(Le,{children:[F,D]}),e[50]=F,e[51]=D,e[52]=P):P=e[52];let W;return e[53]!==w||e[54]!==R||e[55]!==K||e[56]!==P||e[57]!==v?(W=s.jsxs("form",{onSubmit:v,className:"space-y-3",children:[w,R,K,P]}),e[53]=w,e[54]=R,e[55]=K,e[56]=P,e[57]=v,e[58]=W):W=e[58],W}function Yt(i){J.error(`Failed to save key: ${i.message}`)}const Xt=Oe({label:re().optional(),baseUrl:re().min(1,"Base URL is required"),apiKey:re().optional()});function Qt(i){const e=V.c(70),{preset:t,onCancel:n,onSuccess:l}=i,{org:o}=le(),r=ue(),a=me(),[c,u]=L.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=Ae(Xt),e[0]=d):d=e[0];const f=t?.defaultBaseUrl??"";let p;e[1]!==f?(p={resolver:d,defaultValues:{label:"",baseUrl:f,apiKey:""}},e[1]=f,e[2]=p):p=e[2];const{register:m,handleSubmit:b,formState:g}=Te(p),{errors:y}=g;let j;e[3]!==t||e[4]!==r?(j=async se=>{const Ge=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await r.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Ge,...t?{presetId:t.id}:{}})},e[3]=t,e[4]=r,e[5]=j):j=e[5];let _;e[6]!==l||e[7]!==o||e[8]!==a?(_=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)}),J.success("Connection saved successfully"),l()},e[6]=l,e[7]=o,e[8]=a,e[9]=_):_=e[9];let N;e[10]!==j||e[11]!==_?(N={mutationFn:j,onSuccess:_,onError:Jt},e[10]=j,e[11]=_,e[12]=N):N=e[12];const{mutate:I,isPending:E,error:v}=ce(N),k=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",C=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let w;e[13]!==I?(w=se=>I(se),e[13]=I,e[14]=w):w=e[14];let h;e[15]!==b||e[16]!==w?(h=b(w),e[15]=b,e[16]=w,e[17]=h):h=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[18]=S):S=e[18];let x;e[19]!==m?(x=m("label"),e[19]=m,e[20]=x):x=e[20];let O;e[21]!==k||e[22]!==x?(O=s.jsxs("div",{className:"space-y-1",children:[S,s.jsx(ne,{placeholder:k,...x,className:"h-8 text-sm"})]}),e[21]=k,e[22]=x,e[23]=O):O=e[23];let A;e[24]!==C||e[25]!==y||e[26]!==t?.defaultBaseUrl||e[27]!==m?(A=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...m("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:C,...m("baseUrl"),className:"h-8 text-sm"}),y.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:y.baseUrl.message})]}),e[24]=C,e[25]=y,e[26]=t?.defaultBaseUrl,e[27]=m,e[28]=A):A=e[28];const z=t?.apiKeyRecommended?"recommended":"optional";let T;e[29]!==z?(T=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[29]=z,e[30]=T):T=e[30];const U=c?"text":"password";let $;e[31]!==m?($=m("apiKey"),e[31]=m,e[32]=$):$=e[32];let R;e[33]!==U||e[34]!==$?(R=s.jsx(ne,{type:U,placeholder:"sk-...",...$,className:"ph-no-capture h-8 text-sm pr-8"}),e[33]=U,e[34]=$,e[35]=R):R=e[35];let K;e[36]!==c?(K=()=>u(!c),e[36]=c,e[37]=K):K=e[37];let F;e[38]!==c?(F=c?s.jsx(ze,{size:14}):s.jsx(Fe,{size:14}),e[38]=c,e[39]=F):F=e[39];let B;e[40]!==K||e[41]!==F?(B=s.jsx("button",{type:"button",onClick:K,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:F}),e[40]=K,e[41]=F,e[42]=B):B=e[42];let D;e[43]!==R||e[44]!==B?(D=s.jsxs("div",{className:"relative",children:[R,B]}),e[43]=R,e[44]=B,e[45]=D):D=e[45];let P;e[46]!==T||e[47]!==D?(P=s.jsxs("div",{className:"space-y-1",children:[T,D]}),e[46]=T,e[47]=D,e[48]=P):P=e[48];let W;e[49]!==t?(W=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[49]=t,e[50]=W):W=e[50];let M;e[51]!==v?(M=v&&s.jsx("p",{className:"text-xs text-destructive",children:v.message}),e[51]=v,e[52]=M):M=e[52];let q;e[53]!==E||e[54]!==n?(q=s.jsx(Z,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:E,children:"Cancel"}),e[53]=E,e[54]=n,e[55]=q):q=e[55];const X=E?"Saving...":"Save Connection";let Y;e[56]!==E||e[57]!==X?(Y=s.jsx(Z,{type:"submit",size:"sm",disabled:E,children:X}),e[56]=E,e[57]=X,e[58]=Y):Y=e[58];let G;e[59]!==q||e[60]!==Y?(G=s.jsxs(Le,{children:[q,Y]}),e[59]=q,e[60]=Y,e[61]=G):G=e[61];let te;return e[62]!==O||e[63]!==A||e[64]!==P||e[65]!==W||e[66]!==M||e[67]!==G||e[68]!==h?(te=s.jsxs("form",{onSubmit:h,className:"space-y-3",children:[O,A,P,W,M,G]}),e[62]=O,e[63]=A,e[64]=P,e[65]=W,e[66]=M,e[67]=G,e[68]=h,e[69]=te):te=e[69],te}function Jt(i){J.error(`Failed to save connection: ${i.message}`)}const Zt={kind:"closed"};function es(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 ts(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ss({open:i,onOpenChange:e,initialProvider:t}){const l=he()?.providers??[],{org:o}=le(),r=ue(),a=me(),[c,u]=L.useReducer(es,Zt),d=L.useRef(!1);L.useEffect(()=>{i&&c.kind==="closed"?u({type:"open"}):!i&&c.kind!=="closed"&&u({type:"close"})},[i,c.kind]);const f=()=>{d.current=!1,u({type:"close"}),e(!1)},p=()=>{a.invalidateQueries({queryKey:ee.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:ee.aiProviders(o.id)})},{mutate:m}=ce({mutationFn:async({providerId:h,code:S,stateToken:x,label:O})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:h,code:S,stateToken:x,label:O}),h),onSuccess:h=>{Q("ai_provider_oauth_succeeded",{provider_id:h}),p();const S=l.find(x=>x.id===h);J.success(`${S?.name??"Provider"} connected successfully`),f()},onError:(h,S)=>{Q("ai_provider_oauth_failed",{provider_id:S.providerId,error:h.message}),J.error(`OAuth connection failed: ${h.message}`),u({type:"oauth-failed"})}}),{mutate:b}=ce({mutationFn:async h=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:h}),h),onSuccess:h=>{Q("ai_provider_provision_succeeded",{provider_id:h}),p();const S=l.find(x=>x.id===h);J.success(`${S?.name??"Provider"} connected successfully`),f()},onError:(h,S)=>{Q("ai_provider_provision_failed",{provider_id:S,error:h.message}),u({type:"provision-error",error:h.message})}}),g=async h=>{const{provider:S}=h,x=h.kind==="openai-compatible"?h.preset?.id??null:null,O=S.supportedMethods.includes("oauth-pkce"),A=S.supportedMethods.includes("api-key");if(S.supportsProvision===!0){Q("ai_provider_connect_clicked",{provider_id:S.id,method:"provision"}),u({type:"select-provision",providerId:S.id}),b(S.id);return}if(O){Q("ai_provider_connect_clicked",{provider_id:S.id,method:"oauth-pkce"});try{const T=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:S.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!T?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");u({type:"select-oauth",providerId:S.id,stateToken:T.stateToken}),window.open(T.url,"AiProviderOAuth","width=600,height=700")}catch(T){J.error(`Failed to start OAuth: ${T instanceof Error?T.message:String(T)}`)}return}A&&(Q("ai_provider_connect_clicked",{provider_id:S.id,...x!==null?{preset_id:x}:{},method:"api-key"}),u({type:"select-form",providerId:S.id,presetId:x}))},y=L.useRef(g);y.current=g;const j=L.useRef(t);j.current=t,L.useEffect(()=>{!j.current||c.kind!=="grid"||d.current||(d.current=!0,y.current(j.current))},[c.kind]);const _=c.kind==="oauth-pending"?c.stateToken:null,N=c.kind==="oauth-pending"?c.providerId:null;L.useEffect(()=>{if(c.kind!=="oauth-pending")return;let h=!1;const S=c.stateToken,x=c.providerId,O=z=>{if(z.origin!==window.location.origin||z.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:T,stateToken:U}=z.data;if(U!==S){J.error("Security check failed: State token mismatch"),u({type:"oauth-failed"});return}h=!0;const $=l.find(R=>R.id===x);m({providerId:x,code:T,stateToken:S,label:$?.name??x})};window.addEventListener("message",O);const A=setTimeout(()=>{h||(Q("ai_provider_oauth_timeout",{provider_id:x}),u({type:"oauth-failed"}),J.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",O),clearTimeout(A)}},[c.kind,_,N,m]);const I=ts(c),E=I?l.find(h=>h.id===I):null,k=(c.kind==="form"&&c.presetId?ae.find(h=>h.id===c.presetId):null)?.name??E?.name??"Connect an AI provider",C=c.kind!=="grid"&&c.kind!=="closed",w=()=>{t?f():u({type:"back"})};return s.jsx(yt,{open:c.kind!=="closed",onOpenChange:h=>!h&&f(),children:s.jsxs(jt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(St,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[C&&s.jsx(Z,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:w,children:s.jsx(Re,{size:16})}),s.jsx(Nt,{children:k})]}),c.kind==="grid"&&!t&&s.jsx(kt,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(De,{providers:l,onSelect:g}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(Qt,{preset:c.presetId?ae.find(h=>h.id===c.presetId):void 0,onCancel:()=>u({type:"back"}),onSuccess:()=>{p(),f()}}):s.jsx(Gt,{providerId:c.providerId,onCancel:()=>u({type:"back"}),onSuccess:()=>{p(),f()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(ge,{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(ge,{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(bt,{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(Z,{variant:"outline",size:"sm",onClick:()=>u({type:"back"}),children:"Back"}),s.jsx(Z,{size:"sm",onClick:()=>{u({type:"retry-provision"}),b(c.providerId)},children:"Retry"})]})]})]})})}function is(){const i=V.c(7),{org:e}=le(),t=ue();let n;i[0]!==e.id?(n=ee.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(ns)??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}=Qe(o);return r??null}function ns(i){return i.isDefault&&!i.archivedAt}function ls(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 os(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}=Xe(),a=is(),c=Ct(),[u,d]=L.useState(null),[f,p]=L.useState(!1),[m,b]=L.useState(!1),g=he();let y;e[2]!==g?.providers?(y=g?.providers??[],e[2]=g?.providers,e[3]=y):y=e[3];const j=y,_=o.name;let N;e[4]!==a?(N=a?ls(a):null,e[4]=a,e[5]=N):N=e[5];const I=N,E=a?.favicon??a?.logo??null,v=n??(_?`${_} is ready for agents`:"Your agents are almost ready"),k=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=!!(E||I);let w;e[6]!==I?(w=I?{backgroundColor:`${I}18`,borderColor:`${I}30`}:void 0,e[6]=I,e[7]=w):w=e[7];const h=w,S=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 x;e[8]!==S||e[9]!==h||e[10]!==E||e[11]!==c||e[12]!==I?(x=E?s.jsx("div",{className:S,style:h,children:s.jsx("img",{src:E,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>b(!0),"aria-label":c.online?"Desktop linked":"Connect your desktop",className:de(S,"cursor-pointer transition-colors hover:bg-accent"),style:h,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(vt,{size:24,style:I?{color:I}:void 0,className:de(!I&&"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]=S,e[9]=h,e[10]=E,e[11]=c,e[12]=I,e[13]=x):x=e[13];let O;e[14]!==v?(O=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:v}),e[14]=v,e[15]=O):O=e[15];let A;e[16]!==k?(A=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:k}),e[16]=k,e[17]=A):A=e[17];let z;e[18]!==O||e[19]!==A?(z=s.jsxs("div",{className:"space-y-2",children:[O,A]}),e[18]=O,e[19]=A,e[20]=z):z=e[20];let T;e[21]!==x||e[22]!==z?(T=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[x,z]}),e[21]=x,e[22]=z,e[23]=T):T=e[23];let U,$;e[24]===Symbol.for("react.memo_cache_sentinel")?(U=M=>d(M),$=()=>p(!0),e[24]=U,e[25]=$):(U=e[24],$=e[25]);let R;e[26]!==j?(R=s.jsx("div",{className:"w-full",children:s.jsx(De,{providers:j,onSelect:U,onShowAll:$})}),e[26]=j,e[27]=R):R=e[27];const K=u!==null||f;let F;e[28]===Symbol.for("react.memo_cache_sentinel")?(F=M=>{M||(d(null),p(!1))},e[28]=F):F=e[28];const B=u??void 0;let D;e[29]!==K||e[30]!==B?(D=s.jsx(ss,{open:K,onOpenChange:F,initialProvider:B}),e[29]=K,e[30]=B,e[31]=D):D=e[31];let P;e[32]!==m?(P=s.jsx(It,{open:m,onOpenChange:b}),e[32]=m,e[33]=P):P=e[33];let W;return e[34]!==R||e[35]!==D||e[36]!==P||e[37]!==T?(W=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[T,R,D,P]}),e[34]=R,e[35]=D,e[36]=P,e[37]=T,e[38]=W):W=e[38],W}function pe(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 rs(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 as=["bg-destructive","bg-warning","bg-success","bg-success"],cs=["text-success","text-warning","text-warning","text-destructive"];function ds(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function us(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 ms={text:{icon:s.jsx(mt,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(ut,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(rt,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(dt,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(Et,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx(Pe,{className:"size-3.5"}),label:"Web search"}};function hs(i){const e=V.c(5),{capability:t}=i;let n;e[0]!==t?(n=ms[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 fs(i){const e=V.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let v;return e[0]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=v):v=e[0],v}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=pe(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:u}=a;if(l){let v;e[3]!==t.limits?(v=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]=v):v=e[4];let k;e[5]!==o?(k=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]=k):k=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 w;e[9]!==t.limits?(w=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]=w):w=e[10];let h;return e[11]!==v||e[12]!==k||e[13]!==C||e[14]!==w?(h=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[v,k,C,w]}),e[11]=v,e[12]=k,e[13]=C,e[14]=w,e[15]=h):h=e[15],h}let d;e[16]!==c?(d=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=d):d=e[17];let f;e[18]!==t.logo||e[19]!==t.title?(f=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]=f):f=e[20];let p;e[21]!==u?(p=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:u}),e[21]=u,e[22]=p):p=e[22];let m;e[23]!==f||e[24]!==p?(m=s.jsxs("div",{className:"flex items-center gap-2.5",children:[f,p]}),e[23]=f,e[24]=p,e[25]=m):m=e[25];let b;e[26]!==t.modelId?(b=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=b):b=e[27];let g;e[28]!==d||e[29]!==m||e[30]!==b?(g=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[d,m,b]}),e[28]=d,e[29]=m,e[30]=b,e[31]=g):g=e[31];let y;e[32]!==t.capabilities?(y=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(ps)}),e[32]=t.capabilities,e[33]=y):y=e[33];let j;e[34]!==t.limits?(j=t.limits?.contextWindow&&(()=>{const{level:v,label:k,description:C}=rs(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(w=>s.jsx("div",{className:de("w-2 h-2 rounded-full",w<=v?as[v-1]:"bg-muted")},w))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k}),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:ds(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=_):_=e[37];let N;e[38]!==o||e[39]!==r?(N=(o!=null||r!=null)&&(()=>{const{level:v,label:k}=o!=null?us(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:de("text-sm font-bold leading-none",C<=v?cs[v-1]:"text-muted-foreground/20"),children:"$"},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:k})]}),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]=N):N=e[40];let I;e[41]!==j||e[42]!==_||e[43]!==N?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,_,N]}),e[41]=j,e[42]=_,e[43]=N,e[44]=I):I=e[44];let E;return e[45]!==I||e[46]!==g||e[47]!==y?(E=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[g,y,I]}),e[45]=I,e[46]=g,e[47]=y,e[48]=E):E=e[48],E}function ps(i){return s.jsx(hs,{capability:i},i)}function ai(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(H,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(H,{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 y;e[3]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=y):y=e[3];let j;return e[4]!==g?(j=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,y]}),e[4]=g,e[5]=j):j=e[5],j}let a;e[6]!==t?(a=pe(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let u;e[8]!==t?(u=fe(t),e[8]=t,e[9]=u):u=e[9];const d=u;let f;e[10]!==t.title||e[11]!==d?(f=s.jsx("img",{src:d,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]=d,e[12]=f):f=e[12];let p;e[13]!==c?(p=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]=p):p=e[14];let m;e[15]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(ye,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=m):m=e[15];let b;return e[16]!==f||e[17]!==p?(b=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[f,p,m]}),e[16]=f,e[17]=p,e[18]=b):b=e[18],b}const xs=["vision","image","file","audio","video"],Ue=["image/png","image/jpeg","image/gif","image/webp"],Be=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function xe(i){const e=i?.capabilities;return e?xs.some(t=>e.includes(t)):!1}function ci(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&&Ue.includes(i)||l&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||xe(e)&&Be.includes(i))}function di(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...Ue),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),xe(i)&&t.push(...Be),t.join(",")}function ui(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"),xe(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 We=["smarter","faster","cheaper"],Ve={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},gs=[{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"]}],vs=gs.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),bs="google/gemini-2.5-pro",Ie=new Map;function ys(i){const e=Ie.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 vs)if(i.startsWith(l)){if(l===bs&&i.length>l.length&&i[l.length]==="-"){const r=i[l.length+1];if(!r||!/\d/.test(r))continue}t=n;break}return Ie.set(i,t),t}function Ee(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=ys(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 He="mesh:model-shortlist:",js=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 Ss(i){try{const e=localStorage.getItem(He+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ns(i,e){localStorage.setItem(He+i,JSON.stringify([...e]))}function ks(i){const e=V.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=pe(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 u;e[4]!==t||e[5]!==n?(u=()=>n(t),e[4]=t,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==t.title||e[8]!==c?(d=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]=d):d=e[9];let f;e[10]!==o?(f=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=f):f=e[11];let p;e[12]!==r?(p=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=p):p=e[13];let m;e[14]!==f||e[15]!==p?(m=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[f,p]}),e[14]=f,e[15]=p,e[16]=m):m=e[16];let b;return e[17]!==u||e[18]!==d||e[19]!==m?(b=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[d,m]}),e[17]=u,e[18]=d,e[19]=m,e[20]=b):b=e[20],b}function ws(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(et,{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(ct,{className:"size-3.5"}),e[4]=c):c=e[4];let u;e[5]!==n?(u=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(Z,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==a||e[8]!==u?(d=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,a,u]}),e[7]=a,e[8]=u,e[9]=d):d=e[9],d}function _s(){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(Cs)}),i[0]=e):e=i[0],e}function Cs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(H,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(H,{className:"flex-1 h-4"}),s.jsx(H,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Me(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 u;e[6]!==o||e[7]!==l?(u=d=>s.jsx("div",{onClick:()=>l(d),className:"cursor-pointer",children:s.jsx(ks,{model:d,onHover:o})},d.modelId),e[6]=o,e[7]=l,e[8]=u):u=e[8],a=n.map(u),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 Is(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 u=c;let d;e[2]!==t||e[3]!==o?(d=()=>o(t),e[2]=t,e[3]=o,e[4]=d):d=e[4];let f;e[5]!==t.modelId||e[6]!==l?(f=()=>{a(Es),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=f):f=e[7];let p;e[8]!==r||e[9]!==f?(p=s.jsx(tt,{checked:r,onCheckedChange:f}),e[8]=r,e[9]=f,e[10]=p):p=e[10];let m;e[11]!==u||e[12]!==t.title?(m=s.jsx("img",{src:u,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=u,e[12]=t.title,e[13]=m):m=e[13];let b;e[14]!==t.title?(b=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]=b):b=e[15];let g;return e[16]!==d||e[17]!==p||e[18]!==m||e[19]!==b?(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:d,children:[p,m,b]}),e[16]=d,e[17]=p,e[18]=m,e[19]=b,e[20]=g):g=e[20],g}function Es(i){return!i}function Ms(i){const e=[];for(const t of We)if(i[t].length>0){e.push({type:"header",label:Ve[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 Os({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=L.useRef(null),o=Dt({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(Is,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:n})},r.key):null})})})}function As(i){const e=V.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:u}=xt(t),d=c?u.filter(c):u.filter(Ts);let f;e[0]!==t?(f=()=>(t?Ss(t):null)??js,e[0]=t,e[1]=f):f=e[1];const[p,m]=L.useState(f),[,b]=L.useTransition();let g;e[2]!==t||e[3]!==b?(g=h=>{t&&b(()=>{m(S=>{const x=new Set(S);return x.has(h)?x.delete(h):x.add(h),Ns(t,x),x})})},e[2]=t,e[3]=b,e[4]=g):g=e[4];const y=g,j=n.toLowerCase().trim(),_=h=>j?h.filter(S=>S.title.toLowerCase().includes(j)||S.modelId.toLowerCase().includes(j)):h;if(r){const h=Ee(_(d)),S=Ms(h);let x;e[5]!==p?(x=T=>p.has(T.modelId),e[5]=p,e[6]=x):x=e[6];const O=d.filter(x).length;let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Re,{size:14}),e[7]=A):A=e[7];let z;return e[8]!==a?(z=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:[A,"Back"]}),e[8]=a,e[9]=z):z=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:[z,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[O," selected"]})]}),s.jsx(Os,{items:S,shortlistSet:p,onToggle:y,onHover:l})]})}let N;e[10]!==p?(N=h=>p.has(h.modelId),e[10]=p,e[11]=N):N=e[11];const I=d.filter(N),E=I.length>0?I:d,v=Ee(_(E));let k;e[12]!==v||e[13]!==l||e[14]!==o?(k=We.map(h=>s.jsx(Me,{label:Ve[h],models:v[h],onSelect:o,onHover:l},h)),e[12]=v,e[13]=l,e[14]=o,e[15]=k):k=e[15];let C;e[16]!==v.other||e[17]!==l||e[18]!==o?(C=s.jsx(Me,{label:"Other",models:v.other,onSelect:o,onHover:l}),e[16]=v.other,e[17]=l,e[18]=o,e[19]=C):C=e[19];let w;return e[20]!==k||e[21]!==C?(w=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[k,C]}),e[20]=k,e[21]=C,e[22]=w):w=e[22],w}function Ts(i){return i.asyncResearch!==!0}function mi(){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(H,{className:"size-4 shrink-0"}),s.jsx(H,{className:"flex-1 h-6"}),s.jsx(H,{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(zs)})]}),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(H,{className:"size-6 shrink-0"}),s.jsx(H,{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(H,{className:"h-6 w-20 rounded-md"}),s.jsx(H,{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(H,{className:"h-4 w-24"}),s.jsx(H,{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(H,{className:"h-4 w-16"}),s.jsx(H,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function zs(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(H,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(H,{className:"flex-1 h-4"}),s.jsx(H,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function qe(i){const e=V.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,u]=L.useState(null),[d,f]=L.useState(""),[p,m]=L.useState(!1),b=L.useRef(null),g=he(),y=pt();let j;e[0]!==g?.providers?(j=Object.fromEntries((g?.providers??[]).map(Ls)),e[0]=g?.providers,e[1]=j):j=e[1];const _=j,N=Je(),{org:I}=le();let E;e[2]!==l?(E=M=>{l(M),u(null)},e[2]=l,e[3]=E):E=e[3];const v=E;let k;e[4]!==n||e[5]!==t||e[6]!==r?(k=M=>{n&&(r(M),f(""),t())},e[4]=n,e[5]=t,e[6]=r,e[7]=k):k=e[7];const C=k;if(y.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(os,{})}),e[8]=M):M=e[8],M}let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(Pe,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=w):w=e[9];const h=p?"Search all models...":"Search for a model...";let S;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=M=>f(M.target.value),e[10]=S):S=e[10];let x;e[11]!==d||e[12]!==h?(x=s.jsx(ne,{ref:b,type:"text",placeholder:h,value:d,onChange:S,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]=d,e[12]=h,e[13]=x):x=e[13];let O;e[14]!==n||e[15]!==v||e[16]!==y||e[17]!==_?(O=y.length>0&&s.jsxs(st,{value:n??"",onValueChange:v,children:[s.jsxs(it,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Ps,children:[s.jsx(nt,{placeholder:"Key",children:(()=>{const M=y.find(te=>te.id===n),q=M?_[M.providerId]:void 0,X=_e(M?.presetId),Y=X?.logo??q?.logo,G=X?.name??q?.name??M?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[Y?s.jsx("img",{src:Y,alt:G,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:G.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:G})]})})()}),s.jsx(ht,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(lt,{children:y.map(M=>{const q=_[M.providerId],X=_e(M.presetId),Y=X?.logo??q?.logo,G=X?.name??q?.name??M.providerId;return s.jsx(ot,{value:M.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[Y?s.jsx("img",{src:Y,alt:G,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:G.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[G," — ",M.label]})]})},M.id)})})]}),e[14]=n,e[15]=v,e[16]=y,e[17]=_,e[18]=O):O=e[18];let A;e[19]!==x||e[20]!==O?(A=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:[w,x,O]})}),e[19]=x,e[20]=O,e[21]=A):A=e[21];let z;e[22]!==n?(z=M=>{const{error:q,resetError:X}=M;return s.jsx(ws,{error:q,onRetry:X,credentialId:n??void 0})},e[22]=n,e[23]=z):z=e[23];let T;e[24]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(_s,{}),e[24]=T):T=e[24];const U=n??void 0;let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=()=>m(Rs),e[25]=$):$=e[25];let R;e[26]!==a||e[27]!==C||e[28]!==p||e[29]!==d||e[30]!==U?(R=s.jsx(L.Suspense,{fallback:T,children:s.jsx(As,{keyId:U,searchTerm:d,onHover:u,onModelSelect:C,managing:p,onToggleManage:$,filterModels:a})}),e[26]=a,e[27]=C,e[28]=p,e[29]=d,e[30]=U,e[31]=R):R=e[31];let K;e[32]!==n||e[33]!==z||e[34]!==R?(K=s.jsx(Ze,{fallback:z,children:R},n),e[32]=n,e[33]=z,e[34]=R,e[35]=K):K=e[35];let F;e[36]!==p||e[37]!==N||e[38]!==I?(F=!p&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>L.startTransition(()=>m(!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(at,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>N({to:"/$org/settings/ai-providers",params:{org:I.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(ft,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=p,e[37]=N,e[38]=I,e[39]=F):F=e[39];let B;e[40]!==K||e[41]!==F||e[42]!==A?(B=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:[A,K,F]}),e[40]=K,e[41]=F,e[42]=A,e[43]=B):B=e[43];const D=c??o??null;let P;e[44]!==D?(P=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(fs,{model:D})}),e[44]=D,e[45]=P):P=e[45];let W;return e[46]!==B||e[47]!==P?(W=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[B,P]}),e[46]=B,e[47]=P,e[48]=W):W=e[48],W}function Rs(i){return!i}function Ps(i){return i.stopPropagation()}function Ls(i){return[i.id,i]}function $s(i){const e=V.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:o,setModel:r}=gt();let a;e[0]!==l?(a=d=>{Q("chat_credential_changed",{credential_id:d}),l(d)},e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n||e[3]!==o?.modelId||e[4]!==r?(c=d=>{n&&(Q("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:d.modelId,to_model_provider:d.providerId??null,credential_id:n}),r({...d,keyId:n}))},e[2]=n,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let u;return e[6]!==n||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(u=s.jsx(qe,{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]=u):u=e[11],u}function hi(i){const e=V.c(2),{onClose:t}=i;let n;return e[0]!==t?(n=s.jsx($s,{onClose:t}),e[0]=t,e[1]=n):n=e[1],n}function fi(i){const e=V.c(2);let t;return e[0]!==i?(t=s.jsx(qe,{...i}),e[0]=i,e[1]=t):t=e[1],t}export{ss as C,fi as D,mi as M,os as N,ae as O,De as P,ai as S,di as a,hi as b,ui as g,ci as i,xe as m};
@@ -1 +1 @@
1
- import"./index-5MyNR89x.js";import{e as w}from"./backoff-CrEUbyZT.js";const A={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(A),y=3e4,v=1e3;function _(n){const{buildUrl:u,eventTypes:d,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&b(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of d)t.addEventListener(r,s)}function b(e){if(e.refCount<=0||e.reconnectTimer)return;const t=w(y,v,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function S(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function C(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function m(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>C(s,c.data),s.channel=r}return S(s),s}function L(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=m(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&L(r))}}}}function k(n,u){const d=new Set(u);return{subscribe(a,f,o){const i=l=>{d.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const D=[...p],g=[...p],O=_({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${D.join(",")}`,eventTypes:g,crossTab:!0}),H=k(O,[...p]),P=H;export{A as D,P as d};
1
+ import"./index-CcSfK5lN.js";import{e as w}from"./backoff-CrEUbyZT.js";const A={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},p=Object.values(A),y=3e4,v=1e3;function _(n){const{buildUrl:u,eventTypes:d,name:a,crossTab:f=!1}=n,o=new Map,i=f&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(i&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function l(e,t){e.bootDone=!0;for(const s of e.handlers)try{s(t)}catch{}}function h(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function E(e){const t=new EventSource(u(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(h(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&b(e)};const s=r=>{e.channel?.postMessage({kind:"event",type:r.type,data:r.data}),l(e,r)};for(const r of d)t.addEventListener(r,s)}function b(e){if(e.refCount<=0||e.reconnectTimer)return;const t=w(y,v,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),E(e))},t)}function T(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,E(e)}function S(e){if(!i){T(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,T(e)})).catch(()=>{})}function C(e,t){t.kind==="event"?l(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&h(e)}function m(e){const t=o.get(e);if(t)return t;const s={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(o.set(e,s),i){const r=new BroadcastChannel(`sse:${a}:${e}`);r.onmessage=c=>C(s,c.data),s.channel=r}return S(s),s}function L(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,o.delete(e.key)}return{subscribe(e,t,s){const r=m(e);r.refCount++,r.handlers.add(t),s&&r.reconnectHandlers.add(s);let c=!1;return()=>{c||(c=!0,r.handlers.delete(t),s&&r.reconnectHandlers.delete(s),r.refCount--,r.refCount<=0&&L(r))}}}}function k(n,u){const d=new Set(u);return{subscribe(a,f,o){const i=l=>{d.has(l.type)&&f(l)};return n.subscribe(a,i,o)}}}const D=[...p],g=[...p],O=_({name:"watch",buildUrl:n=>`/api/${encodeURIComponent(n)}/watch?types=${D.join(",")}`,eventTypes:g,crossTab:!0}),H=k(O,[...p]),P=H;export{A as D,P as d};
@@ -1 +1 @@
1
- import{c as n,j as i,cD as u,l as c,bU as m,ds as x,dt as j,cE as N,cF as b,du as g,dv as D}from"./index-5MyNR89x.js";import{i as h}from"./X-DlUiLOPC.js";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(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function F(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{R as D,B as a,F as b,E as c,T as d,z as e,w as f,v as g,y as h,k as i};
1
+ import{c as n,j as i,cC as u,l as c,bT as m,dr as x,ds as j,cD as N,cE as b,dt as g,du as D}from"./index-CcSfK5lN.js";import{i as h}from"./X-DJbyjHqp.js";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(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(D,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function w(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(g,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(b,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(g,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function T(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function O(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{R as D,B as a,O as b,E as c,T as d,z as e,w as f,v as g,y as h,k as i};