decocms 2.138.1 → 2.158.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.
- package/README.md +417 -40
- package/dist/README.md +295 -0
- package/dist/client/assets/AlertCircle-26BTIquA.js +1 -0
- package/dist/client/assets/AlignLeft-BAoWjJLP.js +1 -0
- package/dist/client/assets/ArrowDown-DOvUYGWu.js +1 -0
- package/dist/client/assets/ArrowLeft-DWje-uhw.js +1 -0
- package/dist/client/assets/ArrowUp-D2NkC4ab.js +1 -0
- package/dist/client/assets/Check-C-l3bofu.js +1 -0
- package/dist/client/assets/CheckCircle-CZM8ZVML.js +1 -0
- package/dist/client/assets/CheckDone01-CRQ2Q5iB.js +1 -0
- package/dist/client/assets/CheckVerified02-CdvCNYCb.js +1 -0
- package/dist/client/assets/ChevronDown-BpPBzMeM.js +1 -0
- package/dist/client/assets/ChevronLeft-GX7d8CR0.js +1 -0
- package/dist/client/assets/ChevronRight-Bcq8irGN.js +1 -0
- package/dist/client/assets/Clock-COzVVCOL.js +1 -0
- package/dist/client/assets/Code01-Cs4VK4vB.js +1 -0
- package/dist/client/assets/CommitMono-VariableFont-ytizKI8U.woff2 +0 -0
- package/dist/client/assets/Container-DfhSnqz2.js +1 -0
- package/dist/client/assets/Copy01-DO2wEvaR.js +1 -0
- package/dist/client/assets/Dataflow03-CR5XGPzI.js +1 -0
- package/dist/client/assets/DotsHorizontal-C91UrTJm.js +1 -0
- package/dist/client/assets/DotsVertical-BP619RCa.js +1 -0
- package/dist/client/assets/Download01-Cflyuz7y.js +1 -0
- package/dist/client/assets/Edit01-DNHTcM62.js +1 -0
- package/dist/client/assets/Edit05-CVYO506c.js +1 -0
- package/dist/client/assets/Eye-B6nj5379.js +1 -0
- package/dist/client/assets/File02-DAPQcszQ.js +1 -0
- package/dist/client/assets/File06-Dzak8I2H.js +1 -0
- package/dist/client/assets/FilterLines-wbfkcsV6.js +1 -0
- package/dist/client/assets/Globe01-Dd1Phwt-.js +1 -0
- package/dist/client/assets/Globe02-Cg-Z7cLo.js +1 -0
- package/dist/client/assets/Grid01-BLFAr7r2.js +1 -0
- package/dist/client/assets/Hash02-uuIbzxX_.js +1 -0
- package/dist/client/assets/Home02-BrIyZWmN.js +1 -0
- package/dist/client/assets/Image01-Vfr2TPcb.js +1 -0
- package/dist/client/assets/Inbox01-XtxMWjtl.js +1 -0
- package/dist/client/assets/InfoCircle-B0eSQpWU.js +1 -0
- package/dist/client/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
- package/dist/client/assets/InterVariable-Italic-FCBEiFp6.woff2 +0 -0
- package/dist/client/assets/Key01-BoUAxj2a.js +1 -0
- package/dist/client/assets/LayersTwo01-C0YKG0Ut.js +1 -0
- package/dist/client/assets/LayoutLeft-B-ahrlsc.js +1 -0
- package/dist/client/assets/Link01-DT5QeLT3.js +1 -0
- package/dist/client/assets/LinkExternal01-Cpl22oK3.js +1 -0
- package/dist/client/assets/List-CRA-lBCj.js +1 -0
- package/dist/client/assets/Loading01-DIEH7Z5_.js +1 -0
- package/dist/client/assets/Lock01-BImR4r91.js +1 -0
- package/dist/client/assets/Play-BS-YE1aJ.js +1 -0
- package/dist/client/assets/Plus-6jiO8ZBC.js +1 -0
- package/dist/client/assets/RefreshCcw01-Bd7NliRG.js +1 -0
- package/dist/client/assets/Save01-CJOg2A57.js +1 -0
- package/dist/client/assets/SearchMd-DueTE2Za.js +1 -0
- package/dist/client/assets/Settings01-CAa6kxIP.js +1 -0
- package/dist/client/assets/Shield01-D5Lbpdkf.js +1 -0
- package/dist/client/assets/Terminal-Dz3ItnDT.js +1 -0
- package/dist/client/assets/Trash01-BJfk29r7.js +1 -0
- package/dist/client/assets/Upload01-C8qgsFaC.js +1 -0
- package/dist/client/assets/Users03-By3xPyKu.js +1 -0
- package/dist/client/assets/X-CUBSBnfW.js +1 -0
- package/dist/client/assets/XCircle-BXSJdo4M.js +1 -0
- package/dist/client/assets/XClose-_SUO6WNY.js +1 -0
- package/dist/client/assets/Zap-DVnpZGTR.js +1 -0
- package/dist/client/assets/agent-connections-preview-C21rY3q6.js +1 -0
- package/dist/client/assets/agent-detail-DUDAQJKs.js +2 -0
- package/dist/client/assets/agents-Cn8ejClp.js +1 -0
- package/dist/client/assets/alert-dialog-B7sc3pCd.js +7 -0
- package/dist/client/assets/auth-catchall-BabTR-AY.js +1 -0
- package/dist/client/assets/avatar-VlWNUAOT.js +1 -0
- package/dist/client/assets/badge-CD6BO54l.js +1 -0
- package/dist/client/assets/binder-QSDeS-7I.js +1 -0
- package/dist/client/assets/breadcrumb-Vup1mlRL.js +1 -0
- package/dist/client/assets/card-BHxWxRj-.js +1 -0
- package/dist/client/assets/chart-O3Ehqi3I.js +15 -0
- package/dist/client/assets/checkbox-B-bMpUYn.js +1 -0
- package/dist/client/assets/circle-alert-SzbQtmQL.js +1 -0
- package/dist/client/assets/collapsible-BqLGfdnv.js +1 -0
- package/dist/client/assets/collection-detail-8sG8i6JT.js +26 -0
- package/dist/client/assets/collection-display-button-nzZSsR71.js +1 -0
- package/dist/client/assets/collection-search-BLa1FSgc.js +1 -0
- package/dist/client/assets/collection-tab-hD9xx2RM.js +1 -0
- package/dist/client/assets/collection-table-wrapper-Cfty5LrU.js +1 -0
- package/dist/client/assets/collection-tabs-DuOpqFgB.js +1 -0
- package/dist/client/assets/command-8epQsgvR.js +1 -0
- package/dist/client/assets/connect-CGAUvQM2.js +1 -0
- package/dist/client/assets/connection-card-BIcygpni.js +1 -0
- package/dist/client/assets/connection-detail-Bw487j0p.js +1 -0
- package/dist/client/assets/connection-status-CSmuws8d.js +1 -0
- package/dist/client/assets/connections-Cjfm40VT.js +1 -0
- package/dist/client/assets/constants-CTgpgeQD.js +1 -0
- package/dist/client/assets/constants-Dj_jISYh.js +1 -0
- package/dist/client/assets/context-YskDy6K-.js +29 -0
- package/dist/client/assets/create-organization-dialog-BUG--1y4.js +1 -0
- package/dist/client/assets/create-project-dialog-BuQN_Adf.js +1 -0
- package/dist/client/assets/danger-FybWJEM-.js +1 -0
- package/dist/client/assets/danger-zone-s3K0APgl.js +1 -0
- package/dist/client/assets/decopilot-events-CYZOyosB.js +1 -0
- package/dist/client/assets/dependencies-BB7ZmdjB.js +1 -0
- package/dist/client/assets/dialog-DptuG_cr.js +1 -0
- package/dist/client/assets/differenceInSeconds-NQ4PDo0z.js +1 -0
- package/dist/client/assets/dropdown-menu-BOG7ABoQ.js +1 -0
- package/dist/client/assets/dynamic-plugin-layout-CvHqcm_M.js +1 -0
- package/dist/client/assets/editable-task-title-GlTaj-Dg.js +16 -0
- package/dist/client/assets/empty-state-TJSR5D6L.js +1 -0
- package/dist/client/assets/env-vars-editor-BYDljSmo.js +1 -0
- package/dist/client/assets/estree-CwOGYdhi.js +44 -0
- package/dist/client/assets/extract-connection-data-C1W_n5v2.js +1 -0
- package/dist/client/assets/file-browser-CSLD4PKA.js +2 -0
- package/dist/client/assets/form-CMUDPBm_.js +1 -0
- package/dist/client/assets/format-time-CMKyl-GC.js +1 -0
- package/dist/client/assets/formatDistanceToNow-Cb2QZZJn.js +1 -0
- package/dist/client/assets/general-BIgdFMLk.js +1 -0
- package/dist/client/assets/generate-id-Dyweu44Y.js +1 -0
- package/dist/client/assets/github-icon-Dp3wHhYE.js +1 -0
- package/dist/client/assets/grid-view-CY315fYs.js +1 -0
- package/dist/client/assets/home-tIC3jFSt.js +1 -0
- package/dist/client/assets/icon-picker-DMgDoMQP.js +1 -0
- package/dist/client/assets/index-BLLZZmgM.js +1 -0
- package/dist/client/assets/index-BgP2BBPe.js +25 -0
- package/dist/client/assets/index-Bh1Zqcit.js +1 -0
- package/dist/client/assets/index-CcaZ2Rhp.css +1 -0
- package/dist/client/assets/index-Ctv5davQ.js +1 -0
- package/dist/client/assets/index-DO-nwdDW.js +184 -0
- package/dist/client/assets/index-DOB_rN4F.js +218 -0
- package/dist/client/assets/index-DkNKH-eK.js +1 -0
- package/dist/client/assets/index-cBL8sUXN.js +1 -0
- package/dist/client/assets/index-fsM5-qBd.js +1 -0
- package/dist/client/assets/infiniteQueryObserver-cWt_xaLS.js +1 -0
- package/dist/client/assets/input-B8SGuTQM.js +1 -0
- package/dist/client/assets/integration-icon-V4Ha2c0J.js +1 -0
- package/dist/client/assets/label-B6fF1rpb.js +1 -0
- package/dist/client/assets/layout-BEks5Ck0.js +1 -0
- package/dist/client/assets/layout-CtaMNUf9.js +1 -0
- package/dist/client/assets/localstorage-keys-Bk5zpQvC.js +1 -0
- package/dist/client/assets/login-QoEHn0dp.js +1 -0
- package/dist/client/assets/markdown-DpsxaV39.js +29 -0
- package/dist/client/assets/marked.esm-BaswSlok.js +56 -0
- package/dist/client/assets/mcp-app-renderer-BWBfvCfZ.js +11 -0
- package/dist/client/assets/mcp-server-card-DVI83OFF.js +1 -0
- package/dist/client/assets/mcp-server-detail-CQWk-nDT.js +2 -0
- package/dist/client/assets/members-Cz50GPss.js +3 -0
- package/dist/client/assets/monaco-editor-B-Q9hJgq.js +19 -0
- package/dist/client/assets/monitoring-GiO1u0QX.js +31 -0
- package/dist/client/assets/monitoring-dashboard-edit-guLS52dh.js +1 -0
- package/dist/client/assets/monitoring-dashboard-view-oD9n6smk.js +4 -0
- package/dist/client/assets/oauth-callback-D1mS7W-S.js +1 -0
- package/dist/client/assets/page-B-bxv8n0.js +1 -0
- package/dist/client/assets/page-Dj2Rt-qy.js +1 -0
- package/dist/client/assets/plugin-empty-state-C_T43WPo.js +1 -0
- package/dist/client/assets/plugin-empty-state-CianfdH7.js +1 -0
- package/dist/client/assets/plugin-header-BJof8f0A.js +1 -0
- package/dist/client/assets/plugin-header-Dk7Wynnv.js +1 -0
- package/dist/client/assets/plugins-Bfi150dc.js +1 -0
- package/dist/client/assets/popover-BtdPJ3nC.js +1 -0
- package/dist/client/assets/project-app-view-DhMFp-WZ.js +1 -0
- package/dist/client/assets/project-layout-CZC1VeQH.js +1 -0
- package/dist/client/assets/project-plugins-CidjhMjt.js +1 -0
- package/dist/client/assets/projects-list-h-H3Yy06.js +1 -0
- package/dist/client/assets/purify.es-C0_7NiBM.js +2 -0
- package/dist/client/assets/readme-viewer-CBjZ3q97.js +1 -0
- package/dist/client/assets/readme-viewer-DWnTz46N.css +1 -0
- package/dist/client/assets/registry-layout-6aE8g213.js +5 -0
- package/dist/client/assets/registry-utils-BzhAygoB.js +1 -0
- package/dist/client/assets/reports-layout-SI4CW7HK.js +3 -0
- package/dist/client/assets/reset-password-Bku-iVD-.js +1 -0
- package/dist/client/assets/resizable-CqFPe8y6.js +1 -0
- package/dist/client/assets/save-actions-DM1jGhRL.js +1 -0
- package/dist/client/assets/scroll-area-BVEebdGP.js +1 -0
- package/dist/client/assets/select-DFqqm67w.js +1 -0
- package/dist/client/assets/shell-layout-CSWvw7HN.js +3 -0
- package/dist/client/assets/sidebar-settings-C4zyizoT.js +1 -0
- package/dist/client/assets/skeleton-CJ_JeJdS.js +1 -0
- package/dist/client/assets/slugify-CEUa2lfQ.js +1 -0
- package/dist/client/assets/spinner-C6Zm3ycN.js +1 -0
- package/dist/client/assets/standalone-DS4gw9AE.js +29 -0
- package/dist/client/assets/store-invite-Cz_QydvZ.js +1 -0
- package/dist/client/assets/switch-BmfwSiah.js +1 -0
- package/dist/client/assets/table-C_HSnMnV.js +1 -0
- package/dist/client/assets/tabs-BOq2itjh.js +1 -0
- package/dist/client/assets/tasks-DBz2JhcI.js +1 -0
- package/dist/client/assets/tasks-panel-DGPiBlOG.js +1 -0
- package/dist/client/assets/textarea-CeRaW_Yp.js +1 -0
- package/dist/client/assets/time-range-picker-BOerMnsf.js +5 -0
- package/dist/client/assets/toggle-group-DXK9X2m5.js +1 -0
- package/dist/client/assets/tools-list-AsNykbzi.js +1 -0
- package/dist/client/assets/tooltip-BgKT8ibK.js +1 -0
- package/dist/client/assets/topbar-portal-GE4wDFrT.js +1 -0
- package/dist/client/assets/types-DoC5J5ss.js +155 -0
- package/dist/client/assets/typescript-Ca_eWjgL.js +21 -0
- package/dist/client/assets/unwrap-tool-result-BYXdCQMg.js +1 -0
- package/dist/client/assets/usage-B8eRkRZY.js +1 -0
- package/dist/client/assets/use-binding-ClT1c3nb.js +1 -0
- package/dist/client/assets/use-collections-BtaiT5_F.js +1 -0
- package/dist/client/assets/use-connection-isYpENLt.js +1 -0
- package/dist/client/assets/use-copy-Bu52OFim.js +1 -0
- package/dist/client/assets/use-create-virtual-mcp-BFlErPKY.js +1 -0
- package/dist/client/assets/use-install-from-registry-B9yTXj9j.js +1 -0
- package/dist/client/assets/use-list-state-D_7LJjwJ.js +1 -0
- package/dist/client/assets/use-llm-BL3lTNZs.js +1 -0
- package/dist/client/assets/use-mcp-prompts-CZ1OCHIM.js +1 -0
- package/dist/client/assets/use-mcp-tools-keBjueD4.js +1 -0
- package/dist/client/assets/use-members-DxwVg0IG.js +1 -0
- package/dist/client/assets/use-mobile-BaEQSlsR.js +1 -0
- package/dist/client/assets/use-preferences-I5g32f8W.js +1 -0
- package/dist/client/assets/use-project-vp5BoL5F.js +1 -0
- package/dist/client/assets/use-settings-modal-C6ar3obv.js +1 -0
- package/dist/client/assets/use-view-mode-BhC0hulU.js +1 -0
- package/dist/client/assets/use-virtual-mcp-DIu7xjww.js +1 -0
- package/dist/client/assets/useInfiniteQuery-Tly3nTq2.js +1 -0
- package/dist/client/assets/useMutation-BzhmYOfa.js +1 -0
- package/dist/client/assets/useQuery-peW8y0zk.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-R_Y3Vcn3.js +1 -0
- package/dist/client/assets/user-Be2ccajU.js +1 -0
- package/dist/client/assets/workflow-CYA5mkhM.js +1 -0
- package/dist/client/empty-state-cards.png +0 -0
- package/dist/client/empty-state-error.svg +19 -0
- package/dist/client/empty-state-home.png +0 -0
- package/dist/client/empty-state-logs.svg +80 -0
- package/dist/client/empty-state-openrouter.svg +320 -0
- package/dist/client/empty-state-success-muted.svg +19 -0
- package/dist/client/empty-state-success.svg +19 -0
- package/dist/client/emptystate-mcp.svg +33 -0
- package/dist/client/favicon.svg +5 -0
- package/dist/client/globe.svg +4 -0
- package/dist/client/icons/capy-0.png +0 -0
- package/dist/client/icons/capy-1.png +0 -0
- package/dist/client/icons/capy-10.png +0 -0
- package/dist/client/icons/capy-11.png +0 -0
- package/dist/client/icons/capy-12.png +0 -0
- package/dist/client/icons/capy-13.png +0 -0
- package/dist/client/icons/capy-14.png +0 -0
- package/dist/client/icons/capy-15.png +0 -0
- package/dist/client/icons/capy-16.png +0 -0
- package/dist/client/icons/capy-17.png +0 -0
- package/dist/client/icons/capy-18.png +0 -0
- package/dist/client/icons/capy-19.png +0 -0
- package/dist/client/icons/capy-2.png +0 -0
- package/dist/client/icons/capy-20.png +0 -0
- package/dist/client/icons/capy-21.png +0 -0
- package/dist/client/icons/capy-22.png +0 -0
- package/dist/client/icons/capy-23.png +0 -0
- package/dist/client/icons/capy-24.png +0 -0
- package/dist/client/icons/capy-25.png +0 -0
- package/dist/client/icons/capy-26.png +0 -0
- package/dist/client/icons/capy-27.png +0 -0
- package/dist/client/icons/capy-28.png +0 -0
- package/dist/client/icons/capy-29.png +0 -0
- package/dist/client/icons/capy-3.png +0 -0
- package/dist/client/icons/capy-30.png +0 -0
- package/dist/client/icons/capy-31.png +0 -0
- package/dist/client/icons/capy-32.png +0 -0
- package/dist/client/icons/capy-33.png +0 -0
- package/dist/client/icons/capy-34.png +0 -0
- package/dist/client/icons/capy-35.png +0 -0
- package/dist/client/icons/capy-36.png +0 -0
- package/dist/client/icons/capy-37.png +0 -0
- package/dist/client/icons/capy-38.png +0 -0
- package/dist/client/icons/capy-4.png +0 -0
- package/dist/client/icons/capy-5.png +0 -0
- package/dist/client/icons/capy-6.png +0 -0
- package/dist/client/icons/capy-7.png +0 -0
- package/dist/client/icons/capy-8.png +0 -0
- package/dist/client/icons/capy-9.png +0 -0
- package/dist/client/index.html +12 -0
- package/dist/client/logos/Claude Code.svg +3 -0
- package/dist/client/logos/Windsurf.svg +3 -0
- package/dist/client/logos/cursor.svg +3 -0
- package/dist/client/logos/deco logo.svg +4 -0
- package/dist/client/sounds/notification.mp3 +0 -0
- package/dist/client/store-empty-state.svg +109 -0
- package/dist/client/verified-badge.svg +4 -0
- package/dist/server/cli.js +2143 -0
- package/dist/server/migrate.js +2001 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +47 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +82 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +11 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +43 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +45 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +46 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +11 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +11 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +46 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +83 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +83 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +20 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +20 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +2 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +1 -0
- package/dist/server/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +61 -0
- package/dist/server/server.js +1922 -0
- package/package.json +141 -24
- package/bin/deco.js +0 -33
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{r as a,bH as N,j as T,c as Me,bZ as te}from"./index-DOB_rN4F.js";import{S as me}from"./spinner-C6Zm3ycN.js";const Pe=({size:e=24,color:t="currentColor",...r})=>a.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},a.createElement("path",{d:"M21 10H3m13-8v4M8 2v4m-.2 16h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 19.72 21 18.88 21 17.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 4 17.88 4 16.2 4H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 6.28 3 7.12 3 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 22 6.12 22 7.8 22Z"}));Pe.displayName="Calendar";function ue(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Re(e){if(Array.isArray(e))return e}function Se(e,t,r){return(t=Ve(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,i,u,l=[],c=!0,g=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(O){g=!0,o=O}finally{try{if(!c&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(g)throw o}}return l}}function Ce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ce(Object(r),!0).forEach(function(n){Se(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Te(e,t){if(e==null)return{};var r,n,o=_e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function _e(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Ie(e,t){return Re(e)||xe(e,t)||Ae(e,t)||Ce()}function Le(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ve(e){var t=Le(e,"string");return typeof t=="symbol"?t:t+""}function Ae(e,t){if(e){if(typeof e=="string")return ue(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ue(e,t):void 0}}function $e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function fe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?le(Object(r),!0).forEach(function(n){$e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ne(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return t.reduceRight(function(o,i){return i(o)},n)}}function k(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var u=arguments.length,l=new Array(u),c=0;c<u;c++)l[c]=arguments[c];return t.apply(r,[].concat(o,l))}}}function Q(e){return{}.toString.call(e).includes("Object")}function De(e){return!Object.keys(e).length}function W(e){return typeof e=="function"}function ze(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ke(e,t){return Q(t)||C("changeType"),Object.keys(t).some(function(r){return!ze(e,r)})&&C("changeField"),t}function Ke(e){W(e)||C("selectorType")}function We(e){W(e)||Q(e)||C("handlerType"),Q(e)&&Object.values(e).some(function(t){return!W(t)})&&C("handlersType")}function qe(e){e||C("initialIsRequired"),Q(e)||C("initialType"),De(e)&&C("initialContent")}function Fe(e,t){throw new Error(e[t]||e.default)}var He={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},C=k(Fe)(He),U={changes:ke,selector:Ke,handler:We,initial:qe};function Ue(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};U.initial(e),U.handler(t);var r={current:e},n=k(Qe)(r,t),o=k(Je)(r),i=k(U.changes)(e),u=k(Be)(r);function l(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(O){return O};return U.selector(g),g(r.current)}function c(g){Ne(n,o,i,u)(g)}return[l,c]}function Be(e,t){return W(t)?t(e.current):t}function Je(e,t){return e.current=fe(fe({},e.current),t),t}function Qe(e,t,r){return W(t)?t(e.current):Object.keys(r).forEach(function(n){var o;return(o=t[n])===null||o===void 0?void 0:o.call(t,e.current[n])}),r}var Ze={create:Ue},Ge={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Ye(e){return function t(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var u=arguments.length,l=new Array(u),c=0;c<u;c++)l[c]=arguments[c];return t.apply(r,[].concat(o,l))}}}function Xe(e){return{}.toString.call(e).includes("Object")}function et(e){return e||de("configIsRequired"),Xe(e)||de("configType"),e.urls?(tt(),{paths:{vs:e.urls.monacoBase}}):e}function tt(){console.warn(he.deprecation)}function rt(e,t){throw new Error(e[t]||e.default)}var he={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
|
+
You are using deprecated way of configuration.
|
|
4
|
+
|
|
5
|
+
Instead of using
|
|
6
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
7
|
+
use
|
|
8
|
+
monaco.config({ paths: { vs: '...' } })
|
|
9
|
+
|
|
10
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
11
|
+
`},de=Ye(rt)(he),nt={config:et},it=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(i,u){return u(i)},o)}};function ve(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],ve(e[r],t[r]))}),se(se({},e),t)}var ot={type:"cancelation",msg:"operation is manually canceled"};function re(e){var t=!1,r=new Promise(function(n,o){e.then(function(i){return t?o(ot):n(i)}),e.catch(o)});return r.cancel=function(){return t=!0},r}var at=["monaco"],ut=Ze.create({config:Ge,isInitialized:!1,resolve:null,reject:null,monaco:null}),ye=Ie(ut,2),q=ye[0],Z=ye[1];function ct(e){var t=nt.config(e),r=t.monaco,n=Te(t,at);Z(function(o){return{config:ve(o.config,n),monaco:r}})}function st(){var e=q(function(t){var r=t.monaco,n=t.isInitialized,o=t.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!e.isInitialized){if(Z({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),re(ne);if(window.monaco&&window.monaco.editor)return be(window.monaco),e.resolve(window.monaco),re(ne);it(lt,dt)(pt)}return re(ne)}function lt(e){return document.body.appendChild(e)}function ft(e){var t=document.createElement("script");return e&&(t.src=e),t}function dt(e){var t=q(function(n){var o=n.config,i=n.reject;return{config:o,reject:i}}),r=ft("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function pt(){var e=q(function(r){var n=r.config,o=r.resolve,i=r.reject;return{config:n,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var n=r.m||r;be(n),e.resolve(n)},function(r){e.reject(r)})}function be(e){q().monaco||Z({monaco:e})}function gt(){return q(function(e){var t=e.monaco;return t})}var ne=new Promise(function(e,t){return Z({resolve:e,reject:t})}),G={config:ct,init:st,__getMonacoInstance:gt},mt={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ie=mt,ht={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},vt=ht;function yt({children:e}){return N.createElement("div",{style:vt.container},e)}var bt=yt,wt=bt;function Ot({width:e,height:t,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:u}){return N.createElement("section",{style:{...ie.wrapper,width:e,height:t},...u},!r&&N.createElement(wt,null,n),N.createElement("div",{ref:o,style:{...ie.fullWidth,...!r&&ie.hide},className:i}))}var jt=Ot,we=a.memo(jt);function Et(e){a.useEffect(e,[])}var Oe=Et;function Mt(e,t,r=!0){let n=a.useRef(!0);a.useEffect(n.current||!r?()=>{n.current=!1}:e,t)}var M=Mt;function K(){}function A(e,t,r,n){return Pt(e,n)||Rt(e,t,r,n)}function Pt(e,t){return e.editor.getModel(je(e,t))}function Rt(e,t,r,n){return e.editor.createModel(t,r,n?je(e,n):void 0)}function je(e,t){return e.Uri.parse(t)}function St({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:u,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:c=!1,theme:g="light",loading:O="Loading...",options:j={},height:R="100%",width:S="100%",className:_,wrapperProps:L={},beforeMount:I=K,onMount:D=K}){let[y,b]=a.useState(!1),[h,d]=a.useState(!0),v=a.useRef(null),f=a.useRef(null),P=a.useRef(null),m=a.useRef(D),s=a.useRef(I),V=a.useRef(!1);Oe(()=>{let p=G.init();return p.then(w=>(f.current=w)&&d(!1)).catch(w=>w?.type!=="cancelation"&&console.error("Monaco initialization: error:",w)),()=>v.current?z():p.cancel()}),M(()=>{if(v.current&&f.current){let p=v.current.getOriginalEditor(),w=A(f.current,e||"",n||r||"text",i||"");w!==p.getModel()&&p.setModel(w)}},[i],y),M(()=>{if(v.current&&f.current){let p=v.current.getModifiedEditor(),w=A(f.current,t||"",o||r||"text",u||"");w!==p.getModel()&&p.setModel(w)}},[u],y),M(()=>{let p=v.current.getModifiedEditor();p.getOption(f.current.editor.EditorOption.readOnly)?p.setValue(t||""):t!==p.getValue()&&(p.executeEdits("",[{range:p.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),p.pushUndoStop())},[t],y),M(()=>{v.current?.getModel()?.original.setValue(e||"")},[e],y),M(()=>{let{original:p,modified:w}=v.current.getModel();f.current.editor.setModelLanguage(p,n||r||"text"),f.current.editor.setModelLanguage(w,o||r||"text")},[r,n,o],y),M(()=>{f.current?.editor.setTheme(g)},[g],y),M(()=>{v.current?.updateOptions(j)},[j],y);let F=a.useCallback(()=>{if(!f.current)return;s.current(f.current);let p=A(f.current,e||"",n||r||"text",i||""),w=A(f.current,t||"",o||r||"text",u||"");v.current?.setModel({original:p,modified:w})},[r,t,o,e,n,i,u]),H=a.useCallback(()=>{!V.current&&P.current&&(v.current=f.current.editor.createDiffEditor(P.current,{automaticLayout:!0,...j}),F(),f.current?.editor.setTheme(g),b(!0),V.current=!0)},[j,g,F]);a.useEffect(()=>{y&&m.current(v.current,f.current)},[y]),a.useEffect(()=>{!h&&!y&&H()},[h,y,H]);function z(){let p=v.current?.getModel();l||p?.original?.dispose(),c||p?.modified?.dispose(),v.current?.dispose()}return N.createElement(we,{width:S,height:R,isEditorReady:y,loading:O,_ref:P,className:_,wrapperProps:L})}var xt=St;a.memo(xt);function Ct(e){let t=a.useRef();return a.useEffect(()=>{t.current=e},[e]),t.current}var Tt=Ct,B=new Map;function _t({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:o,path:i,theme:u="light",line:l,loading:c="Loading...",options:g={},overrideServices:O={},saveViewState:j=!0,keepCurrentModel:R=!1,width:S="100%",height:_="100%",className:L,wrapperProps:I={},beforeMount:D=K,onMount:y=K,onChange:b,onValidate:h=K}){let[d,v]=a.useState(!1),[f,P]=a.useState(!0),m=a.useRef(null),s=a.useRef(null),V=a.useRef(null),F=a.useRef(y),H=a.useRef(D),z=a.useRef(),p=a.useRef(n),w=Tt(i),oe=a.useRef(!1),Y=a.useRef(!1);Oe(()=>{let E=G.init();return E.then(x=>(m.current=x)&&P(!1)).catch(x=>x?.type!=="cancelation"&&console.error("Monaco initialization: error:",x)),()=>s.current?Ee():E.cancel()}),M(()=>{let E=A(m.current,e||n||"",t||o||"",i||r||"");E!==s.current?.getModel()&&(j&&B.set(w,s.current?.saveViewState()),s.current?.setModel(E),j&&s.current?.restoreViewState(B.get(i)))},[i],d),M(()=>{s.current?.updateOptions(g)},[g],d),M(()=>{!s.current||n===void 0||(s.current.getOption(m.current.editor.EditorOption.readOnly)?s.current.setValue(n):n!==s.current.getValue()&&(Y.current=!0,s.current.executeEdits("",[{range:s.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),s.current.pushUndoStop(),Y.current=!1))},[n],d),M(()=>{let E=s.current?.getModel();E&&o&&m.current?.editor.setModelLanguage(E,o)},[o],d),M(()=>{l!==void 0&&s.current?.revealLine(l)},[l],d),M(()=>{m.current?.editor.setTheme(u)},[u],d);let ae=a.useCallback(()=>{if(!(!V.current||!m.current)&&!oe.current){H.current(m.current);let E=i||r,x=A(m.current,n||e||"",t||o||"",E||"");s.current=m.current?.editor.create(V.current,{model:x,automaticLayout:!0,...g},O),j&&s.current.restoreViewState(B.get(E)),m.current.editor.setTheme(u),l!==void 0&&s.current.revealLine(l),v(!0),oe.current=!0}},[e,t,r,n,o,i,g,O,j,u,l]);a.useEffect(()=>{d&&F.current(s.current,m.current)},[d]),a.useEffect(()=>{!f&&!d&&ae()},[f,d,ae]),p.current=n,a.useEffect(()=>{d&&b&&(z.current?.dispose(),z.current=s.current?.onDidChangeModelContent(E=>{Y.current||b(s.current.getValue(),E)}))},[d,b]),a.useEffect(()=>{if(d){let E=m.current.editor.onDidChangeMarkers(x=>{let X=s.current.getModel()?.uri;if(X&&x.find(ee=>ee.path===X.path)){let ee=m.current.editor.getModelMarkers({resource:X});h?.(ee)}});return()=>{E?.dispose()}}return()=>{}},[d,h]);function Ee(){z.current?.dispose(),R?j&&B.set(i,s.current.saveViewState()):s.current.getModel()?.dispose(),s.current.dispose()}return N.createElement(we,{width:S,height:_,isEditorReady:d,loading:c,_ref:V,className:L,wrapperProps:I})}var It=_t,Lt=a.memo(It),Vt=Lt;async function At(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const r=t.getValue(),o=r.replace(/export default (async )?function/,"export default $1function __default")+`
|
|
12
|
+
type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
|
|
13
|
+
? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
|
|
14
|
+
: T extends object
|
|
15
|
+
? T extends infer O ? { [K in keyof O]: __ExpandRecursively<O[K]> } : never
|
|
16
|
+
: T;
|
|
17
|
+
type __InferredOutput = __ExpandRecursively<Awaited<ReturnType<typeof __default>>>;
|
|
18
|
+
declare const __outputValue: __InferredOutput;
|
|
19
|
+
`;t.setValue(o);const i=t.findMatches("__outputValue",!1,!1,!1,null,!1);if(!i||i.length===0)return t.setValue(r),null;const u=i[0];if(!u)return t.setValue(r),null;const l={lineNumber:u.range.startLineNumber,column:u.range.startColumn+1};try{const g=await(await G.init()).languages.typescript.getTypeScriptWorker();if(!g)return t.setValue(r),null;const O=await g(t.uri);await new Promise(S=>setTimeout(S,100));const j=t.getOffsetAt(l),R=await O.getQuickInfoAtPosition(t.uri.toString(),j);if(t.setValue(r),R){const _=R.displayParts.map(I=>I.text).join("").replace(/^const __outputValue:\s*/,"");return $(_)}else return null}catch(c){return t.setValue(r),console.error("Error getting return type:",c),null}}function $(e){if(e=e.trim(),e==="string")return{type:"string"};if(e==="number")return{type:"number"};if(e==="boolean")return{type:"boolean"};if(e==="null")return{type:"null"};if(e==="undefined")return{type:"null"};if(e==="unknown"||e==="any")return{};if(e==="never")return{not:{}};if(e.endsWith("[]")){const n=e.slice(0,-2);return{type:"array",items:$(n)}}const t=e.match(/^Array<(.+)>$/);if(t&&t[1])return{type:"array",items:$(t[1])};const r=e.match(/^Record<(.+),\s*(.+)>$/);if(r&&r[2])return{type:"object",additionalProperties:$(r[2].trim())};if(e.includes("|")){const n=$t(e);if(n.length>1)return n.every(i=>/^["']/.test(i.trim()))?{type:"string",enum:n.map(i=>i.trim().replace(/^["']|["']$/g,""))}:{anyOf:n.map(i=>$(i.trim()))}}return/^["'].*["']$/.test(e)?{type:"string",const:e.slice(1,-1)}:/^-?\d+(\.\d+)?$/.test(e)?{type:"number",const:parseFloat(e)}:e.startsWith("{")&&e.endsWith("}")?Nt(e):{description:`TypeScript type: ${e}`}}function $t(e){const t=[];let r=0,n="";for(let o=0;o<e.length;o++){const i=e[o];if(i==="{"||i==="<"||i==="("||i==="[")r++;else if(i==="}"||i===">"||i===")"||i==="]")r--;else if(i==="|"&&r===0){t.push(n.trim()),n="";continue}n+=i}return n.trim()&&t.push(n.trim()),t}function Nt(e){const t=e.slice(1,-1).trim();if(!t)return{type:"object",properties:{}};const r={},n=[];let o=0,i="";for(let l=0;l<t.length;l++){const c=t[l];if(c==="{"||c==="<"||c==="("||c==="[")o++;else if(c==="}"||c===">"||c===")"||c==="]")o--;else if(c===";"&&o===0){i.trim()&&pe(i.trim(),r,n),i="";continue}i+=c}i.trim()&&pe(i.trim(),r,n);const u={type:"object",properties:r};return n.length>0&&(u.required=n),u}function pe(e,t,r){const n=e.match(/^(\w+)(\?)?:\s*(.+)$/s);if(n){const o=n[1],i=n[2],u=n[3];o&&u&&(t[o]=$(u.trim()),i||r.push(o))}}class Dt extends a.Component{constructor(t){super(t),this.state={hasError:!1,mountKey:0}}static getDerivedStateFromError(t){if(t.message?.includes("InstantiationService has been disposed"))return{hasError:!0};throw t}componentDidCatch(t){t.message?.includes("InstantiationService has been disposed")&&this.setState(r=>({hasError:!1,mountKey:r.mountKey+1}))}render(){return this.state.hasError?T.jsx("div",{className:"flex items-center justify-center h-full w-full bg-[#1e1e1e] text-gray-400",children:T.jsx(me,{size:"sm"})}):a.cloneElement(this.props.children,{mountKey:this.state.mountKey})}}let J=null;const zt=async()=>{if(J)return J;const[e,t,r]=await Promise.all([te(()=>import("./standalone-DS4gw9AE.js"),[]),te(()=>import("./typescript-Ca_eWjgL.js"),[]),te(()=>import("./estree-CwOGYdhi.js"),[])]);return J={format:e.format,plugins:[t.default,r.default]},J};G.config({paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.0/min/vs"}});const kt={parser:"typescript",semi:!0,singleQuote:!1,tabWidth:2,trailingComma:"es5",printWidth:80},ge={fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,stickyScroll:{enabled:!1},wordWrap:"on",folding:!0,bracketPairColorization:{enabled:!0},suggestOnTriggerCharacters:!0,quickSuggestions:{other:!0,comments:!1,strings:!0},minimap:{enabled:!1},parameterHints:{enabled:!0},inlineSuggest:{enabled:!0},autoClosingBrackets:"always",autoClosingQuotes:"always",autoSurround:"languageDefined",padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8},theme:"light"},Kt=T.jsx("div",{className:"flex items-center justify-center h-full w-full text-gray-400",children:T.jsx(me,{size:"sm"})}),Wt=a.memo(function({code:t,onChange:r,onSave:n,readOnly:o=!1,height:i=300,language:u="typescript",foldOnMount:l=!1,mountKey:c=0}){const g=a.useRef(null),O=a.useRef(null),j=a.useRef(n);j.current=n;const R=a.useRef(u);R.current=u;const S=a.useId(),_=`${S}-${c}`,L=u==="typescript"?`file:///workflow-${S.replace(/:/g,"-")}-${c}.tsx`:void 0,I=o?{...ge,readOnly:!0}:ge,D=async b=>{const h=b.getModel();if(!h){console.warn("No model found");return}const d=h.getValue();if(R.current==="json"){try{const f=JSON.parse(d),P=JSON.stringify(f,null,2);if(P!==d){const m=h.getFullModelRange();b.executeEdits("json-format",[{range:m,text:P}])}}catch(f){console.error("JSON formatting failed:",f)}return}try{const{format:f,plugins:P}=await zt(),m=await f(d,{...kt,plugins:P});if(m!==d){const s=h.getFullModelRange();b.executeEdits("prettier",[{range:s,text:m}])}}catch(f){console.error("Prettier formatting failed:",f)}},y=async(b,h)=>{g.current=b,l&&O.current&&(O.current.style.visibility="hidden",await b.getAction("editor.foldLevel2")?.run(),O.current.style.visibility="visible"),u==="typescript"&&(h.languages.typescript.typescriptDefaults.setCompilerOptions({target:h.languages.typescript.ScriptTarget.ESNext,module:h.languages.typescript.ModuleKind.ESNext,moduleResolution:h.languages.typescript.ModuleResolutionKind.NodeJs,allowNonTsExtensions:!0,allowJs:!0,strict:!1,noEmit:!0,esModuleInterop:!0,jsx:h.languages.typescript.JsxEmit.React,allowSyntheticDefaultImports:!0}),h.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1})),b.addCommand(h.KeyMod.CtrlCmd|h.KeyCode.KeyS,async()=>{await D(b);const d=await At(b),v=b.getValue();j.current?.(v,d)})};return T.jsx("div",{ref:O,className:"h-full",children:T.jsx(Vt,{height:i,language:u,value:t,path:L,onChange:r,onMount:y,loading:Kt,options:I},_)})}),Ht=a.memo(function(t){const r=Me.c(2);let n;return r[0]!==t?(n=T.jsx(Dt,{children:T.jsx(Wt,{...t})}),r[0]=t,r[1]=n):n=r[1],n});export{Ht as M,Pe as n};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import{r as m,c6 as Fe,bI as vn,cg as hn,c as ae,z as we,j as n,E as qt,u as Ye,w as xn,e as Vt,v as gn,K as it,B as ye,x as It,O as na,d as bn}from"./index-DOB_rN4F.js";import{E as Ht,C as yn}from"./collection-search-BLa1FSgc.js";import{P as be}from"./index-fsM5-qBd.js";import{B as sa,a as ia,b as oa,c as la}from"./breadcrumb-Vup1mlRL.js";import{E as jn,d as wn,e as rr,b as Nn,M as Pn,T as On,p as et,s as Re,a as ar}from"./time-range-picker-BOerMnsf.js";import{I as ot}from"./integration-icon-V4Ha2c0J.js";import{B as lt}from"./badge-CD6BO54l.js";import{t as Tt}from"./ChevronDown-BpPBzMeM.js";import{i as Sn}from"./ChevronRight-Bcq8irGN.js";import{c as he,b as Ge,d as ca,e as da,a as ua,T as Q}from"./table-C_HSnMnV.js";import{ar as In,as as tt,a2 as Ce,i as He,at as ma,r as We,V as gt,au as fa,X as bt,av as V,Y as H,aw as ze,ax as ct,ay as dt,az as Ie,aA as nr,O as Ae,a3 as kn,a8 as Gt,aB as Cn,aC as An,aD as En,aE as Tn,_ as Ke,a5 as Mt,w as Mn,l as fe,m as Se,aF as Dn,p as Ne,v as Pe,z as Ut,x as _n,y as ut,B as pa,D as yt,c as jt,R as va,S as ha,C as xa,F as wt,G as ga,H as ba,K as ya,L as Ln,I as ja,d as Ue,M as $n,N as Bn,Z as Nt,P as wa,Q as Rn,T as Pt,U as sr,a0 as Na,a1 as Pa,k as Oa,a4 as zn,aG as Kn,ac as Fn,n as Wn,q as Ee,t as Te,aH as Sa,aI as qn,aJ as Vn,A as ir,aK as Hn,aL as or,E as Gn,aM as Un,aN as Ia,aO as Zn,aP as ka,aQ as Yn,aR as Xn,aS as lr,aT as Qn,$ as Jn,al as Ca,am as Aa,ap as Ea,aq as es,an as Ta,ao as ts}from"./chart-O3Ehqi3I.js";import{u as Zt,a as Yt,W as rs}from"./constants-Dj_jISYh.js";import{i as as}from"./DotsVertical-BP619RCa.js";import{i as ns}from"./Edit05-CVYO506c.js";import{s as Ma}from"./Plus-6jiO8ZBC.js";import{s as Da}from"./Trash01-BJfk29r7.js";import{C as ss}from"./connection-card-BIcygpni.js";import{D as is,a as os,b as ls,c as cr}from"./dropdown-menu-BOG7ABoQ.js";import{f as cs,a as ds,b as us,c as ms,d as fs,e as ps,A as vs,h as hs}from"./alert-dialog-B7sc3pCd.js";import{u as xs}from"./use-members-DxwVg0IG.js";import{u as gs}from"./useSuspenseInfiniteQuery-R_Y3Vcn3.js";import{b as _a}from"./use-connection-isYpENLt.js";import{b as bs}from"./use-virtual-mcp-DIu7xjww.js";import{i as ys}from"./Code01-Cs4VK4vB.js";import{n as Dt}from"./Container-DfhSnqz2.js";import{i as js}from"./FilterLines-wbfkcsV6.js";import{c as ws}from"./Grid01-BLFAr7r2.js";import{I as kt}from"./input-B8SGuTQM.js";import{C as dr}from"./checkbox-B-bMpUYn.js";import{c as Ns,d as Ps,e as ur,a as Os,C as Ss,b as Is}from"./command-8epQsgvR.js";import{b as La,P as $a,a as Ba}from"./popover-BtdPJ3nC.js";import{S as mr,a as fr,b as pr,c as vr,d as rt}from"./select-DFqqm67w.js";import{T as ks}from"./textarea-CeRaW_Yp.js";import{T as Cs,a as As,b as Es}from"./tooltip-BgKT8ibK.js";import{C as Ra}from"./collection-tabs-DuOpqFgB.js";import{S as Ts}from"./switch-BmfwSiah.js";import{L as Ms}from"./label-B6fF1rpb.js";import{u as Ds}from"./use-mcp-tools-keBjueD4.js";import"./Loading01-DIEH7Z5_.js";import"./SearchMd-DueTE2Za.js";import"./localstorage-keys-Bk5zpQvC.js";import"./useQuery-peW8y0zk.js";import"./useMutation-BzhmYOfa.js";import"./Check-C-l3bofu.js";import"./Copy01-DO2wEvaR.js";import"./Download01-Cflyuz7y.js";import"./Key01-BoUAxj2a.js";import"./Play-BS-YE1aJ.js";import"./monaco-editor-B-Q9hJgq.js";import"./spinner-C6Zm3ycN.js";import"./scroll-area-BVEebdGP.js";import"./Clock-COzVVCOL.js";import"./ChevronLeft-GX7d8CR0.js";import"./index-BLLZZmgM.js";import"./card-BHxWxRj-.js";import"./infiniteQueryObserver-cWt_xaLS.js";import"./use-collections-BtaiT5_F.js";import"./index-DkNKH-eK.js";import"./index-cBL8sUXN.js";const _t=({size:t=24,color:e="currentColor",...r})=>m.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},m.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"}));_t.displayName="BarChart07";const za=({size:t=24,color:e="currentColor",...r})=>m.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},m.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"}));za.displayName="PauseCircle";const Ka=({size:t=24,color:e="currentColor",...r})=>m.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},m.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"}),m.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"}));Ka.displayName="PlayCircle";const Fa=Math.cos,mt=Math.sin,pe=Math.sqrt,ft=Math.PI,Ot=2*ft,Xt={draw(t,e){const r=pe(e/ft);t.moveTo(r,0),t.arc(0,0,r,0,Ot)}},_s={draw(t,e){const r=pe(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},Wa=pe(1/3),Ls=Wa*2,$s={draw(t,e){const r=pe(e/Ls),a=r*Wa;t.moveTo(0,-r),t.lineTo(a,0),t.lineTo(0,r),t.lineTo(-a,0),t.closePath()}},Bs={draw(t,e){const r=pe(e),a=-r/2;t.rect(a,a,r,r)}},Rs=.8908130915292852,qa=mt(ft/10)/mt(7*ft/10),zs=mt(Ot/10)*qa,Ks=-Fa(Ot/10)*qa,Fs={draw(t,e){const r=pe(e*Rs),a=zs*r,i=Ks*r;t.moveTo(0,-r),t.lineTo(a,i);for(let s=1;s<5;++s){const o=Ot*s/5,l=Fa(o),c=mt(o);t.lineTo(c*r,-l*r),t.lineTo(l*a-c*i,c*a+l*i)}t.closePath()}},Ct=pe(3),Ws={draw(t,e){const r=-pe(e/(Ct*3));t.moveTo(0,r*2),t.lineTo(-Ct*r,-r),t.lineTo(Ct*r,-r),t.closePath()}},ce=-.5,de=pe(3)/2,Lt=1/pe(12),qs=(Lt/2+1)*3,Vs={draw(t,e){const r=pe(e/qs),a=r/2,i=r*Lt,s=a,o=r*Lt+r,l=-s,c=o;t.moveTo(a,i),t.lineTo(s,o),t.lineTo(l,c),t.lineTo(ce*a-de*i,de*a+ce*i),t.lineTo(ce*s-de*o,de*s+ce*o),t.lineTo(ce*l-de*c,de*l+ce*c),t.lineTo(ce*a+de*i,ce*i-de*a),t.lineTo(ce*s+de*o,ce*o-de*s),t.lineTo(ce*l+de*c,ce*c-de*l),t.closePath()}};function Hs(t,e){let r=null,a=In(i);t=typeof t=="function"?t:tt(t||Xt),e=typeof e=="function"?e:tt(e===void 0?64:+e);function i(){let s;if(r||(r=s=a()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(t=typeof s=="function"?s:tt(s),i):t},i.size=function(s){return arguments.length?(e=typeof s=="function"?s:tt(+s),i):e},i.context=function(s){return arguments.length?(r=s??null,i):r},i}var Gs=["type","size","sizeType"];function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},$t.apply(null,arguments)}function hr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function xr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hr(Object(r),!0).forEach(function(a){Us(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Us(t,e,r){return(e=Zs(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zs(t){var e=Ys(t,"string");return typeof e=="symbol"?e:e+""}function Ys(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xs(t,e){if(t==null)return{};var r,a,i=Qs(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Qs(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var Va={symbolCircle:Xt,symbolCross:_s,symbolDiamond:$s,symbolSquare:Bs,symbolStar:Fs,symbolTriangle:Ws,symbolWye:Vs},Js=Math.PI/180,ei=t=>{var e="symbol".concat(ma(t));return Va[e]||Xt},ti=(t,e,r)=>{if(e==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*Js;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.tan(a)**2)}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},ri=(t,e)=>{Va["symbol".concat(ma(t))]=e},Ha=t=>{var{type:e="circle",size:r=64,sizeType:a="area"}=t,i=Xs(t,Gs),s=xr(xr({},i),{},{type:e,size:r,sizeType:a}),o="circle";typeof e=="string"&&(o=e);var l=()=>{var f=ei(o),x=Hs().type(f).size(ti(r,a,o)),y=x();if(y!==null)return y},{className:c,cx:d,cy:u}=s,v=Ce(s);return He(d)&&He(u)&&He(r)?m.createElement("path",$t({},v,{className:Fe("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};Ha.registerSymbol=ri;var ai=["radius"],ni=["radius"],gr,br,yr,jr,wr,Nr,Pr,Or,Sr,Ir;function kr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function Cr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kr(Object(r),!0).forEach(function(a){si(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function si(t,e,r){return(e=ii(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ii(t){var e=oi(t,"string");return typeof e=="symbol"?e:e+""}function oi(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pt(){return pt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},pt.apply(null,arguments)}function Ar(t,e){if(t==null)return{};var r,a,i=li(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function li(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function xe(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Er=(t,e,r,a,i)=>{var s=ze(r),o=ze(a),l=Math.min(Math.abs(s)/2,Math.abs(o)/2),c=o>=0?1:-1,d=s>=0?1:-1,u=o>=0&&s>=0||o<0&&s<0?1:0,v;if(l>0&&Array.isArray(i)){for(var f=[0,0,0,0],x=0,y=4;x<y;x++){var g,b=(g=i[x])!==null&&g!==void 0?g:0;f[x]=b>l?l:b}v=V(gr||(gr=xe(["M",",",""])),t,e+c*f[0]),f[0]>0&&(v+=V(br||(br=xe(["A ",",",",0,0,",",",",",""])),f[0],f[0],u,t+d*f[0],e)),v+=V(yr||(yr=xe(["L ",",",""])),t+r-d*f[1],e),f[1]>0&&(v+=V(jr||(jr=xe(["A ",",",",0,0,",`,
|
|
2
|
+
`,",",""])),f[1],f[1],u,t+r,e+c*f[1])),v+=V(wr||(wr=xe(["L ",",",""])),t+r,e+a-c*f[2]),f[2]>0&&(v+=V(Nr||(Nr=xe(["A ",",",",0,0,",`,
|
|
3
|
+
`,",",""])),f[2],f[2],u,t+r-d*f[2],e+a)),v+=V(Pr||(Pr=xe(["L ",",",""])),t+d*f[3],e+a),f[3]>0&&(v+=V(Or||(Or=xe(["A ",",",",0,0,",`,
|
|
4
|
+
`,",",""])),f[3],f[3],u,t,e+a-c*f[3])),v+="Z"}else if(l>0&&i===+i&&i>0){var h=Math.min(l,i);v=V(Sr||(Sr=xe(["M ",",",`
|
|
5
|
+
A `,",",",0,0,",",",",",`
|
|
6
|
+
L `,",",`
|
|
7
|
+
A `,",",",0,0,",",",",",`
|
|
8
|
+
L `,",",`
|
|
9
|
+
A `,",",",0,0,",",",",",`
|
|
10
|
+
L `,",",`
|
|
11
|
+
A `,",",",0,0,",",",","," Z"])),t,e+c*h,h,h,u,t+d*h,e,t+r-d*h,e,h,h,u,t+r,e+c*h,t+r,e+a-c*h,h,h,u,t+r-d*h,e+a,t+d*h,e+a,h,h,u,t,e+a-c*h)}else v=V(Ir||(Ir=xe(["M ",","," h "," v "," h "," Z"])),t,e,r,a,-r);return v},Tr={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ci=t=>{var e=We(t,Tr),r=m.useRef(null),[a,i]=m.useState(-1);m.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var D=r.current.getTotalLength();D&&i(D)}catch{}},[]);var{x:s,y:o,width:l,height:c,radius:d,className:u}=e,{animationEasing:v,animationDuration:f,animationBegin:x,isAnimationActive:y,isUpdateAnimationActive:g}=e,b=m.useRef(l),h=m.useRef(c),p=m.useRef(s),j=m.useRef(o),N=m.useMemo(()=>({x:s,y:o,width:l,height:c,radius:d}),[s,o,l,c,d]),O=gt(N,"rectangle-");if(s!==+s||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var w=Fe("recharts-rectangle",u);if(!g){var k=Ce(e),{radius:S}=k,I=Ar(k,ai);return m.createElement("path",pt({},I,{x:ze(s),y:ze(o),width:ze(l),height:ze(c),radius:typeof d=="number"?d:void 0,className:w,d:Er(s,o,l,c,d)}))}var E=b.current,M=h.current,_=p.current,C=j.current,P="0px ".concat(a===-1?1:a,"px"),T="".concat(a,"px ").concat(a,"px"),$=fa(["strokeDasharray"],f,typeof v=="string"?v:Tr.animationEasing);return m.createElement(bt,{animationId:O,key:O,canBegin:a>0,duration:f,easing:v,isActive:g,begin:x},D=>{var z=H(E,l,D),B=H(M,c,D),K=H(_,s,D),R=H(C,o,D);r.current&&(b.current=z,h.current=B,p.current=K,j.current=R);var A;y?D>0?A={transition:$,strokeDasharray:T}:A={strokeDasharray:P}:A={strokeDasharray:T};var L=Ce(e),{radius:F}=L,G=Ar(L,ni);return m.createElement("path",pt({},G,{radius:typeof d=="number"?d:void 0,className:w,d:Er(K,R,z,B,d),ref:r,style:Cr(Cr({},A),e.style)}))})},Mr,Dr,_r,Lr,$r,Br,Rr;function Bt(){return Bt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Bt.apply(null,arguments)}function ke(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var di=(t,e)=>{var r=dt(e-t),a=Math.min(Math.abs(e-t),359.999);return r*a},at=t=>{var{cx:e,cy:r,radius:a,angle:i,sign:s,isExternal:o,cornerRadius:l,cornerIsExternal:c}=t,d=l*(o?1:-1)+a,u=Math.asin(l/d)/nr,v=c?i:i+s*u,f=Ie(e,r,d,v),x=Ie(e,r,a,v),y=c?i-s*u:i,g=Ie(e,r,d*Math.cos(u*nr),y);return{center:f,circleTangency:x,lineTangency:g,theta:u}},Ga=t=>{var{cx:e,cy:r,innerRadius:a,outerRadius:i,startAngle:s,endAngle:o}=t,l=di(s,o),c=s+l,d=Ie(e,r,i,s),u=Ie(e,r,i,c),v=V(Mr||(Mr=ke(["M ",",",`
|
|
12
|
+
A `,",",`,0,
|
|
13
|
+
`,",",`,
|
|
14
|
+
`,",",`
|
|
15
|
+
`])),d.x,d.y,i,i,+(Math.abs(l)>180),+(s>c),u.x,u.y);if(a>0){var f=Ie(e,r,a,s),x=Ie(e,r,a,c);v+=V(Dr||(Dr=ke(["L ",",",`
|
|
16
|
+
A `,",",`,0,
|
|
17
|
+
`,",",`,
|
|
18
|
+
`,","," Z"])),x.x,x.y,a,a,+(Math.abs(l)>180),+(s<=c),f.x,f.y)}else v+=V(_r||(_r=ke(["L ",","," Z"])),e,r);return v},ui=t=>{var{cx:e,cy:r,innerRadius:a,outerRadius:i,cornerRadius:s,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=t,u=dt(d-c),{circleTangency:v,lineTangency:f,theta:x}=at({cx:e,cy:r,radius:i,angle:c,sign:u,cornerRadius:s,cornerIsExternal:l}),{circleTangency:y,lineTangency:g,theta:b}=at({cx:e,cy:r,radius:i,angle:d,sign:-u,cornerRadius:s,cornerIsExternal:l}),h=l?Math.abs(c-d):Math.abs(c-d)-x-b;if(h<0)return o?V(Lr||(Lr=ke(["M ",",",`
|
|
19
|
+
a`,",",",0,0,1,",`,0
|
|
20
|
+
a`,",",",0,0,1,",`,0
|
|
21
|
+
`])),f.x,f.y,s,s,s*2,s,s,-s*2):Ga({cx:e,cy:r,innerRadius:a,outerRadius:i,startAngle:c,endAngle:d});var p=V($r||($r=ke(["M ",",",`
|
|
22
|
+
A`,",",",0,0,",",",",",`
|
|
23
|
+
A`,",",",0,",",",",",",",`
|
|
24
|
+
A`,",",",0,0,",",",",",`
|
|
25
|
+
`])),f.x,f.y,s,s,+(u<0),v.x,v.y,i,i,+(h>180),+(u<0),y.x,y.y,s,s,+(u<0),g.x,g.y);if(a>0){var{circleTangency:j,lineTangency:N,theta:O}=at({cx:e,cy:r,radius:a,angle:c,sign:u,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),{circleTangency:w,lineTangency:k,theta:S}=at({cx:e,cy:r,radius:a,angle:d,sign:-u,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),I=l?Math.abs(c-d):Math.abs(c-d)-O-S;if(I<0&&s===0)return"".concat(p,"L").concat(e,",").concat(r,"Z");p+=V(Br||(Br=ke(["L",",",`
|
|
26
|
+
A`,",",",0,0,",",",",",`
|
|
27
|
+
A`,",",",0,",",",",",",",`
|
|
28
|
+
A`,",",",0,0,",",",",","Z"])),k.x,k.y,s,s,+(u<0),w.x,w.y,a,a,+(I>180),+(u>0),j.x,j.y,s,s,+(u<0),N.x,N.y)}else p+=V(Rr||(Rr=ke(["L",",","Z"])),e,r);return p},mi={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},fi=t=>{var e=We(t,mi),{cx:r,cy:a,innerRadius:i,outerRadius:s,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u,className:v}=e;if(s<i||d===u)return null;var f=Fe("recharts-sector",v),x=s-i,y=ct(o,x,0,!0),g;return y>0&&Math.abs(d-u)<360?g=ui({cx:r,cy:a,innerRadius:i,outerRadius:s,cornerRadius:Math.min(y,x/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):g=Ga({cx:r,cy:a,innerRadius:i,outerRadius:s,startAngle:d,endAngle:u}),m.createElement("path",Bt({},Ce(e),{className:f,d:g}))},Qt=t=>null;Qt.displayName="Cell";var At={},zr;function pi(){return zr||(zr=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});function e(r){if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const i=r[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(r,Symbol.toStringTag)?.writable?!1:r.toString()===`[object ${i}]`}let a=r;for(;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(r)===a}t.isPlainObject=e})(At)),At}var Et,Kr;function vi(){return Kr||(Kr=1,Et=pi().isPlainObject),Et}var hi=vi();const xi=vn(hi);var Fr,Wr,qr,Vr,Hr;function Gr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function Ur(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Gr(Object(r),!0).forEach(function(a){gi(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function gi(t,e,r){return(e=bi(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bi(t){var e=yi(t,"string");return typeof e=="symbol"?e:e+""}function yi(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vt(){return vt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},vt.apply(null,arguments)}function Ve(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Zr=(t,e,r,a,i)=>{var s=r-a,o;return o=V(Fr||(Fr=Ve(["M ",",",""])),t,e),o+=V(Wr||(Wr=Ve(["L ",",",""])),t+r,e),o+=V(qr||(qr=Ve(["L ",",",""])),t+r-s/2,e+i),o+=V(Vr||(Vr=Ve(["L ",",",""])),t+r-s/2-a,e+i),o+=V(Hr||(Hr=Ve(["L ",","," Z"])),t,e),o},ji={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},wi=t=>{var e=We(t,ji),{x:r,y:a,upperWidth:i,lowerWidth:s,height:o,className:l}=e,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:v}=e,f=m.useRef(null),[x,y]=m.useState(-1),g=m.useRef(i),b=m.useRef(s),h=m.useRef(o),p=m.useRef(r),j=m.useRef(a),N=gt(t,"trapezoid-");if(m.useEffect(()=>{if(f.current&&f.current.getTotalLength)try{var P=f.current.getTotalLength();P&&y(P)}catch{}},[]),r!==+r||a!==+a||i!==+i||s!==+s||o!==+o||i===0&&s===0||o===0)return null;var O=Fe("recharts-trapezoid",l);if(!v)return m.createElement("g",null,m.createElement("path",vt({},Ce(e),{className:O,d:Zr(r,a,i,s,o)})));var w=g.current,k=b.current,S=h.current,I=p.current,E=j.current,M="0px ".concat(x===-1?1:x,"px"),_="".concat(x,"px ").concat(x,"px"),C=fa(["strokeDasharray"],d,c);return m.createElement(bt,{animationId:N,key:N,canBegin:x>0,duration:d,easing:c,isActive:v,begin:u},P=>{var T=H(w,i,P),$=H(k,s,P),D=H(S,o,P),z=H(I,r,P),B=H(E,a,P);f.current&&(g.current=T,b.current=$,h.current=D,p.current=z,j.current=B);var K=P>0?{transition:C,strokeDasharray:_}:{strokeDasharray:M};return m.createElement("path",vt({},Ce(e),{className:O,d:Zr(z,B,T,$,D),ref:f,style:Ur(Ur({},K),e.style)}))})},Ni=["option","shapeType","activeClassName","inActiveClassName"];function Pi(t,e){if(t==null)return{};var r,a,i=Oi(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Oi(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}function Yr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function ht(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(r),!0).forEach(function(a){Si(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Si(t,e,r){return(e=Ii(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ii(t){var e=ki(t,"string");return typeof e=="symbol"?e:e+""}function ki(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ci(t,e){return ht(ht({},e),t)}function Ai(t,e){return t==="symbols"}function Xr(t){var{shapeType:e,elementProps:r}=t;switch(e){case"rectangle":return m.createElement(ci,r);case"trapezoid":return m.createElement(wi,r);case"sector":return m.createElement(fi,r);case"symbols":if(Ai(e))return m.createElement(Ha,r);break;case"curve":return m.createElement(kn,r);default:return null}}function Ei(t){return m.isValidElement(t)?t.props:t}function Ua(t){var{option:e,shapeType:r,activeClassName:a="recharts-active-shape",inActiveClassName:i="recharts-shape"}=t,s=Pi(t,Ni),o;if(m.isValidElement(e))o=m.cloneElement(e,ht(ht({},s),Ei(e)));else if(typeof e=="function")o=e(s,s.index);else if(xi(e)&&typeof e!="boolean"){var l=Ci(e,s);o=m.createElement(Xr,{shapeType:r,elementProps:l})}else{var c=s;o=m.createElement(Xr,{shapeType:r,elementProps:c})}return s.isActive?m.createElement(Ae,{className:a},o):m.createElement(Ae,{className:i},o)}var Za=(t,e,r)=>{var a=Gt();return(i,s)=>o=>{t?.(i,s,o),a(Cn({activeIndex:String(s),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},Ya=t=>{var e=Gt();return(r,a)=>i=>{t?.(r,a,i),e(An())}},Xa=(t,e,r)=>{var a=Gt();return(i,s)=>o=>{t?.(i,s,o),a(En({activeIndex:String(s),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},Qr=(t,e,r)=>{var a=r??t;if(!Ke(a))return ct(a,e,0)},Ti=(t,e,r)=>{var a={},i=t.filter(Tn),s=t.filter(d=>d.stackId==null),o=i.reduce((d,u)=>{var v=d[u.stackId];return v==null&&(v=[]),v.push(u),d[u.stackId]=v,d},a),l=Object.entries(o).map(d=>{var u,[v,f]=d,x=f.map(g=>g.dataKey),y=Qr(e,r,(u=f[0])===null||u===void 0?void 0:u.barSize);return{stackId:v,dataKeys:x,barSize:y}}),c=s.map(d=>{var u=[d.dataKey].filter(f=>f!=null),v=Qr(e,r,d.barSize);return{stackId:void 0,dataKeys:u,barSize:v}});return[...l,...c]};function Jr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function nt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Jr(Object(r),!0).forEach(function(a){Mi(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jr(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Mi(t,e,r){return(e=Di(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Di(t){var e=_i(t,"string");return typeof e=="symbol"?e:e+""}function _i(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Li(t,e,r,a,i){var s,o=a.length;if(!(o<1)){var l=ct(t,r,0,!0),c,d=[];if(Mt((s=a[0])===null||s===void 0?void 0:s.barSize)){var u=!1,v=r/o,f=a.reduce((p,j)=>p+(j.barSize||0),0);f+=(o-1)*l,f>=r&&(f-=(o-1)*l,l=0),f>=r&&v>0&&(u=!0,v*=.9,f=o*v);var x=(r-f)/2>>0,y={offset:x-l,size:0};c=a.reduce((p,j)=>{var N,O={stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:y.offset+y.size+l,size:u?v:(N=j.barSize)!==null&&N!==void 0?N:0}},w=[...p,O];return y=O.position,w},d)}else{var g=ct(e,r,0,!0);r-2*g-(o-1)*l<=0&&(l=0);var b=(r-2*g-(o-1)*l)/o;b>1&&(b>>=0);var h=Mt(i)?Math.min(b,i):b;c=a.reduce((p,j,N)=>[...p,{stackId:j.stackId,dataKeys:j.dataKeys,position:{offset:g+(b+l)*N+(b-h)/2,size:h}}],d)}return c}}var $i=(t,e,r,a,i,s,o)=>{var l=Ke(o)?e:o,c=Li(r,a,i!==s?i:s,t,l);return i!==s&&c!=null&&(c=c.map(d=>nt(nt({},d),{},{position:nt(nt({},d.position),{},{offset:d.position.offset-i/2})}))),c},Bi=(t,e)=>{var r=Mn(e);if(!(!t||r==null||e==null)){var{stackId:a}=e;if(a!=null){var i=t[a];if(i){var{stackedData:s}=i;if(s)return s.find(o=>o.key===r)}}}},Ri=(t,e)=>{if(!(t==null||e==null)){var r=t.find(a=>a.stackId===e.stackId&&e.dataKey!=null&&a.dataKeys.includes(e.dataKey));if(r!=null)return r.position}};function zi(t,e){return t&&typeof t=="object"&&"zIndex"in t&&typeof t.zIndex=="number"&&Mt(t.zIndex)?t.zIndex:e}var Ki=["children"];function Fi(t,e){if(t==null)return{};var r,a,i=Wi(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Wi(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var qi={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Vi=m.createContext(qi);function Qa(t){var{children:e}=t,r=Fi(t,Ki);return m.createElement(Vi.Provider,{value:r},e)}var Ja=(t,e,r,a)=>Ne(t,"xAxis",e,a),en=(t,e,r,a)=>Pe(t,"xAxis",e,a),tn=(t,e,r,a)=>Ne(t,"yAxis",r,a),rn=(t,e,r,a)=>Pe(t,"yAxis",r,a),Hi=fe([Se,Ja,tn,en,rn],(t,e,r,a,i)=>_n(t,"xAxis")?ut(e,a,!1):ut(r,i,!1)),Gi=(t,e,r,a,i)=>i;function Ui(t){return t.type==="line"}var Zi=fe([Ut,Gi],(t,e)=>t.filter(Ui).find(r=>r.id===e)),Yi=fe([Se,Ja,tn,en,rn,Zi,Hi,Dn],(t,e,r,a,i,s,o,l)=>{var{chartData:c,dataStartIndex:d,dataEndIndex:u}=l;if(!(s==null||e==null||r==null||a==null||i==null||a.length===0||i.length===0||o==null||t!=="horizontal"&&t!=="vertical")){var{dataKey:v,data:f}=s,x;if(f!=null&&f.length>0?x=f:x=c?.slice(d,u+1),x!=null)return xo({layout:t,xAxis:e,yAxis:r,xAxisTicks:a,yAxisTicks:i,dataKey:v,bandSize:o,displayedData:x})}}),Xi=["id"],Qi=["type","layout","connectNulls","needClip","shape"],Ji=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Ze(){return Ze=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Ze.apply(null,arguments)}function ea(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function ge(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(r),!0).forEach(function(a){eo(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ea(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function eo(t,e,r){return(e=to(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function to(t){var e=ro(t,"string");return typeof e=="symbol"?e:e+""}function ro(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jt(t,e){if(t==null)return{};var r,a,i=ao(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function ao(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var no=t=>{var{dataKey:e,name:r,stroke:a,legendType:i,hide:s}=t;return[{inactive:s,dataKey:e,type:i,color:a,value:wt(r,e),payload:t}]},so=m.memo(t=>{var{dataKey:e,data:r,stroke:a,strokeWidth:i,fill:s,name:o,hide:l,unit:c,tooltipType:d,id:u}=t,v={dataDefinedOnItem:r,getPosition:ba,settings:{stroke:a,strokeWidth:i,fill:s,dataKey:e,nameKey:void 0,name:wt(o,e),hide:l,type:d,color:a,unit:c,graphicalItemId:u}};return m.createElement(ga,{tooltipEntrySettings:v})}),an=(t,e)=>"".concat(e,"px ").concat(t,"px");function io(t,e){for(var r=t.length%2!==0?[...t,0]:t,a=[],i=0;i<e;++i)a.push(...r);return a}var oo=(t,e,r)=>{var a=r.reduce((f,x)=>f+x,0);if(!a)return an(e,t);for(var i=Math.floor(t/a),s=t%a,o=[],l=0,c=0;l<r.length;c+=(d=r[l])!==null&&d!==void 0?d:0,++l){var d,u=r[l];if(u!=null&&c+u>s){o=[...r.slice(0,l),s-c];break}}var v=o.length%2===0?[0,e]:[e];return[...io(r,i),...o,...v].map(f=>"".concat(f,"px")).join(", ")};function lo(t){var{clipPathId:e,points:r,props:a}=t,{dot:i,dataKey:s,needClip:o}=a,{id:l}=a,c=Jt(a,Xi),d=Oa(c);return m.createElement(zn,{points:r,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:s,baseProps:d,needClip:o,clipPathId:e})}function co(t){var{showLabels:e,children:r,points:a}=t,i=m.useMemo(()=>a?.map(s=>{var o,l,c={x:(o=s.x)!==null&&o!==void 0?o:0,y:(l=s.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ge(ge({},c),{},{value:s.value,payload:s.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[a]);return m.createElement(Pa,{value:e?i:void 0},r)}function ta(t){var{clipPathId:e,pathRef:r,points:a,strokeDasharray:i,props:s}=t,{type:o,layout:l,connectNulls:c,needClip:d,shape:u}=s,v=Jt(s,Qi),f=ge(ge({},Ce(v)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(e,")"):void 0,points:a,type:o,layout:l,connectNulls:c,strokeDasharray:i??s.strokeDasharray});return m.createElement(m.Fragment,null,a?.length>1&&m.createElement(Ua,Ze({shapeType:"curve",option:u},f,{pathRef:r})),m.createElement(lo,{points:a,clipPathId:e,props:s}))}function uo(t){try{return t&&t.getTotalLength&&t.getTotalLength()||0}catch{return 0}}function mo(t){var{clipPathId:e,props:r,pathRef:a,previousPointsRef:i,longestAnimatedLengthRef:s}=t,{points:o,strokeDasharray:l,isAnimationActive:c,animationBegin:d,animationDuration:u,animationEasing:v,animateNewValues:f,width:x,height:y,onAnimationEnd:g,onAnimationStart:b}=r,h=i.current,p=gt(o,"recharts-line-"),j=m.useRef(p),[N,O]=m.useState(!1),w=!N,k=m.useCallback(()=>{typeof g=="function"&&g(),O(!1)},[g]),S=m.useCallback(()=>{typeof b=="function"&&b(),O(!0)},[b]),I=uo(a.current),E=m.useRef(0);j.current!==p&&(E.current=s.current,j.current=p);var M=E.current;return m.createElement(co,{points:o,showLabels:w},r.children,m.createElement(bt,{animationId:p,begin:d,duration:u,isActive:c,easing:v,onAnimationEnd:k,onAnimationStart:S,key:p},_=>{var C=H(M,I+M,_),P=Math.min(C,I),T;if(c)if(l){var $="".concat(l).split(/[,\s]+/gim).map(B=>parseFloat(B));T=oo(P,I,$)}else T=an(I,P);else T=l==null?void 0:String(l);if(_>0&&I>0&&(i.current=o,s.current=Math.max(s.current,P)),h){var D=h.length/o.length,z=_===1?o:o.map((B,K)=>{var R=Math.floor(K*D);if(h[R]){var A=h[R];return ge(ge({},B),{},{x:H(A.x,B.x,_),y:H(A.y,B.y,_)})}return f?ge(ge({},B),{},{x:H(x*2,B.x,_),y:H(y/2,B.y,_)}):ge(ge({},B),{},{x:B.x,y:B.y})});return i.current=z,m.createElement(ta,{props:r,points:z,clipPathId:e,pathRef:a,strokeDasharray:T})}return m.createElement(ta,{props:r,points:o,clipPathId:e,pathRef:a,strokeDasharray:T})}),m.createElement(Na,{label:r.label}))}function fo(t){var{clipPathId:e,props:r}=t,a=m.useRef(null),i=m.useRef(0),s=m.useRef(null);return m.createElement(mo,{props:r,clipPathId:e,previousPointsRef:a,longestAnimatedLengthRef:i,pathRef:s})}var po=(t,e)=>{var r,a;return{x:(r=t.x)!==null&&r!==void 0?r:void 0,y:(a=t.y)!==null&&a!==void 0?a:void 0,value:t.value,errorVal:Pt(t.payload,e)}};class vo extends m.Component{render(){var{hide:e,dot:r,points:a,className:i,xAxisId:s,yAxisId:o,top:l,left:c,width:d,height:u,id:v,needClip:f,zIndex:x}=this.props;if(e)return null;var y=Fe("recharts-line",i),g=v,{r:b,strokeWidth:h}=$n(r),p=Bn(r),j=b*2+h,N=f?"url(#clipPath-".concat(p?"":"dots-").concat(g,")"):void 0;return m.createElement(Nt,{zIndex:x},m.createElement(Ae,{className:y},f&&m.createElement("defs",null,m.createElement(wa,{clipPathId:g,xAxisId:s,yAxisId:o}),!p&&m.createElement("clipPath",{id:"clipPath-dots-".concat(g)},m.createElement("rect",{x:c-j/2,y:l-j/2,width:d+j,height:u+j}))),m.createElement(Qa,{xAxisId:s,yAxisId:o,data:a,dataPointFormatter:po,errorBarOffset:0},m.createElement(fo,{props:this.props,clipPathId:g}))),m.createElement(Rn,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:N}))}}var nn={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:yt.line,type:"linear"};function ho(t){var e=We(t,nn),{activeDot:r,animateNewValues:a,animationBegin:i,animationDuration:s,animationEasing:o,connectNulls:l,dot:c,hide:d,isAnimationActive:u,label:v,legendType:f,xAxisId:x,yAxisId:y,id:g}=e,b=Jt(e,Ji),{needClip:h}=ya(x,y),p=Ln(),j=ja(),N=jt(),O=Ue(E=>Yi(E,x,y,N,g));if(j!=="horizontal"&&j!=="vertical"||O==null||p==null)return null;var{height:w,width:k,x:S,y:I}=p;return m.createElement(vo,Ze({},b,{id:g,connectNulls:l,dot:c,activeDot:r,animateNewValues:a,animationBegin:i,animationDuration:s,animationEasing:o,isAnimationActive:u,hide:d,label:v,legendType:f,xAxisId:x,yAxisId:y,points:O,layout:j,height:w,width:k,left:S,top:I,needClip:h}))}function xo(t){var{layout:e,xAxis:r,yAxis:a,xAxisTicks:i,yAxisTicks:s,dataKey:o,bandSize:l,displayedData:c}=t;return c.map((d,u)=>{var v=Pt(d,o);if(e==="horizontal"){var f=sr({axis:r,ticks:i,bandSize:l,entry:d,index:u}),x=Ke(v)?null:a.scale.map(v);return{x:f,y:x??null,value:v,payload:d}}var y=Ke(v)?null:r.scale.map(v),g=sr({axis:a,ticks:s,bandSize:l,entry:d,index:u});return y==null||g==null?null:{x:y,y:g,value:v,payload:d}}).filter(Boolean)}function go(t){var e=We(t,nn),r=jt();return m.createElement(va,{id:e.id,type:"line"},a=>m.createElement(m.Fragment,null,m.createElement(ha,{legendPayload:no(e)}),m.createElement(so,{dataKey:e.dataKey,data:e.data,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:a}),m.createElement(xa,{type:"line",id:a,data:e.data,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,hide:e.hide,isPanorama:r}),m.createElement(ho,Ze({},e,{id:a}))))}var sn=m.memo(go,pa);sn.displayName="Line";function Rt(){return Rt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Rt.apply(null,arguments)}function er(t){return m.createElement(Ua,Rt({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},t))}var bo=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(a,i)=>{if(He(e))return e;var s=He(a)||Ke(a);return s?e(a,i):(s||hn(!1),r)}},yo=(t,e,r)=>r,jo=(t,e)=>e,Xe=fe([Ut,jo],(t,e)=>t.filter(r=>r.type==="bar").find(r=>r.id===e)),wo=fe([Xe],t=>t?.maxBarSize),No=(t,e,r,a)=>a,Po=fe([Se,Ut,Ee,Te,yo],(t,e,r,a,i)=>e.filter(s=>t==="horizontal"?s.xAxisId===r:s.yAxisId===a).filter(s=>s.isPanorama===i).filter(s=>s.hide===!1).filter(s=>s.type==="bar")),Oo=(t,e,r)=>{var a=Se(t),i=Ee(t,e),s=Te(t,e);if(!(i==null||s==null))return a==="horizontal"?ir(t,"yAxis",s,r):ir(t,"xAxis",i,r)},So=(t,e)=>{var r=Se(t),a=Ee(t,e),i=Te(t,e);if(!(a==null||i==null))return r==="horizontal"?or(t,"xAxis",a):or(t,"yAxis",i)},Io=fe([Po,Hn,So],Ti),ko=(t,e,r)=>{var a,i,s=Xe(t,e);if(s==null)return 0;var o=Ee(t,e),l=Te(t,e);if(o==null||l==null)return 0;var c=Se(t),d=Sa(t),{maxBarSize:u}=s,v=Ke(u)?d:u,f,x;return c==="horizontal"?(f=Ne(t,"xAxis",o,r),x=Pe(t,"xAxis",o,r)):(f=Ne(t,"yAxis",l,r),x=Pe(t,"yAxis",l,r)),(a=(i=ut(f,x,!0))!==null&&i!==void 0?i:v)!==null&&a!==void 0?a:0},on=(t,e,r)=>{var a=Se(t),i=Ee(t,e),s=Te(t,e);if(!(i==null||s==null)){var o,l;return a==="horizontal"?(o=Ne(t,"xAxis",i,r),l=Pe(t,"xAxis",i,r)):(o=Ne(t,"yAxis",s,r),l=Pe(t,"yAxis",s,r)),ut(o,l)}},Co=fe([Io,Sa,qn,Vn,ko,on,wo],$i),Ao=(t,e,r)=>{var a=Ee(t,e);if(a!=null)return Ne(t,"xAxis",a,r)},Eo=(t,e,r)=>{var a=Te(t,e);if(a!=null)return Ne(t,"yAxis",a,r)},To=(t,e,r)=>{var a=Ee(t,e);if(a!=null)return Pe(t,"xAxis",a,r)},Mo=(t,e,r)=>{var a=Te(t,e);if(a!=null)return Pe(t,"yAxis",a,r)},Do=fe([Co,Xe],Ri),_o=fe([Oo,Xe],Bi),Lo=fe([Kn,Fn,Ao,Eo,To,Mo,Do,Se,Wn,on,_o,Xe,No],(t,e,r,a,i,s,o,l,c,d,u,v,f)=>{var{chartData:x,dataStartIndex:y,dataEndIndex:g}=c;if(!(v==null||o==null||e==null||l!=="horizontal"&&l!=="vertical"||r==null||a==null||i==null||s==null||d==null)){var{data:b}=v,h;if(b!=null&&b.length>0?h=b:h=x?.slice(y,g+1),h!=null)return dl({layout:l,barSettings:v,pos:o,parentViewBox:e,bandSize:d,xAxis:r,yAxis:a,xAxisTicks:i,yAxisTicks:s,stackedData:u,displayedData:h,offset:t,cells:f,dataStartIndex:y})}}),$o=["index"];function zt(){return zt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},zt.apply(null,arguments)}function Bo(t,e){if(t==null)return{};var r,a,i=Ro(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Ro(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var ln=m.createContext(void 0),zo=t=>{var e=m.useContext(ln);if(e!=null)return e.stackId;if(t!=null)return Gn(t)},Ko=(t,e)=>"recharts-bar-stack-clip-path-".concat(t,"-").concat(e),Fo=t=>{var e=m.useContext(ln);if(e!=null){var{stackId:r}=e;return"url(#".concat(Ko(r,t),")")}},cn=t=>{var{index:e}=t,r=Bo(t,$o),a=Fo(e);return m.createElement(Ae,zt({className:"recharts-bar-stack-layer",clipPath:a},r))},Wo=["onMouseEnter","onMouseLeave","onClick"],qo=["value","background","tooltipPosition"],Vo=["id"],Ho=["onMouseEnter","onClick","onMouseLeave"];function Oe(){return Oe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var a in r)({}).hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Oe.apply(null,arguments)}function ra(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ra(Object(r),!0).forEach(function(a){Go(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ra(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function Go(t,e,r){return(e=Uo(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Uo(t){var e=Zo(t,"string");return typeof e=="symbol"?e:e+""}function Zo(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xt(t,e){if(t==null)return{};var r,a,i=Yo(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)r=s[a],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function Yo(t,e){if(t==null)return{};var r={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;r[a]=t[a]}return r}var Xo=t=>{var{dataKey:e,name:r,fill:a,legendType:i,hide:s}=t;return[{inactive:s,dataKey:e,type:i,color:a,value:wt(r,e),payload:t}]},Qo=m.memo(t=>{var{dataKey:e,stroke:r,strokeWidth:a,fill:i,name:s,hide:o,unit:l,tooltipType:c,id:d}=t,u={dataDefinedOnItem:void 0,getPosition:ba,settings:{stroke:r,strokeWidth:a,fill:i,dataKey:e,nameKey:void 0,name:wt(s,e),hide:o,type:c,color:i,unit:l,graphicalItemId:d}};return m.createElement(ga,{tooltipEntrySettings:u})});function Jo(t){var e=Ue(Ia),{data:r,dataKey:a,background:i,allOtherBarProps:s}=t,{onMouseEnter:o,onMouseLeave:l,onClick:c}=s,d=xt(s,Wo),u=Za(o,a,s.id),v=Ya(l),f=Xa(c,a,s.id);if(!i||r==null)return null;var x=Zn(i);return m.createElement(Nt,{zIndex:zi(i,yt.barBackground)},r.map((y,g)=>{var{value:b,background:h,tooltipPosition:p}=y,j=xt(y,qo);if(!h)return null;var N=u(y,g),O=v(y,g),w=f(y,g),k=se(se(se(se(se({option:i,isActive:String(g)===e},j),{},{fill:"#eee"},h),x),ka(d,y,g)),{},{onMouseEnter:N,onMouseLeave:O,onClick:w,dataKey:a,index:g,className:"recharts-bar-background-rectangle"});return m.createElement(er,Oe({key:"background-bar-".concat(g)},k))}))}function el(t){var{showLabels:e,children:r,rects:a}=t,i=a?.map(s=>{var o={x:s.x,y:s.y,width:s.width,lowerWidth:s.width,upperWidth:s.width,height:s.height};return se(se({},o),{},{value:s.value,payload:s.payload,parentViewBox:s.parentViewBox,viewBox:o,fill:s.fill})});return m.createElement(Pa,{value:e?i:void 0},r)}function tl(t){var{shape:e,activeBar:r,baseProps:a,entry:i,index:s,dataKey:o}=t,l=Ue(Ia),c=Ue(Qn),d=r&&String(i.originalDataIndex)===l&&(c==null||o===c),[u,v]=m.useState(!1),[f,x]=m.useState(!1);m.useEffect(()=>{var j;return d?(v(!0),j=requestAnimationFrame(()=>{x(!0)})):x(!1),()=>{cancelAnimationFrame(j)}},[d]);var y=m.useCallback(()=>{d||v(!1)},[d]),g=d&&f,b=d||u,h;d?r===!0?h=e:h=r:h=e;var p=m.createElement(er,Oe({},a,{name:String(a.name)},i,{isActive:g,option:h,index:s,dataKey:o,onTransitionEnd:y}));return b?m.createElement(Nt,{zIndex:yt.activeBar},m.createElement(cn,{index:i.originalDataIndex},p)):p}function rl(t){var{shape:e,baseProps:r,entry:a,index:i,dataKey:s}=t;return m.createElement(er,Oe({},r,{name:String(r.name)},a,{isActive:!1,option:e,index:i,dataKey:s}))}function al(t){var e,{data:r,props:a}=t,i=(e=Oa(a))!==null&&e!==void 0?e:{},{id:s}=i,o=xt(i,Vo),{shape:l,dataKey:c,activeBar:d}=a,{onMouseEnter:u,onClick:v,onMouseLeave:f}=a,x=xt(a,Ho),y=Za(u,c,s),g=Ya(f),b=Xa(v,c,s);return r?m.createElement(m.Fragment,null,r.map((h,p)=>m.createElement(cn,Oe({index:h.originalDataIndex,key:"rectangle-".concat(h?.x,"-").concat(h?.y,"-").concat(h?.value,"-").concat(p),className:"recharts-bar-rectangle"},ka(x,h,p),{onMouseEnter:y(h,p),onMouseLeave:g(h,p),onClick:b(h,p)}),d?m.createElement(tl,{shape:l,activeBar:d,baseProps:o,entry:h,index:p,dataKey:c}):m.createElement(rl,{shape:l,baseProps:o,entry:h,index:p,dataKey:c})))):null}function nl(t){var{props:e,previousRectanglesRef:r}=t,{data:a,layout:i,isAnimationActive:s,animationBegin:o,animationDuration:l,animationEasing:c,onAnimationEnd:d,onAnimationStart:u}=e,v=r.current,f=gt(e,"recharts-bar-"),[x,y]=m.useState(!1),g=!x,b=m.useCallback(()=>{typeof d=="function"&&d(),y(!1)},[d]),h=m.useCallback(()=>{typeof u=="function"&&u(),y(!0)},[u]);return m.createElement(el,{showLabels:g,rects:a},m.createElement(bt,{animationId:f,begin:o,duration:l,isActive:s,easing:c,onAnimationEnd:b,onAnimationStart:h,key:f},p=>{var j=p===1?a:a?.map((N,O)=>{var w=v&&v[O];if(w)return se(se({},N),{},{x:H(w.x,N.x,p),y:H(w.y,N.y,p),width:H(w.width,N.width,p),height:H(w.height,N.height,p)});if(i==="horizontal"){var k=H(0,N.height,p),S=H(N.stackedBarStart,N.y,p);return se(se({},N),{},{y:S,height:k})}var I=H(0,N.width,p),E=H(N.stackedBarStart,N.x,p);return se(se({},N),{},{width:I,x:E})});return p>0&&(r.current=j??null),j==null?null:m.createElement(Ae,null,m.createElement(al,{props:e,data:j}))}),m.createElement(Na,{label:e.label}),e.children)}function sl(t){var e=m.useRef(null);return m.createElement(nl,{previousRectanglesRef:e,props:t})}var dn=0,il=(t,e)=>{var r=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:r,errorVal:Pt(t,e)}};class ol extends m.PureComponent{render(){var{hide:e,data:r,dataKey:a,className:i,xAxisId:s,yAxisId:o,needClip:l,background:c,id:d}=this.props;if(e||r==null)return null;var u=Fe("recharts-bar",i),v=d;return m.createElement(Ae,{className:u,id:d},l&&m.createElement("defs",null,m.createElement(wa,{clipPathId:v,xAxisId:s,yAxisId:o})),m.createElement(Ae,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(v,")"):void 0},m.createElement(Jo,{data:r,dataKey:a,background:c,allOtherBarProps:this.props}),m.createElement(sl,this.props)))}}var ll={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:dn,xAxisId:0,yAxisId:0,zIndex:yt.bar};function cl(t){var{xAxisId:e,yAxisId:r,hide:a,legendType:i,minPointSize:s,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u}=t,{needClip:v}=ya(e,r),f=ja(),x=jt(),y=Un(t.children,Qt),g=Ue(p=>Lo(p,t.id,x,y));if(f!=="vertical"&&f!=="horizontal")return null;var b,h=g?.[0];return h==null||h.height==null||h.width==null?b=0:b=f==="vertical"?h.height/2:h.width/2,m.createElement(Qa,{xAxisId:e,yAxisId:r,data:g,dataPointFormatter:il,errorBarOffset:b},m.createElement(ol,Oe({},t,{layout:f,needClip:v,data:g,xAxisId:e,yAxisId:r,hide:a,legendType:i,minPointSize:s,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}function dl(t){var{layout:e,barSettings:{dataKey:r,minPointSize:a,hasCustomShape:i},pos:s,bandSize:o,xAxis:l,yAxis:c,xAxisTicks:d,yAxisTicks:u,stackedData:v,displayedData:f,offset:x,cells:y,parentViewBox:g,dataStartIndex:b}=t,h=e==="horizontal"?c:l,p=v?h.scale.domain():null,j=Yn({numericAxis:h}),N=h.scale.map(j);return f.map((O,w)=>{var k,S,I,E,M,_;if(v){var C=v[w+b];if(C==null)return null;k=Xn(C,p)}else k=Pt(O,r),Array.isArray(k)||(k=[j,k]);var P=bo(a,dn)(k[1],w);if(e==="horizontal"){var T,$=c.scale.map(k[0]),D=c.scale.map(k[1]);if($==null||D==null)return null;S=lr({axis:l,ticks:d,bandSize:o,offset:s.offset,entry:O,index:w}),I=(T=D??$)!==null&&T!==void 0?T:void 0,E=s.size;var z=$-D;if(M=Jn(z)?0:z,_={x:S,y:x.top,width:E,height:x.height},Math.abs(P)>0&&Math.abs(M)<Math.abs(P)){var B=dt(M||P)*(Math.abs(P)-Math.abs(M));I-=B,M+=B}}else{var K=l.scale.map(k[0]),R=l.scale.map(k[1]);if(K==null||R==null)return null;if(S=K,I=lr({axis:c,ticks:u,bandSize:o,offset:s.offset,entry:O,index:w}),E=R-K,M=s.size,_={x:x.left,y:I,width:x.width,height:M},Math.abs(P)>0&&Math.abs(E)<Math.abs(P)){var A=dt(E||P)*(Math.abs(P)-Math.abs(E));E+=A}}if(S==null||I==null||E==null||M==null||!i&&(E===0||M===0))return null;var L=se(se({},O),{},{stackedBarStart:N,x:S,y:I,width:E,height:M,value:v?k:k[1],payload:O,background:_,tooltipPosition:{x:S+E/2,y:I+M/2},parentViewBox:g,originalDataIndex:w},y&&y[w]&&y[w].props);return L}).filter(Boolean)}function ul(t){var e=We(t,ll),r=zo(e.stackId),a=jt();return m.createElement(va,{id:e.id,type:"bar"},i=>m.createElement(m.Fragment,null,m.createElement(ha,{legendPayload:Xo(e)}),m.createElement(Qo,{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}),m.createElement(xa,{type:"bar",id:i,data:void 0,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,stackId:r,hide:e.hide,barSize:e.barSize,minPointSize:e.minPointSize,maxBarSize:e.maxBarSize,isPanorama:a,hasCustomShape:e.shape!=null}),m.createElement(Nt,{zIndex:e.zIndex},m.createElement(cl,Oe({},e,{id:i})))))}var un=m.memo(ul,pa);un.displayName="Bar";var ml=["axis"],fl=m.forwardRef((t,e)=>m.createElement(Ca,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ml,tooltipPayloadSearcher:Aa,categoricalChartProps:t,ref:e})),pl=["axis","item"],vl=m.forwardRef((t,e)=>m.createElement(Ca,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:pl,tooltipPayloadSearcher:Aa,categoricalChartProps:t,ref:e}));function hl(t){const e=ae.c(49),{log:r,isExpanded:a,connection:i,virtualMcpName:s,onToggle:o,lastLogRef:l}=t;let c,d;if(e[0]!==r.timestamp){const P=new Date(r.timestamp);c=P.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=P.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=c,e[2]=d}else c=e[1],d=e[2];const u=d,v=a?"bg-muted/30 hover:bg-accent/80":"hover:bg-muted/40";let f;e[3]!==v?(f=we("h-14 md:h-16 transition-colors cursor-pointer",v),e[3]=v,e[4]=f):f=e[4];let x;e[5]!==a?(x=n.jsx(he,{className:"w-10 md:w-12 px-2 md:px-4",children:n.jsx("div",{className:"flex items-center justify-center",children:a?n.jsx(Tt,{size:16,className:"text-muted-foreground"}):n.jsx(Sn,{size:16,className:"text-muted-foreground"})})}),e[5]=a,e[6]=x):x=e[6];const y=i?.icon||null;let g;e[7]!==r.connectionTitle||e[8]!==y?(g=n.jsx(he,{className:"w-12 md:w-16 px-2 md:px-4",children:n.jsx("div",{className:"flex items-center justify-center",children:n.jsx(ot,{icon:y,name:r.connectionTitle,size:"xs",className:"shadow-sm"})})}),e[7]=r.connectionTitle,e[8]=y,e[9]=g):g=e[9];let b;e[10]!==r.toolName?(b=n.jsx("div",{className:"text-xs font-medium text-foreground truncate block",children:r.toolName}),e[10]=r.toolName,e[11]=b):b=e[11];let h;e[12]!==r.connectionTitle?(h=n.jsx("div",{className:"text-xs text-muted-foreground truncate block",children:r.connectionTitle}),e[12]=r.connectionTitle,e[13]=h):h=e[13];let p;e[14]!==b||e[15]!==h?(p=n.jsxs(he,{className:"min-w-0 pr-2 md:pr-4",children:[b,h]}),e[14]=b,e[15]=h,e[16]=p):p=e[16];let j;e[17]!==s?(j=n.jsx(he,{className:"w-24 md:w-32 px-2 md:px-3 text-xs text-muted-foreground",children:n.jsx("div",{className:"truncate",children:s})}),e[17]=s,e[18]=j):j=e[18];let N;e[19]!==r.userName?(N=n.jsx(he,{className:"w-20 md:w-24 px-2 md:px-3 text-xs text-muted-foreground",children:r.userName}),e[19]=r.userName,e[20]=N):N=e[20];let O;e[21]!==c?(O=n.jsx(he,{className:"w-20 md:w-24 px-2 md:px-3 text-xs text-muted-foreground",children:c}),e[21]=c,e[22]=O):O=e[22];let w;e[23]!==u?(w=n.jsx(he,{className:"w-20 md:w-28 px-2 md:px-3 text-xs text-muted-foreground",children:u}),e[23]=u,e[24]=w):w=e[24];let k;e[25]!==r.durationMs?(k=n.jsxs(he,{className:"w-16 md:w-20 px-2 md:px-3 text-xs text-muted-foreground font-mono text-right",children:[r.durationMs,"ms"]}),e[25]=r.durationMs,e[26]=k):k=e[26];const S=r.isError?"destructive":"success",I=r.isError?"Error":"OK";let E;e[27]!==S||e[28]!==I?(E=n.jsx(he,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:n.jsx("div",{className:"flex items-center justify-end",children:n.jsx(lt,{variant:S,className:"text-xs px-1.5 md:px-2 py-0.5 md:py-1",children:I})})}),e[27]=S,e[28]=I,e[29]=E):E=e[29];let M;e[30]!==l||e[31]!==o||e[32]!==j||e[33]!==N||e[34]!==O||e[35]!==w||e[36]!==k||e[37]!==E||e[38]!==f||e[39]!==x||e[40]!==g||e[41]!==p?(M=n.jsxs(Ge,{ref:l,className:f,onClick:o,children:[x,g,p,j,N,O,w,k,E]}),e[30]=l,e[31]=o,e[32]=j,e[33]=N,e[34]=O,e[35]=w,e[36]=k,e[37]=E,e[38]=f,e[39]=x,e[40]=g,e[41]=p,e[42]=M):M=e[42];let _;e[43]!==a||e[44]!==r?(_=a&&n.jsx(Ge,{children:n.jsx(he,{colSpan:9,className:"p-0",children:n.jsx(jn,{log:r})})}),e[43]=a,e[44]=r,e[45]=_):_=e[45];let C;return e[46]!==M||e[47]!==_?(C=n.jsxs(m.Fragment,{children:[M,_]}),e[46]=M,e[47]=_,e[48]=C):C=e[48],C}function St(t){const e=ae.c(24),{title:r,description:a,action:i,children:s,className:o,noPadding:l,onTitleClick:c}=t,d=l===void 0?!1:l;let u;e[0]!==r?(u=typeof r=="string"?n.jsx("div",{className:"text-sm font-medium text-foreground",children:r}):r,e[0]=r,e[1]=u):u=e[1];const v=u;let f;e[2]!==o?(f=we("bg-background flex flex-col",o),e[2]=o,e[3]=f):f=e[3];let x;e[4]!==c||e[5]!==v?(x=c?n.jsx("button",{onClick:c,className:"text-left hover:text-foreground transition-colors cursor-pointer",children:v}):v,e[4]=c,e[5]=v,e[6]=x):x=e[6];let y;e[7]!==a?(y=a?n.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:a}):null,e[7]=a,e[8]=y):y=e[8];let g;e[9]!==x||e[10]!==y?(g=n.jsxs("div",{className:"min-w-0",children:[x,y]}),e[9]=x,e[10]=y,e[11]=g):g=e[11];let b;e[12]!==i?(b=i?n.jsx("div",{className:"shrink-0",children:i}):null,e[12]=i,e[13]=b):b=e[13];let h;e[14]!==g||e[15]!==b?(h=n.jsxs("header",{className:"flex items-center justify-between gap-4 p-5",children:[g,b]}),e[14]=g,e[15]=b,e[16]=h):h=e[16];let p;e[17]!==s||e[18]!==d?(p=d?n.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-h-0",children:s}):n.jsx("div",{className:"px-5 pb-5 pt-2",children:s}),e[17]=s,e[18]=d,e[19]=p):p=e[19];let j;return e[20]!==f||e[21]!==h||e[22]!==p?(j=n.jsxs("div",{className:f,children:[h,p]}),e[20]=f,e[21]=h,e[22]=p,e[23]=j):j=e[23],j}function Kt(t,e){if(t.length===0)return 0;const r=[...t].sort((i,s)=>i-s),a=Math.max(0,Math.min(r.length-1,Math.ceil(e*r.length)-1));return r[a]??0}function xl(t,e){return e<=9e7?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function gl(t,e){const o=e-t;return o<=36e5?Math.max(1,Math.min(60,Math.ceil(o/6e4))):o<=9e7?Math.max(1,Math.min(25,Math.ceil(o/36e5))):Math.max(1,Math.min(31,Math.ceil(o/864e5)))}function bl(t,e,r,a){const i=e.getTime(),s=r.getTime(),o=Math.max(1,s-i),l=gl(i,s),c=Math.max(1,Math.floor(o/l)),d=[];for(let u=0;u<l;u++){const v=new Date(i+u*c),f=v.toISOString();d.push({t:f,ts:v.getTime(),label:xl(v,o),calls:0,errors:0,durations:[]})}for(const u of t){const v=new Date(u.timestamp).getTime(),f=Math.floor((v-i)/c),x=Math.max(0,Math.min(l-1,f)),y=d[x];y&&(y.calls+=1,u.isError&&(y.errors+=1),Number.isFinite(u.durationMs)&&y.durations.push(u.durationMs))}return d.map(u=>({t:u.t,ts:u.ts,label:u.label,calls:u.calls,errors:u.errors,errorRate:u.calls>0?u.errors/u.calls*100:0,avg:Math.round(u.durations.length>0?u.durations.reduce((v,f)=>v+f,0)/u.durations.length:0),p50:Math.round(Kt(u.durations,.5)),p95:Math.round(Kt(u.durations,.95))}))}function yl(t,e,r,a){const i=a??t.length,s=t.filter(u=>u.isError).length,o=t.map(u=>u.durationMs),l=o.length>0?o.reduce((u,v)=>u+v,0)/o.length:0,c=Kt(o,.95),d=bl(t,e.startDate,e.endDate);return{totalCalls:i,totalErrors:s,avgDurationMs:l,p95DurationMs:c,data:d}}function jl(t){const e=ae.c(29),{data:r,dataKey:a,colorNum:i,chartHeight:s}=t,o=`var(--chart-${i})`;let l;e[0]!==s?(l=we(s,"w-full"),e[0]=s,e[1]=l):l=e[1];let c;e[2]!==o||e[3]!==a?(c={label:a,color:o},e[2]=o,e[3]=a,e[4]=c):c=e[4];let d;e[5]!==a||e[6]!==c?(d={[a]:c},e[5]=a,e[6]=c,e[7]=d):d=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u={left:0,right:0,top:0,bottom:0},e[8]=u):u=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx(Ea,{content:n.jsx(es,{indicator:"line",labelFormatter:wl})}),e[9]=v):v=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=[0,0,0,0],e[10]=f):f=e[10];let x;if(e[11]!==o||e[12]!==r||e[13]!==a){let h;e[15]!==o||e[16]!==a?(h=(p,j)=>n.jsx(Qt,{fill:p[a]===0?"var(--muted-foreground)":o,fillOpacity:p[a]===0?.25:1},`cell-${j}`),e[15]=o,e[16]=a,e[17]=h):h=e[17],x=r.map(h),e[11]=o,e[12]=r,e[13]=a,e[14]=x}else x=e[14];let y;e[18]!==o||e[19]!==a||e[20]!==x?(y=n.jsx(un,{dataKey:a,fill:o,radius:f,minPointSize:1,children:x}),e[18]=o,e[19]=a,e[20]=x,e[21]=y):y=e[21];let g;e[22]!==r||e[23]!==y?(g=n.jsxs(vl,{data:r,margin:u,children:[v,y]}),e[22]=r,e[23]=y,e[24]=g):g=e[24];let b;return e[25]!==l||e[26]!==d||e[27]!==g?(b=n.jsx(Ta,{className:l,config:d,children:g}),e[25]=l,e[26]=d,e[27]=g,e[28]=b):b=e[28],b}function wl(t,e){const r=Array.isArray(e)?e[0]:void 0;return r&&typeof r=="object"&&"payload"in r?r.payload?.label??"":""}function Nl(){const t=ae.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0",children:[...Array(3)].map(Pl)}),t[0]=e):e=t[0],e}function Pl(t,e){return n.jsx(St,{title:n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("div",{className:"h-4 w-16 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-5 md:h-6 w-12 rounded bg-muted animate-pulse"})]}),children:n.jsxs("div",{className:"flex flex-col w-full",children:[n.jsx("div",{className:"h-[30px] md:h-[40px] w-full rounded bg-muted animate-pulse"}),n.jsx("div",{className:"space-y-1.5 mt-2",children:Array.from({length:3}).map(Ol)})]})},e)}function Ol(t,e){return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"size-4 rounded-sm bg-muted animate-pulse shrink-0"}),n.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-1.5 flex-1 bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-8 rounded bg-muted animate-pulse shrink-0"})]},e)}function Sl(){const{org:t,project:e,locator:r}=Ye(),a=xn(),i=Vt(),s=Zt({connectionId:Yt,orgId:t.id}),[o,l]=m.useState(null),[c,d]=m.useState(!1),[u,v]=m.useState(!1),{data:f}=gn({queryKey:it.monitoringDashboards(r),queryFn:async()=>{if(!s)throw new Error("MCP client is not available");const p=await s.callTool({name:"MONITORING_DASHBOARD_LIST",arguments:{}});return p.structuredContent??p}}),x=f?.dashboards??[],y=async()=>{if(s){v(!0);try{const p=await s.callTool({name:"MONITORING_DASHBOARD_CREATE",arguments:{name:"Untitled Dashboard",widgets:[{id:crypto.randomUUID(),name:"New Widget",type:"metric",source:{path:"$.usage.total_tokens",from:"output"},aggregation:{fn:"sum"}}]}}),j=(p.structuredContent??p).id;a.invalidateQueries({queryKey:it.monitoringDashboards(r)}),i({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:j}})}catch(p){It.error("Failed to create dashboard"),console.error(p)}finally{v(!1)}}},g=p=>{i({to:"/$org/$project/monitoring/dashboards/$dashboardId",params:{org:t.slug,project:e.slug,dashboardId:p}})},b=p=>{i({to:"/$org/$project/monitoring/dashboards/$dashboardId/edit",params:{org:t.slug,project:e.slug,dashboardId:p}})},h=async p=>{if(s){d(!0);try{await s.callTool({name:"MONITORING_DASHBOARD_DELETE",arguments:{id:p}}),It.success("Dashboard deleted"),a.invalidateQueries({queryKey:it.monitoringDashboards(r)})}catch(j){It.error("Failed to delete dashboard"),console.error(j)}finally{d(!1),l(null)}}};return n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[x.length===0?n.jsx(Ht,{title:"No dashboards yet",description:"Create a dashboard to aggregate and visualize your monitoring data",image:n.jsx(_t,{size:48,className:"text-muted-foreground/50"}),actions:n.jsxs(ye,{onClick:y,size:"sm",disabled:u,children:[n.jsx(Ma,{size:16,className:"mr-1.5"}),"Create Dashboard"]})}):n.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:x.map(p=>n.jsx(ss,{connection:{id:p.id,title:p.name,description:p.description},fallbackIcon:n.jsx(_t,{}),onClick:()=>g(p.id),headerActions:n.jsxs(is,{children:[n.jsx(os,{asChild:!0,children:n.jsx(ye,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:j=>j.stopPropagation(),children:n.jsx(as,{size:20})})}),n.jsxs(ls,{align:"end",onClick:j=>j.stopPropagation(),children:[n.jsxs(cr,{onClick:()=>b(p.id),children:[n.jsx(ns,{size:16}),"Edit"]}),n.jsxs(cr,{onClick:()=>l(p.id),className:"text-destructive",children:[n.jsx(Da,{size:16}),"Delete"]})]})]}),footer:n.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[n.jsxs("span",{children:[p.widgets.length," widget",p.widgets.length!==1?"s":""]}),n.jsx("span",{children:"·"}),n.jsx("span",{children:new Date(p.createdAt).toLocaleDateString()})]})},p.id))}),n.jsx(cs,{open:!!o,onOpenChange:()=>l(null),children:n.jsxs(ds,{children:[n.jsxs(us,{children:[n.jsx(ms,{children:"Delete Dashboard"}),n.jsx(fs,{children:"Are you sure you want to delete this dashboard? This action cannot be undone."})]}),n.jsxs(ps,{children:[n.jsx(vs,{disabled:c,children:"Cancel"}),n.jsx(hs,{disabled:c,onClick:()=>o&&h(o),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c?"Deleting...":"Delete"})]})]})})]})}function Il(){const t=ae.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex items-center justify-between mb-6",children:[n.jsxs("div",{children:[n.jsx("div",{className:"h-6 w-40 bg-muted rounded animate-pulse"}),n.jsx("div",{className:"h-4 w-64 bg-muted rounded animate-pulse mt-2"})]}),n.jsx("div",{className:"h-8 w-32 bg-muted rounded animate-pulse"})]}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto p-5",children:[e,n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(kl)})]}),t[1]=r):r=t[1],r}function kl(t){return n.jsxs("div",{className:"border rounded-lg p-4",children:[n.jsx("div",{className:"h-5 w-32 bg-muted rounded animate-pulse mb-2"}),n.jsx("div",{className:"h-4 w-full bg-muted rounded animate-pulse mb-3"}),n.jsx("div",{className:"h-3 w-24 bg-muted rounded animate-pulse"})]},t)}function Cl(){const t=ae.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboards"}),t[0]=e):e=t[0];let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(qt,{fallback:e,children:n.jsx(m.Suspense,{fallback:n.jsx(Il,{}),children:n.jsx(Sl,{})})}),t[1]=r):r=t[1],r}function Al(t,e,r=!1){const a=m.useRef(null),i=m.useRef(t),s=m.useRef(e),o=m.useRef(r);return i.current=t,s.current=e,o.current=r,c=>{a.current&&a.current.disconnect(),a.current=new IntersectionObserver(d=>{d[0]?.isIntersecting&&s.current&&!o.current&&i.current()}),c&&a.current.observe(c)}}function aa(t){const e=ae.c(72),{options:r,onValueChange:a,defaultValue:i,placeholder:s,variant:o,animation:l,maxCount:c,modalPopover:d,asChild:u,className:v,disabled:f}=t;let x;e[0]!==i?(x=i===void 0?[]:i,e[0]=i,e[1]=x):x=e[1];const y=x,g=s===void 0?"Select items":s,b=o===void 0?"default":o,h=l===void 0?0:l,p=c===void 0?3:c,j=d===void 0?!1:d,N=u===void 0?!1:u,O=f===void 0?!1:f,[w,k]=m.useState(y),[S,I]=m.useState(!1);let E,M;e[2]!==y||e[3]!==w?(E=()=>{JSON.stringify(w)!==JSON.stringify(y)&&k(y)},M=[y,w],e[2]=y,e[3]=w,e[4]=E,e[5]=M):(E=e[4],M=e[5]),m.useEffect(E,M);let _;e[6]!==a||e[7]!==w?(_=W=>{if(W.key==="Enter")I(!0);else if(W.key==="Backspace"&&!W.currentTarget.value){const q=[...w];q.pop(),k(q),a(q)}},e[6]=a,e[7]=w,e[8]=_):_=e[8];const C=_;let P;e[9]!==a||e[10]!==w?(P=W=>{const q=w.includes(W.value)?w.filter(me=>me!==W.value):[...w,W.value];k(q),a(q)},e[9]=a,e[10]=w,e[11]=P):P=e[11];const T=P;let $;e[12]!==a?($=()=>{k([]),a([])},e[12]=a,e[13]=$):$=e[13];const D=$;let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{I(Dl)},e[14]=z):z=e[14];const B=z;let K;e[15]!==D||e[16]!==a||e[17]!==r||e[18]!==w.length?(K=()=>{if(w.length===r.length)D();else{const W=r.map(Ml);k(W),a(W)}},e[15]=D,e[16]=a,e[17]=r,e[18]=w.length,e[19]=K):K=e[19];const R=K;let A;e[20]!==N?(A=N?{}:{variant:"outline"},e[20]=N,e[21]=A):A=e[21];let L;e[22]!==v?(L=we("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",v),e[22]=v,e[23]=L):L=e[23];let F;e[24]!==h||e[25]!==p||e[26]!==r||e[27]!==g||e[28]!==w||e[29]!==b?(F=w.length>0?n.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[w.slice(0,p).map(W=>{const q=r.find(qe=>qe.value===W),me=q?.icon;return n.jsxs(lt,{variant:b==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${h}s`},children:[me&&n.jsx(me,{className:"h-3 w-3 shrink-0"}),n.jsx("span",{className:"truncate",children:q?.label})]},W)}),w.length>p&&n.jsxs(lt,{variant:b==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${h}s`},children:["+",w.length-p]})]}),n.jsx("div",{className:"flex items-center shrink-0 ml-2",children:n.jsx(Tt,{size:20,className:"shrink-0 opacity-50"})})]}):n.jsxs("div",{className:"flex items-center justify-between w-full",children:[n.jsx("span",{className:"text-sm text-muted-foreground",children:g}),n.jsx(Tt,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=h,e[25]=p,e[26]=r,e[27]=g,e[28]=w,e[29]=b,e[30]=F):F=e[30];let G;e[31]!==O||e[32]!==A||e[33]!==L||e[34]!==F?(G=n.jsx(La,{asChild:!0,children:n.jsx(ye,{ref:null,...A,onClick:B,className:L,disabled:O,children:F})}),e[31]=O,e[32]=A,e[33]=L,e[34]=F,e[35]=G):G=e[35];let ne;e[36]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>I(!1),e[36]=ne):ne=e[36];let U;e[37]!==C?(U=n.jsx(Ns,{placeholder:"Search...",onKeyDown:C,className:"rounded-t-xl"}),e[37]=C,e[38]=U):U=e[38];let te;e[39]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(Ps,{children:"No results found."}),e[39]=te):te=e[39];let Z;e[40]!==R?(Z=()=>{R()},e[40]=R,e[41]=Z):Z=e[41];let re;e[42]!==R?(re=W=>{W.stopPropagation(),R()},e[42]=R,e[43]=re):re=e[43];const J=w.length===r.length&&r.length>0;let Y;e[44]!==J||e[45]!==R?(Y=n.jsx(dr,{checked:J,onCheckedChange:R,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Tl}),e[44]=J,e[45]=R,e[46]=Y):Y=e[46];let ie;e[47]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx("span",{children:"(Select All)"}),e[47]=ie):ie=e[47];let X;e[48]!==re||e[49]!==Y?(X=n.jsxs("div",{className:"flex items-center w-full",onClick:re,children:[Y,ie]}),e[48]=re,e[49]=Y,e[50]=X):X=e[50];let ve;e[51]!==Z||e[52]!==X?(ve=n.jsx(ur,{onSelect:Z,className:"cursor-pointer",children:X},"all"),e[51]=Z,e[52]=X,e[53]=ve):ve=e[53];let ee;if(e[54]!==r||e[55]!==w||e[56]!==T){let W;e[58]!==w||e[59]!==T?(W=q=>{const me=w.includes(q.value);return n.jsx(ur,{onSelect:()=>{T(q)},className:"cursor-pointer",children:n.jsxs("div",{className:"flex items-center w-full",onClick:qe=>{qe.stopPropagation(),T(q)},children:[n.jsx(dr,{checked:me,onCheckedChange:()=>{T(q)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:El}),q.icon&&n.jsx(q.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),n.jsx("span",{children:q.label})]})},q.value)},e[58]=w,e[59]=T,e[60]=W):W=e[60],ee=r.map(W),e[54]=r,e[55]=w,e[56]=T,e[57]=ee}else ee=e[57];let oe;e[61]!==ve||e[62]!==ee?(oe=n.jsxs(Os,{className:"rounded-b-xl",children:[te,n.jsxs(Ss,{children:[ve,ee]})]}),e[61]=ve,e[62]=ee,e[63]=oe):oe=e[63];let ue;e[64]!==U||e[65]!==oe?(ue=n.jsx($a,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:ne,children:n.jsxs(Is,{className:"rounded-xl",children:[U,oe]})}),e[64]=U,e[65]=oe,e[66]=ue):ue=e[66];let je;return e[67]!==S||e[68]!==j||e[69]!==G||e[70]!==ue?(je=n.jsxs(Ba,{open:S,onOpenChange:I,modal:j,children:[G,ue]}),e[67]=S,e[68]=j,e[69]=G,e[70]=ue,e[71]=je):je=e[71],je}function El(t){return t.stopPropagation()}function Tl(t){return t.stopPropagation()}function Ml(t){return t.value}function Dl(t){return!t}function _l(){const t=Date.now(),e=300*1e3,r=Math.floor(t/e)*e,a=new Date(r);return{startDate:new Date(r-1440*60*1e3).toISOString(),endDate:a.toISOString()}}function Ll(t){const e=ae.c(12);let r;e[0]!==t?(r=t??_l(),e[0]=t,e[1]=r):r=e[1];const a=r,{org:i}=Ye();let s;e[2]!==i.id?(s={connectionId:Yt,orgId:i.id},e[2]=i.id,e[3]=s):s=e[3];const o=Zt(s);let l;e[4]!==a?(l={...a,limit:2e3,offset:0},e[4]=a,e[5]=l):l=e[5];let c;e[6]!==o||e[7]!==l?(c={client:o,toolName:"MONITORING_LOGS_LIST",toolArguments:l,staleTime:3e4,select:$l},e[6]=o,e[7]=l,e[8]=c):c=e[8];const d=Ds(c);let u;return e[9]!==a||e[10]!==d?(u={...d,dateRange:a},e[9]=a,e[10]=d,e[11]=u):u=e[11],u}function $l(t){return t.structuredContent??t}function Bl(t,e){if(t.length===0)return 0;const r=[...t].sort((i,s)=>i-s),a=Math.max(0,Math.min(r.length-1,Math.ceil(e*r.length)-1));return Math.round(r[a]??0)}function Rl(t,e,r,a=10){const s=e.getTime(),l=(r.getTime()-s)/24,c=new Map;for(const p of t){const j=p.toolName||"Unknown",N=c.get(j);c.set(j,{count:(N?.count??0)+1,connectionId:N?.connectionId||p.connectionId})}const d=[...c.entries()].sort((p,j)=>j[1].count-p[1].count).slice(0,a).map(([p,j])=>({name:p,connectionId:j.connectionId})),u=d.map(p=>p.name),v=[];for(let p=0;p<24;p++){const j=new Date(s+p*l),N=new Map;for(const O of u)N.set(O,{calls:0,errors:0,durations:[]});v.push({t:j.toISOString(),ts:j.getTime(),label:j.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),tools:N})}for(const p of t){const j=new Date(p.timestamp).getTime(),N=Math.floor((j-s)/l),O=Math.max(0,Math.min(23,N)),w=v[O];if(!w)continue;const k=p.toolName||"Unknown",S=w.tools.get(k);S&&(S.calls+=1,p.isError&&(S.errors+=1),Number.isFinite(p.durationMs)&&S.durations.push(p.durationMs))}const f=[],x=[],y=[],g=[];for(const p of v){const j={t:p.t,ts:p.ts,label:p.label},N={...j},O={...j},w={...j},k={...j};for(const S of u){const I=p.tools.get(S);N[S]=I.calls,k[S]=I.errors,O[S]=I.durations.length>0?Math.round(I.durations.reduce((E,M)=>E+M,0)/I.durations.length):0,w[S]=Bl(I.durations,.95)}f.push(N),x.push(O),y.push(w),g.push(k)}const b={},h=new Map;return d.forEach((p,j)=>{const O=`var(--chart-${j%5+1})`;h.set(p.name,O),b[p.name]={label:p.name,color:O}}),{callsBuckets:f,latencyAvgBuckets:x,latencyP95Buckets:y,errorsBuckets:g,topTools:d,chartConfig:b,toolColors:h}}const zl={calls:"Top Tools — Calls","latency-avg":"Top Tools — Avg Latency","latency-p95":"Top Tools — P95 Latency",errors:"Top Tools — Errors"};function Kl(t,e){return e==="latency-avg"||e==="latency-p95"?t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`:String(t)}function Fl(t){const e=ae.c(5),{metricsMode:r,dateRange:a}=t,{org:i}=Ye(),s=Vt(),o=_a()??[],{data:l,dateRange:c}=Ll(a),d=l?.logs??[],u=new Date(c.startDate),v=new Date(c.endDate),{callsBuckets:f,latencyAvgBuckets:x,latencyP95Buckets:y,errorsBuckets:g,topTools:b,chartConfig:h,toolColors:p}=Rl(d,u,v,10),j=r==="latency-avg"?x:r==="latency-p95"?y:r==="errors"?g:f,N=new Map(o.map(ql));let O;e[0]!==s||e[1]!==i.slug?(O=()=>{s({to:"/$org/$project/monitoring",params:{org:i.slug,project:na}})},e[0]=s,e[1]=i.slug,e[2]=O):O=e[2];const w=O,k=zl[r];let S;return e[3]!==k?(S=n.jsx("p",{className:"text-sm text-muted-foreground",children:k}),e[3]=k,e[4]=S):S=e[4],n.jsx(St,{title:n.jsxs("div",{className:"flex flex-col gap-1.5",children:[S,n.jsx("div",{className:"flex items-center gap-3",children:b.slice(0,3).map(I=>{const E=N.get(I.connectionId||"");return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(ot,{icon:E?.icon||null,name:I.name,size:"xs",fallbackIcon:n.jsx(Dt,{}),className:"shrink-0 size-4! min-w-4! aspect-square rounded-sm"}),n.jsx("span",{className:"text-[10px] text-foreground truncate max-w-32",children:I.name})]},I.name)})})]}),onTitleClick:w,children:b.length===0?n.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No tool activity in this time range"}):n.jsx("div",{className:"flex flex-col gap-2 w-full h-full",children:n.jsx(Ta,{className:"flex-1 min-h-0 max-h-[140px] w-full",config:h,children:n.jsxs(fl,{data:j,margin:{left:8,right:8,top:5,bottom:5},children:[n.jsx(ts,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",minTickGap:60}),n.jsx(Ea,{content:I=>{const{active:E,payload:M}=I;if(!E||!M||M.length===0)return null;const _=M[0]&&typeof M[0]=="object"&&"payload"in M[0]?M[0].payload?.label??"":"";return n.jsxs("div",{className:"rounded-lg border bg-background p-2 shadow-sm",children:[n.jsx("div",{className:"mb-1.5 text-xs text-muted-foreground",children:_}),n.jsx("div",{className:"flex flex-col gap-1",children:[...M].sort(Wl).map(C=>{const P=String(C.dataKey??""),T=typeof C.value=="number"?C.value:0,$=typeof C.color=="string"?C.color:void 0;if(!T||T===0)return null;const D=b.find(B=>B.name===P),z=N.get(D?.connectionId||"");return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:$}}),n.jsx(ot,{icon:z?.icon||null,name:P,size:"xs",fallbackIcon:n.jsx(Dt,{}),className:"shrink-0"}),n.jsxs("span",{className:"text-xs text-muted-foreground",children:[P,":"]}),n.jsx("span",{className:"text-xs font-medium",children:Kl(T,r)})]},P)})})]})}}),b.map(I=>n.jsx(sn,{type:"monotone",dataKey:I.name,stroke:p.get(I.name),strokeWidth:2,animationDuration:200,dot:!1,activeDot:{r:4}},I.name))]})})})})}function Wl(t,e){const r=typeof t.value=="number"?t.value:0;return(typeof e.value=="number"?e.value:0)-r}function ql(t){return[t.id,t]}function Vl(){const t=ae.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t[0]=e):e=t[0];let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[e,n.jsx("div",{className:"flex items-center gap-2",children:Array.from({length:3}).map(Hl)})]}),t[1]=r):r=t[1];let a;return t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(St,{title:r,children:n.jsx("div",{className:"flex flex-col gap-2 w-full",children:n.jsx("div",{className:"h-[140px] w-full rounded bg-muted animate-pulse"})})}),t[2]=a):a=t[2],a}function Hl(t,e){return n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:"size-4 aspect-square rounded-md bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-16 rounded bg-muted animate-pulse"})]},e)}const Ft={Content:Fl,Skeleton:Vl};function Gl(t){const e=new Map;for(const a of t){if(!a.connectionId)continue;const i=e.get(a.connectionId)??{requests:0,errors:0,totalLatency:0};e.set(a.connectionId,{requests:i.requests+1,errors:i.errors+(a.isError?1:0),totalLatency:i.totalLatency+a.durationMs})}const r=new Map;for(const[a,i]of e)r.set(a,{connectionId:a,requests:i.requests,errors:i.errors,errorRate:i.requests>0?i.errors/i.requests*100:0,avgLatencyMs:i.requests>0?i.totalLatency/i.requests:0});return r}function st(t,e){return e==="requests"?t.requests:e==="errors"?t.errorRate:t.avgLatencyMs}function Wt(t){return t>=1e4?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`}function Ul(t,e){return e==="requests"?t.requests.toLocaleString():e==="errors"?`${t.errorRate.toFixed(1)}%`:Wt(t.avgLatencyMs)}const Zl=[{id:"calls",dataKey:"calls",colorNum:1,barColor:"bg-chart-1",leaderboardMode:"requests",chartMetrics:["calls"],renderTitle:t=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Tool Calls"}),n.jsx("p",{className:"text-sm md:text-lg font-medium",children:t.totalCalls.toLocaleString()})]}),getNextMetric:()=>"calls"},{id:"latency",dataKey:t=>t==="latency-avg"?"avg":"p95",colorNum:4,barColor:"bg-chart-4",leaderboardMode:"latency",chartMetrics:["latency-avg","latency-p95"],renderTitle:(t,e)=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Latency"}),n.jsxs("div",{className:"flex items-baseline gap-3",children:[n.jsxs("div",{className:we("pb-0.5",e==="latency-avg"?"border-b-2 border-chart-4":"border-b-2 border-transparent"),children:[n.jsx("span",{className:"text-sm md:text-lg font-medium",children:Wt(t.avgDurationMs)}),n.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"avg"})]}),n.jsxs("div",{className:we("pb-0.5",e==="latency-p95"?"border-b-2 border-chart-4":"border-b-2 border-transparent"),children:[n.jsx("span",{className:"text-sm md:text-lg font-medium",children:Wt(t.p95DurationMs)}),n.jsx("span",{className:"text-[10px] md:text-xs text-muted-foreground ml-1",children:"p95"})]})]})]}),getNextMetric:t=>t==="latency-avg"?"latency-p95":"latency-avg"},{id:"errors",dataKey:"errors",colorNum:3,barColor:"bg-chart-3",leaderboardMode:"errors",chartMetrics:["errors"],renderTitle:t=>n.jsxs("div",{className:"flex flex-col gap-0.5 md:gap-1",children:[n.jsx("p",{className:"text-xs md:text-sm text-muted-foreground",children:"Errors"}),n.jsx("p",{className:"text-sm md:text-lg font-medium",children:t.totalErrors.toLocaleString()})]}),getNextMetric:()=>"errors"}];function Yl(t){const e=ae.c(12),{logs:r,connections:a,mode:i,barColor:s}=t;let o,l,c;if(e[0]!==s||e[1]!==a||e[2]!==r||e[3]!==i){c=Symbol.for("react.early_return_sentinel");e:{const u=Gl(r),v=a??[];let f;e[7]!==i?(f=(g,b)=>st(b.metric,i)-st(g.metric,i),e[7]=i,e[8]=f):f=e[8];const x=v.map(g=>({connection:g,metric:u.get(g.id)})).filter(Xl).sort(f).slice(0,5),y=x[0]?.metric?st(x[0].metric,i):1;if(x.length===0){c=null;break e}o="space-y-1.5 mt-2",l=x.map(g=>{const{connection:b,metric:h}=g,p=st(h,i),j=y>0?Math.min(p/y*100,100):0;return n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(ot,{icon:b.icon,name:b.title,size:"xs",fallbackIcon:n.jsx(Dt,{}),className:"shrink-0 size-4! min-w-4!"}),n.jsx("span",{className:"text-[10px] text-foreground truncate min-w-0 w-20",children:b.title}),n.jsx("div",{className:"relative h-1.5 bg-muted/50 overflow-hidden flex-1",children:n.jsx("div",{className:we("h-full",s),style:{width:`${j}%`}})}),n.jsx("span",{className:"text-[10px] tabular-nums shrink-0 text-foreground",children:Ul(h,i)})]},b.id)})}e[0]=s,e[1]=a,e[2]=r,e[3]=i,e[4]=o,e[5]=l,e[6]=c}else o=e[4],l=e[5],c=e[6];if(c!==Symbol.for("react.early_return_sentinel"))return c;let d;return e[9]!==o||e[10]!==l?(d=n.jsx("div",{className:o,children:l}),e[9]=o,e[10]=l,e[11]=d):d=e[11],d}function Xl(t){return t.metric}function Ql(t){const e=ae.c(14),{displayDateRange:r,connectionIds:a,logs:i,total:s,connections:o,selectedMetric:l,onMetricSelect:c}=t;let d,u;if(e[0]!==i||e[1]!==a||e[2]!==o||e[3]!==r||e[4]!==c||e[5]!==l||e[6]!==s){let f=i;if(a.length>1){let g;e[9]!==a?(g=b=>a.includes(b.connectionId),e[9]=a,e[10]=g):g=e[10],f=f.filter(g)}const x=a.length>1?void 0:s,y=yl(f,r,void 0,x);d="grid grid-cols-3 gap-[0.5px] bg-border flex-shrink-0 border-b border-border",u=Zl.map(g=>{const{id:b,dataKey:h,colorNum:p,barColor:j,leaderboardMode:N,chartMetrics:O,renderTitle:w,getNextMetric:k}=g,S=O.includes(l),I=()=>{c(S?k(l):O[0])};return n.jsxs("div",{className:"bg-background relative cursor-pointer",onClick:I,children:[S&&n.jsx("div",{className:"absolute top-0 left-0 right-0 h-0.5 z-10",style:{backgroundColor:`var(--chart-${p})`}}),n.jsx(St,{title:w(y,l),children:n.jsxs("div",{className:"flex flex-col w-full",children:[n.jsx(jl,{data:y.data,dataKey:typeof h=="function"?h(l):h,colorNum:p,chartHeight:"h-[30px] md:h-[40px]"}),n.jsx(Yl,{logs:f,connections:o,mode:N,barColor:j})]})})]},b)}),e[0]=i,e[1]=a,e[2]=o,e[3]=r,e[4]=c,e[5]=l,e[6]=s,e[7]=d,e[8]=u}else d=e[7],u=e[8];let v;return e[11]!==d||e[12]!==u?(v=n.jsx("div",{className:d,children:u}),e[11]=d,e[12]=u,e[13]=v):v=e[13],v}const mn=Object.assign(Ql,{Skeleton:Nl}),Jl=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function ec({connectionIds:t,virtualMcpIds:e,tool:r,status:a,hideSystem:i,propertyFilters:s,connectionOptions:o,virtualMcpOptions:l,activeFiltersCount:c,onUpdateFilters:d}){const[u,v]=m.useState(!1),[f,x]=m.useState("raw"),[y,g]=m.useState(r),[b,h]=m.useState(s),[p,j]=m.useState(et(s)),N=m.useRef(r),O=m.useRef(Re(s));N.current!==r&&(N.current=r,y!==r&&g(r));const w=Re(s);O.current!==w&&(O.current=w,h(s),j(et(s)));const k=(C,P)=>{const T=[...b],$=T[C];$&&(T[C]={key:P.key??$.key,operator:P.operator??$.operator,value:P.value??$.value},h(T))},S=()=>{h([...b,{key:"",operator:"eq",value:""}])},I=C=>{const P=b.filter((T,$)=>$!==C);h(P),j(et(P)),d({propertyFilters:Re(P)})},E=()=>{d({propertyFilters:Re(b)})},M=()=>{const C=ar(p);h(C),d({propertyFilters:Re(C)})},_=()=>{if(f==="raw"){const C=ar(p);h(C),x("form")}else j(et(b)),x("raw")};return n.jsxs(Ba,{open:u,onOpenChange:v,children:[n.jsx(La,{asChild:!0,children:n.jsxs(ye,{variant:"outline",size:"sm",children:[n.jsx(js,{size:16}),"Filters",c>0&&n.jsx(lt,{variant:"default",className:"ml-1 h-5 w-5 rounded-full p-0 flex items-center justify-center text-xs",children:c})]})}),n.jsx($a,{align:"end",className:"w-[320px]",children:n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{children:n.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(Ms,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),n.jsx(Ts,{id:"hide-system-calls",checked:i,onCheckedChange:C=>d({hideSystem:!!C})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),n.jsx(aa,{options:o,defaultValue:t,onValueChange:C=>d({connectionId:C}),placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),n.jsx(aa,{options:l,defaultValue:e,onValueChange:C=>d({virtualMcpId:C}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),n.jsx(kt,{id:"filter-tool",placeholder:"Filter by tool...",value:y,onChange:C=>g(C.target.value),onBlur:()=>{y!==r&&d({tool:y})},onKeyDown:C=>{C.key==="Enter"&&y!==r&&d({tool:y})},className:"w-full"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),n.jsxs(mr,{value:a,onValueChange:C=>d({status:C}),children:[n.jsx(fr,{className:"w-full",children:n.jsx(pr,{})}),n.jsxs(vr,{children:[n.jsx(rt,{value:"all",children:"All Status"}),n.jsx(rt,{value:"success",children:"Success Only"}),n.jsx(rt,{value:"errors",children:"Errors Only"})]})]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),n.jsxs(Cs,{children:[n.jsx(As,{asChild:!0,children:n.jsx(ye,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:_,children:f==="raw"?n.jsx(ws,{size:14}):n.jsx(ys,{size:14})})}),n.jsx(Es,{children:f==="raw"?"Switch to form view":"Switch to raw text"})]})]}),f==="raw"?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx(ks,{placeholder:`Paste property filters here:
|
|
29
|
+
thread_id=abc123
|
|
30
|
+
user~test
|
|
31
|
+
debug?`,value:p,onChange:C=>j(C.target.value),onBlur:M,onKeyDown:C=>{C.key==="Enter"&&C.metaKey&&M()},className:"font-mono text-sm min-h-[80px] resize-none"}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["One per line:"," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key=value"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key~contains"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key@in_list"})," ",n.jsx("code",{className:"bg-muted px-1 rounded",children:"key?"})]})]}):n.jsxs("div",{className:"space-y-3",children:[b.map((C,P)=>n.jsxs("div",{className:"p-2.5 rounded-md border border-border bg-muted/30 space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("span",{className:"text-xs text-muted-foreground",children:["Filter ",P+1]}),n.jsx(ye,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>I(P),children:n.jsx(Da,{size:12})})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(kt,{placeholder:"Key (e.g., thread_id)",value:C.key,onChange:T=>k(P,{key:T.target.value}),onBlur:E,onKeyDown:T=>{T.key==="Enter"&&E()},className:"flex-1 font-mono text-sm"}),n.jsxs(mr,{value:C.operator,onValueChange:T=>{const $=[...b],D=$[P];D&&($[P]={...D,operator:T,value:T==="exists"?"":D.value},h($),d({propertyFilters:Re($)}))},children:[n.jsx(fr,{className:"w-28",children:n.jsx(pr,{})}),n.jsx(vr,{children:Jl.map(T=>n.jsx(rt,{value:T.value,children:T.label},T.value))})]})]}),C.operator!=="exists"&&n.jsx(kt,{placeholder:"Value",value:C.value,onChange:T=>k(P,{value:T.target.value}),onBlur:E,onKeyDown:T=>{T.key==="Enter"&&E()},className:"w-full font-mono text-sm"})]},P)),n.jsxs(ye,{variant:"outline",size:"sm",className:"w-full",onClick:S,children:[n.jsx(Ma,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),c>0&&n.jsx(ye,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{g(""),h([]),j(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),v(!1)},children:"Clear all filters"})]})})]})}function tc(t){const e=ae.c(17),{connectionIds:r,virtualMcpIds:a,tool:i,status:s,search:o,logs:l,hasMore:c,onLoadMore:d,isLoadingMore:u,connections:v,virtualMcps:f,membersData:x}=t,y=v??[],g=f??[];let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b=new Set,e[0]=b):b=e[0];const[h,p]=m.useState(b),j=Al(d,c,u),N=x?.data?.members??[],O=new Map(N.map(nc)),w=new Map(g.map(ac));let S=l.map(A=>{const L=O.get(A.userId??""),F=A.virtualMcpId?w.get(A.virtualMcpId):null;return{...A,userName:L?.name??A.userId??"Unknown",userImage:L?.image,virtualMcpName:F?.title??null}});if(r.length>1){let A;e[1]!==r?(A=L=>r.includes(L.connectionId),e[1]=r,e[2]=A):A=e[2],S=S.filter(A)}if(a.length>1){let A;e[3]!==a?(A=L=>L.virtualMcpId&&a.includes(L.virtualMcpId),e[3]=a,e[4]=A):A=e[4],S=S.filter(A)}if(o){const A=o.toLowerCase();S=S.filter(L=>L.toolName.toLowerCase().includes(A)||L.connectionTitle.toLowerCase().includes(A)||L.errorMessage?.toLowerCase().includes(A))}let I;e[5]===Symbol.for("react.memo_cache_sentinel")?(I=A=>{p(L=>{const F=new Set(L);return F.has(A.id)?F.delete(A.id):F.add(A.id),F})},e[5]=I):I=e[5];const E=I,M=new Map(y.map(rc));if(S.length===0){let A;e[6]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[6]=A):A=e[6];const L=o||r.length>0||a.length>0||i||s!=="all"?"No logs match your filters":"No logs found in this time range";let F;return e[7]!==L?(F=n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Ht,{image:A,title:"No logs found",description:L})}),e[7]=L,e[8]=F):F=e[8],F}const _="flex-1 flex flex-col overflow-hidden",C="flex-1 overflow-auto",P="min-w-[600px] md:min-w-0 bg-background",T=da,$="w-full border-collapse";let D;e[9]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx(ua,{className:"border-b-0 z-20",children:n.jsxs(Ge,{className:"h-9 hover:bg-transparent border-b border-border",children:[n.jsx(Q,{className:"w-10 md:w-12 px-2 md:px-4"}),n.jsx(Q,{className:"w-5"}),n.jsx(Q,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),n.jsx(Q,{className:"w-24 md:w-32 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),n.jsx(Q,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User Name"}),n.jsx(Q,{className:"w-20 md:w-24 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),n.jsx(Q,{className:"w-20 md:w-28 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Time"}),n.jsx(Q,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Latency"}),n.jsx(Q,{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]=D):D=e[9];const z=ca,B=S.map((A,L)=>n.jsx(hl,{log:A,isExpanded:h.has(A.id),connection:M.get(A.connectionId),virtualMcpName:A.virtualMcpName??"",onToggle:()=>E(A),lastLogRef:L===S.length-1?j:void 0},A.id));let K;e[10]!==z||e[11]!==B?(K=n.jsx(z,{children:B}),e[10]=z,e[11]=B,e[12]=K):K=e[12];let R;return e[13]!==T||e[14]!==D||e[15]!==K?(R=n.jsx("div",{className:_,children:n.jsx("div",{className:C,children:n.jsx("div",{className:P,children:n.jsxs(T,{className:$,children:[D,K]})})})}),e[13]=T,e[14]=D,e[15]=K,e[16]=R):R=e[16],R}function rc(t){return[t.id,t]}function ac(t){return[t.id,t]}function nc(t){return[t.userId,t.user]}function sc(){const t=ae.c(10);let e,r;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Q,{className:"w-10 md:w-12 px-2 md:px-4"}),r=n.jsx(Q,{className:"w-5"}),t[0]=e,t[1]=r):(e=t[0],r=t[1]);let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Q,{className:"pr-2 md:pr-4",children:n.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),t[2]=a):a=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(Q,{className:"w-24 md:w-32 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),t[3]=i):i=t[3];let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(Q,{className:"w-20 md:w-24 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t[4]=s):s=t[4];let o;t[5]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx(Q,{className:"w-20 md:w-24 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),t[5]=o):o=t[5];let l;t[6]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(Q,{className:"w-20 md:w-28 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),t[6]=l):l=t[6];let c;t[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(Q,{className:"w-16 md:w-20 px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t[7]=c):c=t[7];let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(ua,{className:"border-b-0 z-20",children:n.jsxs(Ge,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,a,i,s,o,l,c,n.jsx(Q,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:n.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),t[8]=d):d=t[8];let u;return t[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:n.jsx("div",{className:"flex-1 overflow-auto",children:n.jsx("div",{className:"min-w-[600px] md:min-w-0 bg-background",children:n.jsxs(da,{className:"w-full border-collapse",children:[d,n.jsx(ca,{children:Array.from({length:8}).map(ic)})]})})})}),t[9]=u):u=t[9],u}function ic(t,e){return n.jsxs(Ge,{className:"h-12 border-b border-border",children:[n.jsx("td",{className:"px-2 md:px-4",children:n.jsx("div",{className:"size-4 rounded bg-muted animate-pulse"})}),n.jsx("td",{children:n.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"pr-2 md:pr-4",children:n.jsxs("div",{className:"space-y-1",children:[n.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),n.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),n.jsx("td",{className:"px-2 md:px-3",children:n.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),n.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:n.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const fn=Object.assign(tc,{Skeleton:sc});function oc(t){const e=ae.c(95),{tab:r,dateRange:a,displayDateRange:i,connectionIds:s,virtualMcpIds:o,tool:l,status:c,search:d,streaming:u,hideSystem:v,activeFiltersCount:f,from:x,to:y,propertyFilters:g,onUpdateFilters:b,onTimeRangeChange:h,onStreamingToggle:p,onTabChange:j}=t,N=_a(),O=bs(),{data:w}=xs();let k;e[0]!==N?(k=N??[],e[0]=N,e[1]=k):k=e[1];let S;e[2]!==k?(S=k.map(dc),e[2]=k,e[3]=S):S=e[3];const I=S;let E;e[4]!==O?(E=O.map(cc),e[4]=O,e[5]=E):E=e[5];const M=E,{pageSize:_,streamingRefetchInterval:C}=Pn,{org:P,locator:T}=Ye();let $;e[6]!==P.id?($={connectionId:Yt,orgId:P.id},e[6]=P.id,e[7]=$):$=e[7];const D=Zt($);let z,B,K;if(e[8]!==s[0]||e[9]!==s.length||e[10]!==a.endDate||e[11]!==a.startDate||e[12]!==v||e[13]!==T||e[14]!==P.id||e[15]!==g||e[16]!==c||e[17]!==l||e[18]!==o[0]||e[19]!==o.length){const le=Nn(g),Be=v?[rs.SELF(P.id)]:void 0;z={startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:s.length===1?s[0]:void 0,excludeConnectionIds:Be,virtualMcpId:o.length===1?o[0]:void 0,toolName:l||void 0,isError:c==="errors"?!0:c==="success"?!1:void 0,...le},K=gs,B=it.monitoringLogsInfinite(T,JSON.stringify(z)),e[8]=s[0],e[9]=s.length,e[10]=a.endDate,e[11]=a.startDate,e[12]=v,e[13]=T,e[14]=P.id,e[15]=g,e[16]=c,e[17]=l,e[18]=o[0],e[19]=o.length,e[20]=z,e[21]=B,e[22]=K}else z=e[20],B=e[21],K=e[22];let R;e[23]!==z||e[24]!==D?(R=async le=>{const{pageParam:Be}=le,pn=Be===void 0?0:Be;if(!D)throw new Error("MCP client is not available");const tr=await D.callTool({name:"MONITORING_LOGS_LIST",arguments:{...z,limit:_,offset:pn}});return tr.structuredContent??tr},e[23]=z,e[24]=D,e[25]=R):R=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=(le,Be)=>{if(!((le?.logs?.length??0)<_))return Be.length*_},e[26]=A):A=e[26];const L=u?C:!1;let F;e[27]!==B||e[28]!==R||e[29]!==L?(F={queryKey:B,queryFn:R,initialPageParam:0,getNextPageParam:A,staleTime:0,refetchInterval:L},e[27]=B,e[28]=R,e[29]=L,e[30]=F):F=e[30];const{data:G,fetchNextPage:ne,hasNextPage:U,isFetchingNextPage:te}=K(F);let Z;e[31]!==G?.pages?(Z=G?.pages.flatMap(lc)??[],e[31]=G?.pages,e[32]=Z):Z=e[32];const re=Z,J=G?.pages[0]?.total;let Y;e[33]!==ne||e[34]!==U||e[35]!==te?(Y=()=>{U&&!te&&ne()},e[33]=ne,e[34]=U,e[35]=te,e[36]=Y):Y=e[36];const ie=Y,[X,ve]=m.useState("calls");let ee;e[37]!==i.startDate?(ee=i.startDate.toISOString(),e[37]=i.startDate,e[38]=ee):ee=e[38];let oe;e[39]!==i.endDate?(oe=i.endDate.toISOString(),e[39]=i.endDate,e[40]=oe):oe=e[40];let ue;e[41]!==ee||e[42]!==oe?(ue={startDate:ee,endDate:oe},e[41]=ee,e[42]=oe,e[43]=ue):ue=e[43];const je=ue;let W;e[44]===Symbol.for("react.memo_cache_sentinel")?(W={id:"overview",label:"Overview"},e[44]=W):W=e[44];let q;e[45]===Symbol.for("react.memo_cache_sentinel")?(q={id:"audit",label:"Audit"},e[45]=q):q=e[45];let me;e[46]===Symbol.for("react.memo_cache_sentinel")?(me=[W,q,{id:"dashboards",label:"Dashboards"}],e[46]=me):me=e[46];const qe=me;let Qe;e[47]===Symbol.for("react.memo_cache_sentinel")?(Qe=n.jsx(be.Header.Left,{children:n.jsx(sa,{children:n.jsx(ia,{children:n.jsx(oa,{children:n.jsx(la,{children:"Monitoring"})})})})}),e[47]=Qe):Qe=e[47];let Me;e[48]!==f||e[49]!==s||e[50]!==I||e[51]!==x||e[52]!==v||e[53]!==u||e[54]!==p||e[55]!==h||e[56]!==b||e[57]!==g||e[58]!==c||e[59]!==r||e[60]!==y||e[61]!==l||e[62]!==o||e[63]!==M?(Me=(r==="overview"||r==="audit")&&n.jsx(be.Header.Right,{children:n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsx(ec,{connectionIds:s,virtualMcpIds:o,tool:l,status:c,hideSystem:v,propertyFilters:g,connectionOptions:I,virtualMcpOptions:M,activeFiltersCount:f,onUpdateFilters:b}),n.jsxs(ye,{variant:u?"secondary":"outline",size:"sm",className:we("h-7 px-2 sm:px-3 gap-1.5",u&&"bg-muted hover:bg-muted/80"),onClick:p,children:[u?n.jsx(za,{size:16,className:"animate-pulse"}):n.jsx(Ka,{size:16}),n.jsx("span",{className:"hidden sm:inline",children:u?"Streaming":"Stream"})]}),n.jsx(On,{value:{from:x,to:y},onChange:h})]})}),e[48]=f,e[49]=s,e[50]=I,e[51]=x,e[52]=v,e[53]=u,e[54]=p,e[55]=h,e[56]=b,e[57]=g,e[58]=c,e[59]=r,e[60]=y,e[61]=l,e[62]=o,e[63]=M,e[64]=Me):Me=e[64];let De;e[65]!==Me?(De=n.jsxs(be.Header,{children:[Qe,Me]}),e[65]=Me,e[66]=De):De=e[66];let _e;e[67]!==j?(_e=le=>j(le),e[67]=j,e[68]=_e):_e=e[68];let Le;e[69]!==_e||e[70]!==r?(Le=n.jsx("div",{className:"px-5 py-3 border-b border-border",children:n.jsx(Ra,{tabs:qe,activeTab:r,onTabChange:_e})}),e[69]=_e,e[70]=r,e[71]=Le):Le=e[71];let $e;e[72]!==N||e[73]!==re||e[74]!==O||e[75]!==je||e[76]!==s||e[77]!==i||e[78]!==ie||e[79]!==U||e[80]!==te||e[81]!==w||e[82]!==b||e[83]!==d||e[84]!==c||e[85]!==r||e[86]!==l||e[87]!==X||e[88]!==J||e[89]!==o?($e=r==="dashboards"?n.jsx(Cl,{}):r==="audit"?n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx(yn,{value:d,onChange:le=>b({search:le}),placeholder:"Search by tool name, connection, or error...",className:"border-t",onKeyDown:le=>{le.key==="Escape"&&(b({search:""}),le.target.blur())}}),n.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:n.jsx(fn,{connectionIds:s,virtualMcpIds:o,tool:l,status:c,search:d,logs:re,hasMore:U??!1,onLoadMore:ie,isLoadingMore:te,connections:N,virtualMcps:O,membersData:w})})]}):n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx("div",{className:"border-b border-border relative z-10",children:n.jsx(qt,{fallback:null,children:n.jsx(m.Suspense,{fallback:n.jsx(Ft.Skeleton,{}),children:n.jsx(Ft.Content,{metricsMode:X,dateRange:je})})})}),n.jsx(mn,{displayDateRange:i,connectionIds:s,logs:re,total:J,connections:N,selectedMetric:X,onMetricSelect:ve})]}),e[72]=N,e[73]=re,e[74]=O,e[75]=je,e[76]=s,e[77]=i,e[78]=ie,e[79]=U,e[80]=te,e[81]=w,e[82]=b,e[83]=d,e[84]=c,e[85]=r,e[86]=l,e[87]=X,e[88]=J,e[89]=o,e[90]=$e):$e=e[90];let Je;return e[91]!==De||e[92]!==Le||e[93]!==$e?(Je=n.jsxs(n.Fragment,{children:[De,Le,$e]}),e[91]=De,e[92]=Le,e[93]=$e,e[94]=Je):Je=e[94],Je}function lc(t){return t?.logs??[]}function cc(t){return{value:t.id??"",label:t.title??"Decopilot"}}function dc(t){return{value:t.id,label:t.title||t.id}}function xd(){const t=ae.c(81),{org:e}=Ye(),r=Vt();let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/$project/monitoring"},t[0]=a):a=t[0];const i=bn(a),{tab:s,from:o,to:l,connectionId:c,virtualMcpId:d,tool:u,search:v,status:f,streaming:x,propertyFilters:y,hideSystem:g}=i,b=s===void 0?"overview":s;let h;t[1]!==c?(h=c===void 0?[]:c,t[1]=c,t[2]=h):h=t[2];const p=h;let j;t[3]!==d?(j=d===void 0?[]:d,t[3]=d,t[4]=j):j=t[4];const N=j,O=x===void 0?!0:x,w=y===void 0?"":y,k=g===void 0?!1:g;let S,I,E,M,_,C,P;if(t[5]!==p.length||t[6]!==o||t[7]!==k||t[8]!==r||t[9]!==e.slug||t[10]!==w||t[11]!==i||t[12]!==f||t[13]!==O||t[14]!==l||t[15]!==u||t[16]!==N.length){_=wn(w);let Z;t[24]!==r||t[25]!==e.slug||t[26]!==i?(Z=X=>{r({to:"/$org/$project/monitoring",params:{org:e.slug,project:na},search:{...i,...X}})},t[24]=r,t[25]=e.slug,t[26]=i,t[27]=Z):Z=t[27],P=Z;let re;t[28]!==P?(re=X=>{P({from:X.from,to:X.to})},t[28]=P,t[29]=re):re=t[29],M=re;let J,Y;if(t[30]!==o||t[31]!==O||t[32]!==l){const X=rr(o),ve=rr(l);Y=X.date||new Date(Date.now()-18e5);const ee=ve.date||new Date;E={startDate:Y,endDate:ee},J=ee,O&&l==="now"&&(J=new Date(ee),J.setHours(J.getHours()+1)),t[30]=o,t[31]=O,t[32]=l,t[33]=E,t[34]=J,t[35]=Y}else E=t[33],J=t[34],Y=t[35];let ie;t[36]!==J||t[37]!==Y?(ie={startDate:Y,endDate:J},t[36]=J,t[37]=Y,t[38]=ie):ie=t[38],I=ie,S=0,p.length>0&&S++,N.length>0&&S++,u&&S++,f!=="all"&&S++,k&&S++,C=_.filter(uc),t[5]=p.length,t[6]=o,t[7]=k,t[8]=r,t[9]=e.slug,t[10]=w,t[11]=i,t[12]=f,t[13]=O,t[14]=l,t[15]=u,t[16]=N.length,t[17]=S,t[18]=I,t[19]=E,t[20]=M,t[21]=_,t[22]=C,t[23]=P}else S=t[17],I=t[18],E=t[19],M=t[20],_=t[21],C=t[22],P=t[23];const T=C;T.length>0&&(S=S+T.length);let $;t[39]===Symbol.for("react.memo_cache_sentinel")?($=n.jsx(be.Header,{children:n.jsx(be.Header.Left,{children:n.jsx("h1",{className:"text-sm font-medium text-foreground",children:"Monitoring"})})}),t[39]=$):$=t[39];let D;t[40]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-[0.5px] bg-border shrink-0 border-b",children:n.jsx("div",{className:"bg-background p-5 text-sm text-muted-foreground",children:"Failed to load monitoring data"})}),t[40]=D):D=t[40];let z;t[41]===Symbol.for("react.memo_cache_sentinel")?(z=n.jsxs(n.Fragment,{children:[$,n.jsx(be.Content,{children:n.jsxs("div",{className:"flex flex-col overflow-auto md:overflow-hidden h-full",children:[D,n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx(Ht,{title:"Failed to load logs",description:"There was an error loading the monitoring data. Please try again."})})]})})]}),t[41]=z):z=t[41];let B;t[42]===Symbol.for("react.memo_cache_sentinel")?(B=n.jsx(be.Header,{children:n.jsx(be.Header.Left,{children:n.jsx(sa,{children:n.jsx(ia,{children:n.jsx(oa,{children:n.jsx(la,{children:"Monitoring"})})})})})}),t[42]=B):B=t[42];let K;t[43]===Symbol.for("react.memo_cache_sentinel")?(K=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"dashboards",label:"Dashboards"}],t[43]=K):K=t[43];let R;t[44]!==P?(R=Z=>P({tab:Z}),t[44]=P,t[45]=R):R=t[45];let A;t[46]!==R||t[47]!==b?(A=n.jsx("div",{className:"px-5 py-3 border-b border-border",children:n.jsx(Ra,{tabs:K,activeTab:b,onTabChange:R})}),t[46]=R,t[47]=b,t[48]=A):A=t[48];let L;t[49]!==b?(L=b==="audit"?n.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:n.jsx(fn.Skeleton,{})}):b==="dashboards"?n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-muted-foreground",children:"Loading dashboards..."})}):n.jsxs("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:[n.jsx("div",{className:"border-b border-border",children:n.jsx(Ft.Skeleton,{})}),n.jsx(mn.Skeleton,{})]}),t[49]=b,t[50]=L):L=t[50];let F;t[51]!==A||t[52]!==L?(F=n.jsxs(n.Fragment,{children:[B,A,L]}),t[51]=A,t[52]=L,t[53]=F):F=t[53];let G;t[54]!==O||t[55]!==P?(G=()=>P({streaming:!O}),t[54]=O,t[55]=P,t[56]=G):G=t[56];let ne;t[57]!==P?(ne=Z=>P({tab:Z}),t[57]=P,t[58]=ne):ne=t[58];let U;t[59]!==S||t[60]!==p||t[61]!==I||t[62]!==E||t[63]!==o||t[64]!==M||t[65]!==k||t[66]!==_||t[67]!==v||t[68]!==f||t[69]!==O||t[70]!==G||t[71]!==ne||t[72]!==b||t[73]!==l||t[74]!==u||t[75]!==P||t[76]!==N?(U=n.jsx(oc,{tab:b,dateRange:I,displayDateRange:E,connectionIds:p,virtualMcpIds:N,tool:u,status:f,search:v,streaming:O,hideSystem:k,activeFiltersCount:S,from:o,to:l,propertyFilters:_,onUpdateFilters:P,onTimeRangeChange:M,onStreamingToggle:G,onTabChange:ne}),t[59]=S,t[60]=p,t[61]=I,t[62]=E,t[63]=o,t[64]=M,t[65]=k,t[66]=_,t[67]=v,t[68]=f,t[69]=O,t[70]=G,t[71]=ne,t[72]=b,t[73]=l,t[74]=u,t[75]=P,t[76]=N,t[77]=U):U=t[77];let te;return t[78]!==F||t[79]!==U?(te=n.jsx(be,{children:n.jsx(qt,{fallback:z,children:n.jsx(m.Suspense,{fallback:F,children:U})})}),t[78]=F,t[79]=U,t[80]=te):te=t[80],te}function uc(t){return t.key.trim()}export{xd as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as C,c as we,g as Be,j as t,a4 as Fe,E as Te,u as Ee,w as Me,v as Re,K as ve,at as ze,B as re,x as pe}from"./index-DOB_rN4F.js";import{b as Oe}from"./use-connection-isYpENLt.js";import{u as $e,a as Ae}from"./constants-Dj_jISYh.js";import{I as le}from"./input-B8SGuTQM.js";import{I as ke}from"./integration-icon-V4Ha2c0J.js";import{C as We}from"./checkbox-B-bMpUYn.js";import{a as Le,b as Ve,P as Ue}from"./popover-BtdPJ3nC.js";import{i as Ge}from"./AlignLeft-BAoWjJLP.js";import{t as Ie}from"./ChevronDown-BpPBzMeM.js";import{S as je,a as be,b as ye,c as Ne,d as w,n as Ke}from"./select-DFqqm67w.js";import{s as qe}from"./Hash02-uuIbzxX_.js";import{i as He}from"./Play-BS-YE1aJ.js";import{s as Qe}from"./Plus-6jiO8ZBC.js";import{s as Je}from"./Trash01-BJfk29r7.js";import{T as Ye,a as Se}from"./toggle-group-DXK9X2m5.js";import{a as Ze,V as Xe}from"./layout-BEks5Ck0.js";import{S as et}from"./save-actions-DM1jGhRL.js";import{B as tt,a as st,b as Pe,d as rt,e as lt,c as at}from"./breadcrumb-Vup1mlRL.js";import"./use-collections-BtaiT5_F.js";import"./useMutation-BzhmYOfa.js";import"./Container-DfhSnqz2.js";import"./Check-C-l3bofu.js";import"./index-cBL8sUXN.js";import"./index-fsM5-qBd.js";import"./localstorage-keys-Bk5zpQvC.js";import"./useQuery-peW8y0zk.js";import"./tooltip-BgKT8ibK.js";import"./Save01-CJOg2A57.js";import"./Loading01-DIEH7Z5_.js";import"./ChevronRight-Bcq8irGN.js";const _e=({size:l=24,color:e="currentColor",...s})=>C.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},C.createElement("path",{d:"M8 15v2m4-6v6m4-10v10m-8.2 4h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21Z"}));_e.displayName="BarChartSquare02";function De(l){return{id:l.id,name:l.name,type:l.type,sourcePath:l.source.path,sourceFrom:l.source.from,aggregationFn:l.aggregation.fn,groupBy:l.aggregation.groupBy||"",interval:l.aggregation.interval||""}}function it(l){return{id:l.id,name:l.name,type:l.type,source:{path:l.sourcePath,from:l.sourceFrom},aggregation:{fn:l.aggregationFn,groupBy:l.type==="table"&&l.groupBy?l.groupBy:void 0,interval:l.type==="timeseries"&&l.interval?l.interval:void 0}}}const Ce={id:crypto.randomUUID(),name:"",type:"metric",sourcePath:"$.usage.total_tokens",sourceFrom:"output",aggregationFn:"sum",groupBy:"",interval:""};function nt(l){const e=we.c(36),{result:s,widget:o}=l;if(s.error){let i;return e[0]!==s.error?(i=t.jsx("div",{className:"text-sm text-destructive bg-destructive/10 rounded p-3",children:s.error}),e[0]=s.error,e[1]=i):i=e[1],i}if(o.type==="metric"){const i=s.value??0;let d;e[2]!==i?(d=i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:typeof i=="number"?i.toFixed(2):String(i),e[2]=i,e[3]=d):d=e[3];const c=d;let m;e[4]!==c?(m=t.jsx("div",{className:"text-3xl font-bold tabular-nums",children:c}),e[4]=c,e[5]=m):m=e[5];const x=s.matchedRecords??0;let h;e[6]!==x?(h=t.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[x," records matched"]}),e[6]=x,e[7]=h):h=e[7];let f;return e[8]!==m||e[9]!==h?(f=t.jsxs("div",{className:"text-center py-4",children:[m,h]}),e[8]=m,e[9]=h,e[10]=f):f=e[10],f}if(o.type==="table"&&s.groups){let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("thead",{className:"bg-muted/50 sticky top-0",children:t.jsxs("tr",{children:[t.jsx("th",{className:"text-left px-3 py-1.5 text-xs font-medium",children:"Key"}),t.jsx("th",{className:"text-right px-3 py-1.5 text-xs font-medium",children:"Value"})]})}),e[11]=i):i=e[11];let d;e[12]!==s.groups?(d=s.groups.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:2,className:"px-3 py-4 text-center text-muted-foreground text-xs",children:"No data"})}):s.groups.slice(0,10).map(ct),e[12]=s.groups,e[13]=d):d=e[13];let c;e[14]!==d?(c=t.jsxs("table",{className:"w-full text-sm",children:[i,t.jsx("tbody",{children:d})]}),e[14]=d,e[15]=c):c=e[15];let m;e[16]!==s.groups.length?(m=s.groups.length>10&&t.jsxs("div",{className:"text-xs text-muted-foreground text-center py-2",children:["+",s.groups.length-10," more rows"]}),e[16]=s.groups.length,e[17]=m):m=e[17];let x;return e[18]!==c||e[19]!==m?(x=t.jsxs("div",{className:"max-h-[200px] overflow-auto",children:[c,m]}),e[18]=c,e[19]=m,e[20]=x):x=e[20],x}if(o.type==="timeseries"&&s.timeseries){let i;e[21]!==s.timeseries?(i=Math.max(...s.timeseries.map(ot),1),e[21]=s.timeseries,e[22]=i):i=e[22];const d=i;let c;if(e[23]!==d||e[24]!==s.timeseries){let f;e[26]!==d?(f=(u,N)=>t.jsx("div",{className:"flex-1 bg-primary/80 rounded-t",style:{height:`${u.value/d*100}%`,minHeight:u.value>0?"2px":"0px"},title:`${new Date(u.timestamp).toLocaleString()}: ${u.value}`},N),e[26]=d,e[27]=f):f=e[27],c=s.timeseries.slice(-24).map(f),e[23]=d,e[24]=s.timeseries,e[25]=c}else c=e[25];let m;e[28]!==c?(m=t.jsx("div",{className:"flex items-end gap-0.5 h-[80px]",children:c}),e[28]=c,e[29]=m):m=e[29];let x;e[30]!==s.timeseries.length?(x=t.jsxs("div",{className:"text-xs text-muted-foreground text-center mt-2",children:[s.timeseries.length," data points"]}),e[30]=s.timeseries.length,e[31]=x):x=e[31];let h;return e[32]!==m||e[33]!==x?(h=t.jsxs("div",{className:"py-2",children:[m,x]}),e[32]=m,e[33]=x,e[34]=h):h=e[34],h}let j;return e[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"No preview data"}),e[35]=j):j=e[35],j}function ot(l){return l.value}function ct(l,e){return t.jsxs("tr",{className:"border-t",children:[t.jsx("td",{className:"px-3 py-1.5 font-mono text-xs",children:l.key}),t.jsx("td",{className:"px-3 py-1.5 text-right tabular-nums text-xs",children:l.value.toLocaleString()})]},e)}function mt(l){const e=we.c(113),{widget:s,onChange:o,onRemove:j,canRemove:i,onMoveUp:d,onMoveDown:c,canMoveUp:m,canMoveDown:x,onPreview:h,previewResult:f,isPreviewing:u}=l,N=!m;let z;e[0]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(Ke,{size:14}),e[0]=z):z=e[0];let D;e[1]!==d||e[2]!==N?(D=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:d,disabled:N,children:z}),e[1]=d,e[2]=N,e[3]=D):D=e[3];const ae=!x;let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ie,{size:14}),e[4]=g):g=e[4];let p;e[5]!==c||e[6]!==ae?(p=t.jsx(re,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:c,disabled:ae,children:g}),e[5]=c,e[6]=ae,e[7]=p):p=e[7];let k;e[8]!==D||e[9]!==p?(k=t.jsxs("div",{className:"flex items-center gap-0.5",children:[D,p]}),e[8]=D,e[9]=p,e[10]=k):k=e[10];let S;e[11]!==s.type?(S=t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s.type}),e[11]=s.type,e[12]=S):S=e[12];let F;e[13]!==s.name?(F=s.name&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-muted-foreground",children:"·"}),t.jsx("span",{className:"text-sm font-medium",children:s.name})]}),e[13]=s.name,e[14]=F):F=e[14];let _;e[15]!==k||e[16]!==S||e[17]!==F?(_=t.jsxs("div",{className:"flex items-center gap-2",children:[k,S,F]}),e[15]=k,e[16]=S,e[17]=F,e[18]=_):_=e[18];let P;e[19]!==u?(P=u?t.jsx(Fe,{size:14,className:"animate-spin"}):t.jsx(He,{size:14}),e[19]=u,e[20]=P):P=e[20];let B;e[21]!==u||e[22]!==h||e[23]!==P?(B=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:h,disabled:u,children:P}),e[21]=u,e[22]=h,e[23]=P,e[24]=B):B=e[24];const O=!i,ie=i?"visible":"hidden";let T;e[25]!==ie?(T={visibility:ie},e[25]=ie,e[26]=T):T=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Je,{size:14}),e[27]=$):$=e[27];let E;e[28]!==j||e[29]!==O||e[30]!==T?(E=t.jsx(re,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:O,style:T,children:$}),e[28]=j,e[29]=O,e[30]=T,e[31]=E):E=e[31];let M;e[32]!==B||e[33]!==E?(M=t.jsxs("div",{className:"flex items-center gap-1",children:[B,E]}),e[32]=B,e[33]=E,e[34]=M):M=e[34];let R;e[35]!==_||e[36]!==M?(R=t.jsxs("div",{className:"flex items-center justify-between px-4 h-11 border-b bg-muted/30",children:[_,M]}),e[35]=_,e[36]=M,e[37]=R):R=e[37];let r;e[38]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Widget Name"}),e[38]=r):r=e[38];let a;e[39]!==o||e[40]!==s?(a=b=>o({...s,name:b.target.value}),e[39]=o,e[40]=s,e[41]=a):a=e[41];let n;e[42]!==a||e[43]!==s.name?(n=t.jsxs("div",{children:[r,t.jsx(le,{placeholder:"e.g., Total Tokens",value:s.name,onChange:a})]}),e[42]=a,e[43]=s.name,e[44]=n):n=e[44];let v;e[45]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Type"}),e[45]=v):v=e[45];let y;e[46]!==o||e[47]!==s?(y=b=>{b&&o({...s,type:b,groupBy:b==="table"?s.groupBy:"",interval:b==="timeseries"?s.interval||"1h":""})},e[46]=o,e[47]=s,e[48]=y):y=e[48];let I;e[49]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(Se,{value:"metric",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Metric",children:t.jsx(qe,{size:14})}),e[49]=I):I=e[49];let A;e[50]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Se,{value:"timeseries",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Timeseries",children:t.jsx(_e,{size:14})}),e[50]=A):A=e[50];let ne;e[51]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx(Se,{value:"table",className:"flex-1 h-full data-[state=on]:!bg-accent/70","aria-label":"Table",children:t.jsx(Ge,{size:14})}),e[51]=ne):ne=e[51];let W;e[52]!==y||e[53]!==s.type?(W=t.jsxs("div",{children:[v,t.jsxs(Ye,{type:"single",variant:"outline",size:"sm",value:s.type,onValueChange:y,className:"w-full h-10",children:[I,A,ne]})]}),e[52]=y,e[53]=s.type,e[54]=W):W=e[54];let L;e[55]!==n||e[56]!==W?(L=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n,W]}),e[55]=n,e[56]=W,e[57]=L):L=e[57];let oe;e[58]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"JSONPath Expression"}),e[58]=oe):oe=e[58];let V;e[59]!==o||e[60]!==s?(V=b=>o({...s,sourcePath:b.target.value}),e[59]=o,e[60]=s,e[61]=V):V=e[61];let U;e[62]!==V||e[63]!==s.sourcePath?(U=t.jsx(le,{placeholder:"$.usage.total_tokens",value:s.sourcePath,onChange:V,className:"font-mono text-sm"}),e[62]=V,e[63]=s.sourcePath,e[64]=U):U=e[64];let G;e[65]!==s.sourceFrom?(G=t.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path to extract from tool call ",s.sourceFrom]}),e[65]=s.sourceFrom,e[66]=G):G=e[66];let K;e[67]!==U||e[68]!==G?(K=t.jsxs("div",{children:[oe,U,G]}),e[67]=U,e[68]=G,e[69]=K):K=e[69];let ce;e[70]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Extract From"}),e[70]=ce):ce=e[70];let q;e[71]!==o||e[72]!==s?(q=b=>o({...s,sourceFrom:b}),e[71]=o,e[72]=s,e[73]=q):q=e[73];let me;e[74]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx(be,{children:t.jsx(ye,{})}),e[74]=me):me=e[74];let de;e[75]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsxs(Ne,{children:[t.jsx(w,{value:"output",children:"Output"}),t.jsx(w,{value:"input",children:"Input"})]}),e[75]=de):de=e[75];let H;e[76]!==q||e[77]!==s.sourceFrom?(H=t.jsxs("div",{children:[ce,t.jsxs(je,{value:s.sourceFrom,onValueChange:q,children:[me,de]})]}),e[76]=q,e[77]=s.sourceFrom,e[78]=H):H=e[78];let ue;e[79]===Symbol.for("react.memo_cache_sentinel")?(ue=t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Aggregation"}),e[79]=ue):ue=e[79];let Q;e[80]!==o||e[81]!==s?(Q=b=>o({...s,aggregationFn:b}),e[80]=o,e[81]=s,e[82]=Q):Q=e[82];let xe;e[83]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx(be,{children:t.jsx(ye,{})}),e[83]=xe):xe=e[83];let he;e[84]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsxs(Ne,{children:[t.jsx(w,{value:"sum",children:"Sum"}),t.jsx(w,{value:"avg",children:"Average"}),t.jsx(w,{value:"min",children:"Minimum"}),t.jsx(w,{value:"max",children:"Maximum"}),t.jsx(w,{value:"count",children:"Count"}),t.jsx(w,{value:"last",children:"Last"})]}),e[84]=he):he=e[84];let J;e[85]!==Q||e[86]!==s.aggregationFn?(J=t.jsxs("div",{children:[ue,t.jsxs(je,{value:s.aggregationFn,onValueChange:Q,children:[xe,he]})]}),e[85]=Q,e[86]=s.aggregationFn,e[87]=J):J=e[87];let Y;e[88]!==H||e[89]!==J?(Y=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[H,J]}),e[88]=H,e[89]=J,e[90]=Y):Y=e[90];let Z;e[91]!==o||e[92]!==s?(Z=s.type==="table"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Group By (JSONPath)"}),t.jsx(le,{placeholder:"$.model",value:s.groupBy,onChange:b=>o({...s,groupBy:b.target.value}),className:"font-mono text-sm"})]}),e[91]=o,e[92]=s,e[93]=Z):Z=e[93];let X;e[94]!==o||e[95]!==s?(X=s.type==="timeseries"&&t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Time Interval"}),t.jsxs(je,{value:s.interval||"1h",onValueChange:b=>o({...s,interval:b}),children:[t.jsx(be,{children:t.jsx(ye,{})}),t.jsxs(Ne,{children:[t.jsx(w,{value:"15m",children:"15 minutes"}),t.jsx(w,{value:"1h",children:"1 hour"}),t.jsx(w,{value:"1d",children:"1 day"})]})]})]}),e[94]=o,e[95]=s,e[96]=X):X=e[96];let ee;e[97]!==L||e[98]!==K||e[99]!==Y||e[100]!==Z||e[101]!==X?(ee=t.jsxs("div",{className:"space-y-4",children:[L,K,Y,Z,X]}),e[97]=L,e[98]=K,e[99]=Y,e[100]=Z,e[101]=X,e[102]=ee):ee=e[102];let fe;e[103]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("div",{className:"px-3 py-2 border-b text-xs font-medium text-muted-foreground",children:"Preview (last 24h)"}),e[103]=fe):fe=e[103];let te;e[104]!==f||e[105]!==s?(te=t.jsxs("div",{className:"border rounded-lg bg-muted/20 flex flex-col",children:[fe,t.jsx("div",{className:"p-3 flex-1 flex items-center justify-center",children:f?t.jsx(nt,{result:f,widget:s}):t.jsx("div",{className:"text-sm text-muted-foreground text-center",children:'Click "Preview" to test your aggregation'})})]}),e[104]=f,e[105]=s,e[106]=te):te=e[106];let se;e[107]!==ee||e[108]!==te?(se=t.jsx("div",{className:"p-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[ee,te]})}),e[107]=ee,e[108]=te,e[109]=se):se=e[109];let ge;return e[110]!==R||e[111]!==se?(ge=t.jsxs("div",{className:"border rounded-lg bg-card overflow-hidden",children:[R,se]}),e[110]=R,e[111]=se,e[112]=ge):ge=e[112],ge}function dt({dashboardId:l}){const{org:e,project:s,locator:o}=Ee(),j=Me(),i=$e({connectionId:Ae,orgId:e.id}),d=Oe(),{data:c}=Re({queryKey:ve.monitoringDashboardDetails(o,l),queryFn:async()=>{if(!i)throw new Error("MCP client not available");const r=await i.callTool({name:"MONITORING_DASHBOARD_GET",arguments:{id:l}});return r.structuredContent??r}}),[m,x]=C.useState(c?.name??""),[h,f]=C.useState(c?.description??""),[u,N]=C.useState(c?.widgets?.map(De)??[{...Ce}]),[z,D]=C.useState(!1),[ae,g]=C.useState(!1),[p,k]=C.useState(c?.filters?.connectionIds??[]),[S,F]=C.useState(c?.filters?.toolNames?.[0]??""),[_,P]=C.useState({}),[B,O]=C.useState(new Set),ie=()=>{N([...u,{...Ce,id:crypto.randomUUID()}]),g(!0)},T=r=>{N(u.filter((a,n)=>n!==r)),g(!0)},$=(r,a)=>{const n=[...u];n[r]=a,N(n),g(!0),P(v=>{const y={...v};return delete y[a.id],y})},E=async r=>{if(i){O(a=>new Set(a).add(r.id));try{const a=new Date,n=new Date(a.getTime()-1440*60*1e3),v={};p.length>0&&(v.connectionIds=p),S.trim()&&(v.toolNames=[S.trim()]);const I=(await i.callTool({name:"MONITORING_WIDGET_PREVIEW",arguments:{widget:{type:r.type,source:{path:r.sourcePath,from:r.sourceFrom},aggregation:{fn:r.aggregationFn,groupBy:r.type==="table"&&r.groupBy?r.groupBy:void 0,interval:r.type==="timeseries"&&r.interval?r.interval:void 0},filter:Object.keys(v).length>0?v:void 0},timeRange:{startDate:n.toISOString(),endDate:a.toISOString()}}})).structuredContent;P(A=>({...A,[r.id]:{value:I?.value,groups:I?.groups,timeseries:I?.timeseries,matchedRecords:I?.matchedRecords??0}}))}catch(a){console.error("Preview failed:",a),P(n=>({...n,[r.id]:{error:"Preview failed. Check your JSONPath expression."}}))}finally{O(a=>{const n=new Set(a);return n.delete(r.id),n})}}},M=async()=>{if(i){if(!m.trim()){pe.error("Please enter a dashboard name");return}if(u.some(r=>!r.name.trim())){pe.error("Please enter a name for all widgets");return}D(!0);try{const r={};p.length>0&&(r.connectionIds=p),S.trim()&&(r.toolNames=[S.trim()]),await i.callTool({name:"MONITORING_DASHBOARD_UPDATE",arguments:{id:l,name:m.trim(),description:h.trim()||null,filters:Object.keys(r).length>0?r:null,widgets:u.map(it)}}),pe.success("Dashboard saved"),g(!1),j.invalidateQueries({queryKey:ve.monitoringDashboards(o)}),j.invalidateQueries({queryKey:ve.monitoringDashboardDetails(o,l)})}catch(r){pe.error("Failed to save dashboard"),console.error(r)}finally{D(!1)}}};if(!c)return t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Dashboard not found"});const R=t.jsx(tt,{children:t.jsxs(st,{children:[t.jsx(Pe,{children:t.jsx(rt,{asChild:!0,children:t.jsx(ze,{to:"/$org/$project/monitoring",params:{org:e.slug,project:s.slug},search:{tab:"dashboards"},children:"Monitoring"})})}),t.jsx(lt,{}),t.jsx(Pe,{children:t.jsxs(at,{children:["Edit ",c.name]})})]})});return t.jsxs(Ze,{breadcrumb:R,children:[t.jsx(Xe,{children:t.jsx(et,{onSave:M,onUndo:()=>{x(c?.name??""),f(c?.description??""),N(c?.widgets?.map(De)??[{...Ce}]),k(c?.filters?.connectionIds??[]),F(c?.filters?.toolNames?.[0]??""),g(!1)},isDirty:ae,isSaving:z})}),t.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:t.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Dashboard Name"}),t.jsx(le,{placeholder:"e.g., LLM Usage Overview",value:m,onChange:r=>{x(r.target.value),g(!0)}})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Description"}),t.jsx(le,{placeholder:"What does this dashboard show?",value:h,onChange:r=>{f(r.target.value),g(!0)}})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 bg-muted/30",children:[t.jsxs("h2",{className:"text-sm font-medium mb-3",children:["Dashboard Filters",t.jsx("span",{className:"text-muted-foreground font-normal ml-2",children:"(applied to all widgets)"})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Servers"}),t.jsxs(Le,{children:[t.jsx(Ve,{asChild:!0,children:t.jsxs(re,{variant:"outline",className:"w-full justify-between font-normal",children:[t.jsx("span",{className:"flex items-center gap-2 truncate",children:p.length===0?t.jsx("span",{className:"text-muted-foreground",children:"All servers"}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex items-center -space-x-1",children:p.slice(0,3).map(r=>{const a=(d??[]).find(n=>n.id===r);return a?t.jsx(ke,{icon:a.icon,name:a.title||a.id,size:"xs"},r):null})}),t.jsxs("span",{children:[p.length," server",p.length!==1?"s":""]})]})}),t.jsx(Ie,{size:14,className:"text-muted-foreground shrink-0"})]})}),t.jsxs(Ue,{align:"start",className:"w-72 p-1",children:[t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:(d??[]).map(r=>{const a=p.includes(r.id);return t.jsxs("button",{type:"button",className:"flex items-center gap-3 w-full rounded-md px-2 py-2 text-sm hover:bg-muted transition-colors",onClick:()=>{k(n=>a?n.filter(v=>v!==r.id):[...n,r.id]),g(!0)},children:[t.jsx(We,{checked:a}),t.jsx(ke,{icon:r.icon,name:r.title||r.id,size:"xs"}),t.jsx("span",{className:"truncate",children:r.title||r.id})]},r.id)})}),p.length>0&&t.jsx("div",{className:"border-t p-1",children:t.jsx("button",{type:"button",className:"w-full text-xs text-muted-foreground hover:text-foreground py-1.5 transition-colors",onClick:()=>{k([]),g(!0)},children:"Clear selection"})})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm font-medium block mb-1.5",children:"Tool Name Filter"}),t.jsx(le,{placeholder:"e.g., openai_chat",value:S,onChange:r=>{F(r.target.value),g(!0)},className:"font-mono text-sm"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Filter to specific tool names (partial match)"})]})]})]}),t.jsxs("div",{className:"mt-12",children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Widgets"}),t.jsxs(re,{variant:"outline",size:"sm",onClick:ie,children:[t.jsx(Qe,{size:14,className:"mr-1.5"}),"Add Widget"]})]}),t.jsx("div",{className:"space-y-4",children:u.map((r,a)=>t.jsx(mt,{widget:r,onChange:n=>$(a,n),onRemove:()=>T(a),canRemove:u.length>1,onMoveUp:()=>{const n=[...u],v=n[a-1],y=n[a];n[a-1]=y,n[a]=v,N(n),g(!0)},onMoveDown:()=>{const n=[...u],v=n[a],y=n[a+1];n[a]=y,n[a+1]=v,N(n),g(!0)},canMoveUp:a>0,canMoveDown:a<u.length-1,onPreview:()=>E(r),previewResult:_[r.id]??null,isPreviewing:B.has(r.id)},r.id))})]})]})})]})}function Lt(){const l=we.c(5);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},l[0]=e):e=l[0];const{dashboardId:s}=Be(e);let o;l[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Failed to load dashboard editor"}),l[1]=o):o=l[1];let j;l[2]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(Fe,{size:24,className:"animate-spin text-muted-foreground"})}),l[2]=j):j=l[2];let i;return l[3]!==s?(i=t.jsx(Te,{fallback:o,children:t.jsx(C.Suspense,{fallback:j,children:t.jsx(dt,{dashboardId:s})})}),l[3]=s,l[4]=i):i=l[4],i}export{Lt as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as $,j as t,B as R,c as D,w as xe,a4 as re,E as ge,u as fe,v as ne,K as oe,at as pe,g as he,e as je}from"./index-DOB_rN4F.js";import{a as be,u as ye}from"./constants-Dj_jISYh.js";import{p as ee,a as ce,s as ve,b as Ne,e as me,T as we}from"./time-range-picker-BOerMnsf.js";import{i as ke}from"./Edit05-CVYO506c.js";import{V as Se,a as Ce}from"./layout-BEks5Ck0.js";import{b as de,c as $e,d as Fe,e as Re,B as De,a as Te}from"./breadcrumb-Vup1mlRL.js";import{B as _e}from"./badge-CD6BO54l.js";import{I as ue}from"./input-B8SGuTQM.js";import{a as Pe,b as Ie,P as Me}from"./popover-BtdPJ3nC.js";import{S as ze,a as Be,b as Ee,c as Oe,d as Ae}from"./select-DFqqm67w.js";import{T as Ke}from"./textarea-CeRaW_Yp.js";import{T as Le,a as Ve,b as qe}from"./tooltip-BgKT8ibK.js";import{i as Qe}from"./Code01-Cs4VK4vB.js";import{i as We}from"./FilterLines-wbfkcsV6.js";import{c as Ge}from"./Grid01-BLFAr7r2.js";import{s as He}from"./Plus-6jiO8ZBC.js";import{s as Ye}from"./Trash01-BJfk29r7.js";import{s as Ue}from"./XClose-_SUO6WNY.js";import"./Check-C-l3bofu.js";import"./Copy01-DO2wEvaR.js";import"./Download01-Cflyuz7y.js";import"./Key01-BoUAxj2a.js";import"./Play-BS-YE1aJ.js";import"./monaco-editor-B-Q9hJgq.js";import"./spinner-C6Zm3ycN.js";import"./scroll-area-BVEebdGP.js";import"./ChevronDown-BpPBzMeM.js";import"./Clock-COzVVCOL.js";import"./ChevronLeft-GX7d8CR0.js";import"./ChevronRight-Bcq8irGN.js";import"./index-fsM5-qBd.js";import"./localstorage-keys-Bk5zpQvC.js";import"./useQuery-peW8y0zk.js";import"./useMutation-BzhmYOfa.js";import"./index-cBL8sUXN.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]=$.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(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:
|
|
2
|
+
thread_id=abc123
|
|
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(F=>F.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: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 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($e,{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]!==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 Qt(){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{Qt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r,j as e,h as n}from"./index-DOB_rN4F.js";import{i as l}from"./Loading01-DIEH7Z5_.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as g,c as b,j as s,z as L,E as Z,u as G,f as K,B as U}from"./index-DOB_rN4F.js";import{V as J,C as h}from"./index-DO-nwdDW.js";import{E as Q,C as X}from"./editable-task-title-GlTaj-Dg.js";import{a as Y}from"./tasks-panel-DGPiBlOG.js";import{u as B,a as ee}from"./context-YskDy6K-.js";import{I as O}from"./integration-icon-V4Ha2c0J.js";import{b as te,P as se,a as ie}from"./popover-BtdPJ3nC.js";import{S as H}from"./skeleton-CJ_JeJdS.js";import{i as re,d as le}from"./constants-Dj_jISYh.js";import{b as oe}from"./use-virtual-mcp-DIu7xjww.js";import{i as ne}from"./ChevronRight-Bcq8irGN.js";import{t as F}from"./Users03-By3xPyKu.js";import{P}from"./index-fsM5-qBd.js";import{R as A,a as T,b as ae}from"./resizable-CqFPe8y6.js";import"./spinner-C6Zm3ycN.js";import"./tooltip-BgKT8ibK.js";import"./index-cBL8sUXN.js";import"./use-mcp-prompts-CZ1OCHIM.js";import"./useQuery-peW8y0zk.js";import"./dialog-DptuG_cr.js";import"./X-CUBSBnfW.js";import"./form-CMUDPBm_.js";import"./label-B6fF1rpb.js";import"./input-B8SGuTQM.js";import"./usage-B8eRkRZY.js";import"./ArrowUp-D2NkC4ab.js";import"./ChevronDown-BpPBzMeM.js";import"./Edit01-DNHTcM62.js";import"./Lock01-BImR4r91.js";import"./XCircle-BXSJdo4M.js";import"./AlertCircle-26BTIquA.js";import"./select-DFqqm67w.js";import"./Check-C-l3bofu.js";import"./use-preferences-I5g32f8W.js";import"./localstorage-keys-Bk5zpQvC.js";import"./useMutation-BzhmYOfa.js";import"./ArrowLeft-DWje-uhw.js";import"./use-copy-Bu52OFim.js";import"./tabs-BOq2itjh.js";import"./badge-CD6BO54l.js";import"./collapsible-BqLGfdnv.js";import"./Code01-Cs4VK4vB.js";import"./SearchMd-DueTE2Za.js";import"./use-create-virtual-mcp-BFlErPKY.js";import"./decopilot-events-CYZOyosB.js";import"./Copy01-DO2wEvaR.js";import"./marked.esm-BaswSlok.js";import"./markdown-DpsxaV39.js";import"./mcp-app-renderer-BWBfvCfZ.js";import"./types-DoC5J5ss.js";import"./Eye-B6nj5379.js";import"./Globe02-Cg-Z7cLo.js";import"./LayersTwo01-C0YKG0Ut.js";import"./XClose-_SUO6WNY.js";import"./collection-search-BLa1FSgc.js";import"./Loading01-DIEH7Z5_.js";import"./use-connection-isYpENLt.js";import"./use-collections-BtaiT5_F.js";import"./generate-id-Dyweu44Y.js";import"./Clock-COzVVCOL.js";import"./Trash01-BJfk29r7.js";import"./CheckCircle-CZM8ZVML.js";import"./ChevronLeft-GX7d8CR0.js";import"./user-Be2ccajU.js";import"./avatar-VlWNUAOT.js";import"./format-time-CMKyl-GC.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./Plus-6jiO8ZBC.js";import"./dropdown-menu-BOG7ABoQ.js";import"./use-llm-BL3lTNZs.js";import"./use-binding-ClT1c3nb.js";import"./binder-QSDeS-7I.js";import"./checkbox-B-bMpUYn.js";import"./AlignLeft-BAoWjJLP.js";import"./Image01-Vfr2TPcb.js";import"./RefreshCcw01-Bd7NliRG.js";import"./Settings01-CAa6kxIP.js";import"./useSuspenseInfiniteQuery-R_Y3Vcn3.js";import"./infiniteQueryObserver-cWt_xaLS.js";import"./Container-DfhSnqz2.js";const W=({size:e=24,color:t="currentColor",...i})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},g.createElement("path",{d:"M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));W.displayName="LayoutRight";const q=({size:e=24,color:t="currentColor",...i})=>g.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i},g.createElement("path",{d:"m10 15-3.075 3.114c-.43.434-.644.651-.828.666a.5.5 0 0 1-.421-.172c-.12-.14-.12-.446-.12-1.056v-1.56c0-.548-.449-.944-.99-1.024v0a3 3 0 0 1-2.534-2.533C2 12.219 2 11.96 2 11.445V6.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C4.28 2 5.12 2 6.8 2h7.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C19 4.28 19 5.12 19 6.8V11m0 11-2.176-1.513c-.306-.213-.46-.32-.626-.395a2.002 2.002 0 0 0-.462-.145c-.18-.033-.367-.033-.74-.033H13.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C10 18.394 10 17.834 10 16.714V14.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C11.52 11 12.08 11 13.2 11h5.6c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 12.52 22 13.08 22 14.2v2.714c0 .932 0 1.398-.152 1.766a2 2 0 0 1-1.083 1.082c-.367.152-.833.152-1.765.152V22Z"}));q.displayName="MessageChatSquare";function ce(e){const t=b.c(15),{agent:i}=e,{setVirtualMcpId:u}=B();let c;t[0]!==i.id||t[1]!==u?(c=()=>{u(i.id)},t[0]=i.id,t[1]=u,t[2]=c):c=t[2];const l=c;let m;t[3]===Symbol.for("react.memo_cache_sentinel")?(m=L("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[3]=m):m=t[3];const f=`Select agent ${i.title}`;let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(F,{size:20}),t[4]=o):o=t[4];let n;t[5]!==i.icon||t[6]!==i.title?(n=s.jsx(O,{icon:i.icon,name:i.title,fallbackIcon:o}),t[5]=i.icon,t[6]=i.title,t[7]=n):n=t[7];let r;t[8]!==i.title?(r=s.jsx("p",{className:"text-sm text-foreground text-center leading-tight line-clamp-2",children:i.title}),t[8]=i.title,t[9]=r):r=t[9];let a;return t[10]!==l||t[11]!==f||t[12]!==n||t[13]!==r?(a=s.jsxs("button",{type:"button",onClick:l,className:m,"aria-label":f,children:[n,r]}),t[10]=l,t[11]=f,t[12]=n,t[13]=r,t[14]=a):a=t[14],a}function me(e){const t=b.c(14),{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:c}=e,[l,m]=g.useState(!1),f=g.useRef(null);let o,n;t[0]!==l?(o=()=>{l&&setTimeout(()=>{f.current?.focus()},0)},n=[l],t[0]=l,t[1]=o,t[2]=n):(o=t[1],n=t[2]),g.useEffect(o,n);let r;t[3]!==c?(r=N=>{c(N),m(!1)},t[3]=c,t[4]=r):r=t[4];const a=r;let d;t[5]===Symbol.for("react.memo_cache_sentinel")?(d=L("flex flex-col items-center gap-3 p-2 rounded-lg","transition-colors hover:bg-accent/30","cursor-pointer","self-stretch"),t[5]=d):d=t[5];let p;t[6]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(te,{asChild:!0,children:s.jsxs("button",{type:"button",className:d,"aria-label":"See all agents",children:[s.jsx("div",{className:"size-12 rounded-lg bg-accent flex items-center justify-center shrink-0",children:s.jsx(ne,{size:24,className:"text-foreground"})}),s.jsx("p",{className:"text-sm text-foreground text-center leading-tight",children:"See all"})]})}),t[6]=p):p=t[6];let x;t[7]!==a||t[8]!==u||t[9]!==i?(x=s.jsx(se,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:s.jsx(J,{virtualMcps:i,selectedVirtualMcpId:u,onVirtualMcpChange:a,searchInputRef:f})}),t[7]=a,t[8]=u,t[9]=i,t[10]=x):x=t[10];let V;return t[11]!==l||t[12]!==x?(V=s.jsxs(ie,{open:l,onOpenChange:m,children:[p,x]}),t[11]=l,t[12]=x,t[13]=V):V=t[13],V}function de(){const e=b.c(20),t=oe(),{selectedVirtualMcp:i,setVirtualMcpId:u}=B();let c,l,m,f,o,n;if(e[0]!==t){o=Symbol.for("react.early_return_sentinel");e:{const x=t.filter(ue).slice(0,6);if(x.length===0){o=null;break e}n=t.map(pe),m="w-full max-w-[800px]",e[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx("h2",{className:"text-sm font-medium text-muted-foreground mb-4",children:"Recently used agents"}),e[7]=f):f=e[7],c="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",l=x.map(fe)}e[0]=t,e[1]=c,e[2]=l,e[3]=m,e[4]=f,e[5]=o,e[6]=n}else c=e[1],l=e[2],m=e[3],f=e[4],o=e[5],n=e[6];if(o!==Symbol.for("react.early_return_sentinel"))return o;const r=i?.id??null;let a;e[8]!==u||e[9]!==r||e[10]!==n?(a=s.jsx(me,{virtualMcps:n,selectedVirtualMcpId:r,onVirtualMcpChange:u}),e[8]=u,e[9]=r,e[10]=n,e[11]=a):a=e[11];let d;e[12]!==c||e[13]!==l||e[14]!==a?(d=s.jsxs("div",{className:c,children:[l,a]}),e[12]=c,e[13]=l,e[14]=a,e[15]=d):d=e[15];let p;return e[16]!==m||e[17]!==f||e[18]!==d?(p=s.jsxs("div",{className:m,children:[f,d]}),e[16]=m,e[17]=f,e[18]=d,e[19]=p):p=e[19],p}function fe(e){return s.jsx(ce,{agent:e},e.id??"default")}function pe(e){return{id:e.id,title:e.title,description:e.description,icon:e.icon}}function ue(e){return e.id!==null&&!re(e.id)}function xe(){const e=b.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(H,{className:"h-5 w-40 mb-4"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsxs("div",{className:"w-full max-w-[800px]",children:[t,s.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-7 gap-2",children:Array.from({length:7}).map(he)})]}),e[1]=i):i=e[1],i}function he(e,t){return s.jsxs("div",{className:"flex flex-col items-center gap-3 p-2 self-stretch",children:[s.jsx(H,{className:"size-6 rounded-md shrink-0"}),s.jsx(H,{className:"h-4 w-full"})]},t)}function ge(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(g.Suspense,{fallback:s.jsx(xe,{}),children:s.jsx(de,{})}),e[0]=t):t=e[0],t}function je(){const e=b.c(40),{org:t}=G(),{data:i}=K.useSession(),{modelsConnections:u,isChatEmpty:c,activeTaskId:l,tasks:m,selectedVirtualMcp:f}=ee();let o;if(e[0]!==l||e[1]!==m){let j;e[3]!==l?(j=D=>D.id===l,e[3]=l,e[4]=j):j=e[4],o=m.find(j),e[0]=l,e[1]=m,e[2]=o}else o=e[2];const n=o,[r,a]=g.useState(!1);let d;e[5]!==i?.user?.name?(d=i?.user?.name?.split(" ")[0]||"there",e[5]=i?.user?.name,e[6]=d):d=e[6];const p=d;let x;e[7]!==t.id?(x=le(t.id),e[7]=t.id,e[8]=x):x=e[8];const N=f??x;if(u.length===0){let j;return e[9]!==t?(j=s.jsx("div",{className:"flex flex-col h-full bg-background items-center justify-center",children:s.jsx(h.NoLlmBindingEmptyState,{org:t})}),e[9]=t,e[10]=j):j=e[10],j}let E,I;e[11]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx(A,{defaultSize:20,minSize:10,id:"tasks",order:1,children:s.jsx(Y,{})}),I=s.jsx(T,{className:"bg-border/30"}),e[11]=E,e[12]=I):(E=e[11],I=e[12]);const $=r?50:80;let C;e[13]!==n?(C=n?.title&&s.jsx(Q,{taskId:n.id,text:n.title,className:"text-sm font-medium text-foreground"}),e[13]=n,e[14]=C):C=e[14];let v;e[15]!==C?(v=s.jsx(P.Header.Left,{className:"gap-2",children:C}),e[15]=C,e[16]=v):v=e[16];let y;e[17]!==c||e[18]!==r?(y=!c&&s.jsx("button",{type:"button",onClick:()=>a(be),className:L("flex size-7 items-center justify-center rounded-md border border-input hover:bg-accent transition-colors",r&&"bg-accent"),title:"Toggle context panel",children:s.jsx(W,{size:14,className:"text-muted-foreground"})}),e[17]=c,e[18]=r,e[19]=y):y=e[19];let S;e[20]!==y?(S=s.jsx(P.Header.Right,{className:"gap-1",children:y}),e[20]=y,e[21]=S):S=e[21];let k;e[22]!==v||e[23]!==S?(k=s.jsxs(P.Header,{className:"flex-none z-10 bg-background",children:[v,S]}),e[22]=v,e[23]=S,e[24]=k):k=e[24];let _;e[25]!==N||e[26]!==c||e[27]!==p?(_=c?s.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center px-10 pb-32 pt-10",children:[s.jsxs("div",{className:"flex flex-col items-center w-full max-w-[600px]",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(O,{icon:N.icon,name:N.title,size:"md",fallbackIcon:s.jsx(F,{size:20}),className:"size-12 rounded-xl border border-stone-200/60 shadow-sm aspect-square transition-opacity duration-200"})}),s.jsx("div",{className:"text-center mb-8",children:s.jsxs("p",{className:"text-xl font-medium text-foreground",children:["What's on your mind, ",p,"?"]})}),s.jsx("div",{className:"w-full",children:s.jsx(h.Input,{})}),s.jsx(h.IceBreakers,{className:"w-full"})]}),s.jsx("div",{className:"flex flex-col items-center w-full mt-4",children:s.jsx(ge,{})})]}):s.jsxs(s.Fragment,{children:[s.jsx(h.Main,{children:s.jsx(h.Messages,{})}),s.jsx(h.Footer,{children:s.jsx(h.Input,{onOpenContextPanel:()=>a(!0)})})]}),e[25]=N,e[26]=c,e[27]=p,e[28]=_):_=e[28];let w;e[29]!==k||e[30]!==_?(w=s.jsxs(h,{className:"h-full bg-background",children:[k,_]}),e[29]=k,e[30]=_,e[31]=w):w=e[31];let z;e[32]!==w||e[33]!==$?(z=s.jsx(A,{defaultSize:$,minSize:30,id:"main",order:2,children:w}),e[32]=w,e[33]=$,e[34]=z):z=e[34];let M;e[35]!==r?(M=r&&s.jsxs(s.Fragment,{children:[s.jsx(T,{className:"bg-border/30"}),s.jsx(A,{defaultSize:30,minSize:15,id:"context",order:3,children:s.jsx(X,{onClose:()=>a(!1)})})]}),e[35]=r,e[36]=M):M=e[36];let R;return e[37]!==z||e[38]!==M?(R=s.jsxs(ae,{direction:"horizontal",className:"size-full",children:[E,I,z,M]}),e[37]=z,e[38]=M,e[39]=R):R=e[39],R}function be(e){return!e}function Ne(e){const t=b.c(14),{error:i,onRetry:u}=e,c=i?.message?.includes("401")||i?.message?.toLowerCase().includes("unauthorized");let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(P.Header,{className:"flex-none",children:[s.jsx(P.Header.Left,{className:"gap-2"}),s.jsx(P.Header.Right,{className:"gap-1"})]}),t[0]=l):l=t[0];let m;t[1]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx("div",{className:"bg-destructive/10 p-3 rounded-full mx-auto w-fit",children:s.jsx(q,{className:"h-6 w-6 text-destructive"})}),t[1]=m):m=t[1];const f=c?"Unable to load models":"Something went wrong";let o;t[2]!==f?(o=s.jsx("h3",{className:"text-lg font-medium",children:f}),t[2]=f,t[3]=o):o=t[3];const n=c?"There was an authentication error while loading the models. This might be due to an expired session or invalid API key.":i?.message||"An unexpected error occurred";let r;t[4]!==n?(r=s.jsx("p",{className:"text-sm text-muted-foreground",children:n}),t[4]=n,t[5]=r):r=t[5];let a;t[6]!==o||t[7]!==r?(a=s.jsxs("div",{className:"space-y-2",children:[o,r]}),t[6]=o,t[7]=r,t[8]=a):a=t[8];let d;t[9]!==u?(d=s.jsx(U,{variant:"outline",onClick:u,children:"Try again"}),t[9]=u,t[10]=d):d=t[10];let p;return t[11]!==a||t[12]!==d?(p=s.jsxs(h,{children:[l,s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center",children:s.jsxs("div",{className:"max-w-sm space-y-4",children:[m,a,d]})})]}),t[11]=a,t[12]=d,t[13]=p):p=t[13],p}function Kt(){const e=b.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(Z,{fallback:Ce,children:s.jsx(g.Suspense,{fallback:s.jsx(h.Skeleton,{}),children:s.jsx(je,{})})}),e[0]=t):t=e[0],t}function Ce(e){const{error:t,resetError:i}=e;return s.jsx(Ne,{error:t,onRetry:i})}export{Kt as default};
|