decocms 2.175.0 → 2.175.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/dist/client/assets/{AlertCircle-5ZbLDi3s.js → AlertCircle-CnfwZdxb.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-D4ghzTQG.js → AlignLeft-zj1VrWVO.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-B5WC3D5H.js → ArrowDown-BnnQhLmg.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-D0Lalw4x.js → ArrowLeft-C3_bzjZf.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-tKKJvEkq.js → ArrowUp-BuKX1RSZ.js} +1 -1
  6. package/dist/client/assets/{Check-CuWDIJeM.js → Check-7kB05ju_.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-wz1RfkCA.js → CheckCircle-DrGaevdP.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-UsIketHR.js → CheckDone01-CVJEgdwq.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-cu3amtx9.js → CheckVerified02-DmV5dzDn.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-D0TXudCx.js → ChevronDown-DHeagNGb.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-BZsszCLQ.js → ChevronLeft-W2gkpjgL.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-UJRwW9xN.js → ChevronRight-Blv21S_7.js} +1 -1
  13. package/dist/client/assets/{ChevronUp-DXMXl76b.js → ChevronUp-J7upZD3-.js} +1 -1
  14. package/dist/client/assets/{Clock-DKQ7EGj-.js → Clock-9Mm0U0Dg.js} +1 -1
  15. package/dist/client/assets/{Code01-DZzuHJh9.js → Code01-DDbKsccR.js} +1 -1
  16. package/dist/client/assets/{Coins01-DWo6Ypxq.js → Coins01-DTz6uYyF.js} +1 -1
  17. package/dist/client/assets/{Container-YdffBHg3.js → Container-Ci_1Xm4L.js} +1 -1
  18. package/dist/client/assets/{Copy01-CPHBT83w.js → Copy01-BexEalI-.js} +1 -1
  19. package/dist/client/assets/{Dataflow03-CUuQJ-m_.js → Dataflow03-CKfLDuKw.js} +1 -1
  20. package/dist/client/assets/{DotsHorizontal-DUoeCjzn.js → DotsHorizontal-3xIvFzgk.js} +1 -1
  21. package/dist/client/assets/{DotsVertical-BaBvJOuP.js → DotsVertical-7N_NB6wt.js} +1 -1
  22. package/dist/client/assets/{Download01-D5-Ilwwi.js → Download01-D-oC1d8d.js} +1 -1
  23. package/dist/client/assets/{Edit01-Dpq6F4lk.js → Edit01-gYPHsLoC.js} +1 -1
  24. package/dist/client/assets/{Edit05-h0OeCHXT.js → Edit05-BA2Lz_6R.js} +1 -1
  25. package/dist/client/assets/{Eye-DDwMVcxZ.js → Eye-Cn6YseXl.js} +1 -1
  26. package/dist/client/assets/{EyeOff-D8njwIM7.js → EyeOff-L-SLicw9.js} +1 -1
  27. package/dist/client/assets/{File02-Bc8tH3v5.js → File02-Dx1Iz50W.js} +1 -1
  28. package/dist/client/assets/{File06-ZV5CfSHG.js → File06-Dqc-K1-5.js} +1 -1
  29. package/dist/client/assets/{FilterLines-aqS8nu95.js → FilterLines-DCrzLWfV.js} +1 -1
  30. package/dist/client/assets/{Globe01-BdWDm7Ni.js → Globe01-DW2rHI0i.js} +1 -1
  31. package/dist/client/assets/{Globe02-Cn3qFriL.js → Globe02-CyGtzZ8k.js} +1 -1
  32. package/dist/client/assets/{Grid01-Gq7hBl7S.js → Grid01-Dqz--q3o.js} +1 -1
  33. package/dist/client/assets/{Hash02-CmJ0Y9N4.js → Hash02-pqCZ_ykD.js} +1 -1
  34. package/dist/client/assets/{Home02-Dz88FEOV.js → Home02-D2W6xjpZ.js} +1 -1
  35. package/dist/client/assets/{Image01-DBWShOGl.js → Image01-U7ZIAIPc.js} +1 -1
  36. package/dist/client/assets/{Inbox01-CJphqD3y.js → Inbox01-DpRIO4ZY.js} +1 -1
  37. package/dist/client/assets/{InfoCircle-uEl5PLW5.js → InfoCircle-CvSmMU6H.js} +1 -1
  38. package/dist/client/assets/{Key01-IptFTL_3.js → Key01-Dq5b7fdA.js} +1 -1
  39. package/dist/client/assets/{LayersTwo01-B5fVqAUB.js → LayersTwo01-Li6JqY2K.js} +1 -1
  40. package/dist/client/assets/{LayoutLeft-B8-msEGR.js → LayoutLeft-BAk65lFq.js} +1 -1
  41. package/dist/client/assets/{Link01-BpjSsBky.js → Link01-NJWLnzFs.js} +1 -1
  42. package/dist/client/assets/{LinkExternal01-B21lACin.js → LinkExternal01-B8e_Oa3I.js} +1 -1
  43. package/dist/client/assets/{List-ySIwqood.js → List-Cc_Ri6eQ.js} +1 -1
  44. package/dist/client/assets/{Loading01-WTkiPysv.js → Loading01-Cbk1oNZ2.js} +1 -1
  45. package/dist/client/assets/{Lock01-DqO9uSP7.js → Lock01-dP10fLup.js} +1 -1
  46. package/dist/client/assets/{Play-D72BHSXn.js → Play-DqxAqUbl.js} +1 -1
  47. package/dist/client/assets/{Plus-Dto-8y6a.js → Plus-CqWob4tu.js} +1 -1
  48. package/dist/client/assets/{RefreshCcw01-DckyCUMd.js → RefreshCcw01-B6R5Js1R.js} +1 -1
  49. package/dist/client/assets/{Save01-C2uk3LpG.js → Save01-BfieBu6m.js} +1 -1
  50. package/dist/client/assets/{SearchMd-Kap2MdR9.js → SearchMd-DJI6OMcD.js} +1 -1
  51. package/dist/client/assets/{Settings01-CYUXeHtK.js → Settings01-BWkL3Bf9.js} +1 -1
  52. package/dist/client/assets/{Shield01-CJ-f24yL.js → Shield01-DMT1motk.js} +1 -1
  53. package/dist/client/assets/{Terminal-BQ1GlFmm.js → Terminal-zNrinv6B.js} +1 -1
  54. package/dist/client/assets/Tool01-CUx5BAY-.js +1 -0
  55. package/dist/client/assets/{Trash01-DkXbOnbi.js → Trash01-C0891dQq.js} +1 -1
  56. package/dist/client/assets/{Upload01-BasmYIL8.js → Upload01-ngHWsp64.js} +1 -1
  57. package/dist/client/assets/{Users03-BXwEsNFj.js → Users03-FsZwQwZq.js} +1 -1
  58. package/dist/client/assets/{X-CNbskBah.js → X-CeRZ6ROs.js} +1 -1
  59. package/dist/client/assets/XAxis-B4Pxztvn.js +1 -0
  60. package/dist/client/assets/{XCircle-DvUvQRq1.js → XCircle-X3Ds2fko.js} +1 -1
  61. package/dist/client/assets/{XClose-B0FgAxIQ.js → XClose-BieEiV6P.js} +1 -1
  62. package/dist/client/assets/{Zap-BgjTj76q.js → Zap-B-qa654H.js} +1 -1
  63. package/dist/client/assets/{agent-connections-preview-Bh6ijP_X.js → agent-connections-preview-BXeLz6mJ.js} +1 -1
  64. package/dist/client/assets/agent-detail-2cFCKx9t.js +2 -0
  65. package/dist/client/assets/agents-DS-16MLo.js +1 -0
  66. package/dist/client/assets/ai-providers-logos-Bb5LHAPU.js +1 -0
  67. package/dist/client/assets/{alert-dialog-DtAWdTyc.js → alert-dialog-DgTufZ_p.js} +3 -3
  68. package/dist/client/assets/{auth-catchall-5qyXxzaS.js → auth-catchall-zO2o6cw1.js} +1 -1
  69. package/dist/client/assets/automation-detail-CyiDphKi.js +1 -0
  70. package/dist/client/assets/automations-CBvKrAy1.js +1 -0
  71. package/dist/client/assets/{avatar-ChRCLY4k.js → avatar-w6QMWHVj.js} +1 -1
  72. package/dist/client/assets/{badge-C4uZcq7J.js → badge-B-_hRtCy.js} +1 -1
  73. package/dist/client/assets/{binder-hd3C3mvD.js → binder-BEJ4wRzw.js} +1 -1
  74. package/dist/client/assets/{breadcrumb-pLMl4xjy.js → breadcrumb-Dk9kRV2t.js} +1 -1
  75. package/dist/client/assets/card-BSGld6G2.js +1 -0
  76. package/dist/client/assets/chart-CEfru1MQ.js +15 -0
  77. package/dist/client/assets/{checkbox-D2IG7klY.js → checkbox-COsQJsO9.js} +1 -1
  78. package/dist/client/assets/{collapsible-ttq3VbhQ.js → collapsible-BCGKc4Wz.js} +1 -1
  79. package/dist/client/assets/{collection-detail-DoRLjPv6.js → collection-detail-BimbOEiL.js} +5 -5
  80. package/dist/client/assets/collection-display-button-CuyLh-NC.js +1 -0
  81. package/dist/client/assets/{collection-search-Mtc1qP5K.js → collection-search-aJlY7LHs.js} +1 -1
  82. package/dist/client/assets/collection-table-wrapper-CcbJTCba.js +1 -0
  83. package/dist/client/assets/{collection-tabs-CHem1-m4.js → collection-tabs-B2Xeppc1.js} +1 -1
  84. package/dist/client/assets/{command-DRBqjkmt.js → command-CyHipwcz.js} +1 -1
  85. package/dist/client/assets/{connect-CRbH1TYm.js → connect-3nC8bK4k.js} +1 -1
  86. package/dist/client/assets/connection-card-iA_b7WBI.js +1 -0
  87. package/dist/client/assets/connection-detail-B4CoR-IH.js +1 -0
  88. package/dist/client/assets/{connection-status-COvhqytZ.js → connection-status-BddpcBJZ.js} +1 -1
  89. package/dist/client/assets/connections-B-zXLcDP.js +1 -0
  90. package/dist/client/assets/{constants-B9t4Nuz_.js → constants-CDL9XClm.js} +1 -1
  91. package/dist/client/assets/constants-DxY-8FrK.js +1 -0
  92. package/dist/client/assets/{context-CiizXS06.js → context-DDV_uL9a.js} +1 -1
  93. package/dist/client/assets/{create-organization-dialog-BCMxp6fo.js → create-organization-dialog-CG01zre5.js} +1 -1
  94. package/dist/client/assets/{create-project-dialog-BvxMRX5X.js → create-project-dialog-5e-piQzY.js} +1 -1
  95. package/dist/client/assets/{danger-BjSxZinj.js → danger-_ZcnVgTL.js} +1 -1
  96. package/dist/client/assets/{danger-zone-B2z3wTq9.js → danger-zone-e3foS_su.js} +1 -1
  97. package/dist/client/assets/{dependencies-BkOdHYmE.js → dependencies-DUviAtSp.js} +1 -1
  98. package/dist/client/assets/dialog-DxTRqiug.js +1 -0
  99. package/dist/client/assets/{dropdown-menu-Cp0O2jCN.js → dropdown-menu-CdjuOUR6.js} +1 -1
  100. package/dist/client/assets/dynamic-plugin-layout-DszdejBu.js +1 -0
  101. package/dist/client/assets/{editable-task-title-COr46zxY.js → editable-task-title-44X_8A19.js} +1 -1
  102. package/dist/client/assets/{empty-state-DbRFhzf6.js → empty-state-Bj_isc1T.js} +1 -1
  103. package/dist/client/assets/{empty-state-SBIKV11G.js → empty-state-v8jdj56V.js} +1 -1
  104. package/dist/client/assets/env-vars-editor-Bs6jziXp.js +1 -0
  105. package/dist/client/assets/extract-connection-data-Cyjq-Q5I.js +1 -0
  106. package/dist/client/assets/{file-browser-B2cQNHIN.js → file-browser-4NMlO2k_.js} +2 -2
  107. package/dist/client/assets/{form-DPPO-3Tw.js → form-BV3tSlED.js} +1 -1
  108. package/dist/client/assets/{general-DDQcxBFZ.js → general-LSfgt8-y.js} +1 -1
  109. package/dist/client/assets/{grid-view-BhmPSvr_.js → grid-view-BD9vYk3H.js} +1 -1
  110. package/dist/client/assets/home-Ck605SqF.js +1 -0
  111. package/dist/client/assets/{index-B3fUA0k0.js → index-B70G5L15.js} +1 -1
  112. package/dist/client/assets/{index-Bmxys2UV.js → index-BE93ZIdg.js} +1 -1
  113. package/dist/client/assets/{index-DO8fUd54.js → index-BXUNq6d7.js} +4 -4
  114. package/dist/client/assets/{index-D-NeGwUy.js → index-CZ7yh8sQ.js} +1 -1
  115. package/dist/client/assets/index-Ci8WAd55.css +1 -0
  116. package/dist/client/assets/index-Dg_kVhT7.js +1 -0
  117. package/dist/client/assets/index-DlhaGZnK.js +1 -0
  118. package/dist/client/assets/{index-COM-PDLy.js → index-L6huQtcJ.js} +1 -1
  119. package/dist/client/assets/index-rWegviRE.js +1 -0
  120. package/dist/client/assets/{index-BVSHvvtZ.js → index-uQDoUdMq.js} +1 -1
  121. package/dist/client/assets/{index-C6XH6ylF.js → index-zJEaoyYS.js} +12 -12
  122. package/dist/client/assets/{infiniteQueryObserver-x0ce-nmx.js → infiniteQueryObserver-DXFe0xIV.js} +1 -1
  123. package/dist/client/assets/{input-BM9bdg-F.js → input-BFH8rk50.js} +1 -1
  124. package/dist/client/assets/integration-icon-D6SJHU0f.js +1 -0
  125. package/dist/client/assets/{label-CnT8WAQY.js → label-DE7vX487.js} +1 -1
  126. package/dist/client/assets/{layout-ubFJ5DPd.js → layout-B2GnF_Vp.js} +1 -1
  127. package/dist/client/assets/layout-B_GGomJW.js +1 -0
  128. package/dist/client/assets/login-CgzRmuxY.js +1 -0
  129. package/dist/client/assets/{logo-upload-Bb5Ay7-T.js → logo-upload-Bfzj_LQV.js} +1 -1
  130. package/dist/client/assets/{markdown-ZobUYaB1.js → markdown-Da-6gcG9.js} +8 -8
  131. package/dist/client/assets/{mcp-app-renderer-CLfglV2_.js → mcp-app-renderer-CNc9yMN5.js} +2 -2
  132. package/dist/client/assets/mcp-server-card-s9NGsKpt.js +1 -0
  133. package/dist/client/assets/mcp-server-detail-fMXGyX4W.js +2 -0
  134. package/dist/client/assets/members-BvBWfv9e.js +3 -0
  135. package/dist/client/assets/{monaco-editor-kjafc2y3.js → monaco-editor-VspAvYbk.js} +1 -1
  136. package/dist/client/assets/monitoring-B1jfqgQN.js +4 -0
  137. package/dist/client/assets/monitoring-dashboard-edit-Bdujw4Ym.js +1 -0
  138. package/dist/client/assets/{monitoring-dashboard-view-FD-yc8mV.js → monitoring-dashboard-view-CSfkxnkl.js} +2 -2
  139. package/dist/client/assets/monitoring-stats-row-Ds_uiyYJ.js +28 -0
  140. package/dist/client/assets/{oauth-callback-wHI3TkEb.js → oauth-callback-BNPNdlSW.js} +1 -1
  141. package/dist/client/assets/{oauth-callback-ai-provider-DHfWQd6C.js → oauth-callback-ai-provider-CODmoIp9.js} +1 -1
  142. package/dist/client/assets/org-ai-providers-CQKU4ds_.js +1 -0
  143. package/dist/client/assets/page-Bbbh0c0Z.js +1 -0
  144. package/dist/client/assets/page-BfphKBfj.js +1 -0
  145. package/dist/client/assets/{plugin-empty-state-Bh1khfVy.js → plugin-empty-state-BWhKyfJ8.js} +1 -1
  146. package/dist/client/assets/{plugin-empty-state-C0KzvXIH.js → plugin-empty-state-Cx_CuKe3.js} +1 -1
  147. package/dist/client/assets/{plugin-header-DJbwn5SE.js → plugin-header-ET8DV5kQ.js} +1 -1
  148. package/dist/client/assets/{plugin-header-ydYJ1Vj6.js → plugin-header-ncr8MkbN.js} +1 -1
  149. package/dist/client/assets/plugins-BdyM0ZUw.js +1 -0
  150. package/dist/client/assets/{popover-D1WG-emQ.js → popover-BcyJids_.js} +1 -1
  151. package/dist/client/assets/project-app-view-BdLdOYqG.js +1 -0
  152. package/dist/client/assets/project-layout-DReK69oR.js +1 -0
  153. package/dist/client/assets/{project-plugins-BVdloqBu.js → project-plugins-CXWguN_r.js} +1 -1
  154. package/dist/client/assets/projects-list-CZANuMq5.js +1 -0
  155. package/dist/client/assets/{registry-layout-B5XpbAHd.js → registry-layout-CqXQ571U.js} +1 -1
  156. package/dist/client/assets/registry-utils-CaVl1vKg.js +1 -0
  157. package/dist/client/assets/{reports-layout-Ct8yUpC8.js → reports-layout-CQyNOFqA.js} +1 -1
  158. package/dist/client/assets/{reset-password-BXrkGw9C.js → reset-password-Bt_v8_59.js} +1 -1
  159. package/dist/client/assets/{resizable-CqLBllsV.js → resizable-B4X_WbHf.js} +1 -1
  160. package/dist/client/assets/{save-actions-MbSzUbWU.js → save-actions-Py9YKTe0.js} +1 -1
  161. package/dist/client/assets/{scroll-area-BcJ1ckdt.js → scroll-area-R7PT492V.js} +1 -1
  162. package/dist/client/assets/{select-RxUFw6pZ.js → select-B-f7jgVG.js} +1 -1
  163. package/dist/client/assets/{select-virtual-mcp-DU8qBWLM.js → select-virtual-mcp-YanYQUBn.js} +1 -1
  164. package/dist/client/assets/sheet-7nFLkS7G.js +1 -0
  165. package/dist/client/assets/shell-layout-Dp8xiQMR.js +3 -0
  166. package/dist/client/assets/{sidebar-settings-DICq5I_K.js → sidebar-settings-w0p27D0n.js} +1 -1
  167. package/dist/client/assets/{skeleton-CU7LuZGk.js → skeleton-CK2-6UkT.js} +1 -1
  168. package/dist/client/assets/{spinner-CpOteR2a.js → spinner-B1-EIDBS.js} +1 -1
  169. package/dist/client/assets/{store-invite-D2k0Vn6N.js → store-invite-DVPM6U-x.js} +1 -1
  170. package/dist/client/assets/{switch-DyxdcdWl.js → switch-4UL4iV3X.js} +1 -1
  171. package/dist/client/assets/{table-DyNKuHyS.js → table-Bu98B5a-.js} +1 -1
  172. package/dist/client/assets/{tabs-XMAGaWgq.js → tabs-Cif80TZ4.js} +1 -1
  173. package/dist/client/assets/{task-status-DJB3YbbO.js → task-status-BWKjAgiX.js} +16 -16
  174. package/dist/client/assets/{tasks-panel-XTVNkW83.js → tasks-panel-D6Bb-wiS.js} +1 -1
  175. package/dist/client/assets/tasks-tenjlvFT.js +1 -0
  176. package/dist/client/assets/{textarea-BLuscN8X.js → textarea-DPLd5P1K.js} +1 -1
  177. package/dist/client/assets/{time-range-picker-Bd3fku3n.js → time-range-picker-FJd_w9AH.js} +1 -1
  178. package/dist/client/assets/{toggle-group-BrL6C5fG.js → toggle-group-B4QQy8X1.js} +1 -1
  179. package/dist/client/assets/tools-list-BgmW-tI4.js +1 -0
  180. package/dist/client/assets/{tooltip-BLTgyg7W.js → tooltip-BGPUMzDS.js} +1 -1
  181. package/dist/client/assets/{topbar-portal-_Qqzdv9B.js → topbar-portal-CLOTo-7w.js} +1 -1
  182. package/dist/client/assets/{types-BPYct9bF.js → types-DZ5M-eMJ.js} +5 -5
  183. package/dist/client/assets/{use-automations-BeAHZecx.js → use-automations-D7j59hRT.js} +1 -1
  184. package/dist/client/assets/use-binding-CZ8osTa1.js +1 -0
  185. package/dist/client/assets/{use-collections-C8rLdQUN.js → use-collections-yY78nnLx.js} +1 -1
  186. package/dist/client/assets/{use-connection-BNGXvSqD.js → use-connection-lXrlfojY.js} +1 -1
  187. package/dist/client/assets/{use-copy-DPJ8nWWs.js → use-copy-DZJI58oZ.js} +1 -1
  188. package/dist/client/assets/{use-create-virtual-mcp-BfS4KaKE.js → use-create-virtual-mcp-DK_WDS9Y.js} +1 -1
  189. package/dist/client/assets/use-infinite-scroll-C-TK62Eo.js +1 -0
  190. package/dist/client/assets/{use-install-from-registry-BEC7S-53.js → use-install-from-registry-C24f0cqa.js} +1 -1
  191. package/dist/client/assets/{use-list-state-DsQajLIu.js → use-list-state-D6LU1koz.js} +1 -1
  192. package/dist/client/assets/{use-mcp-prompts-D_02f3uO.js → use-mcp-prompts-DT9l3i02.js} +1 -1
  193. package/dist/client/assets/{use-mcp-resources-BNoK6dDS.js → use-mcp-resources-DhBJVSsg.js} +1 -1
  194. package/dist/client/assets/{use-mcp-tools-BCCglZve.js → use-mcp-tools-CwVNqTmj.js} +1 -1
  195. package/dist/client/assets/{use-members-Cqa4gqXV.js → use-members-fpZqw1dy.js} +1 -1
  196. package/dist/client/assets/{use-mobile-kAkblq0-.js → use-mobile-B0lEbMk3.js} +1 -1
  197. package/dist/client/assets/{use-project-DNZXkIib.js → use-project-BnRSDoVD.js} +1 -1
  198. package/dist/client/assets/use-store-discovery-C9fJhQ4Y.js +1 -0
  199. package/dist/client/assets/{use-view-mode-Bl6DaWwW.js → use-view-mode-0w9n1sJ-.js} +1 -1
  200. package/dist/client/assets/{use-virtual-mcp-DoDJBE5n.js → use-virtual-mcp-CyoGC0aH.js} +1 -1
  201. package/dist/client/assets/useInfiniteQuery-BlrmUHYA.js +1 -0
  202. package/dist/client/assets/{useMutation-CNVq636e.js → useMutation-CkdHuTyE.js} +1 -1
  203. package/dist/client/assets/useQuery-Bmc4jnG2.js +1 -0
  204. package/dist/client/assets/useSuspenseInfiniteQuery-DD4jjrsx.js +1 -0
  205. package/dist/client/assets/{user-6WV0RuBu.js → user-sbKkVV9F.js} +1 -1
  206. package/dist/client/assets/workflow-CpP3zoVI.js +1 -0
  207. package/dist/client/index.html +2 -2
  208. package/dist/server/node_modules/{postgres-bytea/license → pg/LICENSE} +6 -6
  209. package/dist/server/node_modules/pg/README.md +95 -0
  210. package/dist/server/node_modules/pg/esm/index.mjs +20 -0
  211. package/dist/server/node_modules/pg/lib/client.js +743 -0
  212. package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
  213. package/dist/server/node_modules/pg/lib/connection.js +221 -0
  214. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  215. package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  216. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  217. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  218. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  219. package/dist/server/node_modules/pg/lib/defaults.js +91 -0
  220. package/dist/server/node_modules/pg/lib/index.js +73 -0
  221. package/dist/server/node_modules/pg/lib/native/client.js +323 -0
  222. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  223. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  224. package/dist/server/node_modules/pg/lib/query.js +252 -0
  225. package/dist/server/node_modules/pg/lib/result.js +109 -0
  226. package/dist/server/node_modules/pg/lib/stream.js +83 -0
  227. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  228. package/dist/server/node_modules/pg/lib/utils.js +217 -0
  229. package/dist/server/node_modules/pg/package.json +76 -0
  230. package/package.json +1 -1
  231. package/dist/client/assets/agent-detail-Cda1RjKX.js +0 -2
  232. package/dist/client/assets/agents-DNXSTqTl.js +0 -1
  233. package/dist/client/assets/ai-providers-logos-W57Qm-EN.js +0 -1
  234. package/dist/client/assets/automation-detail-BV87rs7m.js +0 -1
  235. package/dist/client/assets/automations-Dp0qrLbX.js +0 -1
  236. package/dist/client/assets/card-B4dTtsmd.js +0 -1
  237. package/dist/client/assets/chart-Caf0jSbB.js +0 -15
  238. package/dist/client/assets/collection-display-button-C0A6ba73.js +0 -1
  239. package/dist/client/assets/collection-tab-CTog7m1d.js +0 -1
  240. package/dist/client/assets/collection-table-wrapper-Ccujw2gS.js +0 -1
  241. package/dist/client/assets/connection-card-DXMFAvSL.js +0 -1
  242. package/dist/client/assets/connection-detail-D-M6vj9q.js +0 -1
  243. package/dist/client/assets/connections-BZmayWR_.js +0 -1
  244. package/dist/client/assets/constants-Dr5R1EQY.js +0 -1
  245. package/dist/client/assets/dialog-CTFHRhvl.js +0 -1
  246. package/dist/client/assets/dynamic-plugin-layout-CcrlbNZV.js +0 -1
  247. package/dist/client/assets/env-vars-editor-1feSU4JA.js +0 -1
  248. package/dist/client/assets/extract-connection-data-adtLKfGW.js +0 -1
  249. package/dist/client/assets/github-icon-Dp3wHhYE.js +0 -1
  250. package/dist/client/assets/home-Dxpbp1Bj.js +0 -1
  251. package/dist/client/assets/icon-picker-BKKuKn6y.js +0 -1
  252. package/dist/client/assets/index-B1uuY7UL.js +0 -1
  253. package/dist/client/assets/index-B_m3AdpY.js +0 -1
  254. package/dist/client/assets/index-BqlWbrG0.js +0 -1
  255. package/dist/client/assets/index-DmrxmdhV.css +0 -1
  256. package/dist/client/assets/integration-icon-BrOdBipR.js +0 -1
  257. package/dist/client/assets/layout-C4PDA52F.js +0 -1
  258. package/dist/client/assets/login-CTOJXY_r.js +0 -1
  259. package/dist/client/assets/mcp-server-card-AL30DdJr.js +0 -1
  260. package/dist/client/assets/mcp-server-detail-CN2kEGgD.js +0 -2
  261. package/dist/client/assets/members-CpLusvJM.js +0 -3
  262. package/dist/client/assets/monitoring-BNAsqD0Y.js +0 -31
  263. package/dist/client/assets/monitoring-dashboard-edit-CtIPN7nQ.js +0 -1
  264. package/dist/client/assets/org-ai-providers-Cu3Y8hG7.js +0 -1
  265. package/dist/client/assets/page-BWMoYp-g.js +0 -1
  266. package/dist/client/assets/page-Ch5Qzmi-.js +0 -1
  267. package/dist/client/assets/plugins-D5THwapv.js +0 -1
  268. package/dist/client/assets/project-app-view-D-VHvgqy.js +0 -1
  269. package/dist/client/assets/project-layout-Cd8cNifU.js +0 -1
  270. package/dist/client/assets/projects-list-Z8HiWxIk.js +0 -1
  271. package/dist/client/assets/readme-viewer-MbTGGbgZ.js +0 -1
  272. package/dist/client/assets/registry-utils-oSXyNc33.js +0 -1
  273. package/dist/client/assets/shell-layout-0dnPJSNe.js +0 -3
  274. package/dist/client/assets/tasks-BJvBlQqj.js +0 -1
  275. package/dist/client/assets/tools-list-BeUwtNiH.js +0 -1
  276. package/dist/client/assets/use-binding-DSWv53zN.js +0 -1
  277. package/dist/client/assets/use-llm-IG8InXvX.js +0 -1
  278. package/dist/client/assets/use-local-storage-C3Bo802w.js +0 -1
  279. package/dist/client/assets/useInfiniteQuery-BBGNgnIc.js +0 -1
  280. package/dist/client/assets/useQuery-BeFLqBun.js +0 -1
  281. package/dist/client/assets/useSuspenseInfiniteQuery-CdVyznmA.js +0 -1
  282. package/dist/client/assets/workflow-DUYpxPLh.js +0 -1
  283. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  284. package/dist/server/node_modules/pg-int8/README.md +0 -16
  285. package/dist/server/node_modules/pg-int8/index.js +0 -100
  286. package/dist/server/node_modules/pg-int8/package.json +0 -24
  287. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  288. package/dist/server/node_modules/postgres-array/index.js +0 -97
  289. package/dist/server/node_modules/postgres-array/license +0 -21
  290. package/dist/server/node_modules/postgres-array/package.json +0 -35
  291. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  292. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  293. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  294. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  295. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  296. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  297. package/dist/server/node_modules/postgres-interval/license +0 -21
  298. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  299. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  300. /package/dist/client/assets/{readme-viewer-DWnTz46N.css → mcp-server-detail-DWnTz46N.css} +0 -0
