decocms 2.175.0 → 2.175.1

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 (315) hide show
  1. package/dist/client/assets/{AlertCircle-5ZbLDi3s.js → AlertCircle-De9oqjty.js} +1 -1
  2. package/dist/client/assets/{AlignLeft-D4ghzTQG.js → AlignLeft-BaG4OcCg.js} +1 -1
  3. package/dist/client/assets/{ArrowDown-B5WC3D5H.js → ArrowDown-PFFBPH3j.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-D0Lalw4x.js → ArrowLeft-CPWCs_Od.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-tKKJvEkq.js → ArrowUp-C6Q-EpUw.js} +1 -1
  6. package/dist/client/assets/{Check-CuWDIJeM.js → Check-BfKCyKXX.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-wz1RfkCA.js → CheckCircle-DiRi76qb.js} +1 -1
  8. package/dist/client/assets/{CheckDone01-UsIketHR.js → CheckDone01-ZekLHdFZ.js} +1 -1
  9. package/dist/client/assets/{CheckVerified02-cu3amtx9.js → CheckVerified02-DC3VT092.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-D0TXudCx.js → ChevronDown-BHMaRWRt.js} +1 -1
  11. package/dist/client/assets/{ChevronLeft-BZsszCLQ.js → ChevronLeft-0cpA2yNq.js} +1 -1
  12. package/dist/client/assets/{ChevronRight-UJRwW9xN.js → ChevronRight-1g9z-Z5h.js} +1 -1
  13. package/dist/client/assets/{ChevronUp-DXMXl76b.js → ChevronUp-1s_S3eDF.js} +1 -1
  14. package/dist/client/assets/{Clock-DKQ7EGj-.js → Clock-rHd8cQAO.js} +1 -1
  15. package/dist/client/assets/{Code01-DZzuHJh9.js → Code01-CoTQP8pZ.js} +1 -1
  16. package/dist/client/assets/{Coins01-DWo6Ypxq.js → Coins01-D7lfLTbO.js} +1 -1
  17. package/dist/client/assets/{Container-YdffBHg3.js → Container-DwxLlgWA.js} +1 -1
  18. package/dist/client/assets/{Copy01-CPHBT83w.js → Copy01-CIUDy0Hr.js} +1 -1
  19. package/dist/client/assets/{Dataflow03-CUuQJ-m_.js → Dataflow03-T9TmjQN-.js} +1 -1
  20. package/dist/client/assets/{DotsHorizontal-DUoeCjzn.js → DotsHorizontal-CmCKbvuJ.js} +1 -1
  21. package/dist/client/assets/{DotsVertical-BaBvJOuP.js → DotsVertical-Y8XpM2B_.js} +1 -1
  22. package/dist/client/assets/{Download01-D5-Ilwwi.js → Download01-LinNp3zy.js} +1 -1
  23. package/dist/client/assets/{Edit01-Dpq6F4lk.js → Edit01-Dw-lPBk-.js} +1 -1
  24. package/dist/client/assets/{Edit05-h0OeCHXT.js → Edit05-Bx682Mm6.js} +1 -1
  25. package/dist/client/assets/{Eye-DDwMVcxZ.js → Eye-JuDcZhJz.js} +1 -1
  26. package/dist/client/assets/{EyeOff-D8njwIM7.js → EyeOff-9_-SJWcU.js} +1 -1
  27. package/dist/client/assets/{File02-Bc8tH3v5.js → File02-bFwU_wEK.js} +1 -1
  28. package/dist/client/assets/{File06-ZV5CfSHG.js → File06-CU5oU1OI.js} +1 -1
  29. package/dist/client/assets/{FilterLines-aqS8nu95.js → FilterLines-BaTxnUjH.js} +1 -1
  30. package/dist/client/assets/{Globe01-BdWDm7Ni.js → Globe01-DUjsFcPS.js} +1 -1
  31. package/dist/client/assets/{Globe02-Cn3qFriL.js → Globe02-k3_A41kp.js} +1 -1
  32. package/dist/client/assets/{Grid01-Gq7hBl7S.js → Grid01-DBOkAm2V.js} +1 -1
  33. package/dist/client/assets/{Hash02-CmJ0Y9N4.js → Hash02-gqJDwuju.js} +1 -1
  34. package/dist/client/assets/{Home02-Dz88FEOV.js → Home02-DfEb-Myv.js} +1 -1
  35. package/dist/client/assets/{Image01-DBWShOGl.js → Image01-I9pAeT0N.js} +1 -1
  36. package/dist/client/assets/{Inbox01-CJphqD3y.js → Inbox01-BgDmihAV.js} +1 -1
  37. package/dist/client/assets/{InfoCircle-uEl5PLW5.js → InfoCircle-LX1SVC24.js} +1 -1
  38. package/dist/client/assets/{Key01-IptFTL_3.js → Key01-DAjAUWfr.js} +1 -1
  39. package/dist/client/assets/{LayersTwo01-B5fVqAUB.js → LayersTwo01-C-XZtFtv.js} +1 -1
  40. package/dist/client/assets/{LayoutLeft-B8-msEGR.js → LayoutLeft-BvuIBX8d.js} +1 -1
  41. package/dist/client/assets/{Link01-BpjSsBky.js → Link01-q2vhCqdM.js} +1 -1
  42. package/dist/client/assets/{LinkExternal01-B21lACin.js → LinkExternal01-QGWpvftd.js} +1 -1
  43. package/dist/client/assets/{List-ySIwqood.js → List-CuV23QYs.js} +1 -1
  44. package/dist/client/assets/{Loading01-WTkiPysv.js → Loading01-BNn4YU_K.js} +1 -1
  45. package/dist/client/assets/{Lock01-DqO9uSP7.js → Lock01-DJQX15kR.js} +1 -1
  46. package/dist/client/assets/{Play-D72BHSXn.js → Play-C7yKo0dH.js} +1 -1
  47. package/dist/client/assets/{Plus-Dto-8y6a.js → Plus-CT_Gcwl2.js} +1 -1
  48. package/dist/client/assets/{RefreshCcw01-DckyCUMd.js → RefreshCcw01-uL9q48A4.js} +1 -1
  49. package/dist/client/assets/{Save01-C2uk3LpG.js → Save01-CuwI4Bxq.js} +1 -1
  50. package/dist/client/assets/{SearchMd-Kap2MdR9.js → SearchMd-BLeX5weN.js} +1 -1
  51. package/dist/client/assets/{Settings01-CYUXeHtK.js → Settings01-2AkYiqYr.js} +1 -1
  52. package/dist/client/assets/{Shield01-CJ-f24yL.js → Shield01-D6IOCC-Z.js} +1 -1
  53. package/dist/client/assets/{Terminal-BQ1GlFmm.js → Terminal-Dlvh4GS2.js} +1 -1
  54. package/dist/client/assets/Tool01-CjSIsyxE.js +1 -0
  55. package/dist/client/assets/{Trash01-DkXbOnbi.js → Trash01-YPQczxci.js} +1 -1
  56. package/dist/client/assets/{Upload01-BasmYIL8.js → Upload01-BlEN4mwB.js} +1 -1
  57. package/dist/client/assets/{Users03-BXwEsNFj.js → Users03-B7X28dbt.js} +1 -1
  58. package/dist/client/assets/{X-CNbskBah.js → X-B_f76BPZ.js} +1 -1
  59. package/dist/client/assets/XAxis-Du5m1KMx.js +1 -0
  60. package/dist/client/assets/{XCircle-DvUvQRq1.js → XCircle-DDLf4PgL.js} +1 -1
  61. package/dist/client/assets/{XClose-B0FgAxIQ.js → XClose-eeK1fS1n.js} +1 -1
  62. package/dist/client/assets/{Zap-BgjTj76q.js → Zap-DHey7Hu_.js} +1 -1
  63. package/dist/client/assets/{agent-connections-preview-Bh6ijP_X.js → agent-connections-preview-D6uKmygR.js} +1 -1
  64. package/dist/client/assets/agent-detail-BS4g93cA.js +2 -0
  65. package/dist/client/assets/{agents-DNXSTqTl.js → agents-BuWI7PBX.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-DtAWdTyc.js → alert-dialog-BVglQjyM.js} +3 -3
  67. package/dist/client/assets/{auth-catchall-5qyXxzaS.js → auth-catchall-Bfllc4Ni.js} +1 -1
  68. package/dist/client/assets/automation-detail-DNo-sbc_.js +1 -0
  69. package/dist/client/assets/automations-CCXftgU_.js +1 -0
  70. package/dist/client/assets/{avatar-ChRCLY4k.js → avatar-OE2URZfM.js} +1 -1
  71. package/dist/client/assets/{badge-C4uZcq7J.js → badge-CAg946Xk.js} +1 -1
  72. package/dist/client/assets/{binder-hd3C3mvD.js → binder-DTBFGqjl.js} +1 -1
  73. package/dist/client/assets/{breadcrumb-pLMl4xjy.js → breadcrumb-aP02JuZO.js} +1 -1
  74. package/dist/client/assets/card-RQxLVCBk.js +1 -0
  75. package/dist/client/assets/chart-D9IwJUjP.js +15 -0
  76. package/dist/client/assets/{checkbox-D2IG7klY.js → checkbox-DLsMmmhu.js} +1 -1
  77. package/dist/client/assets/circle-alert-DCE_cWKa.js +1 -0
  78. package/dist/client/assets/{collapsible-ttq3VbhQ.js → collapsible-CGr-TiAc.js} +1 -1
  79. package/dist/client/assets/{collection-detail-DoRLjPv6.js → collection-detail-CZQpkHig.js} +5 -5
  80. package/dist/client/assets/collection-display-button-VOymjalV.js +1 -0
  81. package/dist/client/assets/{collection-search-Mtc1qP5K.js → collection-search-62vwaqdq.js} +1 -1
  82. package/dist/client/assets/collection-table-wrapper-DPJfuSg9.js +1 -0
  83. package/dist/client/assets/{collection-tabs-CHem1-m4.js → collection-tabs-FJx5TF4Z.js} +1 -1
  84. package/dist/client/assets/{command-DRBqjkmt.js → command-ChmbB2jp.js} +1 -1
  85. package/dist/client/assets/connect-Cak7aHsQ.js +1 -0
  86. package/dist/client/assets/connection-card-D9I87KkT.js +1 -0
  87. package/dist/client/assets/connection-detail-ZRvu6X4P.js +1 -0
  88. package/dist/client/assets/{connection-status-COvhqytZ.js → connection-status-D_iX92lK.js} +1 -1
  89. package/dist/client/assets/connections-Bi0oPT3Y.js +1 -0
  90. package/dist/client/assets/constants-B4Swgi3d.js +1 -0
  91. package/dist/client/assets/{constants-B9t4Nuz_.js → constants-XtX-WKGm.js} +1 -1
  92. package/dist/client/assets/{context-CiizXS06.js → context-CtrnP3HC.js} +1 -1
  93. package/dist/client/assets/{create-organization-dialog-BCMxp6fo.js → create-organization-dialog-DlsDrfHE.js} +1 -1
  94. package/dist/client/assets/{create-project-dialog-BvxMRX5X.js → create-project-dialog-BV-JjiBR.js} +1 -1
  95. package/dist/client/assets/{danger-BjSxZinj.js → danger-B3KgXwQ9.js} +1 -1
  96. package/dist/client/assets/{danger-zone-B2z3wTq9.js → danger-zone-C_4VhnMp.js} +1 -1
  97. package/dist/client/assets/{dependencies-BkOdHYmE.js → dependencies-BHUeYRA7.js} +1 -1
  98. package/dist/client/assets/dialog-_XYw8lZC.js +1 -0
  99. package/dist/client/assets/{dropdown-menu-Cp0O2jCN.js → dropdown-menu-DzFMEBVS.js} +1 -1
  100. package/dist/client/assets/{dynamic-plugin-layout-CcrlbNZV.js → dynamic-plugin-layout-b0Zt6Dxk.js} +1 -1
  101. package/dist/client/assets/{editable-task-title-COr46zxY.js → editable-task-title-B7Ktbs3r.js} +1 -1
  102. package/dist/client/assets/{empty-state-DbRFhzf6.js → empty-state-AMuFIqs3.js} +1 -1
  103. package/dist/client/assets/{empty-state-SBIKV11G.js → empty-state-D4GX29pL.js} +1 -1
  104. package/dist/client/assets/env-vars-editor-DTKmdK-v.js +1 -0
  105. package/dist/client/assets/extract-connection-data-CS_Bn7Ri.js +1 -0
  106. package/dist/client/assets/{file-browser-B2cQNHIN.js → file-browser-OSAi_CZb.js} +2 -2
  107. package/dist/client/assets/{form-DPPO-3Tw.js → form-BN7_f2uj.js} +1 -1
  108. package/dist/client/assets/{general-DDQcxBFZ.js → general-B9J0F1Xq.js} +1 -1
  109. package/dist/client/assets/{grid-view-BhmPSvr_.js → grid-view-BH674f3N.js} +1 -1
  110. package/dist/client/assets/home-Dam4fMEZ.js +1 -0
  111. package/dist/client/assets/index-C-NLwTON.js +1 -0
  112. package/dist/client/assets/index-CcA_QriT.js +1 -0
  113. package/dist/client/assets/{index-Bmxys2UV.js → index-Cn8BPdHZ.js} +1 -1
  114. package/dist/client/assets/{index-B3fUA0k0.js → index-CuSj4QrF.js} +1 -1
  115. package/dist/client/assets/index-D5cL24p_.css +1 -0
  116. package/dist/client/assets/{index-BVSHvvtZ.js → index-Da9ggy60.js} +1 -1
  117. package/dist/client/assets/{index-DO8fUd54.js → index-DsOJvxnb.js} +4 -4
  118. package/dist/client/assets/{index-D-NeGwUy.js → index-DxP-spTj.js} +1 -1
  119. package/dist/client/assets/index-MKlLgXIW.js +25 -0
  120. package/dist/client/assets/{index-B1uuY7UL.js → index-X4FDee1r.js} +1 -1
  121. package/dist/client/assets/{index-COM-PDLy.js → index-zjV4p_E5.js} +1 -1
  122. package/dist/client/assets/{infiniteQueryObserver-x0ce-nmx.js → infiniteQueryObserver-BE0Fq7u7.js} +1 -1
  123. package/dist/client/assets/{input-BM9bdg-F.js → input-CUT8DBv1.js} +1 -1
  124. package/dist/client/assets/integration-icon-CVxvM4fR.js +1 -0
  125. package/dist/client/assets/{label-CnT8WAQY.js → label-iPw5smAw.js} +1 -1
  126. package/dist/client/assets/{layout-ubFJ5DPd.js → layout-C2ZnDBkW.js} +1 -1
  127. package/dist/client/assets/{layout-C4PDA52F.js → layout-CA_pUlCy.js} +1 -1
  128. package/dist/client/assets/login-DJvdi7W3.js +1 -0
  129. package/dist/client/assets/{logo-upload-Bb5Ay7-T.js → logo-upload-DlKQk0GB.js} +1 -1
  130. package/dist/client/assets/{markdown-ZobUYaB1.js → markdown-CKKBcXcE.js} +8 -8
  131. package/dist/client/assets/{mcp-app-renderer-CLfglV2_.js → mcp-app-renderer-IX_OR3wW.js} +2 -2
  132. package/dist/client/assets/mcp-server-card-Cq5E9kuT.js +1 -0
  133. package/dist/client/assets/mcp-server-detail-CTGb-hF0.js +2 -0
  134. package/dist/client/assets/members-CYtrIFR5.js +3 -0
  135. package/dist/client/assets/{monaco-editor-kjafc2y3.js → monaco-editor-J8rInsT2.js} +1 -1
  136. package/dist/client/assets/{monitoring-dashboard-edit-CtIPN7nQ.js → monitoring-dashboard-edit-6gWIXCOX.js} +1 -1
  137. package/dist/client/assets/{monitoring-dashboard-view-FD-yc8mV.js → monitoring-dashboard-view-Dt4aILCV.js} +2 -2
  138. package/dist/client/assets/monitoring-gb_hJ2kW.js +4 -0
  139. package/dist/client/assets/monitoring-stats-row-Dx_W_1nT.js +28 -0
  140. package/dist/client/assets/{oauth-callback-wHI3TkEb.js → oauth-callback-COUada1q.js} +1 -1
  141. package/dist/client/assets/{oauth-callback-ai-provider-DHfWQd6C.js → oauth-callback-ai-provider-CqS-ybCD.js} +1 -1
  142. package/dist/client/assets/{org-ai-providers-Cu3Y8hG7.js → org-ai-providers-BDwPbfg4.js} +1 -1
  143. package/dist/client/assets/page-BrXIXidh.js +1 -0
  144. package/dist/client/assets/page-s-fs9Bly.js +1 -0
  145. package/dist/client/assets/{plugin-empty-state-C0KzvXIH.js → plugin-empty-state-CRLH-_5S.js} +1 -1
  146. package/dist/client/assets/{plugin-empty-state-Bh1khfVy.js → plugin-empty-state-Dt2dvxD9.js} +1 -1
  147. package/dist/client/assets/{plugin-header-ydYJ1Vj6.js → plugin-header-CkWzqJkZ.js} +1 -1
  148. package/dist/client/assets/{plugin-header-DJbwn5SE.js → plugin-header-DLDBKovk.js} +1 -1
  149. package/dist/client/assets/plugins-DkI_FXfU.js +1 -0
  150. package/dist/client/assets/{popover-D1WG-emQ.js → popover-CF3EN_0o.js} +1 -1
  151. package/dist/client/assets/{project-app-view-D-VHvgqy.js → project-app-view-Boof680i.js} +1 -1
  152. package/dist/client/assets/project-layout-CxwbtNi5.js +1 -0
  153. package/dist/client/assets/{project-plugins-BVdloqBu.js → project-plugins-DRIvSpW5.js} +1 -1
  154. package/dist/client/assets/{projects-list-Z8HiWxIk.js → projects-list-DmvsbHJl.js} +1 -1
  155. package/dist/client/assets/{registry-layout-B5XpbAHd.js → registry-layout-MGTBGYDW.js} +1 -1
  156. package/dist/client/assets/registry-utils-Cd3t_Kmp.js +1 -0
  157. package/dist/client/assets/{reports-layout-Ct8yUpC8.js → reports-layout-Cu0HmCBt.js} +1 -1
  158. package/dist/client/assets/{reset-password-BXrkGw9C.js → reset-password-Dwr8terU.js} +1 -1
  159. package/dist/client/assets/{resizable-CqLBllsV.js → resizable-D4LJctEl.js} +1 -1
  160. package/dist/client/assets/{save-actions-MbSzUbWU.js → save-actions-MzYbolsq.js} +1 -1
  161. package/dist/client/assets/{scroll-area-BcJ1ckdt.js → scroll-area-B5XbONJS.js} +1 -1
  162. package/dist/client/assets/{select-RxUFw6pZ.js → select-DRPG5csU.js} +1 -1
  163. package/dist/client/assets/{select-virtual-mcp-DU8qBWLM.js → select-virtual-mcp-B8NgSgPI.js} +1 -1
  164. package/dist/client/assets/sheet-BQuKOEiL.js +1 -0
  165. package/dist/client/assets/shell-layout-ZGvfzjfQ.js +3 -0
  166. package/dist/client/assets/{sidebar-settings-DICq5I_K.js → sidebar-settings-BqDjI96r.js} +1 -1
  167. package/dist/client/assets/{skeleton-CU7LuZGk.js → skeleton-DJFpR-1P.js} +1 -1
  168. package/dist/client/assets/{spinner-CpOteR2a.js → spinner-CqAVfcvO.js} +1 -1
  169. package/dist/client/assets/{store-invite-D2k0Vn6N.js → store-invite-JCf8JSic.js} +1 -1
  170. package/dist/client/assets/{switch-DyxdcdWl.js → switch-BQjzAGvm.js} +1 -1
  171. package/dist/client/assets/{table-DyNKuHyS.js → table-DJbHB5IL.js} +1 -1
  172. package/dist/client/assets/{tabs-XMAGaWgq.js → tabs-CkPDQzeX.js} +1 -1
  173. package/dist/client/assets/{task-status-DJB3YbbO.js → task-status-wkv2GdSY.js} +1 -1
  174. package/dist/client/assets/{tasks-panel-XTVNkW83.js → tasks-panel-TN0GeEUK.js} +1 -1
  175. package/dist/client/assets/tasks-zu-x8h5W.js +1 -0
  176. package/dist/client/assets/{textarea-BLuscN8X.js → textarea-CTzX43MZ.js} +1 -1
  177. package/dist/client/assets/{time-range-picker-Bd3fku3n.js → time-range-picker-DNJ6dRiN.js} +1 -1
  178. package/dist/client/assets/{toggle-group-BrL6C5fG.js → toggle-group-y2h19HHT.js} +1 -1
  179. package/dist/client/assets/tools-list-Db7zzadA.js +1 -0
  180. package/dist/client/assets/{tooltip-BLTgyg7W.js → tooltip-XyKE4lZa.js} +1 -1
  181. package/dist/client/assets/{topbar-portal-_Qqzdv9B.js → topbar-portal-D3fRQWai.js} +1 -1
  182. package/dist/client/assets/{types-BPYct9bF.js → types-B3niHy47.js} +5 -5
  183. package/dist/client/assets/{use-automations-BeAHZecx.js → use-automations-C4CL-jAO.js} +1 -1
  184. package/dist/client/assets/use-binding-BfjFWpEn.js +1 -0
  185. package/dist/client/assets/{use-collections-C8rLdQUN.js → use-collections-DSWhP4jg.js} +1 -1
  186. package/dist/client/assets/{use-connection-BNGXvSqD.js → use-connection-DmR852Js.js} +1 -1
  187. package/dist/client/assets/{use-copy-DPJ8nWWs.js → use-copy-dSR0w-bG.js} +1 -1
  188. package/dist/client/assets/{use-create-virtual-mcp-BfS4KaKE.js → use-create-virtual-mcp-DXWAjide.js} +1 -1
  189. package/dist/client/assets/use-infinite-scroll-CvaIKLMy.js +1 -0
  190. package/dist/client/assets/{use-install-from-registry-BEC7S-53.js → use-install-from-registry-_FQYQGQx.js} +1 -1
  191. package/dist/client/assets/{use-list-state-DsQajLIu.js → use-list-state-Ck8sSm9J.js} +1 -1
  192. package/dist/client/assets/{use-llm-IG8InXvX.js → use-llm-BkLbMZPM.js} +1 -1
  193. package/dist/client/assets/{use-local-storage-C3Bo802w.js → use-local-storage-CxC8ozOe.js} +1 -1
  194. package/dist/client/assets/{use-mcp-prompts-D_02f3uO.js → use-mcp-prompts-C-XU_-dc.js} +1 -1
  195. package/dist/client/assets/{use-mcp-resources-BNoK6dDS.js → use-mcp-resources-Bxkx1Ub1.js} +1 -1
  196. package/dist/client/assets/{use-mcp-tools-BCCglZve.js → use-mcp-tools-BXmfFmar.js} +1 -1
  197. package/dist/client/assets/{use-members-Cqa4gqXV.js → use-members-B-Cx3SpJ.js} +1 -1
  198. package/dist/client/assets/{use-mobile-kAkblq0-.js → use-mobile-O8KVzGuv.js} +1 -1
  199. package/dist/client/assets/{use-project-DNZXkIib.js → use-project-Bg5pX2Ab.js} +1 -1
  200. package/dist/client/assets/use-store-discovery-DPE_0zuT.js +1 -0
  201. package/dist/client/assets/{use-view-mode-Bl6DaWwW.js → use-view-mode-ve-Q_Sd0.js} +1 -1
  202. package/dist/client/assets/{use-virtual-mcp-DoDJBE5n.js → use-virtual-mcp-C9XdHCA_.js} +1 -1
  203. package/dist/client/assets/useInfiniteQuery-DEfXPFTs.js +1 -0
  204. package/dist/client/assets/{useMutation-CNVq636e.js → useMutation-B_cFG709.js} +1 -1
  205. package/dist/client/assets/useQuery-D2ShO4od.js +1 -0
  206. package/dist/client/assets/useSuspenseInfiniteQuery-CT40dICu.js +1 -0
  207. package/dist/client/assets/{user-6WV0RuBu.js → user-rS26WEu1.js} +1 -1
  208. package/dist/client/assets/workflow-C4-p-dLU.js +1 -0
  209. package/dist/client/index.html +2 -2
  210. package/dist/server/node_modules/{xtend → pg}/LICENSE +7 -6
  211. package/dist/server/node_modules/pg/README.md +95 -0
  212. package/dist/server/node_modules/pg/esm/index.mjs +20 -0
  213. package/dist/server/node_modules/pg/lib/client.js +743 -0
  214. package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
  215. package/dist/server/node_modules/pg/lib/connection.js +221 -0
  216. package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
  217. package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
  218. package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
  219. package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
  220. package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
  221. package/dist/server/node_modules/pg/lib/defaults.js +91 -0
  222. package/dist/server/node_modules/pg/lib/index.js +73 -0
  223. package/dist/server/node_modules/pg/lib/native/client.js +323 -0
  224. package/dist/server/node_modules/pg/lib/native/index.js +2 -0
  225. package/dist/server/node_modules/pg/lib/native/query.js +165 -0
  226. package/dist/server/node_modules/pg/lib/query.js +252 -0
  227. package/dist/server/node_modules/pg/lib/result.js +109 -0
  228. package/dist/server/node_modules/pg/lib/stream.js +83 -0
  229. package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
  230. package/dist/server/node_modules/pg/lib/utils.js +217 -0
  231. package/dist/server/node_modules/pg/package.json +76 -0
  232. package/package.json +1 -1
  233. package/dist/client/assets/agent-detail-Cda1RjKX.js +0 -2
  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/connect-CRbH1TYm.js +0 -1
  242. package/dist/client/assets/connection-card-DXMFAvSL.js +0 -1
  243. package/dist/client/assets/connection-detail-D-M6vj9q.js +0 -1
  244. package/dist/client/assets/connections-BZmayWR_.js +0 -1
  245. package/dist/client/assets/constants-Dr5R1EQY.js +0 -1
  246. package/dist/client/assets/dialog-CTFHRhvl.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-B_m3AdpY.js +0 -1
  253. package/dist/client/assets/index-BqlWbrG0.js +0 -1
  254. package/dist/client/assets/index-C6XH6ylF.js +0 -25
  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/login-CTOJXY_r.js +0 -1
  258. package/dist/client/assets/mcp-server-card-AL30DdJr.js +0 -1
  259. package/dist/client/assets/mcp-server-detail-CN2kEGgD.js +0 -2
  260. package/dist/client/assets/members-CpLusvJM.js +0 -3
  261. package/dist/client/assets/monitoring-BNAsqD0Y.js +0 -31
  262. package/dist/client/assets/page-BWMoYp-g.js +0 -1
  263. package/dist/client/assets/page-Ch5Qzmi-.js +0 -1
  264. package/dist/client/assets/plugins-D5THwapv.js +0 -1
  265. package/dist/client/assets/project-layout-Cd8cNifU.js +0 -1
  266. package/dist/client/assets/readme-viewer-MbTGGbgZ.js +0 -1
  267. package/dist/client/assets/registry-utils-oSXyNc33.js +0 -1
  268. package/dist/client/assets/shell-layout-0dnPJSNe.js +0 -3
  269. package/dist/client/assets/tasks-BJvBlQqj.js +0 -1
  270. package/dist/client/assets/tools-list-BeUwtNiH.js +0 -1
  271. package/dist/client/assets/use-binding-DSWv53zN.js +0 -1
  272. package/dist/client/assets/useInfiniteQuery-BBGNgnIc.js +0 -1
  273. package/dist/client/assets/useQuery-BeFLqBun.js +0 -1
  274. package/dist/client/assets/useSuspenseInfiniteQuery-CdVyznmA.js +0 -1
  275. package/dist/client/assets/workflow-DUYpxPLh.js +0 -1
  276. package/dist/server/node_modules/async-exit-hook/CHANGELOG.md +0 -62
  277. package/dist/server/node_modules/async-exit-hook/index.js +0 -171
  278. package/dist/server/node_modules/async-exit-hook/license +0 -21
  279. package/dist/server/node_modules/async-exit-hook/package.json +0 -66
  280. package/dist/server/node_modules/async-exit-hook/readme.md +0 -118
  281. package/dist/server/node_modules/pg-int8/LICENSE +0 -13
  282. package/dist/server/node_modules/pg-int8/README.md +0 -16
  283. package/dist/server/node_modules/pg-int8/index.js +0 -100
  284. package/dist/server/node_modules/pg-int8/package.json +0 -24
  285. package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
  286. package/dist/server/node_modules/postgres-array/index.js +0 -97
  287. package/dist/server/node_modules/postgres-array/license +0 -21
  288. package/dist/server/node_modules/postgres-array/package.json +0 -35
  289. package/dist/server/node_modules/postgres-array/readme.md +0 -43
  290. package/dist/server/node_modules/postgres-bytea/index.js +0 -33
  291. package/dist/server/node_modules/postgres-bytea/license +0 -21
  292. package/dist/server/node_modules/postgres-bytea/package.json +0 -34
  293. package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
  294. package/dist/server/node_modules/postgres-date/index.js +0 -116
  295. package/dist/server/node_modules/postgres-date/license +0 -21
  296. package/dist/server/node_modules/postgres-date/package.json +0 -33
  297. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  298. package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
  299. package/dist/server/node_modules/postgres-interval/index.js +0 -125
  300. package/dist/server/node_modules/postgres-interval/license +0 -21
  301. package/dist/server/node_modules/postgres-interval/package.json +0 -36
  302. package/dist/server/node_modules/postgres-interval/readme.md +0 -48
  303. package/dist/server/node_modules/split2/LICENSE +0 -13
  304. package/dist/server/node_modules/split2/README.md +0 -85
  305. package/dist/server/node_modules/split2/bench.js +0 -27
  306. package/dist/server/node_modules/split2/index.js +0 -141
  307. package/dist/server/node_modules/split2/package.json +0 -39
  308. package/dist/server/node_modules/split2/test.js +0 -409
  309. package/dist/server/node_modules/xtend/.jshintrc +0 -30
  310. package/dist/server/node_modules/xtend/README.md +0 -32
  311. package/dist/server/node_modules/xtend/immutable.js +0 -19
  312. package/dist/server/node_modules/xtend/mutable.js +0 -17
  313. package/dist/server/node_modules/xtend/package.json +0 -55
  314. package/dist/server/node_modules/xtend/test.js +0 -103
  315. /package/dist/client/assets/{readme-viewer-DWnTz46N.css → mcp-server-detail-DWnTz46N.css} +0 -0