@@ -1,31 +0,0 @@
1
- import{r as p,ca as Fe,bQ as Nn,cn as wn,c as ee,z as Ne,j as n,u as De,E as Vt,x as Sn,e as Ut,v as Pn,K as lt,B as ye,w as It,O as oa,d as In}from"./index-DO8fUd54.js";import{C as On}from"./collection-search-Mtc1qP5K.js";import{P as je}from"./index-B1uuY7UL.js";import{B as ca,a as da,b as ua,c as ma}from"./breadcrumb-pLMl4xjy.js";import{E as Ht}from"./empty-state-SBIKV11G.js";import{E as Cn,d as kn,e as rr,b as Tn,T as An,M as Gt,p as et,s as Re,a as ar}from"./time-range-picker-Bd3fku3n.js";import{I as it}from"./integration-icon-BrOdBipR.js";import{B as ot}from"./badge-C4uZcq7J.js";import{t as At}from"./ChevronDown-D0TXudCx.js";import{i as Dn}from"./ChevronRight-UJRwW9xN.js";import{c as xe,b as He,d as fa,e as pa,a as va,T as ie}from"./table-DyNKuHyS.js";import{ar as En,as as tt,a2 as ke,i as Ue,at as ha,r as We,V as gt,au as xa,X as bt,av as Y,Y as J,aw as Ke,ax as ct,ay as dt,az as Oe,aA as nr,O as Te,a3 as Mn,a8 as qt,aB as _n,aC as Ln,aD as $n,aE as Bn,_ as ze,a5 as Dt,w as Rn,l as pe,m as Ie,aF as Kn,p as we,v as Se,z as Zt,x as zn,y as ut,B as ga,D as yt,c as jt,R as ba,S as ya,C as ja,F as Nt,G as Na,H as wa,K as Sa,L as Fn,I as Pa,d as Ge,M as Wn,N as Vn,Z as wt,P as Ia,Q as Un,T as St,U as sr,a0 as Oa,a1 as Ca,k as ka,a4 as Hn,aG as Gn,ac as qn,n as Zn,q as Ee,t as Me,aH as Ta,aI as Qn,aJ as Xn,A as lr,aK as Yn,aL as ir,E as Jn,aM as es,aN as Aa,aO as ts,aP as Da,aQ as rs,aR as as,aS as or,aT as ns,$ as ss,al as Ea,am as Ma,ap as Et,aq as ls,an as Mt,ao as cr}from"./chart-Caf0jSbB.js";import{a as Qe,u as Xe,W as is}from"./constants-B9t4Nuz_.js";import{u as Qt}from"./use-mcp-tools-BCCglZve.js";import{i as os}from"./DotsVertical-BaBvJOuP.js";import{i as cs}from"./Edit05-h0OeCHXT.js";import{s as _a}from"./Plus-Dto-8y6a.js";import{s as La}from"./Trash01-DkXbOnbi.js";import{C as ds}from"./connection-card-DXMFAvSL.js";import{D as us,a as ms,b as fs,c as dr}from"./dropdown-menu-Cp0O2jCN.js";import{f as ps,a as vs,b as hs,c as xs,d as gs,e as bs,A as ys,h as js}from"./alert-dialog-DtAWdTyc.js";import{u as Ns}from"./use-members-Cqa4gqXV.js";import{u as ws}from"./useSuspenseInfiniteQuery-CdVyznmA.js";import{b as $a}from"./use-connection-BNGXvSqD.js";import{b as Ss}from"./use-virtual-mcp-DoDJBE5n.js";import{i as Ps}from"./Code01-DZzuHJh9.js";import{n as _t}from"./Container-YdffBHg3.js";import{i as Is}from"./FilterLines-aqS8nu95.js";import{c as Os}from"./Grid01-Gq7hBl7S.js";import{I as Ot}from"./input-BM9bdg-F.js";import{C as ur}from"./checkbox-D2IG7klY.js";import{c as Cs,d as ks,e as mr,a as Ts,C as As,b as Ds}from"./command-DRBqjkmt.js";import{P as Ba,a as Ra,b as Ka}from"./popover-D1WG-emQ.js";import{S as fr,a as pr,b as vr,c as hr,d as rt}from"./select-RxUFw6pZ.js";import{T as Es}from"./textarea-BLuscN8X.js";import{c as Ms,a as _s,T as Ls}from"./tooltip-BLTgyg7W.js";import{C as za}from"./collection-tabs-CHem1-m4.js";import{S as $s}from"./switch-DyxdcdWl.js";import{L as Bs}from"./label-CnT8WAQY.js";import"./Loading01-WTkiPysv.js";import"./SearchMd-Kap2MdR9.js";import"./use-local-storage-C3Bo802w.js";import"./useQuery-BeFLqBun.js";import"./useMutation-CNVq636e.js";import"./Check-CuWDIJeM.js";import"./Copy01-CPHBT83w.js";import"./Download01-D5-Ilwwi.js";import"./Key01-IptFTL_3.js";import"./Play-D72BHSXn.js";import"./monaco-editor-kjafc2y3.js";import"./spinner-CpOteR2a.js";import"./scroll-area-BcJ1ckdt.js";import"./ChevronUp-DXMXl76b.js";import"./Clock-DKQ7EGj-.js";import"./ChevronLeft-BZsszCLQ.js";import"./index-Bmxys2UV.js";import"./card-B4dTtsmd.js";import"./infiniteQueryObserver-x0ce-nmx.js";import"./use-collections-C8rLdQUN.js";import"./index-B_m3AdpY.js";import"./index-COM-PDLy.js";const Lt=({size:t=24,color:e="currentColor",...r})=>p.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},p.createElement("path",{d:"M21 21H6.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C3 19.48 3 18.92 3 17.8V3m4 7.5v7m4.5-12v12m4.5-7v7m4.5-12v12"}));Lt.displayName="BarChart07";const Fa=({size:t=24,color:e="currentColor",...r})=>p.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},p.createElement("path",{d:"M9.5 15V9m5 6V9m7.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Fa.displayName="PauseCircle";const Wa=({size:t=24,color:e="currentColor",...r})=>p.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},p.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Z"}),p.createElement("path",{d:"M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z"}));Wa.displayName="PlayCircle";const Va=Math.cos,mt=Math.sin,ve=Math.sqrt,ft=Math.PI,Pt=2*ft,Xt={draw(t,e){const r=ve(e/ft);t.moveTo(r,0),t.arc(0,0,r,0,Pt)}},Rs={draw(t,e){const r=ve(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Ua=ve(1/3),Ks=Ua*2,zs={draw(t,e){const r=ve(e/Ks),a=r*Ua;t.moveTo(0,-r),t.lineTo(a,0),t.lineTo(0,r),t.lineTo(-a,0),t.closePath()}},Fs={draw(t,e){const r=ve(e),a=-r/2;t.rect(a,a,r,r)}},Ws=.8908130915292852,Ha=mt(ft/10)/mt(7*ft/10),Vs=mt(Pt/10)*Ha,Us=-Va(Pt/10)*Ha,Hs={draw(t,e){const r=ve(e*Ws),a=Vs*r,l=Us*r;t.moveTo(0,-r),t.lineTo(a,l);for(let s=1;s<5;++s){const i=Pt*s/5,c=Va(i),o=mt(i);t.lineTo(o*r,-c*r),t.lineTo(c*a-o*l,o*a+c*l)}t.closePath()}},Ct=ve(3),Gs={draw(t,e){const r=-ve(e/(Ct*3));t.moveTo(0,r*2),t.lineTo(-Ct*r,-r),t.lineTo(Ct*r,-r),t.closePath()}},de=-.5,ue=ve(3)/2,$t=1/ve(12),qs=($t/2+1)*3,Zs={draw(t,e){const r=ve(e/qs),a=r/2,l=r*$t,s=a,i=r*$t+r,c=-s,o=i;t.moveTo(a,l),t.lineTo(s,i),t.lineTo(c,o),t.lineTo(de*a-ue*l,ue*a+de*l),t.lineTo(de*s-ue*i,ue*s+de*i),t.lineTo(de*c-ue*o,ue*c+de*o),t.lineTo(de*a+ue*l,de*l-ue*a),t.lineTo(de*s+ue*i,de*i-ue*s),t.lineTo(de*c+ue*o,de*o-ue*c),t.closePath()}};function Qs(t,e){let r=null,a=En(l);t=typeof t=="function"?t:tt(t||Xt),e=typeof e=="function"?e:tt(e===void 0?64:+e);function l(){let s;if(r||(r=s=a()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),s)return r=null,s+""||null}return l.type=function(s){return arguments.length?(t=typeof s=="function"?s:tt(s),l):t},l.size=function(s){return arguments.length?(e=typeof s=="function"?s:tt(+s),l):e},l.context=function(s){return arguments.length?(r=s??null,l):r},l}var Xs=["type","size","sizeType"];function Bt(){return Bt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Bt.apply(null,arguments)}function xr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function gr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xr(Object(r),!0).forEach(function(a){Ys(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Ys(t,e,r){return(e=Js(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Js(t){var e=el(t,"string");return typeof e=="symbol"?e:e+""}function el(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tl(t,e){if(t==null)return{};var r,a,l=rl(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function rl(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var Ga={symbolCircle:Xt,symbolCross:Rs,symbolDiamond:zs,symbolSquare:Fs,symbolStar:Hs,symbolTriangle:Gs,symbolWye:Zs},al=Math.PI/180,nl=t=>{var e="symbol".concat(ha(t));return Ga[e]||Xt},sl=(t,e,r)=>{if(e==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*al;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},ll=(t,e)=>{Ga["symbol".concat(ha(t))]=e},qa=t=>{var{type:e="circle",size:r=64,sizeType:a="area"}=t,l=tl(t,Xs),s=gr(gr({},l),{},{type:e,size:r,sizeType:a}),i="circle";typeof e=="string"&&(i=e);var c=()=>{var m=nl(i),h=Qs().type(m).size(sl(r,a,i)),b=h();if(b!==null)return b},{className:o,cx:d,cy:f}=s,u=ke(s);return Ue(d)&&Ue(f)&&Ue(r)?p.createElement("path",Bt({},u,{className:Fe("recharts-symbols",o),transform:"translate(".concat(d,", ").concat(f,")"),d:c()})):null};qa.registerSymbol=ll;var il=["radius"],ol=["radius"],br,yr,jr,Nr,wr,Sr,Pr,Ir,Or,Cr;function kr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Tr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kr(Object(r),!0).forEach(function(a){cl(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function cl(t,e,r){return(e=dl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dl(t){var e=ul(t,"string");return typeof e=="symbol"?e:e+""}function ul(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pt(){return pt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pt.apply(null,arguments)}function Ar(t,e){if(t==null)return{};var r,a,l=ml(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function ml(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function ge(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Dr=(t,e,r,a,l)=>{var s=Ke(r),i=Ke(a),c=Math.min(Math.abs(s)/2,Math.abs(i)/2),o=i>=0?1:-1,d=s>=0?1:-1,f=i>=0&&s>=0||i<0&&s<0?1:0,u;if(c>0&&Array.isArray(l)){for(var m=[0,0,0,0],h=0,b=4;h<b;h++){var y,j=(y=l[h])!==null&&y!==void 0?y:0;m[h]=j>c?c:j}u=Y(br||(br=ge(["M",",",""])),t,e+o*m[0]),m[0]>0&&(u+=Y(yr||(yr=ge(["A ",",",",0,0,",",",",",""])),m[0],m[0],f,t+d*m[0],e)),u+=Y(jr||(jr=ge(["L ",",",""])),t+r-d*m[1],e),m[1]>0&&(u+=Y(Nr||(Nr=ge(["A ",",",",0,0,",`,
2
- `,",",""])),m[1],m[1],f,t+r,e+o*m[1])),u+=Y(wr||(wr=ge(["L ",",",""])),t+r,e+a-o*m[2]),m[2]>0&&(u+=Y(Sr||(Sr=ge(["A ",",",",0,0,",`,
3
- `,",",""])),m[2],m[2],f,t+r-d*m[2],e+a)),u+=Y(Pr||(Pr=ge(["L ",",",""])),t+d*m[3],e+a),m[3]>0&&(u+=Y(Ir||(Ir=ge(["A ",",",",0,0,",`,
4
- `,",",""])),m[3],m[3],f,t,e+a-o*m[3])),u+="Z"}else if(c>0&&l===+l&&l>0){var v=Math.min(c,l);u=Y(Or||(Or=ge(["M ",",",`
5
- A `,",",",0,0,",",",",",`
6
- L `,",",`
7
- A `,",",",0,0,",",",",",`
8
- L `,",",`
9
- A `,",",",0,0,",",",",",`
10
- L `,",",`
11
- A `,",",",0,0,",",",","," Z"])),t,e+o*v,v,v,f,t+d*v,e,t+r-d*v,e,v,v,f,t+r,e+o*v,t+r,e+a-o*v,v,v,f,t+r-d*v,e+a,t+d*v,e+a,v,v,f,t,e+a-o*v)}else u=Y(Cr||(Cr=ge(["M ",","," h "," v "," h "," Z"])),t,e,r,a,-r);return u},Er={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},fl=t=>{var e=We(t,Er),r=p.useRef(null),[a,l]=p.useState(-1);p.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var $=r.current.getTotalLength();$&&l($)}catch{}},[]);var{x:s,y:i,width:c,height:o,radius:d,className:f}=e,{animationEasing:u,animationDuration:m,animationBegin:h,isAnimationActive:b,isUpdateAnimationActive:y}=e,j=p.useRef(c),v=p.useRef(o),x=p.useRef(s),g=p.useRef(i),N=p.useMemo(()=>({x:s,y:i,width:c,height:o,radius:d}),[s,i,c,o,d]),S=gt(N,"rectangle-");if(s!==+s||i!==+i||c!==+c||o!==+o||c===0||o===0)return null;var w=Fe("recharts-rectangle",f);if(!y){var O=ke(e),{radius:C}=O,I=Ar(O,il);return p.createElement("path",pt({},I,{x:Ke(s),y:Ke(i),width:Ke(c),height:Ke(o),radius:typeof d=="number"?d:void 0,className:w,d:Dr(s,i,c,o,d)}))}var k=j.current,E=v.current,M=x.current,T=g.current,P="0px ".concat(a===-1?1:a,"px"),D="".concat(a,"px ").concat(a,"px"),L=xa(["strokeDasharray"],m,typeof u=="string"?u:Er.animationEasing);return p.createElement(bt,{animationId:S,key:S,canBegin:a>0,duration:m,easing:u,isActive:y,begin:h},$=>{var z=J(k,c,$),K=J(E,o,$),R=J(M,s,$),_=J(T,i,$);r.current&&(j.current=z,v.current=K,x.current=R,g.current=_);var A;b?$>0?A={transition:L,strokeDasharray:D}:A={strokeDasharray:P}:A={strokeDasharray:D};var B=ke(e),{radius:F}=B,G=Ar(B,ol);return p.createElement("path",pt({},G,{radius:typeof d=="number"?d:void 0,className:w,d:Dr(R,_,z,K,d),ref:r,style:Tr(Tr({},A),e.style)}))})},Mr,_r,Lr,$r,Br,Rr,Kr;function Rt(){return Rt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Rt.apply(null,arguments)}function Ce(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var pl=(t,e)=>{var r=dt(e-t),a=Math.min(Math.abs(e-t),359.999);return r*a},at=t=>{var{cx:e,cy:r,radius:a,angle:l,sign:s,isExternal:i,cornerRadius:c,cornerIsExternal:o}=t,d=c*(i?1:-1)+a,f=Math.asin(c/d)/nr,u=o?l:l+s*f,m=Oe(e,r,d,u),h=Oe(e,r,a,u),b=o?l-s*f:l,y=Oe(e,r,d*Math.cos(f*nr),b);return{center:m,circleTangency:h,lineTangency:y,theta:f}},Za=t=>{var{cx:e,cy:r,innerRadius:a,outerRadius:l,startAngle:s,endAngle:i}=t,c=pl(s,i),o=s+c,d=Oe(e,r,l,s),f=Oe(e,r,l,o),u=Y(Mr||(Mr=Ce(["M ",",",`
12
- A `,",",`,0,
13
- `,",",`,
14
- `,",",`
15
- `])),d.x,d.y,l,l,+(Math.abs(c)>180),+(s>o),f.x,f.y);if(a>0){var m=Oe(e,r,a,s),h=Oe(e,r,a,o);u+=Y(_r||(_r=Ce(["L ",",",`
16
- A `,",",`,0,
17
- `,",",`,
18
- `,","," Z"])),h.x,h.y,a,a,+(Math.abs(c)>180),+(s<=o),m.x,m.y)}else u+=Y(Lr||(Lr=Ce(["L ",","," Z"])),e,r);return u},vl=t=>{var{cx:e,cy:r,innerRadius:a,outerRadius:l,cornerRadius:s,forceCornerRadius:i,cornerIsExternal:c,startAngle:o,endAngle:d}=t,f=dt(d-o),{circleTangency:u,lineTangency:m,theta:h}=at({cx:e,cy:r,radius:l,angle:o,sign:f,cornerRadius:s,cornerIsExternal:c}),{circleTangency:b,lineTangency:y,theta:j}=at({cx:e,cy:r,radius:l,angle:d,sign:-f,cornerRadius:s,cornerIsExternal:c}),v=c?Math.abs(o-d):Math.abs(o-d)-h-j;if(v<0)return i?Y($r||($r=Ce(["M ",",",`
19
- a`,",",",0,0,1,",`,0
20
- a`,",",",0,0,1,",`,0
21
- `])),m.x,m.y,s,s,s*2,s,s,-s*2):Za({cx:e,cy:r,innerRadius:a,outerRadius:l,startAngle:o,endAngle:d});var x=Y(Br||(Br=Ce(["M ",",",`
22
- A`,",",",0,0,",",",",",`
23
- A`,",",",0,",",",",",",",`
24
- A`,",",",0,0,",",",",",`
25
- `])),m.x,m.y,s,s,+(f<0),u.x,u.y,l,l,+(v>180),+(f<0),b.x,b.y,s,s,+(f<0),y.x,y.y);if(a>0){var{circleTangency:g,lineTangency:N,theta:S}=at({cx:e,cy:r,radius:a,angle:o,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),{circleTangency:w,lineTangency:O,theta:C}=at({cx:e,cy:r,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),I=c?Math.abs(o-d):Math.abs(o-d)-S-C;if(I<0&&s===0)return"".concat(x,"L").concat(e,",").concat(r,"Z");x+=Y(Rr||(Rr=Ce(["L",",",`
26
- A`,",",",0,0,",",",",",`
27
- A`,",",",0,",",",",",",",`
28
- A`,",",",0,0,",",",",","Z"])),O.x,O.y,s,s,+(f<0),w.x,w.y,a,a,+(I>180),+(f>0),g.x,g.y,s,s,+(f<0),N.x,N.y)}else x+=Y(Kr||(Kr=Ce(["L",",","Z"])),e,r);return x},hl={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},xl=t=>{var e=We(t,hl),{cx:r,cy:a,innerRadius:l,outerRadius:s,cornerRadius:i,forceCornerRadius:c,cornerIsExternal:o,startAngle:d,endAngle:f,className:u}=e;if(s<l||d===f)return null;var m=Fe("recharts-sector",u),h=s-l,b=ct(i,h,0,!0),y;return b>0&&Math.abs(d-f)<360?y=vl({cx:r,cy:a,innerRadius:l,outerRadius:s,cornerRadius:Math.min(b,h/2),forceCornerRadius:c,cornerIsExternal:o,startAngle:d,endAngle:f}):y=Za({cx:r,cy:a,innerRadius:l,outerRadius:s,startAngle:d,endAngle:f}),p.createElement("path",Rt({},ke(e),{className:m,d:y}))},Yt=t=>null;Yt.displayName="Cell";var kt={},zr;function gl(){return zr||(zr=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const l=r[Symbol.toStringTag];return l==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${l}]`}let a=r;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(r)===a}t.isPlainObject=e})(kt)),kt}var Tt,Fr;function bl(){return Fr||(Fr=1,Tt=gl().isPlainObject),Tt}var yl=bl();const jl=Nn(yl);var Wr,Vr,Ur,Hr,Gr;function qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function Zr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qr(Object(r),!0).forEach(function(a){Nl(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Nl(t,e,r){return(e=wl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wl(t){var e=Sl(t,"string");return typeof e=="symbol"?e:e+""}function Sl(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vt(){return vt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},vt.apply(null,arguments)}function Ve(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Qr=(t,e,r,a,l)=>{var s=r-a,i;return i=Y(Wr||(Wr=Ve(["M ",",",""])),t,e),i+=Y(Vr||(Vr=Ve(["L ",",",""])),t+r,e),i+=Y(Ur||(Ur=Ve(["L ",",",""])),t+r-s/2,e+l),i+=Y(Hr||(Hr=Ve(["L ",",",""])),t+r-s/2-a,e+l),i+=Y(Gr||(Gr=Ve(["L ",","," Z"])),t,e),i},Pl={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Il=t=>{var e=We(t,Pl),{x:r,y:a,upperWidth:l,lowerWidth:s,height:i,className:c}=e,{animationEasing:o,animationDuration:d,animationBegin:f,isUpdateAnimationActive:u}=e,m=p.useRef(null),[h,b]=p.useState(-1),y=p.useRef(l),j=p.useRef(s),v=p.useRef(i),x=p.useRef(r),g=p.useRef(a),N=gt(t,"trapezoid-");if(p.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var P=m.current.getTotalLength();P&&b(P)}catch{}},[]),r!==+r||a!==+a||l!==+l||s!==+s||i!==+i||l===0&&s===0||i===0)return null;var S=Fe("recharts-trapezoid",c);if(!u)return p.createElement("g",null,p.createElement("path",vt({},ke(e),{className:S,d:Qr(r,a,l,s,i)})));var w=y.current,O=j.current,C=v.current,I=x.current,k=g.current,E="0px ".concat(h===-1?1:h,"px"),M="".concat(h,"px ").concat(h,"px"),T=xa(["strokeDasharray"],d,o);return p.createElement(bt,{animationId:N,key:N,canBegin:h>0,duration:d,easing:o,isActive:u,begin:f},P=>{var D=J(w,l,P),L=J(O,s,P),$=J(C,i,P),z=J(I,r,P),K=J(k,a,P);m.current&&(y.current=D,j.current=L,v.current=$,x.current=z,g.current=K);var R=P>0?{transition:T,strokeDasharray:M}:{strokeDasharray:E};return p.createElement("path",vt({},ke(e),{className:S,d:Qr(z,K,D,L,$),ref:m,style:Zr(Zr({},R),e.style)}))})},Ol=["option","shapeType","activeClassName","inActiveClassName"];function Cl(t,e){if(t==null)return{};var r,a,l=kl(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function kl(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Xr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function ht(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xr(Object(r),!0).forEach(function(a){Tl(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Tl(t,e,r){return(e=Al(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Al(t){var e=Dl(t,"string");return typeof e=="symbol"?e:e+""}function Dl(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function El(t,e){return ht(ht({},e),t)}function Ml(t,e){return t==="symbols"}function Yr(t){var{shapeType:e,elementProps:r}=t;switch(e){case"rectangle":return p.createElement(fl,r);case"trapezoid":return p.createElement(Il,r);case"sector":return p.createElement(xl,r);case"symbols":if(Ml(e))return p.createElement(qa,r);break;case"curve":return p.createElement(Mn,r);default:return null}}function _l(t){return p.isValidElement(t)?t.props:t}function Qa(t){var{option:e,shapeType:r,activeClassName:a="recharts-active-shape",inActiveClassName:l="recharts-shape"}=t,s=Cl(t,Ol),i;if(p.isValidElement(e))i=p.cloneElement(e,ht(ht({},s),_l(e)));else if(typeof e=="function")i=e(s,s.index);else if(jl(e)&&typeof e!="boolean"){var c=El(e,s);i=p.createElement(Yr,{shapeType:r,elementProps:c})}else{var o=s;i=p.createElement(Yr,{shapeType:r,elementProps:o})}return s.isActive?p.createElement(Te,{className:a},i):p.createElement(Te,{className:l},i)}var Xa=(t,e,r)=>{var a=qt();return(l,s)=>i=>{t?.(l,s,i),a(_n({activeIndex:String(s),activeDataKey:e,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:r}))}},Ya=t=>{var e=qt();return(r,a)=>l=>{t?.(r,a,l),e(Ln())}},Ja=(t,e,r)=>{var a=qt();return(l,s)=>i=>{t?.(l,s,i),a($n({activeIndex:String(s),activeDataKey:e,activeCoordinate:l.tooltipPosition,activeGraphicalItemId:r}))}},Jr=(t,e,r)=>{var a=r??t;if(!ze(a))return ct(a,e,0)},Ll=(t,e,r)=>{var a={},l=t.filter(Bn),s=t.filter(d=>d.stackId==null),i=l.reduce((d,f)=>{var u=d[f.stackId];return u==null&&(u=[]),u.push(f),d[f.stackId]=u,d},a),c=Object.entries(i).map(d=>{var f,[u,m]=d,h=m.map(y=>y.dataKey),b=Jr(e,r,(f=m[0])===null||f===void 0?void 0:f.barSize);return{stackId:u,dataKeys:h,barSize:b}}),o=s.map(d=>{var f=[d.dataKey].filter(m=>m!=null),u=Jr(e,r,d.barSize);return{stackId:void 0,dataKeys:f,barSize:u}});return[...c,...o]};function ea(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function nt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(r),!0).forEach(function(a){$l(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ea(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function $l(t,e,r){return(e=Bl(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bl(t){var e=Rl(t,"string");return typeof e=="symbol"?e:e+""}function Rl(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Kl(t,e,r,a,l){var s,i=a.length;if(!(i<1)){var c=ct(t,r,0,!0),o,d=[];if(Dt((s=a[0])===null||s===void 0?void 0:s.barSize)){var f=!1,u=r/i,m=a.reduce((x,g)=>x+(g.barSize||0),0);m+=(i-1)*c,m>=r&&(m-=(i-1)*c,c=0),m>=r&&u>0&&(f=!0,u*=.9,m=i*u);var h=(r-m)/2>>0,b={offset:h-c,size:0};o=a.reduce((x,g)=>{var N,S={stackId:g.stackId,dataKeys:g.dataKeys,position:{offset:b.offset+b.size+c,size:f?u:(N=g.barSize)!==null&&N!==void 0?N:0}},w=[...x,S];return b=S.position,w},d)}else{var y=ct(e,r,0,!0);r-2*y-(i-1)*c<=0&&(c=0);var j=(r-2*y-(i-1)*c)/i;j>1&&(j>>=0);var v=Dt(l)?Math.min(j,l):j;o=a.reduce((x,g,N)=>[...x,{stackId:g.stackId,dataKeys:g.dataKeys,position:{offset:y+(j+c)*N+(j-v)/2,size:v}}],d)}return o}}var zl=(t,e,r,a,l,s,i)=>{var c=ze(i)?e:i,o=Kl(r,a,l!==s?l:s,t,c);return l!==s&&o!=null&&(o=o.map(d=>nt(nt({},d),{},{position:nt(nt({},d.position),{},{offset:d.position.offset-l/2})}))),o},Fl=(t,e)=>{var r=Rn(e);if(!(!t||r==null||e==null)){var{stackId:a}=e;if(a!=null){var l=t[a];if(l){var{stackedData:s}=l;if(s)return s.find(i=>i.key===r)}}}},Wl=(t,e)=>{if(!(t==null||e==null)){var r=t.find(a=>a.stackId===e.stackId&&e.dataKey!=null&&a.dataKeys.includes(e.dataKey));if(r!=null)return r.position}};function Vl(t,e){return t&&typeof t=="object"&&"zIndex"in t&&typeof t.zIndex=="number"&&Dt(t.zIndex)?t.zIndex:e}var Ul=["children"];function Hl(t,e){if(t==null)return{};var r,a,l=Gl(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Gl(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var ql={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Zl=p.createContext(ql);function en(t){var{children:e}=t,r=Hl(t,Ul);return p.createElement(Zl.Provider,{value:r},e)}var tn=(t,e,r,a)=>we(t,"xAxis",e,a),rn=(t,e,r,a)=>Se(t,"xAxis",e,a),an=(t,e,r,a)=>we(t,"yAxis",r,a),nn=(t,e,r,a)=>Se(t,"yAxis",r,a),Ql=pe([Ie,tn,an,rn,nn],(t,e,r,a,l)=>zn(t,"xAxis")?ut(e,a,!1):ut(r,l,!1)),Xl=(t,e,r,a,l)=>l;function Yl(t){return t.type==="line"}var Jl=pe([Zt,Xl],(t,e)=>t.filter(Yl).find(r=>r.id===e)),ei=pe([Ie,tn,an,rn,nn,Jl,Ql,Kn],(t,e,r,a,l,s,i,c)=>{var{chartData:o,dataStartIndex:d,dataEndIndex:f}=c;if(!(s==null||e==null||r==null||a==null||l==null||a.length===0||l.length===0||i==null||t!=="horizontal"&&t!=="vertical")){var{dataKey:u,data:m}=s,h;if(m!=null&&m.length>0?h=m:h=o?.slice(d,f+1),h!=null)return yi({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:l,dataKey:u,bandSize:i,displayedData:h})}}),ti=["id"],ri=["type","layout","connectNulls","needClip","shape"],ai=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function qe(){return qe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},qe.apply(null,arguments)}function ta(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function be(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ta(Object(r),!0).forEach(function(a){ni(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ta(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function ni(t,e,r){return(e=si(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function si(t){var e=li(t,"string");return typeof e=="symbol"?e:e+""}function li(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jt(t,e){if(t==null)return{};var r,a,l=ii(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function ii(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var oi=t=>{var{dataKey:e,name:r,stroke:a,legendType:l,hide:s}=t;return[{inactive:s,dataKey:e,type:l,color:a,value:Nt(r,e),payload:t}]},ci=p.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:l,fill:s,name:i,hide:c,unit:o,tooltipType:d,id:f}=t,u={dataDefinedOnItem:r,getPosition:wa,settings:{stroke:a,strokeWidth:l,fill:s,dataKey:e,nameKey:void 0,name:Nt(i,e),hide:c,type:d,color:a,unit:o,graphicalItemId:f}};return p.createElement(Na,{tooltipEntrySettings:u})}),sn=(t,e)=>"".concat(e,"px ").concat(t,"px");function di(t,e){for(var r=t.length%2!==0?[...t,0]:t,a=[],l=0;l<e;++l)a.push(...r);return a}var ui=(t,e,r)=>{var a=r.reduce((m,h)=>m+h,0);if(!a)return sn(e,t);for(var l=Math.floor(t/a),s=t%a,i=[],c=0,o=0;c<r.length;o+=(d=r[c])!==null&&d!==void 0?d:0,++c){var d,f=r[c];if(f!=null&&o+f>s){i=[...r.slice(0,c),s-o];break}}var u=i.length%2===0?[0,e]:[e];return[...di(r,l),...i,...u].map(m=>"".concat(m,"px")).join(", ")};function mi(t){var{clipPathId:e,points:r,props:a}=t,{dot:l,dataKey:s,needClip:i}=a,{id:c}=a,o=Jt(a,ti),d=ka(o);return p.createElement(Hn,{points:r,dot:l,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:s,baseProps:d,needClip:i,clipPathId:e})}function fi(t){var{showLabels:e,children:r,points:a}=t,l=p.useMemo(()=>a?.map(s=>{var i,c,o={x:(i=s.x)!==null&&i!==void 0?i:0,y:(c=s.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return be(be({},o),{},{value:s.value,payload:s.payload,viewBox:o,parentViewBox:void 0,fill:void 0})}),[a]);return p.createElement(Ca,{value:e?l:void 0},r)}function ra(t){var{clipPathId:e,pathRef:r,points:a,strokeDasharray:l,props:s}=t,{type:i,layout:c,connectNulls:o,needClip:d,shape:f}=s,u=Jt(s,ri),m=be(be({},ke(u)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(e,")"):void 0,points:a,type:i,layout:c,connectNulls:o,strokeDasharray:l??s.strokeDasharray});return p.createElement(p.Fragment,null,a?.length>1&&p.createElement(Qa,qe({shapeType:"curve",option:f},m,{pathRef:r})),p.createElement(mi,{points:a,clipPathId:e,props:s}))}function pi(t){try{return t&&t.getTotalLength&&t.getTotalLength()||0}catch{return 0}}function vi(t){var{clipPathId:e,props:r,pathRef:a,previousPointsRef:l,longestAnimatedLengthRef:s}=t,{points:i,strokeDasharray:c,isAnimationActive:o,animationBegin:d,animationDuration:f,animationEasing:u,animateNewValues:m,width:h,height:b,onAnimationEnd:y,onAnimationStart:j}=r,v=l.current,x=gt(i,"recharts-line-"),g=p.useRef(x),[N,S]=p.useState(!1),w=!N,O=p.useCallback(()=>{typeof y=="function"&&y(),S(!1)},[y]),C=p.useCallback(()=>{typeof j=="function"&&j(),S(!0)},[j]),I=pi(a.current),k=p.useRef(0);g.current!==x&&(k.current=s.current,g.current=x);var E=k.current;return p.createElement(fi,{points:i,showLabels:w},r.children,p.createElement(bt,{animationId:x,begin:d,duration:f,isActive:o,easing:u,onAnimationEnd:O,onAnimationStart:C,key:x},M=>{var T=J(E,I+E,M),P=Math.min(T,I),D;if(o)if(c){var L="".concat(c).split(/[,\s]+/gim).map(K=>parseFloat(K));D=ui(P,I,L)}else D=sn(I,P);else D=c==null?void 0:String(c);if(M>0&&I>0&&(l.current=i,s.current=Math.max(s.current,P)),v){var $=v.length/i.length,z=M===1?i:i.map((K,R)=>{var _=Math.floor(R*$);if(v[_]){var A=v[_];return be(be({},K),{},{x:J(A.x,K.x,M),y:J(A.y,K.y,M)})}return m?be(be({},K),{},{x:J(h*2,K.x,M),y:J(b/2,K.y,M)}):be(be({},K),{},{x:K.x,y:K.y})});return l.current=z,p.createElement(ra,{props:r,points:z,clipPathId:e,pathRef:a,strokeDasharray:D})}return p.createElement(ra,{props:r,points:i,clipPathId:e,pathRef:a,strokeDasharray:D})}),p.createElement(Oa,{label:r.label}))}function hi(t){var{clipPathId:e,props:r}=t,a=p.useRef(null),l=p.useRef(0),s=p.useRef(null);return p.createElement(vi,{props:r,clipPathId:e,previousPointsRef:a,longestAnimatedLengthRef:l,pathRef:s})}var xi=(t,e)=>{var r,a;return{x:(r=t.x)!==null&&r!==void 0?r:void 0,y:(a=t.y)!==null&&a!==void 0?a:void 0,value:t.value,errorVal:St(t.payload,e)}};class gi extends p.Component{render(){var{hide:e,dot:r,points:a,className:l,xAxisId:s,yAxisId:i,top:c,left:o,width:d,height:f,id:u,needClip:m,zIndex:h}=this.props;if(e)return null;var b=Fe("recharts-line",l),y=u,{r:j,strokeWidth:v}=Wn(r),x=Vn(r),g=j*2+v,N=m?"url(#clipPath-".concat(x?"":"dots-").concat(y,")"):void 0;return p.createElement(wt,{zIndex:h},p.createElement(Te,{className:b},m&&p.createElement("defs",null,p.createElement(Ia,{clipPathId:y,xAxisId:s,yAxisId:i}),!x&&p.createElement("clipPath",{id:"clipPath-dots-".concat(y)},p.createElement("rect",{x:o-g/2,y:c-g/2,width:d+g,height:f+g}))),p.createElement(en,{xAxisId:s,yAxisId:i,data:a,dataPointFormatter:xi,errorBarOffset:0},p.createElement(hi,{props:this.props,clipPathId:y}))),p.createElement(Un,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:N}))}}var ln={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:yt.line,type:"linear"};function bi(t){var e=We(t,ln),{activeDot:r,animateNewValues:a,animationBegin:l,animationDuration:s,animationEasing:i,connectNulls:c,dot:o,hide:d,isAnimationActive:f,label:u,legendType:m,xAxisId:h,yAxisId:b,id:y}=e,j=Jt(e,ai),{needClip:v}=Sa(h,b),x=Fn(),g=Pa(),N=jt(),S=Ge(k=>ei(k,h,b,N,y));if(g!=="horizontal"&&g!=="vertical"||S==null||x==null)return null;var{height:w,width:O,x:C,y:I}=x;return p.createElement(gi,qe({},j,{id:y,connectNulls:c,dot:o,activeDot:r,animateNewValues:a,animationBegin:l,animationDuration:s,animationEasing:i,isAnimationActive:f,hide:d,label:u,legendType:m,xAxisId:h,yAxisId:b,points:S,layout:g,height:w,width:O,left:C,top:I,needClip:v}))}function yi(t){var{layout:e,xAxis:r,yAxis:a,xAxisTicks:l,yAxisTicks:s,dataKey:i,bandSize:c,displayedData:o}=t;return o.map((d,f)=>{var u=St(d,i);if(e==="horizontal"){var m=sr({axis:r,ticks:l,bandSize:c,entry:d,index:f}),h=ze(u)?null:a.scale.map(u);return{x:m,y:h??null,value:u,payload:d}}var b=ze(u)?null:r.scale.map(u),y=sr({axis:a,ticks:s,bandSize:c,entry:d,index:f});return b==null||y==null?null:{x:b,y,value:u,payload:d}}).filter(Boolean)}function ji(t){var e=We(t,ln),r=jt();return p.createElement(ba,{id:e.id,type:"line"},a=>p.createElement(p.Fragment,null,p.createElement(ya,{legendPayload:oi(e)}),p.createElement(ci,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),p.createElement(ja,{type:"line",id:a,data:e.data,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,hide:e.hide,isPanorama:r}),p.createElement(bi,qe({},e,{id:a}))))}var Kt=p.memo(ji,ga);Kt.displayName="Line";function zt(){return zt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},zt.apply(null,arguments)}function er(t){return p.createElement(Qa,zt({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},t))}var Ni=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(a,l)=>{if(Ue(e))return e;var s=Ue(a)||ze(a);return s?e(a,l):(s||wn(!1),r)}},wi=(t,e,r)=>r,Si=(t,e)=>e,Ye=pe([Zt,Si],(t,e)=>t.filter(r=>r.type==="bar").find(r=>r.id===e)),Pi=pe([Ye],t=>t?.maxBarSize),Ii=(t,e,r,a)=>a,Oi=pe([Ie,Zt,Ee,Me,wi],(t,e,r,a,l)=>e.filter(s=>t==="horizontal"?s.xAxisId===r:s.yAxisId===a).filter(s=>s.isPanorama===l).filter(s=>s.hide===!1).filter(s=>s.type==="bar")),Ci=(t,e,r)=>{var a=Ie(t),l=Ee(t,e),s=Me(t,e);if(!(l==null||s==null))return a==="horizontal"?lr(t,"yAxis",s,r):lr(t,"xAxis",l,r)},ki=(t,e)=>{var r=Ie(t),a=Ee(t,e),l=Me(t,e);if(!(a==null||l==null))return r==="horizontal"?ir(t,"xAxis",a):ir(t,"yAxis",l)},Ti=pe([Oi,Yn,ki],Ll),Ai=(t,e,r)=>{var a,l,s=Ye(t,e);if(s==null)return 0;var i=Ee(t,e),c=Me(t,e);if(i==null||c==null)return 0;var o=Ie(t),d=Ta(t),{maxBarSize:f}=s,u=ze(f)?d:f,m,h;return o==="horizontal"?(m=we(t,"xAxis",i,r),h=Se(t,"xAxis",i,r)):(m=we(t,"yAxis",c,r),h=Se(t,"yAxis",c,r)),(a=(l=ut(m,h,!0))!==null&&l!==void 0?l:u)!==null&&a!==void 0?a:0},on=(t,e,r)=>{var a=Ie(t),l=Ee(t,e),s=Me(t,e);if(!(l==null||s==null)){var i,c;return a==="horizontal"?(i=we(t,"xAxis",l,r),c=Se(t,"xAxis",l,r)):(i=we(t,"yAxis",s,r),c=Se(t,"yAxis",s,r)),ut(i,c)}},Di=pe([Ti,Ta,Qn,Xn,Ai,on,Pi],zl),Ei=(t,e,r)=>{var a=Ee(t,e);if(a!=null)return we(t,"xAxis",a,r)},Mi=(t,e,r)=>{var a=Me(t,e);if(a!=null)return we(t,"yAxis",a,r)},_i=(t,e,r)=>{var a=Ee(t,e);if(a!=null)return Se(t,"xAxis",a,r)},Li=(t,e,r)=>{var a=Me(t,e);if(a!=null)return Se(t,"yAxis",a,r)},$i=pe([Di,Ye],Wl),Bi=pe([Ci,Ye],Fl),Ri=pe([Gn,qn,Ei,Mi,_i,Li,$i,Ie,Zn,on,Bi,Ye,Ii],(t,e,r,a,l,s,i,c,o,d,f,u,m)=>{var{chartData:h,dataStartIndex:b,dataEndIndex:y}=o;if(!(u==null||i==null||e==null||c!=="horizontal"&&c!=="vertical"||r==null||a==null||l==null||s==null||d==null)){var{data:j}=u,v;if(j!=null&&j.length>0?v=j:v=h?.slice(b,y+1),v!=null)return po({layout:c,barSettings:u,pos:i,parentViewBox:e,bandSize:d,xAxis:r,yAxis:a,xAxisTicks:l,yAxisTicks:s,stackedData:f,displayedData:v,offset:t,cells:m,dataStartIndex:b})}}),Ki=["index"];function Ft(){return Ft=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Ft.apply(null,arguments)}function zi(t,e){if(t==null)return{};var r,a,l=Fi(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Fi(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var cn=p.createContext(void 0),Wi=t=>{var e=p.useContext(cn);if(e!=null)return e.stackId;if(t!=null)return Jn(t)},Vi=(t,e)=>"recharts-bar-stack-clip-path-".concat(t,"-").concat(e),Ui=t=>{var e=p.useContext(cn);if(e!=null){var{stackId:r}=e;return"url(#".concat(Vi(r,t),")")}},dn=t=>{var{index:e}=t,r=zi(t,Ki),a=Ui(e);return p.createElement(Te,Ft({className:"recharts-bar-stack-layer",clipPath:a},r))},Hi=["onMouseEnter","onMouseLeave","onClick"],Gi=["value","background","tooltipPosition"],qi=["id"],Zi=["onMouseEnter","onClick","onMouseLeave"];function Pe(){return Pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Pe.apply(null,arguments)}function aa(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),r.push.apply(r,a)}return r}function ce(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?aa(Object(r),!0).forEach(function(a){Qi(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):aa(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Qi(t,e,r){return(e=Xi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xi(t){var e=Yi(t,"string");return typeof e=="symbol"?e:e+""}function Yi(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xt(t,e){if(t==null)return{};var r,a,l=Ji(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(l[r]=t[r])}return l}function Ji(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var eo=t=>{var{dataKey:e,name:r,fill:a,legendType:l,hide:s}=t;return[{inactive:s,dataKey:e,type:l,color:a,value:Nt(r,e),payload:t}]},to=p.memo(t=>{var{dataKey:e,stroke:r,strokeWidth:a,fill:l,name:s,hide:i,unit:c,tooltipType:o,id:d}=t,f={dataDefinedOnItem:void 0,getPosition:wa,settings:{stroke:r,strokeWidth:a,fill:l,dataKey:e,nameKey:void 0,name:Nt(s,e),hide:i,type:o,color:l,unit:c,graphicalItemId:d}};return p.createElement(Na,{tooltipEntrySettings:f})});function ro(t){var e=Ge(Aa),{data:r,dataKey:a,background:l,allOtherBarProps:s}=t,{onMouseEnter:i,onMouseLeave:c,onClick:o}=s,d=xt(s,Hi),f=Xa(i,a,s.id),u=Ya(c),m=Ja(o,a,s.id);if(!l||r==null)return null;var h=ts(l);return p.createElement(wt,{zIndex:Vl(l,yt.barBackground)},r.map((b,y)=>{var{value:j,background:v,tooltipPosition:x}=b,g=xt(b,Gi);if(!v)return null;var N=f(b,y),S=u(b,y),w=m(b,y),O=ce(ce(ce(ce(ce({option:l,isActive:String(y)===e},g),{},{fill:"#eee"},v),h),Da(d,b,y)),{},{onMouseEnter:N,onMouseLeave:S,onClick:w,dataKey:a,index:y,className:"recharts-bar-background-rectangle"});return p.createElement(er,Pe({key:"background-bar-".concat(y)},O))}))}function ao(t){var{showLabels:e,children:r,rects:a}=t,l=a?.map(s=>{var i={x:s.x,y:s.y,width:s.width,lowerWidth:s.width,upperWidth:s.width,height:s.height};return ce(ce({},i),{},{value:s.value,payload:s.payload,parentViewBox:s.parentViewBox,viewBox:i,fill:s.fill})});return p.createElement(Ca,{value:e?l:void 0},r)}function no(t){var{shape:e,activeBar:r,baseProps:a,entry:l,index:s,dataKey:i}=t,c=Ge(Aa),o=Ge(ns),d=r&&String(l.originalDataIndex)===c&&(o==null||i===o),[f,u]=p.useState(!1),[m,h]=p.useState(!1);p.useEffect(()=>{var g;return d?(u(!0),g=requestAnimationFrame(()=>{h(!0)})):h(!1),()=>{cancelAnimationFrame(g)}},[d]);var b=p.useCallback(()=>{d||u(!1)},[d]),y=d&&m,j=d||f,v;d?r===!0?v=e:v=r:v=e;var x=p.createElement(er,Pe({},a,{name:String(a.name)},l,{isActive:y,option:v,index:s,dataKey:i,onTransitionEnd:b}));return j?p.createElement(wt,{zIndex:yt.activeBar},p.createElement(dn,{index:l.originalDataIndex},x)):x}function so(t){var{shape:e,baseProps:r,entry:a,index:l,dataKey:s}=t;return p.createElement(er,Pe({},r,{name:String(r.name)},a,{isActive:!1,option:e,index:l,dataKey:s}))}function lo(t){var e,{data:r,props:a}=t,l=(e=ka(a))!==null&&e!==void 0?e:{},{id:s}=l,i=xt(l,qi),{shape:c,dataKey:o,activeBar:d}=a,{onMouseEnter:f,onClick:u,onMouseLeave:m}=a,h=xt(a,Zi),b=Xa(f,o,s),y=Ya(m),j=Ja(u,o,s);return r?p.createElement(p.Fragment,null,r.map((v,x)=>p.createElement(dn,Pe({index:v.originalDataIndex,key:"rectangle-".concat(v?.x,"-").concat(v?.y,"-").concat(v?.value,"-").concat(x),className:"recharts-bar-rectangle"},Da(h,v,x),{onMouseEnter:b(v,x),onMouseLeave:y(v,x),onClick:j(v,x)}),d?p.createElement(no,{shape:c,activeBar:d,baseProps:i,entry:v,index:x,dataKey:o}):p.createElement(so,{shape:c,baseProps:i,entry:v,index:x,dataKey:o})))):null}function io(t){var{props:e,previousRectanglesRef:r}=t,{data:a,layout:l,isAnimationActive:s,animationBegin:i,animationDuration:c,animationEasing:o,onAnimationEnd:d,onAnimationStart:f}=e,u=r.current,m=gt(e,"recharts-bar-"),[h,b]=p.useState(!1),y=!h,j=p.useCallback(()=>{typeof d=="function"&&d(),b(!1)},[d]),v=p.useCallback(()=>{typeof f=="function"&&f(),b(!0)},[f]);return p.createElement(ao,{showLabels:y,rects:a},p.createElement(bt,{animationId:m,begin:i,duration:c,isActive:s,easing:o,onAnimationEnd:j,onAnimationStart:v,key:m},x=>{var g=x===1?a:a?.map((N,S)=>{var w=u&&u[S];if(w)return ce(ce({},N),{},{x:J(w.x,N.x,x),y:J(w.y,N.y,x),width:J(w.width,N.width,x),height:J(w.height,N.height,x)});if(l==="horizontal"){var O=J(0,N.height,x),C=J(N.stackedBarStart,N.y,x);return ce(ce({},N),{},{y:C,height:O})}var I=J(0,N.width,x),k=J(N.stackedBarStart,N.x,x);return ce(ce({},N),{},{width:I,x:k})});return x>0&&(r.current=g??null),g==null?null:p.createElement(Te,null,p.createElement(lo,{props:e,data:g}))}),p.createElement(Oa,{label:e.label}),e.children)}function oo(t){var e=p.useRef(null);return p.createElement(io,{previousRectanglesRef:e,props:t})}var un=0,co=(t,e)=>{var r=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:r,errorVal:St(t,e)}};class uo extends p.PureComponent{render(){var{hide:e,data:r,dataKey:a,className:l,xAxisId:s,yAxisId:i,needClip:c,background:o,id:d}=this.props;if(e||r==null)return null;var f=Fe("recharts-bar",l),u=d;return p.createElement(Te,{className:f,id:d},c&&p.createElement("defs",null,p.createElement(Ia,{clipPathId:u,xAxisId:s,yAxisId:i})),p.createElement(Te,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(u,")"):void 0},p.createElement(ro,{data:r,dataKey:a,background:o,allOtherBarProps:this.props}),p.createElement(oo,this.props)))}}var mo={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:un,xAxisId:0,yAxisId:0,zIndex:yt.bar};function fo(t){var{xAxisId:e,yAxisId:r,hide:a,legendType:l,minPointSize:s,activeBar:i,animationBegin:c,animationDuration:o,animationEasing:d,isAnimationActive:f}=t,{needClip:u}=Sa(e,r),m=Pa(),h=jt(),b=es(t.children,Yt),y=Ge(x=>Ri(x,t.id,h,b));if(m!=="vertical"&&m!=="horizontal")return null;var j,v=y?.[0];return v==null||v.height==null||v.width==null?j=0:j=m==="vertical"?v.height/2:v.width/2,p.createElement(en,{xAxisId:e,yAxisId:r,data:y,dataPointFormatter:co,errorBarOffset:j},p.createElement(uo,Pe({},t,{layout:m,needClip:u,data:y,xAxisId:e,yAxisId:r,hide:a,legendType:l,minPointSize:s,activeBar:i,animationBegin:c,animationDuration:o,animationEasing:d,isAnimationActive:f})))}function po(t){var{layout:e,barSettings:{dataKey:r,minPointSize:a,hasCustomShape:l},pos:s,bandSize:i,xAxis:c,yAxis:o,xAxisTicks:d,yAxisTicks:f,stackedData:u,displayedData:m,offset:h,cells:b,parentViewBox:y,dataStartIndex:j}=t,v=e==="horizontal"?o:c,x=u?v.scale.domain():null,g=rs({numericAxis:v}),N=v.scale.map(g);return m.map((S,w)=>{var O,C,I,k,E,M;if(u){var T=u[w+j];if(T==null)return null;O=as(T,x)}else O=St(S,r),Array.isArray(O)||(O=[g,O]);var P=Ni(a,un)(O[1],w);if(e==="horizontal"){var D,L=o.scale.map(O[0]),$=o.scale.map(O[1]);if(L==null||$==null)return null;C=or({axis:c,ticks:d,bandSize:i,offset:s.offset,entry:S,index:w}),I=(D=$??L)!==null&&D!==void 0?D:void 0,k=s.size;var z=L-$;if(E=ss(z)?0:z,M={x:C,y:h.top,width:k,height:h.height},Math.abs(P)>0&&Math.abs(E)<Math.abs(P)){var K=dt(E||P)*(Math.abs(P)-Math.abs(E));I-=K,E+=K}}else{var R=c.scale.map(O[0]),_=c.scale.map(O[1]);if(R==null||_==null)return null;if(C=R,I=or({axis:o,ticks:f,bandSize:i,offset:s.offset,entry:S,index:w}),k=_-R,E=s.size,M={x:h.left,y:I,width:h.width,height:E},Math.abs(P)>0&&Math.abs(k)<Math.abs(P)){var A=dt(k||P)*(Math.abs(P)-Math.abs(k));k+=A}}if(C==null||I==null||k==null||E==null||!l&&(k===0||E===0))return null;var B=ce(ce({},S),{},{stackedBarStart:N,x:C,y:I,width:k,height:E,value:u?O:O[1],payload:S,background:M,tooltipPosition:{x:C+k/2,y:I+E/2},parentViewBox:y,originalDataIndex:w},b&&b[w]&&b[w].props);return B}).filter(Boolean)}function vo(t){var e=We(t,mo),r=Wi(e.stackId),a=jt();return p.createElement(ba,{id:e.id,type:"bar"},l=>p.createElement(p.Fragment,null,p.createElement(ya,{legendPayload:eo(e)}),p.createElement(to,{dataKey:e.dataKey,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:l}),p.createElement(ja,{type:"bar",id:l,data:void 0,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,stackId:r,hide:e.hide,barSize:e.barSize,minPointSize:e.minPointSize,maxBarSize:e.maxBarSize,isPanorama:a,hasCustomShape:e.shape!=null}),p.createElement(wt,{zIndex:e.zIndex},p.createElement(fo,Pe({},e,{id:l})))))}var mn=p.memo(vo,ga);mn.displayName="Bar";var ho=["axis"],na=p.forwardRef((t,e)=>p.createElement(Ea,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ho,tooltipPayloadSearcher:Ma,categoricalChartProps:t,ref:e})),xo=["axis","item"],go=p.forwardRef((t,e)=>p.createElement(Ea,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:xo,tooltipPayloadSearcher:Ma,categoricalChartProps:t,ref:e}));function bo(t){const e=ee.c(49),{log:r,isExpanded:a,connection:l,virtualMcpName:s,onToggle:i,lastLogRef:c}=t;let o,d;if(e[0]!==r.timestamp){const P=new Date(r.timestamp);o=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=o,e[2]=d}else o=e[1],d=e[2];const f=d,u=a?"bg-muted/30 hover:bg-accent/80":"hover:bg-muted/40";let m;e[3]!==u?(m=Ne("h-14 md:h-16 transition-colors cursor-pointer",u),e[3]=u,e[4]=m):m=e[4];let h;e[5]!==a?(h=n.jsx(xe,{className:"w-10 md:w-12 px-2 md:px-4",children:n.jsx("div",{className:"flex items-center justify-center",children:a?n.jsx(At,{size:16,className:"text-muted-foreground"}):n.jsx(Dn,{size:16,className:"text-muted-foreground"})})}),e[5]=a,e[6]=h):h=e[6];const b=l?.icon||null;let y;e[7]!==r.connectionTitle||e[8]!==b?(y=n.jsx(xe,{className:"w-12 md:w-16 px-2 md:px-4",children:n.jsx("div",{className:"flex items-center justify-center",children:n.jsx(it,{icon:b,name:r.connectionTitle,size:"xs",className:"shadow-sm"})})}),e[7]=r.connectionTitle,e[8]=b,e[9]=y):y=e[9];let j;e[10]!==r.toolName?(j=n.jsx("div",{className:"text-xs font-medium text-foreground truncate block",children:r.toolName}),e[10]=r.toolName,e[11]=j):j=e[11];let v;e[12]!==r.connectionTitle?(v=n.jsx("div",{className:"text-xs text-muted-foreground truncate block",children:r.connectionTitle}),e[12]=r.connectionTitle,e[13]=v):v=e[13];let x;e[14]!==j||e[15]!==v?(x=n.jsxs(xe,{className:"min-w-0 pr-2 md:pr-4",children:[j,v]}),e[14]=j,e[15]=v,e[16]=x):x=e[16];let g;e[17]!==s?(g=n.jsx(xe,{className:"w-24 md:w-32 px-2 md:px-3 text-xs text-muted-foreground",children:n.jsx("div",{className:"truncate",children:s})}),e[17]=s,e[18]=g):g=e[18];let N;e[19]!==r.userName?(N=n.jsx(xe,{className:"w-20 md:w-24 px-2 md:px-3 text-xs text-muted-foreground",children:r.userName}),e[19]=r.userName,e[20]=N):N=e[20];let S;e[21]!==o?(S=n.jsx(xe,{className:"w-20 md:w-24 px-2 md:px-3 text-xs text-muted-foreground",children:o}),e[21]=o,e[22]=S):S=e[22];let w;e[23]!==f?(w=n.jsx(xe,{className:"w-20 md:w-28 px-2 md:px-3 text-xs text-muted-foreground",children:f}),e[23]=f,e[24]=w):w=e[24];let O;e[25]!==r.durationMs?(O=n.jsxs(xe,{className:"w-16 md:w-20 px-2 md:px-3 text-xs text-muted-foreground font-mono text-right",children:[r.durationMs,"ms"]}),e[25]=r.durationMs,e[26]=O):O=e[26];const C=r.isError?"destructive":"success",I=r.isError?"Error":"OK";let k;e[27]!==C||e[28]!==I?(k=n.jsx(xe,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:n.jsx("div",{className:"flex items-center justify-end",children:n.jsx(ot,{variant:C,className:"text-xs px-1.5 md:px-2 py-0.5 md:py-1",children:I})})}),e[27]=C,e[28]=I,e[29]=k):k=e[29];let E;e[30]!==c||e[31]!==i||e[32]!==g||e[33]!==N||e[34]!==S||e[35]!==w||e[36]!==O||e[37]!==k||e[38]!==m||e[39]!==h||e[40]!==y||e[41]!==x?(E=n.jsxs(He,{ref:c,className:m,onClick:i,children:[h,y,x,g,N,S,w,O,k]}),e[30]=c,e[31]=i,e[32]=g,e[33]=N,e[34]=S,e[35]=w,e[36]=O,e[37]=k,e[38]=m,e[39]=h,e[40]=y,e[41]=x,e[42]=E):E=e[42];let M;e[43]!==a||e[44]!==r?(M=a&&n.jsx(He,{children:n.jsx(xe,{colSpan:9,className:"p-0",children:n.jsx(Cn,{log:r})})}),e[43]=a,e[44]=r,e[45]=M):M=e[45];let T;return e[46]!==E||e[47]!==M?(T=n.jsxs(p.Fragment,{children:[E,M]}),e[46]=E,e[47]=M,e[48]=T):T=e[48],T}function Ae(t){const e=ee.c(24),{title:r,description:a,action:l,children:s,className:i,noPadding:c,onTitleClick:o}=t,d=c===void 0?!1:c;let f;e[0]!==r?(f=typeof r=="string"?n.jsx("div",{className:"text-sm font-medium text-foreground",children:r}):r,e[0]=r,e[1]=f):f=e[1];const u=f;let m;e[2]!==i?(m=Ne("bg-background flex flex-col",i),e[2]=i,e[3]=m):m=e[3];let h;e[4]!==o||e[5]!==u?(h=o?n.jsx("button",{onClick:o,className:"text-left hover:text-foreground transition-colors cursor-pointer",children:u}):u,e[4]=o,e[5]=u,e[6]=h):h=e[6];let b;e[7]!==a?(b=a?n.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:a}):null,e[7]=a,e[8]=b):b=e[8];let y;e[9]!==h||e[10]!==b?(y=n.jsxs("div",{className:"min-w-0",children:[h,b]}),e[9]=h,e[10]=b,e[11]=y):y=e[11];let j;e[12]!==l?(j=l?n.jsx("div",{className:"shrink-0",children:l}):null,e[12]=l,e[13]=j):j=e[13];let v;e[14]!==y||e[15]!==j?(v=n.jsxs("header",{className:"flex items-center justify-between gap-4 p-5",children:[y,j]}),e[14]=y,e[15]=j,e[16]=v):v=e[16];let x;e[17]!==s||e[18]!==d?(x=d?n.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-h-0",children:s}):n.jsx("div",{className:"px-5 pb-5 pt-2",children:s}),e[17]=s,e[18]=d,e[19]=x):x=e[19];let g;return e[20]!==m||e[21]!==v||e[22]!==x?(g=n.jsxs("div",{className:m,children:[v,x]}),e[20]=m,e[21]=v,e[22]=x,e[23]=g):g=e[23],g}function fn(t){const e=ee.c(29),{data:r,dataKey:a,colorNum:l,chartHeight:s}=t,i=`var(--chart-${l})`;let c;e[0]!==s?(c=Ne(s,"w-full"),e[0]=s,e[1]=c):c=e[1];let o;e[2]!==i||e[3]!==a?(o={label:a,color:i},e[2]=i,e[3]=a,e[4]=o):o=e[4];let d;e[5]!==a||e[6]!==o?(d={[a]:o},e[5]=a,e[6]=o,e[7]=d):d=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={left:0,right:0,top:0,bottom:0},e[8]=f):f=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Et,{content:n.jsx(ls,{indicator:"line",labelFormatter:yo})}),e[9]=u):u=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=[0,0,0,0],e[10]=m):m=e[10];let h;if(e[11]!==i||e[12]!==r||e[13]!==a){let v;e[15]!==i||e[16]!==a?(v=(x,g)=>n.jsx(Yt,{fill:x[a]===0?"var(--muted-foreground)":i,fillOpacity:x[a]===0?.25:1},`cell-${g}`),e[15]=i,e[16]=a,e[17]=v):v=e[17],h=r.map(v),e[11]=i,e[12]=r,e[13]=a,e[14]=h}else h=e[14];let b;e[18]!==i||e[19]!==a||e[20]!==h?(b=n.jsx(mn,{dataKey:a,fill:i,radius:m,minPointSize:1,children:h}),e[18]=i,e[19]=a,e[20]=h,e[21]=b):b=e[21];let y;e[22]!==r||e[23]!==b?(y=n.jsxs(go,{data:r,margin:f,children:[u,b]}),e[22]=r,e[23]=b,e[24]=y):y=e[24];let j;return e[25]!==c||e[26]!==d||e[27]!==y?(j=n.jsx(Mt,{className:c,config:d,children:y}),e[25]=c,e[26]=d,e[27]=y,e[28]=j):j=e[28],j}function yo(t,e){const r=Array.isArray(e)?e[0]:void 0;return r&&typeof r=="object"&&"payload"in r?r.payload?.label??"":""}function jo(){const t=ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",children:[...Array(3)].map(No)}),t[0]=e):e=t[0],e}function No(t,e){return n.jsx(Ae,{title:n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("div",{className:"h-4 w-16 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-5 md:h-6 w-12 rounded bg-muted animate-pulse"})]}),children:n.jsxs("div",{className:"flex flex-col w-full",children:[n.jsx("div",{className:"h-[30px] md:h-[40px] w-full rounded bg-muted animate-pulse"}),n.jsx("div",{className:"space-y-1.5 mt-2",children:Array.from({length:3}).map(wo)})]})},e)}function wo(t,e){return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"size-4 rounded-sm bg-muted animate-pulse shrink-0"}),n.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-1.5 flex-1 bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-8 rounded bg-muted animate-pulse shrink-0"})]},e)}const tr="decopilot";function So(t,e){const r=ee.c(13),{org:a}=De();let l;r[0]!==a.id?(l={connectionId:Qe,orgId:a.id},r[0]=a.id,r[1]=l):l=r[1];const s=Xe(l);let i;r[2]!==t.excludeConnectionIds?(i=t.excludeConnectionIds??[],r[2]=t.excludeConnectionIds,r[3]=i):i=r[3];let c;r[4]!==i?(c=[tr,...i],r[4]=i,r[5]=c):c=r[5];let o;r[6]!==t||r[7]!==c?(o={...t,excludeConnectionIds:c},r[6]=t,r[7]=c,r[8]=o):o=r[8];let d;return r[9]!==s||r[10]!==e||r[11]!==o?(d={client:s,toolName:"MONITORING_STATS",toolArguments:o,staleTime:3e4,...e,select:Po},r[9]=s,r[10]=e,r[11]=o,r[12]=d):d=r[12],Qt(d)}function Po(t){return t.structuredContent??t}function Io(t,e){const r=ee.c(13),{org:a}=De();let l;r[0]!==a.id?(l={connectionId:Qe,orgId:a.id},r[0]=a.id,r[1]=l):l=r[1];const s=Xe(l);let i;r[2]!==t.excludeConnectionIds?(i=t.excludeConnectionIds??[],r[2]=t.excludeConnectionIds,r[3]=i):i=r[3];let c;r[4]!==i?(c=[tr,...i],r[4]=i,r[5]=c):c=r[5];let o;r[6]!==t||r[7]!==c?(o={...t,excludeConnectionIds:c},r[6]=t,r[7]=c,r[8]=o):o=r[8];let d;return r[9]!==s||r[10]!==e||r[11]!==o?(d={client:s,toolName:"MONITORING_STATS",toolArguments:o,staleTime:3e4,...e,select:Oo},r[9]=s,r[10]=e,r[11]=o,r[12]=d):d=r[12],Qt(d)}function Oo(t){return t.structuredContent??t}function pn(t,e){const r=ee.c(9),{org:a}=De();let l;r[0]!==a.id?(l={connectionId:Qe,orgId:a.id},r[0]=a.id,r[1]=l):l=r[1];const s=Xe(l);let i;r[2]===Symbol.for("react.memo_cache_sentinel")?(i=[tr],r[2]=i):i=r[2];let c;r[3]!==t?(c={...t,connectionIds:i,topN:5},r[3]=t,r[4]=c):c=r[4];let o;return r[5]!==s||r[6]!==e||r[7]!==c?(o={client:s,toolName:"MONITORING_STATS",toolArguments:c,staleTime:3e4,...e,select:Co},r[5]=s,r[6]=e,r[7]=c,r[8]=o):o=r[8],Qt(o)}function Co(t){return t.structuredContent??t}function ko(){const{org:t,project:e,locator:r}=De(),a=Sn(),l=Ut(),s=Xe({connectionId:Qe,orgId:t.id}),[i,c]=p.useState(null),[o,d]=p.useState(!1),[f,u]=p.useState(!1),{data:m}=Pn({queryKey:lt.monitoringDashboards(r),queryFn:async()=>{if(!s)throw new Error("MCP client is not available");const x=await s.callTool({name:"MONITORING_DASHBOARD_LIST",arguments:{}});return x.structuredContent??x}}),h=m?.dashboards??[],b=async()=>{if(s){u(!0);try{const x=await s.callTool({name:"MONITORING_DASHBOARD_CREATE",arguments:{name:"Untitled Dashboard",widgets:[{id:crypto.randomUUID(),name:"New Widget",type:"metric",source:{path:"$.usage.total_tokens",from:"output"},aggregation:{fn:"sum"}}]}}),g=(x.structuredContent??x).id;a.invalidateQueries({queryKey:lt.monitoringDashboards(r)}),l({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:g}})}catch(x){It.error("Failed to create dashboard"),console.error(x)}finally{u(!1)}}},y=x=>{l({to:"/$org/$project/monitoring/dashboards/$dashboardId",params:{org:t.slug,project:e.slug,dashboardId:x}})},j=x=>{l({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:x}})},v=async x=>{if(s){d(!0);try{await s.callTool({name:"MONITORING_DASHBOARD_DELETE",arguments:{id:x}}),It.success("Dashboard deleted"),a.invalidateQueries({queryKey:lt.monitoringDashboards(r)})}catch(g){It.error("Failed to delete dashboard"),console.error(g)}finally{d(!1),c(null)}}};return n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[h.length===0?n.jsx(Ht,{title:"No dashboards yet",description:"Create a dashboard to aggregate and visualize your monitoring data",image:n.jsx(Lt,{size:48,className:"text-muted-foreground/50"}),actions:n.jsxs(ye,{onClick:b,size:"sm",disabled:f,children:[n.jsx(_a,{size:16,className:"mr-1.5"}),"Create Dashboard"]})}):n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:h.map(x=>n.jsx(ds,{connection:{id:x.id,title:x.name,description:x.description},fallbackIcon:n.jsx(Lt,{}),onClick:()=>y(x.id),headerActions:n.jsxs(us,{children:[n.jsx(ms,{asChild:!0,children:n.jsx(ye,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:g=>g.stopPropagation(),children:n.jsx(os,{size:20})})}),n.jsxs(fs,{align:"end",onClick:g=>g.stopPropagation(),children:[n.jsxs(dr,{onClick:()=>j(x.id),children:[n.jsx(cs,{size:16}),"Edit"]}),n.jsxs(dr,{onClick:()=>c(x.id),className:"text-destructive",children:[n.jsx(La,{size:16}),"Delete"]})]})]}),footer:n.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[n.jsxs("span",{children:[x.widgets.length," widget",x.widgets.length!==1?"s":""]}),n.jsx("span",{children:"·"}),n.jsx("span",{children:new Date(x.createdAt).toLocaleDateString()})]})},x.id))}),n.jsx(ps,{open:!!i,onOpenChange:()=>c(null),children:n.jsxs(vs,{children:[n.jsxs(hs,{children:[n.jsx(xs,{children:"Delete Dashboard"}),n.jsx(gs,{children:"Are you sure you want to delete this dashboard? This action cannot be undone."})]}),n.jsxs(bs,{children:[n.jsx(ys,{disabled:o,children:"Cancel"}),n.jsx(js,{disabled:o,onClick:()=>i&&v(i),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:o?"Deleting...":"Delete"})]})]})})]})}function To(){const t=ee.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{children:[n.jsx("div",{className:"h-6 w-40 bg-muted rounded animate-pulse"}),n.jsx("div",{className:"h-4 w-64 bg-muted rounded animate-pulse mt-2"})]}),n.jsx("div",{className:"h-8 w-32 bg-muted rounded animate-pulse"})]}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[e,n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(Ao)})]}),t[1]=r):r=t[1],r}function Ao(t){return n.jsxs("div",{className:"border rounded-lg p-4",children:[n.jsx("div",{className:"h-5 w-32 bg-muted rounded animate-pulse mb-2"}),n.jsx("div",{className:"h-4 w-full bg-muted rounded animate-pulse mb-3"}),n.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]},t)}function Do(){const t=ee.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboards"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(Vt,{fallback:e,children:n.jsx(p.Suspense,{fallback:n.jsx(To,{}),children:n.jsx(ko,{})})}),t[1]=r):r=t[1],r}function Eo(t,e,r=!1){const a=p.useRef(null),l=p.useRef(t),s=p.useRef(e),i=p.useRef(r);return l.current=t,s.current=e,i.current=r,o=>{a.current&&a.current.disconnect(),a.current=new IntersectionObserver(d=>{d[0]?.isIntersecting&&s.current&&!i.current&&l.current()}),o&&a.current.observe(o)}}function sa(t){const e=ee.c(72),{options:r,onValueChange:a,defaultValue:l,placeholder:s,variant:i,animation:c,maxCount:o,modalPopover:d,asChild:f,className:u,disabled:m}=t;let h;e[0]!==l?(h=l===void 0?[]:l,e[0]=l,e[1]=h):h=e[1];const b=h,y=s===void 0?"Select items":s,j=i===void 0?"default":i,v=c===void 0?0:c,x=o===void 0?3:o,g=d===void 0?!1:d,N=f===void 0?!1:f,S=m===void 0?!1:m,[w,O]=p.useState(b),[C,I]=p.useState(!1);let k,E;e[2]!==b||e[3]!==w?(k=()=>{JSON.stringify(w)!==JSON.stringify(b)&&O(b)},E=[b,w],e[2]=b,e[3]=w,e[4]=k,e[5]=E):(k=e[4],E=e[5]),p.useEffect(k,E);let M;e[6]!==a||e[7]!==w?(M=Z=>{if(Z.key==="Enter")I(!0);else if(Z.key==="Backspace"&&!Z.currentTarget.value){const ae=[...w];ae.pop(),O(ae),a(ae)}},e[6]=a,e[7]=w,e[8]=M):M=e[8];const T=M;let P;e[9]!==a||e[10]!==w?(P=Z=>{const ae=w.includes(Z.value)?w.filter(fe=>fe!==Z.value):[...w,Z.value];O(ae),a(ae)},e[9]=a,e[10]=w,e[11]=P):P=e[11];const D=P;let L;e[12]!==a?(L=()=>{O([]),a([])},e[12]=a,e[13]=L):L=e[13];const $=L;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{I($o)},e[14]=z):z=e[14];const K=z;let R;e[15]!==$||e[16]!==a||e[17]!==r||e[18]!==w.length?(R=()=>{if(w.length===r.length)$();else{const Z=r.map(Lo);O(Z),a(Z)}},e[15]=$,e[16]=a,e[17]=r,e[18]=w.length,e[19]=R):R=e[19];const _=R;let A;e[20]!==N?(A=N?{}:{variant:"outline"},e[20]=N,e[21]=A):A=e[21];let B;e[22]!==u?(B=Ne("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",u),e[22]=u,e[23]=B):B=e[23];let F;e[24]!==v||e[25]!==x||e[26]!==r||e[27]!==y||e[28]!==w||e[29]!==j?(F=w.length>0?n.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[w.slice(0,x).map(Z=>{const ae=r.find(he=>he.value===Z),fe=ae?.icon;return n.jsxs(ot,{variant:j==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${v}s`},children:[fe&&n.jsx(fe,{className:"h-3 w-3 shrink-0"}),n.jsx("span",{className:"truncate",children:ae?.label})]},Z)}),w.length>x&&n.jsxs(ot,{variant:j==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${v}s`},children:["+",w.length-x]})]}),n.jsx("div",{className:"flex items-center shrink-0 ml-2",children:n.jsx(At,{size:20,className:"shrink-0 opacity-50"})})]}):n.jsxs("div",{className:"flex items-center justify-between w-full",children:[n.jsx("span",{className:"text-sm text-muted-foreground",children:y}),n.jsx(At,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=v,e[25]=x,e[26]=r,e[27]=y,e[28]=w,e[29]=j,e[30]=F):F=e[30];let G;e[31]!==S||e[32]!==A||e[33]!==B||e[34]!==F?(G=n.jsx(Ba,{asChild:!0,children:n.jsx(ye,{ref:null,...A,onClick:K,className:B,disabled:S,children:F})}),e[31]=S,e[32]=A,e[33]=B,e[34]=F,e[35]=G):G=e[35];let ne;e[36]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>I(!1),e[36]=ne):ne=e[36];let X;e[37]!==T?(X=n.jsx(Cs,{placeholder:"Search...",onKeyDown:T,className:"rounded-t-xl"}),e[37]=T,e[38]=X):X=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(ks,{children:"No results found."}),e[39]=V):V=e[39];let H;e[40]!==_?(H=()=>{_()},e[40]=_,e[41]=H):H=e[41];let q;e[42]!==_?(q=Z=>{Z.stopPropagation(),_()},e[42]=_,e[43]=q):q=e[43];const Q=w.length===r.length&&r.length>0;let W;e[44]!==Q||e[45]!==_?(W=n.jsx(ur,{checked:Q,onCheckedChange:_,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:_o}),e[44]=Q,e[45]=_,e[46]=W):W=e[46];let te;e[47]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx("span",{children:"(Select All)"}),e[47]=te):te=e[47];let U;e[48]!==q||e[49]!==W?(U=n.jsxs("div",{className:"flex items-center w-full",onClick:q,children:[W,te]}),e[48]=q,e[49]=W,e[50]=U):U=e[50];let se;e[51]!==H||e[52]!==U?(se=n.jsx(mr,{onSelect:H,className:"cursor-pointer",children:U},"all"),e[51]=H,e[52]=U,e[53]=se):se=e[53];let le;if(e[54]!==r||e[55]!==w||e[56]!==D){let Z;e[58]!==w||e[59]!==D?(Z=ae=>{const fe=w.includes(ae.value);return n.jsx(mr,{onSelect:()=>{D(ae)},className:"cursor-pointer",children:n.jsxs("div",{className:"flex items-center w-full",onClick:he=>{he.stopPropagation(),D(ae)},children:[n.jsx(ur,{checked:fe,onCheckedChange:()=>{D(ae)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Mo}),ae.icon&&n.jsx(ae.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),n.jsx("span",{children:ae.label})]})},ae.value)},e[58]=w,e[59]=D,e[60]=Z):Z=e[60],le=r.map(Z),e[54]=r,e[55]=w,e[56]=D,e[57]=le}else le=e[57];let re;e[61]!==se||e[62]!==le?(re=n.jsxs(Ts,{className:"rounded-b-xl",children:[V,n.jsxs(As,{children:[se,le]})]}),e[61]=se,e[62]=le,e[63]=re):re=e[63];let oe;e[64]!==X||e[65]!==re?(oe=n.jsx(Ra,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:ne,children:n.jsxs(Ds,{className:"rounded-xl",children:[X,re]})}),e[64]=X,e[65]=re,e[66]=oe):oe=e[66];let me;return e[67]!==C||e[68]!==g||e[69]!==G||e[70]!==oe?(me=n.jsxs(Ka,{open:C,onOpenChange:I,modal:g,children:[G,oe]}),e[67]=C,e[68]=g,e[69]=G,e[70]=oe,e[71]=me):me=e[71],me}function Mo(t){return t.stopPropagation()}function _o(t){return t.stopPropagation()}function Lo(t){return t.value}function $o(t){return!t}function vn(t,e){return e==="1d"?t.toLocaleDateString([],{month:"short",day:"numeric"}):t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Bo(t,e,r,a,l){const s=t.map(g=>g.toolName),i=new Map,c=20,o=r.getTime(),f=(a.getTime()-o)/(c-1);for(let g=0;g<c;g++){const N=Math.round(o+g*f),S=new Date(N);i.set(String(N),{t:S.toISOString(),ts:N,label:vn(S,l),tools:new Map})}const u=[...i.keys()].map(Number).sort((g,N)=>g-N);for(const g of e){const N=g.timestamp.includes("T")?g.timestamp:g.timestamp.replace(" ","T"),S=new Date(N).getTime();let w=u[0],O=Math.abs(S-w);for(const k of u){const E=Math.abs(S-k);E<O&&(O=E,w=k)}const C=i.get(String(w)),I=C.tools.get(g.toolName);I?C.tools.set(g.toolName,{calls:I.calls+g.calls,errors:I.errors+g.errors,avg:(I.avg*I.calls+g.avg*g.calls)/(I.calls+g.calls),p95:Math.max(I.p95,g.p95)}):C.tools.set(g.toolName,{calls:g.calls,errors:g.errors,avg:g.avg,p95:g.p95})}const m=[...i.values()].sort((g,N)=>g.ts-N.ts),h=[],b=[],y=[],j=[];for(const g of m){const N={t:g.t,ts:g.ts,label:g.label},S={...N},w={...N},O={...N},C={...N};for(const I of s){const k=g.tools.get(I)??{calls:0,errors:0,avg:0,p95:0};S[I]=k.calls,C[I]=k.errors,w[I]=Math.round(k.avg),O[I]=Math.round(k.p95)}h.push(S),b.push(w),y.push(O),j.push(C)}const v={},x=new Map;return t.forEach((g,N)=>{const w=`var(--chart-${N%5+1})`;x.set(g.toolName,w),v[g.toolName]={label:g.toolName,color:w}}),{callsBuckets:h,latencyAvgBuckets:b,latencyP95Buckets:y,errorsBuckets:j,chartConfig:v,toolColors:x}}function Ro(t,e){let r=0,a=Math.abs(t-e[0]);for(let l=1;l<e.length;l++){const s=Math.abs(t-e[l]);s<a&&(a=s,r=l)}return r}function Ko(t,e,r,a){const s=e.getTime(),c=(r.getTime()-s)/19,o=[],d=[];for(let u=0;u<20;u++){const m=Math.round(s+u*c);d.push(m),o.push({t:new Date(m).toISOString(),ts:m,label:vn(new Date(m),a),calls:0,errors:0,avg:0,p95:0})}const f=new Array(20).fill(0);for(const u of t){const m=new Date(u.timestamp).getTime(),h=Ro(m,d),b=o[h];b.calls+=u.calls,b.errors+=u.errors,b.avg+=u.avg,b.p95=Math.max(b.p95,u.p95),f[h]++}for(let u=0;u<20;u++)f[u]>0&&(o[u].avg=o[u].avg/f[u]);return o}const la={calls:"Top Tools — Calls","latency-avg":"Top Tools — Average Latency","latency-p95":"Top Tools — P95 Latency",errors:"Top Tools — Errors","llm-calls":"AI Usage","llm-latency-avg":"AI Latency","llm-latency-p95":"AI P95 Latency","llm-errors":"AI Errors"};function zo(t){return t.startsWith("llm-")}function ia(t,e){return e==="latency-avg"||e==="latency-p95"||e==="llm-latency-avg"||e==="llm-latency-p95"?t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`:String(t)}function Fo(t){const e=ee.c(34),{metricsMode:r,dateRange:a,connectionIds:l,excludeConnectionIds:s,toolName:i,status:c,isStreaming:o,streamingRefetchInterval:d}=t,{org:f}=De(),u=Ut(),m=$a()??[],h=a;if(!h)throw new Error("TopTools requires an explicit date range");const b=new Date(h.startDate),y=new Date(h.endDate),j=y.getTime()-b.getTime(),v=j<=36e5?"1m":j<=9e7?"1h":"1d",x=zo(r),g=l?.length?l:void 0;let N;e[0]!==i?(N=i?[i]:void 0,e[0]=i,e[1]=N):N=e[1];let S;e[2]!==h.endDate||e[3]!==h.startDate||e[4]!==s||e[5]!==v||e[6]!==c||e[7]!==g||e[8]!==N?(S={interval:v,startDate:h.startDate,endDate:h.endDate,topN:10,connectionIds:g,excludeConnectionIds:s,toolNames:N,status:c},e[2]=h.endDate,e[3]=h.startDate,e[4]=s,e[5]=v,e[6]=c,e[7]=g,e[8]=N,e[9]=S):S=e[9];const w=o?d:!1;let O;e[10]!==w?(O={refetchInterval:w},e[10]=w,e[11]=O):O=e[11];const{data:C}=Io(S,O);let I;e[12]!==h.endDate||e[13]!==h.startDate||e[14]!==v?(I={interval:v,startDate:h.startDate,endDate:h.endDate},e[12]=h.endDate,e[13]=h.startDate,e[14]=v,e[15]=I):I=e[15];const k=o?d:!1;let E;e[16]!==k?(E={refetchInterval:k},e[16]=k,e[17]=E):E=e[17];const{data:M}=pn(I,E),T=C?.topTools??[],{callsBuckets:P,latencyAvgBuckets:D,latencyP95Buckets:L,errorsBuckets:$,chartConfig:z,toolColors:K}=Bo(T,C?.topToolsTimeseries??[],b,y,v),R=Ko(M?.timeseries??[],b,y,v),_=r==="llm-latency-avg"?"avg":r==="llm-latency-p95"?"p95":r==="llm-errors"?"errors":"calls",A=r==="latency-avg"?D:r==="latency-p95"?L:r==="errors"?$:P,B=new Map(m.map(Vo));let F;e[18]!==u||e[19]!==f.slug?(F=()=>{u({to:"/$org/$project/monitoring",params:{org:f.slug,project:oa}})},e[18]=u,e[19]=f.slug,e[20]=F):F=e[20];const G=F;if(x){let V;e[21]!==_?(V={label:_,color:"var(--chart-1)"},e[21]=_,e[22]=V):V=e[22];let H;e[23]!==_||e[24]!==V?(H={[_]:V},e[23]=_,e[24]=V,e[25]=H):H=e[25];const q=H,Q=la[r];let W;e[26]!==Q?(W=n.jsx("div",{className:"flex flex-col gap-1.5",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:Q})}),e[26]=Q,e[27]=W):W=e[27];const te=(M?.timeseries?.length??0)===0?n.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No AI activity in this time range"}):n.jsx("div",{className:"flex flex-col gap-2 w-full h-full",children:n.jsx(Mt,{className:"flex-1 min-h-0 max-h-[140px] w-full",config:q,children:n.jsxs(na,{data:R,margin:{left:8,right:8,top:5,bottom:5},children:[n.jsx(cr,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"var(--muted-foreground)"}}),n.jsx(Et,{content:se=>{const{active:le,payload:re}=se;if(!le||!re||re.length===0)return null;const oe=re[0]&&typeof re[0]=="object"&&"payload"in re[0]?re[0].payload?.label??"":"",me=typeof re[0]?.value=="number"?re[0].value:0;return n.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-sm",children:[n.jsx("div",{className:"mb-1.5 text-xs text-muted-foreground",children:oe}),n.jsx("div",{className:"text-xs font-medium",children:ia(me,r)})]})}}),n.jsx(Kt,{type:"monotone",dataKey:_,stroke:"var(--chart-1)",strokeWidth:2,animationDuration:200,dot:!1,activeDot:{r:4}})]})})});let U;return e[28]!==G||e[29]!==W||e[30]!==te?(U=n.jsx(Ae,{title:W,onTitleClick:G,children:te}),e[28]=G,e[29]=W,e[30]=te,e[31]=U):U=e[31],U}const ne=la[r];let X;return e[32]!==ne?(X=n.jsx("p",{className:"text-sm text-muted-foreground",children:ne}),e[32]=ne,e[33]=X):X=e[33],n.jsx(Ae,{title:n.jsxs("div",{className:"flex flex-col gap-1.5",children:[X,n.jsx("div",{className:"flex items-center gap-3",children:T.slice(0,3).map(V=>{const H=B.get(V.connectionId||"");return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(it,{icon:H?.icon||null,name:V.toolName,size:"xs",fallbackIcon:n.jsx(_t,{}),className:"shrink-0 size-4! min-w-4! aspect-square rounded-sm"}),n.jsx("span",{className:"text-[10px] text-foreground truncate max-w-32",children:V.toolName})]},V.toolName)})})]}),onTitleClick:G,children:T.length===0?n.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No tool activity in this time range"}):n.jsx("div",{className:"flex flex-col gap-2 w-full h-full",children:n.jsx(Mt,{className:"flex-1 min-h-0 max-h-[140px] w-full",config:z,children:n.jsxs(na,{data:A,margin:{left:8,right:8,top:5,bottom:5},children:[n.jsx(cr,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"var(--muted-foreground)"}}),n.jsx(Et,{content:V=>{const{active:H,payload:q}=V;if(!H||!q||q.length===0)return null;const Q=q[0]&&typeof q[0]=="object"&&"payload"in q[0]?q[0].payload?.label??"":"";return n.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-sm",children:[n.jsx("div",{className:"mb-1.5 text-xs text-muted-foreground",children:Q}),n.jsx("div",{className:"flex flex-col gap-1",children:[...q].sort(Wo).map(W=>{const te=String(W.dataKey??""),U=typeof W.value=="number"?W.value:0,se=typeof W.color=="string"?W.color:void 0;if(!U||U===0)return null;const le=T.find(oe=>oe.toolName===te),re=B.get(le?.connectionId||"");return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:se}}),n.jsx(it,{icon:re?.icon||null,name:te,size:"xs",fallbackIcon:n.jsx(_t,{}),className:"shrink-0"}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:[te,":"]}),n.jsx("span",{className:"text-xs font-medium",children:ia(U,r)})]},te)})})]})}}),T.map(V=>n.jsx(Kt,{type:"monotone",dataKey:V.toolName,stroke:K.get(V.toolName),strokeWidth:2,animationDuration:200,dot:!1,activeDot:{r:4}},V.toolName))]})})})})}function Wo(t,e){const r=typeof t.value=="number"?t.value:0;return(typeof e.value=="number"?e.value:0)-r}function Vo(t){return[t.id,t]}function Uo(){const t=ee.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[e,n.jsx("div",{className:"flex items-center gap-2",children:Array.from({length:3}).map(Ho)})]}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Ae,{title:r,children:n.jsx("div",{className:"flex flex-col gap-2 w-full",children:n.jsx("div",{className:"h-[140px] w-full rounded bg-muted animate-pulse"})})}),t[2]=a):a=t[2],a}function Ho(t,e){return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"size-4 aspect-square rounded-md bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-16 rounded bg-muted animate-pulse"})]},e)}const Wt={Content:Fo,Skeleton:Uo};function hn(t){const e=t.endDate.getTime()-t.startDate.getTime(),r=3600*1e3,a=25*r;return e<=r?"1m":e<=a?"1h":"1d"}function Go(t,e){const r=new Date(t);return e==="1d"?r.toLocaleDateString([],{month:"short",day:"numeric"}):r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function qo(t,e){const r=new Date(t);return e==="1d"?(r.setHours(0,0,0,0),r):e==="1h"?(r.setMinutes(0,0,0),r):(r.setSeconds(0,0),r)}function xn(t,e,r){const a=new Map(t.map(u=>[qo(new Date(u.timestamp),r).getTime(),u])),l=20,s=e.startDate.getTime(),c=(e.endDate.getTime()-s)/(l-1),o=[],d=[];for(let u=0;u<l;u++){const m=Math.round(s+u*c);d.push(m),o.push({t:new Date(m).toISOString(),ts:m,label:Go(new Date(m).toISOString(),r),calls:0,errors:0,errorRate:0,avg:0,p50:0,p95:0})}const f=new Array(l).fill(0);for(const[u,m]of a){let h=0,b=Math.abs(u-d[0]);for(let j=1;j<d.length;j++){const v=Math.abs(u-d[j]);v<b&&(b=v,h=j)}const y=o[h];y.calls+=m.calls,y.errors+=m.errors,y.errorRate+=m.errorRate,y.avg+=m.avg,y.p50+=m.p50,y.p95=Math.max(y.p95,m.p95),f[h]++}for(let u=0;u<l;u++)f[u]>0&&(o[u].errorRate=o[u].errorRate/f[u],o[u].avg=o[u].avg/f[u],o[u].p50=o[u].p50/f[u]);return o}function st(t,e){return e==="requests"?t.calls:e==="errors"?t.errorRate:t.avgDurationMs}function Ze(t){return t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`}function Zo(t,e){return e==="requests"?t.calls.toLocaleString():e==="errors"?`${t.errorRate.toFixed(1)}%`:Ze(t.avgDurationMs)}const Qo=[{id:"calls",dataKey:"calls",colorNum:1,barColor:"bg-chart-1",leaderboardMode:"requests",chartMetrics:["calls"],renderTitle:t=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Tool Calls"}),n.jsx("p",{className:"text-sm md:text-lg font-medium",children:t.totalCalls.toLocaleString()})]}),getNextMetric:()=>"calls"},{id:"latency",dataKey:t=>t==="latency-avg"?"avg":"p95",colorNum:4,barColor:"bg-chart-4",leaderboardMode:"latency",chartMetrics:["latency-avg","latency-p95"],renderTitle:(t,e)=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Latency"}),n.jsxs("div",{className:"flex items-baseline gap-3",children:[n.jsxs("div",{className:Ne("pb-0.5",e==="latency-avg"?"border-b-2 border-chart-4":"border-b-2 border-transparent"),children:[n.jsx("span",{className:"text-sm md:text-lg font-medium",children:Ze(t.avgDurationMs)}),n.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"avg"})]}),n.jsxs("div",{className:Ne("pb-0.5",e==="latency-p95"?"border-b-2 border-chart-4":"border-b-2 border-transparent"),children:[n.jsx("span",{className:"text-sm md:text-lg font-medium",children:Ze(t.p95DurationMs)}),n.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"p95"})]})]})]}),getNextMetric:t=>t==="latency-avg"?"latency-p95":"latency-avg"},{id:"errors",dataKey:"errors",colorNum:3,barColor:"bg-chart-3",leaderboardMode:"errors",chartMetrics:["errors"],renderTitle:t=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Errors"}),n.jsx("p",{className:"text-sm md:text-lg font-medium",children:t.totalErrors.toLocaleString()})]}),getNextMetric:()=>"errors"}];function Xo(t){const e=ee.c(12),{metrics:r,connections:a,mode:l,barColor:s}=t;let i,c,o;if(e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==l){o=Symbol.for("react.early_return_sentinel");e:{const f=new Map(r.map(Jo)),u=a??[];let m;e[7]!==l?(m=(y,j)=>st(j.metric,l)-st(y.metric,l),e[7]=l,e[8]=m):m=e[8];const h=u.map(y=>({connection:y,metric:f.get(y.id)})).filter(Yo).sort(m).slice(0,5),b=h[0]?.metric?st(h[0].metric,l):1;if(h.length===0){o=null;break e}i="space-y-1.5 mt-2",c=h.map(y=>{const{connection:j,metric:v}=y,x=st(v,l),g=b>0?Math.min(x/b*100,100):0;return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(it,{icon:j.icon,name:j.title,size:"xs",fallbackIcon:n.jsx(_t,{}),className:"shrink-0 size-4! min-w-4!"}),n.jsx("span",{className:"text-[10px] text-foreground truncate min-w-0 w-20",children:j.title}),n.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1",children:n.jsx("div",{className:Ne("h-full",s),style:{width:`${g}%`}})}),n.jsx("span",{className:"text-[10px] tabular-nums shrink-0 text-foreground",children:Zo(v,l)})]},j.id)})}e[0]=s,e[1]=a,e[2]=r,e[3]=l,e[4]=i,e[5]=c,e[6]=o}else i=e[4],c=e[5],o=e[6];if(o!==Symbol.for("react.early_return_sentinel"))return o;let d;return e[9]!==i||e[10]!==c?(d=n.jsx("div",{className:i,children:c}),e[9]=i,e[10]=c,e[11]=d):d=e[11],d}function Yo(t){return t.metric}function Jo(t){return[t.connectionId,t]}function ec(t){const e=ee.c(8),{displayDateRange:r,connectionIds:a,excludeConnectionIds:l,toolName:s,status:i,connections:c,isStreaming:o,selectedMetric:d,onMetricSelect:f}=t,u=hn(r),m=o?Gt.streamingRefetchInterval:!1;let h;e[0]!==m?(h={refetchInterval:m},e[0]=m,e[1]=h):h=e[1];const{data:b}=So({interval:u,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionIds:a.length>0?a:void 0,excludeConnectionIds:l,toolNames:s?[s]:void 0,status:i},h),y=b?{totalCalls:b.totalCalls,totalErrors:b.totalErrors,avgDurationMs:b.avgDurationMs,p95DurationMs:b.p95DurationMs,data:xn(b.timeseries,r,u)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},j="border-b border-border";let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("div",{className:"px-5 py-2 bg-muted/30 border-b border-border",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Tool Calls"})}),e[2]=v):v=e[2];const x="grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",g=Qo.map(w=>{const{id:O,dataKey:C,colorNum:I,barColor:k,leaderboardMode:E,chartMetrics:M,renderTitle:T,getNextMetric:P}=w,D=M.includes(d),L=()=>{f(D?P(d):M[0])};return n.jsxs("div",{className:"bg-background relative cursor-pointer",onClick:L,children:[D&&n.jsx("div",{className:"absolute top-0 left-0 right-0 h-0.5 z-10",style:{backgroundColor:`var(--chart-${I})`}}),n.jsx(Ae,{title:T(y,d),children:n.jsxs("div",{className:"flex flex-col w-full",children:[n.jsx(fn,{data:y.data,dataKey:typeof C=="function"?C(d):C,colorNum:I,chartHeight:"h-[30px] md:h-[40px]"}),n.jsx(Xo,{metrics:b?.connectionBreakdown??[],connections:c,mode:E,barColor:k})]})})]},O)});let N;e[3]!==g?(N=n.jsx("div",{className:x,children:g}),e[3]=g,e[4]=N):N=e[4];let S;return e[5]!==v||e[6]!==N?(S=n.jsxs("div",{className:j,children:[v,N]}),e[5]=v,e[6]=N,e[7]=S):S=e[7],S}const gn=Object.assign(ec,{Skeleton:jo});function tc(t){const e=ee.c(9),{topTools:r,barColor:a}=t;if(r.length===0)return null;const l=r[0]?.calls??1;let s;if(e[0]!==a||e[1]!==l||e[2]!==r){let c;e[4]!==a||e[5]!==l?(c=o=>{const{toolName:d,calls:f}=o,u=l>0?Math.min(f/l*100,100):0;return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"text-[10px] text-foreground truncate min-w-0 w-24",children:d}),n.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1",children:n.jsx("div",{className:Ne("h-full",a),style:{width:`${u}%`}})}),n.jsx("span",{className:"text-[10px] tabular-nums shrink-0 text-foreground",children:f.toLocaleString()})]},d)},e[4]=a,e[5]=l,e[6]=c):c=e[6],s=r.map(c),e[0]=a,e[1]=l,e[2]=r,e[3]=s}else s=e[3];let i;return e[7]!==s?(i=n.jsx("div",{className:"space-y-1.5 mt-2",children:s}),e[7]=s,e[8]=i):i=e[8],i}function rc(t){const e=ee.c(8),{displayDateRange:r,isStreaming:a,selectedMetric:l,onMetricSelect:s}=t,i=hn(r),c=a?Gt.streamingRefetchInterval:!1;let o;e[0]!==c?(o={refetchInterval:c},e[0]=c,e[1]=o):o=e[1];const{data:d}=pn({interval:i,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString()},o),f=d?{totalCalls:d.totalCalls,totalErrors:d.totalErrors,avgDurationMs:d.avgDurationMs,p95DurationMs:d.p95DurationMs,data:xn(d.timeseries,r,i)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},u=d?.topTools??[],m=[{id:"llm-calls",dataKey:"calls",colorNum:1,barColor:"bg-chart-1",chartMetric:"llm-calls",renderTitle:()=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"AI Usage"}),n.jsx("p",{className:"text-sm md:text-lg font-medium",children:f.totalCalls.toLocaleString()})]})},{id:"llm-latency",dataKey:"avg",colorNum:4,barColor:"bg-chart-4",chartMetric:"llm-latency-avg",renderTitle:()=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"AI Latency"}),n.jsxs("div",{className:"flex items-baseline gap-3",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-sm md:text-lg font-medium",children:Ze(f.avgDurationMs)}),n.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"avg"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-sm md:text-lg font-medium",children:Ze(f.p95DurationMs)}),n.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"p95"})]})]})]})},{id:"llm-errors",dataKey:"errors",colorNum:3,barColor:"bg-chart-3",chartMetric:"llm-errors",renderTitle:()=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"AI Errors"}),n.jsx("p",{className:"text-sm md:text-lg font-medium",children:f.totalErrors.toLocaleString()})]})}],h="border-b border-border";let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("div",{className:"px-5 py-2 bg-muted/30 border-b border-border",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"AI Usage"})}),e[2]=b):b=e[2];const y="grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",j=m.map(g=>{const{id:N,dataKey:S,colorNum:w,barColor:O,chartMetric:C,renderTitle:I}=g,k=l===C;return n.jsxs("div",{className:"bg-background relative cursor-pointer",onClick:()=>s(C),children:[k&&n.jsx("div",{className:"absolute top-0 left-0 right-0 h-0.5 z-10",style:{backgroundColor:`var(--chart-${w})`}}),n.jsx(Ae,{title:I(),children:n.jsxs("div",{className:"flex flex-col w-full",children:[n.jsx(fn,{data:f.data,dataKey:S,colorNum:w,chartHeight:"h-[30px] md:h-[40px]"}),n.jsx(tc,{topTools:u,barColor:O})]})})]},N)});let v;e[3]!==j?(v=n.jsx("div",{className:y,children:j}),e[3]=j,e[4]=v):v=e[4];let x;return e[5]!==b||e[6]!==v?(x=n.jsxs("div",{className:h,children:[b,v]}),e[5]=b,e[6]=v,e[7]=x):x=e[7],x}function ac(){const t=ee.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"px-5 py-2 bg-muted/30 border-b border-border",children:n.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"border-b border-border",children:[e,n.jsx("div",{className:"grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",children:[...Array(3)].map(nc)})]}),t[1]=r):r=t[1],r}function nc(t,e){return n.jsx(Ae,{title:n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("div",{className:"h-4 w-16 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-5 md:h-6 w-12 rounded bg-muted animate-pulse"})]}),children:n.jsxs("div",{className:"flex flex-col w-full",children:[n.jsx("div",{className:"h-[30px] md:h-[40px] w-full rounded bg-muted animate-pulse"}),n.jsx("div",{className:"space-y-1.5 mt-2",children:Array.from({length:3}).map(sc)})]})},e)}function sc(t,e){return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"h-2.5 w-24 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-1.5 flex-1 bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-8 rounded bg-muted animate-pulse shrink-0"})]},e)}const bn=Object.assign(rc,{Skeleton:ac}),lc=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function ic({connectionIds:t,virtualMcpIds:e,tool:r,status:a,hideSystem:l,propertyFilters:s,connectionOptions:i,virtualMcpOptions:c,activeFiltersCount:o,onUpdateFilters:d}){const[f,u]=p.useState(!1),[m,h]=p.useState("raw"),[b,y]=p.useState(r),[j,v]=p.useState(s),[x,g]=p.useState(et(s)),N=p.useRef(r),S=p.useRef(Re(s));N.current!==r&&(N.current=r,b!==r&&y(r));const w=Re(s);S.current!==w&&(S.current=w,v(s),g(et(s)));const O=(T,P)=>{const D=[...j],L=D[T];L&&(D[T]={key:P.key??L.key,operator:P.operator??L.operator,value:P.value??L.value},v(D))},C=()=>{v([...j,{key:"",operator:"eq",value:""}])},I=T=>{const P=j.filter((D,L)=>L!==T);v(P),g(et(P)),d({propertyFilters:Re(P)})},k=()=>{d({propertyFilters:Re(j)})},E=()=>{const T=ar(x);v(T),d({propertyFilters:Re(T)})},M=()=>{if(m==="raw"){const T=ar(x);v(T),h("form")}else g(et(j)),h("raw")};return n.jsxs(Ka,{open:f,onOpenChange:u,children:[n.jsx(Ba,{asChild:!0,children:n.jsxs(ye,{variant:"outline",size:"sm",children:[n.jsx(Is,{size:16}),"Filters",o>0&&n.jsx(ot,{variant:"default",className:"ml-1 h-5 w-5 rounded-full p-0 flex items-center justify-center text-xs",children:o})]})}),n.jsx(Ra,{align:"end",className:"w-[320px]",children:n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{children:n.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(Bs,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),n.jsx($s,{id:"hide-system-calls",checked:l,onCheckedChange:T=>d({hideSystem:!!T})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),n.jsx(sa,{options:i,defaultValue:t,onValueChange:T=>d({connectionId:T}),placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),n.jsx(sa,{options:c,defaultValue:e,onValueChange:T=>d({virtualMcpId:T}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),n.jsx(Ot,{id:"filter-tool",placeholder:"Filter by tool...",value:b,onChange:T=>y(T.target.value),onBlur:()=>{b!==r&&d({tool:b})},onKeyDown:T=>{T.key==="Enter"&&b!==r&&d({tool:b})},className:"w-full"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),n.jsxs(fr,{value:a,onValueChange:T=>d({status:T}),children:[n.jsx(pr,{className:"w-full",children:n.jsx(vr,{})}),n.jsxs(hr,{children:[n.jsx(rt,{value:"all",children:"All Status"}),n.jsx(rt,{value:"success",children:"Success Only"}),n.jsx(rt,{value:"errors",children:"Errors Only"})]})]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),n.jsxs(Ms,{children:[n.jsx(_s,{asChild:!0,children:n.jsx(ye,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:M,children:m==="raw"?n.jsx(Os,{size:14}):n.jsx(Ps,{size:14})})}),n.jsx(Ls,{children:m==="raw"?"Switch to form view":"Switch to raw text"})]})]}),m==="raw"?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(Es,{placeholder:`Paste property filters here:
29
- thread_id=abc123
30
- user~test
31
- debug?`,value:x,onChange:T=>g(T.target.value),onBlur:E,onKeyDown:T=>{T.key==="Enter"&&T.metaKey&&E()},className:"font-mono text-sm min-h-[80px] resize-none"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):n.jsxs("div",{className:"space-y-3",children:[j.map((T,P)=>n.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",P+1]}),n.jsx(ye,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>I(P),children:n.jsx(La,{size:12})})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(Ot,{placeholder:"Key (e.g., thread_id)",value:T.key,onChange:D=>O(P,{key:D.target.value}),onBlur:k,onKeyDown:D=>{D.key==="Enter"&&k()},className:"flex-1 font-mono text-sm"}),n.jsxs(fr,{value:T.operator,onValueChange:D=>{const L=[...j],$=L[P];$&&(L[P]={...$,operator:D,value:D==="exists"?"":$.value},v(L),d({propertyFilters:Re(L)}))},children:[n.jsx(pr,{className:"w-28",children:n.jsx(vr,{})}),n.jsx(hr,{children:lc.map(D=>n.jsx(rt,{value:D.value,children:D.label},D.value))})]})]}),T.operator!=="exists"&&n.jsx(Ot,{placeholder:"Value",value:T.value,onChange:D=>O(P,{value:D.target.value}),onBlur:k,onKeyDown:D=>{D.key==="Enter"&&k()},className:"w-full font-mono text-sm"})]},P)),n.jsxs(ye,{variant:"outline",size:"sm",className:"w-full",onClick:C,children:[n.jsx(_a,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),o>0&&n.jsx(ye,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{y(""),v([]),g(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),u(!1)},children:"Clear all filters"})]})})]})}function oc(t){const e=ee.c(17),{connectionIds:r,virtualMcpIds:a,tool:l,status:s,search:i,logs:c,hasMore:o,onLoadMore:d,isLoadingMore:f,connections:u,virtualMcps:m,membersData:h}=t,b=u??[],y=m??[];let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=new Set,e[0]=j):j=e[0];const[v,x]=p.useState(j),g=Eo(d,o,f),N=h?.data?.members??[],S=new Map(N.map(uc)),w=new Map(y.map(dc));let C=c.map(A=>{const B=S.get(A.userId??""),F=A.virtualMcpId?w.get(A.virtualMcpId):null;return{...A,userName:B?.name??A.userId??"Unknown",userImage:B?.image,virtualMcpName:F?.title??null}});if(r.length>1){let A;e[1]!==r?(A=B=>r.includes(B.connectionId),e[1]=r,e[2]=A):A=e[2],C=C.filter(A)}if(a.length>1){let A;e[3]!==a?(A=B=>B.virtualMcpId&&a.includes(B.virtualMcpId),e[3]=a,e[4]=A):A=e[4],C=C.filter(A)}if(i){const A=i.toLowerCase();C=C.filter(B=>B.toolName.toLowerCase().includes(A)||B.connectionTitle.toLowerCase().includes(A)||B.errorMessage?.toLowerCase().includes(A))}let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=A=>{x(B=>{const F=new Set(B);return F.has(A.id)?F.delete(A.id):F.add(A.id),F})},e[5]=I):I=e[5];const k=I,E=new Map(b.map(cc));if(C.length===0){let A;e[6]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[6]=A):A=e[6];const B=i||r.length>0||a.length>0||l||s!=="all"?"No logs match your filters":"No logs found in this time range";let F;return e[7]!==B?(F=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Ht,{image:A,title:"No logs found",description:B})}),e[7]=B,e[8]=F):F=e[8],F}const M="flex-1 flex flex-col overflow-hidden",T="flex-1 overflow-auto",P="min-w-[600px] md:min-w-0 bg-background",D=pa,L="w-full border-collapse";let $;e[9]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(va,{className:"border-b-0 z-20",children:n.jsxs(He,{className:"h-9 hover:bg-transparent border-b border-border",children:[n.jsx(ie,{className:"w-10 md:w-12 px-2 md:px-4"}),n.jsx(ie,{className:"w-5"}),n.jsx(ie,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),n.jsx(ie,{className:"w-24 md:w-32 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),n.jsx(ie,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User Name"}),n.jsx(ie,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),n.jsx(ie,{className:"w-20 md:w-28 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Time"}),n.jsx(ie,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Latency"}),n.jsx(ie,{className:"w-16 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right pr-3 md:pr-5",children:"Status"})]})}),e[9]=$):$=e[9];const z=fa,K=C.map((A,B)=>n.jsx(bo,{log:A,isExpanded:v.has(A.id),connection:E.get(A.connectionId),virtualMcpName:A.virtualMcpName??"",onToggle:()=>k(A),lastLogRef:B===C.length-1?g:void 0},A.id));let R;e[10]!==z||e[11]!==K?(R=n.jsx(z,{children:K}),e[10]=z,e[11]=K,e[12]=R):R=e[12];let _;return e[13]!==D||e[14]!==$||e[15]!==R?(_=n.jsx("div",{className:M,children:n.jsx("div",{className:T,children:n.jsx("div",{className:P,children:n.jsxs(D,{className:L,children:[$,R]})})})}),e[13]=D,e[14]=$,e[15]=R,e[16]=_):_=e[16],_}function cc(t){return[t.id,t]}function dc(t){return[t.id,t]}function uc(t){return[t.userId,t.user]}function mc(){const t=ee.c(10);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(ie,{className:"w-10 md:w-12 px-2 md:px-4"}),r=n.jsx(ie,{className:"w-5"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(ie,{className:"pr-2 md:pr-4",children:n.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),t[2]=a):a=t[2];let l;t[3]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(ie,{className:"w-24 md:w-32 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),t[3]=l):l=t[3];let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(ie,{className:"w-20 md:w-24 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t[4]=s):s=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(ie,{className:"w-20 md:w-24 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),t[5]=i):i=t[5];let c;t[6]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ie,{className:"w-20 md:w-28 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),t[6]=c):c=t[6];let o;t[7]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(ie,{className:"w-16 md:w-20 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t[7]=o):o=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(va,{className:"border-b-0 z-20",children:n.jsxs(He,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,a,l,s,i,c,o,n.jsx(ie,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:n.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),t[8]=d):d=t[8];let f;return t[9]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsx("div",{className:"min-w-[600px] md:min-w-0 bg-background",children:n.jsxs(pa,{className:"w-full border-collapse",children:[d,n.jsx(fa,{children:Array.from({length:8}).map(fc)})]})})})}),t[9]=f):f=t[9],f}function fc(t,e){return n.jsxs(He,{className:"h-12 border-b border-border",children:[n.jsx("td",{className:"px-2 md:px-4",children:n.jsx("div",{className:"size-4 rounded bg-muted animate-pulse"})}),n.jsx("td",{children:n.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"pr-2 md:pr-4",children:n.jsxs("div",{className:"space-y-1",children:[n.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),n.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:n.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const yn=Object.assign(oc,{Skeleton:mc});function pc(t){const e=ee.c(44),{client:r,locator:a,baseParams:l,pageSize:s,isStreaming:i,streamingRefetchInterval:c,connectionIds:o,virtualMcpIds:d,tool:f,status:u,searchQuery:m,onUpdateFilters:h,allConnections:b,allVirtualMcps:y,membersData:j}=t;let v;e[0]!==l||e[1]!==a?(v=lt.monitoringLogsInfinite(a,JSON.stringify(l)),e[0]=l,e[1]=a,e[2]=v):v=e[2];let x;e[3]!==l||e[4]!==r||e[5]!==s?(x=async R=>{const{pageParam:_}=R,A=_===void 0?0:_;if(!r)throw new Error("MCP client is not available");const B=await r.callTool({name:"MONITORING_LOGS_LIST",arguments:{...l,limit:s,offset:A}});return B.structuredContent??B},e[3]=l,e[4]=r,e[5]=s,e[6]=x):x=e[6];let g;e[7]!==s?(g=(R,_)=>{if(!((R?.logs?.length??0)<s))return _.length*s},e[7]=s,e[8]=g):g=e[8];const N=i?c:!1;let S;e[9]!==v||e[10]!==x||e[11]!==g||e[12]!==N?(S={queryKey:v,queryFn:x,initialPageParam:0,getNextPageParam:g,staleTime:0,refetchInterval:N},e[9]=v,e[10]=x,e[11]=g,e[12]=N,e[13]=S):S=e[13];const{data:w,fetchNextPage:O,hasNextPage:C,isFetchingNextPage:I}=ws(S);let k;e[14]!==w.pages?(k=w.pages.flatMap(vc),e[14]=w.pages,e[15]=k):k=e[15];const E=k;let M;e[16]!==O||e[17]!==C||e[18]!==I?(M=()=>{C&&!I&&O()},e[16]=O,e[17]=C,e[18]=I,e[19]=M):M=e[19];const T=M;let P;e[20]!==h?(P=R=>h({search:R}),e[20]=h,e[21]=P):P=e[21];let D;e[22]!==h?(D=R=>{R.key==="Escape"&&(h({search:""}),R.target.blur())},e[22]=h,e[23]=D):D=e[23];let L;e[24]!==m||e[25]!==P||e[26]!==D?(L=n.jsx(On,{value:m,onChange:P,placeholder:"Search by tool name, connection, or error...",className:"border-t",onKeyDown:D}),e[24]=m,e[25]=P,e[26]=D,e[27]=L):L=e[27];const $=C??!1;let z;e[28]!==b||e[29]!==E||e[30]!==y||e[31]!==o||e[32]!==T||e[33]!==I||e[34]!==j||e[35]!==m||e[36]!==u||e[37]!==$||e[38]!==f||e[39]!==d?(z=n.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:n.jsx(yn,{connectionIds:o,virtualMcpIds:d,tool:f,status:u,search:m,logs:E,hasMore:$,onLoadMore:T,isLoadingMore:I,connections:b,virtualMcps:y,membersData:j})}),e[28]=b,e[29]=E,e[30]=y,e[31]=o,e[32]=T,e[33]=I,e[34]=j,e[35]=m,e[36]=u,e[37]=$,e[38]=f,e[39]=d,e[40]=z):z=e[40];let K;return e[41]!==L||e[42]!==z?(K=n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[L,z]}),e[41]=L,e[42]=z,e[43]=K):K=e[43],K}function vc(t){return t.logs??[]}function hc(t){const e=ee.c(85),{tab:r,dateRange:a,displayDateRange:l,connectionIds:s,virtualMcpIds:i,tool:c,status:o,search:d,streaming:f,hideSystem:u,activeFiltersCount:m,from:h,to:b,propertyFilters:y,onUpdateFilters:j,onTimeRangeChange:v,onStreamingToggle:x,onTabChange:g}=t,N=$a(),S=Ss(),{data:w}=Ns();let O;e[0]!==N?(O=N??[],e[0]=N,e[1]=O):O=e[1];let C;e[2]!==O?(C=O.map(gc),e[2]=O,e[3]=C):C=e[3];const I=C;let k;e[4]!==S?(k=S.map(xc),e[4]=S,e[5]=k):k=e[5];const E=k,{pageSize:M,streamingRefetchInterval:T}=Gt,{org:P,locator:D}=De();let L;e[6]!==P.id?(L={connectionId:Qe,orgId:P.id},e[6]=P.id,e[7]=L):L=e[7];const $=Xe(L);let z;e[8]!==y?(z=Tn(y),e[8]=y,e[9]=z):z=e[9];const K=z;let R;e[10]!==u||e[11]!==P.id?(R=u?[is.SELF(P.id)]:void 0,e[10]=u,e[11]=P.id,e[12]=R):R=e[12];const _=R,[A,B]=p.useState(!1);let F;e[13]!==a.startDate?(F=a.startDate.toISOString(),e[13]=a.startDate,e[14]=F):F=e[14];let G;e[15]!==a.endDate?(G=a.endDate.toISOString(),e[15]=a.endDate,e[16]=G):G=e[16];const ne=A?"decopilot":s.length===1?s[0]:void 0,X=i.length===1?i[0]:void 0,V=c||void 0,H=o==="errors"?!0:o==="success"?!1:void 0;let q;e[17]!==_||e[18]!==K||e[19]!==X||e[20]!==V||e[21]!==H||e[22]!==F||e[23]!==G||e[24]!==ne?(q={startDate:F,endDate:G,connectionId:ne,excludeConnectionIds:_,virtualMcpId:X,toolName:V,isError:H,...K},e[17]=_,e[18]=K,e[19]=X,e[20]=V,e[21]=H,e[22]=F,e[23]=G,e[24]=ne,e[25]=q):q=e[25];const Q=q,[W,te]=p.useState("calls");let U;e[26]!==l.startDate?(U=l.startDate.toISOString(),e[26]=l.startDate,e[27]=U):U=e[27];let se;e[28]!==l.endDate?(se=l.endDate.toISOString(),e[28]=l.endDate,e[29]=se):se=e[29];let le;e[30]!==U||e[31]!==se?(le={startDate:U,endDate:se},e[30]=U,e[31]=se,e[32]=le):le=e[32];const re=le;let oe;e[33]===Symbol.for("react.memo_cache_sentinel")?(oe={id:"overview",label:"Overview"},e[33]=oe):oe=e[33];let me;e[34]===Symbol.for("react.memo_cache_sentinel")?(me={id:"audit",label:"Audit"},e[34]=me):me=e[34];let Z;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z=[oe,me,{id:"dashboards",label:"Dashboards"}],e[35]=Z):Z=e[35];const ae=Z;let fe;e[36]===Symbol.for("react.memo_cache_sentinel")?(fe=n.jsx(je.Header.Left,{children:n.jsx(ca,{children:n.jsx(da,{children:n.jsx(ua,{children:n.jsx(ma,{children:"Monitoring"})})})})}),e[36]=fe):fe=e[36];let he;e[37]!==m||e[38]!==A||e[39]!==s||e[40]!==I||e[41]!==h||e[42]!==u||e[43]!==f||e[44]!==x||e[45]!==v||e[46]!==j||e[47]!==y||e[48]!==o||e[49]!==r||e[50]!==b||e[51]!==c||e[52]!==i||e[53]!==E?(he=(r==="overview"||r==="audit")&&n.jsx(je.Header.Right,{children:n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(ic,{connectionIds:s,virtualMcpIds:i,tool:c,status:o,hideSystem:u,propertyFilters:y,connectionOptions:I,virtualMcpOptions:E,activeFiltersCount:m,onUpdateFilters:j}),r==="audit"&&n.jsx(ye,{variant:A?"secondary":"outline",size:"sm",className:"h-7 px-2 sm:px-3 text-xs",onClick:()=>B(!A),children:"AI Usage"}),n.jsxs(ye,{variant:f?"secondary":"outline",size:"sm",className:Ne("h-7 px-2 sm:px-3 gap-1.5",f&&"bg-muted hover:bg-muted/80"),onClick:x,children:[f?n.jsx(Fa,{size:16,className:"animate-pulse"}):n.jsx(Wa,{size:16}),n.jsx("span",{className:"hidden sm:inline",children:f?"Streaming":"Stream"})]}),n.jsx(An,{value:{from:h,to:b},onChange:v})]})}),e[37]=m,e[38]=A,e[39]=s,e[40]=I,e[41]=h,e[42]=u,e[43]=f,e[44]=x,e[45]=v,e[46]=j,e[47]=y,e[48]=o,e[49]=r,e[50]=b,e[51]=c,e[52]=i,e[53]=E,e[54]=he):he=e[54];let _e;e[55]!==he?(_e=n.jsxs(je.Header,{children:[fe,he]}),e[55]=he,e[56]=_e):_e=e[56];let Le;e[57]!==g?(Le=jn=>g(jn),e[57]=g,e[58]=Le):Le=e[58];let $e;e[59]!==Le||e[60]!==r?($e=n.jsx("div",{className:"px-5 py-3 border-b border-border",children:n.jsx(za,{tabs:ae,activeTab:r,onTabChange:Le})}),e[59]=Le,e[60]=r,e[61]=$e):$e=e[61];let Be;e[62]!==N||e[63]!==S||e[64]!==re||e[65]!==Q||e[66]!==$||e[67]!==s||e[68]!==l||e[69]!==_||e[70]!==f||e[71]!==D||e[72]!==w||e[73]!==j||e[74]!==d||e[75]!==o||e[76]!==r||e[77]!==c||e[78]!==W||e[79]!==i?(Be=r==="dashboards"?n.jsx(Do,{}):r==="audit"?n.jsx(pc,{client:$,locator:D,baseParams:Q,pageSize:M,isStreaming:f,streamingRefetchInterval:T,connectionIds:s,virtualMcpIds:i,tool:c,status:o,searchQuery:d,onUpdateFilters:j,allConnections:N,allVirtualMcps:S,membersData:w}):n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx("div",{className:"border-b border-border relative z-10",children:n.jsx(Vt,{fallback:null,children:n.jsx(p.Suspense,{fallback:n.jsx(Wt.Skeleton,{}),children:n.jsx(Wt.Content,{metricsMode:W,dateRange:re,connectionIds:s,excludeConnectionIds:_,toolName:c||void 0,status:o==="errors"?"error":o==="success"?"success":void 0,isStreaming:f,streamingRefetchInterval:T})})})}),n.jsx(gn,{displayDateRange:l,connectionIds:s,excludeConnectionIds:_,toolName:c||void 0,status:o==="errors"?"error":o==="success"?"success":void 0,connections:N,isStreaming:f,selectedMetric:W,onMetricSelect:te}),n.jsx(bn,{displayDateRange:l,isStreaming:f,selectedMetric:W,onMetricSelect:te})]}),e[62]=N,e[63]=S,e[64]=re,e[65]=Q,e[66]=$,e[67]=s,e[68]=l,e[69]=_,e[70]=f,e[71]=D,e[72]=w,e[73]=j,e[74]=d,e[75]=o,e[76]=r,e[77]=c,e[78]=W,e[79]=i,e[80]=Be):Be=e[80];let Je;return e[81]!==_e||e[82]!==$e||e[83]!==Be?(Je=n.jsxs(n.Fragment,{children:[_e,$e,Be]}),e[81]=_e,e[82]=$e,e[83]=Be,e[84]=Je):Je=e[84],Je}function xc(t){return{value:t.id??"",label:t.title??"Decopilot"}}function gc(t){return{value:t.id,label:t.title||t.id}}function Od(){const t=ee.c(81),{org:e}=De(),r=Ut();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/$project/monitoring"},t[0]=a):a=t[0];const l=In(a),{tab:s,from:i,to:c,connectionId:o,virtualMcpId:d,tool:f,search:u,status:m,streaming:h,propertyFilters:b,hideSystem:y}=l,j=s===void 0?"overview":s;let v;t[1]!==o?(v=o===void 0?[]:o,t[1]=o,t[2]=v):v=t[2];const x=v;let g;t[3]!==d?(g=d===void 0?[]:d,t[3]=d,t[4]=g):g=t[4];const N=g,S=h===void 0?!0:h,w=b===void 0?"":b,O=y===void 0?!1:y;let C,I,k,E,M,T,P;if(t[5]!==x.length||t[6]!==i||t[7]!==O||t[8]!==r||t[9]!==e.slug||t[10]!==w||t[11]!==l||t[12]!==m||t[13]!==S||t[14]!==c||t[15]!==f||t[16]!==N.length){M=kn(w);let H;t[24]!==r||t[25]!==e.slug||t[26]!==l?(H=U=>{r({to:"/$org/$project/monitoring",params:{org:e.slug,project:oa},search:{...l,...U}})},t[24]=r,t[25]=e.slug,t[26]=l,t[27]=H):H=t[27],P=H;let q;t[28]!==P?(q=U=>{P({from:U.from,to:U.to})},t[28]=P,t[29]=q):q=t[29],E=q;let Q,W;if(t[30]!==i||t[31]!==S||t[32]!==c){const U=rr(i),se=rr(c);W=U.date||new Date(Date.now()-18e5);const le=se.date||new Date;k={startDate:W,endDate:le},Q=le,S&&c==="now"&&(Q=new Date(le),Q.setHours(Q.getHours()+1)),t[30]=i,t[31]=S,t[32]=c,t[33]=k,t[34]=Q,t[35]=W}else k=t[33],Q=t[34],W=t[35];let te;t[36]!==Q||t[37]!==W?(te={startDate:W,endDate:Q},t[36]=Q,t[37]=W,t[38]=te):te=t[38],I=te,C=0,x.length>0&&C++,N.length>0&&C++,f&&C++,m!=="all"&&C++,O&&C++,T=M.filter(bc),t[5]=x.length,t[6]=i,t[7]=O,t[8]=r,t[9]=e.slug,t[10]=w,t[11]=l,t[12]=m,t[13]=S,t[14]=c,t[15]=f,t[16]=N.length,t[17]=C,t[18]=I,t[19]=k,t[20]=E,t[21]=M,t[22]=T,t[23]=P}else C=t[17],I=t[18],k=t[19],E=t[20],M=t[21],T=t[22],P=t[23];const D=T;D.length>0&&(C=C+D.length);let L;t[39]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx(je.Header,{children:n.jsx(je.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[39]=L):L=t[39];let $;t[40]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-[0.5px] bg-border shrink-0 border-b",children:n.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load monitoring data"})}),t[40]=$):$=t[40];let z;t[41]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(n.Fragment,{children:[L,n.jsx(je.Content,{children:n.jsxs("div",{className:"flex flex-col overflow-auto md:overflow-hidden h-full",children:[$,n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Ht,{title:"Failed to load logs",description:"There was an error loading the monitoring data. Please try again."})})]})})]}),t[41]=z):z=t[41];let K;t[42]===Symbol.for("react.memo_cache_sentinel")?(K=n.jsx(je.Header,{children:n.jsx(je.Header.Left,{children:n.jsx(ca,{children:n.jsx(da,{children:n.jsx(ua,{children:n.jsx(ma,{children:"Monitoring"})})})})})}),t[42]=K):K=t[42];let R;t[43]===Symbol.for("react.memo_cache_sentinel")?(R=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"dashboards",label:"Dashboards"}],t[43]=R):R=t[43];let _;t[44]!==P?(_=H=>P({tab:H}),t[44]=P,t[45]=_):_=t[45];let A;t[46]!==_||t[47]!==j?(A=n.jsx("div",{className:"px-5 py-3 border-b border-border",children:n.jsx(za,{tabs:R,activeTab:j,onTabChange:_})}),t[46]=_,t[47]=j,t[48]=A):A=t[48];let B;t[49]!==j?(B=j==="audit"?n.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:n.jsx(yn.Skeleton,{})}):j==="dashboards"?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-muted-foreground",children:"Loading dashboards..."})}):n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx("div",{className:"border-b border-border",children:n.jsx(Wt.Skeleton,{})}),n.jsx(gn.Skeleton,{}),n.jsx(bn.Skeleton,{})]}),t[49]=j,t[50]=B):B=t[50];let F;t[51]!==A||t[52]!==B?(F=n.jsxs(n.Fragment,{children:[K,A,B]}),t[51]=A,t[52]=B,t[53]=F):F=t[53];let G;t[54]!==S||t[55]!==P?(G=()=>P({streaming:!S}),t[54]=S,t[55]=P,t[56]=G):G=t[56];let ne;t[57]!==P?(ne=H=>P({tab:H}),t[57]=P,t[58]=ne):ne=t[58];let X;t[59]!==C||t[60]!==x||t[61]!==I||t[62]!==k||t[63]!==i||t[64]!==E||t[65]!==O||t[66]!==M||t[67]!==u||t[68]!==m||t[69]!==S||t[70]!==G||t[71]!==ne||t[72]!==j||t[73]!==c||t[74]!==f||t[75]!==P||t[76]!==N?(X=n.jsx(hc,{tab:j,dateRange:I,displayDateRange:k,connectionIds:x,virtualMcpIds:N,tool:f,status:m,search:u,streaming:S,hideSystem:O,activeFiltersCount:C,from:i,to:c,propertyFilters:M,onUpdateFilters:P,onTimeRangeChange:E,onStreamingToggle:G,onTabChange:ne}),t[59]=C,t[60]=x,t[61]=I,t[62]=k,t[63]=i,t[64]=E,t[65]=O,t[66]=M,t[67]=u,t[68]=m,t[69]=S,t[70]=G,t[71]=ne,t[72]=j,t[73]=c,t[74]=f,t[75]=P,t[76]=N,t[77]=X):X=t[77];let V;return t[78]!==F||t[79]!==X?(V=n.jsx(je,{children:n.jsx(Vt,{fallback:z,children:n.jsx(p.Suspense,{fallback:F,children:X})})}),t[78]=F,t[79]=X,t[80]=V):V=t[80],V}function bc(t){return t.key.trim()}export{Od as default};
@@ -1 +0,0 @@
1
- import{r as C,c as we,g as Be,j as t,ag as Fe,E as Te,u as Ee,x as Me,v as Re,K as ve,F as ze,B as re,w as pe}from"./index-DO8fUd54.js";import{b as Oe}from"./use-connection-BNGXvSqD.js";import{u as $e,a as Ae}from"./constants-B9t4Nuz_.js";import{I as le}from"./input-BM9bdg-F.js";import{I as ke}from"./integration-icon-BrOdBipR.js";import{C as We}from"./checkbox-D2IG7klY.js";import{b as Le,P as Ve,a as Ue}from"./popover-D1WG-emQ.js";import{i as Ge}from"./AlignLeft-D4ghzTQG.js";import{t as Ie}from"./ChevronDown-D0TXudCx.js";import{n as Ke}from"./ChevronUp-DXMXl76b.js";import{s as qe}from"./Hash02-CmJ0Y9N4.js";import{i as He}from"./Play-D72BHSXn.js";import{s as Qe}from"./Plus-Dto-8y6a.js";import{s as Je}from"./Trash01-DkXbOnbi.js";import{S as je,a as be,b as ye,c as Ne,d as w}from"./select-RxUFw6pZ.js";import{T as Ye,a as Se}from"./toggle-group-BrL6C5fG.js";import{a as Ze,V as Xe}from"./layout-ubFJ5DPd.js";import{S as et}from"./save-actions-MbSzUbWU.js";import{B as tt,a as st,b as Pe,d as rt,e as lt,c as at}from"./breadcrumb-pLMl4xjy.js";import"./use-collections-C8rLdQUN.js";import"./useMutation-CNVq636e.js";import"./Container-YdffBHg3.js";import"./Check-CuWDIJeM.js";import"./index-COM-PDLy.js";import"./index-B1uuY7UL.js";import"./use-local-storage-C3Bo802w.js";import"./useQuery-BeFLqBun.js";import"./tooltip-BLTgyg7W.js";import"./Save01-C2uk3LpG.js";import"./Loading01-WTkiPysv.js";import"./ChevronRight-UJRwW9xN.js";const _e=({size:l=24,color:e="currentColor",...s})=>C.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},C.createElement("path",{d:"M8 15v2m4-6v6m4-10v10m-8.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));_e.displayName="BarChartSquare02";function De(l){return{id:l.id,name:l.name,type:l.type,sourcePath:l.source.path,sourceFrom:l.source.from,aggregationFn:l.aggregation.fn,groupBy:l.aggregation.groupBy||"",interval:l.aggregation.interval||""}}function it(l){return{id:l.id,name:l.name,type:l.type,source:{path:l.sourcePath,from:l.sourceFrom},aggregation:{fn:l.aggregationFn,groupBy:l.type==="table"&&l.groupBy?l.groupBy:void 0,interval:l.type==="timeseries"&&l.interval?l.interval:void 0}}}const Ce={id:crypto.randomUUID(),name:"",type:"metric",sourcePath:"$.usage.total_tokens",sourceFrom:"output",aggregationFn:"sum",groupBy:"",interval:""};function nt(l){const e=we.c(36),{result:s,widget:o}=l;if(s.error){let i;return e[0]!==s.error?(i=t.jsx("div",{className:"text-sm text-destructive bg-destructive/10 rounded p-3",children:s.error}),e[0]=s.error,e[1]=i):i=e[1],i}if(o.type==="metric"){const i=s.value??0;let d;e[2]!==i?(d=i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:typeof i=="number"?i.toFixed(2):String(i),e[2]=i,e[3]=d):d=e[3];const c=d;let m;e[4]!==c?(m=t.jsx("div",{className:"text-3xl font-bold tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];const x=s.matchedRecords??0;let h;e[6]!==x?(h=t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[x," records matched"]}),e[6]=x,e[7]=h):h=e[7];let f;return e[8]!==m||e[9]!==h?(f=t.jsxs("div",{className:"text-center py-4",children:[m,h]}),e[8]=m,e[9]=h,e[10]=f):f=e[10],f}if(o.type==="table"&&s.groups){let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("thead",{className:"bg-muted/50 sticky top-0",children:t.jsxs("tr",{children:[t.jsx("th",{className:"text-left px-3 py-1.5 text-xs font-medium",children:"Key"}),t.jsx("th",{className:"text-right px-3 py-1.5 text-xs font-medium",children:"Value"})]})}),e[11]=i):i=e[11];let d;e[12]!==s.groups?(d=s.groups.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:2,className:"px-3 py-4 text-center text-muted-foreground text-xs",children:"No data"})}):s.groups.slice(0,10).map(ct),e[12]=s.groups,e[13]=d):d=e[13];let c;e[14]!==d?(c=t.jsxs("table",{className:"w-full text-sm",children:[i,t.jsx("tbody",{children:d})]}),e[14]=d,e[15]=c):c=e[15];let m;e[16]!==s.groups.length?(m=s.groups.length>10&&t.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["+",s.groups.length-10," more rows"]}),e[16]=s.groups.length,e[17]=m):m=e[17];let x;return e[18]!==c||e[19]!==m?(x=t.jsxs("div",{className:"max-h-[200px] overflow-auto",children:[c,m]}),e[18]=c,e[19]=m,e[20]=x):x=e[20],x}if(o.type==="timeseries"&&s.timeseries){let i;e[21]!==s.timeseries?(i=Math.max(...s.timeseries.map(ot),1),e[21]=s.timeseries,e[22]=i):i=e[22];const d=i;let c;if(e[23]!==d||e[24]!==s.timeseries){let f;e[26]!==d?(f=(u,N)=>t.jsx("div",{className:"flex-1 bg-primary/80 rounded-t",style:{height:`${u.value/d*100}%`,minHeight:u.value>0?"2px":"0px"},title:`${new Date(u.timestamp).toLocaleString()}: ${u.value}`},N),e[26]=d,e[27]=f):f=e[27],c=s.timeseries.slice(-24).map(f),e[23]=d,e[24]=s.timeseries,e[25]=c}else c=e[25];let m;e[28]!==c?(m=t.jsx("div",{className:"flex items-end gap-0.5 h-[80px]",children:c}),e[28]=c,e[29]=m):m=e[29];let x;e[30]!==s.timeseries.length?(x=t.jsxs("div",{className:"text-xs text-muted-foreground text-center mt-2",children:[s.timeseries.length," data points"]}),e[30]=s.timeseries.length,e[31]=x):x=e[31];let h;return e[32]!==m||e[33]!==x?(h=t.jsxs("div",{className:"py-2",children:[m,x]}),e[32]=m,e[33]=x,e[34]=h):h=e[34],h}let j;return e[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"No preview data"}),e[35]=j):j=e[35],j}function ot(l){return l.value}function ct(l,e){return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:l.key}),t.jsx("td",{className:"px-3 py-1.5 text-right tabular-nums text-xs",children:l.value.toLocaleString()})]},e)}function mt(l){const e=we.c(113),{widget:s,onChange:o,onRemove:j,canRemove:i,onMoveUp:d,onMoveDown:c,canMoveUp:m,canMoveDown:x,onPreview:h,previewResult:f,isPreviewing:u}=l,N=!m;let z;e[0]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Ke,{size:14}),e[0]=z):z=e[0];let D;e[1]!==d||e[2]!==N?(D=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:d,disabled:N,children:z}),e[1]=d,e[2]=N,e[3]=D):D=e[3];const ae=!x;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ie,{size:14}),e[4]=g):g=e[4];let p;e[5]!==c||e[6]!==ae?(p=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:c,disabled:ae,children:g}),e[5]=c,e[6]=ae,e[7]=p):p=e[7];let k;e[8]!==D||e[9]!==p?(k=t.jsxs("div",{className:"flex items-center gap-0.5",children:[D,p]}),e[8]=D,e[9]=p,e[10]=k):k=e[10];let S;e[11]!==s.type?(S=t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s.type}),e[11]=s.type,e[12]=S):S=e[12];let F;e[13]!==s.name?(F=s.name&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-sm font-medium",children:s.name})]}),e[13]=s.name,e[14]=F):F=e[14];let _;e[15]!==k||e[16]!==S||e[17]!==F?(_=t.jsxs("div",{className:"flex items-center gap-2",children:[k,S,F]}),e[15]=k,e[16]=S,e[17]=F,e[18]=_):_=e[18];let P;e[19]!==u?(P=u?t.jsx(Fe,{size:14,className:"animate-spin"}):t.jsx(He,{size:14}),e[19]=u,e[20]=P):P=e[20];let B;e[21]!==u||e[22]!==h||e[23]!==P?(B=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:h,disabled:u,children:P}),e[21]=u,e[22]=h,e[23]=P,e[24]=B):B=e[24];const O=!i,ie=i?"visible":"hidden";let T;e[25]!==ie?(T={visibility:ie},e[25]=ie,e[26]=T):T=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Je,{size:14}),e[27]=$):$=e[27];let E;e[28]!==j||e[29]!==O||e[30]!==T?(E=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:O,style:T,children:$}),e[28]=j,e[29]=O,e[30]=T,e[31]=E):E=e[31];let M;e[32]!==B||e[33]!==E?(M=t.jsxs("div",{className:"flex items-center gap-1",children:[B,E]}),e[32]=B,e[33]=E,e[34]=M):M=e[34];let R;e[35]!==_||e[36]!==M?(R=t.jsxs("div",{className:"flex items-center justify-between px-4 h-11 border-b bg-muted/30",children:[_,M]}),e[35]=_,e[36]=M,e[37]=R):R=e[37];let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Widget Name"}),e[38]=r):r=e[38];let a;e[39]!==o||e[40]!==s?(a=b=>o({...s,name:b.target.value}),e[39]=o,e[40]=s,e[41]=a):a=e[41];let n;e[42]!==a||e[43]!==s.name?(n=t.jsxs("div",{children:[r,t.jsx(le,{placeholder:"e.g., Total Tokens",value:s.name,onChange:a})]}),e[42]=a,e[43]=s.name,e[44]=n):n=e[44];let v;e[45]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Type"}),e[45]=v):v=e[45];let y;e[46]!==o||e[47]!==s?(y=b=>{b&&o({...s,type:b,groupBy:b==="table"?s.groupBy:"",interval:b==="timeseries"?s.interval||"1h":""})},e[46]=o,e[47]=s,e[48]=y):y=e[48];let I;e[49]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{value:"metric",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Metric",children:t.jsx(qe,{size:14})}),e[49]=I):I=e[49];let A;e[50]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Se,{value:"timeseries",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Timeseries",children:t.jsx(_e,{size:14})}),e[50]=A):A=e[50];let ne;e[51]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{value:"table",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Table",children:t.jsx(Ge,{size:14})}),e[51]=ne):ne=e[51];let W;e[52]!==y||e[53]!==s.type?(W=t.jsxs("div",{children:[v,t.jsxs(Ye,{type:"single",variant:"outline",size:"sm",value:s.type,onValueChange:y,className:"w-full h-10",children:[I,A,ne]})]}),e[52]=y,e[53]=s.type,e[54]=W):W=e[54];let L;e[55]!==n||e[56]!==W?(L=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n,W]}),e[55]=n,e[56]=W,e[57]=L):L=e[57];let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"JSONPath Expression"}),e[58]=oe):oe=e[58];let V;e[59]!==o||e[60]!==s?(V=b=>o({...s,sourcePath:b.target.value}),e[59]=o,e[60]=s,e[61]=V):V=e[61];let U;e[62]!==V||e[63]!==s.sourcePath?(U=t.jsx(le,{placeholder:"$.usage.total_tokens",value:s.sourcePath,onChange:V,className:"font-mono text-sm"}),e[62]=V,e[63]=s.sourcePath,e[64]=U):U=e[64];let G;e[65]!==s.sourceFrom?(G=t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path to extract from tool call ",s.sourceFrom]}),e[65]=s.sourceFrom,e[66]=G):G=e[66];let K;e[67]!==U||e[68]!==G?(K=t.jsxs("div",{children:[oe,U,G]}),e[67]=U,e[68]=G,e[69]=K):K=e[69];let ce;e[70]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Extract From"}),e[70]=ce):ce=e[70];let q;e[71]!==o||e[72]!==s?(q=b=>o({...s,sourceFrom:b}),e[71]=o,e[72]=s,e[73]=q):q=e[73];let me;e[74]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(be,{children:t.jsx(ye,{})}),e[74]=me):me=e[74];let de;e[75]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsxs(Ne,{children:[t.jsx(w,{value:"output",children:"Output"}),t.jsx(w,{value:"input",children:"Input"})]}),e[75]=de):de=e[75];let H;e[76]!==q||e[77]!==s.sourceFrom?(H=t.jsxs("div",{children:[ce,t.jsxs(je,{value:s.sourceFrom,onValueChange:q,children:[me,de]})]}),e[76]=q,e[77]=s.sourceFrom,e[78]=H):H=e[78];let ue;e[79]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Aggregation"}),e[79]=ue):ue=e[79];let Q;e[80]!==o||e[81]!==s?(Q=b=>o({...s,aggregationFn:b}),e[80]=o,e[81]=s,e[82]=Q):Q=e[82];let xe;e[83]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(be,{children:t.jsx(ye,{})}),e[83]=xe):xe=e[83];let he;e[84]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsxs(Ne,{children:[t.jsx(w,{value:"sum",children:"Sum"}),t.jsx(w,{value:"avg",children:"Average"}),t.jsx(w,{value:"min",children:"Minimum"}),t.jsx(w,{value:"max",children:"Maximum"}),t.jsx(w,{value:"count",children:"Count"}),t.jsx(w,{value:"last",children:"Last"})]}),e[84]=he):he=e[84];let J;e[85]!==Q||e[86]!==s.aggregationFn?(J=t.jsxs("div",{children:[ue,t.jsxs(je,{value:s.aggregationFn,onValueChange:Q,children:[xe,he]})]}),e[85]=Q,e[86]=s.aggregationFn,e[87]=J):J=e[87];let Y;e[88]!==H||e[89]!==J?(Y=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[H,J]}),e[88]=H,e[89]=J,e[90]=Y):Y=e[90];let Z;e[91]!==o||e[92]!==s?(Z=s.type==="table"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Group By (JSONPath)"}),t.jsx(le,{placeholder:"$.model",value:s.groupBy,onChange:b=>o({...s,groupBy:b.target.value}),className:"font-mono text-sm"})]}),e[91]=o,e[92]=s,e[93]=Z):Z=e[93];let X;e[94]!==o||e[95]!==s?(X=s.type==="timeseries"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Time Interval"}),t.jsxs(je,{value:s.interval||"1h",onValueChange:b=>o({...s,interval:b}),children:[t.jsx(be,{children:t.jsx(ye,{})}),t.jsxs(Ne,{children:[t.jsx(w,{value:"15m",children:"15 minutes"}),t.jsx(w,{value:"1h",children:"1 hour"}),t.jsx(w,{value:"1d",children:"1 day"})]})]})]}),e[94]=o,e[95]=s,e[96]=X):X=e[96];let ee;e[97]!==L||e[98]!==K||e[99]!==Y||e[100]!==Z||e[101]!==X?(ee=t.jsxs("div",{className:"space-y-4",children:[L,K,Y,Z,X]}),e[97]=L,e[98]=K,e[99]=Y,e[100]=Z,e[101]=X,e[102]=ee):ee=e[102];let fe;e[103]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("div",{className:"px-3 py-2 border-b text-xs font-medium text-muted-foreground",children:"Preview (last 24h)"}),e[103]=fe):fe=e[103];let te;e[104]!==f||e[105]!==s?(te=t.jsxs("div",{className:"border rounded-lg bg-muted/20 flex flex-col",children:[fe,t.jsx("div",{className:"p-3 flex-1 flex items-center justify-center",children:f?t.jsx(nt,{result:f,widget:s}):t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:'Click "Preview" to test your aggregation'})})]}),e[104]=f,e[105]=s,e[106]=te):te=e[106];let se;e[107]!==ee||e[108]!==te?(se=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[ee,te]})}),e[107]=ee,e[108]=te,e[109]=se):se=e[109];let ge;return e[110]!==R||e[111]!==se?(ge=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden",children:[R,se]}),e[110]=R,e[111]=se,e[112]=ge):ge=e[112],ge}function dt({dashboardId:l}){const{org:e,project:s,locator:o}=Ee(),j=Me(),i=$e({connectionId:Ae,orgId:e.id}),d=Oe(),{data:c}=Re({queryKey:ve.monitoringDashboardDetails(o,l),queryFn:async()=>{if(!i)throw new Error("MCP client not available");const r=await i.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:l}});return r.structuredContent??r}}),[m,x]=C.useState(c?.name??""),[h,f]=C.useState(c?.description??""),[u,N]=C.useState(c?.widgets?.map(De)??[{...Ce}]),[z,D]=C.useState(!1),[ae,g]=C.useState(!1),[p,k]=C.useState(c?.filters?.connectionIds??[]),[S,F]=C.useState(c?.filters?.toolNames?.[0]??""),[_,P]=C.useState({}),[B,O]=C.useState(new Set),ie=()=>{N([...u,{...Ce,id:crypto.randomUUID()}]),g(!0)},T=r=>{N(u.filter((a,n)=>n!==r)),g(!0)},$=(r,a)=>{const n=[...u];n[r]=a,N(n),g(!0),P(v=>{const y={...v};return delete y[a.id],y})},E=async r=>{if(i){O(a=>new Set(a).add(r.id));try{const a=new Date,n=new Date(a.getTime()-1440*60*1e3),v={};p.length>0&&(v.connectionIds=p),S.trim()&&(v.toolNames=[S.trim()]);const I=(await i.callTool({name:"MONITORING_WIDGET_PREVIEW",arguments:{widget:{type:r.type,source:{path:r.sourcePath,from:r.sourceFrom},aggregation:{fn:r.aggregationFn,groupBy:r.type==="table"&&r.groupBy?r.groupBy:void 0,interval:r.type==="timeseries"&&r.interval?r.interval:void 0},filter:Object.keys(v).length>0?v:void 0},timeRange:{startDate:n.toISOString(),endDate:a.toISOString()}}})).structuredContent;P(A=>({...A,[r.id]:{value:I?.value,groups:I?.groups,timeseries:I?.timeseries,matchedRecords:I?.matchedRecords??0}}))}catch(a){console.error("Preview failed:",a),P(n=>({...n,[r.id]:{error:"Preview failed. Check your JSONPath expression."}}))}finally{O(a=>{const n=new Set(a);return n.delete(r.id),n})}}},M=async()=>{if(i){if(!m.trim()){pe.error("Please enter a dashboard name");return}if(u.some(r=>!r.name.trim())){pe.error("Please enter a name for all widgets");return}D(!0);try{const r={};p.length>0&&(r.connectionIds=p),S.trim()&&(r.toolNames=[S.trim()]),await i.callTool({name:"MONITORING_DASHBOARD_UPDATE",arguments:{id:l,name:m.trim(),description:h.trim()||null,filters:Object.keys(r).length>0?r:null,widgets:u.map(it)}}),pe.success("Dashboard saved"),g(!1),j.invalidateQueries({queryKey:ve.monitoringDashboards(o)}),j.invalidateQueries({queryKey:ve.monitoringDashboardDetails(o,l)})}catch(r){pe.error("Failed to save dashboard"),console.error(r)}finally{D(!1)}}};if(!c)return t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"});const R=t.jsx(tt,{children:t.jsxs(st,{children:[t.jsx(Pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(ze,{to:"/$org/$project/monitoring",params:{org:e.slug,project:s.slug},search:{tab:"dashboards"},children:"Monitoring"})})}),t.jsx(lt,{}),t.jsx(Pe,{children:t.jsxs(at,{children:["Edit ",c.name]})})]})});return t.jsxs(Ze,{breadcrumb:R,children:[t.jsx(Xe,{children:t.jsx(et,{onSave:M,onUndo:()=>{x(c?.name??""),f(c?.description??""),N(c?.widgets?.map(De)??[{...Ce}]),k(c?.filters?.connectionIds??[]),F(c?.filters?.toolNames?.[0]??""),g(!1)},isDirty:ae,isSaving:z})}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Dashboard Name"}),t.jsx(le,{placeholder:"e.g., LLM Usage Overview",value:m,onChange:r=>{x(r.target.value),g(!0)}})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Description"}),t.jsx(le,{placeholder:"What does this dashboard show?",value:h,onChange:r=>{f(r.target.value),g(!0)}})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 bg-muted/30",children:[t.jsxs("h2",{className:"text-sm font-medium mb-3",children:["Dashboard Filters",t.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(applied to all widgets)"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Servers"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsxs(re,{variant:"outline",className:"w-full justify-between font-normal",children:[t.jsx("span",{className:"flex items-center gap-2 truncate",children:p.length===0?t.jsx("span",{className:"text-muted-foreground",children:"All servers"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex items-center -space-x-1",children:p.slice(0,3).map(r=>{const a=(d??[]).find(n=>n.id===r);return a?t.jsx(ke,{icon:a.icon,name:a.title||a.id,size:"xs"},r):null})}),t.jsxs("span",{children:[p.length," server",p.length!==1?"s":""]})]})}),t.jsx(Ie,{size:14,className:"text-muted-foreground shrink-0"})]})}),t.jsxs(Ue,{align:"start",className:"w-72 p-1",children:[t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:(d??[]).map(r=>{const a=p.includes(r.id);return t.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",onClick:()=>{k(n=>a?n.filter(v=>v!==r.id):[...n,r.id]),g(!0)},children:[t.jsx(We,{checked:a}),t.jsx(ke,{icon:r.icon,name:r.title||r.id,size:"xs"}),t.jsx("span",{className:"truncate",children:r.title||r.id})]},r.id)})}),p.length>0&&t.jsx("div",{className:"border-t p-1",children:t.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",onClick:()=>{k([]),g(!0)},children:"Clear selection"})})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Tool Name Filter"}),t.jsx(le,{placeholder:"e.g., openai_chat",value:S,onChange:r=>{F(r.target.value),g(!0)},className:"font-mono text-sm"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Filter to specific tool names (partial match)"})]})]})]}),t.jsxs("div",{className:"mt-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Widgets"}),t.jsxs(re,{variant:"outline",size:"sm",onClick:ie,children:[t.jsx(Qe,{size:14,className:"mr-1.5"}),"Add Widget"]})]}),t.jsx("div",{className:"space-y-4",children:u.map((r,a)=>t.jsx(mt,{widget:r,onChange:n=>$(a,n),onRemove:()=>T(a),canRemove:u.length>1,onMoveUp:()=>{const n=[...u],v=n[a-1],y=n[a];n[a-1]=y,n[a]=v,N(n),g(!0)},onMoveDown:()=>{const n=[...u],v=n[a],y=n[a+1];n[a]=y,n[a+1]=v,N(n),g(!0)},canMoveUp:a>0,canMoveDown:a<u.length-1,onPreview:()=>E(r),previewResult:_[r.id]??null,isPreviewing:B.has(r.id)},r.id))})]})]})})]})}function Vt(){const l=we.c(5);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},l[0]=e):e=l[0];const{dashboardId:s}=Be(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard editor"}),l[1]=o):o=l[1];let j;l[2]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Fe,{size:24,className:"animate-spin text-muted-foreground"})}),l[2]=j):j=l[2];let i;return l[3]!==s?(i=t.jsx(Te,{fallback:o,children:t.jsx(C.Suspense,{fallback:j,children:t.jsx(dt,{dashboardId:s})})}),l[3]=s,l[4]=i):i=l[4],i}export{Vt as default};
@@ -1 +0,0 @@
1
- import{r as v,c as E,bh as re,e as ae,d as ne,g as ie,u as Z,x as W,w as C,K as b,j as s,z as oe,B as V,E as le}from"./index-DO8fUd54.js";import{u as ce}from"./use-local-storage-C3Bo802w.js";import{u as Y}from"./useMutation-CNVq636e.js";import{i as de}from"./AlertCircle-5ZbLDi3s.js";import{i as me}from"./EyeOff-D8njwIM7.js";import{s as ue}from"./Eye-DDwMVcxZ.js";import{i as fe}from"./Key01-IptFTL_3.js";import{s as he}from"./Trash01-DkXbOnbi.js";import{C as xe}from"./card-B4dTtsmd.js";import{I as G}from"./input-BM9bdg-F.js";import{S as pe}from"./skeleton-CU7LuZGk.js";import{A as ge}from"./avatar-ChRCLY4k.js";import{b as X,P as J,a as ee}from"./popover-D1WG-emQ.js";import{a as ve,b as ye}from"./use-llm-IG8InXvX.js";import{u as te,a as se}from"./constants-B9t4Nuz_.js";import{f as je}from"./formatDistanceToNow-Cb2QZZJn.js";const Ce=({size:t=24,color:e="currentColor",...i})=>v.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},v.createElement("path",{d:"M9 2v2m6-2v2M9 20v2m6-2v2m5-13h2m-2 5h2M2 9h2m-2 5h2m4.8 6h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 17.72 20 16.88 20 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 4 16.88 4 15.2 4H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 6.28 4 7.12 4 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 20 7.12 20 8.8 20Zm1.8-5h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 14.24 15 13.96 15 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 9 13.96 9 13.4 9h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 9.76 9 10.04 9 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 15 10.04 15 10.6 15Z"}));Ce.displayName="CpuChip01";const _e={devMode:!1,toolApprovalLevel:"none",enableNotifications:typeof Notification<"u",experimentalAutomations:!1};function Ze(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=re.preferences(),t[0]=e):e=t[0],ce(e,Ae)}function Ae(t){return{..._e,...t}}const Se=new Set(["account.profile","account.preferences","org.general","org.plugins","org.ai-providers","org.billing"]);function Ne(t){return t?Se.has(t):!1}function We(){const t=E.c(17),e=ae();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={strict:!1},t[0]=i):i=t[0];const o=ne(i);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[1]=r):r=t[1];const{org:a,project:l}=ie(r);let c;t[2]!==o.settings?(c=Ne(o.settings)?o.settings:void 0,t[2]=o.settings,t[3]=c):c=t[3];const d=c,u=!!d;let f;t[4]!==e||t[5]!==a||t[6]!==l?(f=g=>{!a||!l||e({to:"/$org/$project",params:{org:a,project:l},search:{settings:g}})},t[4]=e,t[5]=a,t[6]=l,t[7]=f):f=t[7];const x=f;let m;t[8]!==e||t[9]!==a||t[10]!==l?(m=()=>{!a||!l||e({to:"/$org/$project",params:{org:a,project:l},search:{}})},t[8]=e,t[9]=a,t[10]=l,t[11]=m):m=t[11];const N=m,h=d??"account.preferences";let y;return t[12]!==N||t[13]!==u||t[14]!==x||t[15]!==h?(y={isOpen:u,activeSection:h,open:x,close:N},t[12]=N,t[13]=u,t[14]=x,t[15]=h,t[16]=y):y=t[16],y}function be(t){const e=E.c(3),{error:i}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(de,{size:16}),e[0]=o):o=e[0];let r;return e[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[o,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function Ee(t){const e=E.c(9),{keys:i,onDelete:o,isDeleting:r}=t;let a;if(e[0]!==r||e[1]!==i||e[2]!==o){let c;e[4]!==r||e[5]!==o?(c=d=>s.jsxs("div",{className:"flex items-center justify-between p-2 rounded-md bg-muted/50 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[s.jsx(fe,{size:14,className:"text-muted-foreground shrink-0"}),s.jsx("span",{className:"font-medium truncate",children:d.label}),s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:["added ",je(new Date(d.createdAt))," ago"]})]}),s.jsx("div",{onClick:Pe,children:s.jsxs(X,{children:[s.jsx(J,{asChild:!0,children:s.jsx(V,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",disabled:r,children:s.jsx(he,{size:14})})}),s.jsx(ee,{className:"w-auto p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-xs font-medium",children:"Delete this key?"}),s.jsx("div",{className:"flex gap-2",children:s.jsx(V,{variant:"destructive",size:"xs",onClick:()=>o(d.id),disabled:r,children:"Delete"})})]})})]})})]},d.id),e[4]=r,e[5]=o,e[6]=c):c=e[6],a=i.map(c),e[0]=r,e[1]=i,e[2]=o,e[3]=a}else a=e[3];let l;return e[7]!==a?(l=s.jsx("div",{className:"flex flex-col gap-2 mt-4",children:a}),e[7]=a,e[8]=l):l=e[8],l}function Pe(t){return t.stopPropagation()}function we(t){const e=E.c(52),{providerId:i,onCancel:o,onSuccess:r}=t,{locator:a,org:l}=Z();let c;e[0]!==l.id?(c={connectionId:se,orgId:l.id},e[0]=l.id,e[1]=c):c=e[1];const d=te(c),u=W(),[f,x]=v.useState(""),[m,N]=v.useState(""),[h,y]=v.useState(!1);let g;e[2]!==m||e[3]!==d||e[4]!==f||e[5]!==i?(g=async()=>{await d.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:i,label:f||"Personal key",apiKey:m}})},e[2]=m,e[3]=d,e[4]=f,e[5]=i,e[6]=g):g=e[6];let _;e[7]!==a||e[8]!==r||e[9]!==u?(_=()=>{u.invalidateQueries({queryKey:b.aiProviderKeys(a)}),u.invalidateQueries({queryKey:b.aiProviders(a)}),C.success("Key saved successfully"),r()},e[7]=a,e[8]=r,e[9]=u,e[10]=_):_=e[10];let P;e[11]!==g||e[12]!==_?(P={mutationFn:g,onSuccess:_,onError:Ie},e[11]=g,e[12]=_,e[13]=P):P=e[13];const{mutate:F,isPending:n,error:A}=Y(P);let p;e[14]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[14]=p):p=e[14];let S;e[15]===Symbol.for("react.memo_cache_sentinel")?(S=B=>x(B.target.value),e[15]=S):S=e[15];let j;e[16]!==f?(j=s.jsxs("div",{className:"space-y-1",children:[p,s.jsx(G,{placeholder:"e.g. Personal key",value:f,onChange:S,className:"h-8 text-sm"})]}),e[16]=f,e[17]=j):j=e[17];let z;e[18]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[18]=z):z=e[18];const Q=h?"text":"password";let M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M=B=>N(B.target.value),e[19]=M):M=e[19];let w;e[20]!==m||e[21]!==Q?(w=s.jsx(G,{type:Q,placeholder:"sk-...",value:m,onChange:M,className:"h-8 text-sm pr-8"}),e[20]=m,e[21]=Q,e[22]=w):w=e[22];let I;e[23]!==h?(I=()=>y(!h),e[23]=h,e[24]=I):I=e[24];let k;e[25]!==h?(k=h?s.jsx(me,{size:14}):s.jsx(ue,{size:14}),e[25]=h,e[26]=k):k=e[26];let K;e[27]!==I||e[28]!==k?(K=s.jsx("button",{type:"button",onClick:I,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:k}),e[27]=I,e[28]=k,e[29]=K):K=e[29];let O;e[30]!==w||e[31]!==K?(O=s.jsxs("div",{className:"space-y-1",children:[z,s.jsxs("div",{className:"relative",children:[w,K]})]}),e[30]=w,e[31]=K,e[32]=O):O=e[32];let T;e[33]!==A?(T=A&&s.jsx("p",{className:"text-xs text-destructive",children:A.message}),e[33]=A,e[34]=T):T=e[34];let $;e[35]!==n||e[36]!==o?($=s.jsx(V,{variant:"ghost",size:"sm",onClick:o,disabled:n,children:"Cancel"}),e[35]=n,e[36]=o,e[37]=$):$=e[37];let L;e[38]!==F?(L=()=>F(),e[38]=F,e[39]=L):L=e[39];const U=!m||n,H=n?"Saving...":"Save Key";let R;e[40]!==L||e[41]!==U||e[42]!==H?(R=s.jsx(V,{size:"sm",onClick:L,disabled:U,children:H}),e[40]=L,e[41]=U,e[42]=H,e[43]=R):R=e[43];let D;e[44]!==$||e[45]!==R?(D=s.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[$,R]}),e[44]=$,e[45]=R,e[46]=D):D=e[46];let q;return e[47]!==O||e[48]!==T||e[49]!==D||e[50]!==j?(q=s.jsxs("div",{className:"space-y-3",children:[j,O,T,D]}),e[47]=O,e[48]=T,e[49]=D,e[50]=j,e[51]=q):q=e[51],q}function Ie(t){C.error(`Failed to save key: ${t.message}`)}function ke({provider:t,keys:e}){const{locator:i,org:o}=Z(),r=te({connectionId:se,orgId:o.id}),a=W(),[l,c]=v.useState(!1),[d,u]=v.useState(!1),[f,x]=v.useState(null),m=e.length>0,{mutate:N,isPending:h}=Y({mutationFn:async n=>(await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:n}}),n),onSuccess:n=>{a.invalidateQueries({queryKey:b.aiProviderKeys(i)}),a.invalidateQueries({queryKey:b.aiProviders(i)}),a.invalidateQueries({queryKey:b.aiProviderModels(i,n)}),C.success("Key deleted")},onError:n=>{C.error(`Failed to delete key: ${n.message}`)}}),{mutate:y}=Y({mutationFn:async({code:n,stateToken:A})=>{const p=await r.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:t.id,code:n,stateToken:A,label:"Connected via OAuth"}});if(p?.isError){const S=p.content?.[0]?.text??"OAuth exchange failed";throw new Error(S)}},onSuccess:()=>{a.invalidateQueries({queryKey:b.aiProviderKeys(i)}),a.invalidateQueries({queryKey:b.aiProviders(i)}),C.success(`${t.name} connected successfully`),u(!1),x(null)},onError:n=>{C.error(`OAuth connection failed: ${n.message}`),u(!1),x(null)}});v.useEffect(()=>{if(!d||!f)return;const n=p=>{if(p.origin===window.location.origin&&p.data?.type==="AI_PROVIDER_OAUTH_CALLBACK"){const{code:S,stateToken:j}=p.data;j===f?y({code:S,stateToken:j}):(console.error("State token mismatch"),C.error("Security check failed: State token mismatch"),u(!1),x(null))}};window.addEventListener("message",n);const A=setTimeout(()=>{d&&(u(!1),x(null),C.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",n),clearTimeout(A)}},[d,f,y]);const g=t.supportedMethods.includes("oauth-pkce"),_=t.supportedMethods.includes("api-key"),P=()=>{l||d||(g?F():_&&c(!0))},F=async()=>{try{u(!0);const n=await r.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:t.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(n.structuredContent)x(n.structuredContent.stateToken),window.open(n.structuredContent.url,"AiProviderOAuth","width=600,height=700");else throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL")}catch(n){u(!1),C.error(`Failed to start OAuth: ${n instanceof Error?n.message:String(n)}`)}};return s.jsxs(X,{open:l,onOpenChange:n=>{n||c(!1)},children:[s.jsx(J,{asChild:!0,children:s.jsxs(xe,{className:oe("p-4 flex flex-col gap-3 transition-colors relative",m&&"border-primary/20",!d&&"cursor-pointer hover:bg-muted/30",d&&"cursor-wait"),onClick:P,children:[m&&s.jsx("div",{className:"absolute top-4 right-4 w-2 h-2 rounded-full bg-green-500"}),s.jsx("div",{className:"flex items-start justify-between",children:s.jsxs("div",{className:"flex items-center gap-3",children:[t.logo?s.jsx("img",{src:t.logo,alt:t.name,className:"size-8 rounded-md object-contain"}):s.jsx(ge,{fallback:t.name.charAt(0),className:"size-8 bg-primary/10 text-primary"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-base",children:t.name}),s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-1",children:d?"Authorizing...":t.description})]})]})}),m&&s.jsxs("div",{className:"mt-1",children:[s.jsxs("p",{className:"text-xs font-medium text-muted-foreground",children:[e.length," key",e.length!==1?"s":""," configured"]}),s.jsx(Ee,{keys:e,onDelete:N,isDeleting:h})]})]})}),s.jsx(ee,{className:"w-72 p-4",align:"start",onInteractOutside:()=>c(!1),children:s.jsx(we,{providerId:t.id,onCancel:()=>c(!1),onSuccess:()=>c(!1)})})]})}function Ke(){const t=E.c(6),e=ve(),i=ye();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-medium",children:"AI Providers"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Set up AI model providers. Keys are stored encrypted in the vault."})]}),t[0]=o):o=t[0];let r;t[1]!==e?.providers||t[2]!==i?(r=e?.providers?.map(l=>s.jsx(ke,{provider:l,keys:i.filter(c=>c.providerId===l.id)},l.id)),t[1]=e?.providers,t[2]=i,t[3]=r):r=t[3];let a;return t[4]!==r?(a=s.jsxs("div",{className:"space-y-6",children:[o,s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 [&>*:first-child]:lg:col-span-2",children:r})]}),t[4]=r,t[5]=a):a=t[5],a}function Xe(){const t=E.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(le,{fallback:Oe,children:s.jsx(v.Suspense,{fallback:s.jsx(pe,{className:"h-64 w-full"}),children:s.jsx(Ke,{})})}),t[0]=e):e=t[0],e}function Oe(t){const{error:e}=t;return s.jsx(be,{error:e??new Error("Failed to load AI providers")})}export{Xe as O,ke as P,We as a,Ce as i,Ze as u};
@@ -1 +0,0 @@
1
- import{r as g,c as b,j as s,z as L,E as Z,u as G,f as K,B as U}from"./index-DO8fUd54.js";import{C as h}from"./task-status-DJB3YbbO.js";import{E as J,C as Q}from"./editable-task-title-COr46zxY.js";import{a as X}from"./tasks-panel-XTVNkW83.js";import{u as B,a as Y}from"./context-CiizXS06.js";import{V as ee}from"./select-virtual-mcp-DU8qBWLM.js";import{I as O}from"./integration-icon-BrOdBipR.js";import{P as te,a as se,b as ie}from"./popover-D1WG-emQ.js";import{S as H}from"./skeleton-CU7LuZGk.js";import{i as re,d as le}from"./constants-B9t4Nuz_.js";import{b as oe}from"./use-virtual-mcp-DoDJBE5n.js";import{i as ne}from"./ChevronRight-UJRwW9xN.js";import{t as F}from"./Users03-BXwEsNFj.js";import{P}from"./index-B1uuY7UL.js";import{R as A,a as T,b as ae}from"./resizable-CqLBllsV.js";import"./spinner-CpOteR2a.js";import"./tooltip-BLTgyg7W.js";import"./index-COM-PDLy.js";import"./use-mcp-prompts-D_02f3uO.js";import"./useQuery-BeFLqBun.js";import"./dialog-CTFHRhvl.js";import"./X-CNbskBah.js";import"./form-DPPO-3Tw.js";import"./label-CnT8WAQY.js";import"./input-BM9bdg-F.js";import"./index-B3fUA0k0.js";import"./usage-B8rgFVXq.js";import"./ArrowUp-tKKJvEkq.js";import"./ChevronDown-D0TXudCx.js";import"./Edit01-Dpq6F4lk.js";import"./Lock01-DqO9uSP7.js";import"./XCircle-DvUvQRq1.js";import"./AlertCircle-5ZbLDi3s.js";import"./select-RxUFw6pZ.js";import"./ChevronUp-DXMXl76b.js";import"./Check-CuWDIJeM.js";import"./org-ai-providers-Cu3Y8hG7.js";import"./use-local-storage-C3Bo802w.js";import"./useMutation-CNVq636e.js";import"./EyeOff-D8njwIM7.js";import"./Eye-DDwMVcxZ.js";import"./Key01-IptFTL_3.js";import"./Trash01-DkXbOnbi.js";import"./card-B4dTtsmd.js";import"./avatar-ChRCLY4k.js";import"./use-llm-IG8InXvX.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowLeft-D0Lalw4x.js";import"./use-copy-DPJ8nWWs.js";import"./tabs-XMAGaWgq.js";import"./badge-C4uZcq7J.js";import"./collapsible-ttq3VbhQ.js";import"./index-BqlWbrG0.js";import"./Code01-DZzuHJh9.js";import"./checkbox-D2IG7klY.js";import"./AlignLeft-D4ghzTQG.js";import"./Image01-DBWShOGl.js";import"./RefreshCcw01-DckyCUMd.js";import"./SearchMd-Kap2MdR9.js";import"./Settings01-CYUXeHtK.js";import"./ai-providers-logos-W57Qm-EN.js";import"./use-mcp-resources-BNoK6dDS.js";import"./Copy01-CPHBT83w.js";import"./marked.esm-BaswSlok.js";import"./markdown-ZobUYaB1.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CLfglV2_.js";import"./types-BPYct9bF.js";import"./Globe02-Cn3qFriL.js";import"./LayersTwo01-B5fVqAUB.js";import"./XClose-B0FgAxIQ.js";import"./Clock-DKQ7EGj-.js";import"./use-collections-C8rLdQUN.js";import"./useSuspenseInfiniteQuery-CdVyznmA.js";import"./infiniteQueryObserver-x0ce-nmx.js";import"./CheckCircle-wz1RfkCA.js";import"./Loading01-WTkiPysv.js";import"./ChevronLeft-BZsszCLQ.js";import"./collection-search-Mtc1qP5K.js";import"./user-6WV0RuBu.js";import"./format-time-CMKyl-GC.js";import"./Plus-Dto-8y6a.js";import"./dropdown-menu-Cp0O2jCN.js";import"./decopilot-events-Brt4gAR6.js";import"./use-create-virtual-mcp-BfS4KaKE.js";import"./Container-YdffBHg3.js";const W=({size:e=24,color:t="currentColor",...i})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},g.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));W.displayName="LayoutRight";const q=({size:e=24,color:t="currentColor",...i})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},g.createElement("path",{d:"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2.002 2.002 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152V22Z"}));q.displayName="MessageChatSquare";function ce(e){const t=b.c(15),{agent:i}=e,{setVirtualMcpId:u}=B();let c;t[0]!==i.id||t[1]!==u?(c=()=>{u(i.id)},t[0]=i.id,t[1]=u,t[2]=c):c=t[2];const l=c;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=L("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const p=`Select agent ${i.title}`;let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(F,{size:20}),t[4]=o):o=t[4];let n;t[5]!==i.icon||t[6]!==i.title?(n=s.jsx(O,{icon:i.icon,name:i.title,fallbackIcon:o}),t[5]=i.icon,t[6]=i.title,t[7]=n):n=t[7];let r;t[8]!==i.title?(r=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=r):r=t[9];let a;return t[10]!==l||t[11]!==p||t[12]!==n||t[13]!==r?(a=s.jsxs("button",{type:"button",onClick:l,className:m,"aria-label":p,children:[n,r]}),t[10]=l,t[11]=p,t[12]=n,t[13]=r,t[14]=a):a=t[14],a}function me(e){const t=b.c(14),{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:c}=e,[l,m]=g.useState(!1),p=g.useRef(null);let o,n;t[0]!==l?(o=()=>{l&&setTimeout(()=>{p.current?.focus()},0)},n=[l],t[0]=l,t[1]=o,t[2]=n):(o=t[1],n=t[2]),g.useEffect(o,n);let r;t[3]!==c?(r=N=>{c(N),m(!1)},t[3]=c,t[4]=r):r=t[4];const a=r;let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=L("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=d):d=t[5];let f;t[6]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(te,{asChild:!0,children:s.jsxs("button",{type:"button",className:d,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(ne,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=f):f=t[6];let x;t[7]!==a||t[8]!==u||t[9]!==i?(x=s.jsx(se,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(ee,{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:a,searchInputRef:p})}),t[7]=a,t[8]=u,t[9]=i,t[10]=x):x=t[10];let V;return t[11]!==l||t[12]!==x?(V=s.jsxs(ie,{open:l,onOpenChange:m,children:[f,x]}),t[11]=l,t[12]=x,t[13]=V):V=t[13],V}function de(){const e=b.c(20),t=oe(),{selectedVirtualMcp:i,setVirtualMcpId:u}=B();let c,l,m,p,o,n;if(e[0]!==t){o=Symbol.for("react.early_return_sentinel");e:{const x=t.filter(ue).slice(0,6);if(x.length===0){o=null;break e}n=t.map(fe),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=p):p=e[7],c="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",l=x.map(pe)}e[0]=t,e[1]=c,e[2]=l,e[3]=m,e[4]=p,e[5]=o,e[6]=n}else c=e[1],l=e[2],m=e[3],p=e[4],o=e[5],n=e[6];if(o!==Symbol.for("react.early_return_sentinel"))return o;const r=i?.id??null;let a;e[8]!==u||e[9]!==r||e[10]!==n?(a=s.jsx(me,{virtualMcps:n,selectedVirtualMcpId:r,onVirtualMcpChange:u}),e[8]=u,e[9]=r,e[10]=n,e[11]=a):a=e[11];let d;e[12]!==c||e[13]!==l||e[14]!==a?(d=s.jsxs("div",{className:c,children:[l,a]}),e[12]=c,e[13]=l,e[14]=a,e[15]=d):d=e[15];let f;return e[16]!==m||e[17]!==p||e[18]!==d?(f=s.jsxs("div",{className:m,children:[p,d]}),e[16]=m,e[17]=p,e[18]=d,e[19]=f):f=e[19],f}function pe(e){return s.jsx(ce,{agent:e},e.id??"default")}function fe(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function ue(e){return e.id!==null&&!re(e.id)}function xe(){const e=b.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(H,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(he)})]}),e[1]=i):i=e[1],i}function he(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(H,{className:"size-6 rounded-md shrink-0"}),s.jsx(H,{className:"h-4 w-full"})]},t)}function ge(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(g.Suspense,{fallback:s.jsx(xe,{}),children:s.jsx(de,{})}),e[0]=t):t=e[0],t}function je(){const e=b.c(39),{org:t}=G(),{data:i}=K.useSession(),{allModelsConnections:u,isChatEmpty:c,activeTaskId:l,tasks:m,selectedVirtualMcp:p}=Y();let o;if(e[0]!==l||e[1]!==m){let j;e[3]!==l?(j=D=>D.id===l,e[3]=l,e[4]=j):j=e[4],o=m.find(j),e[0]=l,e[1]=m,e[2]=o}else o=e[2];const n=o,[r,a]=g.useState(!1);let d;e[5]!==i?.user?.name?(d=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=d):d=e[6];const f=d;let x;e[7]!==t.id?(x=le(t.id),e[7]=t.id,e[8]=x):x=e[8];const N=p??x;if(u.length===0){let j;return e[9]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"flex flex-col h-full bg-background items-center justify-center",children:s.jsx(h.NoLlmBindingEmptyState,{})}),e[9]=j):j=e[9],j}let E,I;e[10]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(A,{defaultSize:20,minSize:10,id:"tasks",order:1,children:s.jsx(X,{})}),I=s.jsx(T,{className:"bg-border/30"}),e[10]=E,e[11]=I):(E=e[10],I=e[11]);const $=r?50:80;let C;e[12]!==n?(C=n?.title&&s.jsx(J,{taskId:n.id,text:n.title,className:"text-sm font-medium text-foreground"}),e[12]=n,e[13]=C):C=e[13];let v;e[14]!==C?(v=s.jsx(P.Header.Left,{className:"gap-2",children:C}),e[14]=C,e[15]=v):v=e[15];let y;e[16]!==c||e[17]!==r?(y=!c&&s.jsx("button",{type:"button",onClick:()=>a(be),className:L("flex size-7 items-center justify-center rounded-md border border-input hover:bg-accent transition-colors",r&&"bg-accent"),title:"Toggle context panel",children:s.jsx(W,{size:14,className:"text-muted-foreground"})}),e[16]=c,e[17]=r,e[18]=y):y=e[18];let S;e[19]!==y?(S=s.jsx(P.Header.Right,{className:"gap-1",children:y}),e[19]=y,e[20]=S):S=e[20];let k;e[21]!==v||e[22]!==S?(k=s.jsxs(P.Header,{className:"flex-none z-10 bg-background",children:[v,S]}),e[21]=v,e[22]=S,e[23]=k):k=e[23];let _;e[24]!==N||e[25]!==c||e[26]!==f?(_=c?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(O,{icon:N.icon,name:N.title,size:"md",fallbackIcon:s.jsx(F,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsx("div",{className:"text-center mb-8",children:s.jsxs("p",{className:"text-xl font-medium text-foreground",children:["What's on your mind, ",f,"?"]})}),s.jsx("div",{className:"w-full",children:s.jsx(h.Input,{})}),s.jsx(h.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx(ge,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(h.Main,{children:s.jsx(h.Messages,{})}),s.jsx(h.Footer,{children:s.jsx(h.Input,{onOpenContextPanel:()=>a(!0)})})]}),e[24]=N,e[25]=c,e[26]=f,e[27]=_):_=e[27];let w;e[28]!==k||e[29]!==_?(w=s.jsxs(h,{className:"h-full bg-background",children:[k,_]}),e[28]=k,e[29]=_,e[30]=w):w=e[30];let z;e[31]!==w||e[32]!==$?(z=s.jsx(A,{defaultSize:$,minSize:30,id:"main",order:2,children:w}),e[31]=w,e[32]=$,e[33]=z):z=e[33];let M;e[34]!==r?(M=r&&s.jsxs(s.Fragment,{children:[s.jsx(T,{className:"bg-border/30"}),s.jsx(A,{defaultSize:30,minSize:15,id:"context",order:3,children:s.jsx(Q,{onClose:()=>a(!1)})})]}),e[34]=r,e[35]=M):M=e[35];let R;return e[36]!==z||e[37]!==M?(R=s.jsxs(ae,{direction:"horizontal",className:"size-full",children:[E,I,z,M]}),e[36]=z,e[37]=M,e[38]=R):R=e[38],R}function be(e){return!e}function Ne(e){const t=b.c(14),{error:i,onRetry:u}=e,c=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(P.Header,{className:"flex-none",children:[s.jsx(P.Header.Left,{className:"gap-2"}),s.jsx(P.Header.Right,{className:"gap-1"})]}),t[0]=l):l=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(q,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const p=c?"Unable to load models":"Something went wrong";let o;t[2]!==p?(o=s.jsx("h3",{className:"text-lg font-medium",children:p}),t[2]=p,t[3]=o):o=t[3];const n=c?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let r;t[4]!==n?(r=s.jsx("p",{className:"text-sm text-muted-foreground",children:n}),t[4]=n,t[5]=r):r=t[5];let a;t[6]!==o||t[7]!==r?(a=s.jsxs("div",{className:"space-y-2",children:[o,r]}),t[6]=o,t[7]=r,t[8]=a):a=t[8];let d;t[9]!==u?(d=s.jsx(U,{variant:"outline",onClick:u,children:"Try again"}),t[9]=u,t[10]=d):d=t[10];let f;return t[11]!==a||t[12]!==d?(f=s.jsxs(h,{children:[l,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,d]})})]}),t[11]=a,t[12]=d,t[13]=f):f=t[13],f}function ts(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Z,{fallback:Ce,children:s.jsx(g.Suspense,{fallback:s.jsx(h.Skeleton,{}),children:s.jsx(je,{})})}),e[0]=t):t=e[0],t}function Ce(e){const{error:t,resetError:i}=e;return s.jsx(Ne,{error:t,onRetry:i})}export{ts as default};
@@ -1 +0,0 @@
1
- import{c as X,r as H,u as ne,K as me,c2 as ke,j as s,z as de,B as te,e as xe,af as ge,ag as pe,O as he,f as ze,at as $e,c3 as ae,bh as Fe,E as Le,au as Ee}from"./index-DO8fUd54.js";import{P as se}from"./index-B1uuY7UL.js";import{B as Oe,a as _e,b as Ke,c as Ae}from"./breadcrumb-pLMl4xjy.js";import{i as je}from"./FilterLines-aqS8nu95.js";import{n as ye}from"./Inbox01-CJphqD3y.js";import{i as le}from"./Loading01-WTkiPysv.js";import{i as ve}from"./SearchMd-Kap2MdR9.js";import{u as be}from"./useQuery-BeFLqBun.js";import{u as Me}from"./useInfiniteQuery-BBGNgnIc.js";import{a as Be,f as De,b as Ge}from"./registry-utils-oSXyNc33.js";import{u as Ne,W as We,a as Ve,e as qe,b as Ue}from"./constants-B9t4Nuz_.js";import{u as He,a as Ce,b as Je}from"./use-connection-BNGXvSqD.js";import{s as Qe}from"./slugify-CEUa2lfQ.js";import{C as Ye}from"./collection-search-Mtc1qP5K.js";import{M as ce}from"./mcp-server-card-AL30DdJr.js";import{I as Ze}from"./input-BM9bdg-F.js";import{b as Se,P as we,a as Ie}from"./popover-D1WG-emQ.js";import{i as Te}from"./Check-CuWDIJeM.js";import{t as Re}from"./ChevronDown-D0TXudCx.js";import{s as re}from"./XClose-B0FgAxIQ.js";import{s as Xe}from"./Plus-Dto-8y6a.js";import{E as et}from"./empty-state-SBIKV11G.js";import{u as tt}from"./use-binding-DSWv53zN.js";import{u as st}from"./use-local-storage-C3Bo802w.js";import"./tooltip-BLTgyg7W.js";import"./index-COM-PDLy.js";import"./ChevronRight-UJRwW9xN.js";import"./infiniteQueryObserver-x0ce-nmx.js";import"./use-collections-C8rLdQUN.js";import"./useMutation-CNVq636e.js";import"./CheckVerified02-cu3amtx9.js";import"./Globe02-Cn3qFriL.js";import"./Lock01-DqO9uSP7.js";import"./Terminal-BQ1GlFmm.js";import"./card-B4dTtsmd.js";import"./integration-icon-BrOdBipR.js";import"./Container-YdffBHg3.js";import"./github-icon-Dp3wHhYE.js";import"./binder-hd3C3mvD.js";function rt(t,e){const r=X.c(4),[l,d]=H.useState(t),n=H.useRef(null),i=H.useRef(!0);let c,m;return r[0]!==e||r[1]!==t?(c=()=>{if(i.current){i.current=!1;return}return n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{d(t)},e),()=>{n.current&&clearTimeout(n.current)}},m=[t,e],r[0]=e,r[1]=t,r[2]=c,r[3]=m):(c=r[2],m=r[3]),H.useEffect(c,m),l}function lt(t){const e=X.c(14),r=H.useRef(null),l=`scroll-position:${t}`,d=H.useRef(null);let n;e[0]!==l?(n=()=>{r.current&&sessionStorage.setItem(l,String(r.current.scrollTop))},e[0]=l,e[1]=n):n=e[1];const i=n;let c;e[2]!==l?(c=()=>{if(d.current===l)return;const x=sessionStorage.getItem(l);if(x&&r.current){const $=Number.parseInt(x,10);r.current.scrollTop=$}d.current=l},e[2]=l,e[3]=c):c=e[3];const m=c;let f;e[4]!==m||e[5]!==l?(f=()=>{d.current!==l&&m()},e[4]=m,e[5]=l,e[6]=f):f=e[6];const T=f;let o;e[7]!==m||e[8]!==l?(o=x=>{r.current=x,x&&d.current!==l&&requestAnimationFrame(()=>{m()})},e[7]=m,e[8]=l,e[9]=o):o=e[9];const p=o;let a;return e[10]!==T||e[11]!==i||e[12]!==p?(a={scrollRef:p,saveScrollPosition:i,handleScroll:T},e[10]=T,e[11]=i,e[12]=p,e[13]=a):a=e[13],a}const nt=24;function it(t){const e=X.c(54),{registryId:r,listToolName:l,filtersToolName:d,search:n}=t,{org:i}=ne();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=[],e[0]=c):c=e[0];const[m,f]=H.useState(c);let T;e[1]===Symbol.for("react.memo_cache_sentinel")?(T=[],e[1]=T):T=e[1];const[o,p]=H.useState(T),a=r||null;let x;e[2]!==i.id||e[3]!==a?(x={connectionId:a,orgId:i.id},e[2]=i.id,e[3]=a,e[4]=x):x=e[4];const $=Ne(x),R=!!d;let C;e[5]!==d||e[6]!==r?(C=me.toolCall(r,d||"no-filters","{}"),e[5]=d,e[6]=r,e[7]=C):C=e[7];let y;e[8]!==$||e[9]!==d?(y=async()=>{if(!d)return{tags:[],categories:[]};const O=await $.callTool({name:d,arguments:{}});return O.structuredContent??O},e[8]=$,e[9]=d,e[10]=y):y=e[10];let F;e[11]!==C||e[12]!==y?(F={queryKey:C,queryFn:y,staleTime:36e5,retry:2},e[11]=C,e[12]=y,e[13]=F):F=e[13];const{data:S}=be(F);let h,v,z;if(e[14]!==l||e[15]!==r||e[16]!==n||e[17]!==o||e[18]!==m){const O=n?.trim()?{operator:"or",conditions:[{field:["name"],operator:"contains",value:n},{field:["title"],operator:"contains",value:n},{field:["description"],operator:"contains",value:n}]}:void 0;h={limit:nt,...m.length>0&&{tags:m},...o.length>0&&{categories:o},...O&&{where:O}},z=Me,v=me.toolCall(r,l,JSON.stringify(h)),e[14]=l,e[15]=r,e[16]=n,e[17]=o,e[18]=m,e[19]=h,e[20]=v,e[21]=z}else h=e[19],v=e[20],z=e[21];let P;e[22]!==$||e[23]!==h||e[24]!==l?(P=async O=>{const{pageParam:U}=O,K=U?{...h,cursor:U}:h,u=await $.callTool({name:l,arguments:K});return u.structuredContent??u},e[22]=$,e[23]=h,e[24]=l,e[25]=P):P=e[25];let k;e[26]!==P||e[27]!==v?(k={queryKey:v,queryFn:P,initialPageParam:void 0,getNextPageParam:ot,staleTime:36e5,placeholderData:ke,retry:2},e[26]=P,e[27]=v,e[28]=k):k=e[28];const{data:b,fetchNextPage:w,hasNextPage:g,isFetchingNextPage:N,isFetching:j,isLoading:L,error:I}=z(k);let E;e:{if(!b?.pages||b.pages.length===0){E=null;break e}const O=b.pages[0];if(typeof O=="object"&&O!==null&&"totalCount"in O&&typeof O.totalCount=="number"){E=O.totalCount;break e}E=null}const A=E,_=b?.pages;let G;e[29]!==_?(G=Be(_),e[29]=_,e[30]=G):G=e[30];const W=G;let J;e[31]!==n||e[32]!==o.length||e[33]!==m.length?(J=m.length>0||o.length>0||!!n?.trim(),e[31]=n,e[32]=o.length,e[33]=m.length,e[34]=J):J=e[34];const Y=J,Z=j&&!N&&!L&&Y;let V;e[35]!==w||e[36]!==g||e[37]!==N?(V=()=>{g&&!N&&w()},e[35]=w,e[36]=g,e[37]=N,e[38]=V):V=e[38];const Q=V,q=g??!1,M=R?S?.tags:void 0,B=R?S?.categories:void 0;let D;return e[39]!==Y||e[40]!==j||e[41]!==N||e[42]!==Z||e[43]!==L||e[44]!==W||e[45]!==I||e[46]!==Q||e[47]!==o||e[48]!==m||e[49]!==q||e[50]!==M||e[51]!==B||e[52]!==A?(D={items:W,totalCount:A,hasMore:q,isLoadingMore:N,isFiltering:Z,isInitialLoading:L,isFetching:j,error:I,loadMore:Q,availableTags:M,availableCategories:B,selectedTags:m,selectedCategories:o,setSelectedTags:f,setSelectedCategories:p,hasActiveFilters:Y},e[39]=Y,e[40]=j,e[41]=N,e[42]=Z,e[43]=L,e[44]=W,e[45]=I,e[46]=Q,e[47]=o,e[48]=m,e[49]=q,e[50]=M,e[51]=B,e[52]=A,e[53]=D):D=e[53],D}function ot(t){if(typeof t=="object"&&t!==null){const e=t.nextCursor||t.cursor;if(e)return e}}function at(t,e){return[...t].sort((r,l)=>l.count-r.count).slice(0,e)}function ue(t){const e=X.c(52),{label:r,items:l,selectedItems:d,onToggle:n,onClear:i}=t,[c,m]=H.useState(""),[f,T]=H.useState(!1);let o,p,a,x,$,R,C,y,F,S,h;if(e[0]!==l||e[1]!==r||e[2]!==n||e[3]!==f||e[4]!==c||e[5]!==d){const w=[...c?l.filter(_=>_.value.toLowerCase().includes(c.toLowerCase())):l].sort(ct);a=d.length,p=Se,F=f,S=T;let g;e[17]!==r?(g=s.jsx("span",{children:r}),e[17]=r,e[18]=g):g=e[18];let N;e[19]!==a?(N=a>0&&s.jsx("span",{className:"ml-1 rounded-full bg-primary text-primary-foreground px-1.5 py-0.5 text-[10px] font-medium",children:a}),e[19]=a,e[20]=N):N=e[20];let j;e[21]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Re,{size:14,className:"opacity-50"}),e[21]=j):j=e[21],e[22]!==N||e[23]!==g?(h=s.jsx(we,{asChild:!0,children:s.jsxs(te,{variant:"outline",size:"sm",className:"h-7 px-3 gap-1.5 text-xs font-normal flex-1",children:[g,N,j]})}),e[22]=N,e[23]=g,e[24]=h):h=e[24],o=Ie,R="w-64 p-0",C="start";let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx(ve,{size:16,className:"text-muted-foreground shrink-0"}),e[25]=L):L=e[25];let I;e[26]!==r?(I=r.toLowerCase(),e[26]=r,e[27]=I):I=e[27];const E=`Search ${I}...`;let A;e[28]===Symbol.for("react.memo_cache_sentinel")?(A=_=>m(_.target.value),e[28]=A):A=e[28],e[29]!==c||e[30]!==E?(y=s.jsx("div",{className:"shrink-0 w-full border-b border-border h-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-10 px-4 cursor-text",children:[L,s.jsx(Ze,{type:"text",placeholder:E,value:c,onChange:A,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[29]=c,e[30]=E,e[31]=y):y=e[31],x="max-h-64 overflow-y-auto p-1 flex flex-col gap-1",$=w.length===0?s.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No results found"}):w.map(_=>{const G=d.includes(_.value);return s.jsxs("button",{onClick:()=>n(_.value),className:de("w-full flex items-center justify-between px-2 py-1.5 text-sm rounded cursor-pointer transition-colors",G?"bg-accent/50 text-foreground":"hover:bg-muted text-foreground"),children:[s.jsxs("span",{className:"truncate flex items-center gap-2",children:[G&&s.jsx(Te,{size:16,className:"text-muted-foreground shrink-0"}),_.value]}),s.jsx("span",{className:"text-xs text-muted-foreground ml-2 shrink-0",children:_.count})]},_.value)}),e[0]=l,e[1]=r,e[2]=n,e[3]=f,e[4]=c,e[5]=d,e[6]=o,e[7]=p,e[8]=a,e[9]=x,e[10]=$,e[11]=R,e[12]=C,e[13]=y,e[14]=F,e[15]=S,e[16]=h}else o=e[6],p=e[7],a=e[8],x=e[9],$=e[10],R=e[11],C=e[12],y=e[13],F=e[14],S=e[15],h=e[16];let v;e[32]!==x||e[33]!==$?(v=s.jsx("div",{className:x,children:$}),e[32]=x,e[33]=$,e[34]=v):v=e[34];let z;e[35]!==r||e[36]!==i||e[37]!==a?(z=a>0&&s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs(te,{variant:"ghost",size:"sm",onClick:i,className:"w-full text-xs text-muted-foreground hover:text-foreground",children:["Clear ",r.toLowerCase()]})}),e[35]=r,e[36]=i,e[37]=a,e[38]=z):z=e[38];let P;e[39]!==o||e[40]!==z||e[41]!==R||e[42]!==C||e[43]!==y||e[44]!==v?(P=s.jsxs(o,{className:R,align:C,children:[y,v,z]}),e[39]=o,e[40]=z,e[41]=R,e[42]=C,e[43]=y,e[44]=v,e[45]=P):P=e[45];let k;return e[46]!==p||e[47]!==P||e[48]!==F||e[49]!==S||e[50]!==h?(k=s.jsxs(p,{open:F,onOpenChange:S,children:[h,P]}),e[46]=p,e[47]=P,e[48]=F,e[49]=S,e[50]=h,e[51]=k):k=e[51],k}function ct(t,e){return e.count-t.count}function mt(t){const e=X.c(67),{availableTags:r,availableCategories:l,selectedTags:d,selectedCategories:n,onTagChange:i,onCategoryChange:c}=t,m=r&&r.length>0||l&&l.length>0,f=d.length>0||n.length>0;if(!m)return null;let T;e[0]!==i||e[1]!==d?(T=g=>{d.includes(g)?i(d.filter(N=>N!==g)):i([...d,g])},e[0]=i,e[1]=d,e[2]=T):T=e[2];const o=T;let p;e[3]!==c||e[4]!==n?(p=g=>{n.includes(g)?c(n.filter(N=>N!==g)):c([...n,g])},e[3]=c,e[4]=n,e[5]=p):p=e[5];const a=p;let x;e[6]!==c||e[7]!==i?(x=()=>{i([]),c([])},e[6]=c,e[7]=i,e[8]=x):x=e[8];const $=x;let R,C,y,F,S,h,v;if(e[9]!==l||e[10]!==r||e[11]!==c||e[12]!==i||e[13]!==n||e[14]!==d||e[15]!==a||e[16]!==o){const g=l?at(l,6):[];R=n,C=d,v=new Set(g.map(dt)),S="flex items-center border-b border-border";let N;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:s.jsx(je,{size:16})}),e[24]=N):N=e[24];let j;e[25]!==l||e[26]!==c||e[27]!==n||e[28]!==a?(j=l&&l.length>0&&s.jsx(ue,{label:"Categories",items:l,selectedItems:n,onToggle:a,onClear:()=>c([])}),e[25]=l,e[26]=c,e[27]=n,e[28]=a,e[29]=j):j=e[29];let L;e[30]!==r||e[31]!==i||e[32]!==d||e[33]!==o?(L=r&&r.length>0&&s.jsx(ue,{label:"Tags",items:r,selectedItems:d,onToggle:o,onClear:()=>i([])}),e[30]=r,e[31]=i,e[32]=d,e[33]=o,e[34]=L):L=e[34],e[35]!==L||e[36]!==j?(h=s.jsxs("div",{className:"flex items-center gap-3 flex-wrap px-5 py-3 border-r border-border",children:[N,j,L]}),e[35]=L,e[36]=j,e[37]=h):h=e[37],y="flex items-center gap-3 flex-wrap px-5 py-3";let I;e[38]!==n||e[39]!==a?(I=E=>{const A=n.includes(E.value);return s.jsxs("div",{onClick:()=>a(E.value),className:de("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer",A?"bg-primary text-primary-foreground hover:bg-primary/80":"bg-muted hover:bg-accent text-muted-foreground"),children:[s.jsx("span",{children:E.value}),A&&s.jsx("span",{onClick:_=>{_.stopPropagation(),a(E.value)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(re,{size:12})})]},E.value)},e[38]=n,e[39]=a,e[40]=I):I=e[40],F=g.map(I),e[9]=l,e[10]=r,e[11]=c,e[12]=i,e[13]=n,e[14]=d,e[15]=a,e[16]=o,e[17]=R,e[18]=C,e[19]=y,e[20]=F,e[21]=S,e[22]=h,e[23]=v}else R=e[17],C=e[18],y=e[19],F=e[20],S=e[21],h=e[22],v=e[23];let z;if(e[41]!==R||e[42]!==a||e[43]!==v){let g;e[45]!==v?(g=j=>!v.has(j),e[45]=v,e[46]=g):g=e[46];let N;e[47]!==a?(N=j=>s.jsxs("div",{onClick:()=>a(j),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:j}),s.jsx("span",{onClick:L=>{L.stopPropagation(),a(j)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(re,{size:12})})]},`cat-${j}`),e[47]=a,e[48]=N):N=e[48],z=R.filter(g).map(N),e[41]=R,e[42]=a,e[43]=v,e[44]=z}else z=e[44];let P;if(e[49]!==C||e[50]!==o){let g;e[52]!==o?(g=N=>s.jsxs("div",{onClick:()=>o(N),className:"inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-full transition-colors cursor-pointer bg-primary text-primary-foreground hover:bg-accent/50",children:[s.jsx("span",{children:N}),s.jsx("span",{onClick:j=>{j.stopPropagation(),o(N)},className:"hover:bg-primary/20 rounded-full p-0.5 -mr-1 cursor-pointer flex items-center",children:s.jsx(re,{size:12})})]},`tag-${N}`),e[52]=o,e[53]=g):g=e[53],P=C.map(g),e[49]=C,e[50]=o,e[51]=P}else P=e[51];let k;e[54]!==$||e[55]!==f?(k=f&&s.jsxs(te,{variant:"ghost",size:"sm",onClick:$,className:"h-7 text-xs text-muted-foreground hover:text-foreground gap-1 px-2",children:[s.jsx(re,{size:14}),"Clear all"]}),e[54]=$,e[55]=f,e[56]=k):k=e[56];let b;e[57]!==k||e[58]!==y||e[59]!==F||e[60]!==z||e[61]!==P?(b=s.jsxs("div",{className:y,children:[F,z,P,k]}),e[57]=k,e[58]=y,e[59]=F,e[60]=z,e[61]=P,e[62]=b):b=e[62];let w;return e[63]!==b||e[64]!==S||e[65]!==h?(w=s.jsxs("div",{className:S,children:[h,b]}),e[63]=b,e[64]=S,e[65]=h,e[66]=w):w=e[66],w}function dt(t){return t.value}function ft(t,e){if(!e)return t;const r=e.toLowerCase();return t.filter(l=>(l.name||l.title||"").toLowerCase().includes(r)||(l.description||l.server?.description||"").toLowerCase().includes(r))}function Pe(t){return t.verified===!0||t._meta?.["mcp.mesh"]?.verified===!0}function fe(t){return t._meta?.["mcp.mesh"]?.official===!0}function ut(t){const e=X.c(58),{registryId:r,listToolName:l,filtersToolName:d,storePrivateOnly:n}=t,[i,c]=H.useState(""),m=rt(i,300),f=xe(),{org:T}=ne(),{scrollRef:o,saveScrollPosition:p,handleScroll:a}=lt(`store-discovery:${r}`);let x;e[0]!==m||e[1]!==d||e[2]!==l||e[3]!==r?(x={registryId:r,listToolName:l,filtersToolName:d,search:m},e[0]=m,e[1]=d,e[2]=l,e[3]=r,e[4]=x):x=e[4];const{items:$,hasMore:R,isLoadingMore:C,isInitialLoading:y,isFetching:F,error:S,loadMore:h,availableTags:v,availableCategories:z,selectedTags:P,selectedCategories:k,setSelectedTags:b,setSelectedCategories:w,hasActiveFilters:g}=it(x);let N;e[5]!==$||e[6]!==i?(N=i?ft($,i):$,e[5]=$,e[6]=i,e[7]=N):N=e[7];const j=N;let L;e[8]!==j||e[9]!==n?(L=n?j.filter(ht):j,e[8]=j,e[9]=n,e[10]=L):L=e[10];const I=L,E=(i!==m||F)&&!y&&!!i;let A;e[11]!==I?(A=I.filter(fe),e[11]=I,e[12]=A):A=e[12];const _=A;let G;e[13]!==I?(G=I.filter(pt),e[13]=I,e[14]=G):G=e[14];const W=G;let J;e[15]!==I?(J=I.filter(gt),e[15]=I,e[16]=J):J=e[16];const Y=J;let Z;e[17]!==f||e[18]!==T.slug||e[19]!==r||e[20]!==p?(Z=K=>{p();const u=Qe(K.name||K.title||K.server?.title||""),ee=typeof K.id=="string"&&K.id.includes("/"),ie=typeof K.server?.name=="string"&&K.server.name.includes("/"),oe=ee&&!ie?K.id:K.server?.name||K.id||"";f({to:"/$org/$project/store/$appName",params:{org:T.slug,project:he,appName:u},search:{registryId:r,serverName:oe}})},e[17]=f,e[18]=T.slug,e[19]=r,e[20]=p,e[21]=Z):Z=e[21];const V=Z;let Q;e[22]!==a||e[23]!==R||e[24]!==C||e[25]!==h?(Q=K=>{if(a(),!R||C)return;const u=K.currentTarget;u.scrollHeight-u.scrollTop-u.clientHeight<200&&h()},e[22]=a,e[23]=R,e[24]=C,e[25]=h,e[26]=Q):Q=e[26];const q=Q;let M;e[27]!==E||e[28]!==i?(M=s.jsx(Ye,{value:i,onChange:c,placeholder:"Search for an MCP Server...",isSearching:E}),e[27]=E,e[28]=i,e[29]=M):M=e[29];let B;e[30]!==z||e[31]!==v||e[32]!==k||e[33]!==P||e[34]!==w||e[35]!==b?(B=s.jsx(mt,{availableTags:v,availableCategories:z,selectedTags:P,selectedCategories:k,onTagChange:b,onCategoryChange:w}),e[30]=z,e[31]=v,e[32]=k,e[33]=P,e[34]=w,e[35]=b,e[36]=B):B=e[36];let D;e[37]!==Y||e[38]!==S||e[39]!==V||e[40]!==g||e[41]!==R||e[42]!==y||e[43]!==C||e[44]!==E||e[45]!==_||e[46]!==i||e[47]!==W||e[48]!==I.length?(D=s.jsx("div",{className:"p-5",children:s.jsx("div",{children:S&&!y?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:s.jsx(ge,{className:"size-8 text-destructive"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Registry unavailable"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Could not load items from this registry. It may be temporarily offline."}),S.message&&s.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:S.message})]}),s.jsxs(te,{variant:"outline",size:"sm",onClick:xt,children:[s.jsx(pe,{className:"size-4"}),"Try again"]})]}):y?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading items..."})]}):I.length===0&&!g?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ye,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No items available"}),s.jsx("p",{className:"text-muted-foreground",children:"This store doesn't have any available items yet."})]}):I.length===0&&g&&!i?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(je,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No matching items"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your filters to find more results."})]}):i&&I.length===0&&!E?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ve,{size:48,className:"text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No results found"}),s.jsx("p",{className:"text-muted-foreground",children:"Try adjusting your search terms."})]}):s.jsxs("div",{className:"flex flex-col gap-8",children:[E&&I.length===0&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Searching..."})]}),_.length>0&&s.jsx(ce,{items:_,title:"Official",onItemClick:V}),W.length>0&&s.jsx(ce,{items:W,title:"Verified",onItemClick:V}),Y.length>0&&s.jsx(ce,{items:Y,title:_.length>0||W.length>0?"All":"",onItemClick:V}),R&&C&&s.jsx("div",{className:"flex justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(le,{size:20,className:"animate-spin"}),s.jsx("span",{className:"text-sm",children:"Loading more items..."})]})})]})})}),e[37]=Y,e[38]=S,e[39]=V,e[40]=g,e[41]=R,e[42]=y,e[43]=C,e[44]=E,e[45]=_,e[46]=i,e[47]=W,e[48]=I.length,e[49]=D):D=e[49];let O;e[50]!==q||e[51]!==o||e[52]!==D?(O=s.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",onScroll:q,children:D}),e[50]=q,e[51]=o,e[52]=D,e[53]=O):O=e[53];let U;return e[54]!==B||e[55]!==O||e[56]!==M?(U=s.jsxs("div",{className:"flex flex-col h-full",children:[M,B,O]}),e[54]=B,e[55]=O,e[56]=M,e[57]=U):U=e[57],U}function xt(){return window.location.reload()}function gt(t){return!Pe(t)&&!fe(t)}function pt(t){return Pe(t)&&!fe(t)}function ht(t){return t.is_public!==!0}function jt(t){const e=X.c(11),{registryId:r,storePrivateOnly:l}=t,d=He(r),n=d?.tools;let i;e[0]!==n?(i=De(n),e[0]=n,e[1]=i):i=e[1];const c=i;if(!c){let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("div",{className:"bg-muted p-3 rounded-full",children:s.jsx(ye,{className:"size-8 text-muted-foreground"})}),e[2]=a):a=e[2];let x;return e[3]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-12 text-center space-y-4",children:[a,s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Registry not available"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"This registry does not support listing store items, or the connection is not responding."})]})]}),e[3]=x):x=e[3],x}const m=d?.tools;let f;e[4]!==m?(f=Ge(m),e[4]=m,e[5]=f):f=e[5];const o=f||void 0;let p;return e[6]!==c||e[7]!==r||e[8]!==l||e[9]!==o?(p=s.jsx(ut,{registryId:r,listToolName:c,filtersToolName:o,storePrivateOnly:l}),e[6]=c,e[7]=r,e[8]=l,e[9]=o,e[10]=p):p=e[10],p}function yt(t){const e=X.c(43),{registries:r,value:l,onValueChange:d,onAddWellKnown:n,wellKnownRegistries:i,placeholder:c}=t,m=c===void 0?"Select a registry...":c,[f,T]=H.useState(!1);let o,p,a,x,$,R,C,y;if(e[0]!==f||e[1]!==m||e[2]!==r||e[3]!==l){let b;e[12]!==l?(b=g=>g.id===l,e[12]=l,e[13]=b):b=e[13];const w=r.find(b);p=Se,C=f,y=T,o=we,R=!0,a="button",e[14]===Symbol.for("react.memo_cache_sentinel")?(x=de("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] h-7 min-w-[160px]"),e[14]=x):x=e[14],$=w?s.jsxs("span",{className:"flex items-center gap-2",children:[w.icon?s.jsx("img",{src:w.icon,alt:w.name,className:"w-4 h-4 rounded"}):s.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:w.name})]}):s.jsx("span",{className:"text-muted-foreground",children:m}),e[0]=f,e[1]=m,e[2]=r,e[3]=l,e[4]=o,e[5]=p,e[6]=a,e[7]=x,e[8]=$,e[9]=R,e[10]=C,e[11]=y}else o=e[4],p=e[5],a=e[6],x=e[7],$=e[8],R=e[9],C=e[10],y=e[11];let F;e[15]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Re,{className:"size-4 opacity-50"}),e[15]=F):F=e[15];let S;e[16]!==a||e[17]!==x||e[18]!==$?(S=s.jsxs("button",{type:a,className:x,children:[$,F]}),e[16]=a,e[17]=x,e[18]=$,e[19]=S):S=e[19];let h;e[20]!==o||e[21]!==R||e[22]!==S?(h=s.jsx(o,{asChild:R,children:S}),e[20]=o,e[21]=R,e[22]=S,e[23]=h):h=e[23];let v;if(e[24]!==d||e[25]!==r||e[26]!==l){let b;e[28]!==d||e[29]!==l?(b=w=>s.jsxs("button",{type:"button",onClick:()=>{d(w.id??w.name),T(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[w.icon?s.jsx("img",{src:w.icon,alt:w.name,className:"w-4 h-4 rounded"}):s.jsx("span",{className:"w-4 h-4 rounded from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:w.name.slice(0,1).toUpperCase()}),s.jsx("span",{children:w.name})]}),l===(w.id??w.name)&&s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:s.jsx(Te,{className:"size-4"})})]},w.id??w.name),e[28]=d,e[29]=l,e[30]=b):b=e[30],v=r.map(b),e[24]=d,e[25]=r,e[26]=l,e[27]=v}else v=e[27];let z;e[31]!==n||e[32]!==i?(z=i.length>0&&s.jsxs("div",{className:"border-t border-border pt-1 mt-1",children:[s.jsx("p",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Other known registries"}),i.map(b=>s.jsxs("button",{type:"button",onClick:()=>{n(b),T(!1)},className:"relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none hover:bg-accent hover:text-accent-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[b.icon?s.jsx("img",{src:b.icon,alt:b.title,className:"w-4 h-4 rounded"}):s.jsx("span",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:b.title.slice(0,1).toUpperCase()}),s.jsx("span",{className:"flex-1",children:b.title})]}),s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center text-muted-foreground",children:s.jsx(Xe,{size:16})})]},b.id??b.title))]}),e[31]=n,e[32]=i,e[33]=z):z=e[33];let P;e[34]!==v||e[35]!==z?(P=s.jsxs(Ie,{align:"end",className:"w-auto min-w-[200px] p-1",children:[v,z]}),e[34]=v,e[35]=z,e[36]=P):P=e[36];let k;return e[37]!==p||e[38]!==h||e[39]!==P||e[40]!==C||e[41]!==y?(k=s.jsxs(p,{open:C,onOpenChange:y,children:[h,P]}),e[37]=p,e[38]=h,e[39]=P,e[40]=C,e[41]=y,e[42]=k):k=e[42],k}function vt({registries:t,onConnected:e}){const r=Ce(),{org:{slug:l}}=ne(),{data:d}=ze.useSession(),n=xe(),[i,c]=H.useState(!1),m=t[0],f=async()=>{if(!(!m||!d?.user?.id)){c(!0);try{const o=await r.create.mutateAsync(m);e?.(o.id)}finally{c(!1)}}},T=()=>{n({to:"/$org/$project/mcps",params:{org:l,project:he},search:{action:"create"}})};return s.jsx(et,{image:s.jsx("img",{src:"/store-empty-state.svg",alt:"No store connected",width:336,height:320,className:"max-w-full h-auto"}),title:"Connect to registry",description:"Connect to discover and use Connections from the community.",actions:s.jsxs(s.Fragment,{children:[s.jsxs(te,{variant:"outline",onClick:f,disabled:i||!m,children:[m?.icon&&s.jsx("img",{src:m.icon,alt:"",className:"size-4"}),i?"Installing...":"Install Registry"]}),s.jsx(te,{variant:"outline",onClick:T,children:"Custom Connection"})]})})}function bt(t){const e=X.c(15),{error:r,onRetry:l,registryName:d}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:s.jsx(ge,{className:"h-6 w-6 text-destructive"})}),e[0]=n):n=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("h3",{className:"text-lg font-medium",children:"Unable to load store"}),e[1]=i):i=e[1];let c;e[2]!==d?(c=s.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:["The ",s.jsx("strong",{children:d})," registry is currently unreachable. This may be a temporary issue — try again in a moment."]}),e[2]=d,e[3]=c):c=e[3];let m;e[4]!==r?(m=r?.message&&s.jsx("p",{className:"text-xs text-muted-foreground/60 font-mono max-w-md mx-auto truncate",children:r.message}),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==c||e[7]!==m?(f=s.jsxs("div",{className:"space-y-2",children:[i,c,m]}),e[6]=c,e[7]=m,e[8]=f):f=e[8];let T;e[9]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx(pe,{className:"size-4"}),e[9]=T):T=e[9];let o;e[10]!==l?(o=s.jsxs(te,{variant:"outline",size:"sm",onClick:l,children:[T,"Try again"]}),e[10]=l,e[11]=o):o=e[11];let p;return e[12]!==f||e[13]!==o?(p=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[n,f,o]}),e[12]=f,e[13]=o,e[14]=p):p=e[14],p}function cs(){const t=X.c(53),{org:e,project:r}=ne(),l=Je(),d=Ce(),n=$e(),i=n.location.pathname.includes("/store/")&&n.location.pathname.split("/").length>3,c=tt(l);let m;t[0]!==e.id?(m=We.SELF(e.id),t[0]=e.id,t[1]=m):m=t[1];const f=m,T=r.enabledPlugins,o=T==null||T.includes(ae);let p;t[2]!==f?(p=(u,ee)=>u.id===f?1:ee.id===f?-1:0,t[2]=f,t[3]=p):p=t[3];const a=c.filter(u=>u.id!==f?!0:o).sort(p);let x;t[4]!==f?(x=u=>u.id===f,t[4]=f,t[5]=x):x=t[5];const $=a.some(x);let R;t[6]!==e.id?(R={connectionId:Ve,orgId:e.id},t[6]=e.id,t[7]=R):R=t[7];const C=Ne(R);let y;t[8]!==r.id||t[9]!==C?(y=async()=>{const u=await C.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:r.id,pluginId:ae}});return u.structuredContent??u},t[8]=r.id,t[9]=C,t[10]=y):y=t[10];const{data:F}=be({queryKey:me.projectPluginConfig(r.id??"",ae),queryFn:y,enabled:$&&!!r.id,staleTime:6e4}),S=F?.config?.settings;let h;t[11]!==S||t[12]!==f?(h=u=>u.id===f&&S?{id:u.id,name:S.registryName||u.title,icon:S.registryIcon||u.icon||void 0}:{id:u.id,name:u.title,icon:u.icon||void 0},t[11]=S,t[12]=f,t[13]=h):h=t[13];const v=a.map(h);let z;t[14]!==e.slug?(z=Fe.selectedRegistry(e.slug),t[14]=e.slug,t[15]=z):z=t[15];const[P,k]=st(z,Ct);let b;t[16]!==P?(b=u=>u.id===P,t[16]=P,t[17]=b):b=t[17];const w=a.find(b);let g;t[18]!==f?(g=u=>u.id!==f,t[18]=f,t[19]=g):g=t[19];const N=a.find(g),j=w?.id||N?.id||a[0]?.id||"",L=j===f&&S?.storePrivateOnly===!0;let I;t[20]!==e.id?(I=qe(e.id),t[20]=e.id,t[21]=I):I=t[21];let E;t[22]!==I?(E=[I],t[22]=I,t[23]=E):E=t[23];const A=E;let _;t[24]===Symbol.for("react.memo_cache_sentinel")?(_=[Ue()],t[24]=_):_=t[24];const G=_;let W;t[25]!==d.create||t[26]!==k?(W=async u=>{const ee=await d.create.mutateAsync(u);k(ee.id)},t[25]=d.create,t[26]=k,t[27]=W):W=t[27];const J=W,Y=new Set(a.map(Nt)),Z=A.filter(u=>u.id&&!Y.has(u.id)),V=G.filter(u=>u.id&&!Y.has(u.id));if(i){let u;return t[28]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Ee,{}),t[28]=u):u=t[28],u}let Q;t[29]===Symbol.for("react.memo_cache_sentinel")?(Q=s.jsx(se.Header.Left,{children:s.jsx(Oe,{children:s.jsx(_e,{children:s.jsx(Ke,{children:s.jsx(Ae,{children:"Store"})})})})}),t[29]=Q):Q=t[29];let q;t[30]!==J?(q=async u=>J(u),t[30]=J,t[31]=q):q=t[31];let M;t[32]!==Z||t[33]!==j||t[34]!==v||t[35]!==k||t[36]!==q?(M=s.jsxs(se.Header,{children:[Q,s.jsx(se.Header.Right,{children:s.jsx(yt,{wellKnownRegistries:Z,registries:v,value:j,onValueChange:k,onAddWellKnown:q,placeholder:"Select store..."})})]}),t[32]=Z,t[33]=j,t[34]=v,t[35]=k,t[36]=q,t[37]=M):M=t[37];let B;t[38]!==j||t[39]!==v?(B=u=>{const{error:ee,resetError:ie}=u;return s.jsx(bt,{error:ee,onRetry:ie,registryName:v.find(oe=>oe.id===j)?.name??"registry"})},t[38]=j,t[39]=v,t[40]=B):B=t[40];let D;t[41]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[s.jsx(le,{size:32,className:"animate-spin text-muted-foreground mb-4"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading store items..."})]}),t[41]=D):D=t[41];let O;t[42]!==V||t[43]!==j||t[44]!==k||t[45]!==L?(O=s.jsx(H.Suspense,{fallback:D,children:j?s.jsx(jt,{registryId:j,storePrivateOnly:L}):s.jsx("div",{className:"flex flex-col items-center justify-center h-full",children:s.jsx(vt,{registries:V,onConnected:u=>{k(u)}})})}),t[42]=V,t[43]=j,t[44]=k,t[45]=L,t[46]=O):O=t[46];let U;t[47]!==B||t[48]!==O?(U=s.jsx(se.Content,{children:s.jsx(Le,{fallback:B,children:O})}),t[47]=B,t[48]=O,t[49]=U):U=t[49];let K;return t[50]!==M||t[51]!==U?(K=s.jsxs(se,{children:[M,U]}),t[50]=M,t[51]=U,t[52]=K):K=t[52],K}function Nt(t){return t.id}function Ct(t){return t??""}export{cs as default};
@@ -1 +0,0 @@
1
- import{c as r,j as i}from"./index-DO8fUd54.js";import{P as m}from"./project-plugins-BVdloqBu.js";import"./useQuery-BeFLqBun.js";import"./useMutation-CNVq636e.js";import"./constants-B9t4Nuz_.js";import"./switch-DyxdcdWl.js";import"./label-CnT8WAQY.js";import"./Container-YdffBHg3.js";import"./use-connection-BNGXvSqD.js";import"./use-collections-C8rLdQUN.js";import"./use-binding-DSWv53zN.js";import"./binder-hd3C3mvD.js";import"./use-install-from-registry-BEC7S-53.js";import"./extract-connection-data-adtLKfGW.js";import"./constants-Dr5R1EQY.js";import"./github-icon-Dp3wHhYE.js";import"./registry-utils-oSXyNc33.js";import"./generate-id-Dyweu44Y.js";import"./Loading01-WTkiPysv.js";import"./Plus-Dto-8y6a.js";import"./select-RxUFw6pZ.js";import"./ChevronUp-DXMXl76b.js";import"./index-COM-PDLy.js";import"./Check-CuWDIJeM.js";import"./ChevronDown-D0TXudCx.js";function w(){const o=r.c(1);let t;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(m,{}),o[0]=t):t=o[0],t}export{w as default};
@@ -1 +0,0 @@
1
- import{c as P,g as A,j as r,E as y,r as R,u as T}from"./index-DO8fUd54.js";import{u as S}from"./use-connection-BNGXvSqD.js";import{u as U}from"./constants-B9t4Nuz_.js";import{u as v}from"./use-mcp-tools-BCCglZve.js";import{c as E}from"./content-blocks-o63cs2vh.js";import{M as H}from"./mcp-app-renderer-CLfglV2_.js";import{g as O,M as $}from"./types-BPYct9bF.js";import{u as D}from"./context-CiizXS06.js";import{P as _,u as k}from"./index-B1uuY7UL.js";import"./use-collections-C8rLdQUN.js";import"./useMutation-CNVq636e.js";import"./useQuery-BeFLqBun.js";import"./use-mcp-resources-BNoK6dDS.js";import"./decopilot-events-Brt4gAR6.js";import"./use-local-storage-C3Bo802w.js";import"./tooltip-BLTgyg7W.js";import"./index-COM-PDLy.js";const b={};function w(t){const e=P.c(22),{client:o,resourceURI:m,tool:i,connectionId:f}=t,{sendMessage:a,setAppContext:c,clearAppContext:n}=D(),[,p]=k(),l=`${f}:${i.name}`;let d;e[0]!==o||e[1]!==i.name?(d={client:o,toolName:i.name,toolArguments:b},e[0]=o,e[1]=i.name,e[2]=d):d=e[2];const{data:u}=v(d);let s;e[3]!==a||e[4]!==p?(s=N=>{const M=E(N.content);M.content.length>0&&(p(!0),a(M))},e[3]=a,e[4]=p,e[5]=s):s=e[5];const g=s,I=i;let x;e[6]!==I?(x={tool:I},e[6]=I,e[7]=x):x=e[7];let h;e[8]!==c||e[9]!==l?(h=N=>c(l,N),e[8]=c,e[9]=l,e[10]=h):h=e[10];let j;e[11]!==n||e[12]!==l?(j=()=>n(l),e[11]=n,e[12]=l,e[13]=j):j=e[13];let C;return e[14]!==o||e[15]!==g||e[16]!==m||e[17]!==x||e[18]!==h||e[19]!==j||e[20]!==u?(C=r.jsx(H,{resourceURI:m,toolInfo:x,toolInput:b,toolResult:u,displayMode:"fullscreen",minHeight:$.fullscreen.minHeight,maxHeight:$.fullscreen.maxHeight,client:o,onMessage:g,onUpdateModelContext:h,onTeardown:j,className:"h-full"}),e[14]=o,e[15]=g,e[16]=m,e[17]=x,e[18]=h,e[19]=j,e[20]=u,e[21]=C):C=e[21],C}function L(t){const e=P.c(17),{connectionId:o,toolName:m}=t,{org:i}=T();let f;e[0]!==o||e[1]!==i.id?(f={connectionId:o,orgId:i.id},e[0]=o,e[1]=i.id,e[2]=f):f=e[2];const a=U(f),c=S(o),n=decodeURIComponent(m);let p,l;if(e[3]!==c?.tools||e[4]!==n){let s;e[7]!==n?(s=g=>g.name===n,e[7]=n,e[8]=s):s=e[8],l=(c?.tools??[]).find(s),p=l?._meta?O(l._meta):void 0,e[3]=c?.tools,e[4]=n,e[5]=p,e[6]=l}else p=e[5],l=e[6];const d=p;if(!c){let s;return e[9]===Symbol.for("react.memo_cache_sentinel")?(s=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Connection not found"})}),e[9]=s):s=e[9],s}if(!l||!d){let s;return e[10]!==n?(s=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsxs("p",{className:"text-sm text-muted-foreground",children:['Tool "',n,'" not found or has no UI']})}),e[10]=n,e[11]=s):s=e[11],s}let u;return e[12]!==a||e[13]!==o||e[14]!==d||e[15]!==l?(u=r.jsx(w,{client:a,resourceURI:d,tool:l,connectionId:o}),e[12]=a,e[13]=o,e[14]=d,e[15]=l,e[16]=u):u=e[16],u}function ne(){const t=P.c(9);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/$project/apps/$connectionId/$toolName"},t[0]=e):e=t[0];const{connectionId:o,toolName:m}=A(e);let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(_.Header,{}),t[1]=i):i=t[1];const f=`${o}:${m}`;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[r.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),r.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),t[2]=a):a=t[2];let c;t[3]!==o||t[4]!==m?(c=r.jsx(R.Suspense,{fallback:a,children:r.jsx(L,{connectionId:o,toolName:m})}),t[3]=o,t[4]=m,t[5]=c):c=t[5];let n;return t[6]!==f||t[7]!==c?(n=r.jsxs(_,{children:[i,r.jsx(_.Content,{children:r.jsx(y,{fallback:void 0,children:c},f)})]}),t[6]=f,t[7]=c,t[8]=n):n=t[8],n}export{ne as default};