@@ -1,4 +1,4 @@
1
- import{r as F,j as t,B as R,c as D,x as xe,ag as re,E as ge,u as fe,v as ne,K as oe,F as pe,g as he,e as je}from"./index-DO8fUd54.js";import{a as be,u as ye}from"./constants-B9t4Nuz_.js";import{p as ee,a as ce,s as ve,b as Ne,e as me,T as we}from"./time-range-picker-Bd3fku3n.js";import{i as ke}from"./Edit05-h0OeCHXT.js";import{V as Se,a as Ce}from"./layout-ubFJ5DPd.js";import{b as de,c as Fe,d as $e,e as Re,B as De,a as Te}from"./breadcrumb-pLMl4xjy.js";import{B as _e}from"./badge-C4uZcq7J.js";import{I as ue}from"./input-BM9bdg-F.js";import{b as Pe,P as Ie,a as Me}from"./popover-D1WG-emQ.js";import{S as ze,a as Be,b as Ee,c as Oe,d as Ae}from"./select-RxUFw6pZ.js";import{T as Ke}from"./textarea-BLuscN8X.js";import{c as Le,a as Ve,T as qe}from"./tooltip-BLTgyg7W.js";import{i as Qe}from"./Code01-DZzuHJh9.js";import{i as We}from"./FilterLines-aqS8nu95.js";import{c as Ge}from"./Grid01-Gq7hBl7S.js";import{s as He}from"./Plus-Dto-8y6a.js";import{s as Ye}from"./Trash01-DkXbOnbi.js";import{s as Ue}from"./XClose-B0FgAxIQ.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"./ChevronDown-D0TXudCx.js";import"./Clock-DKQ7EGj-.js";import"./ChevronLeft-BZsszCLQ.js";import"./ChevronRight-UJRwW9xN.js";import"./index-B1uuY7UL.js";import"./use-local-storage-C3Bo802w.js";import"./useQuery-BeFLqBun.js";import"./useMutation-CNVq636e.js";import"./index-COM-PDLy.js";const Je=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Xe({value:s,onChange:e}){const[r,i]=F.useState(!1),[l,n]=F.useState("raw"),[c,o]=F.useState(s),[m,d]=F.useState(ee(s)),g=F.useRef(s);g.current!==s&&(g.current=s,o(s),d(ee(s)));const f=()=>{e(c.filter(a=>a.key.trim()))},p=()=>{const a=ce(m);o(a),e(a)},j=()=>{if(l==="raw"){const a=ce(m);o(a),n("form")}else d(ee(c)),n("raw")},v=(a,x)=>{const u=[...c],h=u[a];h&&(u[a]={key:x.key??h.key,operator:x.operator??h.operator,value:x.value??h.value},o(u))},b=()=>{o([...c,{key:"",operator:"eq",value:""}])},w=a=>{const x=c.filter((u,h)=>h!==a);o(x),d(ee(x)),e(x.filter(u=>u.key.trim()))},y=()=>{o([]),d(""),e([]),i(!1)},k=s.filter(a=>a.key.trim()).length;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[s.filter(a=>a.key.trim()).map((a,x)=>{const u=a.operator==="exists"?`${a.key}?`:a.operator==="contains"?`${a.key}~${a.value}`:a.operator==="in"?`${a.key}@${a.value}`:`${a.key}=${a.value}`;return t.jsxs(_e,{variant:"secondary",className:"gap-1 pl-2 pr-1 h-7 text-xs font-mono font-normal cursor-default",children:[u,t.jsx("button",{type:"button",className:"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20 transition-colors",onClick:()=>{const h=s.filter((C,$)=>$!==x);e(h)},children:t.jsx(Ue,{size:12})})]},`${a.key}-${x}`)}),t.jsxs(Pe,{open:r,onOpenChange:i,children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(R,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5",children:[t.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),k===0?t.jsx("span",{className:"text-sm",children:"Filter"}):t.jsx("span",{className:"text-sm",children:k})]})}),t.jsxs(Me,{className:"w-[380px] p-4",align:"end",sideOffset:4,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Property Filters"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:j,children:l==="raw"?t.jsx(Ge,{size:14}):t.jsx(Qe,{size:14})})}),t.jsx(qe,{children:l==="raw"?"Switch to form view":"Switch to raw text"})]})]}),l==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ke,{placeholder:`Paste property filters here:
1
+ import{r as $,j as t,B as R,c as D,x as xe,al as re,E as ge,u as fe,v as ne,K as oe,J as pe,g as he,e as je}from"./index-DsOJvxnb.js";import{a as be,u as ye}from"./constants-XtX-WKGm.js";import{p as ee,a as ce,s as ve,b as Ne,e as me,T as we}from"./time-range-picker-DNJ6dRiN.js";import{i as ke}from"./Edit05-Bx682Mm6.js";import{V as Se,a as Ce}from"./layout-C2ZnDBkW.js";import{b as de,c as $e,d as Fe,e as Re,B as De,a as Te}from"./breadcrumb-aP02JuZO.js";import{B as _e}from"./badge-CAg946Xk.js";import{I as ue}from"./input-CUT8DBv1.js";import{b as Pe,P as Ie,a as Me}from"./popover-CF3EN_0o.js";import{S as ze,a as Be,b as Ee,c as Oe,d as Ae}from"./select-DRPG5csU.js";import{T as Ke}from"./textarea-CTzX43MZ.js";import{c as Le,a as Ve,T as qe}from"./tooltip-XyKE4lZa.js";import{i as Qe}from"./Code01-CoTQP8pZ.js";import{i as We}from"./FilterLines-BaTxnUjH.js";import{c as Ge}from"./Grid01-DBOkAm2V.js";import{s as He}from"./Plus-CT_Gcwl2.js";import{s as Ye}from"./Trash01-YPQczxci.js";import{s as Je}from"./XClose-eeK1fS1n.js";import"./Check-BfKCyKXX.js";import"./Copy01-CIUDy0Hr.js";import"./Download01-LinNp3zy.js";import"./Key01-DAjAUWfr.js";import"./Play-C7yKo0dH.js";import"./monaco-editor-J8rInsT2.js";import"./spinner-CqAVfcvO.js";import"./scroll-area-B5XbONJS.js";import"./ChevronUp-1s_S3eDF.js";import"./ChevronDown-BHMaRWRt.js";import"./Clock-rHd8cQAO.js";import"./ChevronLeft-0cpA2yNq.js";import"./ChevronRight-1g9z-Z5h.js";import"./index-X4FDee1r.js";import"./use-local-storage-CxC8ozOe.js";import"./useQuery-D2ShO4od.js";import"./useMutation-B_cFG709.js";import"./index-zjV4p_E5.js";const Ue=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Xe({value:s,onChange:e}){const[r,i]=$.useState(!1),[l,n]=$.useState("raw"),[c,o]=$.useState(s),[m,d]=$.useState(ee(s)),g=$.useRef(s);g.current!==s&&(g.current=s,o(s),d(ee(s)));const f=()=>{e(c.filter(a=>a.key.trim()))},p=()=>{const a=ce(m);o(a),e(a)},j=()=>{if(l==="raw"){const a=ce(m);o(a),n("form")}else d(ee(c)),n("raw")},v=(a,x)=>{const u=[...c],h=u[a];h&&(u[a]={key:x.key??h.key,operator:x.operator??h.operator,value:x.value??h.value},o(u))},b=()=>{o([...c,{key:"",operator:"eq",value:""}])},w=a=>{const x=c.filter((u,h)=>h!==a);o(x),d(ee(x)),e(x.filter(u=>u.key.trim()))},y=()=>{o([]),d(""),e([]),i(!1)},k=s.filter(a=>a.key.trim()).length;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[s.filter(a=>a.key.trim()).map((a,x)=>{const u=a.operator==="exists"?`${a.key}?`:a.operator==="contains"?`${a.key}~${a.value}`:a.operator==="in"?`${a.key}@${a.value}`:`${a.key}=${a.value}`;return t.jsxs(_e,{variant:"secondary",className:"gap-1 pl-2 pr-1 h-7 text-xs font-mono font-normal cursor-default",children:[u,t.jsx("button",{type:"button",className:"ml-0.5 rounded-full p-0.5 hover:bg-muted-foreground/20 transition-colors",onClick:()=>{const h=s.filter((C,F)=>F!==x);e(h)},children:t.jsx(Je,{size:12})})]},`${a.key}-${x}`)}),t.jsxs(Pe,{open:r,onOpenChange:i,children:[t.jsx(Ie,{asChild:!0,children:t.jsxs(R,{variant:"outline",size:"sm",className:"h-7 px-2 gap-1.5",children:[t.jsx(We,{className:"h-3.5 w-3.5 text-muted-foreground"}),k===0?t.jsx("span",{className:"text-sm",children:"Filter"}):t.jsx("span",{className:"text-sm",children:k})]})}),t.jsxs(Me,{className:"w-[380px] p-4",align:"end",sideOffset:4,children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("h4",{className:"text-sm font-medium",children:"Property Filters"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:j,children:l==="raw"?t.jsx(Ge,{size:14}):t.jsx(Qe,{size:14})})}),t.jsx(qe,{children:l==="raw"?"Switch to form view":"Switch to raw text"})]})]}),l==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(Ke,{placeholder:`Paste property filters here:
2
2
  thread_id=abc123
3
3
  user~test
4
- debug?`,value:m,onChange:a=>d(a.target.value),onBlur:p,onKeyDown:a=>{a.key==="Enter"&&a.metaKey&&p()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[c.map((a,x)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",x+1]}),t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>w(x),children:t.jsx(Ye,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ue,{placeholder:"Key (e.g., thread_id)",value:a.key,onChange:u=>v(x,{key:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"flex-1 font-mono text-sm"}),t.jsxs(ze,{value:a.operator,onValueChange:u=>{const h=[...c],C=h[x];C&&(h[x]={...C,operator:u,value:u==="exists"?"":C.value},o(h),e(h.filter($=>$.key.trim())))},children:[t.jsx(Be,{className:"w-28",children:t.jsx(Ee,{})}),t.jsx(Oe,{children:Je.map(u=>t.jsx(Ae,{value:u.value,children:u.label},u.value))})]})]}),a.operator!=="exists"&&t.jsx(ue,{placeholder:"Value",value:a.value,onChange:u=>v(x,{value:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"w-full font-mono text-sm"})]},x)),t.jsxs(R,{variant:"outline",size:"sm",className:"w-full",onClick:b,children:[t.jsx(He,{size:14,className:"mr-1.5"}),"Add filter"]})]}),k>0&&t.jsx(R,{variant:"ghost",size:"sm",className:"w-full mt-3 text-muted-foreground",onClick:y,children:"Clear all filters"})]})]})]})}function G(s,e){return e||Number.isInteger(s)?s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString():s>=1e6?`${(s/1e6).toFixed(2)}M`:s>=1e3?`${(s/1e3).toFixed(2)}K`:s.toFixed(2)}function ae(s){return{sum:"Total",avg:"Average",min:"Minimum",max:"Maximum",count:"Count",last:"Latest"}[s]??s}function le(s){const e=D.c(7),{name:r,subtitle:i}=s;let l;e[0]!==r?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:r}),e[0]=r,e[1]=l):l=e[1];let n;e[2]!==i?(n=t.jsx("div",{className:"text-xs text-muted-foreground",children:i}),e[2]=i,e[3]=n):n=e[3];let c;return e[4]!==l||e[5]!==n?(c=t.jsxs("div",{className:"px-4 py-3",children:[l,n]}),e[4]=l,e[5]=n,e[6]=c):c=e[6],c}function Ze(s){const e=D.c(13),{widget:r,result:i}=s,l=i?.value??0,n=r.aggregation.fn==="count",c=r.name;let o;e[0]!==r.aggregation.fn?(o=ae(r.aggregation.fn),e[0]=r.aggregation.fn,e[1]=o):o=e[1];let m;e[2]!==o||e[3]!==r.name?(m=t.jsx(le,{name:c,subtitle:o}),e[2]=o,e[3]=r.name,e[4]=m):m=e[4];let d;e[5]!==n||e[6]!==l?(d=G(l,n),e[5]=n,e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=t.jsx("div",{className:"px-4 pb-4 mt-auto",children:t.jsx("div",{className:"text-4xl font-bold tabular-nums",children:d})}),e[8]=d,e[9]=g):g=e[9];let f;return e[10]!==m||e[11]!==g?(f=t.jsxs("div",{className:"border rounded-lg bg-card flex flex-col h-full",children:[m,g]}),e[10]=m,e[11]=g,e[12]=f):f=e[12],f}function et(s){const e=D.c(15),{widget:r,result:i}=s;let l,n;e[0]!==i?.groups?(l=i?.groups??[],n=Math.max(...l.map(tt),1),e[0]=i?.groups,e[1]=l,e[2]=n):(l=e[1],n=e[2]);const c=n;let o;e[3]!==r.aggregation.fn||e[4]!==r.aggregation.groupBy?(o=r.aggregation.groupBy?`Grouped by ${r.aggregation.groupBy}`:ae(r.aggregation.fn),e[3]=r.aggregation.fn,e[4]=r.aggregation.groupBy,e[5]=o):o=e[5];let m;e[6]!==o||e[7]!==r.name?(m=t.jsx(le,{name:r.name,subtitle:o}),e[6]=o,e[7]=r.name,e[8]=m):m=e[8];let d;e[9]!==l||e[10]!==c?(d=t.jsx("div",{className:"max-h-[300px] overflow-auto",children:l.length===0?t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"No data available for this query"}):t.jsx("div",{className:"divide-y",children:l.map(f=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[t.jsx("span",{className:"text-sm truncate flex-1 min-w-0",children:f.key||"(empty)"}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 w-32",children:[t.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${f.value/c*100}%`}})}),t.jsx("span",{className:"text-xs tabular-nums text-muted-foreground w-10 text-right",children:G(f.value,!0)})]})]},f.key))})}),e[9]=l,e[10]=c,e[11]=d):d=e[11];let g;return e[12]!==m||e[13]!==d?(g=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden flex flex-col h-full",children:[m,d]}),e[12]=m,e[13]=d,e[14]=g):g=e[14],g}function tt(s){return s.value}function st(s){const e=D.c(37),{widget:r,result:i}=s;let l,n,c,o,m,d,g,f,p;if(e[0]!==i?.timeseries||e[1]!==r.aggregation.fn||e[2]!==r.aggregation.interval||e[3]!==r.name){p=i?.timeseries??[],n=Math.max(...p.map(at),1);const a=p.reduce(rt,0);l=r.aggregation.fn==="count",f="border rounded-lg bg-card overflow-hidden flex flex-col h-full",d="flex items-start justify-between pr-4";const x=r.name;let u;e[13]!==r.aggregation.fn?(u=ae(r.aggregation.fn),e[13]=r.aggregation.fn,e[14]=u):u=e[14];const h=`${u} per ${r.aggregation.interval}`;e[15]!==h||e[16]!==r.name?(g=t.jsx(le,{name:x,subtitle:h}),e[15]=h,e[16]=r.name,e[17]=g):g=e[17],m="text-right pt-3",c="text-lg font-semibold tabular-nums leading-tight",o=G(a,l),e[0]=i?.timeseries,e[1]=r.aggregation.fn,e[2]=r.aggregation.interval,e[3]=r.name,e[4]=l,e[5]=n,e[6]=c,e[7]=o,e[8]=m,e[9]=d,e[10]=g,e[11]=f,e[12]=p}else l=e[4],n=e[5],c=e[6],o=e[7],m=e[8],d=e[9],g=e[10],f=e[11],p=e[12];let j;e[18]!==c||e[19]!==o?(j=t.jsx("div",{className:c,children:o}),e[18]=c,e[19]=o,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"text-xs text-muted-foreground",children:"total"}),e[21]=v):v=e[21];let b;e[22]!==m||e[23]!==j?(b=t.jsxs("div",{className:m,children:[j,v]}),e[22]=m,e[23]=j,e[24]=b):b=e[24];let w;e[25]!==d||e[26]!==g||e[27]!==b?(w=t.jsxs("div",{className:d,children:[g,b]}),e[25]=d,e[26]=g,e[27]=b,e[28]=w):w=e[28];let y;e[29]!==l||e[30]!==n||e[31]!==p?(y=t.jsx("div",{className:"px-4 pb-3 flex-1 flex flex-col min-h-0",children:p.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No data available"}):t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("div",{className:"text-[10px] text-muted-foreground mb-1 tabular-nums",children:G(n,l)}),t.jsx("div",{className:"flex items-end gap-[2px] flex-1",children:p.map((a,x)=>t.jsx("div",{className:"group relative flex-1 bg-primary/70 rounded-t transition-all hover:bg-primary cursor-default",style:{height:`${a.value/n*100}%`,minHeight:a.value>0?"3px":"0px"},children:t.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-10 pointer-events-none",children:t.jsx("div",{className:"bg-foreground text-background text-[10px] px-1.5 py-0.5 rounded whitespace-nowrap tabular-nums",children:G(a.value,l)})})},x))}),t.jsx("div",{className:"flex justify-between text-[10px] text-muted-foreground mt-1.5 tabular-nums",children:p.length>0&&(()=>{const a=new Date(p[0].timestamp),x=new Date(p[p.length-1].timestamp),C=x.getTime()-a.getTime()>864e5?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a.toLocaleString([],C)}),t.jsx("span",{children:x.toLocaleString([],C)})]})})()})]})}),e[29]=l,e[30]=n,e[31]=p,e[32]=y):y=e[32];let k;return e[33]!==w||e[34]!==y||e[35]!==f?(k=t.jsxs("div",{className:f,children:[w,y]}),e[33]=w,e[34]=y,e[35]=f,e[36]=k):k=e[36],k}function rt(s,e){return s+e.value}function at(s){return s.value}function lt(s){const e=D.c(81),{dashboardId:r,timeRange:i,propertyFilters:l,onEdit:n,onRefresh:c,onTimeRangeChange:o,onPropertyFiltersChange:m}=s,{org:d,project:g,locator:f}=fe();let p;e[0]!==d.id?(p={connectionId:be,orgId:d.id},e[0]=d.id,e[1]=p):p=e[1];const j=ye(p);let v;e[2]!==r||e[3]!==f?(v=oe.monitoringDashboardDetails(f,r),e[2]=r,e[3]=f,e[4]=v):v=e[4];let b;e[5]!==j||e[6]!==r?(b=async()=>{if(!j)throw new Error("MCP client not available");const N=await j.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:r}});return N.structuredContent??N},e[5]=j,e[6]=r,e[7]=b):b=e[7];let w;e[8]!==v||e[9]!==b?(w={queryKey:v,queryFn:b},e[8]=v,e[9]=b,e[10]=w):w=e[10];const{data:y}=ne(w);let k,a,x;if(e[11]!==r||e[12]!==f||e[13]!==l||e[14]!==i.from||e[15]!==i.to){const N=l.filter(ot),S=ve(N);k=N.length>0?Ne(N):void 0,x=ne,a=oe.monitoringDashboardQuery(f,r,i.from,i.to,S||void 0),e[11]=r,e[12]=f,e[13]=l,e[14]=i.from,e[15]=i.to,e[16]=k,e[17]=a,e[18]=x}else k=e[16],a=e[17],x=e[18];let u;e[19]!==k||e[20]!==j||e[21]!==r||e[22]!==i.from||e[23]!==i.to?(u=async()=>{if(!j)throw new Error("MCP client not available");const N=me(i.from),S=me(i.to),W=N.date||new Date(Date.now()-864e5),se=S.date||new Date,ie=await j.callTool({name:"MONITORING_DASHBOARD_QUERY",arguments:{dashboardId:r,timeRange:{startDate:W.toISOString(),endDate:se.toISOString()},...k?{propertyFilters:k}:{}}});return ie.structuredContent??ie},e[19]=k,e[20]=j,e[21]=r,e[22]=i.from,e[23]=i.to,e[24]=u):u=e[24];let h;e[25]!==a||e[26]!==u?(h={queryKey:a,queryFn:u,refetchInterval:3e4},e[25]=a,e[26]=u,e[27]=h):h=e[27];const{data:C,isRefetching:$}=x(h);if(!y){let N;return e[28]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"}),e[28]=N):N=e[28],N}let H;e[29]!==C?.results?(H=new Map(C?.results?.map(nt)??[]),e[29]=C?.results,e[30]=H):H=e[30];const Q=H;let T;e[31]!==d.slug||e[32]!==g.slug?(T={org:d.slug,project:g.slug},e[31]=d.slug,e[32]=g.slug,e[33]=T):T=e[33];let Y;e[34]===Symbol.for("react.memo_cache_sentinel")?(Y={tab:"dashboards"},e[34]=Y):Y=e[34];let _;e[35]!==T?(_=t.jsx(de,{children:t.jsx($e,{asChild:!0,children:t.jsx(pe,{to:"/$org/$project/monitoring",params:T,search:Y,children:"Monitoring"})})}),e[35]=T,e[36]=_):_=e[36];let U;e[37]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Re,{}),e[37]=U):U=e[37];let P;e[38]!==y.name?(P=t.jsx(de,{children:t.jsx(Fe,{children:y.name})}),e[38]=y.name,e[39]=P):P=e[39];let J;e[40]!==_||e[41]!==P?(J=t.jsx(De,{children:t.jsxs(Te,{children:[_,U,P]})}),e[40]=_,e[41]=P,e[42]=J):J=e[42];const te=J;let I;e[43]!==n?(I=n&&t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:n,children:t.jsx(ke,{size:14})}),e[43]=n,e[44]=I):I=e[44];let X;e[45]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(re,{size:14}),e[45]=X):X=e[45];let M;e[46]!==c?(M=t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:c,children:X}),e[46]=c,e[47]=M):M=e[47];let z;e[48]!==m||e[49]!==l?(z=t.jsx(Xe,{value:l,onChange:m}),e[48]=m,e[49]=l,e[50]=z):z=e[50];let B;e[51]!==i.from||e[52]!==i.to?(B={from:i.from,to:i.to},e[51]=i.from,e[52]=i.to,e[53]=B):B=e[53];let E;e[54]!==o||e[55]!==B?(E=t.jsx(we,{value:B,onChange:o,className:"min-w-0"}),e[54]=o,e[55]=B,e[56]=E):E=e[56];let O;e[57]!==I||e[58]!==M||e[59]!==z||e[60]!==E?(O=t.jsxs(Se,{children:[I,M,z,E]}),e[57]=I,e[58]=M,e[59]=z,e[60]=E,e[61]=O):O=e[61];let A;e[62]!==y.description?(A=y.description&&t.jsx("div",{className:"mb-6",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:y.description})}),e[62]=y.description,e[63]=A):A=e[63];let K;if(e[64]!==y.widgets||e[65]!==Q){let N;e[67]!==Q?(N=S=>{const W=Q.get(S.id),se=S.type==="metric"?"":"col-span-2";return t.jsxs("div",{className:se,children:[S.type==="metric"&&t.jsx(Ze,{widget:S,result:W}),S.type==="table"&&t.jsx(et,{widget:S,result:W}),S.type==="timeseries"&&t.jsx(st,{widget:S,result:W})]},S.id)},e[67]=Q,e[68]=N):N=e[68],K=y.widgets.map(N),e[64]=y.widgets,e[65]=Q,e[66]=K}else K=e[66];let L;e[69]!==K?(L=t.jsx("div",{className:"grid grid-cols-5 gap-4",ref:it,children:K}),e[69]=K,e[70]=L):L=e[70];let V;e[71]!==$?(V=$&&t.jsxs("div",{className:"fixed bottom-4 right-4 bg-background border rounded-lg px-3 py-2 shadow-lg flex items-center gap-2 text-sm",children:[t.jsx(re,{size:14,className:"animate-spin"}),"Refreshing..."]}),e[71]=$,e[72]=V):V=e[72];let q;e[73]!==A||e[74]!==L||e[75]!==V?(q=t.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[A,L,V]}),e[73]=A,e[74]=L,e[75]=V,e[76]=q):q=e[76];let Z;return e[77]!==te||e[78]!==O||e[79]!==q?(Z=t.jsxs(Ce,{breadcrumb:te,children:[O,q]}),e[77]=te,e[78]=O,e[79]=q,e[80]=Z):Z=e[80],Z}function it(s){if(!s)return;const e=()=>{const i=(s.clientWidth-64)/5;s.style.gridAutoRows=`${i}px`};e(),new ResizeObserver(e).observe(s)}function nt(s){return[s.widgetId,s]}function ot(s){return s.key.trim()}function ct(s){const e=D.c(13),{dashboardId:r,onEdit:i}=s,l=xe();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"now-24h",to:"now"},e[0]=n):n=e[0];const[c,o]=F.useState(n);let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[1]=m):m=e[1];const[d,g]=F.useState(m);let f;e[2]!==r||e[3]!==l?(f=()=>{l.invalidateQueries({predicate:w=>w.queryKey[0]==="monitoringDashboardQuery"&&w.queryKey[2]===r})},e[2]=r,e[3]=l,e[4]=f):f=e[4];const p=f;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard"}),e[5]=j):j=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})}),e[6]=v):v=e[6];let b;return e[7]!==r||e[8]!==p||e[9]!==i||e[10]!==d||e[11]!==c?(b=t.jsx(ge,{fallback:j,children:t.jsx(F.Suspense,{fallback:v,children:t.jsx(lt,{dashboardId:r,timeRange:c,propertyFilters:d,onEdit:i,onRefresh:p,onTimeRangeChange:o,onPropertyFiltersChange:g})})}),e[7]=r,e[8]=p,e[9]=i,e[10]=d,e[11]=c,e[12]=b):b=e[12],b}function Wt(){const s=D.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{dashboardId:r}=he(e),{org:i,project:l}=fe(),n=je();let c;s[1]!==r||s[2]!==n||s[3]!==i.slug||s[4]!==l.slug?(c=()=>{n({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:i.slug,project:l.slug,dashboardId:r}})},s[1]=r,s[2]=n,s[3]=i.slug,s[4]=l.slug,s[5]=c):c=s[5];const o=c;let m;return s[6]!==r||s[7]!==o?(m=t.jsx(ct,{dashboardId:r,onEdit:o}),s[6]=r,s[7]=o,s[8]=m):m=s[8],m}export{Wt as default};
4
+ debug?`,value:m,onChange:a=>d(a.target.value),onBlur:p,onKeyDown:a=>{a.key==="Enter"&&a.metaKey&&p()},className:"font-mono text-sm min-h-[80px] resize-none"}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",t.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):t.jsxs("div",{className:"space-y-3",children:[c.map((a,x)=>t.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",x+1]}),t.jsx(R,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>w(x),children:t.jsx(Ye,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ue,{placeholder:"Key (e.g., thread_id)",value:a.key,onChange:u=>v(x,{key:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"flex-1 font-mono text-sm"}),t.jsxs(ze,{value:a.operator,onValueChange:u=>{const h=[...c],C=h[x];C&&(h[x]={...C,operator:u,value:u==="exists"?"":C.value},o(h),e(h.filter(F=>F.key.trim())))},children:[t.jsx(Be,{className:"w-28",children:t.jsx(Ee,{})}),t.jsx(Oe,{children:Ue.map(u=>t.jsx(Ae,{value:u.value,children:u.label},u.value))})]})]}),a.operator!=="exists"&&t.jsx(ue,{placeholder:"Value",value:a.value,onChange:u=>v(x,{value:u.target.value}),onBlur:f,onKeyDown:u=>{u.key==="Enter"&&f()},className:"w-full font-mono text-sm"})]},x)),t.jsxs(R,{variant:"outline",size:"sm",className:"w-full",onClick:b,children:[t.jsx(He,{size:14,className:"mr-1.5"}),"Add filter"]})]}),k>0&&t.jsx(R,{variant:"ghost",size:"sm",className:"w-full mt-3 text-muted-foreground",onClick:y,children:"Clear all filters"})]})]})]})}function G(s,e){return e||Number.isInteger(s)?s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:s.toLocaleString():s>=1e6?`${(s/1e6).toFixed(2)}M`:s>=1e3?`${(s/1e3).toFixed(2)}K`:s.toFixed(2)}function ae(s){return{sum:"Total",avg:"Average",min:"Minimum",max:"Maximum",count:"Count",last:"Latest"}[s]??s}function le(s){const e=D.c(7),{name:r,subtitle:i}=s;let l;e[0]!==r?(l=t.jsx("div",{className:"text-sm font-medium text-foreground",children:r}),e[0]=r,e[1]=l):l=e[1];let n;e[2]!==i?(n=t.jsx("div",{className:"text-xs text-muted-foreground",children:i}),e[2]=i,e[3]=n):n=e[3];let c;return e[4]!==l||e[5]!==n?(c=t.jsxs("div",{className:"px-4 py-3",children:[l,n]}),e[4]=l,e[5]=n,e[6]=c):c=e[6],c}function Ze(s){const e=D.c(13),{widget:r,result:i}=s,l=i?.value??0,n=r.aggregation.fn==="count",c=r.name;let o;e[0]!==r.aggregation.fn?(o=ae(r.aggregation.fn),e[0]=r.aggregation.fn,e[1]=o):o=e[1];let m;e[2]!==o||e[3]!==r.name?(m=t.jsx(le,{name:c,subtitle:o}),e[2]=o,e[3]=r.name,e[4]=m):m=e[4];let d;e[5]!==n||e[6]!==l?(d=G(l,n),e[5]=n,e[6]=l,e[7]=d):d=e[7];let g;e[8]!==d?(g=t.jsx("div",{className:"px-4 pb-4 mt-auto",children:t.jsx("div",{className:"text-4xl font-bold tabular-nums",children:d})}),e[8]=d,e[9]=g):g=e[9];let f;return e[10]!==m||e[11]!==g?(f=t.jsxs("div",{className:"border rounded-lg bg-card flex flex-col h-full",children:[m,g]}),e[10]=m,e[11]=g,e[12]=f):f=e[12],f}function et(s){const e=D.c(15),{widget:r,result:i}=s;let l,n;e[0]!==i?.groups?(l=i?.groups??[],n=Math.max(...l.map(tt),1),e[0]=i?.groups,e[1]=l,e[2]=n):(l=e[1],n=e[2]);const c=n;let o;e[3]!==r.aggregation.fn||e[4]!==r.aggregation.groupBy?(o=r.aggregation.groupBy?`Grouped by ${r.aggregation.groupBy}`:ae(r.aggregation.fn),e[3]=r.aggregation.fn,e[4]=r.aggregation.groupBy,e[5]=o):o=e[5];let m;e[6]!==o||e[7]!==r.name?(m=t.jsx(le,{name:r.name,subtitle:o}),e[6]=o,e[7]=r.name,e[8]=m):m=e[8];let d;e[9]!==l||e[10]!==c?(d=t.jsx("div",{className:"max-h-[300px] overflow-auto",children:l.length===0?t.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"No data available for this query"}):t.jsx("div",{className:"divide-y",children:l.map(f=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[t.jsx("span",{className:"text-sm truncate flex-1 min-w-0",children:f.key||"(empty)"}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 w-32",children:[t.jsx("div",{className:"flex-1 h-1.5 bg-muted rounded-full overflow-hidden",children:t.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${f.value/c*100}%`}})}),t.jsx("span",{className:"text-xs tabular-nums text-muted-foreground w-10 text-right",children:G(f.value,!0)})]})]},f.key))})}),e[9]=l,e[10]=c,e[11]=d):d=e[11];let g;return e[12]!==m||e[13]!==d?(g=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden flex flex-col h-full",children:[m,d]}),e[12]=m,e[13]=d,e[14]=g):g=e[14],g}function tt(s){return s.value}function st(s){const e=D.c(37),{widget:r,result:i}=s;let l,n,c,o,m,d,g,f,p;if(e[0]!==i?.timeseries||e[1]!==r.aggregation.fn||e[2]!==r.aggregation.interval||e[3]!==r.name){p=i?.timeseries??[],n=Math.max(...p.map(at),1);const a=p.reduce(rt,0);l=r.aggregation.fn==="count",f="border rounded-lg bg-card overflow-hidden flex flex-col h-full",d="flex items-start justify-between pr-4";const x=r.name;let u;e[13]!==r.aggregation.fn?(u=ae(r.aggregation.fn),e[13]=r.aggregation.fn,e[14]=u):u=e[14];const h=`${u} per ${r.aggregation.interval}`;e[15]!==h||e[16]!==r.name?(g=t.jsx(le,{name:x,subtitle:h}),e[15]=h,e[16]=r.name,e[17]=g):g=e[17],m="text-right pt-3",c="text-lg font-semibold tabular-nums leading-tight",o=G(a,l),e[0]=i?.timeseries,e[1]=r.aggregation.fn,e[2]=r.aggregation.interval,e[3]=r.name,e[4]=l,e[5]=n,e[6]=c,e[7]=o,e[8]=m,e[9]=d,e[10]=g,e[11]=f,e[12]=p}else l=e[4],n=e[5],c=e[6],o=e[7],m=e[8],d=e[9],g=e[10],f=e[11],p=e[12];let j;e[18]!==c||e[19]!==o?(j=t.jsx("div",{className:c,children:o}),e[18]=c,e[19]=o,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"text-xs text-muted-foreground",children:"total"}),e[21]=v):v=e[21];let b;e[22]!==m||e[23]!==j?(b=t.jsxs("div",{className:m,children:[j,v]}),e[22]=m,e[23]=j,e[24]=b):b=e[24];let w;e[25]!==d||e[26]!==g||e[27]!==b?(w=t.jsxs("div",{className:d,children:[g,b]}),e[25]=d,e[26]=g,e[27]=b,e[28]=w):w=e[28];let y;e[29]!==l||e[30]!==n||e[31]!==p?(y=t.jsx("div",{className:"px-4 pb-3 flex-1 flex flex-col min-h-0",children:p.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No data available"}):t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("div",{className:"text-[10px] text-muted-foreground mb-1 tabular-nums",children:G(n,l)}),t.jsx("div",{className:"flex items-end gap-[2px] flex-1",children:p.map((a,x)=>t.jsx("div",{className:"group relative flex-1 bg-primary/70 rounded-t transition-all hover:bg-primary cursor-default",style:{height:`${a.value/n*100}%`,minHeight:a.value>0?"3px":"0px"},children:t.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-10 pointer-events-none",children:t.jsx("div",{className:"bg-foreground text-background text-[10px] px-1.5 py-0.5 rounded whitespace-nowrap tabular-nums",children:G(a.value,l)})})},x))}),t.jsx("div",{className:"flex justify-between text-[10px] text-muted-foreground mt-1.5 tabular-nums",children:p.length>0&&(()=>{const a=new Date(p[0].timestamp),x=new Date(p[p.length-1].timestamp),C=x.getTime()-a.getTime()>864e5?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"};return t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a.toLocaleString([],C)}),t.jsx("span",{children:x.toLocaleString([],C)})]})})()})]})}),e[29]=l,e[30]=n,e[31]=p,e[32]=y):y=e[32];let k;return e[33]!==w||e[34]!==y||e[35]!==f?(k=t.jsxs("div",{className:f,children:[w,y]}),e[33]=w,e[34]=y,e[35]=f,e[36]=k):k=e[36],k}function rt(s,e){return s+e.value}function at(s){return s.value}function lt(s){const e=D.c(81),{dashboardId:r,timeRange:i,propertyFilters:l,onEdit:n,onRefresh:c,onTimeRangeChange:o,onPropertyFiltersChange:m}=s,{org:d,project:g,locator:f}=fe();let p;e[0]!==d.id?(p={connectionId:be,orgId:d.id},e[0]=d.id,e[1]=p):p=e[1];const j=ye(p);let v;e[2]!==r||e[3]!==f?(v=oe.monitoringDashboardDetails(f,r),e[2]=r,e[3]=f,e[4]=v):v=e[4];let b;e[5]!==j||e[6]!==r?(b=async()=>{if(!j)throw new Error("MCP client not available");const N=await j.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:r}});return N.structuredContent??N},e[5]=j,e[6]=r,e[7]=b):b=e[7];let w;e[8]!==v||e[9]!==b?(w={queryKey:v,queryFn:b},e[8]=v,e[9]=b,e[10]=w):w=e[10];const{data:y}=ne(w);let k,a,x;if(e[11]!==r||e[12]!==f||e[13]!==l||e[14]!==i.from||e[15]!==i.to){const N=l.filter(ot),S=ve(N);k=N.length>0?Ne(N):void 0,x=ne,a=oe.monitoringDashboardQuery(f,r,i.from,i.to,S||void 0),e[11]=r,e[12]=f,e[13]=l,e[14]=i.from,e[15]=i.to,e[16]=k,e[17]=a,e[18]=x}else k=e[16],a=e[17],x=e[18];let u;e[19]!==k||e[20]!==j||e[21]!==r||e[22]!==i.from||e[23]!==i.to?(u=async()=>{if(!j)throw new Error("MCP client not available");const N=me(i.from),S=me(i.to),W=N.date||new Date(Date.now()-864e5),se=S.date||new Date,ie=await j.callTool({name:"MONITORING_DASHBOARD_QUERY",arguments:{dashboardId:r,timeRange:{startDate:W.toISOString(),endDate:se.toISOString()},...k?{propertyFilters:k}:{}}});return ie.structuredContent??ie},e[19]=k,e[20]=j,e[21]=r,e[22]=i.from,e[23]=i.to,e[24]=u):u=e[24];let h;e[25]!==a||e[26]!==u?(h={queryKey:a,queryFn:u,refetchInterval:3e4},e[25]=a,e[26]=u,e[27]=h):h=e[27];const{data:C,isRefetching:F}=x(h);if(!y){let N;return e[28]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"}),e[28]=N):N=e[28],N}let H;e[29]!==C?.results?(H=new Map(C?.results?.map(nt)??[]),e[29]=C?.results,e[30]=H):H=e[30];const Q=H;let T;e[31]!==d.slug||e[32]!==g.slug?(T={org:d.slug,project:g.slug},e[31]=d.slug,e[32]=g.slug,e[33]=T):T=e[33];let Y;e[34]===Symbol.for("react.memo_cache_sentinel")?(Y={tab:"dashboards"},e[34]=Y):Y=e[34];let _;e[35]!==T?(_=t.jsx(de,{children:t.jsx(Fe,{asChild:!0,children:t.jsx(pe,{to:"/$org/$project/monitoring",params:T,search:Y,children:"Monitoring"})})}),e[35]=T,e[36]=_):_=e[36];let J;e[37]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx(Re,{}),e[37]=J):J=e[37];let P;e[38]!==y.name?(P=t.jsx(de,{children:t.jsx($e,{children:y.name})}),e[38]=y.name,e[39]=P):P=e[39];let U;e[40]!==_||e[41]!==P?(U=t.jsx(De,{children:t.jsxs(Te,{children:[_,J,P]})}),e[40]=_,e[41]=P,e[42]=U):U=e[42];const te=U;let I;e[43]!==n?(I=n&&t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:n,children:t.jsx(ke,{size:14})}),e[43]=n,e[44]=I):I=e[44];let X;e[45]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(re,{size:14}),e[45]=X):X=e[45];let M;e[46]!==c?(M=t.jsx(R,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:c,children:X}),e[46]=c,e[47]=M):M=e[47];let z;e[48]!==m||e[49]!==l?(z=t.jsx(Xe,{value:l,onChange:m}),e[48]=m,e[49]=l,e[50]=z):z=e[50];let B;e[51]!==i.from||e[52]!==i.to?(B={from:i.from,to:i.to},e[51]=i.from,e[52]=i.to,e[53]=B):B=e[53];let E;e[54]!==o||e[55]!==B?(E=t.jsx(we,{value:B,onChange:o,className:"min-w-0"}),e[54]=o,e[55]=B,e[56]=E):E=e[56];let O;e[57]!==I||e[58]!==M||e[59]!==z||e[60]!==E?(O=t.jsxs(Se,{children:[I,M,z,E]}),e[57]=I,e[58]=M,e[59]=z,e[60]=E,e[61]=O):O=e[61];let A;e[62]!==y.description?(A=y.description&&t.jsx("div",{className:"mb-6",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:y.description})}),e[62]=y.description,e[63]=A):A=e[63];let K;if(e[64]!==y.widgets||e[65]!==Q){let N;e[67]!==Q?(N=S=>{const W=Q.get(S.id),se=S.type==="metric"?"":"col-span-2";return t.jsxs("div",{className:se,children:[S.type==="metric"&&t.jsx(Ze,{widget:S,result:W}),S.type==="table"&&t.jsx(et,{widget:S,result:W}),S.type==="timeseries"&&t.jsx(st,{widget:S,result:W})]},S.id)},e[67]=Q,e[68]=N):N=e[68],K=y.widgets.map(N),e[64]=y.widgets,e[65]=Q,e[66]=K}else K=e[66];let L;e[69]!==K?(L=t.jsx("div",{className:"grid grid-cols-5 gap-4",ref:it,children:K}),e[69]=K,e[70]=L):L=e[70];let V;e[71]!==F?(V=F&&t.jsxs("div",{className:"fixed bottom-4 right-4 bg-background border rounded-lg px-3 py-2 shadow-lg flex items-center gap-2 text-sm",children:[t.jsx(re,{size:14,className:"animate-spin"}),"Refreshing..."]}),e[71]=F,e[72]=V):V=e[72];let q;e[73]!==A||e[74]!==L||e[75]!==V?(q=t.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[A,L,V]}),e[73]=A,e[74]=L,e[75]=V,e[76]=q):q=e[76];let Z;return e[77]!==te||e[78]!==O||e[79]!==q?(Z=t.jsxs(Ce,{breadcrumb:te,children:[O,q]}),e[77]=te,e[78]=O,e[79]=q,e[80]=Z):Z=e[80],Z}function it(s){if(!s)return;const e=()=>{const i=(s.clientWidth-64)/5;s.style.gridAutoRows=`${i}px`};e(),new ResizeObserver(e).observe(s)}function nt(s){return[s.widgetId,s]}function ot(s){return s.key.trim()}function ct(s){const e=D.c(13),{dashboardId:r,onEdit:i}=s,l=xe();let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"now-24h",to:"now"},e[0]=n):n=e[0];const[c,o]=$.useState(n);let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[1]=m):m=e[1];const[d,g]=$.useState(m);let f;e[2]!==r||e[3]!==l?(f=()=>{l.invalidateQueries({predicate:w=>w.queryKey[0]==="monitoringDashboardQuery"&&w.queryKey[2]===r})},e[2]=r,e[3]=l,e[4]=f):f=e[4];const p=f;let j;e[5]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard"}),e[5]=j):j=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})}),e[6]=v):v=e[6];let b;return e[7]!==r||e[8]!==p||e[9]!==i||e[10]!==d||e[11]!==c?(b=t.jsx(ge,{fallback:j,children:t.jsx($.Suspense,{fallback:v,children:t.jsx(lt,{dashboardId:r,timeRange:c,propertyFilters:d,onEdit:i,onRefresh:p,onTimeRangeChange:o,onPropertyFiltersChange:g})})}),e[7]=r,e[8]=p,e[9]=i,e[10]=d,e[11]=c,e[12]=b):b=e[12],b}function Wt(){const s=D.c(9);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},s[0]=e):e=s[0];const{dashboardId:r}=he(e),{org:i,project:l}=fe(),n=je();let c;s[1]!==r||s[2]!==n||s[3]!==i.slug||s[4]!==l.slug?(c=()=>{n({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:i.slug,project:l.slug,dashboardId:r}})},s[1]=r,s[2]=n,s[3]=i.slug,s[4]=l.slug,s[5]=c):c=s[5];const o=c;let m;return s[6]!==r||s[7]!==o?(m=t.jsx(ct,{dashboardId:r,onEdit:o}),s[6]=r,s[7]=o,s[8]=m):m=s[8],m}export{Wt as default};
@@ -0,0 +1,4 @@
1
+ import{r as w,c7 as ss,c as re,y as fe,j as s,u as pe,E as Fe,x as as,e as Ve,v as rs,K as Pe,B as ue,w as Ee,O as gt,d as ns}from"./index-DsOJvxnb.js";import{C as ls}from"./collection-search-62vwaqdq.js";import{P as xe}from"./index-X4FDee1r.js";import{B as vt,a as bt,b as jt,c as Nt}from"./breadcrumb-aP02JuZO.js";import{E as We}from"./empty-state-D4GX29pL.js";import{E as os,d as is,e as Je,b as cs,T as ds,M as He,p as ke,s as je,a as Ze}from"./time-range-picker-DNJ6dRiN.js";import{I as Ae}from"./integration-icon-CVxvM4fR.js";import{B as Le}from"./badge-CAg946Xk.js";import{t as Re}from"./ChevronDown-BHMaRWRt.js";import{i as ms}from"./ChevronRight-1g9z-Z5h.js";import{e as de,b as we,d as yt,T as wt,a as St,c as ne}from"./table-DJbHB5IL.js";import{S as us,b as xs,H as Ne,M as fs,K as Ct}from"./monitoring-stats-row-Dx_W_1nT.js";import{a as Ie,u as De,W as ps}from"./constants-XtX-WKGm.js";import{u as Ue}from"./use-mcp-tools-BXmfFmar.js";import{i as hs}from"./DotsVertical-Y8XpM2B_.js";import{i as gs}from"./Edit05-Bx682Mm6.js";import{s as It}from"./Plus-CT_Gcwl2.js";import{s as Dt}from"./Trash01-YPQczxci.js";import{C as vs}from"./connection-card-D9I87KkT.js";import{D as bs,a as js,b as Ns,c as Xe}from"./dropdown-menu-DzFMEBVS.js";import{f as ys,a as ws,b as Ss,c as Cs,d as Is,e as Ds,A as Ts,h as ks}from"./alert-dialog-BVglQjyM.js";import{u as Ms}from"./use-infinite-scroll-CvaIKLMy.js";import{u as _s}from"./use-members-B-Cx3SpJ.js";import{u as Ps}from"./useSuspenseInfiniteQuery-CT40dICu.js";import{b as Tt}from"./use-connection-DmR852Js.js";import{b as As}from"./use-virtual-mcp-C9XdHCA_.js";import{i as Ls}from"./Code01-CoTQP8pZ.js";import{n as $e}from"./Container-DwxLlgWA.js";import{i as Es}from"./FilterLines-BaTxnUjH.js";import{c as Os}from"./Grid01-DBOkAm2V.js";import{I as Oe}from"./input-CUT8DBv1.js";import{C as Ye}from"./checkbox-DLsMmmhu.js";import{c as Rs,d as $s,e as et,a as zs,C as Ks,b as Bs}from"./command-ChmbB2jp.js";import{P as kt,a as Mt,b as _t}from"./popover-CF3EN_0o.js";import{S as tt,a as st,b as at,c as rt,d as Me}from"./select-DRPG5csU.js";import{T as Fs}from"./textarea-CTzX43MZ.js";import{c as Vs,a as Ws,T as Hs}from"./tooltip-XyKE4lZa.js";import{C as Pt}from"./collection-tabs-FJx5TF4Z.js";import{S as Us}from"./switch-BQjzAGvm.js";import{L as Gs}from"./label-iPw5smAw.js";import{c as Ge,s as At,d as qs,e as Lt,f as Et,g as Qs,i as Js,h as nt,p as Zs,r as Ot,D as Xs,u as Rt,R as Ys,S as ea,j as ta,k as $t,l as sa,n as aa,m as ra,o as na,q as la,t as oa,v as ia,Z as ca,L as da,G as ma,w as zt,x as lt,y as ot,z as ua,J as xa,A as ye,B as fa,E as pa,F as ha,H as ga,I as va,K as ba,C as it,a as ct}from"./chart-D9IwJUjP.js";import{g as ja,A as Na,D as ya,X as dt}from"./XAxis-Du5m1KMx.js";import"./Loading01-BNn4YU_K.js";import"./SearchMd-BLeX5weN.js";import"./use-local-storage-CxC8ozOe.js";import"./useQuery-D2ShO4od.js";import"./useMutation-B_cFG709.js";import"./Check-BfKCyKXX.js";import"./Copy01-CIUDy0Hr.js";import"./Download01-LinNp3zy.js";import"./Key01-DAjAUWfr.js";import"./Play-C7yKo0dH.js";import"./monaco-editor-J8rInsT2.js";import"./spinner-CqAVfcvO.js";import"./scroll-area-B5XbONJS.js";import"./ChevronUp-1s_S3eDF.js";import"./Clock-rHd8cQAO.js";import"./ChevronLeft-0cpA2yNq.js";import"./card-RQxLVCBk.js";import"./infiniteQueryObserver-BE0Fq7u7.js";import"./use-collections-DSWhP4jg.js";import"./index-CcA_QriT.js";import"./index-zjV4p_E5.js";import"./index-Cn8BPdHZ.js";const ze=({size:t=24,color:e="currentColor",...a})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},w.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"}));ze.displayName="BarChart07";const Kt=({size:t=24,color:e="currentColor",...a})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},w.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"}));Kt.displayName="PauseCircle";const Bt=({size:t=24,color:e="currentColor",...a})=>w.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...a},w.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"}),w.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"}));Bt.displayName="PlayCircle";var Ft=(t,e,a,r)=>Lt(t,"xAxis",e,r),Vt=(t,e,a,r)=>Et(t,"xAxis",e,r),Wt=(t,e,a,r)=>Lt(t,"yAxis",a,r),Ht=(t,e,a,r)=>Et(t,"yAxis",a,r),wa=Ge([At,Ft,Wt,Vt,Ht],(t,e,a,r,n)=>Js(t,"xAxis")?nt(e,r,!1):nt(a,n,!1)),Sa=(t,e,a,r,n)=>n;function Ca(t){return t.type==="line"}var Ia=Ge([Qs,Sa],(t,e)=>t.filter(Ca).find(a=>a.id===e)),Da=Ge([At,Ft,Wt,Vt,Ht,Ia,wa,qs],(t,e,a,r,n,l,i,c)=>{var{chartData:o,dataStartIndex:d,dataEndIndex:f}=c;if(!(l==null||e==null||a==null||r==null||n==null||r.length===0||n.length===0||i==null||t!=="horizontal"&&t!=="vertical")){var{dataKey:m,data:p}=l,x;if(p!=null&&p.length>0?x=p:x=o?.slice(d,f+1),x!=null)return Ga({layout:t,xAxis:e,yAxis:a,xAxisTicks:r,yAxisTicks:n,dataKey:m,bandSize:i,displayedData:x})}}),Ta=["id"],ka=["type","layout","connectNulls","needClip","shape"],Ma=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Se(){return Se=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},Se.apply(null,arguments)}function mt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),a.push.apply(a,r)}return a}function me(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?mt(Object(a),!0).forEach(function(r){_a(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):mt(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function _a(t,e,a){return(e=Pa(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Pa(t){var e=Aa(t,"string");return typeof e=="symbol"?e:e+""}function Aa(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qe(t,e){if(t==null)return{};var a,r,n=La(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(r=0;r<l.length;r++)a=l[r],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(n[a]=t[a])}return n}function La(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var Ea=t=>{var{dataKey:e,name:a,stroke:r,legendType:n,hide:l}=t;return[{inactive:l,dataKey:e,type:n,color:r,value:$t(a,e),payload:t}]},Oa=w.memo(t=>{var{dataKey:e,data:a,stroke:r,strokeWidth:n,fill:l,name:i,hide:c,unit:o,tooltipType:d,id:f}=t,m={dataDefinedOnItem:a,getPosition:aa,settings:{stroke:r,strokeWidth:n,fill:l,dataKey:e,nameKey:void 0,name:$t(i,e),hide:c,type:d,color:r,unit:o,graphicalItemId:f}};return w.createElement(sa,{tooltipEntrySettings:m})}),Ut=(t,e)=>"".concat(e,"px ").concat(t,"px");function Ra(t,e){for(var a=t.length%2!==0?[...t,0]:t,r=[],n=0;n<e;++n)r.push(...a);return r}var $a=(t,e,a)=>{var r=a.reduce((p,x)=>p+x,0);if(!r)return Ut(e,t);for(var n=Math.floor(t/r),l=t%r,i=[],c=0,o=0;c<a.length;o+=(d=a[c])!==null&&d!==void 0?d:0,++c){var d,f=a[c];if(f!=null&&o+f>l){i=[...a.slice(0,c),l-o];break}}var m=i.length%2===0?[0,e]:[e];return[...Ra(a,n),...i,...m].map(p=>"".concat(p,"px")).join(", ")};function za(t){var{clipPathId:e,points:a,props:r}=t,{dot:n,dataKey:l,needClip:i}=r,{id:c}=r,o=qe(r,Ta),d=ga(o);return w.createElement(ya,{points:a,dot:n,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:l,baseProps:d,needClip:i,clipPathId:e})}function Ka(t){var{showLabels:e,children:a,points:r}=t,n=w.useMemo(()=>r?.map(l=>{var i,c,o={x:(i=l.x)!==null&&i!==void 0?i:0,y:(c=l.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return me(me({},o),{},{value:l.value,payload:l.payload,viewBox:o,parentViewBox:void 0,fill:void 0})}),[r]);return w.createElement(pa,{value:e?n:void 0},a)}function ut(t){var{clipPathId:e,pathRef:a,points:r,strokeDasharray:n,props:l}=t,{type:i,layout:c,connectNulls:o,needClip:d,shape:f}=l,m=qe(l,ka),p=me(me({},ha(m)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(e,")"):void 0,points:r,type:i,layout:c,connectNulls:o,strokeDasharray:n??l.strokeDasharray});return w.createElement(w.Fragment,null,r?.length>1&&w.createElement(xs,Se({shapeType:"curve",option:f},p,{pathRef:a})),w.createElement(za,{points:r,clipPathId:e,props:l}))}function Ba(t){try{return t&&t.getTotalLength&&t.getTotalLength()||0}catch{return 0}}function Fa(t){var{clipPathId:e,props:a,pathRef:r,previousPointsRef:n,longestAnimatedLengthRef:l}=t,{points:i,strokeDasharray:c,isAnimationActive:o,animationBegin:d,animationDuration:f,animationEasing:m,animateNewValues:p,width:x,height:b,onAnimationEnd:j,onAnimationStart:v}=a,g=n.current,h=ua(i,"recharts-line-"),u=w.useRef(h),[y,S]=w.useState(!1),N=!y,P=w.useCallback(()=>{typeof j=="function"&&j(),S(!1)},[j]),D=w.useCallback(()=>{typeof v=="function"&&v(),S(!0)},[v]),I=Ba(r.current),M=w.useRef(0);u.current!==h&&(M.current=l.current,u.current=h);var L=M.current;return w.createElement(Ka,{points:i,showLabels:N},a.children,w.createElement(xa,{animationId:h,begin:d,duration:f,isActive:o,easing:m,onAnimationEnd:P,onAnimationStart:D,key:h},E=>{var T=ye(L,I+L,E),C=Math.min(T,I),_;if(o)if(c){var O="".concat(c).split(/[,\s]+/gim).map(K=>parseFloat(K));_=$a(C,I,O)}else _=Ut(I,C);else _=c==null?void 0:String(c);if(E>0&&I>0&&(n.current=i,l.current=Math.max(l.current,C)),g){var F=g.length/i.length,W=E===1?i:i.map((K,z)=>{var A=Math.floor(z*F);if(g[A]){var k=g[A];return me(me({},K),{},{x:ye(k.x,K.x,E),y:ye(k.y,K.y,E)})}return p?me(me({},K),{},{x:ye(x*2,K.x,E),y:ye(b/2,K.y,E)}):me(me({},K),{},{x:K.x,y:K.y})});return n.current=W,w.createElement(ut,{props:a,points:W,clipPathId:e,pathRef:r,strokeDasharray:_})}return w.createElement(ut,{props:a,points:i,clipPathId:e,pathRef:r,strokeDasharray:_})}),w.createElement(fa,{label:a.label}))}function Va(t){var{clipPathId:e,props:a}=t,r=w.useRef(null),n=w.useRef(0),l=w.useRef(null);return w.createElement(Fa,{props:a,clipPathId:e,previousPointsRef:r,longestAnimatedLengthRef:n,pathRef:l})}var Wa=(t,e)=>{var a,r;return{x:(a=t.x)!==null&&a!==void 0?a:void 0,y:(r=t.y)!==null&&r!==void 0?r:void 0,value:t.value,errorVal:zt(t.payload,e)}};class Ha extends w.Component{render(){var{hide:e,dot:a,points:r,className:n,xAxisId:l,yAxisId:i,top:c,left:o,width:d,height:f,id:m,needClip:p,zIndex:x}=this.props;if(e)return null;var b=ss("recharts-line",n),j=m,{r:v,strokeWidth:g}=ja(a),h=ia(a),u=v*2+g,y=p?"url(#clipPath-".concat(h?"":"dots-").concat(j,")"):void 0;return w.createElement(ca,{zIndex:x},w.createElement(da,{className:b},p&&w.createElement("defs",null,w.createElement(ma,{clipPathId:j,xAxisId:l,yAxisId:i}),!h&&w.createElement("clipPath",{id:"clipPath-dots-".concat(j)},w.createElement("rect",{x:o-u/2,y:c-u/2,width:d+u,height:f+u}))),w.createElement(us,{xAxisId:l,yAxisId:i,data:r,dataPointFormatter:Wa,errorBarOffset:0},w.createElement(Va,{props:this.props,clipPathId:j}))),w.createElement(Na,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:y}))}}var Gt={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:Xs.line,type:"linear"};function Ua(t){var e=Ot(t,Gt),{activeDot:a,animateNewValues:r,animationBegin:n,animationDuration:l,animationEasing:i,connectNulls:c,dot:o,hide:d,isAnimationActive:f,label:m,legendType:p,xAxisId:x,yAxisId:b,id:j}=e,v=qe(e,Ma),{needClip:g}=ra(x,b),h=na(),u=la(),y=Rt(),S=oa(M=>Da(M,x,b,y,j));if(u!=="horizontal"&&u!=="vertical"||S==null||h==null)return null;var{height:N,width:P,x:D,y:I}=h;return w.createElement(Ha,Se({},v,{id:j,connectNulls:c,dot:o,activeDot:a,animateNewValues:r,animationBegin:n,animationDuration:l,animationEasing:i,isAnimationActive:f,hide:d,label:m,legendType:p,xAxisId:x,yAxisId:b,points:S,layout:u,height:N,width:P,left:D,top:I,needClip:g}))}function Ga(t){var{layout:e,xAxis:a,yAxis:r,xAxisTicks:n,yAxisTicks:l,dataKey:i,bandSize:c,displayedData:o}=t;return o.map((d,f)=>{var m=zt(d,i);if(e==="horizontal"){var p=lt({axis:a,ticks:n,bandSize:c,entry:d,index:f}),x=ot(m)?null:r.scale.map(m);return{x:p,y:x??null,value:m,payload:d}}var b=ot(m)?null:a.scale.map(m),j=lt({axis:r,ticks:l,bandSize:c,entry:d,index:f});return b==null||j==null?null:{x:b,y:j,value:m,payload:d}}).filter(Boolean)}function qa(t){var e=Ot(t,Gt),a=Rt();return w.createElement(Ys,{id:e.id,type:"line"},r=>w.createElement(w.Fragment,null,w.createElement(ea,{legendPayload:Ea(e)}),w.createElement(Oa,{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:r}),w.createElement(ta,{type:"line",id:r,data:e.data,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,hide:e.hide,isPanorama:a}),w.createElement(Ua,Se({},e,{id:r}))))}var Ke=w.memo(qa,Zs);Ke.displayName="Line";var Qa=["axis"],xt=w.forwardRef((t,e)=>w.createElement(va,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Qa,tooltipPayloadSearcher:ba,categoricalChartProps:t,ref:e}));function Ja(t){const e=re.c(49),{log:a,isExpanded:r,connection:n,virtualMcpName:l,onToggle:i,lastLogRef:c}=t;let o,d;if(e[0]!==a.timestamp){const C=new Date(a.timestamp);o=C.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=C.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=a.timestamp,e[1]=o,e[2]=d}else o=e[1],d=e[2];const f=d,m=r?"bg-muted/30 hover:bg-accent/80":"hover:bg-muted/40";let p;e[3]!==m?(p=fe("h-14 md:h-16 transition-colors cursor-pointer",m),e[3]=m,e[4]=p):p=e[4];let x;e[5]!==r?(x=s.jsx(de,{className:"w-10 md:w-12 px-2 md:px-4",children:s.jsx("div",{className:"flex items-center justify-center",children:r?s.jsx(Re,{size:16,className:"text-muted-foreground"}):s.jsx(ms,{size:16,className:"text-muted-foreground"})})}),e[5]=r,e[6]=x):x=e[6];const b=n?.icon||null;let j;e[7]!==a.connectionTitle||e[8]!==b?(j=s.jsx(de,{className:"w-12 md:w-16 px-2 md:px-4",children:s.jsx("div",{className:"flex items-center justify-center",children:s.jsx(Ae,{icon:b,name:a.connectionTitle,size:"xs",className:"shadow-sm"})})}),e[7]=a.connectionTitle,e[8]=b,e[9]=j):j=e[9];let v;e[10]!==a.toolName?(v=s.jsx("div",{className:"text-xs font-medium text-foreground truncate block",children:a.toolName}),e[10]=a.toolName,e[11]=v):v=e[11];let g;e[12]!==a.connectionTitle?(g=s.jsx("div",{className:"text-xs text-muted-foreground truncate block",children:a.connectionTitle}),e[12]=a.connectionTitle,e[13]=g):g=e[13];let h;e[14]!==v||e[15]!==g?(h=s.jsxs(de,{className:"min-w-0 pr-2 md:pr-4",children:[v,g]}),e[14]=v,e[15]=g,e[16]=h):h=e[16];let u;e[17]!==l?(u=s.jsx(de,{className:"w-24 md:w-32 px-2 md:px-3 text-xs text-muted-foreground",children:s.jsx("div",{className:"truncate",children:l})}),e[17]=l,e[18]=u):u=e[18];let y;e[19]!==a.userName?(y=s.jsx(de,{className:"w-20 md:w-24 px-2 md:px-3 text-xs text-muted-foreground",children:a.userName}),e[19]=a.userName,e[20]=y):y=e[20];let S;e[21]!==o?(S=s.jsx(de,{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 N;e[23]!==f?(N=s.jsx(de,{className:"w-20 md:w-28 px-2 md:px-3 text-xs text-muted-foreground",children:f}),e[23]=f,e[24]=N):N=e[24];let P;e[25]!==a.durationMs?(P=s.jsxs(de,{className:"w-16 md:w-20 px-2 md:px-3 text-xs text-muted-foreground font-mono text-right",children:[a.durationMs,"ms"]}),e[25]=a.durationMs,e[26]=P):P=e[26];const D=a.isError?"destructive":"success",I=a.isError?"Error":"OK";let M;e[27]!==D||e[28]!==I?(M=s.jsx(de,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:s.jsx("div",{className:"flex items-center justify-end",children:s.jsx(Le,{variant:D,className:"text-xs px-1.5 md:px-2 py-0.5 md:py-1",children:I})})}),e[27]=D,e[28]=I,e[29]=M):M=e[29];let L;e[30]!==c||e[31]!==i||e[32]!==u||e[33]!==y||e[34]!==S||e[35]!==N||e[36]!==P||e[37]!==M||e[38]!==p||e[39]!==x||e[40]!==j||e[41]!==h?(L=s.jsxs(we,{ref:c,className:p,onClick:i,children:[x,j,h,u,y,S,N,P,M]}),e[30]=c,e[31]=i,e[32]=u,e[33]=y,e[34]=S,e[35]=N,e[36]=P,e[37]=M,e[38]=p,e[39]=x,e[40]=j,e[41]=h,e[42]=L):L=e[42];let E;e[43]!==r||e[44]!==a?(E=r&&s.jsx(we,{children:s.jsx(de,{colSpan:9,className:"p-0",children:s.jsx(os,{log:a})})}),e[43]=r,e[44]=a,e[45]=E):E=e[45];let T;return e[46]!==L||e[47]!==E?(T=s.jsxs(w.Fragment,{children:[L,E]}),e[46]=L,e[47]=E,e[48]=T):T=e[48],T}const Qe="decopilot";function Za(t,e){const a=re.c(13),{org:r}=pe();let n;a[0]!==r.id?(n={connectionId:Ie,orgId:r.id},a[0]=r.id,a[1]=n):n=a[1];const l=De(n);let i;a[2]!==t.excludeConnectionIds?(i=t.excludeConnectionIds??[],a[2]=t.excludeConnectionIds,a[3]=i):i=a[3];let c;a[4]!==i?(c=[Qe,...i],a[4]=i,a[5]=c):c=a[5];let o;a[6]!==t||a[7]!==c?(o={...t,excludeConnectionIds:c},a[6]=t,a[7]=c,a[8]=o):o=a[8];let d;return a[9]!==l||a[10]!==e||a[11]!==o?(d={client:l,toolName:"MONITORING_STATS",toolArguments:o,staleTime:3e4,...e,select:Xa},a[9]=l,a[10]=e,a[11]=o,a[12]=d):d=a[12],Ue(d)}function Xa(t){return t.structuredContent??t}function Ya(t,e){const a=re.c(13),{org:r}=pe();let n;a[0]!==r.id?(n={connectionId:Ie,orgId:r.id},a[0]=r.id,a[1]=n):n=a[1];const l=De(n);let i;a[2]!==t.excludeConnectionIds?(i=t.excludeConnectionIds??[],a[2]=t.excludeConnectionIds,a[3]=i):i=a[3];let c;a[4]!==i?(c=[Qe,...i],a[4]=i,a[5]=c):c=a[5];let o;a[6]!==t||a[7]!==c?(o={...t,excludeConnectionIds:c},a[6]=t,a[7]=c,a[8]=o):o=a[8];let d;return a[9]!==l||a[10]!==e||a[11]!==o?(d={client:l,toolName:"MONITORING_STATS",toolArguments:o,staleTime:3e4,...e,select:er},a[9]=l,a[10]=e,a[11]=o,a[12]=d):d=a[12],Ue(d)}function er(t){return t.structuredContent??t}function qt(t,e){const a=re.c(9),{org:r}=pe();let n;a[0]!==r.id?(n={connectionId:Ie,orgId:r.id},a[0]=r.id,a[1]=n):n=a[1];const l=De(n);let i;a[2]===Symbol.for("react.memo_cache_sentinel")?(i=[Qe],a[2]=i):i=a[2];let c;a[3]!==t?(c={...t,connectionIds:i,topN:5},a[3]=t,a[4]=c):c=a[4];let o;return a[5]!==l||a[6]!==e||a[7]!==c?(o={client:l,toolName:"MONITORING_STATS",toolArguments:c,staleTime:3e4,...e,select:tr},a[5]=l,a[6]=e,a[7]=c,a[8]=o):o=a[8],Ue(o)}function tr(t){return t.structuredContent??t}function sr(){const{org:t,project:e,locator:a}=pe(),r=as(),n=Ve(),l=De({connectionId:Ie,orgId:t.id}),[i,c]=w.useState(null),[o,d]=w.useState(!1),[f,m]=w.useState(!1),{data:p}=rs({queryKey:Pe.monitoringDashboards(a),queryFn:async()=>{if(!l)throw new Error("MCP client is not available");const h=await l.callTool({name:"MONITORING_DASHBOARD_LIST",arguments:{}});return h.structuredContent??h}}),x=p?.dashboards??[],b=async()=>{if(l){m(!0);try{const h=await l.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"}}]}}),u=(h.structuredContent??h).id;r.invalidateQueries({queryKey:Pe.monitoringDashboards(a)}),n({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:u}})}catch(h){Ee.error("Failed to create dashboard"),console.error(h)}finally{m(!1)}}},j=h=>{n({to:"/$org/$project/monitoring/dashboards/$dashboardId",params:{org:t.slug,project:e.slug,dashboardId:h}})},v=h=>{n({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:h}})},g=async h=>{if(l){d(!0);try{await l.callTool({name:"MONITORING_DASHBOARD_DELETE",arguments:{id:h}}),Ee.success("Dashboard deleted"),r.invalidateQueries({queryKey:Pe.monitoringDashboards(a)})}catch(u){Ee.error("Failed to delete dashboard"),console.error(u)}finally{d(!1),c(null)}}};return s.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[x.length===0?s.jsx(We,{title:"No dashboards yet",description:"Create a dashboard to aggregate and visualize your monitoring data",image:s.jsx(ze,{size:48,className:"text-muted-foreground/50"}),actions:s.jsxs(ue,{onClick:b,size:"sm",disabled:f,children:[s.jsx(It,{size:16,className:"mr-1.5"}),"Create Dashboard"]})}):s.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:x.map(h=>s.jsx(vs,{connection:{id:h.id,title:h.name,description:h.description},fallbackIcon:s.jsx(ze,{}),onClick:()=>j(h.id),headerActions:s.jsxs(bs,{children:[s.jsx(js,{asChild:!0,children:s.jsx(ue,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u=>u.stopPropagation(),children:s.jsx(hs,{size:20})})}),s.jsxs(Ns,{align:"end",onClick:u=>u.stopPropagation(),children:[s.jsxs(Xe,{onClick:()=>v(h.id),children:[s.jsx(gs,{size:16}),"Edit"]}),s.jsxs(Xe,{onClick:()=>c(h.id),className:"text-destructive",children:[s.jsx(Dt,{size:16}),"Delete"]})]})]}),footer:s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[s.jsxs("span",{children:[h.widgets.length," widget",h.widgets.length!==1?"s":""]}),s.jsx("span",{children:"·"}),s.jsx("span",{children:new Date(h.createdAt).toLocaleDateString()})]})},h.id))}),s.jsx(ys,{open:!!i,onOpenChange:()=>c(null),children:s.jsxs(ws,{children:[s.jsxs(Ss,{children:[s.jsx(Cs,{children:"Delete Dashboard"}),s.jsx(Is,{children:"Are you sure you want to delete this dashboard? This action cannot be undone."})]}),s.jsxs(Ds,{children:[s.jsx(Ts,{disabled:o,children:"Cancel"}),s.jsx(ks,{disabled:o,onClick:()=>i&&g(i),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:o?"Deleting...":"Delete"})]})]})})]})}function ar(){const t=re.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{children:[s.jsx("div",{className:"h-6 w-40 bg-muted rounded animate-pulse"}),s.jsx("div",{className:"h-4 w-64 bg-muted rounded animate-pulse mt-2"})]}),s.jsx("div",{className:"h-8 w-32 bg-muted rounded animate-pulse"})]}),t[0]=e):e=t[0];let a;return t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[e,s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(rr)})]}),t[1]=a):a=t[1],a}function rr(t){return s.jsxs("div",{className:"border rounded-lg p-4",children:[s.jsx("div",{className:"h-5 w-32 bg-muted rounded animate-pulse mb-2"}),s.jsx("div",{className:"h-4 w-full bg-muted rounded animate-pulse mb-3"}),s.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]},t)}function nr(){const t=re.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.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 a;return t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Fe,{fallback:e,children:s.jsx(w.Suspense,{fallback:s.jsx(ar,{}),children:s.jsx(sr,{})})}),t[1]=a):a=t[1],a}function ft(t){const e=re.c(72),{options:a,onValueChange:r,defaultValue:n,placeholder:l,variant:i,animation:c,maxCount:o,modalPopover:d,asChild:f,className:m,disabled:p}=t;let x;e[0]!==n?(x=n===void 0?[]:n,e[0]=n,e[1]=x):x=e[1];const b=x,j=l===void 0?"Select items":l,v=i===void 0?"default":i,g=c===void 0?0:c,h=o===void 0?3:o,u=d===void 0?!1:d,y=f===void 0?!1:f,S=p===void 0?!1:p,[N,P]=w.useState(b),[D,I]=w.useState(!1);let M,L;e[2]!==b||e[3]!==N?(M=()=>{JSON.stringify(N)!==JSON.stringify(b)&&P(b)},L=[b,N],e[2]=b,e[3]=N,e[4]=M,e[5]=L):(M=e[4],L=e[5]),w.useEffect(M,L);let E;e[6]!==r||e[7]!==N?(E=Q=>{if(Q.key==="Enter")I(!0);else if(Q.key==="Backspace"&&!Q.currentTarget.value){const ee=[...N];ee.pop(),P(ee),r(ee)}},e[6]=r,e[7]=N,e[8]=E):E=e[8];const T=E;let C;e[9]!==r||e[10]!==N?(C=Q=>{const ee=N.includes(Q.value)?N.filter(ie=>ie!==Q.value):[...N,Q.value];P(ee),r(ee)},e[9]=r,e[10]=N,e[11]=C):C=e[11];const _=C;let O;e[12]!==r?(O=()=>{P([]),r([])},e[12]=r,e[13]=O):O=e[13];const F=O;let W;e[14]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{I(cr)},e[14]=W):W=e[14];const K=W;let z;e[15]!==F||e[16]!==r||e[17]!==a||e[18]!==N.length?(z=()=>{if(N.length===a.length)F();else{const Q=a.map(ir);P(Q),r(Q)}},e[15]=F,e[16]=r,e[17]=a,e[18]=N.length,e[19]=z):z=e[19];const A=z;let k;e[20]!==y?(k=y?{}:{variant:"outline"},e[20]=y,e[21]=k):k=e[21];let R;e[22]!==m?(R=fe("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",m),e[22]=m,e[23]=R):R=e[23];let $;e[24]!==g||e[25]!==h||e[26]!==a||e[27]!==j||e[28]!==N||e[29]!==v?($=N.length>0?s.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[N.slice(0,h).map(Q=>{const ee=a.find(ce=>ce.value===Q),ie=ee?.icon;return s.jsxs(Le,{variant:v==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${g}s`},children:[ie&&s.jsx(ie,{className:"h-3 w-3 shrink-0"}),s.jsx("span",{className:"truncate",children:ee?.label})]},Q)}),N.length>h&&s.jsxs(Le,{variant:v==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${g}s`},children:["+",N.length-h]})]}),s.jsx("div",{className:"flex items-center shrink-0 ml-2",children:s.jsx(Re,{size:20,className:"shrink-0 opacity-50"})})]}):s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:j}),s.jsx(Re,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=g,e[25]=h,e[26]=a,e[27]=j,e[28]=N,e[29]=v,e[30]=$):$=e[30];let q;e[31]!==S||e[32]!==k||e[33]!==R||e[34]!==$?(q=s.jsx(kt,{asChild:!0,children:s.jsx(ue,{ref:null,...k,onClick:K,className:R,disabled:S,children:$})}),e[31]=S,e[32]=k,e[33]=R,e[34]=$,e[35]=q):q=e[35];let te;e[36]===Symbol.for("react.memo_cache_sentinel")?(te=()=>I(!1),e[36]=te):te=e[36];let Z;e[37]!==T?(Z=s.jsx(Rs,{placeholder:"Search...",onKeyDown:T,className:"rounded-t-xl"}),e[37]=T,e[38]=Z):Z=e[38];let V;e[39]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx($s,{children:"No results found."}),e[39]=V):V=e[39];let U;e[40]!==A?(U=()=>{A()},e[40]=A,e[41]=U):U=e[41];let G;e[42]!==A?(G=Q=>{Q.stopPropagation(),A()},e[42]=A,e[43]=G):G=e[43];const J=N.length===a.length&&a.length>0;let B;e[44]!==J||e[45]!==A?(B=s.jsx(Ye,{checked:J,onCheckedChange:A,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:or}),e[44]=J,e[45]=A,e[46]=B):B=e[46];let X;e[47]===Symbol.for("react.memo_cache_sentinel")?(X=s.jsx("span",{children:"(Select All)"}),e[47]=X):X=e[47];let H;e[48]!==G||e[49]!==B?(H=s.jsxs("div",{className:"flex items-center w-full",onClick:G,children:[B,X]}),e[48]=G,e[49]=B,e[50]=H):H=e[50];let se;e[51]!==U||e[52]!==H?(se=s.jsx(et,{onSelect:U,className:"cursor-pointer",children:H},"all"),e[51]=U,e[52]=H,e[53]=se):se=e[53];let ae;if(e[54]!==a||e[55]!==N||e[56]!==_){let Q;e[58]!==N||e[59]!==_?(Q=ee=>{const ie=N.includes(ee.value);return s.jsx(et,{onSelect:()=>{_(ee)},className:"cursor-pointer",children:s.jsxs("div",{className:"flex items-center w-full",onClick:ce=>{ce.stopPropagation(),_(ee)},children:[s.jsx(Ye,{checked:ie,onCheckedChange:()=>{_(ee)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:lr}),ee.icon&&s.jsx(ee.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),s.jsx("span",{children:ee.label})]})},ee.value)},e[58]=N,e[59]=_,e[60]=Q):Q=e[60],ae=a.map(Q),e[54]=a,e[55]=N,e[56]=_,e[57]=ae}else ae=e[57];let Y;e[61]!==se||e[62]!==ae?(Y=s.jsxs(zs,{className:"rounded-b-xl",children:[V,s.jsxs(Ks,{children:[se,ae]})]}),e[61]=se,e[62]=ae,e[63]=Y):Y=e[63];let le;e[64]!==Z||e[65]!==Y?(le=s.jsx(Mt,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:te,children:s.jsxs(Bs,{className:"rounded-xl",children:[Z,Y]})}),e[64]=Z,e[65]=Y,e[66]=le):le=e[66];let oe;return e[67]!==D||e[68]!==u||e[69]!==q||e[70]!==le?(oe=s.jsxs(_t,{open:D,onOpenChange:I,modal:u,children:[q,le]}),e[67]=D,e[68]=u,e[69]=q,e[70]=le,e[71]=oe):oe=e[71],oe}function lr(t){return t.stopPropagation()}function or(t){return t.stopPropagation()}function ir(t){return t.value}function cr(t){return!t}function Qt(t,e){return e==="1d"?t.toLocaleDateString([],{month:"short",day:"numeric"}):t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function dr(t,e,a,r,n){const l=t.map(u=>u.toolName),i=new Map,c=20,o=a.getTime(),f=(r.getTime()-o)/(c-1);for(let u=0;u<c;u++){const y=Math.round(o+u*f),S=new Date(y);i.set(String(y),{t:S.toISOString(),ts:y,label:Qt(S,n),tools:new Map})}const m=[...i.keys()].map(Number).sort((u,y)=>u-y);for(const u of e){const y=u.timestamp.includes("T")?u.timestamp:u.timestamp.replace(" ","T"),S=new Date(y).getTime();let N=m[0],P=Math.abs(S-N);for(const M of m){const L=Math.abs(S-M);L<P&&(P=L,N=M)}const D=i.get(String(N)),I=D.tools.get(u.toolName);I?D.tools.set(u.toolName,{calls:I.calls+u.calls,errors:I.errors+u.errors,avg:(I.avg*I.calls+u.avg*u.calls)/(I.calls+u.calls),p95:Math.max(I.p95,u.p95)}):D.tools.set(u.toolName,{calls:u.calls,errors:u.errors,avg:u.avg,p95:u.p95})}const p=[...i.values()].sort((u,y)=>u.ts-y.ts),x=[],b=[],j=[],v=[];for(const u of p){const y={t:u.t,ts:u.ts,label:u.label},S={...y},N={...y},P={...y},D={...y};for(const I of l){const M=u.tools.get(I)??{calls:0,errors:0,avg:0,p95:0};S[I]=M.calls,D[I]=M.errors,N[I]=Math.round(M.avg),P[I]=Math.round(M.p95)}x.push(S),b.push(N),j.push(P),v.push(D)}const g={},h=new Map;return t.forEach((u,y)=>{const N=`var(--chart-${y%5+1})`;h.set(u.toolName,N),g[u.toolName]={label:u.toolName,color:N}}),{callsBuckets:x,latencyAvgBuckets:b,latencyP95Buckets:j,errorsBuckets:v,chartConfig:g,toolColors:h}}function mr(t,e){let a=0,r=Math.abs(t-e[0]);for(let n=1;n<e.length;n++){const l=Math.abs(t-e[n]);l<r&&(r=l,a=n)}return a}function ur(t,e,a,r){const l=e.getTime(),c=(a.getTime()-l)/19,o=[],d=[];for(let m=0;m<20;m++){const p=Math.round(l+m*c);d.push(p),o.push({t:new Date(p).toISOString(),ts:p,label:Qt(new Date(p),r),calls:0,errors:0,avg:0,p95:0})}const f=new Array(20).fill(0);for(const m of t){const p=new Date(m.timestamp).getTime(),x=mr(p,d),b=o[x];b.calls+=m.calls,b.errors+=m.errors,b.avg+=m.avg,b.p95=Math.max(b.p95,m.p95),f[x]++}for(let m=0;m<20;m++)f[m]>0&&(o[m].avg=o[m].avg/f[m]);return o}const pt={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 xr(t){return t.startsWith("llm-")}function ht(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 fr(t){const e=re.c(34),{metricsMode:a,dateRange:r,connectionIds:n,excludeConnectionIds:l,toolName:i,status:c,isStreaming:o,streamingRefetchInterval:d}=t,{org:f}=pe(),m=Ve(),p=Tt()??[],x=r;if(!x)throw new Error("TopTools requires an explicit date range");const b=new Date(x.startDate),j=new Date(x.endDate),v=j.getTime()-b.getTime(),g=v<=36e5?"1m":v<=9e7?"1h":"1d",h=xr(a),u=n?.length?n:void 0;let y;e[0]!==i?(y=i?[i]:void 0,e[0]=i,e[1]=y):y=e[1];let S;e[2]!==x.endDate||e[3]!==x.startDate||e[4]!==l||e[5]!==g||e[6]!==c||e[7]!==u||e[8]!==y?(S={interval:g,startDate:x.startDate,endDate:x.endDate,topN:10,connectionIds:u,excludeConnectionIds:l,toolNames:y,status:c},e[2]=x.endDate,e[3]=x.startDate,e[4]=l,e[5]=g,e[6]=c,e[7]=u,e[8]=y,e[9]=S):S=e[9];const N=o?d:!1;let P;e[10]!==N?(P={refetchInterval:N},e[10]=N,e[11]=P):P=e[11];const{data:D}=Ya(S,P);let I;e[12]!==x.endDate||e[13]!==x.startDate||e[14]!==g?(I={interval:g,startDate:x.startDate,endDate:x.endDate},e[12]=x.endDate,e[13]=x.startDate,e[14]=g,e[15]=I):I=e[15];const M=o?d:!1;let L;e[16]!==M?(L={refetchInterval:M},e[16]=M,e[17]=L):L=e[17];const{data:E}=qt(I,L),T=D?.topTools??[],{callsBuckets:C,latencyAvgBuckets:_,latencyP95Buckets:O,errorsBuckets:F,chartConfig:W,toolColors:K}=dr(T,D?.topToolsTimeseries??[],b,j,g),z=ur(E?.timeseries??[],b,j,g),A=a==="llm-latency-avg"?"avg":a==="llm-latency-p95"?"p95":a==="llm-errors"?"errors":"calls",k=a==="latency-avg"?_:a==="latency-p95"?O:a==="errors"?F:C,R=new Map(p.map(hr));let $;e[18]!==m||e[19]!==f.slug?($=()=>{m({to:"/$org/$project/monitoring",params:{org:f.slug,project:gt}})},e[18]=m,e[19]=f.slug,e[20]=$):$=e[20];const q=$;if(h){let V;e[21]!==A?(V={label:A,color:"var(--chart-1)"},e[21]=A,e[22]=V):V=e[22];let U;e[23]!==A||e[24]!==V?(U={[A]:V},e[23]=A,e[24]=V,e[25]=U):U=e[25];const G=U,J=pt[a];let B;e[26]!==J?(B=s.jsx("div",{className:"flex flex-col gap-1.5",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:J})}),e[26]=J,e[27]=B):B=e[27];const X=(E?.timeseries?.length??0)===0?s.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No AI activity in this time range"}):s.jsx("div",{className:"flex flex-col gap-2 w-full h-full",children:s.jsx(it,{className:"flex-1 min-h-0 max-h-[140px] w-full",config:G,children:s.jsxs(xt,{data:z,margin:{left:8,right:8,top:5,bottom:5},children:[s.jsx(dt,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"var(--muted-foreground)"}}),s.jsx(ct,{content:se=>{const{active:ae,payload:Y}=se;if(!ae||!Y||Y.length===0)return null;const le=Y[0]&&typeof Y[0]=="object"&&"payload"in Y[0]?Y[0].payload?.label??"":"",oe=typeof Y[0]?.value=="number"?Y[0].value:0;return s.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-sm",children:[s.jsx("div",{className:"mb-1.5 text-xs text-muted-foreground",children:le}),s.jsx("div",{className:"text-xs font-medium",children:ht(oe,a)})]})}}),s.jsx(Ke,{type:"monotone",dataKey:A,stroke:"var(--chart-1)",strokeWidth:2,animationDuration:200,dot:!1,activeDot:{r:4}})]})})});let H;return e[28]!==q||e[29]!==B||e[30]!==X?(H=s.jsx(Ne,{title:B,onTitleClick:q,children:X}),e[28]=q,e[29]=B,e[30]=X,e[31]=H):H=e[31],H}const te=pt[a];let Z;return e[32]!==te?(Z=s.jsx("p",{className:"text-sm text-muted-foreground",children:te}),e[32]=te,e[33]=Z):Z=e[33],s.jsx(Ne,{title:s.jsxs("div",{className:"flex flex-col gap-1.5",children:[Z,s.jsx("div",{className:"flex items-center gap-3",children:T.slice(0,3).map(V=>{const U=R.get(V.connectionId||"");return s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Ae,{icon:U?.icon||null,name:V.toolName,size:"xs",fallbackIcon:s.jsx($e,{}),className:"shrink-0 size-4! min-w-4! aspect-square rounded-sm"}),s.jsx("span",{className:"text-[10px] text-foreground truncate max-w-32",children:V.toolName})]},V.toolName)})})]}),onTitleClick:q,children:T.length===0?s.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No tool activity in this time range"}):s.jsx("div",{className:"flex flex-col gap-2 w-full h-full",children:s.jsx(it,{className:"flex-1 min-h-0 max-h-[140px] w-full",config:W,children:s.jsxs(xt,{data:k,margin:{left:8,right:8,top:5,bottom:5},children:[s.jsx(dt,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"var(--muted-foreground)"}}),s.jsx(ct,{content:V=>{const{active:U,payload:G}=V;if(!U||!G||G.length===0)return null;const J=G[0]&&typeof G[0]=="object"&&"payload"in G[0]?G[0].payload?.label??"":"";return s.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-sm",children:[s.jsx("div",{className:"mb-1.5 text-xs text-muted-foreground",children:J}),s.jsx("div",{className:"flex flex-col gap-1",children:[...G].sort(pr).map(B=>{const X=String(B.dataKey??""),H=typeof B.value=="number"?B.value:0,se=typeof B.color=="string"?B.color:void 0;if(!H||H===0)return null;const ae=T.find(le=>le.toolName===X),Y=R.get(ae?.connectionId||"");return s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:se}}),s.jsx(Ae,{icon:Y?.icon||null,name:X,size:"xs",fallbackIcon:s.jsx($e,{}),className:"shrink-0"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[X,":"]}),s.jsx("span",{className:"text-xs font-medium",children:ht(H,a)})]},X)})})]})}}),T.map(V=>s.jsx(Ke,{type:"monotone",dataKey:V.toolName,stroke:K.get(V.toolName),strokeWidth:2,animationDuration:200,dot:!1,activeDot:{r:4}},V.toolName))]})})})})}function pr(t,e){const a=typeof t.value=="number"?t.value:0;return(typeof e.value=="number"?e.value:0)-a}function hr(t){return[t.id,t]}function gr(){const t=re.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t[0]=e):e=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[e,s.jsx("div",{className:"flex items-center gap-2",children:Array.from({length:3}).map(vr)})]}),t[1]=a):a=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(Ne,{title:a,children:s.jsx("div",{className:"flex flex-col gap-2 w-full",children:s.jsx("div",{className:"h-[140px] w-full rounded bg-muted animate-pulse"})})}),t[2]=r):r=t[2],r}function vr(t,e){return s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"size-4 aspect-square rounded-md bg-muted animate-pulse"}),s.jsx("div",{className:"h-2.5 w-16 rounded bg-muted animate-pulse"})]},e)}const Be={Content:fr,Skeleton:gr};function Jt(t){const e=t.endDate.getTime()-t.startDate.getTime(),a=3600*1e3,r=25*a;return e<=a?"1m":e<=r?"1h":"1d"}function br(t,e){const a=new Date(t);return e==="1d"?a.toLocaleDateString([],{month:"short",day:"numeric"}):a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function jr(t,e){const a=new Date(t);return e==="1d"?(a.setHours(0,0,0,0),a):e==="1h"?(a.setMinutes(0,0,0),a):(a.setSeconds(0,0),a)}function Zt(t,e,a){const r=new Map(t.map(m=>[jr(new Date(m.timestamp),a).getTime(),m])),n=20,l=e.startDate.getTime(),c=(e.endDate.getTime()-l)/(n-1),o=[],d=[];for(let m=0;m<n;m++){const p=Math.round(l+m*c);d.push(p),o.push({t:new Date(p).toISOString(),ts:p,label:br(new Date(p).toISOString(),a),calls:0,errors:0,errorRate:0,avg:0,p50:0,p95:0})}const f=new Array(n).fill(0);for(const[m,p]of r){let x=0,b=Math.abs(m-d[0]);for(let v=1;v<d.length;v++){const g=Math.abs(m-d[v]);g<b&&(b=g,x=v)}const j=o[x];j.calls+=p.calls,j.errors+=p.errors,j.errorRate+=p.errorRate,j.avg+=p.avg,j.p50+=p.p50,j.p95=Math.max(j.p95,p.p95),f[x]++}for(let m=0;m<n;m++)f[m]>0&&(o[m].errorRate=o[m].errorRate/f[m],o[m].avg=o[m].avg/f[m],o[m].p50=o[m].p50/f[m]);return o}function _e(t,e){return e==="requests"?t.calls:e==="errors"?t.errorRate:t.avgDurationMs}function Ce(t){return t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`}function Nr(t,e){return e==="requests"?t.calls.toLocaleString():e==="errors"?`${t.errorRate.toFixed(1)}%`:Ce(t.avgDurationMs)}const yr=[{id:"calls",dataKey:"calls",colorNum:1,barColor:"bg-chart-1",leaderboardMode:"requests",chartMetrics:["calls"],renderTitle:t=>s.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[s.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Tool Calls"}),s.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)=>s.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[s.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Latency"}),s.jsxs("div",{className:"flex items-baseline gap-3",children:[s.jsxs("div",{className:fe("pb-0.5",e==="latency-avg"?"border-b-2 border-chart-4":"border-b-2 border-transparent"),children:[s.jsx("span",{className:"text-sm md:text-lg font-medium",children:Ce(t.avgDurationMs)}),s.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"avg"})]}),s.jsxs("div",{className:fe("pb-0.5",e==="latency-p95"?"border-b-2 border-chart-4":"border-b-2 border-transparent"),children:[s.jsx("span",{className:"text-sm md:text-lg font-medium",children:Ce(t.p95DurationMs)}),s.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=>s.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[s.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Errors"}),s.jsx("p",{className:"text-sm md:text-lg font-medium",children:t.totalErrors.toLocaleString()})]}),getNextMetric:()=>"errors"}];function wr(t){const e=re.c(12),{metrics:a,connections:r,mode:n,barColor:l}=t;let i,c,o;if(e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==n){o=Symbol.for("react.early_return_sentinel");e:{const f=new Map(a.map(Cr)),m=r??[];let p;e[7]!==n?(p=(j,v)=>_e(v.metric,n)-_e(j.metric,n),e[7]=n,e[8]=p):p=e[8];const x=m.map(j=>({connection:j,metric:f.get(j.id)})).filter(Sr).sort(p).slice(0,5),b=x[0]?.metric?_e(x[0].metric,n):1;if(x.length===0){o=null;break e}i="space-y-1.5 mt-2",c=x.map(j=>{const{connection:v,metric:g}=j,h=_e(g,n),u=b>0?Math.min(h/b*100,100):0;return s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Ae,{icon:v.icon,name:v.title,size:"xs",fallbackIcon:s.jsx($e,{}),className:"shrink-0 size-4! min-w-4!"}),s.jsx("span",{className:"text-[10px] text-foreground truncate min-w-0 w-20",children:v.title}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1",children:s.jsx("div",{className:fe("h-full",l),style:{width:`${u}%`}})}),s.jsx("span",{className:"text-[10px] tabular-nums shrink-0 text-foreground",children:Nr(g,n)})]},v.id)})}e[0]=l,e[1]=r,e[2]=a,e[3]=n,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=s.jsx("div",{className:i,children:c}),e[9]=i,e[10]=c,e[11]=d):d=e[11],d}function Sr(t){return t.metric}function Cr(t){return[t.connectionId,t]}function Ir(t){const e=re.c(8),{displayDateRange:a,connectionIds:r,excludeConnectionIds:n,toolName:l,status:i,connections:c,isStreaming:o,selectedMetric:d,onMetricSelect:f}=t,m=Jt(a),p=o?He.streamingRefetchInterval:!1;let x;e[0]!==p?(x={refetchInterval:p},e[0]=p,e[1]=x):x=e[1];const{data:b}=Za({interval:m,startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionIds:r.length>0?r:void 0,excludeConnectionIds:n,toolNames:l?[l]:void 0,status:i},x),j=b?{totalCalls:b.totalCalls,totalErrors:b.totalErrors,avgDurationMs:b.avgDurationMs,p95DurationMs:b.p95DurationMs,data:Zt(b.timeseries,a,m)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},v="border-b border-border";let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx("div",{className:"px-5 py-2 bg-muted/30 border-b border-border",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Tool Calls"})}),e[2]=g):g=e[2];const h="grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",u=yr.map(N=>{const{id:P,dataKey:D,colorNum:I,barColor:M,leaderboardMode:L,chartMetrics:E,renderTitle:T,getNextMetric:C}=N,_=E.includes(d),O=()=>{f(_?C(d):E[0])};return s.jsxs("div",{className:"bg-background relative cursor-pointer",onClick:O,children:[_&&s.jsx("div",{className:"absolute top-0 left-0 right-0 h-0.5 z-10",style:{backgroundColor:`var(--chart-${I})`}}),s.jsx(Ne,{title:T(j,d),children:s.jsxs("div",{className:"flex flex-col w-full",children:[s.jsx(Ct,{data:j.data,dataKey:typeof D=="function"?D(d):D,colorNum:I,chartHeight:"h-[30px] md:h-[40px]"}),s.jsx(wr,{metrics:b?.connectionBreakdown??[],connections:c,mode:L,barColor:M})]})})]},P)});let y;e[3]!==u?(y=s.jsx("div",{className:h,children:u}),e[3]=u,e[4]=y):y=e[4];let S;return e[5]!==g||e[6]!==y?(S=s.jsxs("div",{className:v,children:[g,y]}),e[5]=g,e[6]=y,e[7]=S):S=e[7],S}const Xt=Object.assign(Ir,{Skeleton:fs});function Dr(t){const e=re.c(9),{topTools:a,barColor:r}=t;if(a.length===0)return null;const n=a[0]?.calls??1;let l;if(e[0]!==r||e[1]!==n||e[2]!==a){let c;e[4]!==r||e[5]!==n?(c=o=>{const{toolName:d,calls:f}=o,m=n>0?Math.min(f/n*100,100):0;return s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] text-foreground truncate min-w-0 w-24",children:d}),s.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1",children:s.jsx("div",{className:fe("h-full",r),style:{width:`${m}%`}})}),s.jsx("span",{className:"text-[10px] tabular-nums shrink-0 text-foreground",children:f.toLocaleString()})]},d)},e[4]=r,e[5]=n,e[6]=c):c=e[6],l=a.map(c),e[0]=r,e[1]=n,e[2]=a,e[3]=l}else l=e[3];let i;return e[7]!==l?(i=s.jsx("div",{className:"space-y-1.5 mt-2",children:l}),e[7]=l,e[8]=i):i=e[8],i}function Tr(t){const e=re.c(8),{displayDateRange:a,isStreaming:r,selectedMetric:n,onMetricSelect:l}=t,i=Jt(a),c=r?He.streamingRefetchInterval:!1;let o;e[0]!==c?(o={refetchInterval:c},e[0]=c,e[1]=o):o=e[1];const{data:d}=qt({interval:i,startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString()},o),f=d?{totalCalls:d.totalCalls,totalErrors:d.totalErrors,avgDurationMs:d.avgDurationMs,p95DurationMs:d.p95DurationMs,data:Zt(d.timeseries,a,i)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},m=d?.topTools??[],p=[{id:"llm-calls",dataKey:"calls",colorNum:1,barColor:"bg-chart-1",chartMetric:"llm-calls",renderTitle:()=>s.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[s.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"AI Usage"}),s.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:()=>s.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[s.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"AI Latency"}),s.jsxs("div",{className:"flex items-baseline gap-3",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm md:text-lg font-medium",children:Ce(f.avgDurationMs)}),s.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"avg"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm md:text-lg font-medium",children:Ce(f.p95DurationMs)}),s.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:()=>s.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[s.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"AI Errors"}),s.jsx("p",{className:"text-sm md:text-lg font-medium",children:f.totalErrors.toLocaleString()})]})}],x="border-b border-border";let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("div",{className:"px-5 py-2 bg-muted/30 border-b border-border",children:s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"AI Usage"})}),e[2]=b):b=e[2];const j="grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",v=p.map(u=>{const{id:y,dataKey:S,colorNum:N,barColor:P,chartMetric:D,renderTitle:I}=u,M=n===D;return s.jsxs("div",{className:"bg-background relative cursor-pointer",onClick:()=>l(D),children:[M&&s.jsx("div",{className:"absolute top-0 left-0 right-0 h-0.5 z-10",style:{backgroundColor:`var(--chart-${N})`}}),s.jsx(Ne,{title:I(),children:s.jsxs("div",{className:"flex flex-col w-full",children:[s.jsx(Ct,{data:f.data,dataKey:S,colorNum:N,chartHeight:"h-[30px] md:h-[40px]"}),s.jsx(Dr,{topTools:m,barColor:P})]})})]},y)});let g;e[3]!==v?(g=s.jsx("div",{className:j,children:v}),e[3]=v,e[4]=g):g=e[4];let h;return e[5]!==b||e[6]!==g?(h=s.jsxs("div",{className:x,children:[b,g]}),e[5]=b,e[6]=g,e[7]=h):h=e[7],h}function kr(){const t=re.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"px-5 py-2 bg-muted/30 border-b border-border",children:s.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t[0]=e):e=t[0];let a;return t[1]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsxs("div",{className:"border-b border-border",children:[e,s.jsx("div",{className:"grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",children:[...Array(3)].map(Mr)})]}),t[1]=a):a=t[1],a}function Mr(t,e){return s.jsx(Ne,{title:s.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[s.jsx("div",{className:"h-4 w-16 rounded bg-muted animate-pulse"}),s.jsx("div",{className:"h-5 md:h-6 w-12 rounded bg-muted animate-pulse"})]}),children:s.jsxs("div",{className:"flex flex-col w-full",children:[s.jsx("div",{className:"h-[30px] md:h-[40px] w-full rounded bg-muted animate-pulse"}),s.jsx("div",{className:"space-y-1.5 mt-2",children:Array.from({length:3}).map(_r)})]})},e)}function _r(t,e){return s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"h-2.5 w-24 rounded bg-muted animate-pulse"}),s.jsx("div",{className:"h-1.5 flex-1 bg-muted animate-pulse"}),s.jsx("div",{className:"h-2.5 w-8 rounded bg-muted animate-pulse shrink-0"})]},e)}const Yt=Object.assign(Tr,{Skeleton:kr}),Pr=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Ar({connectionIds:t,virtualMcpIds:e,tool:a,status:r,hideSystem:n,propertyFilters:l,connectionOptions:i,virtualMcpOptions:c,activeFiltersCount:o,onUpdateFilters:d}){const[f,m]=w.useState(!1),[p,x]=w.useState("raw"),[b,j]=w.useState(a),[v,g]=w.useState(l),[h,u]=w.useState(ke(l)),y=w.useRef(a),S=w.useRef(je(l));y.current!==a&&(y.current=a,b!==a&&j(a));const N=je(l);S.current!==N&&(S.current=N,g(l),u(ke(l)));const P=(T,C)=>{const _=[...v],O=_[T];O&&(_[T]={key:C.key??O.key,operator:C.operator??O.operator,value:C.value??O.value},g(_))},D=()=>{g([...v,{key:"",operator:"eq",value:""}])},I=T=>{const C=v.filter((_,O)=>O!==T);g(C),u(ke(C)),d({propertyFilters:je(C)})},M=()=>{d({propertyFilters:je(v)})},L=()=>{const T=Ze(h);g(T),d({propertyFilters:je(T)})},E=()=>{if(p==="raw"){const T=Ze(h);g(T),x("form")}else u(ke(v)),x("raw")};return s.jsxs(_t,{open:f,onOpenChange:m,children:[s.jsx(kt,{asChild:!0,children:s.jsxs(ue,{variant:"outline",size:"sm",children:[s.jsx(Es,{size:16}),"Filters",o>0&&s.jsx(Le,{variant:"default",className:"ml-1 h-5 w-5 rounded-full p-0 flex items-center justify-center text-xs",children:o})]})}),s.jsx(Mt,{align:"end",className:"w-[320px]",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{children:s.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Gs,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),s.jsx(Us,{id:"hide-system-calls",checked:n,onCheckedChange:T=>d({hideSystem:!!T})})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),s.jsx(ft,{options:i,defaultValue:t,onValueChange:T=>d({connectionId:T}),placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),s.jsx(ft,{options:c,defaultValue:e,onValueChange:T=>d({virtualMcpId:T}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),s.jsx(Oe,{id:"filter-tool",placeholder:"Filter by tool...",value:b,onChange:T=>j(T.target.value),onBlur:()=>{b!==a&&d({tool:b})},onKeyDown:T=>{T.key==="Enter"&&b!==a&&d({tool:b})},className:"w-full"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),s.jsxs(tt,{value:r,onValueChange:T=>d({status:T}),children:[s.jsx(st,{className:"w-full",children:s.jsx(at,{})}),s.jsxs(rt,{children:[s.jsx(Me,{value:"all",children:"All Status"}),s.jsx(Me,{value:"success",children:"Success Only"}),s.jsx(Me,{value:"errors",children:"Errors Only"})]})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),s.jsxs(Vs,{children:[s.jsx(Ws,{asChild:!0,children:s.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:E,children:p==="raw"?s.jsx(Os,{size:14}):s.jsx(Ls,{size:14})})}),s.jsx(Hs,{children:p==="raw"?"Switch to form view":"Switch to raw text"})]})]}),p==="raw"?s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fs,{placeholder:`Paste property filters here:
2
+ thread_id=abc123
3
+ user~test
4
+ debug?`,value:h,onChange:T=>u(T.target.value),onBlur:L,onKeyDown:T=>{T.key==="Enter"&&T.metaKey&&L()},className:"font-mono text-sm min-h-[80px] resize-none"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",s.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",s.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",s.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",s.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):s.jsxs("div",{className:"space-y-3",children:[v.map((T,C)=>s.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",C+1]}),s.jsx(ue,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>I(C),children:s.jsx(Dt,{size:12})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Oe,{placeholder:"Key (e.g., thread_id)",value:T.key,onChange:_=>P(C,{key:_.target.value}),onBlur:M,onKeyDown:_=>{_.key==="Enter"&&M()},className:"flex-1 font-mono text-sm"}),s.jsxs(tt,{value:T.operator,onValueChange:_=>{const O=[...v],F=O[C];F&&(O[C]={...F,operator:_,value:_==="exists"?"":F.value},g(O),d({propertyFilters:je(O)}))},children:[s.jsx(st,{className:"w-28",children:s.jsx(at,{})}),s.jsx(rt,{children:Pr.map(_=>s.jsx(Me,{value:_.value,children:_.label},_.value))})]})]}),T.operator!=="exists"&&s.jsx(Oe,{placeholder:"Value",value:T.value,onChange:_=>P(C,{value:_.target.value}),onBlur:M,onKeyDown:_=>{_.key==="Enter"&&M()},className:"w-full font-mono text-sm"})]},C)),s.jsxs(ue,{variant:"outline",size:"sm",className:"w-full",onClick:D,children:[s.jsx(It,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),o>0&&s.jsx(ue,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{j(""),g([]),u(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),m(!1)},children:"Clear all filters"})]})})]})}function Lr(t){const e=re.c(17),{connectionIds:a,virtualMcpIds:r,tool:n,status:l,search:i,logs:c,hasMore:o,onLoadMore:d,isLoadingMore:f,connections:m,virtualMcps:p,membersData:x}=t,b=m??[],j=p??[];let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=new Set,e[0]=v):v=e[0];const[g,h]=w.useState(v),u=Ms(d,o,f),y=x?.data?.members??[],S=new Map(y.map(Rr)),N=new Map(j.map(Or));let D=c.map(k=>{const R=S.get(k.userId??""),$=k.virtualMcpId?N.get(k.virtualMcpId):null;return{...k,userName:R?.name??k.userId??"Unknown",userImage:R?.image,virtualMcpName:$?.title??null}});if(a.length>1){let k;e[1]!==a?(k=R=>a.includes(R.connectionId),e[1]=a,e[2]=k):k=e[2],D=D.filter(k)}if(r.length>1){let k;e[3]!==r?(k=R=>R.virtualMcpId&&r.includes(R.virtualMcpId),e[3]=r,e[4]=k):k=e[4],D=D.filter(k)}if(i){const k=i.toLowerCase();D=D.filter(R=>R.toolName.toLowerCase().includes(k)||R.connectionTitle.toLowerCase().includes(k)||R.errorMessage?.toLowerCase().includes(k))}let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=k=>{h(R=>{const $=new Set(R);return $.has(k.id)?$.delete(k.id):$.add(k.id),$})},e[5]=I):I=e[5];const M=I,L=new Map(b.map(Er));if(D.length===0){let k;e[6]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[6]=k):k=e[6];const R=i||a.length>0||r.length>0||n||l!=="all"?"No logs match your filters":"No logs found in this time range";let $;return e[7]!==R?($=s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(We,{image:k,title:"No logs found",description:R})}),e[7]=R,e[8]=$):$=e[8],$}const E="flex-1 flex flex-col overflow-hidden",T="flex-1 overflow-auto",C="min-w-[600px] md:min-w-0 bg-background",_=wt,O="w-full border-collapse";let F;e[9]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(St,{className:"border-b-0 z-20",children:s.jsxs(we,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(ne,{className:"w-10 md:w-12 px-2 md:px-4"}),s.jsx(ne,{className:"w-5"}),s.jsx(ne,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),s.jsx(ne,{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"}),s.jsx(ne,{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"}),s.jsx(ne,{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"}),s.jsx(ne,{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"}),s.jsx(ne,{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"}),s.jsx(ne,{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]=F):F=e[9];const W=yt,K=D.map((k,R)=>s.jsx(Ja,{log:k,isExpanded:g.has(k.id),connection:L.get(k.connectionId),virtualMcpName:k.virtualMcpName??"",onToggle:()=>M(k),lastLogRef:R===D.length-1?u:void 0},k.id));let z;e[10]!==W||e[11]!==K?(z=s.jsx(W,{children:K}),e[10]=W,e[11]=K,e[12]=z):z=e[12];let A;return e[13]!==_||e[14]!==F||e[15]!==z?(A=s.jsx("div",{className:E,children:s.jsx("div",{className:T,children:s.jsx("div",{className:C,children:s.jsxs(_,{className:O,children:[F,z]})})})}),e[13]=_,e[14]=F,e[15]=z,e[16]=A):A=e[16],A}function Er(t){return[t.id,t]}function Or(t){return[t.id,t]}function Rr(t){return[t.userId,t.user]}function $r(){const t=re.c(10);let e,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(ne,{className:"w-10 md:w-12 px-2 md:px-4"}),a=s.jsx(ne,{className:"w-5"}),t[0]=e,t[1]=a):(e=t[0],a=t[1]);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(ne,{className:"pr-2 md:pr-4",children:s.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),t[2]=r):r=t[2];let n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(ne,{className:"w-24 md:w-32 px-2 md:px-3",children:s.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),t[3]=n):n=t[3];let l;t[4]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(ne,{className:"w-20 md:w-24 px-2 md:px-3",children:s.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t[4]=l):l=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(ne,{className:"w-20 md:w-24 px-2 md:px-3",children:s.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=s.jsx(ne,{className:"w-20 md:w-28 px-2 md:px-3",children:s.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=s.jsx(ne,{className:"w-16 md:w-20 px-2 md:px-3",children:s.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=s.jsx(St,{className:"border-b-0 z-20",children:s.jsxs(we,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,a,r,n,l,i,c,o,s.jsx(ne,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:s.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=s.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:s.jsx("div",{className:"flex-1 overflow-auto",children:s.jsx("div",{className:"min-w-[600px] md:min-w-0 bg-background",children:s.jsxs(wt,{className:"w-full border-collapse",children:[d,s.jsx(yt,{children:Array.from({length:8}).map(zr)})]})})})}),t[9]=f):f=t[9],f}function zr(t,e){return s.jsxs(we,{className:"h-12 border-b border-border",children:[s.jsx("td",{className:"px-2 md:px-4",children:s.jsx("div",{className:"size-4 rounded bg-muted animate-pulse"})}),s.jsx("td",{children:s.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),s.jsx("td",{className:"pr-2 md:pr-4",children:s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),s.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),s.jsx("td",{className:"px-2 md:px-3",children:s.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s.jsx("td",{className:"px-2 md:px-3",children:s.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),s.jsx("td",{className:"px-2 md:px-3",children:s.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s.jsx("td",{className:"px-2 md:px-3",children:s.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),s.jsx("td",{className:"px-2 md:px-3",children:s.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),s.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:s.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const es=Object.assign(Lr,{Skeleton:$r});function Kr(t){const e=re.c(44),{client:a,locator:r,baseParams:n,pageSize:l,isStreaming:i,streamingRefetchInterval:c,connectionIds:o,virtualMcpIds:d,tool:f,status:m,searchQuery:p,onUpdateFilters:x,allConnections:b,allVirtualMcps:j,membersData:v}=t;let g;e[0]!==n||e[1]!==r?(g=Pe.monitoringLogsInfinite(r,JSON.stringify(n)),e[0]=n,e[1]=r,e[2]=g):g=e[2];let h;e[3]!==n||e[4]!==a||e[5]!==l?(h=async z=>{const{pageParam:A}=z,k=A===void 0?0:A;if(!a)throw new Error("MCP client is not available");const R=await a.callTool({name:"MONITORING_LOGS_LIST",arguments:{...n,limit:l,offset:k}});return R.structuredContent??R},e[3]=n,e[4]=a,e[5]=l,e[6]=h):h=e[6];let u;e[7]!==l?(u=(z,A)=>{if(!((z?.logs?.length??0)<l))return A.length*l},e[7]=l,e[8]=u):u=e[8];const y=i?c:!1;let S;e[9]!==g||e[10]!==h||e[11]!==u||e[12]!==y?(S={queryKey:g,queryFn:h,initialPageParam:0,getNextPageParam:u,staleTime:0,refetchInterval:y},e[9]=g,e[10]=h,e[11]=u,e[12]=y,e[13]=S):S=e[13];const{data:N,fetchNextPage:P,hasNextPage:D,isFetchingNextPage:I}=Ps(S);let M;e[14]!==N.pages?(M=N.pages.flatMap(Br),e[14]=N.pages,e[15]=M):M=e[15];const L=M;let E;e[16]!==P||e[17]!==D||e[18]!==I?(E=()=>{D&&!I&&P()},e[16]=P,e[17]=D,e[18]=I,e[19]=E):E=e[19];const T=E;let C;e[20]!==x?(C=z=>x({search:z}),e[20]=x,e[21]=C):C=e[21];let _;e[22]!==x?(_=z=>{z.key==="Escape"&&(x({search:""}),z.target.blur())},e[22]=x,e[23]=_):_=e[23];let O;e[24]!==p||e[25]!==C||e[26]!==_?(O=s.jsx(ls,{value:p,onChange:C,placeholder:"Search by tool name, connection, or error...",className:"border-t",onKeyDown:_}),e[24]=p,e[25]=C,e[26]=_,e[27]=O):O=e[27];const F=D??!1;let W;e[28]!==b||e[29]!==L||e[30]!==j||e[31]!==o||e[32]!==T||e[33]!==I||e[34]!==v||e[35]!==p||e[36]!==m||e[37]!==F||e[38]!==f||e[39]!==d?(W=s.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:s.jsx(es,{connectionIds:o,virtualMcpIds:d,tool:f,status:m,search:p,logs:L,hasMore:F,onLoadMore:T,isLoadingMore:I,connections:b,virtualMcps:j,membersData:v})}),e[28]=b,e[29]=L,e[30]=j,e[31]=o,e[32]=T,e[33]=I,e[34]=v,e[35]=p,e[36]=m,e[37]=F,e[38]=f,e[39]=d,e[40]=W):W=e[40];let K;return e[41]!==O||e[42]!==W?(K=s.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[O,W]}),e[41]=O,e[42]=W,e[43]=K):K=e[43],K}function Br(t){return t.logs??[]}function Fr(t){const e=re.c(85),{tab:a,dateRange:r,displayDateRange:n,connectionIds:l,virtualMcpIds:i,tool:c,status:o,search:d,streaming:f,hideSystem:m,activeFiltersCount:p,from:x,to:b,propertyFilters:j,onUpdateFilters:v,onTimeRangeChange:g,onStreamingToggle:h,onTabChange:u}=t,y=Tt(),S=As(),{data:N}=_s();let P;e[0]!==y?(P=y??[],e[0]=y,e[1]=P):P=e[1];let D;e[2]!==P?(D=P.map(Wr),e[2]=P,e[3]=D):D=e[3];const I=D;let M;e[4]!==S?(M=S.map(Vr),e[4]=S,e[5]=M):M=e[5];const L=M,{pageSize:E,streamingRefetchInterval:T}=He,{org:C,locator:_}=pe();let O;e[6]!==C.id?(O={connectionId:Ie,orgId:C.id},e[6]=C.id,e[7]=O):O=e[7];const F=De(O);let W;e[8]!==j?(W=cs(j),e[8]=j,e[9]=W):W=e[9];const K=W;let z;e[10]!==m||e[11]!==C.id?(z=m?[ps.SELF(C.id)]:void 0,e[10]=m,e[11]=C.id,e[12]=z):z=e[12];const A=z,[k,R]=w.useState(!1);let $;e[13]!==r.startDate?($=r.startDate.toISOString(),e[13]=r.startDate,e[14]=$):$=e[14];let q;e[15]!==r.endDate?(q=r.endDate.toISOString(),e[15]=r.endDate,e[16]=q):q=e[16];const te=k?"decopilot":l.length===1?l[0]:void 0,Z=i.length===1?i[0]:void 0,V=c||void 0,U=o==="errors"?!0:o==="success"?!1:void 0;let G;e[17]!==A||e[18]!==K||e[19]!==Z||e[20]!==V||e[21]!==U||e[22]!==$||e[23]!==q||e[24]!==te?(G={startDate:$,endDate:q,connectionId:te,excludeConnectionIds:A,virtualMcpId:Z,toolName:V,isError:U,...K},e[17]=A,e[18]=K,e[19]=Z,e[20]=V,e[21]=U,e[22]=$,e[23]=q,e[24]=te,e[25]=G):G=e[25];const J=G,[B,X]=w.useState("calls");let H;e[26]!==n.startDate?(H=n.startDate.toISOString(),e[26]=n.startDate,e[27]=H):H=e[27];let se;e[28]!==n.endDate?(se=n.endDate.toISOString(),e[28]=n.endDate,e[29]=se):se=e[29];let ae;e[30]!==H||e[31]!==se?(ae={startDate:H,endDate:se},e[30]=H,e[31]=se,e[32]=ae):ae=e[32];const Y=ae;let le;e[33]===Symbol.for("react.memo_cache_sentinel")?(le={id:"overview",label:"Overview"},e[33]=le):le=e[33];let oe;e[34]===Symbol.for("react.memo_cache_sentinel")?(oe={id:"audit",label:"Audit"},e[34]=oe):oe=e[34];let Q;e[35]===Symbol.for("react.memo_cache_sentinel")?(Q=[le,oe,{id:"dashboards",label:"Dashboards"}],e[35]=Q):Q=e[35];const ee=Q;let ie;e[36]===Symbol.for("react.memo_cache_sentinel")?(ie=s.jsx(xe.Header.Left,{children:s.jsx(vt,{children:s.jsx(bt,{children:s.jsx(jt,{children:s.jsx(Nt,{children:"Monitoring"})})})})}),e[36]=ie):ie=e[36];let ce;e[37]!==p||e[38]!==k||e[39]!==l||e[40]!==I||e[41]!==x||e[42]!==m||e[43]!==f||e[44]!==h||e[45]!==g||e[46]!==v||e[47]!==j||e[48]!==o||e[49]!==a||e[50]!==b||e[51]!==c||e[52]!==i||e[53]!==L?(ce=(a==="overview"||a==="audit")&&s.jsx(xe.Header.Right,{children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ar,{connectionIds:l,virtualMcpIds:i,tool:c,status:o,hideSystem:m,propertyFilters:j,connectionOptions:I,virtualMcpOptions:L,activeFiltersCount:p,onUpdateFilters:v}),a==="audit"&&s.jsx(ue,{variant:k?"secondary":"outline",size:"sm",className:"h-7 px-2 sm:px-3 text-xs",onClick:()=>R(!k),children:"AI Usage"}),s.jsxs(ue,{variant:f?"secondary":"outline",size:"sm",className:fe("h-7 px-2 sm:px-3 gap-1.5",f&&"bg-muted hover:bg-muted/80"),onClick:h,children:[f?s.jsx(Kt,{size:16,className:"animate-pulse"}):s.jsx(Bt,{size:16}),s.jsx("span",{className:"hidden sm:inline",children:f?"Streaming":"Stream"})]}),s.jsx(ds,{value:{from:x,to:b},onChange:g})]})}),e[37]=p,e[38]=k,e[39]=l,e[40]=I,e[41]=x,e[42]=m,e[43]=f,e[44]=h,e[45]=g,e[46]=v,e[47]=j,e[48]=o,e[49]=a,e[50]=b,e[51]=c,e[52]=i,e[53]=L,e[54]=ce):ce=e[54];let he;e[55]!==ce?(he=s.jsxs(xe.Header,{children:[ie,ce]}),e[55]=ce,e[56]=he):he=e[56];let ge;e[57]!==u?(ge=ts=>u(ts),e[57]=u,e[58]=ge):ge=e[58];let ve;e[59]!==ge||e[60]!==a?(ve=s.jsx("div",{className:"px-5 py-3 border-b border-border",children:s.jsx(Pt,{tabs:ee,activeTab:a,onTabChange:ge})}),e[59]=ge,e[60]=a,e[61]=ve):ve=e[61];let be;e[62]!==y||e[63]!==S||e[64]!==Y||e[65]!==J||e[66]!==F||e[67]!==l||e[68]!==n||e[69]!==A||e[70]!==f||e[71]!==_||e[72]!==N||e[73]!==v||e[74]!==d||e[75]!==o||e[76]!==a||e[77]!==c||e[78]!==B||e[79]!==i?(be=a==="dashboards"?s.jsx(nr,{}):a==="audit"?s.jsx(Kr,{client:F,locator:_,baseParams:J,pageSize:E,isStreaming:f,streamingRefetchInterval:T,connectionIds:l,virtualMcpIds:i,tool:c,status:o,searchQuery:d,onUpdateFilters:v,allConnections:y,allVirtualMcps:S,membersData:N}):s.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[s.jsx("div",{className:"border-b border-border relative z-10",children:s.jsx(Fe,{fallback:null,children:s.jsx(w.Suspense,{fallback:s.jsx(Be.Skeleton,{}),children:s.jsx(Be.Content,{metricsMode:B,dateRange:Y,connectionIds:l,excludeConnectionIds:A,toolName:c||void 0,status:o==="errors"?"error":o==="success"?"success":void 0,isStreaming:f,streamingRefetchInterval:T})})})}),s.jsx(Xt,{displayDateRange:n,connectionIds:l,excludeConnectionIds:A,toolName:c||void 0,status:o==="errors"?"error":o==="success"?"success":void 0,connections:y,isStreaming:f,selectedMetric:B,onMetricSelect:X}),s.jsx(Yt,{displayDateRange:n,isStreaming:f,selectedMetric:B,onMetricSelect:X})]}),e[62]=y,e[63]=S,e[64]=Y,e[65]=J,e[66]=F,e[67]=l,e[68]=n,e[69]=A,e[70]=f,e[71]=_,e[72]=N,e[73]=v,e[74]=d,e[75]=o,e[76]=a,e[77]=c,e[78]=B,e[79]=i,e[80]=be):be=e[80];let Te;return e[81]!==he||e[82]!==ve||e[83]!==be?(Te=s.jsxs(s.Fragment,{children:[he,ve,be]}),e[81]=he,e[82]=ve,e[83]=be,e[84]=Te):Te=e[84],Te}function Vr(t){return{value:t.id??"",label:t.title??"Decopilot"}}function Wr(t){return{value:t.id,label:t.title||t.id}}function al(){const t=re.c(81),{org:e}=pe(),a=Ve();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/$project/monitoring"},t[0]=r):r=t[0];const n=ns(r),{tab:l,from:i,to:c,connectionId:o,virtualMcpId:d,tool:f,search:m,status:p,streaming:x,propertyFilters:b,hideSystem:j}=n,v=l===void 0?"overview":l;let g;t[1]!==o?(g=o===void 0?[]:o,t[1]=o,t[2]=g):g=t[2];const h=g;let u;t[3]!==d?(u=d===void 0?[]:d,t[3]=d,t[4]=u):u=t[4];const y=u,S=x===void 0?!0:x,N=b===void 0?"":b,P=j===void 0?!1:j;let D,I,M,L,E,T,C;if(t[5]!==h.length||t[6]!==i||t[7]!==P||t[8]!==a||t[9]!==e.slug||t[10]!==N||t[11]!==n||t[12]!==p||t[13]!==S||t[14]!==c||t[15]!==f||t[16]!==y.length){E=is(N);let U;t[24]!==a||t[25]!==e.slug||t[26]!==n?(U=H=>{a({to:"/$org/$project/monitoring",params:{org:e.slug,project:gt},search:{...n,...H}})},t[24]=a,t[25]=e.slug,t[26]=n,t[27]=U):U=t[27],C=U;let G;t[28]!==C?(G=H=>{C({from:H.from,to:H.to})},t[28]=C,t[29]=G):G=t[29],L=G;let J,B;if(t[30]!==i||t[31]!==S||t[32]!==c){const H=Je(i),se=Je(c);B=H.date||new Date(Date.now()-18e5);const ae=se.date||new Date;M={startDate:B,endDate:ae},J=ae,S&&c==="now"&&(J=new Date(ae),J.setHours(J.getHours()+1)),t[30]=i,t[31]=S,t[32]=c,t[33]=M,t[34]=J,t[35]=B}else M=t[33],J=t[34],B=t[35];let X;t[36]!==J||t[37]!==B?(X={startDate:B,endDate:J},t[36]=J,t[37]=B,t[38]=X):X=t[38],I=X,D=0,h.length>0&&D++,y.length>0&&D++,f&&D++,p!=="all"&&D++,P&&D++,T=E.filter(Hr),t[5]=h.length,t[6]=i,t[7]=P,t[8]=a,t[9]=e.slug,t[10]=N,t[11]=n,t[12]=p,t[13]=S,t[14]=c,t[15]=f,t[16]=y.length,t[17]=D,t[18]=I,t[19]=M,t[20]=L,t[21]=E,t[22]=T,t[23]=C}else D=t[17],I=t[18],M=t[19],L=t[20],E=t[21],T=t[22],C=t[23];const _=T;_.length>0&&(D=D+_.length);let O;t[39]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx(xe.Header,{children:s.jsx(xe.Header.Left,{children:s.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[39]=O):O=t[39];let F;t[40]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-[0.5px] bg-border shrink-0 border-b",children:s.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load monitoring data"})}),t[40]=F):F=t[40];let W;t[41]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsxs(s.Fragment,{children:[O,s.jsx(xe.Content,{children:s.jsxs("div",{className:"flex flex-col overflow-auto md:overflow-hidden h-full",children:[F,s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(We,{title:"Failed to load logs",description:"There was an error loading the monitoring data. Please try again."})})]})})]}),t[41]=W):W=t[41];let K;t[42]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(xe.Header,{children:s.jsx(xe.Header.Left,{children:s.jsx(vt,{children:s.jsx(bt,{children:s.jsx(jt,{children:s.jsx(Nt,{children:"Monitoring"})})})})})}),t[42]=K):K=t[42];let z;t[43]===Symbol.for("react.memo_cache_sentinel")?(z=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"dashboards",label:"Dashboards"}],t[43]=z):z=t[43];let A;t[44]!==C?(A=U=>C({tab:U}),t[44]=C,t[45]=A):A=t[45];let k;t[46]!==A||t[47]!==v?(k=s.jsx("div",{className:"px-5 py-3 border-b border-border",children:s.jsx(Pt,{tabs:z,activeTab:v,onTabChange:A})}),t[46]=A,t[47]=v,t[48]=k):k=t[48];let R;t[49]!==v?(R=v==="audit"?s.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:s.jsx(es.Skeleton,{})}):v==="dashboards"?s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-muted-foreground",children:"Loading dashboards..."})}):s.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[s.jsx("div",{className:"border-b border-border",children:s.jsx(Be.Skeleton,{})}),s.jsx(Xt.Skeleton,{}),s.jsx(Yt.Skeleton,{})]}),t[49]=v,t[50]=R):R=t[50];let $;t[51]!==k||t[52]!==R?($=s.jsxs(s.Fragment,{children:[K,k,R]}),t[51]=k,t[52]=R,t[53]=$):$=t[53];let q;t[54]!==S||t[55]!==C?(q=()=>C({streaming:!S}),t[54]=S,t[55]=C,t[56]=q):q=t[56];let te;t[57]!==C?(te=U=>C({tab:U}),t[57]=C,t[58]=te):te=t[58];let Z;t[59]!==D||t[60]!==h||t[61]!==I||t[62]!==M||t[63]!==i||t[64]!==L||t[65]!==P||t[66]!==E||t[67]!==m||t[68]!==p||t[69]!==S||t[70]!==q||t[71]!==te||t[72]!==v||t[73]!==c||t[74]!==f||t[75]!==C||t[76]!==y?(Z=s.jsx(Fr,{tab:v,dateRange:I,displayDateRange:M,connectionIds:h,virtualMcpIds:y,tool:f,status:p,search:m,streaming:S,hideSystem:P,activeFiltersCount:D,from:i,to:c,propertyFilters:E,onUpdateFilters:C,onTimeRangeChange:L,onStreamingToggle:q,onTabChange:te}),t[59]=D,t[60]=h,t[61]=I,t[62]=M,t[63]=i,t[64]=L,t[65]=P,t[66]=E,t[67]=m,t[68]=p,t[69]=S,t[70]=q,t[71]=te,t[72]=v,t[73]=c,t[74]=f,t[75]=C,t[76]=y,t[77]=Z):Z=t[77];let V;return t[78]!==$||t[79]!==Z?(V=s.jsx(xe,{children:s.jsx(Fe,{fallback:W,children:s.jsx(w.Suspense,{fallback:$,children:Z})})}),t[78]=$,t[79]=Z,t[80]=V):V=t[80],V}function Hr(t){return t.key.trim()}export{al as default};
@@ -0,0 +1,28 @@
1
+ import{r as d,c7 as se,bR as ct,ck as ut,c as $e,y as _r,j as P}from"./index-DsOJvxnb.js";import{aH as vt,aI as ve,F as ee,M as le,aJ as Nr,r as Ae,z as Le,aK as $r,J as Ke,aL as I,A as w,aM as Q,aN as pe,W as me,aO as H,aP as Ue,L as re,aw as ft,a2 as Re,aQ as dt,aR as pt,aS as mt,aT as ht,y as Ie,ax as we,ar as gt,c as G,aU as yt,aa as bt,s as ne,an as xt,ap as Y,e as te,aq as V,f as ae,h as Lr,g as Kr,aV as Rr,aW as Ot,aX as Pt,as as He,aY as jt,aZ as Ze,at as At,p as It,u as zr,R as St,S as Et,j as kt,Z as ze,D as We,k as Wr,l as Tt,n as wt,m as Mt,q as Ct,a_ as Bt,t as he,w as Fr,G as Dt,P as qr,T as _t,a0 as Gr,a$ as Nt,b0 as $t,b1 as Ye,B as Lt,E as Kt,H as Rt,b2 as zt,av as Wt,I as Ft,K as qt,a as Gt,b as Ut,C as Ht}from"./chart-D9IwJUjP.js";const Ur=Math.cos,ge=Math.sin,$=Math.sqrt,ye=Math.PI,Se=2*ye,Fe={draw(r,e){const t=$(e/ye);r.moveTo(t,0),r.arc(0,0,t,0,Se)}},Zt={draw(r,e){const t=$(e/5)/2;r.moveTo(-3*t,-t),r.lineTo(-t,-t),r.lineTo(-t,-3*t),r.lineTo(t,-3*t),r.lineTo(t,-t),r.lineTo(3*t,-t),r.lineTo(3*t,t),r.lineTo(t,t),r.lineTo(t,3*t),r.lineTo(-t,3*t),r.lineTo(-t,t),r.lineTo(-3*t,t),r.closePath()}},Hr=$(1/3),Yt=Hr*2,Vt={draw(r,e){const t=$(e/Yt),a=t*Hr;r.moveTo(0,-t),r.lineTo(a,0),r.lineTo(0,t),r.lineTo(-a,0),r.closePath()}},Xt={draw(r,e){const t=$(e),a=-t/2;r.rect(a,a,t,t)}},Jt=.8908130915292852,Zr=ge(ye/10)/ge(7*ye/10),Qt=ge(Se/10)*Zr,ea=-Ur(Se/10)*Zr,ra={draw(r,e){const t=$(e*Jt),a=Qt*t,i=ea*t;r.moveTo(0,-t),r.lineTo(a,i);for(let n=1;n<5;++n){const o=Se*n/5,s=Ur(o),u=ge(o);r.lineTo(u*t,-s*t),r.lineTo(s*a-u*i,u*a+s*i)}r.closePath()}},Ee=$(3),ta={draw(r,e){const t=-$(e/(Ee*3));r.moveTo(0,t*2),r.lineTo(-Ee*t,-t),r.lineTo(Ee*t,-t),r.closePath()}},_=-.5,N=$(3)/2,Me=1/$(12),aa=(Me/2+1)*3,na={draw(r,e){const t=$(e/aa),a=t/2,i=t*Me,n=a,o=t*Me+t,s=-n,u=o;r.moveTo(a,i),r.lineTo(n,o),r.lineTo(s,u),r.lineTo(_*a-N*i,N*a+_*i),r.lineTo(_*n-N*o,N*n+_*o),r.lineTo(_*s-N*u,N*s+_*u),r.lineTo(_*a+N*i,_*i-N*a),r.lineTo(_*n+N*o,_*o-N*n),r.lineTo(_*s+N*u,_*u-N*s),r.closePath()}};function ia(r,e){let t=null,a=vt(i);r=typeof r=="function"?r:ve(r||Fe),e=typeof e=="function"?e:ve(e===void 0?64:+e);function i(){let n;if(t||(t=n=a()),r.apply(this,arguments).draw(t,+e.apply(this,arguments)),n)return t=null,n+""||null}return i.type=function(n){return arguments.length?(r=typeof n=="function"?n:ve(n),i):r},i.size=function(n){return arguments.length?(e=typeof n=="function"?n:ve(+n),i):e},i.context=function(n){return arguments.length?(t=n??null,i):t},i}var oa=["type","size","sizeType"];function Ce(){return Ce=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)({}).hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},Ce.apply(null,arguments)}function Ve(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,a)}return t}function Xe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ve(Object(t),!0).forEach(function(a){la(r,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ve(Object(t)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(t,a))})}return r}function la(r,e,t){return(e=sa(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function sa(r){var e=ca(r,"string");return typeof e=="symbol"?e:e+""}function ca(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function ua(r,e){if(r==null)return{};var t,a,i=va(r,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(a=0;a<n.length;a++)t=n[a],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function va(r,e){if(r==null)return{};var t={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(e.indexOf(a)!==-1)continue;t[a]=r[a]}return t}var Yr={symbolCircle:Fe,symbolCross:Zt,symbolDiamond:Vt,symbolSquare:Xt,symbolStar:ra,symbolTriangle:ta,symbolWye:na},fa=Math.PI/180,da=r=>{var e="symbol".concat(Nr(r));return Yr[e]||Fe},pa=(r,e,t)=>{if(e==="area")return r;switch(t){case"cross":return 5*r*r/9;case"diamond":return .5*r*r/Math.sqrt(3);case"square":return r*r;case"star":{var a=18*fa;return 1.25*r*r*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*r*r/4;case"wye":return(21-10*Math.sqrt(3))*r*r/8;default:return Math.PI*r*r/4}},ma=(r,e)=>{Yr["symbol".concat(Nr(r))]=e},Vr=r=>{var{type:e="circle",size:t=64,sizeType:a="area"}=r,i=ua(r,oa),n=Xe(Xe({},i),{},{type:e,size:t,sizeType:a}),o="circle";typeof e=="string"&&(o=e);var s=()=>{var v=da(o),m=ia().type(v).size(pa(t,a,o)),h=m();if(h!==null)return h},{className:u,cx:c,cy:l}=n,f=ee(n);return le(c)&&le(l)&&le(t)?d.createElement("path",Ce({},f,{className:se("recharts-symbols",u),transform:"translate(".concat(c,", ").concat(l,")"),d:s()})):null};Vr.registerSymbol=ma;var ha=["radius"],ga=["radius"],Je,Qe,er,rr,tr,ar,nr,ir,or,lr;function sr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,a)}return t}function cr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sr(Object(t),!0).forEach(function(a){ya(r,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):sr(Object(t)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(t,a))})}return r}function ya(r,e,t){return(e=ba(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ba(r){var e=xa(r,"string");return typeof e=="symbol"?e:e+""}function xa(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function be(){return be=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)({}).hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},be.apply(null,arguments)}function ur(r,e){if(r==null)return{};var t,a,i=Oa(r,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(a=0;a<n.length;a++)t=n[a],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function Oa(r,e){if(r==null)return{};var t={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(e.indexOf(a)!==-1)continue;t[a]=r[a]}return t}function K(r,e){return e||(e=r.slice(0)),Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(e)}}))}var vr=(r,e,t,a,i)=>{var n=Q(t),o=Q(a),s=Math.min(Math.abs(n)/2,Math.abs(o)/2),u=o>=0?1:-1,c=n>=0?1:-1,l=o>=0&&n>=0||o<0&&n<0?1:0,f;if(s>0&&Array.isArray(i)){for(var v=[0,0,0,0],m=0,h=4;m<h;m++){var g,b=(g=i[m])!==null&&g!==void 0?g:0;v[m]=b>s?s:b}f=I(Je||(Je=K(["M",",",""])),r,e+u*v[0]),v[0]>0&&(f+=I(Qe||(Qe=K(["A ",",",",0,0,",",",",",""])),v[0],v[0],l,r+c*v[0],e)),f+=I(er||(er=K(["L ",",",""])),r+t-c*v[1],e),v[1]>0&&(f+=I(rr||(rr=K(["A ",",",",0,0,",`,
2
+ `,",",""])),v[1],v[1],l,r+t,e+u*v[1])),f+=I(tr||(tr=K(["L ",",",""])),r+t,e+a-u*v[2]),v[2]>0&&(f+=I(ar||(ar=K(["A ",",",",0,0,",`,
3
+ `,",",""])),v[2],v[2],l,r+t-c*v[2],e+a)),f+=I(nr||(nr=K(["L ",",",""])),r+c*v[3],e+a),v[3]>0&&(f+=I(ir||(ir=K(["A ",",",",0,0,",`,
4
+ `,",",""])),v[3],v[3],l,r,e+a-u*v[3])),f+="Z"}else if(s>0&&i===+i&&i>0){var p=Math.min(s,i);f=I(or||(or=K(["M ",",",`
5
+ A `,",",",0,0,",",",",",`
6
+ L `,",",`
7
+ A `,",",",0,0,",",",",",`
8
+ L `,",",`
9
+ A `,",",",0,0,",",",",",`
10
+ L `,",",`
11
+ A `,",",",0,0,",",",","," Z"])),r,e+u*p,p,p,l,r+c*p,e,r+t-c*p,e,p,p,l,r+t,e+u*p,r+t,e+a-u*p,p,p,l,r+t-c*p,e+a,r+c*p,e+a,p,p,l,r,e+a-u*p)}else f=I(lr||(lr=K(["M ",","," h "," v "," h "," Z"])),r,e,t,a,-t);return f},fr={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Pa=r=>{var e=Ae(r,fr),t=d.useRef(null),[a,i]=d.useState(-1);d.useEffect(()=>{if(t.current&&t.current.getTotalLength)try{var T=t.current.getTotalLength();T&&i(T)}catch{}},[]);var{x:n,y:o,width:s,height:u,radius:c,className:l}=e,{animationEasing:f,animationDuration:v,animationBegin:m,isAnimationActive:h,isUpdateAnimationActive:g}=e,b=d.useRef(s),p=d.useRef(u),y=d.useRef(n),x=d.useRef(o),O=d.useMemo(()=>({x:n,y:o,width:s,height:u,radius:c}),[n,o,s,u,c]),S=Le(O,"rectangle-");if(n!==+n||o!==+o||s!==+s||u!==+u||s===0||u===0)return null;var j=se("recharts-rectangle",l);if(!g){var A=ee(e),{radius:D}=A,M=ur(A,ha);return d.createElement("path",be({},M,{x:Q(n),y:Q(o),width:Q(s),height:Q(u),radius:typeof c=="number"?c:void 0,className:j,d:vr(n,o,s,u,c)}))}var k=b.current,C=p.current,U=y.current,X=x.current,E="0px ".concat(a===-1?1:a,"px"),L="".concat(a,"px ").concat(a,"px"),z=$r(["strokeDasharray"],v,typeof f=="string"?f:fr.animationEasing);return d.createElement(Ke,{animationId:S,key:S,canBegin:a>0,duration:v,easing:f,isActive:g,begin:m},T=>{var R=w(k,s,T),W=w(C,u,T),F=w(U,n,T),ie=w(X,o,T);t.current&&(b.current=R,p.current=W,y.current=F,x.current=ie);var J;h?T>0?J={transition:z,strokeDasharray:L}:J={strokeDasharray:E}:J={strokeDasharray:L};var ue=ee(e),{radius:vi}=ue,st=ur(ue,ga);return d.createElement("path",be({},st,{radius:typeof c=="number"?c:void 0,className:j,d:vr(F,ie,R,W,c),ref:t,style:cr(cr({},J),e.style)}))})},dr,pr,mr,hr,gr,yr,br;function Be(){return Be=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)({}).hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},Be.apply(null,arguments)}function Z(r,e){return e||(e=r.slice(0)),Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(e)}}))}var ja=(r,e)=>{var t=me(e-r),a=Math.min(Math.abs(e-r),359.999);return t*a},fe=r=>{var{cx:e,cy:t,radius:a,angle:i,sign:n,isExternal:o,cornerRadius:s,cornerIsExternal:u}=r,c=s*(o?1:-1)+a,l=Math.asin(s/c)/Ue,f=u?i:i+n*l,v=H(e,t,c,f),m=H(e,t,a,f),h=u?i-n*l:i,g=H(e,t,c*Math.cos(l*Ue),h);return{center:v,circleTangency:m,lineTangency:g,theta:l}},Xr=r=>{var{cx:e,cy:t,innerRadius:a,outerRadius:i,startAngle:n,endAngle:o}=r,s=ja(n,o),u=n+s,c=H(e,t,i,n),l=H(e,t,i,u),f=I(dr||(dr=Z(["M ",",",`
12
+ A `,",",`,0,
13
+ `,",",`,
14
+ `,",",`
15
+ `])),c.x,c.y,i,i,+(Math.abs(s)>180),+(n>u),l.x,l.y);if(a>0){var v=H(e,t,a,n),m=H(e,t,a,u);f+=I(pr||(pr=Z(["L ",",",`
16
+ A `,",",`,0,
17
+ `,",",`,
18
+ `,","," Z"])),m.x,m.y,a,a,+(Math.abs(s)>180),+(n<=u),v.x,v.y)}else f+=I(mr||(mr=Z(["L ",","," Z"])),e,t);return f},Aa=r=>{var{cx:e,cy:t,innerRadius:a,outerRadius:i,cornerRadius:n,forceCornerRadius:o,cornerIsExternal:s,startAngle:u,endAngle:c}=r,l=me(c-u),{circleTangency:f,lineTangency:v,theta:m}=fe({cx:e,cy:t,radius:i,angle:u,sign:l,cornerRadius:n,cornerIsExternal:s}),{circleTangency:h,lineTangency:g,theta:b}=fe({cx:e,cy:t,radius:i,angle:c,sign:-l,cornerRadius:n,cornerIsExternal:s}),p=s?Math.abs(u-c):Math.abs(u-c)-m-b;if(p<0)return o?I(hr||(hr=Z(["M ",",",`
19
+ a`,",",",0,0,1,",`,0
20
+ a`,",",",0,0,1,",`,0
21
+ `])),v.x,v.y,n,n,n*2,n,n,-n*2):Xr({cx:e,cy:t,innerRadius:a,outerRadius:i,startAngle:u,endAngle:c});var y=I(gr||(gr=Z(["M ",",",`
22
+ A`,",",",0,0,",",",",",`
23
+ A`,",",",0,",",",",",",",`
24
+ A`,",",",0,0,",",",",",`
25
+ `])),v.x,v.y,n,n,+(l<0),f.x,f.y,i,i,+(p>180),+(l<0),h.x,h.y,n,n,+(l<0),g.x,g.y);if(a>0){var{circleTangency:x,lineTangency:O,theta:S}=fe({cx:e,cy:t,radius:a,angle:u,sign:l,isExternal:!0,cornerRadius:n,cornerIsExternal:s}),{circleTangency:j,lineTangency:A,theta:D}=fe({cx:e,cy:t,radius:a,angle:c,sign:-l,isExternal:!0,cornerRadius:n,cornerIsExternal:s}),M=s?Math.abs(u-c):Math.abs(u-c)-S-D;if(M<0&&n===0)return"".concat(y,"L").concat(e,",").concat(t,"Z");y+=I(yr||(yr=Z(["L",",",`
26
+ A`,",",",0,0,",",",",",`
27
+ A`,",",",0,",",",",",",",`
28
+ A`,",",",0,0,",",",",","Z"])),A.x,A.y,n,n,+(l<0),j.x,j.y,a,a,+(M>180),+(l>0),x.x,x.y,n,n,+(l<0),O.x,O.y)}else y+=I(br||(br=Z(["L",",","Z"])),e,t);return y},Ia={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Sa=r=>{var e=Ae(r,Ia),{cx:t,cy:a,innerRadius:i,outerRadius:n,cornerRadius:o,forceCornerRadius:s,cornerIsExternal:u,startAngle:c,endAngle:l,className:f}=e;if(n<i||c===l)return null;var v=se("recharts-sector",f),m=n-i,h=pe(o,m,0,!0),g;return h>0&&Math.abs(c-l)<360?g=Aa({cx:t,cy:a,innerRadius:i,outerRadius:n,cornerRadius:Math.min(h,m/2),forceCornerRadius:s,cornerIsExternal:u,startAngle:c,endAngle:l}):g=Xr({cx:t,cy:a,innerRadius:i,outerRadius:n,startAngle:c,endAngle:l}),d.createElement("path",Be({},ee(e),{className:v,d:g}))},qe=r=>null;qe.displayName="Cell";var ke={},xr;function Ea(){return xr||(xr=1,(function(r){Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});function e(t){if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const i=t[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable?!1:t.toString()===`[object ${i}]`}let a=t;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(t)===a}r.isPlainObject=e})(ke)),ke}var Te,Or;function ka(){return Or||(Or=1,Te=Ea().isPlainObject),Te}var Ta=ka();const wa=ct(Ta);var Pr,jr,Ar,Ir,Sr;function Er(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,a)}return t}function kr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Er(Object(t),!0).forEach(function(a){Ma(r,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Er(Object(t)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(t,a))})}return r}function Ma(r,e,t){return(e=Ca(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ca(r){var e=Ba(r,"string");return typeof e=="symbol"?e:e+""}function Ba(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function xe(){return xe=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)({}).hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},xe.apply(null,arguments)}function oe(r,e){return e||(e=r.slice(0)),Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(e)}}))}var Tr=(r,e,t,a,i)=>{var n=t-a,o;return o=I(Pr||(Pr=oe(["M ",",",""])),r,e),o+=I(jr||(jr=oe(["L ",",",""])),r+t,e),o+=I(Ar||(Ar=oe(["L ",",",""])),r+t-n/2,e+i),o+=I(Ir||(Ir=oe(["L ",",",""])),r+t-n/2-a,e+i),o+=I(Sr||(Sr=oe(["L ",","," Z"])),r,e),o},Da={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},_a=r=>{var e=Ae(r,Da),{x:t,y:a,upperWidth:i,lowerWidth:n,height:o,className:s}=e,{animationEasing:u,animationDuration:c,animationBegin:l,isUpdateAnimationActive:f}=e,v=d.useRef(null),[m,h]=d.useState(-1),g=d.useRef(i),b=d.useRef(n),p=d.useRef(o),y=d.useRef(t),x=d.useRef(a),O=Le(r,"trapezoid-");if(d.useEffect(()=>{if(v.current&&v.current.getTotalLength)try{var E=v.current.getTotalLength();E&&h(E)}catch{}},[]),t!==+t||a!==+a||i!==+i||n!==+n||o!==+o||i===0&&n===0||o===0)return null;var S=se("recharts-trapezoid",s);if(!f)return d.createElement("g",null,d.createElement("path",xe({},ee(e),{className:S,d:Tr(t,a,i,n,o)})));var j=g.current,A=b.current,D=p.current,M=y.current,k=x.current,C="0px ".concat(m===-1?1:m,"px"),U="".concat(m,"px ").concat(m,"px"),X=$r(["strokeDasharray"],c,u);return d.createElement(Ke,{animationId:O,key:O,canBegin:m>0,duration:c,easing:u,isActive:f,begin:l},E=>{var L=w(j,i,E),z=w(A,n,E),T=w(D,o,E),R=w(M,t,E),W=w(k,a,E);v.current&&(g.current=L,b.current=z,p.current=T,y.current=R,x.current=W);var F=E>0?{transition:X,strokeDasharray:U}:{strokeDasharray:C};return d.createElement("path",xe({},ee(e),{className:S,d:Tr(R,W,L,z,T),ref:v,style:kr(kr({},F),e.style)}))})},Na=["option","shapeType","activeClassName","inActiveClassName"];function $a(r,e){if(r==null)return{};var t,a,i=La(r,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(a=0;a<n.length;a++)t=n[a],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function La(r,e){if(r==null)return{};var t={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(e.indexOf(a)!==-1)continue;t[a]=r[a]}return t}function wr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,a)}return t}function Oe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wr(Object(t),!0).forEach(function(a){Ka(r,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):wr(Object(t)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(t,a))})}return r}function Ka(r,e,t){return(e=Ra(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ra(r){var e=za(r,"string");return typeof e=="symbol"?e:e+""}function za(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Wa(r,e){return Oe(Oe({},e),r)}function Fa(r,e){return r==="symbols"}function Mr(r){var{shapeType:e,elementProps:t}=r;switch(e){case"rectangle":return d.createElement(Pa,t);case"trapezoid":return d.createElement(_a,t);case"sector":return d.createElement(Sa,t);case"symbols":if(Fa(e))return d.createElement(Vr,t);break;case"curve":return d.createElement(ft,t);default:return null}}function qa(r){return d.isValidElement(r)?r.props:r}function Ga(r){var{option:e,shapeType:t,activeClassName:a="recharts-active-shape",inActiveClassName:i="recharts-shape"}=r,n=$a(r,Na),o;if(d.isValidElement(e))o=d.cloneElement(e,Oe(Oe({},n),qa(e)));else if(typeof e=="function")o=e(n,n.index);else if(wa(e)&&typeof e!="boolean"){var s=Wa(e,n);o=d.createElement(Mr,{shapeType:t,elementProps:s})}else{var u=n;o=d.createElement(Mr,{shapeType:t,elementProps:u})}return n.isActive?d.createElement(re,{className:a},o):d.createElement(re,{className:i},o)}var Jr=(r,e,t)=>{var a=Re();return(i,n)=>o=>{r?.(i,n,o),a(dt({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:t}))}},Qr=r=>{var e=Re();return(t,a)=>i=>{r?.(t,a,i),e(pt())}},et=(r,e,t)=>{var a=Re();return(i,n)=>o=>{r?.(i,n,o),a(mt({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:t}))}},Cr=(r,e,t)=>{var a=t??r;if(!Ie(a))return pe(a,e,0)},Ua=(r,e,t)=>{var a={},i=r.filter(ht),n=r.filter(c=>c.stackId==null),o=i.reduce((c,l)=>{var f=c[l.stackId];return f==null&&(f=[]),f.push(l),c[l.stackId]=f,c},a),s=Object.entries(o).map(c=>{var l,[f,v]=c,m=v.map(g=>g.dataKey),h=Cr(e,t,(l=v[0])===null||l===void 0?void 0:l.barSize);return{stackId:f,dataKeys:m,barSize:h}}),u=n.map(c=>{var l=[c.dataKey].filter(v=>v!=null),f=Cr(e,t,c.barSize);return{stackId:void 0,dataKeys:l,barSize:f}});return[...s,...u]};function Br(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,a)}return t}function de(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Br(Object(t),!0).forEach(function(a){Ha(r,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Br(Object(t)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(t,a))})}return r}function Ha(r,e,t){return(e=Za(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Za(r){var e=Ya(r,"string");return typeof e=="symbol"?e:e+""}function Ya(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Va(r,e,t,a,i){var n,o=a.length;if(!(o<1)){var s=pe(r,t,0,!0),u,c=[];if(we((n=a[0])===null||n===void 0?void 0:n.barSize)){var l=!1,f=t/o,v=a.reduce((y,x)=>y+(x.barSize||0),0);v+=(o-1)*s,v>=t&&(v-=(o-1)*s,s=0),v>=t&&f>0&&(l=!0,f*=.9,v=o*f);var m=(t-v)/2>>0,h={offset:m-s,size:0};u=a.reduce((y,x)=>{var O,S={stackId:x.stackId,dataKeys:x.dataKeys,position:{offset:h.offset+h.size+s,size:l?f:(O=x.barSize)!==null&&O!==void 0?O:0}},j=[...y,S];return h=S.position,j},c)}else{var g=pe(e,t,0,!0);t-2*g-(o-1)*s<=0&&(s=0);var b=(t-2*g-(o-1)*s)/o;b>1&&(b>>=0);var p=we(i)?Math.min(b,i):b;u=a.reduce((y,x,O)=>[...y,{stackId:x.stackId,dataKeys:x.dataKeys,position:{offset:g+(b+s)*O+(b-p)/2,size:p}}],c)}return u}}var Xa=(r,e,t,a,i,n,o)=>{var s=Ie(o)?e:o,u=Va(t,a,i!==n?i:n,r,s);return i!==n&&u!=null&&(u=u.map(c=>de(de({},c),{},{position:de(de({},c.position),{},{offset:c.position.offset-i/2})}))),u},Ja=(r,e)=>{var t=gt(e);if(!(!r||t==null||e==null)){var{stackId:a}=e;if(a!=null){var i=r[a];if(i){var{stackedData:n}=i;if(n)return n.find(o=>o.key===t)}}}},Qa=(r,e)=>{if(!(r==null||e==null)){var t=r.find(a=>a.stackId===e.stackId&&e.dataKey!=null&&a.dataKeys.includes(e.dataKey));if(t!=null)return t.position}};function en(r,e){return r&&typeof r=="object"&&"zIndex"in r&&typeof r.zIndex=="number"&&we(r.zIndex)?r.zIndex:e}var rn=["children"];function tn(r,e){if(r==null)return{};var t,a,i=an(r,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(a=0;a<n.length;a++)t=n[a],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function an(r,e){if(r==null)return{};var t={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(e.indexOf(a)!==-1)continue;t[a]=r[a]}return t}var nn={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},on=d.createContext(nn);function ln(r){var{children:e}=r,t=tn(r,rn);return d.createElement(on.Provider,{value:t},e)}function De(){return De=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)({}).hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},De.apply(null,arguments)}function Ge(r){return d.createElement(Ga,De({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},r))}var sn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(a,i)=>{if(le(e))return e;var n=le(a)||Ie(a);return n?e(a,i):(n||ut(!1),t)}},cn=(r,e,t)=>t,un=(r,e)=>e,ce=G([Kr,un],(r,e)=>r.filter(t=>t.type==="bar").find(t=>t.id===e)),vn=G([ce],r=>r?.maxBarSize),fn=(r,e,t,a)=>a,dn=G([ne,Kr,Y,V,cn],(r,e,t,a,i)=>e.filter(n=>r==="horizontal"?n.xAxisId===t:n.yAxisId===a).filter(n=>n.isPanorama===i).filter(n=>n.hide===!1).filter(n=>n.type==="bar")),pn=(r,e,t)=>{var a=ne(r),i=Y(r,e),n=V(r,e);if(!(i==null||n==null))return a==="horizontal"?He(r,"yAxis",n,t):He(r,"xAxis",i,t)},mn=(r,e)=>{var t=ne(r),a=Y(r,e),i=V(r,e);if(!(a==null||i==null))return t==="horizontal"?Ze(r,"xAxis",a):Ze(r,"yAxis",i)},hn=G([dn,jt,mn],Ua),gn=(r,e,t)=>{var a,i,n=ce(r,e);if(n==null)return 0;var o=Y(r,e),s=V(r,e);if(o==null||s==null)return 0;var u=ne(r),c=Rr(r),{maxBarSize:l}=n,f=Ie(l)?c:l,v,m;return u==="horizontal"?(v=te(r,"xAxis",o,t),m=ae(r,"xAxis",o,t)):(v=te(r,"yAxis",s,t),m=ae(r,"yAxis",s,t)),(a=(i=Lr(v,m,!0))!==null&&i!==void 0?i:f)!==null&&a!==void 0?a:0},rt=(r,e,t)=>{var a=ne(r),i=Y(r,e),n=V(r,e);if(!(i==null||n==null)){var o,s;return a==="horizontal"?(o=te(r,"xAxis",i,t),s=ae(r,"xAxis",i,t)):(o=te(r,"yAxis",n,t),s=ae(r,"yAxis",n,t)),Lr(o,s)}},yn=G([hn,Rr,Ot,Pt,gn,rt,vn],Xa),bn=(r,e,t)=>{var a=Y(r,e);if(a!=null)return te(r,"xAxis",a,t)},xn=(r,e,t)=>{var a=V(r,e);if(a!=null)return te(r,"yAxis",a,t)},On=(r,e,t)=>{var a=Y(r,e);if(a!=null)return ae(r,"xAxis",a,t)},Pn=(r,e,t)=>{var a=V(r,e);if(a!=null)return ae(r,"yAxis",a,t)},jn=G([yn,ce],Qa),An=G([pn,ce],Ja),In=G([yt,bt,bn,xn,On,Pn,jn,ne,xt,rt,An,ce,fn],(r,e,t,a,i,n,o,s,u,c,l,f,v)=>{var{chartData:m,dataStartIndex:h,dataEndIndex:g}=u;if(!(f==null||o==null||e==null||s!=="horizontal"&&s!=="vertical"||t==null||a==null||i==null||n==null||c==null)){var{data:b}=f,p;if(b!=null&&b.length>0?p=b:p=m?.slice(h,g+1),p!=null)return Qn({layout:s,barSettings:f,pos:o,parentViewBox:e,bandSize:c,xAxis:t,yAxis:a,xAxisTicks:i,yAxisTicks:n,stackedData:l,displayedData:p,offset:r,cells:v,dataStartIndex:h})}}),Sn=["index"];function _e(){return _e=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)({}).hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},_e.apply(null,arguments)}function En(r,e){if(r==null)return{};var t,a,i=kn(r,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(a=0;a<n.length;a++)t=n[a],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function kn(r,e){if(r==null)return{};var t={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(e.indexOf(a)!==-1)continue;t[a]=r[a]}return t}var tt=d.createContext(void 0),Tn=r=>{var e=d.useContext(tt);if(e!=null)return e.stackId;if(r!=null)return At(r)},wn=(r,e)=>"recharts-bar-stack-clip-path-".concat(r,"-").concat(e),Mn=r=>{var e=d.useContext(tt);if(e!=null){var{stackId:t}=e;return"url(#".concat(wn(t,r),")")}},at=r=>{var{index:e}=r,t=En(r,Sn),a=Mn(e);return d.createElement(re,_e({className:"recharts-bar-stack-layer",clipPath:a},t))},Cn=["onMouseEnter","onMouseLeave","onClick"],Bn=["value","background","tooltipPosition"],Dn=["id"],_n=["onMouseEnter","onClick","onMouseLeave"];function q(){return q=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var a in t)({}).hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},q.apply(null,arguments)}function Dr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,a)}return t}function B(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dr(Object(t),!0).forEach(function(a){Nn(r,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dr(Object(t)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(t,a))})}return r}function Nn(r,e,t){return(e=$n(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function $n(r){var e=Ln(r,"string");return typeof e=="symbol"?e:e+""}function Ln(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Pe(r,e){if(r==null)return{};var t,a,i=Kn(r,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);for(a=0;a<n.length;a++)t=n[a],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(r,t)&&(i[t]=r[t])}return i}function Kn(r,e){if(r==null)return{};var t={};for(var a in r)if({}.hasOwnProperty.call(r,a)){if(e.indexOf(a)!==-1)continue;t[a]=r[a]}return t}var Rn=r=>{var{dataKey:e,name:t,fill:a,legendType:i,hide:n}=r;return[{inactive:n,dataKey:e,type:i,color:a,value:Wr(t,e),payload:r}]},zn=d.memo(r=>{var{dataKey:e,stroke:t,strokeWidth:a,fill:i,name:n,hide:o,unit:s,tooltipType:u,id:c}=r,l={dataDefinedOnItem:void 0,getPosition:wt,settings:{stroke:t,strokeWidth:a,fill:i,dataKey:e,nameKey:void 0,name:Wr(n,e),hide:o,type:u,color:i,unit:s,graphicalItemId:c}};return d.createElement(Tt,{tooltipEntrySettings:l})});function Wn(r){var e=he(qr),{data:t,dataKey:a,background:i,allOtherBarProps:n}=r,{onMouseEnter:o,onMouseLeave:s,onClick:u}=n,c=Pe(n,Cn),l=Jr(o,a,n.id),f=Qr(s),v=et(u,a,n.id);if(!i||t==null)return null;var m=_t(i);return d.createElement(ze,{zIndex:en(i,We.barBackground)},t.map((h,g)=>{var{value:b,background:p,tooltipPosition:y}=h,x=Pe(h,Bn);if(!p)return null;var O=l(h,g),S=f(h,g),j=v(h,g),A=B(B(B(B(B({option:i,isActive:String(g)===e},x),{},{fill:"#eee"},p),m),Gr(c,h,g)),{},{onMouseEnter:O,onMouseLeave:S,onClick:j,dataKey:a,index:g,className:"recharts-bar-background-rectangle"});return d.createElement(Ge,q({key:"background-bar-".concat(g)},A))}))}function Fn(r){var{showLabels:e,children:t,rects:a}=r,i=a?.map(n=>{var o={x:n.x,y:n.y,width:n.width,lowerWidth:n.width,upperWidth:n.width,height:n.height};return B(B({},o),{},{value:n.value,payload:n.payload,parentViewBox:n.parentViewBox,viewBox:o,fill:n.fill})});return d.createElement(Kt,{value:e?i:void 0},t)}function qn(r){var{shape:e,activeBar:t,baseProps:a,entry:i,index:n,dataKey:o}=r,s=he(qr),u=he(zt),c=t&&String(i.originalDataIndex)===s&&(u==null||o===u),[l,f]=d.useState(!1),[v,m]=d.useState(!1);d.useEffect(()=>{var x;return c?(f(!0),x=requestAnimationFrame(()=>{m(!0)})):m(!1),()=>{cancelAnimationFrame(x)}},[c]);var h=d.useCallback(()=>{c||f(!1)},[c]),g=c&&v,b=c||l,p;c?t===!0?p=e:p=t:p=e;var y=d.createElement(Ge,q({},a,{name:String(a.name)},i,{isActive:g,option:p,index:n,dataKey:o,onTransitionEnd:h}));return b?d.createElement(ze,{zIndex:We.activeBar},d.createElement(at,{index:i.originalDataIndex},y)):y}function Gn(r){var{shape:e,baseProps:t,entry:a,index:i,dataKey:n}=r;return d.createElement(Ge,q({},t,{name:String(t.name)},a,{isActive:!1,option:e,index:i,dataKey:n}))}function Un(r){var e,{data:t,props:a}=r,i=(e=Rt(a))!==null&&e!==void 0?e:{},{id:n}=i,o=Pe(i,Dn),{shape:s,dataKey:u,activeBar:c}=a,{onMouseEnter:l,onClick:f,onMouseLeave:v}=a,m=Pe(a,_n),h=Jr(l,u,n),g=Qr(v),b=et(f,u,n);return t?d.createElement(d.Fragment,null,t.map((p,y)=>d.createElement(at,q({index:p.originalDataIndex,key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(y),className:"recharts-bar-rectangle"},Gr(m,p,y),{onMouseEnter:h(p,y),onMouseLeave:g(p,y),onClick:b(p,y)}),c?d.createElement(qn,{shape:s,activeBar:c,baseProps:o,entry:p,index:y,dataKey:u}):d.createElement(Gn,{shape:s,baseProps:o,entry:p,index:y,dataKey:u})))):null}function Hn(r){var{props:e,previousRectanglesRef:t}=r,{data:a,layout:i,isAnimationActive:n,animationBegin:o,animationDuration:s,animationEasing:u,onAnimationEnd:c,onAnimationStart:l}=e,f=t.current,v=Le(e,"recharts-bar-"),[m,h]=d.useState(!1),g=!m,b=d.useCallback(()=>{typeof c=="function"&&c(),h(!1)},[c]),p=d.useCallback(()=>{typeof l=="function"&&l(),h(!0)},[l]);return d.createElement(Fn,{showLabels:g,rects:a},d.createElement(Ke,{animationId:v,begin:o,duration:s,isActive:n,easing:u,onAnimationEnd:b,onAnimationStart:p,key:v},y=>{var x=y===1?a:a?.map((O,S)=>{var j=f&&f[S];if(j)return B(B({},O),{},{x:w(j.x,O.x,y),y:w(j.y,O.y,y),width:w(j.width,O.width,y),height:w(j.height,O.height,y)});if(i==="horizontal"){var A=w(0,O.height,y),D=w(O.stackedBarStart,O.y,y);return B(B({},O),{},{y:D,height:A})}var M=w(0,O.width,y),k=w(O.stackedBarStart,O.x,y);return B(B({},O),{},{width:M,x:k})});return y>0&&(t.current=x??null),x==null?null:d.createElement(re,null,d.createElement(Un,{props:e,data:x}))}),d.createElement(Lt,{label:e.label}),e.children)}function Zn(r){var e=d.useRef(null);return d.createElement(Hn,{previousRectanglesRef:e,props:r})}var nt=0,Yn=(r,e)=>{var t=Array.isArray(r.value)?r.value[1]:r.value;return{x:r.x,y:r.y,value:t,errorVal:Fr(r,e)}};class Vn extends d.PureComponent{render(){var{hide:e,data:t,dataKey:a,className:i,xAxisId:n,yAxisId:o,needClip:s,background:u,id:c}=this.props;if(e||t==null)return null;var l=se("recharts-bar",i),f=c;return d.createElement(re,{className:l,id:c},s&&d.createElement("defs",null,d.createElement(Dt,{clipPathId:f,xAxisId:n,yAxisId:o})),d.createElement(re,{className:"recharts-bar-rectangles",clipPath:s?"url(#clipPath-".concat(f,")"):void 0},d.createElement(Wn,{data:t,dataKey:a,background:u,allOtherBarProps:this.props}),d.createElement(Zn,this.props)))}}var Xn={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:nt,xAxisId:0,yAxisId:0,zIndex:We.bar};function Jn(r){var{xAxisId:e,yAxisId:t,hide:a,legendType:i,minPointSize:n,activeBar:o,animationBegin:s,animationDuration:u,animationEasing:c,isAnimationActive:l}=r,{needClip:f}=Mt(e,t),v=Ct(),m=zr(),h=Bt(r.children,qe),g=he(y=>In(y,r.id,m,h));if(v!=="vertical"&&v!=="horizontal")return null;var b,p=g?.[0];return p==null||p.height==null||p.width==null?b=0:b=v==="vertical"?p.height/2:p.width/2,d.createElement(ln,{xAxisId:e,yAxisId:t,data:g,dataPointFormatter:Yn,errorBarOffset:b},d.createElement(Vn,q({},r,{layout:v,needClip:f,data:g,xAxisId:e,yAxisId:t,hide:a,legendType:i,minPointSize:n,activeBar:o,animationBegin:s,animationDuration:u,animationEasing:c,isAnimationActive:l})))}function Qn(r){var{layout:e,barSettings:{dataKey:t,minPointSize:a,hasCustomShape:i},pos:n,bandSize:o,xAxis:s,yAxis:u,xAxisTicks:c,yAxisTicks:l,stackedData:f,displayedData:v,offset:m,cells:h,parentViewBox:g,dataStartIndex:b}=r,p=e==="horizontal"?u:s,y=f?p.scale.domain():null,x=Nt({numericAxis:p}),O=p.scale.map(x);return v.map((S,j)=>{var A,D,M,k,C,U;if(f){var X=f[j+b];if(X==null)return null;A=$t(X,y)}else A=Fr(S,t),Array.isArray(A)||(A=[x,A]);var E=sn(a,nt)(A[1],j);if(e==="horizontal"){var L,z=u.scale.map(A[0]),T=u.scale.map(A[1]);if(z==null||T==null)return null;D=Ye({axis:s,ticks:c,bandSize:o,offset:n.offset,entry:S,index:j}),M=(L=T??z)!==null&&L!==void 0?L:void 0,k=n.size;var R=z-T;if(C=Wt(R)?0:R,U={x:D,y:m.top,width:k,height:m.height},Math.abs(E)>0&&Math.abs(C)<Math.abs(E)){var W=me(C||E)*(Math.abs(E)-Math.abs(C));M-=W,C+=W}}else{var F=s.scale.map(A[0]),ie=s.scale.map(A[1]);if(F==null||ie==null)return null;if(D=F,M=Ye({axis:u,ticks:l,bandSize:o,offset:n.offset,entry:S,index:j}),k=ie-F,C=n.size,U={x:m.left,y:M,width:m.width,height:C},Math.abs(E)>0&&Math.abs(k)<Math.abs(E)){var J=me(k||E)*(Math.abs(E)-Math.abs(k));k+=J}}if(D==null||M==null||k==null||C==null||!i&&(k===0||C===0))return null;var ue=B(B({},S),{},{stackedBarStart:O,x:D,y:M,width:k,height:C,value:f?A:A[1],payload:S,background:U,tooltipPosition:{x:D+k/2,y:M+C/2},parentViewBox:g,originalDataIndex:j},h&&h[j]&&h[j].props);return ue}).filter(Boolean)}function ei(r){var e=Ae(r,Xn),t=Tn(e.stackId),a=zr();return d.createElement(St,{id:e.id,type:"bar"},i=>d.createElement(d.Fragment,null,d.createElement(Et,{legendPayload:Rn(e)}),d.createElement(zn,{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:i}),d.createElement(kt,{type:"bar",id:i,data:void 0,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,stackId:t,hide:e.hide,barSize:e.barSize,minPointSize:e.minPointSize,maxBarSize:e.maxBarSize,isPanorama:a,hasCustomShape:e.shape!=null}),d.createElement(ze,{zIndex:e.zIndex},d.createElement(Jn,q({},e,{id:i})))))}var it=d.memo(ei,It);it.displayName="Bar";var ri=["axis","item"],ti=d.forwardRef((r,e)=>d.createElement(Ft,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ri,tooltipPayloadSearcher:qt,categoricalChartProps:r,ref:e}));function ai(r){const e=$e.c(24),{title:t,description:a,action:i,children:n,className:o,noPadding:s,onTitleClick:u}=r,c=s===void 0?!1:s;let l;e[0]!==t?(l=typeof t=="string"?P.jsx("div",{className:"text-sm font-medium text-foreground",children:t}):t,e[0]=t,e[1]=l):l=e[1];const f=l;let v;e[2]!==o?(v=_r("bg-background flex flex-col",o),e[2]=o,e[3]=v):v=e[3];let m;e[4]!==u||e[5]!==f?(m=u?P.jsx("button",{onClick:u,className:"text-left hover:text-foreground transition-colors cursor-pointer",children:f}):f,e[4]=u,e[5]=f,e[6]=m):m=e[6];let h;e[7]!==a?(h=a?P.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:a}):null,e[7]=a,e[8]=h):h=e[8];let g;e[9]!==m||e[10]!==h?(g=P.jsxs("div",{className:"min-w-0",children:[m,h]}),e[9]=m,e[10]=h,e[11]=g):g=e[11];let b;e[12]!==i?(b=i?P.jsx("div",{className:"shrink-0",children:i}):null,e[12]=i,e[13]=b):b=e[13];let p;e[14]!==g||e[15]!==b?(p=P.jsxs("header",{className:"flex items-center justify-between gap-4 p-5",children:[g,b]}),e[14]=g,e[15]=b,e[16]=p):p=e[16];let y;e[17]!==n||e[18]!==c?(y=c?P.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-h-0",children:n}):P.jsx("div",{className:"px-5 pb-5 pt-2",children:n}),e[17]=n,e[18]=c,e[19]=y):y=e[19];let x;return e[20]!==v||e[21]!==p||e[22]!==y?(x=P.jsxs("div",{className:v,children:[p,y]}),e[20]=v,e[21]=p,e[22]=y,e[23]=x):x=e[23],x}const ot=60*1e3,je=60*ot,ni=24*je,lt=25*je;function Ne(r,e){if(r.length===0)return 0;const t=[...r].sort((i,n)=>i-n),a=Math.max(0,Math.min(t.length-1,Math.ceil(e*t.length)-1));return t[a]??0}function ii(r,e){return e<=lt?r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):r.toLocaleDateString([],{month:"short",day:"numeric"})}function oi(r,e){const t=e-r;return t<=je?Math.max(1,Math.min(60,Math.ceil(t/ot))):t<=lt?Math.max(1,Math.min(25,Math.ceil(t/je))):Math.max(1,Math.min(31,Math.ceil(t/ni)))}function li(r,e,t,a){const i=e.getTime(),n=t.getTime(),o=Math.max(1,n-i),s=oi(i,n),u=Math.max(1,Math.floor(o/s)),c=[];for(let l=0;l<s;l++){const f=new Date(i+l*u);c.push({t:f.toISOString(),ts:f.getTime(),label:ii(f,o),calls:0,errors:0,durations:[]})}for(const l of r){const f=new Date(l.timestamp).getTime(),v=Math.floor((f-i)/u),m=Math.max(0,Math.min(s-1,v)),h=c[m];h&&(h.calls+=1,l.isError&&(h.errors+=1),Number.isFinite(l.durationMs)&&h.durations.push(l.durationMs))}return c.map(l=>({t:l.t,ts:l.ts,label:l.label,calls:l.calls,errors:l.errors,errorRate:l.calls>0?l.errors/l.calls*100:0,avg:Math.round(l.durations.length>0?l.durations.reduce((f,v)=>f+v,0)/l.durations.length:0),p50:Math.round(Ne(l.durations,.5)),p95:Math.round(Ne(l.durations,.95))}))}function pi(r,e,t,a){const i=r.length,n=r.filter(l=>l.isError).length,o=r.map(l=>l.durationMs),s=o.length>0?o.reduce((l,f)=>l+f,0)/o.length:0,u=Ne(o,.95),c=li(r,e.startDate,e.endDate);return{totalCalls:i,totalErrors:n,avgDurationMs:s,p95DurationMs:u,data:c}}function mi(r){const e=$e.c(29),{data:t,dataKey:a,colorNum:i,chartHeight:n}=r,o=`var(--chart-${i})`;let s;e[0]!==n?(s=_r(n,"w-full"),e[0]=n,e[1]=s):s=e[1];let u;e[2]!==o||e[3]!==a?(u={label:a,color:o},e[2]=o,e[3]=a,e[4]=u):u=e[4];let c;e[5]!==a||e[6]!==u?(c={[a]:u},e[5]=a,e[6]=u,e[7]=c):c=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l={left:0,right:0,top:0,bottom:0},e[8]=l):l=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=P.jsx(Gt,{content:P.jsx(Ut,{indicator:"line",labelFormatter:si})}),e[9]=f):f=e[9];let v;e[10]===Symbol.for("react.memo_cache_sentinel")?(v=[0,0,0,0],e[10]=v):v=e[10];let m;if(e[11]!==o||e[12]!==t||e[13]!==a){let p;e[15]!==o||e[16]!==a?(p=(y,x)=>P.jsx(qe,{fill:y[a]===0?"var(--muted-foreground)":o,fillOpacity:y[a]===0?.25:1},`cell-${x}`),e[15]=o,e[16]=a,e[17]=p):p=e[17],m=t.map(p),e[11]=o,e[12]=t,e[13]=a,e[14]=m}else m=e[14];let h;e[18]!==o||e[19]!==a||e[20]!==m?(h=P.jsx(it,{dataKey:a,fill:o,radius:v,minPointSize:1,children:m}),e[18]=o,e[19]=a,e[20]=m,e[21]=h):h=e[21];let g;e[22]!==t||e[23]!==h?(g=P.jsxs(ti,{data:t,margin:l,children:[f,h]}),e[22]=t,e[23]=h,e[24]=g):g=e[24];let b;return e[25]!==s||e[26]!==c||e[27]!==g?(b=P.jsx(Ht,{className:s,config:c,children:g}),e[25]=s,e[26]=c,e[27]=g,e[28]=b):b=e[28],b}function si(r,e){const t=Array.isArray(e)?e[0]:void 0;return t&&typeof t=="object"&&"payload"in t?t.payload?.label??"":""}function hi(){const r=$e.c(1);let e;return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=P.jsx("div",{className:"grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",children:[...Array(3)].map(ci)}),r[0]=e):e=r[0],e}function ci(r,e){return P.jsx(ai,{title:P.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[P.jsx("div",{className:"h-4 w-16 rounded bg-muted animate-pulse"}),P.jsx("div",{className:"h-5 md:h-6 w-12 rounded bg-muted animate-pulse"})]}),children:P.jsxs("div",{className:"flex flex-col w-full",children:[P.jsx("div",{className:"h-[30px] md:h-[40px] w-full rounded bg-muted animate-pulse"}),P.jsx("div",{className:"space-y-1.5 mt-2",children:Array.from({length:3}).map(ui)})]})},e)}function ui(r,e){return P.jsxs("div",{className:"flex items-center gap-1.5",children:[P.jsx("div",{className:"size-4 rounded-sm bg-muted animate-pulse shrink-0"}),P.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"}),P.jsx("div",{className:"h-1.5 flex-1 bg-muted animate-pulse"}),P.jsx("div",{className:"h-2.5 w-8 rounded bg-muted animate-pulse shrink-0"})]},e)}export{ti as B,qe as C,ai as H,mi as K,hi as M,ln as S,it as a,Ga as b,pi as c};
@@ -1 +1 @@
1
- import{r,j as e,h as n}from"./index-DO8fUd54.js";import{i as l}from"./Loading01-WTkiPysv.js";function d(){const[t,c]=r.useState(null),[i,a]=r.useState(!1);return r.useEffect(()=>{(async()=>{try{const s=await n();if(!s.success){c(s.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(s){c(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[i&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!i&&!t&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(l,{size:32,className:"animate-spin text-primary"})}),t&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t?"Authentication Failed":i?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:t?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:t}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):i?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{d as default};
1
+ import{r,j as e,h as n}from"./index-DsOJvxnb.js";import{i as l}from"./Loading01-BNn4YU_K.js";function d(){const[t,c]=r.useState(null),[i,a]=r.useState(!1);return r.useEffect(()=>{(async()=>{try{const s=await n();if(!s.success){c(s.error||"MCP authentication failed"),setTimeout(()=>{window.close()},3e3);return}a(!0),setTimeout(()=>{window.close()},1500)}catch(s){c(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[i&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!i&&!t&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(l,{size:32,className:"animate-spin text-primary"})}),t&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t?"Authentication Failed":i?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:t?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:t}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),"This window will close automatically."]})]}):i?e.jsxs("p",{children:["Authentication complete.",e.jsx("br",{}),"This window will close automatically."]}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{d as default};
@@ -1 +1 @@
1
- import{r,j as e}from"./index-DO8fUd54.js";import{i as d}from"./Loading01-WTkiPysv.js";function h(){const[t,i]=r.useState("loading"),[o,l]=r.useState(null),c=r.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const s=new URLSearchParams(window.location.search),a=s.get("code"),n=s.get("state");if(!a||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:a,stateToken:n},window.location.origin),i("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(s){console.error("OAuth callback error:",s),l(s instanceof Error?s.message:String(s)),i("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[t==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),t==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(d,{size:32,className:"animate-spin text-primary"})}),t==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t==="error"?"Authentication Failed":t==="success"?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:t==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:o}),e.jsx("p",{className:"mt-2",children:"This window will close automatically."})]}):t==="success"?e.jsx("p",{children:"Authentication complete. This window will close automatically."}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
1
+ import{r,j as e}from"./index-DsOJvxnb.js";import{i as d}from"./Loading01-BNn4YU_K.js";function h(){const[t,i]=r.useState("loading"),[o,l]=r.useState(null),c=r.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const s=new URLSearchParams(window.location.search),a=s.get("code"),n=s.get("state");if(!a||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:a,stateToken:n},window.location.origin),i("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(s){console.error("OAuth callback error:",s),l(s instanceof Error?s.message:String(s)),i("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[t==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),t==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(d,{size:32,className:"animate-spin text-primary"})}),t==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t==="error"?"Authentication Failed":t==="success"?"Authentication Successful":"Authentication in progress..."}),e.jsx("div",{className:"text-sm text-muted-foreground",children:t==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:"An error occurred during authentication:"}),e.jsx("p",{className:"text-destructive",children:o}),e.jsx("p",{className:"mt-2",children:"This window will close automatically."})]}):t==="success"?e.jsx("p",{children:"Authentication complete. This window will close automatically."}):e.jsx("p",{children:"Processing authentication..."})})]})]})})}export{h as default};
@@ -1 +1 @@
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
+ import{r as v,c as E,aw 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,y as oe,B as V,E as le}from"./index-DsOJvxnb.js";import{u as ce}from"./use-local-storage-CxC8ozOe.js";import{u as Y}from"./useMutation-B_cFG709.js";import{i as de}from"./AlertCircle-De9oqjty.js";import{i as me}from"./EyeOff-9_-SJWcU.js";import{s as ue}from"./Eye-JuDcZhJz.js";import{i as fe}from"./Key01-DAjAUWfr.js";import{s as he}from"./Trash01-YPQczxci.js";import{C as xe}from"./card-RQxLVCBk.js";import{I as G}from"./input-CUT8DBv1.js";import{S as pe}from"./skeleton-DJFpR-1P.js";import{A as ge}from"./avatar-OE2URZfM.js";import{b as X,P as J,a as ee}from"./popover-CF3EN_0o.js";import{a as ve,b as ye}from"./use-llm-BkLbMZPM.js";import{u as te,a as se}from"./constants-XtX-WKGm.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};