decocms 3.89.3 → 3.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-NC3dB7os.js → AlertCircle-eL7jEjpx.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-D9dn8W9B.js → ArrowUpRight-BtZv9HXz.js} +1 -1
- package/dist/client/assets/{CheckCircle-4xU28_ze.js → CheckCircle-Ce4sW5Fr.js} +1 -1
- package/dist/client/assets/{ChevronDown-4vfFBrpS.js → ChevronDown-8-SpQ5a6.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CCAFk4Lh.js → ChevronLeft-DQ6Y033o.js} +1 -1
- package/dist/client/assets/{ChevronRight-BSaK-g_n.js → ChevronRight-C7AnVgNL.js} +1 -1
- package/dist/client/assets/{ChevronUp-CIoJSXpm.js → ChevronUp-hzSQl57_.js} +1 -1
- package/dist/client/assets/{DotsVertical-DXhOiROl.js → DotsVertical-CBCiPEnd.js} +1 -1
- package/dist/client/assets/{Eye-BcF7vo02.js → Eye-Du8USWUC.js} +1 -1
- package/dist/client/assets/{FilterLines-CyP0eiMt.js → FilterLines-D51fKry2.js} +1 -1
- package/dist/client/assets/{Globe01-cpwm3ZU4.js → Globe01-ByUFNYZ1.js} +1 -1
- package/dist/client/assets/{Globe04-DdU789Mf.js → Globe04-BnUIZrLZ.js} +1 -1
- package/dist/client/assets/{HardDrive-8lyy5Dp-.js → HardDrive-OrjxQFg1.js} +1 -1
- package/dist/client/assets/{Key01-C3jXuyTV.js → Key01-CI_-yaVv.js} +1 -1
- package/dist/client/assets/{LayoutLeft-BA3GeXV2.js → LayoutLeft-DnqAFiqW.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dc9R-z7y.js → LinkExternal01-C9plWUCQ.js} +1 -1
- package/dist/client/assets/{Monitor01-4eRzNp1q.js → Monitor01-Cx6UPY56.js} +1 -1
- package/dist/client/assets/{Palette-DziwArEq.js → Palette-DxYtHeiN.js} +1 -1
- package/dist/client/assets/{Play-BTFQj3qh.js → Play-Bpofg5MS.js} +1 -1
- package/dist/client/assets/{Plus-pFzKRSyH.js → Plus-B6Bp27KE.js} +1 -1
- package/dist/client/assets/{SearchMd-BiaNZC1b.js → SearchMd-DY2IStnr.js} +1 -1
- package/dist/client/assets/{Settings02-Bvzlcm1U.js → Settings02-CzDpZT_t.js} +1 -1
- package/dist/client/assets/{Shield01-CtXmxEJK.js → Shield01-ByoQOTwe.js} +1 -1
- package/dist/client/assets/{Star01-B2kdQndt.js → Star01-COmcJPAd.js} +1 -1
- package/dist/client/assets/{Stars01-C_5LYi93.js → Stars01-DjTb55Tj.js} +1 -1
- package/dist/client/assets/{Stars02-i3gYlhXk.js → Stars02-B4L_1USv.js} +1 -1
- package/dist/client/assets/{Sun-CoqE3qoL.js → Sun-BrBndJzL.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CPEaTyhx.js → SwitchHorizontal01-COrtT0WP.js} +1 -1
- package/dist/client/assets/{Tool01-BmUpgiVH.js → Tool01-D9Z3ra2m.js} +1 -1
- package/dist/client/assets/{Trash01-B2-9vQgJ.js → Trash01-S_d8yXYH.js} +1 -1
- package/dist/client/assets/{Upload01-FAxCvObz.js → Upload01-BovBQGIq.js} +1 -1
- package/dist/client/assets/{User01-C1HCSK6y.js → User01-Dcns6QTI.js} +1 -1
- package/dist/client/assets/{Users01-D0cghbTw.js → Users01-Dua8TttV.js} +1 -1
- package/dist/client/assets/{Users03-vYWz866I.js → Users03-DTBaxDUb.js} +1 -1
- package/dist/client/assets/{X-DVenJxl2.js → X-ClFhIPPx.js} +1 -1
- package/dist/client/assets/{XCircle-DkV5O0gt.js → XCircle-ZlnM-le2.js} +1 -1
- package/dist/client/assets/{XClose-1aztqZN5.js → XClose-Cr1-H9ci.js} +1 -1
- package/dist/client/assets/{Zap-CxBpS0TW.js → Zap-TPho1Yix.js} +1 -1
- package/dist/client/assets/{ZapSquare-BupPfcYG.js → ZapSquare-Brn6J5mG.js} +1 -1
- package/dist/client/assets/{ZoomOut-DXDDUqzg.js → ZoomOut-BkeollDv.js} +1 -1
- package/dist/client/assets/{access-gate-DJ3w7Rqa.js → access-gate-FCkKFtCU.js} +1 -1
- package/dist/client/assets/{add-section-modal-B_FGzKHG.js → add-section-modal-CP8OZAs0.js} +1 -1
- package/dist/client/assets/{agent-icon-B9Rg96af.js → agent-icon-B6eCx9D1.js} +1 -1
- package/dist/client/assets/{agents-list-BpBQ33-8.js → agents-list-CoW11iHc.js} +1 -1
- package/dist/client/assets/ai-providers-DZvST0-1.js +1 -0
- package/dist/client/assets/{alert-DBActzOw.js → alert-DG7kpTTq.js} +1 -1
- package/dist/client/assets/{alert-dialog-TZS2F66y.js → alert-dialog-DCN5JdMo.js} +3 -3
- package/dist/client/assets/app-editor-Cslki56N.js +1 -0
- package/dist/client/assets/{auth-B2SyT5jq.js → auth-B9FveTwh.js} +1 -1
- package/dist/client/assets/{auth-catchall-jfA3V8jK.js → auth-catchall-c1PPJXlb.js} +1 -1
- package/dist/client/assets/{auth-entry-CzM_DcXD.js → auth-entry-_nOUFp_x.js} +1 -1
- package/dist/client/assets/{auth-split-layout-D8jZEv56.js → auth-split-layout-DqH6c0k8.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-ugENWEdg.js → authenticate-and-persist-oauth-DiMpH9Hf.js} +1 -1
- package/dist/client/assets/{automation-list-row-RaQMgsZa.js → automation-list-row-D6X7gs0k.js} +1 -1
- package/dist/client/assets/{automation-runs-DEnZLNcv.js → automation-runs-B9slN7zB.js} +1 -1
- package/dist/client/assets/automations-DgNLJXiB.js +1 -0
- package/dist/client/assets/{avatar-Cz89OzST.js → avatar-CMukQvh7.js} +1 -1
- package/dist/client/assets/{badge-DemqTgjN.js → badge-BkyT3WoL.js} +1 -1
- package/dist/client/assets/{block-document-DnpmRre2.js → block-document-DuE6VWLI.js} +1 -1
- package/dist/client/assets/{brand-context-44FYoRF-.js → brand-context--ofWuplm.js} +1 -1
- package/dist/client/assets/buckets-YjT6-1gl.js +1 -0
- package/dist/client/assets/{capability-load-error-CD0k_ZBV.js → capability-load-error-b3EGpgG0.js} +1 -1
- package/dist/client/assets/{card-DWocPikY.js → card-Bs3t5A2h.js} +1 -1
- package/dist/client/assets/category-editor-CEjlWNxU.js +1 -0
- package/dist/client/assets/{chat-context-bLbsqSUE.js → chat-context-DueHVvJY.js} +5 -5
- package/dist/client/assets/{checkbox-DmyBqpG7.js → checkbox-LHoIUSFR.js} +1 -1
- package/dist/client/assets/{cli-auth-success-g1RYvQjB.js → cli-auth-success-ML14RiWT.js} +1 -1
- package/dist/client/assets/collection-detail-ibjdpE0q.js +1 -0
- package/dist/client/assets/{collection-display-button-CmYy5ol1.js → collection-display-button-Drrg41_3.js} +1 -1
- package/dist/client/assets/{collection-search-JyQFyghK.js → collection-search-CgpTu-Mz.js} +1 -1
- package/dist/client/assets/{collection-tabs-LMEfLwWZ.js → collection-tabs-C8hplLSb.js} +1 -1
- package/dist/client/assets/command-BQdrUZdP.js +1 -0
- package/dist/client/assets/commerce-onboarding-D1XLRejF.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-dXosml16.js → connect-desktop-dialog-XNmCdvVO.js} +1 -1
- package/dist/client/assets/{connection-card-DoMs787B.js → connection-card-DFgMcv0g.js} +1 -1
- package/dist/client/assets/connection-detail-D4rMC3p5.js +1 -0
- package/dist/client/assets/{connection-form-helpers-Dm__G9wh.js → connection-form-helpers-BehaoK99.js} +1 -1
- package/dist/client/assets/connections-EApUiHUb.js +1 -0
- package/dist/client/assets/{context-menu-B93bMgay.js → context-menu-BrlUfyhd.js} +1 -1
- package/dist/client/assets/{decopilot-4k7KQSVX.js → decopilot-2OorXRZy.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BEKDdVOU.js → decopilot-sse-pool-BTlcRVcA.js} +1 -1
- package/dist/client/assets/{dialog-BbHIKIUS.js → dialog-DGm31nBN.js} +1 -1
- package/dist/client/assets/{domain-settings-PpBMgUMH.js → domain-settings-CdtyE8KM.js} +1 -1
- package/dist/client/assets/{drawer-kr03m1vm.js → drawer-DdWdZjEE.js} +1 -1
- package/dist/client/assets/{dropdown-menu-vGHmo9fD.js → dropdown-menu-BLOjaXD3.js} +1 -1
- package/dist/client/assets/{empty-state-B4c8fq4i.js → empty-state-DVp61Buk.js} +1 -1
- package/dist/client/assets/{extract-connection-data-D9jcQvie.js → extract-connection-data-D_bB-ShD.js} +1 -1
- package/dist/client/assets/file-explorer-vaSlSqZW.js +2 -0
- package/dist/client/assets/{file-type-icon-DO4mmgEl.js → file-type-icon-BCa6hDuH.js} +1 -1
- package/dist/client/assets/{files-DSkQRfS7.js → files-DQb9-lnV.js} +1 -1
- package/dist/client/assets/{form-BtzyQGYU.js → form-B5xe8o6u.js} +1 -1
- package/dist/client/assets/general-ydE7PYML.js +1 -0
- package/dist/client/assets/{github-repo-picker-BR4lmXmU.js → github-repo-picker-8IaQB8YW.js} +1 -1
- package/dist/client/assets/{hooks-DlrZPw8A.js → hooks-DpQFLCh_.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-DCkFh2H5.js → import-from-deco-dialog-CRv9nGz3.js} +1 -1
- package/dist/client/assets/{index-BbMa6I-9.js → index-B6YHm6is.js} +2 -2
- package/dist/client/assets/index-BCPspZww.js +1 -0
- package/dist/client/assets/{index-BHKcN4cC.js → index-BOJe9uwl.js} +1 -1
- package/dist/client/assets/{index-DasNl4Yd.js → index-BRdqVONz.js} +1 -1
- package/dist/client/assets/{index-ZjRHn464.js → index-BtAPhKbE.js} +1 -1
- package/dist/client/assets/{index-JuJHr8Il.js → index-CRPVmS_G.js} +1 -1
- package/dist/client/assets/index-CS7neKAN.js +26 -0
- package/dist/client/assets/{index-B37Lpv5S.js → index-CZQAHCWx.js} +4 -4
- package/dist/client/assets/index-CthwRpPw.js +1 -0
- package/dist/client/assets/{index-CAIYCRJp.js → index-CuxqDMpm.js} +1 -1
- package/dist/client/assets/index-DRv0VWsh.js +1 -0
- package/dist/client/assets/{index-DeXSnTz7.js → index-EMcMxAnt.js} +2 -2
- package/dist/client/assets/{index-yU2r0Gdy.js → index-hv1cpMXB.js} +10 -10
- package/dist/client/assets/{index-redirect-c7PIBlRk.js → index-redirect-Q0F80k5-.js} +1 -1
- package/dist/client/assets/{index-BqVMogvA.js → index-w238AwGD.js} +1 -1
- package/dist/client/assets/{input-D3OR9wlV.js → input-Bnf6c030.js} +1 -1
- package/dist/client/assets/{integration-icon-DtONHt_d.js → integration-icon-BZb9eAa5.js} +1 -1
- package/dist/client/assets/{label-C3oLcOn0.js → label-Di7vPCvs.js} +1 -1
- package/dist/client/assets/{login-DjI0bYya.js → login-2SyCeWam.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B7tRsqo-.js → mcp-oauth-CkPjLCsH.js} +1 -1
- package/dist/client/assets/{members-DIxpLBtJ.js → members-CjaCp3dg.js} +2 -2
- package/dist/client/assets/{monaco-editor-CI1Pa0QN.js → monaco-editor-DwYoS9zw.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BcIi6QZu.js → monitoring-stats-row-DkqIQOcq.js} +1 -1
- package/dist/client/assets/{oauth-callback-Dgp5DdjP.js → oauth-callback-CZp0JiJW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DPhQ8sI3.js → oauth-callback-ai-provider-Dg09kVke.js} +1 -1
- package/dist/client/assets/{onboarding-DtsS5lUr.js → onboarding-BbfRp_j7.js} +1 -1
- package/dist/client/assets/{org-install-7RmPSbO9.js → org-install-C35OKz52.js} +1 -1
- package/dist/client/assets/{org-layout--gQCQGBA.js → org-layout-DZByPEyS.js} +1 -1
- package/dist/client/assets/{organization-choice-A8WzCg8t.js → organization-choice-D-8Jpbxq.js} +1 -1
- package/dist/client/assets/{page-seo-form-rxuP--YT.js → page-seo-form-DpKXv5ZW.js} +1 -1
- package/dist/client/assets/page-seo-sheet-BNm6Mm2L.js +1 -0
- package/dist/client/assets/{popover-voqJlCLR.js → popover-BLg2uxUj.js} +1 -1
- package/dist/client/assets/post-editor-DtfgS5ZG.js +1 -0
- package/dist/client/assets/{preview-dialog-DC1NsLKi.js → preview-dialog-DqH-_Rmc.js} +1 -1
- package/dist/client/assets/{primitives-DLRj8yUL.js → primitives-DXpcMQqJ.js} +1 -1
- package/dist/client/assets/profile-BoEvNBMC.js +1 -0
- package/dist/client/assets/project-app-view-DMQWiDoZ.js +1 -0
- package/dist/client/assets/record-editor-GeUn2Cfg.js +1 -0
- package/dist/client/assets/registry-BnG2g9Fw.js +2 -0
- package/dist/client/assets/{registry-layout-Bsm16ESy.js → registry-layout-DkLgn4PF.js} +2 -2
- package/dist/client/assets/{require-capability-WHfqcRqc.js → require-capability-ghUcEykT.js} +1 -1
- package/dist/client/assets/{required-auth-layout-CcH9lzeU.js → required-auth-layout-SCPc1ODv.js} +1 -1
- package/dist/client/assets/{reset-password-o6QeBSLY.js → reset-password-ohLffP_O.js} +1 -1
- package/dist/client/assets/{roles-D_-_h1c8.js → roles-BjyevsY6.js} +1 -1
- package/dist/client/assets/{save-status-D4ISIXoj.js → save-status-COIKtaoc.js} +1 -1
- package/dist/client/assets/{scroll-area-CLfWXW0D.js → scroll-area-DFbOrGft.js} +1 -1
- package/dist/client/assets/{search-input-DPBtlWUD.js → search-input-Db1Wlp2M.js} +1 -1
- package/dist/client/assets/secrets-BORDpp9r.js +1 -0
- package/dist/client/assets/{sections-editor-DdPJUwmv.js → sections-editor-CsdioN2W.js} +2 -2
- package/dist/client/assets/select-Biv4m02a.js +1 -0
- package/dist/client/assets/{select-model-DdKq7y8l.js → select-model-B6vWutyx.js} +1 -1
- package/dist/client/assets/seo-editor-CSTNL9M8.js +1 -0
- package/dist/client/assets/{settings-layout-Bf0CD3Ha.js → settings-layout-5lmse1ub.js} +1 -1
- package/dist/client/assets/{settings-section-BOPxWg6D.js → settings-section-CD_Cl2xg.js} +1 -1
- package/dist/client/assets/{sheet-BCI6wljB.js → sheet-CLgUQ0k9.js} +1 -1
- package/dist/client/assets/{shell-controls-CUcC0uoE.js → shell-controls-DuKZWqgd.js} +1 -1
- package/dist/client/assets/{shell-layout-BpdvdxRY.js → shell-layout-fqgrNv9Y.js} +1 -1
- package/dist/client/assets/{shell-route-loading-CrU5yzKP.js → shell-route-loading-B3Il8pQg.js} +1 -1
- package/dist/client/assets/{sidebar-DLjbCYfe.js → sidebar-B6ogJK6o.js} +1 -1
- package/dist/client/assets/{skeleton-vuq3rnUi.js → skeleton-7DG8UULc.js} +1 -1
- package/dist/client/assets/{sortable.esm-aG8KzwUt.js → sortable.esm-BBNRI0-0.js} +1 -1
- package/dist/client/assets/sso-50J9BcfO.js +1 -0
- package/dist/client/assets/{store-ChzWT5-N.js → store-D0nqcAbk.js} +1 -1
- package/dist/client/assets/store-registry-DZK1gxtR.js +2 -0
- package/dist/client/assets/{studio-tools-QGvUs6qu.js → studio-tools-DCyngkzJ.js} +1 -1
- package/dist/client/assets/{switch-BwnzJhUB.js → switch-DQj88pZv.js} +1 -1
- package/dist/client/assets/{table-DyiI6lY1.js → table-Du45gWno.js} +1 -1
- package/dist/client/assets/{tabs-2cKRgONn.js → tabs--E0r9_Sj.js} +1 -1
- package/dist/client/assets/{task-status-1cY6Pf8x.js → task-status-B_9F2gh5.js} +1 -1
- package/dist/client/assets/{textarea-DqRxFP0T.js → textarea-BFNmWFvP.js} +1 -1
- package/dist/client/assets/{toggle-group-CvE2Rn7y.js → toggle-group-KbM3MWcV.js} +1 -1
- package/dist/client/assets/{toolbar-Dsvneu3f.js → toolbar-BgwgtfBD.js} +1 -1
- package/dist/client/assets/{tooltip-Bjh8CXdQ.js → tooltip-Dcp4xtTX.js} +1 -1
- package/dist/client/assets/{types-CXT3eJPp.js → types-BhFW6kUE.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Cm6bJu4O.js → use-ai-providers-BMg8Dsli.js} +1 -1
- package/dist/client/assets/{use-automations-hkjYbjXY.js → use-automations-D4GU11Hn.js} +1 -1
- package/dist/client/assets/{use-capability-qIjsd8HD.js → use-capability-CAL5M8kW.js} +1 -1
- package/dist/client/assets/{use-clock-tick-Doyl2hlk.js → use-clock-tick-CG1lc4nO.js} +1 -1
- package/dist/client/assets/{use-collections-OMXnywUO.js → use-collections-BYr7pEmZ.js} +1 -1
- package/dist/client/assets/use-connection-D9HsjWxg.js +1 -0
- package/dist/client/assets/{use-copy-CjrJL2o4.js → use-copy-B6e0ArXF.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BbhHiNda.js → use-create-virtual-mcp-UIYeNsla.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BStxRiyA.js → use-debounced-autosave-xepBeP7W.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CcoavCzH.js → use-delete-connection-BEeKZ9NT.js} +1 -1
- package/dist/client/assets/{use-file-configs-DwaAJaA6.js → use-file-configs-BmyLNtzY.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-BLyYnILN.js → use-infinite-scroll-CJlKxIxa.js} +1 -1
- package/dist/client/assets/{use-join-requests-DzaX5jxt.js → use-join-requests-Dh4DPnmF.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CX47WlCL.js → use-mcp-client-7EfqWxgd.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-CbrvbR3P.js → use-mcp-prompts-DIkRTD9t.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-C37oT0bu.js → use-mcp-tools-W08KOK_v.js} +1 -1
- package/dist/client/assets/{use-members-CtUanB1S.js → use-members-DyLgAHg5.js} +1 -1
- package/dist/client/assets/{use-mobile-BsQGJSz8.js → use-mobile-CeVjRMu3.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C_B7rQZ3.js → use-navigate-to-agent-CfSjeQwH.js} +1 -1
- package/dist/client/assets/use-org-auth-client-CVfi2bFZ.js +1 -0
- package/dist/client/assets/{use-org-sso-DKfKkOYy.js → use-org-sso-3_seOFru.js} +1 -1
- package/dist/client/assets/{use-organization-roles-LSjQh-hO.js → use-organization-roles-BBD5Uy2k.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Cw-0oyZX.js → use-organization-settings-Bvieu16r.js} +1 -1
- package/dist/client/assets/{use-registry-connections-sALt7ACC.js → use-registry-connections-DgPJKdCX.js} +1 -1
- package/dist/client/assets/{use-secrets-DyPgSICV.js → use-secrets-Bpmq5HaY.js} +1 -1
- package/dist/client/assets/{use-status-sounds-YKEkF-4T.js → use-status-sounds-Dsmk_M7Y.js} +1 -1
- package/dist/client/assets/{use-view-mode-BMTZD0uv.js → use-view-mode-DhQbMx-b.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-ByWPjIzd.js → use-virtual-mcp-CTBnE7sF.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B8aLEC__.js +1 -0
- package/dist/client/assets/{useQueries-Do45fFi7.js → useQueries-DRRNcEOA.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BJo3aYmp.js +1 -0
- package/dist/client/assets/variant-calendar-D-QL2C_C.js +1 -0
- package/dist/client/assets/{view-mode-toggle-yOXFqeV7.js → view-mode-toggle-9We3fjVd.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +4 -5
- package/dist/client/assets/Form-DLIz5vwr.js +0 -26
- package/dist/client/assets/ai-providers-Cr1HJb4g.js +0 -1
- package/dist/client/assets/app-editor-Cu5Jn0bp.js +0 -1
- package/dist/client/assets/automations-LxVvDRSf.js +0 -1
- package/dist/client/assets/buckets-pliF9NOx.js +0 -1
- package/dist/client/assets/category-editor-BElGS0p5.js +0 -1
- package/dist/client/assets/collection-detail-BfoXrAWD.js +0 -1
- package/dist/client/assets/command-6Xv18lx6.js +0 -1
- package/dist/client/assets/commerce-onboarding-COle5u-q.js +0 -1
- package/dist/client/assets/connection-detail-Cy4adAl6.js +0 -1
- package/dist/client/assets/connections-x7QDuFJK.js +0 -1
- package/dist/client/assets/file-explorer-BujxJOsE.js +0 -2
- package/dist/client/assets/general-BjDrCY53.js +0 -1
- package/dist/client/assets/index-B7G40tVP.js +0 -1
- package/dist/client/assets/index-BdQq_4o_.js +0 -1
- package/dist/client/assets/index-CxLZ7FWT.js +0 -1
- package/dist/client/assets/index-DGekSTiC.js +0 -1
- package/dist/client/assets/index-hl6kLhIe.js +0 -1
- package/dist/client/assets/page-seo-sheet-vEubWUB4.js +0 -1
- package/dist/client/assets/post-editor-CukRi04m.js +0 -1
- package/dist/client/assets/profile-Cuy0XRiQ.js +0 -1
- package/dist/client/assets/project-app-view-DCl-CWYr.js +0 -1
- package/dist/client/assets/record-editor-DOI2gIfd.js +0 -1
- package/dist/client/assets/registry-EBdkezYg.js +0 -2
- package/dist/client/assets/secrets-cvbnrgVx.js +0 -1
- package/dist/client/assets/select-Dm5gSFeK.js +0 -1
- package/dist/client/assets/seo-editor-D12GD7FT.js +0 -1
- package/dist/client/assets/sso-V1O3oG0I.js +0 -1
- package/dist/client/assets/store-registry-DwmY0RAT.js +0 -2
- package/dist/client/assets/tools-list-Dk1OdhLO.js +0 -1
- package/dist/client/assets/use-connection-CQmB3ngS.js +0 -1
- package/dist/client/assets/use-org-auth-client-BWt-3T2p.js +0 -1
- package/dist/client/assets/useInfiniteQuery-V0rLmF2w.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Zpghw-jA.js +0 -1
- package/dist/client/assets/variant-calendar-bDr2uwc7.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as j,C as L,K as q,w as $,a7 as V,ad as z,j as n,r as R,ai as Y,a2 as W,bc as X,U as x,Z as C,ba as Q,V as I,bb as _,Y as Z,X as k,bI as J,bH as ee}from"./index-CZQAHCWx.js";import{i as oe}from"./mcp-oauth-CkPjLCsH.js";import{B as w}from"./badge-BkyT3WoL.js";import{T as E,a as P,b as S,c as te}from"./tooltip-Dcp4xtTX.js";import{g as re}from"./types-BhFW6kUE.js";import{s as ae}from"./Eye-Du8USWUC.js";import{s as se}from"./Star01-COmcJPAd.js";import{aj as ne}from"./agent-icon-B6eCx9D1.js";function ke(d){const e=j.c(11),{connectionId:t}=d,{org:a}=L();let o,r,s;e[0]!==t||e[1]!==a.slug?(o=new URL(`/api/${a.slug}/mcp/${t}`,window.location.origin),s=$,r=q.isMCPAuthenticated(o.href,null),e[0]=t,e[1]=a.slug,e[2]=o,e[3]=r,e[4]=s):(o=e[2],r=e[3],s=e[4]);let i;e[5]!==o||e[6]!==a.id?(i=()=>oe({url:o.href,token:null,orgId:a.id}),e[5]=o,e[6]=a.id,e[7]=i):i=e[7];let c;e[8]!==r||e[9]!==i?(c={queryKey:r,queryFn:i},e[8]=r,e[9]=i,e[10]=c):c=e[10];const{data:l}=s(c);return l}const ie=[{key:"readOnlyHint",label:"Read-only",Icon:ae,variant:"secondary"},{key:"destructiveHint",label:"Destructive",Icon:V,variant:"destructive"},{key:"idempotentHint",label:"Idempotent",Icon:z,variant:"secondary"},{key:"openWorldHint",label:"Open-world",Icon:se,variant:"outline"}];function we(d){const e=j.c(18),{annotations:t,_meta:a}=d;let o;e[0]!==a?(o=re(a),e[0]=a,e[1]=o):o=e[1];const r=!!o;let s,i,c,l,p;if(e[2]!==t||e[3]!==r){p=Symbol.for("react.early_return_sentinel");e:{const f=t?ie.filter(m=>t[m.key]===!0):[];if(f.length===0&&!r){p=null;break e}s=te,i="flex gap-1 flex-nowrap",e[9]!==r?(c=r&&n.jsxs(E,{children:[n.jsx(P,{asChild:!0,children:n.jsx(w,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:n.jsx(ne,{})})}),n.jsx(S,{children:"Interactive"})]}),e[9]=r,e[10]=c):c=e[10],l=f.map(ce)}e[2]=t,e[3]=r,e[4]=s,e[5]=i,e[6]=c,e[7]=l,e[8]=p}else s=e[4],i=e[5],c=e[6],l=e[7],p=e[8];if(p!==Symbol.for("react.early_return_sentinel"))return p;let u;e[11]!==i||e[12]!==c||e[13]!==l?(u=n.jsxs("div",{className:i,children:[c,l]}),e[11]=i,e[12]=c,e[13]=l,e[14]=u):u=e[14];let v;return e[15]!==s||e[16]!==u?(v=n.jsx(s,{children:u}),e[15]=s,e[16]=u,e[17]=v):v=e[17],v}function ce(d){const{label:e,Icon:t,variant:a}=d;return n.jsxs(E,{children:[n.jsx(P,{asChild:!0,children:n.jsx(w,{asChild:!0,variant:a,className:"size-6 p-1",children:n.jsx(t,{})})}),n.jsx(S,{children:e})]},e)}var g="Radio",[de,A]=k(g),[le,ue]=de(g),N=R.forwardRef((d,e)=>{const{__scopeRadio:t,name:a,checked:o=!1,required:r,disabled:s,value:i="on",onCheck:c,form:l,...p}=d,[u,v]=R.useState(null),f=C(e,y=>v(y)),m=R.useRef(!1),h=u?l||!!u.closest("form"):!0;return n.jsxs(le,{scope:t,checked:o,disabled:s,children:[n.jsx(x.button,{type:"button",role:"radio","aria-checked":o,"data-state":O(o),"data-disabled":s?"":void 0,disabled:s,value:i,...p,ref:f,onClick:I(d.onClick,y=>{o||c?.(),h&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),h&&n.jsx(D,{control:u,bubbles:!m.current,name:a,value:i,checked:o,required:r,disabled:s,form:l,style:{transform:"translateX(-100%)"}})]})});N.displayName=g;var G="RadioIndicator",T=R.forwardRef((d,e)=>{const{__scopeRadio:t,forceMount:a,...o}=d,r=ue(G,t);return n.jsx(Z,{present:a||r.checked,children:n.jsx(x.span,{"data-state":O(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:e})})});T.displayName=G;var pe="RadioBubbleInput",D=R.forwardRef(({__scopeRadio:d,control:e,checked:t,bubbles:a=!0,...o},r)=>{const s=R.useRef(null),i=C(s,r),c=J(t),l=ee(e);return R.useEffect(()=>{const p=s.current;if(!p)return;const u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(c!==t&&f){const m=new Event("click",{bubbles:a});f.call(p,t),p.dispatchEvent(m)}},[c,t,a]),n.jsx(x.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...o,tabIndex:-1,ref:i,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});D.displayName=pe;function O(d){return d?"checked":"unchecked"}var fe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],b="RadioGroup",[ve]=k(b,[_,A]),M=_(),U=A(),[me,Re]=ve(b),B=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,name:a,defaultValue:o,value:r,required:s=!1,disabled:i=!1,orientation:c,dir:l,loop:p=!0,onValueChange:u,...v}=d,f=M(t),m=Y(l),[h,y]=W({prop:r,defaultProp:o??null,onChange:u,caller:b});return n.jsx(me,{scope:t,name:a,required:s,disabled:i,value:h,onValueChange:y,children:n.jsx(X,{asChild:!0,...f,orientation:c,dir:m,loop:p,children:n.jsx(x.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":i?"":void 0,dir:m,...v,ref:e})})})});B.displayName=b;var F="RadioGroupItem",H=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,disabled:a,...o}=d,r=Re(F,t),s=r.disabled||a,i=M(t),c=U(t),l=R.useRef(null),p=C(e,l),u=r.value===o.value,v=R.useRef(!1);return R.useEffect(()=>{const f=h=>{fe.includes(h.key)&&(v.current=!0)},m=()=>v.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",m)}},[]),n.jsx(Q,{asChild:!0,...i,focusable:!s,active:u,children:n.jsx(N,{disabled:s,required:r.required,checked:u,...c,...o,name:r.name,ref:p,onCheck:()=>r.onValueChange(o.value),onKeyDown:I(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:I(o.onFocus,()=>{v.current&&l.current?.click()})})})});H.displayName=F;var he="RadioGroupIndicator",K=R.forwardRef((d,e)=>{const{__scopeRadioGroup:t,...a}=d,o=U(t);return n.jsx(T,{...o,...a,ref:e})});K.displayName=he;var Ee=B,Pe=H,Se=K;export{Pe as I,Ee as R,we as T,Se as a,ke as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bz as _}from"./index-
|
|
1
|
+
import{bz as _}from"./index-CZQAHCWx.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{am as st,c as k,j as n,r as $,C as J,m as xe,l as Q,i as le,an as Z,t as U,K as te,k as se,B as Y,d as nt,a7 as it,E as ot,a as rt}from"./index-CZQAHCWx.js";import{u as ge}from"./use-mobile-CeVjRMu3.js";import{u as lt}from"./useQueries-DRRNcEOA.js";import{i as at,u as ae,m as ct,a as dt,S as mt}from"./use-mcp-client-7EfqWxgd.js";import{u as ut,b as ft,v as pt,a as ht}from"./use-virtual-mcp-CTBnE7sF.js";import{i as xt}from"./ChevronUp-hzSQl57_.js";import{e as gt,A as ce,Y as yt,a8 as bt,D as jt,k as vt}from"./agent-icon-B6eCx9D1.js";import{s as ye}from"./Plus-B6Bp27KE.js";import{i as $e}from"./X-ClFhIPPx.js";import{C as oe}from"./index-B6YHm6is.js";import{b as Nt}from"./chat-context-DueHVvJY.js";import{N as wt}from"./decopilot-2OorXRZy.js";import{g as St,b as Ae,c as re,K as Pe,P as Ee,D as Me,d as _t,S as Ct,v as It,e as Tt,C as kt,s as $t,l as At,k as Pt,o as Et,u as Mt,j as zt,h as Ot}from"./sortable.esm-BBNRI0-0.js";import{u as ze,a as Oe,o as Lt}from"./use-organization-settings-Bvieu16r.js";import{c as be,b as Dt,h as Ht}from"./shell-layout-fqgrNv9Y.js";import{I as Le}from"./input-Bnf6c030.js";import{S as Rt,t as je,P as Ft,j as Ut,s as Bt,g as Vt}from"./scroll-area-DFbOrGft.js";import{S as Kt,a as qt,b as Wt,c as Gt,d as Qt}from"./sheet-CLgUQ0k9.js";import{S as H}from"./skeleton-7DG8UULc.js";import{t as De}from"./ChevronDown-8-SpQ5a6.js";import{d as He}from"./ZoomOut-BkeollDv.js";import{g as Re,M as Jt}from"./types-BhFW6kUE.js";import{I as Fe}from"./integration-icon-BZb9eAa5.js";import{a as Xt,b as Zt,c as Yt,d as we,S as es}from"./select-Biv4m02a.js";import{T as ts}from"./textarea-BFNmWFvP.js";import{u as Ue}from"./studio-tools-DCyngkzJ.js";import{a as ss}from"./use-mcp-tools-W08KOK_v.js";import{i as ns}from"./XCircle-ZlnM-le2.js";import{f as is}from"./tab-id-BptcWVWa.js";import{g as os}from"./use-mcp-prompts-DIkRTD9t.js";import{u as rs,w as ls}from"./hooks-DpQFLCh_.js";import{a as as,g as cs,c as ds,b as ms,D as us}from"./dropdown-menu-BLOjaXD3.js";import{s as fs}from"./Trash01-S_d8yXYH.js";import{a as ps,u as hs}from"./use-ai-providers-BMg8Dsli.js";import{u as xs}from"./connect-desktop-dialog-XNmCdvVO.js";import{a as gs}from"./toolbar-BgwgtfBD.js";import"./auth-B9FveTwh.js";import"./use-collections-BYr7pEmZ.js";import"./AlertCircle-eL7jEjpx.js";import"./Tool01-D9Z3ra2m.js";import"./SwitchHorizontal01-COrtT0WP.js";import"./Settings02-CzDpZT_t.js";import"./ArrowUpRight-BtZv9HXz.js";import"./ZapSquare-Brn6J5mG.js";import"./Users03-DTBaxDUb.js";import"./CheckCircle-Ce4sW5Fr.js";import"./ChevronLeft-DQ6Y033o.js";import"./ChevronRight-C7AnVgNL.js";import"./DotsVertical-CBCiPEnd.js";import"./Stars02-B4L_1USv.js";import"./Eye-Du8USWUC.js";import"./Globe01-ByUFNYZ1.js";import"./FilterLines-D51fKry2.js";import"./Star01-COmcJPAd.js";import"./Globe04-BnUIZrLZ.js";import"./HardDrive-OrjxQFg1.js";import"./Key01-CI_-yaVv.js";import"./LayoutLeft-DnqAFiqW.js";import"./LinkExternal01-C9plWUCQ.js";import"./Monitor01-Cx6UPY56.js";import"./Sun-BrBndJzL.js";import"./Palette-DxYtHeiN.js";import"./Play-Bpofg5MS.js";import"./SearchMd-DY2IStnr.js";import"./Shield01-ByoQOTwe.js";import"./Stars01-DjTb55Tj.js";import"./Upload01-BovBQGIq.js";import"./User01-Dcns6QTI.js";import"./Users01-Dua8TttV.js";import"./XClose-Cr1-H9ci.js";import"./Zap-TPho1Yix.js";import"./tooltip-Dcp4xtTX.js";import"./dialog-DGm31nBN.js";import"./drawer-DdWdZjEE.js";import"./collection-search-CgpTu-Mz.js";import"./form-B5xe8o6u.js";import"./label-Di7vPCvs.js";import"./tabs--E0r9_Sj.js";import"./toggle-group-KbM3MWcV.js";import"./popover-BLg2uxUj.js";import"./command-BQdrUZdP.js";import"./index-BOJe9uwl.js";import"./useInfiniteQuery-B8aLEC__.js";import"./use-infinite-scroll-CJlKxIxa.js";import"./question-004-sINsf4GQ.js";import"./checkbox-LHoIUSFR.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-CMukQvh7.js";import"./settings-section-CD_Cl2xg.js";import"./card-Bs3t5A2h.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DFgMcv0g.js";import"./use-registry-connections-DgPJKdCX.js";import"./use-connection-D9HsjWxg.js";import"./extract-connection-data-D_bB-ShD.js";import"./collection-tabs-C8hplLSb.js";import"./badge-BkyT3WoL.js";import"./connection-form-helpers-BehaoK99.js";import"./authenticate-and-persist-oauth-DiMpH9Hf.js";import"./mcp-oauth-CkPjLCsH.js";import"./useSuspenseInfiniteQuery-BJo3aYmp.js";import"./required-auth-layout-SCPc1ODv.js";import"./use-org-sso-3_seOFru.js";import"./use-clock-tick-CG1lc4nO.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B6e0ArXF.js";import"./file-type-icon-BCa6hDuH.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-CfSjeQwH.js";import"./decopilot-sse-pool-BTlcRVcA.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";function ys(t,e){return lt({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:st,enabled:!0,placeholderData:void 0}))},e)}function Be(t){const e=k.c(11),{properties:s,required:o,values:i,onChange:r}=t;let a;e[0]!==o?(a=o??[],e[0]=o,e[1]=a):a=e[1];let d;e[2]!==a?(d=new Set(a),e[2]=a,e[3]=d):d=e[3];const l=d;let m;e[4]!==s?(m=Object.entries(s),e[4]=s,e[5]=m):m=e[5];let c;return e[6]!==r||e[7]!==l||e[8]!==m||e[9]!==i?(c=n.jsx("div",{className:"flex flex-col gap-2",children:m.map(u=>{const[f,p]=u;return n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{className:"text-xs font-medium leading-none flex items-center gap-1",children:[f,l.has(f)&&n.jsx("span",{className:"text-red-500 text-[10px]",children:"*"})]}),n.jsx("span",{className:"text-[10px] text-muted-foreground font-mono",children:p.type})]}),p.description&&n.jsx("p",{className:"text-[10px] text-muted-foreground leading-snug",children:p.description}),n.jsx(bs,{type:p.type,fieldKey:f,value:i[f],onChange:h=>r(f,h)})]},f)})}),e[6]=r,e[7]=l,e[8]=m,e[9]=i,e[10]=c):c=e[10],c}function bs(t){const e=k.c(19),{type:s,fieldKey:o,value:i,onChange:r}=t;if(s==="object"||s==="array"){const c=i??"";let u;e[0]!==r?(u=h=>r(h.target.value),e[0]=r,e[1]=u):u=e[1];const f=`Enter ${o} as JSON…`;let p;return e[2]!==c||e[3]!==u||e[4]!==f?(p=n.jsx(ts,{className:"font-mono text-xs h-16",value:c,onChange:u,placeholder:f,rows:2}),e[2]=c,e[3]=u,e[4]=f,e[5]=p):p=e[5],p}if(s==="boolean"){const c=i!=null?String(i):"";let u;e[6]!==r?(u=x=>r(x==="true"),e[6]=r,e[7]=u):u=e[7];let f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(Xt,{className:"h-7 text-xs",children:n.jsx(Zt,{placeholder:"Select…"})}),e[8]=f):f=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsxs(Yt,{children:[n.jsx(we,{value:"true",children:"true"}),n.jsx(we,{value:"false",children:"false"})]}),e[9]=p):p=e[9];let h;return e[10]!==c||e[11]!==u?(h=n.jsxs(es,{value:c,onValueChange:u,children:[f,p]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}const a=i??"";let d;e[13]!==r?(d=c=>r(c.target.value),e[13]=r,e[14]=d):d=e[14];const l=`Enter ${o}…`;let m;return e[15]!==a||e[16]!==d||e[17]!==l?(m=n.jsx(Le,{className:"h-7 text-xs",value:a,onChange:d,placeholder:l}),e[15]=a,e[16]=d,e[17]=l,e[18]=m):m=e[18],m}const ne=8;function js(t){const e=k.c(16),{open:s,onOpenChange:o}=t,[i,r]=$.useState("");let a,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(Kt,{children:"Manage home"}),d=n.jsx(qt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=a,e[1]=d):(a=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(gt,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none","aria-hidden":!0}),e[2]=l):l=e[2];let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=x=>r(x.target.value),e[3]=m):m=e[3];let c;e[4]!==i?(c=n.jsxs(Wt,{className:"px-5 py-4 border-b border-border",children:[a,d,n.jsxs("div",{className:"relative mt-3",children:[l,n.jsx(Le,{value:i,onChange:m,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=i,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Js,{}),e[6]=u):u=e[6];let f;e[7]!==i?(f=n.jsx(Rt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3 flex flex-col gap-4",children:n.jsx($.Suspense,{fallback:u,children:n.jsx(Ns,{search:i})})})}),e[7]=i,e[8]=f):f=e[8];let p;e[9]!==c||e[10]!==f?(p=n.jsxs(Gt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[c,f]}),e[9]=c,e[10]=f,e[11]=p):p=e[11];let h;return e[12]!==o||e[13]!==s||e[14]!==p?(h=n.jsx(Qt,{open:s,onOpenChange:o,children:p}),e[12]=o,e[13]=s,e[14]=p,e[15]=h):h=e[15],h}function vs(t){const e=k.c(32),{org:s}=J(),o=ze();let i;e[0]!==o?.ids?(i=o?.ids??[],e[0]=o?.ids,e[1]=i):i=e[1];const r=i,a=Oe(),d=ft(),l=xe();let m;e[2]!==s||e[3]!==l?(m=()=>l.refetchQueries({queryKey:te.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=m):m=e[4];const c=m;let u;e[5]!==r?(u=_=>r.includes(_),e[5]=r,e[6]=u):u=e[6];const f=u;let p;e[7]!==r||e[8]!==t?(p=t?r.filter(_=>t.has(_)).length:r.length,e[7]=r,e[8]=t,e[9]=p):p=e[9];const x=p>=ne;let y;e[10]!==x||e[11]!==f||e[12]!==a?(y=_=>f(_)||x?Promise.resolve():a.apply(I=>I.includes(_)?null:[...I,_]),e[10]=x,e[11]=f,e[12]=a,e[13]=y):y=e[13];const b=y;let v;e[14]!==a?(v=_=>a.apply(I=>I.filter(T=>T!==_)),e[14]=a,e[15]=v):v=e[15];const N=v;let j;e[16]!==a?(j=_=>a.apply(()=>_),e[16]=a,e[17]=j):j=e[17];const g=j;let w;e[18]!==d||e[19]!==x||e[20]!==f||e[21]!==c||e[22]!==a?(w=async(_,I)=>{await d.update.mutateAsync({id:_.id,data:{metadata:I}}),!f(_.id)&&!x&&await a.apply(T=>T.includes(_.id)?null:[...T,_.id]),await c()},e[18]=d,e[19]=x,e[20]=f,e[21]=c,e[22]=a,e[23]=w):w=e[23];const S=w;let C;return e[24]!==b||e[25]!==x||e[26]!==r||e[27]!==f||e[28]!==N||e[29]!==g||e[30]!==S?(C={homeIds:r,isOnHome:f,atLimit:x,addAgent:b,removeAgent:N,reorder:g,saveAgentMetadata:S},e[24]=b,e[25]=x,e[26]=r,e[27]=f,e[28]=N,e[29]=g,e[30]=S,e[31]=C):C=e[31],C}function Ns(t){const e=k.c(21),{search:s}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={pageSize:1e3},e[0]=o):o=e[0];const i=ut(o);let r;e[1]!==i?(r=new Set(i.map(Is)),e[1]=i,e[2]=r):r=e[2];const a=vs(r);let d,l,m;if(e[3]!==i||e[4]!==a||e[5]!==s){const x=new Map(i.map(Cs));d=s.trim().toLowerCase();const y=N=>!d||N.title?.toLowerCase().includes(d);l=a.homeIds.map(N=>x.get(N)).filter(_s).filter(y);const b=St(i);let v;e[9]!==a?(v=N=>!a.isOnHome(N.id),e[9]=a,e[10]=v):v=e[10],m=i.filter(Ss).filter(N=>!b.has(N.id)).filter(v).filter(y).sort(ws),e[3]=i,e[4]=a,e[5]=s,e[6]=d,e[7]=l,e[8]=m}else d=e[6],l=e[7],m=e[8];const c=m;let u;e[11]!==a||e[12]!==l?(u=n.jsx(Ts,{home:a,agents:l}),e[11]=a,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==c||e[15]!==a||e[16]!==f?(p=n.jsx(As,{home:a,agents:c,hasSearch:f}),e[14]=c,e[15]=a,e[16]=f,e[17]=p):p=e[17];let h;return e[18]!==u||e[19]!==p?(h=n.jsxs(n.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=h):h=e[20],h}function ws(t,e){return(t.title??"").localeCompare(e.title??"")}function Ss(t){return t.id&&!at(t.id)}function _s(t){return!!t}function Cs(t){return[t.id,t]}function Is(t){return t.id}function Ve(t){const e=k.c(7),{title:s,hint:o}=t;let i;e[0]!==s?(i=n.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=i):i=e[1];let r;e[2]!==o?(r=o&&n.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=r):r=e[3];let a;return e[4]!==i||e[5]!==r?(a=n.jsxs("div",{className:"flex items-center justify-between px-1",children:[i,r]}),e[4]=i,e[5]=r,e[6]=a):a=e[6],a}function Ts(t){const e=k.c(14),{home:s,agents:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={activationConstraint:{distance:5}},e[0]=i):i=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:$t},e[1]=r):r=e[1];const a=Ae(re(Ee,i),re(Pe,r));let d;e[2]!==s?(d=p=>{const{active:h,over:x}=p;if(!x||h.id===x.id)return;const y=s.homeIds,b=y.indexOf(h.id),v=y.indexOf(x.id);b===-1||v===-1||s.reorder(At([...y],b,v)).catch($s)},e[2]=s,e[3]=d):d=e[3];const l=d,m=`${s.homeIds.length}/${ne}`;let c;e[4]!==m?(c=n.jsx(Ve,{title:"On home",hint:m}),e[4]=m,e[5]=c):c=e[5];let u;e[6]!==o||e[7]!==l||e[8]!==s||e[9]!==a?(u=o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):n.jsx(Me,{sensors:a,collisionDetection:_t,onDragEnd:l,children:n.jsx(Ct,{items:o.map(ks),strategy:It,children:n.jsx("div",{className:"flex flex-col gap-1",children:o.map(p=>n.jsx(Es,{agent:p,home:s},p.id))})})}),e[6]=o,e[7]=l,e[8]=s,e[9]=a,e[10]=u):u=e[10];let f;return e[11]!==c||e[12]!==u?(f=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,u]}),e[11]=c,e[12]=u,e[13]=f):f=e[13],f}function ks(t){return t.id}function $s(){return U.error("Couldn't reorder home — please try again.")}function As(t){const e=k.c(6),{home:s,agents:o,hasSearch:i}=t,[r,a]=$.useState(20);let d;if(e[0]!==o||e[1]!==i||e[2]!==s||e[3]!==r){const l=o.slice(0,r);let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx(Ve,{title:"Add to home"}),e[5]=m):m=e[5],d=n.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,o.length===0?n.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:i?"No agents match.":"Every agent is on the home."}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex flex-col gap-1",children:l.map(c=>n.jsx(Os,{agent:c,home:s},c.id))}),o.length>r&&n.jsxs("button",{type:"button",onClick:()=>a(Ps),className:"mt-1 self-center rounded-md px-3 py-1.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",children:["Load more (",o.length-r,")"]})]})]}),e[0]=o,e[1]=i,e[2]=s,e[3]=r,e[4]=d}else d=e[4];return d}function Ps(t){return t+20}function Ke(t){const e=Z(t.metadata?.ui).filter(r=>!!r.resourceUri).length,s=t.metadata?.ui?.homePrompts,o=Array.isArray(s)?s.length:null,i=[];return e>0&&i.push(`${e} tile${e===1?"":"s"}`),o!==null&&o>0&&i.push(`${o} prompt${o===1?"":"s"}`),o===0&&i.push("prompts off"),i.join(" · ")}function Es(t){const e=k.c(57),{agent:s,home:o}=t,[i,r]=$.useState(!1);let a;e[0]!==s.id?(a={id:s.id},e[0]=s.id,e[1]=a):a=e[1];const{attributes:d,listeners:l,setNodeRef:m,transform:c,transition:u,isDragging:f}=Tt(a),p=Ke(s)||"Quick access";let h;e[2]!==c?(h=kt.Transform.toString(c),e[2]=c,e[3]=h):h=e[3];const x=f?.5:void 0,y=f?100:void 0;let b;e[4]!==h||e[5]!==x||e[6]!==y||e[7]!==u?(b={transform:h,transition:u,opacity:x,zIndex:y},e[4]=h,e[5]=x,e[6]=y,e[7]=u,e[8]=b):b=e[8];const v=b,N=f&&"shadow-lg";let j;e[9]!==N?(j=Q("rounded-lg border border-border bg-card",N),e[9]=N,e[10]=j):j=e[10];const g=`Drag to reorder ${s.title??s.id}`;let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=n.jsx(He,{size:14}),e[11]=w):w=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==g?(S=n.jsx("button",{type:"button",...d,...l,className:"shrink-0 text-muted-foreground hover:text-foreground cursor-grab active:cursor-grabbing outline-none focus-visible:ring-2 focus-visible:ring-ring rounded","aria-label":g,children:w}),e[12]=d,e[13]=l,e[14]=g,e[15]=S):S=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=()=>r(zs),e[16]=C):C=e[16];const _=s.title??s.id;let I;e[17]!==s.icon||e[18]!==_?(I=n.jsx(ce,{icon:s.icon,name:_,size:"sm"}),e[17]=s.icon,e[18]=_,e[19]=I):I=e[19];const T=s.title??s.id;let P;e[20]!==T?(P=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:T}),e[20]=T,e[21]=P):P=e[21];let M;e[22]!==p?(M=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=M):M=e[23];let z;e[24]!==P||e[25]!==M?(z=n.jsxs("div",{className:"min-w-0 flex-1",children:[P,M]}),e[24]=P,e[25]=M,e[26]=z):z=e[26];const B=i&&"rotate-180";let O;e[27]!==B?(O=Q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=O):O=e[28];let L;e[29]!==O?(L=n.jsx(De,{size:16,className:O}),e[29]=O,e[30]=L):L=e[30];let K;e[31]!==i||e[32]!==I||e[33]!==z||e[34]!==L?(K=n.jsxs("button",{type:"button",onClick:C,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":i,children:[I,z,L]}),e[31]=i,e[32]=I,e[33]=z,e[34]=L,e[35]=K):K=e[35];let A;e[36]!==s.id||e[37]!==o?(A=()=>o.removeAgent(s.id).catch(Ms),e[36]=s.id,e[37]=o,e[38]=A):A=e[38];const V=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=n.jsx($e,{size:14}),e[39]=D):D=e[39];let E;e[40]!==A||e[41]!==V?(E=n.jsx("button",{type:"button",onClick:A,"aria-label":V,title:"Remove from home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive",children:D}),e[40]=A,e[41]=V,e[42]=E):E=e[42];let R;e[43]!==S||e[44]!==K||e[45]!==E?(R=n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,K,E]}),e[43]=S,e[44]=K,e[45]=E,e[46]=R):R=e[46];let F;e[47]!==s||e[48]!==i||e[49]!==o?(F=i&&n.jsx(qe,{agent:s,home:o}),e[47]=s,e[48]=i,e[49]=o,e[50]=F):F=e[50];let W;return e[51]!==m||e[52]!==v||e[53]!==R||e[54]!==F||e[55]!==j?(W=n.jsxs("div",{ref:m,style:v,className:j,children:[R,F]}),e[51]=m,e[52]=v,e[53]=R,e[54]=F,e[55]=j,e[56]=W):W=e[56],W}function Ms(){return U.error("Couldn't remove from home — please try again.")}function zs(t){return!t}function Os({agent:t,home:e}){const[s,o]=$.useState(!1),[i,r]=$.useState(!1),a=Ke(t),d=async()=>{if(!e.atLimit){r(!0);try{await e.addAgent(t.id)}catch{U.error("Couldn't add to home — please try again.")}finally{r(!1)}}};return n.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[n.jsxs("button",{type:"button",onClick:()=>o(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[n.jsx(ce,{icon:t.icon,name:t.title??t.id,size:"sm"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),a&&n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a})]}),n.jsx(De,{size:16,className:Q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),n.jsx("button",{type:"button",onClick:d,disabled:i||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${ne}) — remove an agent first`:"Add to home",className:"shrink-0 inline-flex size-7 items-center justify-center rounded-md bg-foreground text-background text-xs hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:i?n.jsx(le,{size:12,className:"animate-spin"}):n.jsx(ye,{size:14})})]}),s&&n.jsx(qe,{agent:t,home:e})]})}function qe(t){const e=k.c(17),{agent:s,home:o}=t,i=s.metadata?.ui;let r;e[0]!==i?(r=Z(i),e[0]=i,e[1]=r):r=e[1];const a=r;let d;e[2]!==s.connections?(d=(s.connections??[]).map(Ls).sort(),e[2]=s.connections,e[3]=d):d=e[3];const l=d,m=s.metadata?.ui?.homePrompts;let c;e[4]!==s||e[5]!==l||e[6]!==o||e[7]!==a?(c=n.jsx(Hs,{agent:s,home:o,connectionIds:l,pinnedTiles:a}),e[4]=s,e[5]=l,e[6]=o,e[7]=a,e[8]=c):c=e[8];let u;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(Ds,{}),e[9]=u):u=e[9];const f=m??null;let p;e[10]!==s||e[11]!==o||e[12]!==f?(p=n.jsx($.Suspense,{fallback:u,children:n.jsx(Vs,{agent:s,home:o,curated:f})}),e[10]=s,e[11]=o,e[12]=f,e[13]=p):p=e[13];let h;return e[14]!==c||e[15]!==p?(h=n.jsxs("div",{className:"border-t border-border px-3 py-2 flex flex-col gap-3",children:[c,p]}),e[14]=c,e[15]=p,e[16]=h):h=e[16],h}function Ls(t){return t.connection_id}function Ds(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[n.jsx(H,{className:"h-8 w-full"}),n.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Hs({agent:t,home:e,connectionIds:s,pinnedTiles:o}){const i=Ue(),{data:r,isLoading:a}=se({queryKey:te.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async u=>{try{const{item:f}=await i.call("COLLECTION_CONNECTIONS_GET",{id:u}),p=(f?.tools??[]).flatMap(h=>{const x=Re(h._meta);return x?[{name:h.name,description:h.description,resourceUri:x,inputSchema:h.inputSchema}]:[]});return{id:u,title:f?.title??u,icon:f?.icon??null,uiTools:p}}catch{return{id:u,title:u,icon:null,uiTools:[]}}}))).filter(u=>u.uiTools.length>0)});if(s.length===0)return null;if(a)return n.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]});if(!r||r.length===0)return null;const d=new Map;for(const c of r)for(const u of c.uiTools)d.set(`${c.id}:${u.name}`,{conn:c,tool:u});const l=c=>{if(c.toolName&&c.connectionId)return d.get(`${c.connectionId}:${c.toolName}`);for(const[,u]of d)if(u.conn.id===c.connectionId&&u.tool.resourceUri===c.resourceUri)return u},m=o.some(c=>!!l(c));return n.jsxs("div",{className:"flex flex-col gap-2",children:[m&&n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Pinned tiles"}),o.map(c=>{const u=l(c);return u?n.jsx(Us,{agent:t,home:e,connection:u.conn,tool:u.tool,tile:c},c.tileId??`${c.connectionId}:${c.resourceUri}:${c.toolName}`):null})]}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground px-2",children:"Add tile"}),r.map(c=>c.uiTools.map(u=>n.jsx(Bs,{agent:t,home:e,connection:c,tool:u},`add:${c.id}:${u.name}`)))]})]})}function We(t,e){const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;if((r==="object"||r==="array")&&typeof i=="string"){if(!i.trim())continue;try{s[o]=JSON.parse(i)}catch{return null}}else if((r==="number"||r==="integer")&&typeof i=="string"){if(!i.trim())continue;s[o]=Number(i)}else i!==""&&i!=null&&(s[o]=i)}return s}function Rs(t,e){if(!t||!e)return{};const s={};for(const[o,i]of Object.entries(t)){const r=e[o]?.type;(r==="object"||r==="array")&&i!=null&&typeof i!="string"?s[o]=JSON.stringify(i,null,2):s[o]=i}return s}function Fs(t){if(!t)return"";const e=Object.entries(t).filter(([,s])=>s!=null&&s!=="");return e.length===0?"":e.slice(0,3).map(([s,o])=>{const i=typeof o=="object"?JSON.stringify(o):String(o);return`${s}=${i.length>20?`${i.slice(0,20)}…`:i}`}).join(", ")}function Us({agent:t,home:e,connection:s,tool:o,tile:i}){const[r,a]=$.useState(!1),[d,l]=$.useState(!1),m=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[c,u]=$.useState(()=>Rs(i.toolInput,o.inputSchema?.properties)),f=async()=>{a(!0);try{const x=Z(t.metadata?.ui),y=i.tileId?x.filter(v=>v.tileId!==i.tileId):x.filter(v=>v!==i),b={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:y}};await e.saveAgentMetadata(t,b),l(!1)}catch(x){console.error("[home-tiles] failed to remove tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},p=async()=>{a(!0);try{let x;if(m&&o.inputSchema?.properties){const N=We(c,o.inputSchema.properties);if(!N){U.error("Invalid JSON in one of the fields — please fix it."),a(!1);return}Object.keys(N).length>0&&(x=N)}const b=Z(t.metadata?.ui).map(N=>(i.tileId?N.tileId===i.tileId:N===i)?{...N,toolInput:x}:N),v={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:b}};await e.saveAgentMetadata(t,v),l(!1)}catch(x){console.error("[home-tiles] failed to save tile",x),U.error("Couldn't update home — please try again.")}finally{a(!1)}},h=Fs(i.toolInput);return n.jsxs("div",{className:"flex flex-col rounded-md bg-accent/20",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"truncate text-sm text-foreground",children:je(o.name)}),h&&n.jsx("div",{className:"truncate text-[10px] text-muted-foreground font-mono",children:h})]}),m&&n.jsx("button",{type:"button",onClick:()=>l(x=>!x),"aria-label":"Configure tile props",title:"Configure tile props",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent/60",children:n.jsx(yt,{size:14})}),n.jsx(ve,{isPinned:!0,submitting:r,onClick:f,label:"Remove from home"})]}),d&&m&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:c,onChange:(x,y)=>u(b=>({...b,[x]:y}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>l(!1),children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:r,onClick:p,children:r?n.jsx(le,{size:12,className:"animate-spin"}):"Save"})]})]})]})}function Bs({agent:t,home:e,connection:s,tool:o}){const[i,r]=$.useState(!1),[a,d]=$.useState(!1),l=o.inputSchema?.properties&&Object.keys(o.inputSchema.properties).length>0,[m,c]=$.useState({}),u=async()=>{if(l&&!a){d(!0);return}if(!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}await f()},f=async()=>{r(!0);try{let p;if(l&&o.inputSchema?.properties){const b=We(m,o.inputSchema.properties);if(!b){U.error("Invalid JSON in one of the fields — please fix it."),r(!1);return}Object.keys(b).length>0&&(p=b)}const x=[...Z(t.metadata?.ui),{tileId:crypto.randomUUID(),connectionId:s.id,resourceUri:o.resourceUri,toolName:o.name,...p?{toolInput:p}:{}}],y={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:x}};await e.saveAgentMetadata(t,y),d(!1),c({})}catch(p){console.error("[home-tiles] failed to add tile",p),U.error("Couldn't update home — please try again.")}finally{r(!1)}};return n.jsxs("div",{className:"flex flex-col rounded-md hover:bg-accent/40",children:[n.jsxs("div",{className:"flex items-center gap-2.5 px-2 py-1",children:[n.jsx(Fe,{icon:s.icon,name:s.title,size:"xs"}),n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:je(o.name)}),n.jsx(ve,{isPinned:!1,submitting:i,onClick:u,label:"Add to home"})]}),a&&l&&o.inputSchema?.properties&&n.jsxs("div",{className:"px-3 pb-2 pt-1 flex flex-col gap-2",children:[n.jsx(Be,{properties:o.inputSchema.properties,required:o.inputSchema.required,values:m,onChange:(p,h)=>c(x=>({...x,[p]:h}))}),n.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[n.jsx(Y,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{d(!1),c({})},children:"Cancel"}),n.jsx(Y,{size:"sm",className:"h-7 text-xs",disabled:i,onClick:f,children:i?n.jsx(le,{size:12,className:"animate-spin"}):"Pin"})]})]})]})}function ve(t){const e=k.c(11),{isPinned:s,submitting:o,onClick:i,label:r}=t,a=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==a?(d=Q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",a),e[0]=a,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==o?(l=o?n.jsx(le,{size:12,className:"animate-spin"}):s?n.jsx(bt,{size:14}):n.jsx(ye,{size:14}),e[2]=s,e[3]=o,e[4]=l):l=e[4];let m;return e[5]!==r||e[6]!==i||e[7]!==o||e[8]!==d||e[9]!==l?(m=n.jsx("button",{type:"button",onClick:i,disabled:o,"aria-label":r,title:r,className:d,children:l}),e[5]=r,e[6]=i,e[7]=o,e[8]=d,e[9]=l,e[10]=m):m=e[10],m}function Vs(t){const e=k.c(32),{agent:s,home:o,curated:i}=t,{org:r}=J();let a;e[0]!==s.id||e[1]!==r.id||e[2]!==r.slug?(a={connectionId:s.id,orgId:r.id,orgSlug:r.slug},e[0]=s.id,e[1]=r.id,e[2]=r.slug,e[3]=a):a=e[3];const d=ae(a);let l;e[4]!==s.id||e[5]!==r.id?(l=te.agentPrompts(r.id,s.id),e[4]=s.id,e[5]=r.id,e[6]=l):l=e[6];let m;e[7]!==d?(m=async()=>{const{prompts:g}=await d.listPrompts();return g.map(Gs)},e[7]=d,e[8]=m):m=e[8];let c;e[9]!==l||e[10]!==m?(c={queryKey:l,queryFn:m,staleTime:3e4,retry:!1},e[9]=l,e[10]=m,e[11]=c):c=e[11];const{data:u,isLoading:f,error:p}=se(c),h=be(r.slug);let x,y;if(e[12]!==s.id||e[13]!==u||e[14]!==h.prompts){let g;e[17]!==s.id?(g=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=g):g=e[18],x=h.prompts.filter(g).map(Ws);let w;e[19]!==u?(w=u??[],e[19]=u,e[20]=w):w=e[20],y=[...w];for(const S of x)y.some(C=>C.name===S.name)||y.push(S);e[12]=s.id,e[13]=u,e[14]=h.prompts,e[15]=x,e[16]=y}else x=e[15],y=e[16];if(f&&x.length===0){let g;return e[21]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx(H,{className:"h-7 w-full"}),n.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=g):g=e[21],g}if(p&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(y.length===0)return null;let b;e[22]!==i||e[23]!==y?(b=i??y.map(qs),e[22]=i,e[23]=y,e[24]=b):b=e[24];let v;e[25]!==b?(v=new Set(b),e[25]=b,e[26]=v):v=e[26];const N=v;let j;return e[27]!==s||e[28]!==o||e[29]!==y||e[30]!==N?(j=n.jsx("div",{className:"flex flex-col gap-0.5",children:y.map(g=>n.jsx(Qs,{agent:s,home:o,prompt:g,allPromptNames:y.map(Ks),isPinned:N.has(g.name)},g.name))}),e[27]=s,e[28]=o,e[29]=y,e[30]=N,e[31]=j):j=e[31],j}function Ks(t){return t.name}function qs(t){return t.name}function Ws(t){return{name:t.promptName,title:t.title,description:t.description}}function Gs(t){return{name:t.name,title:t.title,description:t.description}}function Qs({agent:t,home:e,prompt:s,allPromptNames:o,isPinned:i}){const[r,a]=$.useState(!1),d=async()=>{if(!i&&!e.isOnHome(t.id)&&e.atLimit){U.error(`Home is full (${ne}) — remove an agent first`);return}a(!0);try{const l=t.metadata?.ui?.homePrompts;let m;Array.isArray(l)?m=i?l.filter(u=>u!==s.name):[...l,s.name]:m=i?o.filter(u=>u!==s.name):o;const c={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:m}};await e.saveAgentMetadata(t,c)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),U.error("Couldn't update home — please try again.")}finally{a(!1)}};return n.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??je(s.name)}),n.jsx(ve,{isPinned:i,submitting:r,onClick:d,label:i?"Remove from home":"Add to home"})]})}function Js(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Xs)}),t[0]=e):e=t[0],e}function Xs(t,e){return n.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[n.jsx(H,{className:"size-8 rounded-md"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const ee=1,Ge=`home-board.layout.v${ee}`;function Qe(t){return`home-board.layout.v${ee}.${t}`}const Je={version:ee,tiles:{},hidden:[]};function fe(t){return!t||t.version!==ee?Je:{version:ee,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Zs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(Qe(t));return e?fe(JSON.parse(e)):void 0}catch{return}}function Se(t,e){try{localStorage.setItem(Qe(t),JSON.stringify(e))}catch{}}async function _e(t,e){if(!(await fetch(`/api/${t}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function en(t){const e=k.c(24),s=xe();let o;e[0]!==t?(o=te.boardLayout(t),e[0]=t,e[1]=o):o=e[1];const i=o;let r;e[2]!==t?(r=Ys(t),e[2]=t,e[3]=r):r=e[3];const a=r;let d;e[4]!==a||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${Ge}`);if(b.status===404)return a&&Zs(a)?(await _e(t,a),a):Je;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),N=fe(v.value);return Se(t,N),N},e[4]=a,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==a||e[8]!==i||e[9]!==d?(l={queryKey:i,queryFn:d,initialData:a,staleTime:0,refetchOnWindowFocus:!1},e[7]=a,e[8]=i,e[9]=d,e[10]=l):l=e[10];const{data:m,isLoading:c}=se(l);let u;e[11]!==t?(u={mutationFn:b=>_e(t,b)},e[11]=t,e[12]=u):u=e[12];const f=nt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==i?(p=b=>{Se(t,b),s.setQueryData(i,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=i,e[17]=p):p=e[17];const h=p;let x;e[18]!==m?(x=fe(m),e[18]=m,e[19]=x):x=e[19];let y;return e[20]!==c||e[21]!==h||e[22]!==x?(y={layout:x,isLoading:c,save:h},e[20]=c,e[21]=h,e[22]=x,e[23]=y):y=e[23],y}const Xe=$.createContext(null);function tn(t){const e=k.c(24),{children:s}=t,{org:o}=J(),i=en(o.slug),[r,a]=$.useState(!1),[d,l]=$.useState(null);let m;e[0]!==i.layout?(m=()=>{l(i.layout),a(!0)},e[0]=i.layout,e[1]=m):m=e[1];const c=m;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),a(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==i?(p=()=>{d&&i.save(d),l(null),a(!1)},e[3]=d,e[4]=i,e[5]=p):p=e[5];const h=p,x=r&&d!==null,y=x?d:i.layout;let b;e[6]!==d||e[7]!==x||e[8]!==i.layout?(b=x?JSON.stringify(d)!==JSON.stringify(i.layout):!1,e[6]=d,e[7]=x,e[8]=i.layout,e[9]=b):b=e[9];const v=b;let N;e[10]!==r||e[11]!==i?(N=S=>{r?l(S):i.save(S)},e[10]=r,e[11]=i,e[12]=N):N=e[12];const j=N;let g;e[13]!==j||e[14]!==c||e[15]!==v||e[16]!==r||e[17]!==y||e[18]!==h||e[19]!==i.isLoading?(g={isEditMode:r,enter:c,cancel:f,save:h,hasChanges:v,layout:y,isLayoutLoading:i.isLoading,commitLayout:j},e[13]=j,e[14]=c,e[15]=v,e[16]=r,e[17]=y,e[18]=h,e[19]=i.isLoading,e[20]=g):g=e[20];let w;return e[21]!==s||e[22]!==g?(w=n.jsx(Xe.Provider,{value:g,children:s}),e[21]=s,e[22]=g,e[23]=w):w=e[23],w}function Ze(){const t=$.useContext(Xe);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function sn({agentId:t}){const{org:e,locator:s}=J(),o=ae({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:i}=rs(),{setTaskId:r}=Dt(),[a,d]=$.useState(null),[l,m]=$.useState(!1),c=$.useRef(!1),u=async(y,b)=>{if(!o){U.error("MCP client not available");return}if(!c.current){c.current=!0,m(!0);try{const v=await os(o,y.name,b),N={type:"doc",content:[{type:"paragraph",content:[Ut({id:y.name,name:Bt(y.name,Vt(y._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},j=crypto.randomUUID();ls(sessionStorage,s,j,{tiptapDoc:N}),await i({id:j,virtual_mcp_id:t}),r(j,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},f=async y=>{if(!c.current){if(y.arguments&&y.arguments.length>0){d(y);return}await u(y)}},p=async y=>{if(!a)return;const b=a;d(null),await u(b,y)};return{start:f,startBlank:async y=>{if(!c.current){c.current=!0,m(!0);try{const b=crypto.randomUUID();await i({id:b,virtual_mcp_id:t}),r(b,t,y?.main?{main:y.main}:void 0)}catch(b){console.error("[start-thread-from-prompt] startBlank failed",b),U.error("Failed to start thread. Please try again.")}finally{c.current=!1,m(!1)}}},dialog:n.jsx(Ft,{prompt:a,setPrompt:y=>d(y),onSubmit:p}),dialogPrompt:a,starting:l}}const q=4,G=100,Ce=12,nn=5,on={w:2,h:2};class pe extends $.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,s){console.error("[home-tiles] tile crashed:",e,s.componentStack)}render(){return this.state.hasError?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[n.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:n.jsx(it,{size:16})}),n.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),n.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:this.state.message??"Something went wrong rendering this tile."})]}):this.props.children}}function rn(t){const e=k.c(72),{tiles:s,isEditMode:o,renderTile:i,onMove:r,onResize:a,onRemove:d}=t,l=ge(),m=$.useRef(null),[c,u]=$.useState(null),[f,p]=$.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activationConstraint:{distance:4}},e[0]=h):h=e[0];const x=Ae(re(Ee,h),re(Pe)),y=s.reduce(ln,0),b=o?Math.max(y+2,4):Math.max(y,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const A=m.current?.getBoundingClientRect();return A?{cellWidth:A.width/q,cellHeight:G}:null},e[1]=v):v=e[1];const N=v;let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=A=>{u(String(A.active.id)),p(N())},e[2]=j):j=e[2];const g=j;let w;e[3]!==f||e[4]!==r||e[5]!==s?(w=A=>{const V=String(A.active.id),D=f??N();if(u(null),p(null),!D||D.cellWidth<=0)return;const E=s.find(W=>W.id===V);if(!E)return;const R=Math.round(A.delta.x/D.cellWidth),F=Math.round(A.delta.y/D.cellHeight);R===0&&F===0||r(V,{x:E.x+R,y:E.y+F})},e[3]=f,e[4]=r,e[5]=s,e[6]=w):w=e[6];const S=w;if(l){let A;if(e[7]!==i||e[8]!==s){let D;e[10]!==i?(D=E=>n.jsx("div",{className:"group bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:G},children:n.jsx(pe,{children:i(E)})},E.id),e[10]=i,e[11]=D):D=e[11],A=s.map(D),e[7]=i,e[8]=s,e[9]=A}else A=e[9];let V;return e[12]!==A?(V=n.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:A}),e[12]=A,e[13]=V):V=e[13],V}let C,_,I,T,P,M,z,B,O;if(e[14]!==c||e[15]!==f||e[16]!==o||e[17]!==S||e[18]!==d||e[19]!==a||e[20]!==i||e[21]!==x||e[22]!==s||e[23]!==b){const A=c?s.find(X=>X.id===c):null;_=Me,B=x,O=g,I=S;const V=b*G,D=o?G*4:G;let E;e[33]!==V||e[34]!==D?(E={height:V,minHeight:D},e[33]=V,e[34]=D,e[35]=E):E=e[35];let R;e[36]!==o||e[37]!==s||e[38]!==b?(R=o&&n.jsx(an,{rows:b,tiles:s}),e[36]=o,e[37]=s,e[38]=b,e[39]=R):R=e[39];let F;if(e[40]!==c||e[41]!==o||e[42]!==d||e[43]!==a||e[44]!==i||e[45]!==s){let X;e[47]!==c||e[48]!==o||e[49]!==d||e[50]!==a||e[51]!==i?(X=ie=>n.jsx(dn,{tile:ie,isEditMode:o,isDragging:c===ie.id,onResize:a,onRemove:d,children:i(ie)},ie.id),e[47]=c,e[48]=o,e[49]=d,e[50]=a,e[51]=i,e[52]=X):X=e[52],F=s.map(X),e[40]=c,e[41]=o,e[42]=d,e[43]=a,e[44]=i,e[45]=s,e[46]=F}else F=e[46];e[53]!==E||e[54]!==R||e[55]!==F?(T=n.jsxs("div",{ref:m,className:"relative w-full",style:E,children:[R,F]}),e[53]=E,e[54]=R,e[55]=F,e[56]=T):T=e[56],C=Pt,P=null;const W=A&&f?A.w*f.cellWidth-Ce:void 0,de=A&&f?A.h*f.cellHeight-Ce:void 0;e[57]!==W||e[58]!==de?(M={width:W,height:de},e[57]=W,e[58]=de,e[59]=M):M=e[59],z=A&&n.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:n.jsx(pe,{children:i(A)})}),e[14]=c,e[15]=f,e[16]=o,e[17]=S,e[18]=d,e[19]=a,e[20]=i,e[21]=x,e[22]=s,e[23]=b,e[24]=C,e[25]=_,e[26]=I,e[27]=T,e[28]=P,e[29]=M,e[30]=z,e[31]=B,e[32]=O}else C=e[24],_=e[25],I=e[26],T=e[27],P=e[28],M=e[29],z=e[30],B=e[31],O=e[32];let L;e[60]!==C||e[61]!==P||e[62]!==M||e[63]!==z?(L=n.jsx(C,{dropAnimation:P,style:M,children:z}),e[60]=C,e[61]=P,e[62]=M,e[63]=z,e[64]=L):L=e[64];let K;return e[65]!==_||e[66]!==I||e[67]!==T||e[68]!==L||e[69]!==B||e[70]!==O?(K=n.jsxs(_,{sensors:B,onDragStart:O,onDragEnd:I,children:[T,L]}),e[65]=_,e[66]=I,e[67]=T,e[68]=L,e[69]=B,e[70]=O,e[71]=K):K=e[71],K}function ln(t,e){return Math.max(t,e.y+e.h)}function an(t){const e=k.c(7),{rows:s,tiles:o}=t;let i;e[0]!==o?(i=(l,m)=>o.some(c=>l>=c.x&&l<c.x+c.w&&m>=c.y&&m<c.y+c.h),e[0]=o,e[1]=i):i=e[1];const r=i;let a;if(e[2]!==r||e[3]!==s){a=[];for(let l=0;l<s;l++)for(let m=0;m<q;m++)r(m,l)||a.push({x:m,y:l});e[2]=r,e[3]=s,e[4]=a}else a=e[4];let d;return e[5]!==a?(d=n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:a.map(cn)}),e[5]=a,e[6]=d):d=e[6],d}function cn(t){return n.jsx("div",{className:"absolute p-1",style:{left:`${t.x/q*100}%`,top:t.y*G,width:`${1/q*100}%`,height:G},children:n.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function dn(t){const e=k.c(31),{tile:s,isEditMode:o,isDragging:i,onResize:r,onRemove:a,children:d}=t,l=!o;let m;e[0]!==l||e[1]!==s.id?(m={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=m):m=e[2];const{setNodeRef:c,attributes:u,listeners:f,isDragging:p}=Et(m),h=`${s.x/q*100}%`,x=`${s.w/q*100}%`,y=s.y*G,b=s.h*G,v=p||i,N=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",j=v&&"opacity-30";let g;e[3]!==N||e[4]!==j?(g=Q("absolute p-1 will-change-[left,top,width,height,opacity]",N,j),e[3]=N,e[4]=j,e[5]=g):g=e[5];let w;e[6]!==b||e[7]!==h||e[8]!==y||e[9]!==x?(w={left:h,top:y,width:x,height:b},e[6]=b,e[7]=h,e[8]=y,e[9]=x,e[10]=w):w=e[10];const S=o&&"outline outline-1 outline-transparent hover:outline-primary/40";let C;e[11]!==S?(C=Q("group relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=C):C=e[12];let _;e[13]!==u||e[14]!==o||e[15]!==f||e[16]!==a||e[17]!==r||e[18]!==s?(_=o&&n.jsxs(n.Fragment,{children:[n.jsx("button",{type:"button",...u,...f,className:"absolute top-2 left-2 z-10 flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted cursor-grab active:cursor-grabbing","aria-label":"Drag tile",children:n.jsx(He,{size:16})}),n.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:n.jsx(mn,{tile:s,onResize:r,onRemove:a})})]}),e[13]=u,e[14]=o,e[15]=f,e[16]=a,e[17]=r,e[18]=s,e[19]=_):_=e[19];let I;e[20]!==d?(I=n.jsx("div",{className:"h-full overflow-hidden",children:n.jsx(pe,{children:d})}),e[20]=d,e[21]=I):I=e[21];let T;e[22]!==I||e[23]!==C||e[24]!==_?(T=n.jsxs("div",{className:C,children:[_,I]}),e[22]=I,e[23]=C,e[24]=_,e[25]=T):T=e[25];let P;return e[26]!==c||e[27]!==T||e[28]!==g||e[29]!==w?(P=n.jsx("div",{ref:c,className:g,style:w,children:T}),e[26]=c,e[27]=T,e[28]=g,e[29]=w,e[30]=P):P=e[30],P}function mn(t){const e=k.c(20),{tile:s,onResize:o,onRemove:i}=t,[r,a]=$.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(as,{asChild:!0,children:n.jsx("button",{type:"button",className:"flex size-8 items-center justify-center rounded-md bg-background/90 border border-border text-muted-foreground hover:text-foreground hover:bg-muted","aria-label":"Tile options",children:n.jsx(jt,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==o||e[2]!==s.id?(l=y=>{o(s.id,y),a(!1)},e[1]=o,e[2]=s.id,e[3]=l):l=e[3];let m;e[4]!==l||e[5]!==s?(m=n.jsx(un,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=m):m=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(cs,{}),e[7]=c):c=e[7];let u;e[8]!==i||e[9]!==s.id?(u=()=>i(s.id),e[8]=i,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx(fs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=n.jsxs(ds,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=n.jsxs(ms,{align:"end",className:"w-auto",children:[m,c,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let x;return e[17]!==r||e[18]!==h?(x=n.jsxs(us,{open:r,onOpenChange:a,children:[d,h]}),e[17]=r,e[18]=h,e[19]=x):x=e[19],x}function un(t){const e=k.c(19),{tile:s,onPick:o}=t,i=s.minW??1,r=s.minH??1,[a,d]=$.useState(null);let l;e[0]!==a||e[1]!==s.h||e[2]!==s.w?(l=a??{w:s.w,h:s.h},e[0]=a,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const m=l;let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=c):c=e[4];let u;e[5]!==m.h||e[6]!==m.w?(u=n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[c,n.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[m.w," × ",m.h]})]}),e[5]=m.h,e[6]=m.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${q}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let h;e[10]!==m.h||e[11]!==m.w||e[12]!==r||e[13]!==i||e[14]!==o?(h=n.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:nn},(y,b)=>Array.from({length:q},(v,N)=>{const j=N+1,g=b+1,w=j<i||g<r,S=j<=m.w&&g<=m.h;return n.jsx("button",{type:"button",disabled:w,"aria-label":`${j} by ${g}`,onPointerEnter:()=>d({w:j,h:g}),onClick:()=>o({w:j,h:g}),className:Q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",w?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${j}x${g}`)}))}),e[10]=m.h,e[11]=m.w,e[12]=r,e[13]=i,e[14]=o,e[15]=h):h=e[15];let x;return e[16]!==u||e[17]!==h?(x=n.jsxs("div",{className:"px-2 py-1.5",children:[u,h]}),e[16]=u,e[17]=h,e[18]=x):x=e[18],x}function fn(t,e,s){return t.some(o=>e>=o.x&&e<o.x+o.w&&s>=o.y&&s<o.y+o.h)}function he(t,e,s){for(let o=0;o<100;o++)for(let i=0;i<=q-e;i++){let r=!0;for(let a=0;a<s&&r;a++)for(let d=0;d<e&&r;d++)fn(t,i+d,o+a)&&(r=!1);if(r)return{x:i,y:o}}return{x:0,y:0}}function me(t,e,s={w:1,h:1}){const o=Math.max(s.w,Math.min(q,t)),i=Math.max(s.h,Math.min(6,e));return{w:o,h:i}}function ue(t,e,s){const o=Math.max(0,Math.min(q-s,t)),i=Math.max(0,e);return{x:o,y:i}}function pn(t,e,s){const o=t.find(l=>l.id===e);if(!o)return t;const i=t.filter(l=>l.id!==e),r=i.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(r&&r.w===o.w&&r.h===o.h)return t.map(l=>l.id===e?{...l,x:r.x,y:r.y}:l.id===r.id?{...l,x:o.x,y:o.y}:l);const d=[{...o,x:s.x,y:s.y}];for(const l of i){const m=he(d,l.w,l.h);d.push({...l,x:m.x,y:m.y})}return d}function hn(t){const e=k.c(35),{layout:s,isLayoutLoading:o,commitLayout:i}=Ze();let r;e[0]!==s.hidden?(r=new Set(s.hidden),e[0]=s.hidden,e[1]=r):r=e[1];const a=r;let d,l;if(e[2]!==t||e[3]!==a||e[4]!==s.tiles){l=[];let v;e[7]!==a?(v=j=>j.pinned||!a.has(j.id),e[7]=a,e[8]=v):v=e[8];const N=t.filter(v);d=new Map;for(const j of t)j.minSize&&d.set(j.id,j.minSize);for(const j of N){const g=s.tiles[j.id];if(!g)continue;const w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),{x:_,y:I}=ue(g.x,g.y,S);l.push({id:j.id,x:_,y:I,w:S,h:C,minW:w?.w,minH:w?.h})}for(const j of N){if(l.some(I=>I.id===j.id))continue;const g=j.defaultSize??on,w=d.get(j.id),{w:S,h:C}=me(g.w,g.h,w),_=he(l,S,C);l.push({id:j.id,x:_.x,y:_.y,w:S,h:C,minW:w?.w,minH:w?.h})}e[2]=t,e[3]=a,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let m;e[9]!==t?(m=new Set(t.map(xn)),e[9]=t,e[10]=m):m=e[10];const c=m;let u;e[11]!==c||e[12]!==i?(u=(v,N)=>{const j={};for(const g of v)j[g.id]={x:g.x,y:g.y,w:g.w,h:g.h};i({version:ee,tiles:j,hidden:N.filter(g=>c.has(g))})},e[11]=c,e[12]=i,e[13]=u):u=e[13];const f=u;let p;e[14]!==l?(p={visible:l},e[14]=l,e[15]=p):p=e[15];let h;e[16]!==f||e[17]!==s||e[18]!==l?(h=(v,N)=>{const j=l.find(S=>S.id===v);if(!j)return;const g=ue(N.x,N.y,j.w);if(g.x===j.x&&g.y===j.y)return;const w=pn(l,v,g);f(w,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=h):h=e[19];let x;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(x=(v,N)=>{const j=l.find(T=>T.id===v);if(!j)return;const g=d.get(v),{w,h:S}=me(N.w,N.h,g);if(w===j.w&&S===j.h)return;const C={...j,w,h:S,x:ue(j.x,j.y,w).x},_=l.filter(T=>T.id!==v),I=[C];for(const T of _){const P=he(I,T.w,T.h);I.push({...T,x:P.x,y:P.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=x):x=e[24];let y;e[25]!==f||e[26]!==s||e[27]!==l?(y=v=>{const N=l.filter(j=>j.id!==v);f(N,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=y):y=e[28];let b;return e[29]!==o||e[30]!==p||e[31]!==h||e[32]!==x||e[33]!==y?(b={snapshot:p,isLoading:o,moveTile:h,resizeTile:x,hideTile:y},e[29]=o,e[30]=p,e[31]=h,e[32]=x,e[33]=y,e[34]=b):b=e[34],b}function xn(t){return t.id}const gn={w:2,h:4},yn={w:1,h:2},bn={w:1,h:1};function jn(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vn(t){return t.tileId?`tile:${t.tileId}`:`tile:${t.agentId}:${t.resourceUri}`}function Nn(t){return t.promptName?t.agentName:t.description}function wn(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function Ye(t){const e=k.c(14),{org:s}=J();let o;e[0]!==s.id||e[1]!==s.slug||e[2]!==t.connectionId?(o=ct({connectionId:t.connectionId,orgId:s.id,orgSlug:s.slug}),e[0]=s.id,e[1]=s.slug,e[2]=t.connectionId,e[3]=o):o=e[3];const{data:i}=se(o),r=!!i&&!t.toolName;let a;e[4]!==i||e[5]!==r?(a={client:i,enabled:r},e[4]=i,e[5]=r,e[6]=a):a=e[6];const{data:d}=ss(a);let l;e[7]!==t.resourceUri||e[8]!==t.toolName||e[9]!==d?.tools?(l=t.toolName??d?.tools.find(u=>Re(u._meta)===t.resourceUri)?.name,e[7]=t.resourceUri,e[8]=t.toolName,e[9]=d?.tools,e[10]=l):l=e[10];const m=l;let c;return e[11]!==t.connectionId||e[12]!==m?(c=m?is(t.connectionId,m):void 0,e[11]=t.connectionId,e[12]=m,e[13]=c):c=e[13],c}function Ne(t){const e=k.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:o,startBlank:i,dialog:r,starting:a}=sn(s);let d;e[2]!==o||e[3]!==i?(d=c=>{if(!c.promptName){i();return}o(wn(c))},e[2]=o,e[3]=i,e[4]=d):d=e[4];const l=d;let m;return e[5]!==r||e[6]!==l||e[7]!==i||e[8]!==a?(m={open:l,startBlank:i,dialog:r,starting:a},e[5]=r,e[6]=l,e[7]=i,e[8]=a,e[9]=m):m=e[9],m}function Sn(t){const e=k.c(32),{entry:s,isEditMode:o}=t,{open:i,dialog:r,starting:a}=Ne(s.agentId);let d;e[0]!==s||e[1]!==i?(d=()=>i(s),e[0]=s,e[1]=i,e[2]=d):d=e[2];const l=a||o,m=!o&&"cursor-pointer transition-colors hover:bg-accent/40",c=o&&"cursor-default pl-12",u=a&&"opacity-60";let f;e[3]!==m||e[4]!==c||e[5]!==u?(f=Q("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",m,c,u),e[3]=m,e[4]=c,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=n.jsx(ce,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let h;e[10]!==s.title?(h=n.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=h):h=e[11];let x;e[12]!==s?(x=Nn(s),e[12]=s,e[13]=x):x=e[13];let y;e[14]!==x?(y=n.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=y):y=e[15];let b;e[16]!==y||e[17]!==h?(b=n.jsxs("div",{className:"min-w-0 flex-1",children:[h,y]}),e[16]=y,e[17]=h,e[18]=b):b=e[18];let v;e[19]!==o?(v=!o&&n.jsx(ns,{size:16,className:"shrink-0 text-muted-foreground opacity-0 -translate-x-1 transition-all duration-200 group-hover/tile:opacity-100 group-hover/tile:translate-x-0","aria-hidden":!0}),e[19]=o,e[20]=v):v=e[20];let N;e[21]!==a||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(N=n.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":a,className:f,children:[p,b,v]}),e[21]=a,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=N):N=e[28];let j;return e[29]!==r||e[30]!==N?(j=n.jsxs(n.Fragment,{children:[N,r]}),e[29]=r,e[30]=N,e[31]=j):j=e[31],j}function _n(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("div",{className:"mt-4 grid w-full grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:Array.from({length:3},Cn)}),t[0]=e):e=t[0],e}function Cn(t,e){return n.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[n.jsx(H,{className:"size-10 rounded-xl"}),n.jsxs("div",{className:"flex-1 space-y-1.5",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function In(t){const e=k.c(17),{tile:s,prompts:o,isEditMode:i,tileWidth:r}=t,{org:a}=J(),{open:d,startBlank:l,dialog:m,starting:c}=Ne(s.agentId),u=o.filter(Tn),f=Ye(s),p="relative flex h-full w-full flex-col p-3";let h;e[0]!==i||e[1]!==f||e[2]!==l||e[3]!==c?(h=!i&&n.jsx("button",{type:"button",onClick:()=>{l(f?{main:f}:void 0)},disabled:c,"aria-busy":c,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[0]=i,e[1]=f,e[2]=l,e[3]=c,e[4]=h):h=e[4];const x="flex min-h-0 flex-1 gap-3 overflow-hidden";let y;e[5]===Symbol.for("react.memo_cache_sentinel")?(y=n.jsx($n,{}),e[5]=y):y=e[5];let b;e[6]!==a.id||e[7]!==a.slug||e[8]!==s?(b=n.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:n.jsx($.Suspense,{fallback:y,children:n.jsx(kn,{tile:s,orgId:a.id,orgSlug:a.slug})})}),e[6]=a.id,e[7]=a.slug,e[8]=s,e[9]=b):b=e[9];const v=u.length>0&&!i&&r>=2&&n.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:u.map(g=>n.jsx("button",{type:"button",onClick:()=>d(g),disabled:c,className:"shrink-0 rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:g.title})},g.promptName))});let N;e[10]!==b||e[11]!==v?(N=n.jsxs("div",{className:x,children:[b,v]}),e[10]=b,e[11]=v,e[12]=N):N=e[12];let j;return e[13]!==m||e[14]!==h||e[15]!==N?(j=n.jsxs("div",{className:p,children:[h,N,m]}),e[13]=m,e[14]=h,e[15]=N,e[16]=j):j=e[16],j}function Tn(t){return!!t.promptName}function kn(t){const e=k.c(13),{tile:s,orgId:o,orgSlug:i}=t;let r;e[0]!==o||e[1]!==i||e[2]!==s.connectionId?(r={connectionId:s.connectionId,orgId:o,orgSlug:i},e[0]=o,e[1]=i,e[2]=s.connectionId,e[3]=r):r=e[3];const a=ae(r),d=s.minHeight??200,l=s.maxHeight??4e3;let m;return e[4]!==a||e[5]!==o||e[6]!==i||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri||e[11]!==s.toolInput?(m=n.jsx(Jt,{resourceURI:s.resourceUri,orgId:o,orgSlug:i,connectionId:s.connectionId,client:a,toolInput:s.toolInput,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=a,e[5]=o,e[6]=i,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=s.toolInput,e[12]=m):m=e[12],m}function $n(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[n.jsx(H,{className:"h-3 w-2/3"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function An(t){const e=k.c(14),{icon:s,name:o}=t;let i;e[0]!==s||e[1]!==o?(i=n.jsx(ce,{icon:s,name:o,size:"sm+"}),e[0]=s,e[1]=o,e[2]=i):i=e[2];let r;e[3]!==o?(r=n.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:o}),e[3]=o,e[4]=r):r=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=a):a=e[5];let d;e[6]!==r?(d=n.jsxs("div",{className:"min-w-0 flex-1",children:[r,a]}),e[6]=r,e[7]=d):d=e[7];let l;e[8]!==i||e[9]!==d?(l=n.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[8]=i,e[9]=d,e[10]=l):l=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[n.jsx(H,{className:"h-3 w-3/4"}),n.jsx(H,{className:"h-3 w-1/2"}),n.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=m):m=e[11];let c;return e[12]!==l?(c=n.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,m]}),e[12]=l,e[13]=c):c=e[13],c}function Pn(t){const e=k.c(10),{tile:s,prompts:o,isEditMode:i}=t,{open:r,startBlank:a,dialog:d,starting:l}=Ne(s.agentId),m=o.filter(En),c=Ye(s),u="flex h-full w-full flex-col gap-3 p-4";let f;e[0]!==c||e[1]!==a?(f=()=>{a(c?{main:c}:void 0)},e[0]=c,e[1]=a,e[2]=f):f=e[2];const p=l||i;let h;e[3]!==f||e[4]!==p?(h=n.jsx("button",{type:"button",onClick:f,disabled:p,className:"mb-1 self-start rounded-md px-2 py-1 text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:"Open chat"}),e[3]=f,e[4]=p,e[5]=h):h=e[5];const x=m.length>0&&!i&&n.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:m.map(b=>n.jsx("button",{type:"button",onClick:()=>!i&&r(b),disabled:l,className:"rounded-lg border border-border bg-background px-2.5 py-2 text-left text-xs leading-snug text-foreground transition-colors hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",children:n.jsx("span",{className:"line-clamp-2",children:b.title})},b.promptName))});let y;return e[6]!==d||e[7]!==h||e[8]!==x?(y=n.jsxs("div",{className:u,children:[h,x,d]}),e[6]=d,e[7]=h,e[8]=x,e[9]=y):y=e[9],y}function En(t){return!!t.promptName}function et({isEditMode:t}){const{org:e}=J(),{isLoading:s,prompts:o,tiles:i}=be(e.slug),r=ze()?.ids??[],a=new Set(r),d=Oe(),l=Ue(),m=xe(),c=new Set(i.map(g=>g.agentId)),u=new Map;for(const g of o){const w=u.get(g.agentId);w?w.push(g):u.set(g.agentId,[g])}const f=o.filter(g=>!c.has(g.agentId)),p=[...i.map(g=>({kind:"tile",id:vn(g),data:g})),...f.map(g=>({kind:"prompt",id:jn(g),data:g}))],h=new Map(p.map(g=>[g.id,g])),x=hn(p.map(g=>({id:g.id,defaultSize:g.kind==="tile"?gn:bn,minSize:g.kind==="tile"?yn:void 0,pinned:a.has(g.data.agentId)}))),y=g=>{d.apply(w=>w.filter(S=>S!==g)).catch(()=>U.error("Couldn't remove from home — please try again."))},b=async g=>{if(i.filter(S=>S.agentId===g.agentId).length<=1){y(g.agentId);return}try{const C=(await l.call("COLLECTION_VIRTUAL_MCP_GET",{id:g.agentId})).item;if(!C)throw new Error("Agent not found");const _=Z(C.metadata?.ui),I=g.tileId?_.filter(T=>T.tileId!==g.tileId):_.filter(T=>T.connectionId!==g.connectionId||T.resourceUri!==g.resourceUri);await l.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:g.agentId,data:{metadata:{...C.metadata??{},ui:{...C.metadata?.ui??{},homeTile:null,homeTiles:I}}}}),m.invalidateQueries({queryKey:te.homeNextActions(e.slug)})}catch{U.error("Couldn't remove tile — please try again.")}},v=g=>{const w=h.get(g);if(w){if(!a.has(w.data.agentId)){x.hideTile(g);return}w.kind==="tile"?b(w.data):y(w.data.agentId)}},N=g=>{const w=h.get(g.id);if(!w)return null;if(w.kind==="tile"){const S=u.get(w.data.agentId)??[];return n.jsx(ot,{fallback:n.jsx(Pn,{tile:w.data,prompts:S,isEditMode:t}),children:n.jsx($.Suspense,{fallback:n.jsx(An,{icon:w.data.agentIcon,name:w.data.agentName}),children:n.jsx(In,{tile:w.data,prompts:S,isEditMode:t,tileWidth:g.w})})})}return n.jsx(Sn,{entry:w.data,isEditMode:t})};return s||x.isLoading?n.jsx(_n,{}):x.snapshot.visible.length===0&&!t?null:n.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:n.jsx(rn,{tiles:x.snapshot.visible,isEditMode:t,renderTile:N,onMove:x.moveTile,onResize:x.resizeTile,onRemove:v})})}function Mn(t){const e=k.c(2),{prompts:s,tiles:o}=be(t),i=o.length>0||s.length>0;let r;return e[0]!==i?(r={hasVisibleTiles:i},e[0]=i,e[1]=r):r=e[1],r}const Ie=420,Te=305;function tt(){const t=k.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/bg-top-left.svg",alt:"",className:"absolute top-0 left-0 h-auto select-none opacity-80 dark:hidden",style:{width:Ie}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("img",{src:"/home/bg-top-left-dark.svg",alt:"",className:"absolute top-0 left-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Ie}}),t[1]=s):s=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("img",{src:"/home/bg-bottom-right.svg",alt:"",className:"absolute bottom-0 right-0 h-auto select-none opacity-80 dark:hidden",style:{width:Te}}),t[2]=o):o=t[2];let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,o,n.jsx("img",{src:"/home/bg-bottom-right-dark.svg",alt:"",className:"absolute bottom-0 right-0 hidden h-auto select-none opacity-80 dark:block",style:{width:Te}})]}),t[3]=i):i=t[3],i}function ke(){const t=k.c(33),{data:e}=rt.useSession(),{org:s}=J(),o=ge(),i=xs(),{selectedVirtualMcp:r}=Nt();let a;t[0]!==s.id?(a=dt(s.id),t[0]=s.id,t[1]=a):a=t[1];const l=r??a;let m;t[2]!==s.slug?(m=Ht(s.slug),t[2]=s.slug,t[3]=m):m=t[3],se(m);let c;t[4]!==s.id||t[5]!==s.slug?(c={connectionId:mt,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=c):c=t[6];const u=ae(c);let f;t[7]!==s.id||t[8]!==s.slug?(f=ps(s.slug,s.id),t[7]=s.id,t[8]=s.slug,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==s.slug?(p=Lt(s.slug,s.id),t[10]=s.id,t[11]=s.slug,t[12]=p):p=t[12];let h;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(h=pt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=h):h=t[16];let x;t[17]!==f||t[18]!==p||t[19]!==h?(x={queries:[f,p,h]},t[17]=f,t[18]=p,t[19]=h,t[20]=x):x=t[20],ys(x);const y=hs(),b=ht(l.id),{hasDecoKey:v,isZeroBalance:N,isInitialFreeCredit:j,balanceDollars:g,hasOnlyDecoProvider:w}=Mt(),{hasVisibleTiles:S}=Mn(s.slug),C=zt(b?.metadata);if(y.length===0&&!(C&&Ot(i))){let L;return t[21]===Symbol.for("react.memo_cache_sentinel")?(L=n.jsx("div",{className:"flex-1 overflow-y-auto",children:n.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:n.jsx(wt,{})})}),t[21]=L):L=t[21],L}let I;t[22]!==e?.user?.name?(I=e?.user?.name?.split(" ")[0]||"there",t[22]=e?.user?.name,t[23]=I):I=t[23];const T=I,P=v&&j&&g!=null,M=v&&N&&w;let z;t[24]!==g||t[25]!==P||t[26]!==M?(z=P?n.jsx(oe.CreditsEyebrow,{balanceDollars:g}):M?n.jsx(oe.NoCreditsEyebrow,{}):null,t[24]=g,t[25]=P,t[26]=M,t[27]=z):z=t[27];const B=z;let O;return t[28]!==B||t[29]!==S||t[30]!==o||t[31]!==T?(O=n.jsx(tn,{children:o?n.jsx(zn,{eyebrow:B,userName:T}):n.jsx(On,{eyebrow:B,userName:T,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=o,t[31]=T,t[32]=O):O=t[32],O}function zn(t){const e=k.c(12),{eyebrow:s,userName:o}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(tt,{}),e[0]=i):i=e[0];let r;e[1]!==s?(r=s&&n.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=r):r=e[2];let a;e[3]!==o?(a=n.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",o,"?"]}),e[3]=o,e[4]=a):a=e[4];let d;e[5]!==r||e[6]!==a?(d=n.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[r,a]}),e[5]=r,e[6]=a,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:n.jsx(oe.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsx("div",{className:"relative w-full px-4 pb-8",children:n.jsx(et,{isEditMode:!1})}),e[9]=m):m=e[9];let c;return e[10]!==d?(c=n.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[i,d,l,m]}),e[10]=d,e[11]=c):c=e[11],c}function On(t){const e=k.c(32),{eyebrow:s,userName:o,hasVisibleTiles:i}=t,{isEditMode:r,enter:a,save:d,cancel:l,hasChanges:m}=Ze(),[c,u]=$.useState(!1);let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>u(!0),e[0]=f):f=e[0];let p;e[1]!==l||e[2]!==a||e[3]!==m||e[4]!==r||e[5]!==d?(p=n.jsx(gs.Right,{children:n.jsx(Ln,{isEditMode:r,hasChanges:m,onEnter:a,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=a,e[3]=m,e[4]=r,e[5]=d,e[6]=p):p=e[6];let h;e[7]!==c?(h=n.jsx(js,{open:c,onOpenChange:u}),e[7]=c,e[8]=h):h=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(tt,{}),e[9]=x):x=e[9];const y=i||r?"pt-32":"flex-1 justify-center";let b;e[10]!==y?(b=Q("relative flex flex-col items-center px-10 pb-4",y),e[10]=y,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&n.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let N;e[14]!==o?(N=n.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",o,"?"]}),e[14]=o,e[15]=N):N=e[15];let j;e[16]!==v||e[17]!==N?(j=n.jsxs("div",{className:"text-center mb-10",children:[v,N]}),e[16]=v,e[17]=N,e[18]=j):j=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsxs("div",{className:"relative w-full",children:[n.jsx(Dn,{}),n.jsx(oe.Input,{showConnectionsBanner:!0})]}),e[19]=g):g=e[19];let w;e[20]!==j?(w=n.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[j,g]}),e[20]=j,e[21]=w):w=e[21];let S;e[22]!==r?(S=n.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:n.jsx(et,{isEditMode:r})}),e[22]=r,e[23]=S):S=e[23];let C;e[24]!==w||e[25]!==S||e[26]!==b?(C=n.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,n.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:n.jsxs("div",{className:b,children:[w,S]})})]}),e[24]=w,e[25]=S,e[26]=b,e[27]=C):C=e[27];let _;return e[28]!==C||e[29]!==p||e[30]!==h?(_=n.jsxs(n.Fragment,{children:[p,h,C]}),e[28]=C,e[29]=p,e[30]=h,e[31]=_):_=e[31],_}function Ln(t){const e=k.c(17),{isEditMode:s,hasChanges:o,onEnter:i,onSave:r,onCancel:a,onAddTile:d}=t;if(s){let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx(ye,{size:14}),e[0]=c):c=e[0];let u;e[1]!==d?(u=n.jsxs("button",{type:"button",onClick:d,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Add a tile from any agent",children:[c,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx($e,{size:14}),e[3]=f):f=e[3];let p;e[4]!==a?(p=n.jsxs(Y,{size:"sm",variant:"ghost",onClick:a,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=a,e[5]=p):p=e[5];const h=!o;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(xt,{size:14}),e[6]=x):x=e[6];let y;e[7]!==r||e[8]!==h?(y=n.jsxs(Y,{size:"sm",onClick:r,disabled:h,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=r,e[8]=h,e[9]=y):y=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==y?(b=n.jsxs(n.Fragment,{children:[u,p,y]}),e[10]=u,e[11]=p,e[12]=y,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsx(vt,{size:14}),e[14]=l):l=e[14];let m;return e[15]!==i?(m=n.jsxs("button",{type:"button",onClick:i,className:"flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-foreground transition-colors",title:"Customize your home",children:[l,"Customize"]}),e[15]=i,e[16]=m):m=e[16],m}function Dn(){const t=k.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx("img",{src:"/home/capybara.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute -top-16 right-6 z-20 h-20 w-auto select-none"}),t[0]=e):e=t[0],e}function Vo(){const t=k.c(2);if(ge()){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=n.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:n.jsx(ke,{})}),t[0]=o):o=t[0],o}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:n.jsx("div",{className:"h-full p-0.5 pt-0.25",children:n.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:n.jsx(ke,{})})})}),t[1]=s):s=t[1],s}export{Vo as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{c as le,r as K,b as yt,
|
|
1
|
+
import{c as le,r as K,b as yt,C as Be,j as t,B as Z,t as Se,l as de,K as it,k as wt,a7 as rs,u as ls,y as xt,E as os}from"./index-CZQAHCWx.js";import{S as as}from"./search-input-Db1Wlp2M.js";import{P as De}from"./index-BtAPhKbE.js";import{E as St}from"./empty-state-DVp61Buk.js";import{R as ns}from"./require-capability-ghUcEykT.js";import{J as Tt,S as is}from"./scroll-area-DFbOrGft.js";import{u as vt}from"./use-connection-D9HsjWxg.js";import{g as Pt}from"./connection-slug-eyAPH6o3.js";import{B as rt}from"./badge-BkyT3WoL.js";import{P as ct,a as dt,b as mt}from"./popover-BLg2uxUj.js";import{T as Ze,a as et,b as tt}from"./tooltip-Dcp4xtTX.js";import{i as ft,n as cs}from"./ChevronUp-hzSQl57_.js";import{a as Xe}from"./Eye-Du8USWUC.js";import{n as Mt}from"./Globe01-ByUFNYZ1.js";import{i as At}from"./FilterLines-D51fKry2.js";import{i as ds}from"./Key01-CI_-yaVv.js";import{i as ms}from"./Play-Bpofg5MS.js";import{ak as us,T as xs,M as fs}from"./agent-icon-B6eCx9D1.js";import{M as _t}from"./monaco-editor-DwYoS9zw.js";import{u as ps}from"./use-members-DyLgAHg5.js";import{S as hs,u as gs,W as js}from"./use-mcp-client-7EfqWxgd.js";import{u as vs}from"./use-virtual-mcp-CTBnE7sF.js";import{n as Qe}from"./XCircle-ZlnM-le2.js";import{c as Ns}from"./SwitchHorizontal01-COrtT0WP.js";import{s as bs}from"./Plus-B6Bp27KE.js";import{s as ys}from"./Trash01-S_d8yXYH.js";import{I as Ge}from"./input-Bnf6c030.js";import{C as ws,g as Ss,b as Dt,f as st,a as Vt,c as pt,d as Is,e as Lt,h as Ut,A as Cs,T as ks,i as Ts,M as ht}from"./automation-runs-B9slN7zB.js";import{a as lt,b as ot,c as at,d as $e,S as nt}from"./select-Biv4m02a.js";import{t as Kt}from"./ChevronDown-8-SpQ5a6.js";import{s as Ms}from"./Stars02-B4L_1USv.js";import{T as _s}from"./textarea-BFNmWFvP.js";import{C as qt}from"./collection-tabs-C8hplLSb.js";import{S as Ds}from"./switch-DQj88pZv.js";import{L as Ls}from"./label-Di7vPCvs.js";import{I as qe}from"./integration-icon-BZb9eAa5.js";import{A as Bt}from"./avatar-CMukQvh7.js";import{A as Fs,a as Rs,b as $s}from"./alert-DG7kpTTq.js";import{C as Ht}from"./card-Bs3t5A2h.js";import{K as Me}from"./monitoring-stats-row-DkqIQOcq.js";import{u as Jt}from"./studio-tools-DCyngkzJ.js";import{u as zs}from"./useSuspenseInfiniteQuery-BJo3aYmp.js";import{b as Os,S as Es,c as Ps,d as As}from"./sheet-CLgUQ0k9.js";import{T as Fe,a as ut,b as Gt,c as Qt,d as Wt,e as ae}from"./table-Du45gWno.js";import{u as Vs}from"./use-infinite-scroll-CJlKxIxa.js";import{c as Us,b as Ks}from"./use-automations-D4GU11Hn.js";import"./SearchMd-DY2IStnr.js";import"./sidebar-B6ogJK6o.js";import"./LayoutLeft-DnqAFiqW.js";import"./use-mobile-CeVjRMu3.js";import"./use-capability-CAL5M8kW.js";import"./access-gate-FCkKFtCU.js";import"./capability-load-error-b3EGpgG0.js";import"./Stars01-DjTb55Tj.js";import"./ChevronRight-C7AnVgNL.js";import"./use-clock-tick-CG1lc4nO.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B6e0ArXF.js";import"./file-type-icon-BCa6hDuH.js";import"./dialog-DGm31nBN.js";import"./X-ClFhIPPx.js";import"./ZoomOut-BkeollDv.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-BhFW6kUE.js";import"./chat-context-DueHVvJY.js";import"./hooks-DpQFLCh_.js";import"./decopilot-sse-pool-BTlcRVcA.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-BMg8Dsli.js";import"./use-organization-settings-Bvieu16r.js";import"./AlertCircle-eL7jEjpx.js";import"./Star01-COmcJPAd.js";import"./XClose-Cr1-H9ci.js";import"./ZapSquare-Brn6J5mG.js";import"./Tool01-D9Z3ra2m.js";import"./Monitor01-Cx6UPY56.js";import"./Upload01-BovBQGIq.js";import"./shell-layout-fqgrNv9Y.js";import"./Users03-DTBaxDUb.js";import"./CheckCircle-Ce4sW5Fr.js";import"./Zap-TPho1Yix.js";import"./required-auth-layout-SCPc1ODv.js";import"./use-org-sso-3_seOFru.js";import"./LinkExternal01-C9plWUCQ.js";import"./ArrowUpRight-BtZv9HXz.js";import"./Palette-DxYtHeiN.js";import"./use-navigate-to-agent-CfSjeQwH.js";import"./use-mcp-prompts-DIkRTD9t.js";import"./form-B5xe8o6u.js";import"./use-collections-BYr7pEmZ.js";import"./Settings02-CzDpZT_t.js";import"./ChevronLeft-DQ6Y033o.js";import"./DotsVertical-CBCiPEnd.js";import"./Globe04-BnUIZrLZ.js";import"./HardDrive-OrjxQFg1.js";import"./Sun-BrBndJzL.js";import"./Shield01-ByoQOTwe.js";import"./User01-Dcns6QTI.js";import"./Users01-Dua8TttV.js";import"./index-CRPVmS_G.js";import"./use-org-auth-client-CVfi2bFZ.js";import"./auth-B9FveTwh.js";import"./useInfiniteQuery-B8aLEC__.js";import"./task-status-B_9F2gh5.js";import"./checkbox-LHoIUSFR.js";import"./command-BQdrUZdP.js";import"./index-BOJe9uwl.js";import"./index-CuxqDMpm.js";const Nt={maxJsonRenderSize:5e4,pageSize:50,streamingRefetchInterval:3e3};function Re(s){return s.filter(e=>e.key.trim()).map(e=>{const r=encodeURIComponent(e.key.trim()),l=encodeURIComponent(e.value||"");return`${r}:${e.operator}:${l}`}).join(",")}function qs(s){return s?s.split(",").map(e=>{const[r,l,...a]=e.split(":");return{key:decodeURIComponent(r||""),operator:l||"eq",value:decodeURIComponent(a.join(":")||"")}}):[]}function Ye(s){return s.filter(e=>e.key.trim()).map(e=>{switch(e.operator){case"eq":return`${e.key}=${e.value}`;case"contains":return`${e.key}~${e.value}`;case"exists":return`${e.key}?`;case"in":return`${e.key}@${e.value}`}}).join(`
|
|
2
2
|
`)}function Ft(s){return s.trim()?s.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{if(e.endsWith("?"))return{key:e.slice(0,-1),operator:"exists",value:""};if(e.includes("=")){const[r,...l]=e.split("=");return{key:r||"",operator:"eq",value:l.join("=")}}if(e.includes("~")){const[r,...l]=e.split("~");return{key:r||"",operator:"contains",value:l.join("~")}}if(e.includes("@")){const[r,...l]=e.split("@");return{key:r||"",operator:"in",value:l.join("@")}}return{key:e,operator:"exists",value:""}}):[]}function Bs(s){const e={},r={},l=[],a={};for(const o of s)if(o.key.trim())switch(o.operator){case"eq":o.value&&(e[o.key]=o.value);break;case"contains":o.value&&(r[o.key]=`%${o.value}%`);break;case"exists":l.push(o.key);break;case"in":o.value&&(a[o.key]=o.value);break}return{properties:Object.keys(e).length>0?e:void 0,propertyPatterns:Object.keys(r).length>0?r:void 0,propertyKeys:l.length>0?l:void 0,propertyInValues:Object.keys(a).length>0?a:void 0}}function Rt(s){if(!s)return{content:"null",isTruncated:!1,originalSize:4};if(typeof s._decocms_truncated=="string")return{content:s._decocms_truncated,isTruncated:!0,originalSize:s._decocms_truncated.length};const e=JSON.stringify(s,null,2),r=e.length;return r<=Nt.maxJsonRenderSize?{content:e,isTruncated:!1,originalSize:r}:{content:e.slice(0,Nt.maxJsonRenderSize)+`
|
|
4
4
|
|
|
5
5
|
... [TRUNCATED - content too large to display]`,isTruncated:!0,originalSize:r}}function Hs(s){const e=le.c(117),{log:r}=s,[l,a]=K.useState(!1),[o,c]=K.useState(!1),i=yt(),{org:n}=Be(),d=vt(),f=Rt(r.input),p=Rt(r.output),v=Js;let b;e[0]!==r.input||e[1]!==r.output?(b=async se=>{const ee=v(se==="input"?r.input:r.output);try{await navigator.clipboard.writeText(ee),se==="input"?(a(!0),setTimeout(()=>a(!1),2e3)):(c(!0),setTimeout(()=>c(!1),2e3))}catch{Se.error("Failed to copy to clipboard")}},e[0]=r.input,e[1]=r.output,e[2]=b):b=e[2];const u=b;let R;e[3]!==r.id||e[4]!==r.input||e[5]!==r.output||e[6]!==r.toolName?(R=se=>{const ee=v(se==="input"?r.input:r.output),oe=new Blob([ee],{type:"application/json"}),he=URL.createObjectURL(oe),be=document.createElement("a");be.href=he,be.download=`${r.toolName}-${se}-${r.id}.json`,be.click(),URL.revokeObjectURL(he)},e[3]=r.id,e[4]=r.input,e[5]=r.output,e[6]=r.toolName,e[7]=R):R=e[7];const h=R;let j;e[8]!==d||e[9]!==r.connectionId||e[10]!==r.input||e[11]!==r.toolName||e[12]!==i||e[13]!==n?(j=()=>{const se=d.find(oe=>oe.id===r.connectionId);if(!se){Se.error("Could not find the connection for this tool call");return}const ee=crypto.randomUUID();sessionStorage.setItem(`replay-${ee}`,JSON.stringify(r.input)),i({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:n.slug,appSlug:Pt(se),collectionName:"tools",itemId:encodeURIComponent(r.toolName)},search:{replayId:ee}})},e[8]=d,e[9]=r.connectionId,e[10]=r.input,e[11]=r.toolName,e[12]=i,e[13]=n,e[14]=j):j=e[14];const m=j,[C,S]=K.useState(!1);let g;e[15]!==r.requestId?(g=async()=>{try{await navigator.clipboard.writeText(r.requestId),S(!0),setTimeout(()=>S(!1),2e3)}catch{Se.error("Failed to copy to clipboard")}},e[15]=r.requestId,e[16]=g):g=e[16];const _=g;let I;e[17]!==r.timestamp?(I=new Date(r.timestamp).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[17]=r.timestamp,e[18]=I):I=e[18];const x=I,F="text-sm px-5 md:px-6 py-5 space-y-5";let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Timestamp"}),e[19]=w):w=e[19];let D;e[20]!==x?(D=t.jsxs("div",{children:[w,t.jsx("div",{className:"text-sm text-foreground",children:x})]}),e[20]=x,e[21]=D):D=e[21];let k;e[22]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Duration"}),e[22]=k):k=e[22];let O;e[23]!==r.durationMs?(O=t.jsxs("div",{children:[k,t.jsxs("div",{className:"text-sm font-mono text-foreground",children:[r.durationMs,"ms"]})]}),e[23]=r.durationMs,e[24]=O):O=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[25]=$):$=e[25];let J;e[26]!==r.userName?(J=t.jsxs("div",{children:[$,t.jsx("div",{className:"text-sm text-foreground",children:r.userName})]}),e[26]=r.userName,e[27]=J):J=e[27];let P;e[28]!==r.virtualMcpName?(P=r.virtualMcpName&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsx("div",{className:"text-sm text-foreground",children:r.virtualMcpName})]}),e[28]=r.virtualMcpName,e[29]=P):P=e[29];let X;e[30]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Request ID"}),e[30]=X):X=e[30];let y;e[31]!==r.requestId?(y=t.jsx("code",{className:"font-mono text-foreground text-[11px]",children:r.requestId}),e[31]=r.requestId,e[32]=y):y=e[32];let T;e[33]!==C?(T=C?t.jsx(ft,{size:12}):t.jsx(Xe,{size:12}),e[33]=C,e[34]=T):T=e[34];let L;e[35]!==_||e[36]!==T?(L=t.jsx(Z,{size:"icon",variant:"ghost",onClick:_,"aria-label":"Copy request ID",className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:T}),e[35]=_,e[36]=T,e[37]=L):L=e[37];let z;e[38]!==y||e[39]!==L?(z=t.jsxs("div",{children:[X,t.jsxs("div",{className:"flex items-center gap-1",children:[y,L]})]}),e[38]=y,e[39]=L,e[40]=z):z=e[40];let E;e[41]!==r.userAgent?(E=r.userAgent&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Client"}),t.jsx("div",{className:"text-sm font-mono text-foreground",children:r.userAgent})]}),e[41]=r.userAgent,e[42]=E):E=e[42];let U;e[43]!==r.properties||e[44]!==i||e[45]!==n?(U=r.properties&&Object.keys(r.properties).length>0&&t.jsxs("div",{className:"md:col-span-2",children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1.5",children:"Properties"}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(r.properties).map(se=>{const[ee,oe]=se;return t.jsxs(ct,{children:[t.jsx(dt,{asChild:!0,children:t.jsxs(rt,{variant:"secondary",className:"font-mono text-xs px-2 py-0.5 cursor-pointer hover:bg-secondary/80 transition-colors",children:[ee,"=",oe]})}),t.jsx(mt,{className:"w-auto p-1",align:"end",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:()=>{const he={key:ee,operator:"eq",value:oe};i({to:"/$org/settings/monitor",params:{org:n.slug},search:{propertyFilters:Re([he])}})},children:[t.jsx(At,{size:14,className:"mr-2"}),"Filter by this property"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(`${ee}=${oe}`),Se.success("Copied filter to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(Xe,{size:14,className:"mr-2"}),"Copy filter"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(ee),Se.success("Copied key to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(ds,{size:14,className:"mr-2"}),"Copy key"]}),t.jsxs(Z,{variant:"ghost",size:"sm",className:"justify-start h-8 px-2 text-xs font-normal focus-visible:ring-0 focus-visible:ring-offset-0",onClick:async()=>{try{await navigator.clipboard.writeText(oe),Se.success("Copied value to clipboard")}catch{Se.error("Failed to copy to clipboard")}},children:[t.jsx(us,{size:14,className:"mr-2"}),"Copy value"]})]})})]},ee)})})]}),e[43]=r.properties,e[44]=i,e[45]=n,e[46]=U):U=e[46];let q;e[47]!==O||e[48]!==J||e[49]!==P||e[50]!==z||e[51]!==E||e[52]!==U||e[53]!==D?(q=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",children:[D,O,J,P,z,E,U]}),e[47]=O,e[48]=J,e[49]=P,e[50]=z,e[51]=E,e[52]=U,e[53]=D,e[54]=q):q=e[54];let V;e[55]!==r.errorMessage?(V=r.errorMessage&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-destructive mb-1",children:"Error"}),t.jsx("div",{className:"text-destructive font-mono text-xs bg-destructive/10 p-2 rounded break-all",children:r.errorMessage})]}),e[55]=r.errorMessage,e[56]=V):V=e[56];const Y="space-y-4";let B;e[57]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Input"}),e[57]=B):B=e[57];const G=f.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(f.originalSize)," - truncated)"]});let A;e[58]!==G?(A=t.jsxs("div",{className:"flex items-center gap-2",children:[B,G]}),e[58]=G,e[59]=A):A=e[59];let N;e[60]!==m||e[61]!==r.input?(N=r.input&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:m,"aria-label":"Replay tool call",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(ms,{size:14})})}),t.jsx(tt,{children:"Replay tool call"})]}),e[60]=m,e[61]=r.input,e[62]=N):N=e[62];let M;e[63]!==h||e[64]!==f?(M=f.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("input"),"aria-label":"Download full input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Mt,{size:14})})}),t.jsx(tt,{children:"Download full input"})]}),e[63]=h,e[64]=f,e[65]=M):M=e[65];let H;e[66]!==u?(H=()=>u("input"),e[66]=u,e[67]=H):H=e[67];let te;e[68]!==l?(te=l?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[68]=l,e[69]=te):te=e[69];let Q;e[70]!==H||e[71]!==te?(Q=t.jsx(Z,{size:"icon",variant:"ghost",onClick:H,"aria-label":"Copy input",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:te}),e[70]=H,e[71]=te,e[72]=Q):Q=e[72];let re;e[73]!==N||e[74]!==M||e[75]!==Q?(re=t.jsxs("div",{className:"flex items-center gap-1",children:[N,M,Q]}),e[73]=N,e[74]=M,e[75]=Q,e[76]=re):re=e[76];let W;e[77]!==A||e[78]!==re?(W=t.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 border-b border-border",children:[A,re]}),e[77]=A,e[78]=re,e[79]=W):W=e[79];let ne;e[80]!==f?(ne=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(_t,{code:f.content,language:"json",height:"100%",readOnly:!0})}),e[80]=f,e[81]=ne):ne=e[81];let ce;e[82]!==W||e[83]!==ne?(ce=t.jsx("div",{children:t.jsxs("div",{className:"rounded-lg overflow-hidden border border-border",children:[W,ne]})}),e[82]=W,e[83]=ne,e[84]=ce):ce=e[84];const ze="rounded-lg overflow-hidden border border-border",Ie="flex items-center justify-between p-1 pl-4 border-b border-border",Ce="flex items-center gap-2";let ie;e[85]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx("span",{className:"text-xs text-muted-foreground select-none",children:"Output"}),e[85]=ie):ie=e[85];const Le=p.isTruncated&&t.jsxs("span",{className:"text-xs text-amber-600 dark:text-amber-400",children:["(",Tt(p.originalSize)," - truncated)"]});let ge;e[86]!==ie||e[87]!==Le?(ge=t.jsxs("div",{className:Ce,children:[ie,Le]}),e[86]=ie,e[87]=Le,e[88]=ge):ge=e[88];let je;e[89]!==h||e[90]!==p.isTruncated?(je=p.isTruncated&&t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>h("output"),"aria-label":"Download full output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:t.jsx(Mt,{size:14})})}),t.jsx(tt,{children:"Download full output"})]}),e[89]=h,e[90]=p.isTruncated,e[91]=je):je=e[91];let ve;e[92]!==u?(ve=()=>u("output"),e[92]=u,e[93]=ve):ve=e[93];let me;e[94]!==o?(me=o?t.jsx(ft,{size:14}):t.jsx(Xe,{size:14}),e[94]=o,e[95]=me):me=e[95];let Ne;e[96]!==ve||e[97]!==me?(Ne=t.jsx(Z,{size:"icon",variant:"ghost",onClick:ve,"aria-label":"Copy output",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:me}),e[96]=ve,e[97]=me,e[98]=Ne):Ne=e[98];let ue;e[99]!==je||e[100]!==Ne?(ue=t.jsxs("div",{className:"flex items-center gap-1",children:[je,Ne]}),e[99]=je,e[100]=Ne,e[101]=ue):ue=e[101];let xe;e[102]!==ge||e[103]!==ue?(xe=t.jsxs("div",{className:Ie,children:[ge,ue]}),e[102]=ge,e[103]=ue,e[104]=xe):xe=e[104];let fe;e[105]!==p.content?(fe=t.jsx("div",{className:"h-[200px] md:h-[280px] overflow-auto",children:t.jsx(_t,{code:p.content,language:"json",height:"100%",readOnly:!0})}),e[105]=p.content,e[106]=fe):fe=e[106];let pe;e[107]!==xe||e[108]!==fe?(pe=t.jsx("div",{children:t.jsxs("div",{className:ze,children:[xe,fe]})}),e[107]=xe,e[108]=fe,e[109]=pe):pe=e[109];let ke;e[110]!==ce||e[111]!==pe?(ke=t.jsxs("div",{className:Y,children:[ce,pe]}),e[110]=ce,e[111]=pe,e[112]=ke):ke=e[112];let we;return e[113]!==q||e[114]!==V||e[115]!==ke?(we=t.jsxs("div",{className:F,children:[q,V,ke]}),e[113]=q,e[114]=V,e[115]=ke,e[116]=we):we=e[116],we}function Js(s){return JSON.stringify(s,null,2)}const Xt=/^now(?:-(\d+)([mhdwM]))?$/,Gs={m:"minute",h:"hour",d:"day",w:"week",M:"month"};function Yt(s){const e=s.trim();if(e==="now")return{isNow:!0,offset:0,unit:null};const r=e.match(Xt);if(!r)return null;const l=r[1]?Number.parseInt(r[1],10):0,a=r[2]||null;return{isNow:!0,offset:l,unit:a}}function ye(s){const e=s.trim(),r=new Date(e);if(!Number.isNaN(r.getTime())&&e.includes("-"))return{valid:!0,date:r};const l=Yt(e);if(!l)return{valid:!1,date:null,error:'Invalid expression. Use "now" or "now-Xu" (e.g., now-2d, now-3h)'};const a=new Date,o=new Date(a);if(l.offset===0||!l.unit)return{valid:!0,date:o};switch(l.unit){case"m":o.setMinutes(o.getMinutes()-l.offset);break;case"h":o.setHours(o.getHours()-l.offset);break;case"d":o.setDate(o.getDate()-l.offset);break;case"w":o.setDate(o.getDate()-l.offset*7);break;case"M":o.setMonth(o.getMonth()-l.offset);break}return{valid:!0,date:o}}function Qs(s){return s.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Zt(s){const e=s.trim();return Xt.test(e)}function $t(s){const e=s.trim();if(e==="now")return"Now";const r=Yt(e);if(!r||!r.unit){const o=ye(e);return o.valid&&o.date?Qs(o.date):e}const l=Gs[r.unit],a=r.offset!==1?"s":"";return`${r.offset} ${l}${a} ago`}const es=[{label:"Last 5 minutes",from:"now-5m",to:"now",value:"5m"},{label:"Last 15 minutes",from:"now-15m",to:"now",value:"15m"},{label:"Last 30 minutes",from:"now-30m",to:"now",value:"30m"},{label:"Last 1 hour",from:"now-1h",to:"now",value:"1h"},{label:"Last 3 hours",from:"now-3h",to:"now",value:"3h"},{label:"Last 6 hours",from:"now-6h",to:"now",value:"6h"},{label:"Last 12 hours",from:"now-12h",to:"now",value:"12h"},{label:"Last 24 hours",from:"now-24h",to:"now",value:"24h"},{label:"Last 2 days",from:"now-2d",to:"now",value:"2d"},{label:"Last 7 days",from:"now-7d",to:"now",value:"7d"},{label:"Last 30 days",from:"now-30d",to:"now",value:"30d"}];function Ws(s,e){const r=es.find(l=>l.from===s&&l.to===e);return r?r.label:`${$t(s)} to ${$t(e)}`}function Je(s){const e=s.getFullYear(),r=String(s.getMonth()+1).padStart(2,"0"),l=String(s.getDate()).padStart(2,"0"),a=String(s.getHours()).padStart(2,"0"),o=String(s.getMinutes()).padStart(2,"0"),c=String(s.getSeconds()).padStart(2,"0");return`${e}-${r}-${l} ${a}:${o}:${c}`}function Xs(s){const e=s.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(!e)return null;const[,r,l,a,o,c,i]=e,n=new Date(Number(r),Number(l)-1,Number(a),Number(o),Number(c),Number(i));return Number.isNaN(n.getTime())?null:n}function gt(s){if(Zt(s))return s;const e=ye(s);return e.valid&&e.date?Je(e.date):s}function zt({value:s,onChange:e,placeholder:r="now or now-2d",className:l,disabled:a,error:o}){const[c,i]=K.useState(!1),[n,d]=K.useState(()=>gt(s)),[f,p]=K.useState(),[v,b]=K.useState(!1),u=K.useRef(s);u.current!==s&&(u.current=s,v||d(gt(s)));const R=x=>{const F=x.target.value;d(F),p(void 0)},h=()=>{b(!0)},j=()=>{b(!1);const x=n.trim();if(Zt(x)){p(void 0),e(x);return}const F=Xs(x);if(F){p(void 0),e(F.toISOString()),d(Je(F));return}const w=ye(x);if(w.valid&&w.date){p(void 0),e(x),d(Je(w.date));return}d(gt(s)),p(void 0)},m=x=>{if(x){const w=ye(s).date||new Date;x.setHours(w.getHours()),x.setMinutes(w.getMinutes()),x.setSeconds(0),x.setMilliseconds(0);const D=x.toISOString();d(Je(x)),e(D),p(void 0)}i(!1)},C=x=>{const[F,w]=x.target.value.split(":").map(Number),k=ye(s).date||new Date;k.setHours(F||0),k.setMinutes(w||0),k.setSeconds(0),k.setMilliseconds(0);const O=k.toISOString();d(Je(k)),e(O)},S=ye(s),g=S.valid?S.date:new Date,_=g?`${String(g.getHours()).padStart(2,"0")}:${String(g.getMinutes()).padStart(2,"0")}`:"",I=o||f;return t.jsxs("div",{className:de("flex gap-1",l),children:[t.jsxs("div",{className:"flex-1 relative",children:[t.jsx(Ge,{value:n,onChange:R,onFocus:h,onBlur:j,placeholder:r,disabled:a,className:de("text-sm h-8",I&&"border-destructive focus-visible:ring-destructive")}),I&&t.jsx("p",{className:"text-xs text-destructive mt-1",children:I})]}),t.jsxs(ct,{open:c,onOpenChange:i,children:[t.jsx(dt,{asChild:!0,children:t.jsx(Z,{variant:"outline",size:"icon",className:"h-8 w-8 shrink-0",disabled:a,children:t.jsx(xs,{className:"h-4 w-4"})})}),t.jsxs(mt,{className:"w-auto p-0",align:"end",children:[t.jsx(ws,{mode:"single",selected:g||void 0,onSelect:m,initialFocus:!0}),t.jsxs("div",{className:"border-t p-3",children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"Time"}),t.jsx(Ge,{type:"time",value:_,onChange:C,className:"text-sm h-8"})]})]})]})]})}function Ys({value:s,onChange:e,className:r,disabled:l,quickRanges:a=es}){const[o,c]=K.useState(!1),[i,n]=K.useState(s.from),[d,f]=K.useState(s.to),[p,v]=K.useState(null),b=K.useRef({from:s.from,to:s.to});(b.current.from!==s.from||b.current.to!==s.to)&&(b.current={from:s.from,to:s.to},n(s.from),f(s.to));const u=m=>{b.current={from:m.from,to:m.to},n(m.from),f(m.to),c(!1),e({from:m.from,to:m.to})},R=()=>{const m=ye(i),C=ye(d);if(!m.valid||!m.date){v("Invalid 'From' date");return}if(!C.valid||!C.date){v("Invalid 'To' date");return}if(m.date>=C.date){v("'From' must be before 'To'");return}v(null),e({from:i,to:d}),c(!1)},h=m=>s.from===m.from&&s.to===m.to,j=Ws(s.from,s.to);return t.jsxs(ct,{open:o,onOpenChange:c,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:de("gap-1.5 min-w-[160px] justify-between",r),disabled:l,children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(Ms,{className:"size-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:j})]}),t.jsx(Kt,{className:"size-4 text-muted-foreground"})]})}),t.jsx(mt,{className:"w-[540px] p-0",align:"end",sideOffset:4,onCloseAutoFocus:m=>m.preventDefault(),style:o?void 0:{animationDuration:"0s"},children:t.jsxs("div",{className:"flex",children:[t.jsxs("div",{className:"flex-1 p-4 border-r",children:[t.jsx("h4",{className:"text-sm font-medium mb-4",children:"Absolute time range"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"From"}),t.jsx(zt,{value:i,onChange:n,placeholder:"now-24h"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs text-muted-foreground mb-1.5 block",children:"To"}),t.jsx(zt,{value:d,onChange:f,placeholder:"now"})]}),p&&t.jsx("p",{className:"text-xs text-destructive",children:p}),t.jsx(Z,{onClick:R,className:"w-full",size:"sm",children:"Apply time range"})]})]}),t.jsx("div",{className:"w-[200px]",children:t.jsx(is,{className:"h-[280px]",children:t.jsx("div",{className:"p-2",children:a.map(m=>{const C=h(m);return t.jsx("button",{type:"button",onClick:()=>u(m),className:de("w-full text-left px-3 py-2 text-sm rounded-md transition-colors","hover:bg-accent hover:text-accent-foreground",C&&"bg-accent text-accent-foreground font-medium"),children:m.label},m.value)})})})})]})})]})}const ts="decopilot";async function ss(s,e){return await s.call("MONITORING_STATS",e)}function Zs(s,e){const r=le.c(12),{org:l}=Be(),a=Jt();let o,c,i;r[0]!==l.id||r[1]!==s?(i={...s,excludeConnectionIds:[ts,...s.excludeConnectionIds??[]]},c=wt,o=it.monitoringStatsToolCalls(l.id,JSON.stringify(i)),r[0]=l.id,r[1]=s,r[2]=o,r[3]=c,r[4]=i):(o=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==o||r[10]!==n?(d={queryKey:o,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=o,r[10]=n,r[11]=d):d=r[11],c(d)}function er(s,e){const r=le.c(12),{org:l}=Be(),a=Jt();let o,c,i;r[0]!==l.id||r[1]!==s?(i={...s,connectionIds:[ts],topN:5,llmUsage:!0,userIds:s.userIds?.length?s.userIds:void 0},c=wt,o=it.monitoringStatsLlm(l.id,JSON.stringify(i)),r[0]=l.id,r[1]=s,r[2]=o,r[3]=c,r[4]=i):(o=r[2],c=r[3],i=r[4]);let n;r[5]!==a||r[6]!==i?(n=()=>ss(a,i),r[5]=a,r[6]=i,r[7]=n):n=r[7];let d;return r[8]!==e||r[9]!==o||r[10]!==n?(d={queryKey:o,queryFn:n,staleTime:3e4,retry:!1,...e},r[8]=e,r[9]=o,r[10]=n,r[11]=d):d=r[11],c(d)}function _e(s){const e=le.c(20),{title:r,value:l,action:a,children:o,className:c}=s;let i;e[0]!==c?(i=de("pt-4 px-4 pb-6 gap-8",c),e[0]=c,e[1]=i):i=e[1];let n;e[2]!==r?(n=t.jsx("span",{className:"text-sm text-foreground/70",children:r}),e[2]=r,e[3]=n):n=e[3];let d;e[4]!==l?(d=t.jsx("span",{className:"text-4xl font-normal",children:l}),e[4]=l,e[5]=d):d=e[5];let f;e[6]!==n||e[7]!==d?(f=t.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[n,d]}),e[6]=n,e[7]=d,e[8]=f):f=e[8];let p;e[9]!==a?(p=a&&t.jsx("div",{className:"shrink-0",children:a}),e[9]=a,e[10]=p):p=e[10];let v;e[11]!==f||e[12]!==p?(v=t.jsxs("div",{className:"flex items-start justify-between",children:[f,p]}),e[11]=f,e[12]=p,e[13]=v):v=e[13];let b;e[14]!==o?(b=o&&t.jsx("div",{className:"flex flex-col gap-6",children:o}),e[14]=o,e[15]=b):b=e[15];let u;return e[16]!==i||e[17]!==v||e[18]!==b?(u=t.jsxs(Ht,{className:i,children:[v,b]}),e[16]=i,e[17]=v,e[18]=b,e[19]=u):u=e[19],u}function jt(s){const e=le.c(14),{metrics:r,connections:l,mode:a,total:o}=s,{org:c}=Be(),i=yt();let n,d,f;if(e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==i||e[4]!==c||e[5]!==o){f=Symbol.for("react.early_return_sentinel");e:{const v=l??[],b=new Map(r.map(sr));let u;e[9]!==a?(u=(h,j)=>{const m=Lt(h.metric,a);return Lt(j.metric,a)-m},e[9]=a,e[10]=u):u=e[10];const R=v.map(h=>({connection:h,metric:b.get(h.id)})).filter(tr).sort(u).slice(0,4);if(R.length===0){f=null;break e}n="flex flex-col",d=R.map((h,j)=>{const{connection:m,metric:C}=h,S=o>0?(C.calls/o*100).toFixed(1):"0.0",g=a==="errors"?`${C.errorRate.toFixed(1)}%`:`${S}%`,_=j===R.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3 cursor-pointer hover:bg-accent/50 transition-colors",!_&&"border-b border-border/50"),onClick:()=>i({to:"/$org/settings/connections/$appSlug",params:{org:c.slug,appSlug:Pt(m)}}),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:m.icon,name:m.title,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-6! min-w-6! rounded-md"}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:m.title})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsx("span",{className:"text-sm text-foreground/30 tabular-nums",children:g}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:Is(C,a)})]})]},m.id)})}e[0]=l,e[1]=r,e[2]=a,e[3]=i,e[4]=c,e[5]=o,e[6]=n,e[7]=d,e[8]=f}else n=e[6],d=e[7],f=e[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;let p;return e[11]!==n||e[12]!==d?(p=t.jsx("div",{className:n,children:d}),e[11]=n,e[12]=d,e[13]=p):p=e[13],p}function tr(s){return s.metric}function sr(s){return[s.connectionId,s]}const Ot=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function Et(s){let e=0;for(let r=0;r<s.length;r++)e=e*31+s.charCodeAt(r)>>>0;return Ot[e%Ot.length]}function He(s){const e=le.c(21),{models:r,mode:l}=s,a=l===void 0?"calls":l;if(r.length===0)return null;let o;e[0]!==a?(o=u=>a==="tokens"?(u.inputTokens??0)+(u.outputTokens??0):a==="cost"?u.costUsd??0:u.calls,e[0]=a,e[1]=o):o=e[1];const c=o;let i;e[2]!==a?(i=u=>a==="cost"?Vt(u):a==="tokens"?st(u):u.toLocaleString(),e[2]=a,e[3]=i):i=e[3];const n=i;let d;e[4]!==c?(d=(u,R)=>u+c(R),e[4]=c,e[5]=d):d=e[5];const f=r.reduce(d,0);let p,v;if(e[6]!==n||e[7]!==r||e[8]!==f||e[9]!==c){let u;e[12]!==c?(u=(j,m)=>c(m)-c(j),e[12]=c,e[13]=u):u=e[13];const R=[...r].sort(u).slice(0,4);p="flex flex-col";let h;e[14]!==n||e[15]!==f||e[16]!==c?(h=(j,m,C)=>{const S=c(j),g=f>0?(S/f*100).toFixed(1):"0.0",_=m===C.length-1;return t.jsxs("div",{className:de("flex items-center h-10 px-3",!_&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[t.jsx("div",{className:"size-6 rounded-md border border-border/10 shadow-sm flex items-center justify-center shrink-0",style:{backgroundColor:`color-mix(in oklch, ${Et(j.toolName)} 18%, transparent)`},children:t.jsx(Qe,{size:14,style:{color:Et(j.toolName)}})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1 truncate",children:j.toolName})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0 px-3",children:[t.jsxs("span",{className:"text-sm text-foreground/30 tabular-nums",children:[g,"%"]}),t.jsx("span",{className:"text-sm text-foreground tabular-nums",children:n(S)})]})]},j.toolName)},e[14]=n,e[15]=f,e[16]=c,e[17]=h):h=e[17],v=R.map(h),e[6]=n,e[7]=r,e[8]=f,e[9]=c,e[10]=p,e[11]=v}else p=e[10],v=e[11];let b;return e[18]!==p||e[19]!==v?(b=t.jsx("div",{className:p,children:v}),e[18]=p,e[19]=v,e[20]=b):b=e[20],b}function rr(s){const e=le.c(48),{displayDateRange:r,connectionIds:l,excludeConnectionIds:a,toolName:o,status:c,connections:i,isStreaming:n,streamingRefetchInterval:d,llmUserIds:f}=s,p=Ss(r),v=n?d:!1;let b;e[0]!==v?(b={refetchInterval:v},e[0]=v,e[1]=b):b=e[1];const{data:u,isError:R}=Zs({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),connectionIds:l.length>0?l:void 0,excludeConnectionIds:a,toolNames:o?[o]:void 0,status:c},b);let h;e[2]!==v?(h={refetchInterval:v},e[2]=v,e[3]=h):h=e[3];const{data:j,isError:m}=er({interval:p,startDate:r.startDate.toISOString(),endDate:r.endDate.toISOString(),userIds:f?.length?f:void 0},h),C=R||m,S=u?{totalCalls:u.totalCalls,totalErrors:u.totalErrors,avgDurationMs:u.avgDurationMs,p95DurationMs:u.p95DurationMs,data:Dt(u.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]},g=j?{totalCalls:j.totalCalls,totalErrors:j.totalErrors,avgDurationMs:j.avgDurationMs,p95DurationMs:j.p95DurationMs,data:Dt(j.timeseries,r,p)}:{totalCalls:0,totalErrors:0,avgDurationMs:0,p95DurationMs:0,data:[]};let _;e[4]!==j?.topTools?(_=j?.topTools??[],e[4]=j?.topTools,e[5]=_):_=e[5];const I=_,x=j?.totalInputTokens??0,F=j?.totalOutputTokens??0,w=j?.totalTokens??0,D=j?.totalCostUsd??0;let k;e[6]!==u?.connectionBreakdown?(k=u?.connectionBreakdown??[],e[6]=u?.connectionBreakdown,e[7]=k):k=e[7];const O=k,[$,J]=K.useState("avg");let P;e[8]!==C?(P=C&&t.jsxs(Fs,{variant:"destructive",children:[t.jsx(rs,{}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx(Rs,{children:"Failed to load monitoring data"}),t.jsx($s,{children:"We couldn't fetch your monitoring stats right now. Please try again later."})]})]}),e[8]=C,e[9]=P):P=e[9];let X;e[10]===Symbol.for("react.memo_cache_sentinel")?(X=ce=>J(ce),e[10]=X):X=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(lt,{className:"w-[120px]",children:t.jsx(ot,{})}),e[11]=y):y=e[11];let T;e[12]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(at,{children:[t.jsx($e,{value:"avg",children:"Avg"}),t.jsx($e,{value:"p95",children:"P95"})]}),e[12]=T):T=e[12];let L;e[13]!==$?(L=t.jsxs(nt,{value:$,onValueChange:X,children:[y,T]}),e[13]=$,e[14]=L):L=e[14];let z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsxs("div",{className:"flex items-center gap-3 pt-4",children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"AI Usage"}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),e[15]=z):z=e[15];let E;e[16]!==I?(E=t.jsx(He,{models:I,mode:"calls"}),e[16]=I,e[17]=E):E=e[17];let U;e[18]!==w?(U=st(w),e[18]=w,e[19]=U):U=e[19];let q;e[20]!==x?(q=st(x),e[20]=x,e[21]=q):q=e[21];let V;e[22]!==F?(V=st(F),e[22]=F,e[23]=V):V=e[23];let Y;e[24]!==q||e[25]!==V?(Y=t.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[q," in ·"," ",V," out"]}),e[24]=q,e[25]=V,e[26]=Y):Y=e[26];let B;e[27]!==I?(B=t.jsx(He,{models:I,mode:"tokens"}),e[27]=I,e[28]=B):B=e[28];let G;e[29]!==D?(G=D>0?Vt(D):"—",e[29]=D,e[30]=G):G=e[30];let A;e[31]!==D?(A=D===0?t.jsx("span",{className:"text-xs text-muted-foreground",children:"No provider cost data"}):void 0,e[31]=D,e[32]=A):A=e[32];let N;e[33]!==I||e[34]!==D?(N=D>0?t.jsx(He,{models:I,mode:"cost"}):t.jsx("div",{className:"flex items-center justify-center h-20 text-center text-xs text-muted-foreground px-4",children:"Cost is reported only for the deco AI Gateway and OpenRouter providers."}),e[33]=I,e[34]=D,e[35]=N):N=e[35];let M;e[36]!==I?(M=t.jsx(He,{models:I,mode:"calls"}),e[36]=I,e[37]=M):M=e[37];const H=_e,te="AI Errors",Q=g.totalErrors.toLocaleString();let re;e[38]!==g.data?(re=t.jsx(Me,{data:g.data,dataKey:"errors",colorNum:3,chartHeight:"h-[80px] md:h-[120px]"}),e[38]=g.data,e[39]=re):re=e[39];let W;e[40]!==I||e[41]!==g.totalErrors?(W=g.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No AI errors in this period"}):t.jsx(He,{models:I,mode:"calls"}),e[40]=I,e[41]=g.totalErrors,e[42]=W):W=e[42];let ne;return e[43]!==H||e[44]!==Q||e[45]!==re||e[46]!==W?(ne=t.jsxs(H,{title:te,value:Q,children:[re,W]}),e[43]=H,e[44]=Q,e[45]=re,e[46]=W,e[47]=ne):ne=e[47],t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-2 pb-6 max-w-[1200px] mx-auto w-full overflow-auto",children:[P,t.jsxs(_e,{title:"Tool Calls",value:S.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"calls",colorNum:1,chartHeight:"h-[120px] md:h-[180px]",variant:"area"}),t.jsx(jt,{metrics:O,connections:i,mode:"requests",total:S.totalCalls})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"Latency",value:pt($==="avg"?S.avgDurationMs:S.p95DurationMs),action:L,children:[t.jsx(Me,{data:S.data,dataKey:$,colorNum:4,chartHeight:"h-[120px] md:h-[180px]"}),t.jsx(jt,{metrics:O,connections:i,mode:"latency",total:S.totalCalls})]}),t.jsxs(_e,{title:"Errors",value:S.totalErrors.toLocaleString(),children:[t.jsx(Me,{data:S.data,dataKey:"errors",colorNum:3,chartHeight:"h-[120px] md:h-[180px]"}),S.totalErrors===0?t.jsx("div",{className:"flex items-center justify-center h-20 text-sm text-muted-foreground",children:"No errors in this period"}):t.jsx(jt,{metrics:O,connections:i,mode:"errors",total:S.totalErrors})]})]}),z,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsxs(_e,{title:"AI Calls",value:g.totalCalls.toLocaleString(),children:[t.jsx(Me,{data:g.data,dataKey:"calls",colorNum:1,chartHeight:"h-[80px] md:h-[120px]"}),E]}),t.jsxs(_e,{title:"Tokens",value:U,action:Y,children:[t.jsx(Me,{data:g.data,dataKey:"totalTokens",colorNum:2,chartHeight:"h-[80px] md:h-[120px]"}),B]}),t.jsxs(_e,{title:"Cost",value:G,action:A,children:[t.jsx(Me,{data:g.data,dataKey:"costUsd",colorNum:5,chartHeight:"h-[80px] md:h-[120px]"}),N]})]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs(_e,{title:"AI Latency",value:pt(g.avgDurationMs),action:t.jsxs("span",{className:"text-xs text-muted-foreground",children:["p95: ",pt(g.p95DurationMs)]}),children:[t.jsx(Me,{data:g.data,dataKey:"avg",colorNum:4,chartHeight:"h-[80px] md:h-[120px]"}),M]}),ne]})]})}function Ke(s){const e=le.c(8),{className:r}=s;let l;e[0]!==r?(l=de("pt-4 px-4 pb-6 gap-8",r),e[0]=r,e[1]=l):l=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-10 w-14 rounded bg-muted animate-pulse"})]}),t.jsx("div",{className:"h-8 w-[120px] rounded-md bg-muted animate-pulse"})]}),e[2]=a):a=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"h-[180px] w-full rounded bg-muted/60 animate-pulse"}),e[3]=o):o=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=Array.from({length:4}).map(lr),e[4]=c):c=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"flex flex-col gap-6",children:[o,t.jsxs("div",{className:"flex flex-col",children:[c,t.jsx("div",{className:"flex items-center h-10 px-4 gap-2",children:t.jsx("div",{className:"h-4 w-14 rounded bg-muted animate-pulse"})})]})]}),e[5]=i):i=e[5];let n;return e[6]!==l?(n=t.jsxs(Ht,{className:l,children:[a,i]}),e[6]=l,e[7]=n):n=e[7],n}function lr(s,e){return t.jsxs("div",{className:de("flex items-center h-10 px-3",e<3&&"border-b border-border/50"),children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx("div",{className:"size-6 rounded-md bg-muted animate-pulse shrink-0"}),t.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"})]}),t.jsxs("div",{className:"flex items-center gap-2 px-3",children:[t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-4 w-10 rounded bg-muted animate-pulse"})]})]},e)}function or(){const s=le.c(4);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ke,{}),s[0]=e):e=s[0];let r,l;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{})]}),l=t.jsx("div",{className:"border-t border-border"}),s[1]=r,s[2]=l):(r=s[1],l=s[2]);let a;return s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex flex-col gap-4 px-4 md:px-10 pt-8 md:pt-12 pb-6 max-w-[1200px] mx-auto w-full",children:[e,r,l,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[t.jsx(Ke,{}),t.jsx(Ke,{}),t.jsx(Ke,{})]})]}),s[3]=a):a=s[3],a}function ar(s){const e=le.c(46),{log:r,connection:l,virtualMcpName:a,virtualMcpIcon:o,onClick:c,lastLogRef:i}=s;let n,d;if(e[0]!==r.timestamp){const $=new Date(r.timestamp);n=$.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=$.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[0]=r.timestamp,e[1]=n,e[2]=d}else n=e[1],d=e[2];const f=d,p=l?.icon||null,v=l?.title??r.connectionId;let b;e[3]!==p||e[4]!==v?(b=t.jsx(Fe,{className:"w-12 md:w-16 px-2 md:px-4",children:t.jsx("div",{className:"flex items-center justify-center",children:t.jsx(qe,{icon:p,name:v,size:"xs",className:"shadow-sm"})})}),e[3]=p,e[4]=v,e[5]=b):b=e[5];let u;e[6]!==r.toolName?(u=t.jsx("div",{className:"font-medium text-foreground truncate block",children:r.toolName}),e[6]=r.toolName,e[7]=u):u=e[7];const R=l?.title??r.connectionId;let h;e[8]!==R?(h=t.jsx("div",{className:"text-muted-foreground truncate block text-xs",children:R}),e[8]=R,e[9]=h):h=e[9];let j;e[10]!==u||e[11]!==h?(j=t.jsxs(Fe,{className:"min-w-0 pr-2 md:pr-4",children:[u,h]}),e[10]=u,e[11]=h,e[12]=j):j=e[12];let m;e[13]!==o||e[14]!==a?(m=t.jsx(Fe,{className:"w-36 md:w-44 px-2 md:px-3 text-muted-foreground",children:a?t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(qe,{icon:o,name:a,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"truncate",children:a})]}):t.jsx("span",{className:"text-muted-foreground/40",children:"—"})}),e[13]=o,e[14]=a,e[15]=m):m=e[15];let C;e[16]!==r.userImage||e[17]!==r.userName?(C=t.jsx(Bt,{url:r.userImage,fallback:r.userName,shape:"circle",size:"2xs",className:"shrink-0"}),e[16]=r.userImage,e[17]=r.userName,e[18]=C):C=e[18];let S;e[19]!==r.userName?(S=t.jsx("span",{className:"truncate",children:r.userName}),e[19]=r.userName,e[20]=S):S=e[20];let g;e[21]!==C||e[22]!==S?(g=t.jsx(Fe,{className:"w-28 md:w-36 px-2 md:px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,S]})}),e[21]=C,e[22]=S,e[23]=g):g=e[23];let _;e[24]!==n?(_=t.jsx("div",{children:n}),e[24]=n,e[25]=_):_=e[25];let I;e[26]!==f?(I=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:f}),e[26]=f,e[27]=I):I=e[27];let x;e[28]!==_||e[29]!==I?(x=t.jsxs(Fe,{className:"w-32 md:w-40 px-2 md:px-3 text-muted-foreground",children:[_,I]}),e[28]=_,e[29]=I,e[30]=x):x=e[30];let F;e[31]!==r.durationMs?(F=t.jsxs(Fe,{className:"w-16 md:w-20 px-2 md:px-3 text-muted-foreground font-mono",children:[r.durationMs,"ms"]}),e[31]=r.durationMs,e[32]=F):F=e[32];const w=r.isError?"destructive":"success",D=r.isError?"Error":"OK";let k;e[33]!==w||e[34]!==D?(k=t.jsx(Fe,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"flex items-center justify-end",children:t.jsx(rt,{variant:w,className:"px-1.5 md:px-2 py-0.5 md:py-1",children:D})})}),e[33]=w,e[34]=D,e[35]=k):k=e[35];let O;return e[36]!==i||e[37]!==c||e[38]!==g||e[39]!==x||e[40]!==F||e[41]!==k||e[42]!==b||e[43]!==j||e[44]!==m?(O=t.jsxs(ut,{ref:i,className:"h-14 md:h-16 transition-colors cursor-pointer hover:bg-muted/40 border-b-0",onClick:c,children:[b,j,m,g,x,F,k]}),e[36]=i,e[37]=c,e[38]=g,e[39]=x,e[40]=F,e[41]=k,e[42]=b,e[43]=j,e[44]=m,e[45]=O):O=e[45],O}function nr(s){const e=le.c(26),{connectionIds:r,virtualMcpIds:l,tool:a,status:o,search:c,logs:i,hasMore:n,onLoadMore:d,isLoadingMore:f,connections:p,virtualMcps:v,membersData:b,client:u}=s,R=p??[],h=v??[],[j,m]=K.useState(null),C=Vs(d,n,f),S=Ut(b),g=new Map(S.map(mr)),_=new Map(h.map(dr));let x=i.map(N=>{const M=g.get(N.userId??""),H=N.virtualMcpId?_.get(N.virtualMcpId):null;return{...N,userName:M?.name??N.userId??"Unknown",userImage:M?.image??void 0,virtualMcpName:H?.title??null,virtualMcpIcon:H?.icon??null}});if(r.length>1){let N;e[0]!==r?(N=M=>r.includes(M.connectionId),e[0]=r,e[1]=N):N=e[1],x=x.filter(N)}if(l.length>1){let N;e[2]!==l?(N=M=>M.virtualMcpId&&l.includes(M.virtualMcpId),e[2]=l,e[3]=N):N=e[3],x=x.filter(N)}const F=new Map(R.map(cr));if(c){const N=c.toLowerCase();x=x.filter(M=>M.toolName.toLowerCase().includes(N)||(F.get(M.connectionId)?.title??M.connectionId).toLowerCase().includes(N)||M.errorMessage?.toLowerCase().includes(N))}const w=j!==null?x[j]??null:null,D=wt({queryKey:it.monitoringLogDetail(w?.id??""),queryFn:async()=>{if(!u)throw new Error("MCP client is not available");const N=await u.callTool({name:"MONITORING_LOG_GET",arguments:{id:w.id}});return N.structuredContent??N},enabled:w!==null}),k=D.data?.log,O=w&&k?{...w,input:k.input,output:k.output}:w;if(x.length===0){let N;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("img",{src:"/empty-state-logs.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),e[4]=N):N=e[4];const M=c||r.length>0||l.length>0||a||o!=="all"?"No logs match your filters":"No logs found in this time range";let H;return e[5]!==M?(H=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(St,{image:N,title:"No logs found",description:M})}),e[5]=M,e[6]=H):H=e[6],H}const $="flex-1 flex flex-col min-w-0",J="flex-1 min-w-0 pt-1",P="min-w-[600px] md:min-w-0",X=Qt,y="w-full border-collapse";let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(ae,{className:"w-5"}),t.jsx(ae,{className:"pr-2 md:pr-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Tool / Connection"}),t.jsx(ae,{className:"w-36 md:w-44 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(ae,{className:"w-28 md:w-36 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"}),t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Latency"}),t.jsx(ae,{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[7]=T):T=e[7];const L=Gt,z=x.map((N,M)=>t.jsx(ar,{log:N,connection:F.get(N.connectionId),virtualMcpName:N.virtualMcpName??"",virtualMcpIcon:N.virtualMcpIcon,onClick:()=>m(M),lastLogRef:M===x.length-1?C:void 0},N.id));let E;e[8]!==L||e[9]!==z?(E=t.jsx(L,{children:z}),e[8]=L,e[9]=z,e[10]=E):E=e[10];let U;e[11]!==X||e[12]!==T||e[13]!==E?(U=t.jsx("div",{className:J,children:t.jsx("div",{className:P,children:t.jsxs(X,{className:y,children:[T,E]})})}),e[11]=X,e[12]=T,e[13]=E,e[14]=U):U=e[14];const q=j!==null;let V;e[15]!==m?(V=N=>{N||m(null)},e[15]=m,e[16]=V):V=e[16];const Y=w&&j!==null&&t.jsxs(t.Fragment,{children:[t.jsx(Os,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(qe,{icon:F.get(w.connectionId)?.icon||null,name:F.get(w.connectionId)?.title??w.connectionId,size:"sm",className:"shadow-sm shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(Es,{className:"text-sm leading-snug truncate",children:w.toolName}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:F.get(w.connectionId)?.title??w.connectionId})]})]}),t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(ir),disabled:j===0,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous entry",children:t.jsx(cs,{size:14})}),t.jsx(Z,{size:"icon",variant:"ghost",onClick:()=>m(N=>N!==null&&N<x.length-1?N+1:N),disabled:j===x.length-1,className:"h-7 w-7 text-muted-foreground","aria-label":"Next entry",children:t.jsx(Kt,{size:14})})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:D.isLoading?t.jsx("div",{className:"flex items-center justify-center py-12",children:t.jsx("div",{className:"size-5 border-2 border-muted-foreground/30 border-t-muted-foreground rounded-full animate-spin"})}):D.isError?t.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground",children:[t.jsx("p",{children:"Failed to load log details"}),t.jsx(Z,{variant:"outline",size:"sm",onClick:()=>D.refetch(),children:"Retry"})]}):t.jsx(Hs,{log:O})})]});let B;e[17]!==Y?(B=t.jsx(Ps,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:Y}),e[17]=Y,e[18]=B):B=e[18];let G;e[19]!==V||e[20]!==B||e[21]!==q?(G=t.jsx(As,{open:q,onOpenChange:V,children:B}),e[19]=V,e[20]=B,e[21]=q,e[22]=G):G=e[22];let A;return e[23]!==G||e[24]!==U?(A=t.jsxs("div",{className:$,children:[U,G]}),e[23]=G,e[24]=U,e[25]=A):A=e[25],A}function ir(s){return s!==null&&s>0?s-1:s}function cr(s){return[s.id,s]}function dr(s){return[s.id,s]}function mr(s){return[s.userId,s.user]}function ur(){const s=le.c(8);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ae,{className:"w-12 md:w-16 px-2 md:px-4"}),s[0]=e):e=s[0];let r;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ae,{className:"pr-2 md:pr-4",children:t.jsx("div",{className:"h-3 w-24 rounded bg-muted animate-pulse"})}),s[1]=r):r=s[1];let l;s[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ae,{className:"w-24 md:w-32 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse"})}),s[2]=l):l=s[2];let a;s[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ae,{className:"w-20 md:w-24 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),s[3]=a):a=s[3];let o;s[4]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(ae,{className:"w-32 md:w-40 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse"})}),s[4]=o):o=s[4];let c;s[5]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(ae,{className:"w-16 md:w-20 px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),s[5]=c):c=s[5];let i;s[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{className:"border-b-0 z-20",children:t.jsxs(ut,{className:"h-9 hover:bg-transparent border-b border-border",children:[e,r,l,a,o,c,t.jsx(ae,{className:"w-16 md:w-24 px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-3 w-12 rounded bg-muted animate-pulse ml-auto"})})]})}),s[6]=i):i=s[6];let n;return s[7]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsxs(Qt,{className:"w-full border-collapse",children:[i,t.jsx(Gt,{children:Array.from({length:8}).map(xr)})]})})}),s[7]=n):n=s[7],n}function xr(s,e){return t.jsxs(ut,{className:"h-14 border-b border-border hover:bg-transparent",children:[t.jsx("td",{className:"px-2 md:px-4",children:t.jsx("div",{className:"size-5 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"pr-2 md:pr-4",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3.5 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-16 rounded bg-muted animate-pulse"})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-2.5 w-20 rounded bg-muted animate-pulse"})]})}),t.jsx("td",{className:"px-2 md:px-3",children:t.jsx("div",{className:"h-3 w-10 rounded bg-muted animate-pulse ml-auto"})}),t.jsx("td",{className:"px-2 md:px-3 pr-3 md:pr-5",children:t.jsx("div",{className:"h-5 w-14 rounded-full bg-muted animate-pulse ml-auto"})})]},e)}const bt=Object.assign(nr,{Skeleton:ur});function fr(s){const e=le.c(34),{client:r,locator:l,baseParams:a,pageSize:o,isStreaming:c,streamingRefetchInterval:i,connectionIds:n,virtualMcpIds:d,tool:f,status:p,searchQuery:v,allConnections:b,allVirtualMcps:u,membersData:R}=s;let h;e[0]!==a||e[1]!==l?(h=it.monitoringLogsInfinite(l,JSON.stringify(a)),e[0]=a,e[1]=l,e[2]=h):h=e[2];let j;e[3]!==a||e[4]!==r||e[5]!==o?(j=async J=>{const{pageParam:P}=J,X=P===void 0?0:P;if(!r)throw new Error("MCP client is not available");const y=await r.callTool({name:"MONITORING_LOGS_LIST",arguments:{...a,limit:o,offset:X}});return y.structuredContent??y},e[3]=a,e[4]=r,e[5]=o,e[6]=j):j=e[6];let m;e[7]!==o?(m=(J,P)=>{if(!((J?.logs?.length??0)<o))return P.length*o},e[7]=o,e[8]=m):m=e[8];const C=c?i:!1;let S;e[9]!==h||e[10]!==j||e[11]!==m||e[12]!==C?(S={queryKey:h,queryFn:j,initialPageParam:0,getNextPageParam:m,staleTime:0,refetchInterval:C},e[9]=h,e[10]=j,e[11]=m,e[12]=C,e[13]=S):S=e[13];const{data:g,fetchNextPage:_,hasNextPage:I,isFetchingNextPage:x}=zs(S);let F;e[14]!==g.pages?(F=g.pages.flatMap(pr),e[14]=g.pages,e[15]=F):F=e[15];const w=F;let D;e[16]!==_||e[17]!==I||e[18]!==x?(D=()=>{I&&!x&&_()},e[16]=_,e[17]=I,e[18]=x,e[19]=D):D=e[19];const k=D,O=I??!1;let $;return e[20]!==b||e[21]!==u||e[22]!==r||e[23]!==n||e[24]!==k||e[25]!==x||e[26]!==R||e[27]!==w||e[28]!==v||e[29]!==p||e[30]!==O||e[31]!==f||e[32]!==d?($=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",children:t.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:t.jsx(bt,{connectionIds:n,virtualMcpIds:d,tool:f,status:p,search:v,logs:w,hasMore:O,onLoadMore:k,isLoadingMore:x,connections:b,virtualMcps:u,membersData:R,client:r})})})}),e[20]=b,e[21]=u,e[22]=r,e[23]=n,e[24]=k,e[25]=x,e[26]=R,e[27]=w,e[28]=v,e[29]=p,e[30]=O,e[31]=f,e[32]=d,e[33]=$):$=e[33],$}function pr(s){return s.logs??[]}function hr(s){const e=le.c(15),{dateRange:r}=s,{data:l,isLoading:a}=Us(void 0);let o;e[0]!==l?(o=l===void 0?[]:l,e[0]=l,e[1]=o):o=e[1];const c=o,[i,n]=K.useState(null),d=i??c[0]?.id??null,{data:f}=Ks(d??"");let p;e[2]!==r.startDate?(p=r.startDate.toISOString(),e[2]=r.startDate,e[3]=p):p=e[3];let v;e[4]!==r.endDate?(v=r.endDate.toISOString(),e[4]=r.endDate,e[5]=v):v=e[5];let b;e[6]!==p||e[7]!==v?(b={startDate:p,endDate:v},e[6]=p,e[7]=v,e[8]=b):b=e[8];const u=b;let R;return e[9]!==f||e[10]!==c||e[11]!==d||e[12]!==a||e[13]!==u?(R=t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx("div",{className:"mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0 gap-5 pt-1",children:a?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"}):c.length===0?t.jsx("div",{className:"py-16",children:t.jsx(St,{title:"No automations",description:"Create an automation to see its runs and usage here."})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(nt,{value:d??"",onValueChange:h=>n(h),children:[t.jsx(lt,{className:"w-72",children:t.jsx(ot,{placeholder:"Select an automation…"})}),t.jsx(at,{children:c.map(jr)})]})}),f?t.jsx(Cs,{automationId:f.id,triggerIds:f.triggers.map(gr),range:u}):t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading…"})]})})}),e[9]=f,e[10]=c,e[11]=d,e[12]=a,e[13]=u,e[14]=R):R=e[14],R}function gr(s){return s.id}function jr(s){return t.jsx($e,{value:s.id,children:s.name},s.id)}const vr=[{value:"eq",label:"equals"},{value:"contains",label:"contains"},{value:"in",label:"in (list)"},{value:"exists",label:"exists"}];function Nr({connectionIds:s,virtualMcpIds:e,tool:r,status:l,hideSystem:a,propertyFilters:o,connectionOptions:c,virtualMcpOptions:i,activeFiltersCount:n,onUpdateFilters:d,onConnectionSearchChange:f,memberOptions:p,llmUserIds:v=[],onLlmUserIdsChange:b,showMemberFilter:u}){const[R,h]=K.useState(!1),[j,m]=K.useState("form"),[C,S]=K.useState(r),[g,_]=K.useState(o),[I,x]=K.useState(Ye(o)),F=K.useRef(r),w=K.useRef(Re(o));F.current!==r&&(F.current=r,C!==r&&S(r));const D=Re(o);w.current!==D&&(w.current=D,_(o),x(Ye(o)));const k=(y,T)=>{const L=[...g],z=L[y];z&&(L[y]={key:T.key??z.key,operator:T.operator??z.operator,value:T.value??z.value},_(L))},O=()=>{_([...g,{key:"",operator:"eq",value:""}])},$=y=>{const T=g.filter((L,z)=>z!==y);_(T),x(Ye(T)),d({propertyFilters:Re(T)})},J=()=>{d({propertyFilters:Re(g)})},P=()=>{const y=Ft(I);_(y),d({propertyFilters:Re(y)})},X=()=>{if(j==="raw"){const y=Ft(I);_(y),m("form")}else x(Ye(g)),m("raw")};return t.jsxs(ct,{open:R,onOpenChange:h,children:[t.jsx(dt,{asChild:!0,children:t.jsxs(Z,{variant:"outline",className:"relative",children:[t.jsx(At,{size:16}),t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),n>0&&t.jsxs(t.Fragment,{children:[t.jsx(rt,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:n}),t.jsx(rt,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:n})]})]})}),t.jsx(mt,{align:"end",className:"w-[320px]",children:t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{children:t.jsx("h4",{className:"font-medium text-sm mb-3",children:"Filter Logs"})}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Ls,{htmlFor:"hide-system-calls",className:"text-xs font-medium text-muted-foreground cursor-pointer",children:"Hide system calls"}),t.jsx(Ds,{id:"hide-system-calls",checked:a,onCheckedChange:y=>d({hideSystem:!!y})})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Connections"}),t.jsx(ht,{options:c,defaultValue:s,onValueChange:y=>d({connectionId:y}),onSearchChange:f,placeholder:"All servers",variant:"secondary",className:"w-full",maxCount:2})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agents"}),t.jsx(ht,{options:i,defaultValue:e,onValueChange:y=>d({virtualMcpId:y}),placeholder:"All Agents",variant:"secondary",className:"w-full",maxCount:2})]}),u&&t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Members"}),t.jsx(ht,{options:p??[],defaultValue:v,onValueChange:y=>b?.(y),placeholder:"All members",variant:"secondary",className:"w-full",maxCount:2}),t.jsx("p",{className:"text-[11px] text-muted-foreground mt-1",children:"Filters AI usage (calls, tokens, cost) only."})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Tool Name"}),t.jsx(Ge,{id:"filter-tool",placeholder:"Filter by tool...",value:C,onChange:y=>S(y.target.value),onBlur:()=>{C!==r&&d({tool:C})},onKeyDown:y=>{y.key==="Enter"&&C!==r&&d({tool:C})},className:"w-full"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),t.jsxs(nt,{value:l,onValueChange:y=>d({status:y}),children:[t.jsx(lt,{className:"w-full",children:t.jsx(ot,{})}),t.jsxs(at,{children:[t.jsx($e,{value:"all",children:"All Status"}),t.jsx($e,{value:"success",children:"Success Only"}),t.jsx($e,{value:"errors",children:"Errors Only"})]})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Property Filters"}),t.jsxs(Ze,{children:[t.jsx(et,{asChild:!0,children:t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:X,children:j==="raw"?t.jsx(Ns,{size:14}):t.jsx(fs,{size:14})})}),t.jsx(tt,{children:j==="raw"?"Switch to form view":"Switch to raw text"})]})]}),j==="raw"?t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(_s,{placeholder:`Paste property filters here:
|
|
6
6
|
thread_id=abc123
|
|
7
7
|
user~test
|
|
8
|
-
debug?`,value:I,onChange:y=>x(y.target.value),onBlur:P,onKeyDown:y=>{y.key==="Enter"&&y.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:[g.map((y,T)=>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 ",T+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>$(T),children:t.jsx(ys,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ge,{placeholder:"Key (e.g., thread_id)",value:y.key,onChange:L=>k(T,{key:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:y.operator,onValueChange:L=>{const z=[...g],E=z[T];E&&(z[T]={...E,operator:L,value:L==="exists"?"":E.value},_(z),d({propertyFilters:Re(z)}))},children:[t.jsx(lt,{className:"w-28",children:t.jsx(ot,{})}),t.jsx(at,{children:vr.map(L=>t.jsx($e,{value:L.value,children:L.label},L.value))})]})]}),y.operator!=="exists"&&t.jsx(Ge,{placeholder:"Value",value:y.value,onChange:L=>k(T,{value:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"w-full font-mono text-sm"})]},T)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[t.jsx(bs,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),_([]),x(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),h(!1)},children:"Clear all filters"})]})})]})}function br(s){const e=le.c(113),{tab:r,dateRange:l,displayDateRange:a,connectionIds:o,virtualMcpIds:c,tool:i,status:n,search:d,streaming:f,hideSystem:p,activeFiltersCount:v,from:b,to:u,propertyFilters:R,onUpdateFilters:h,onTimeRangeChange:j,onStreamingToggle:m,onTabChange:C}=s,S=vt(),g=vs(),{data:_}=ps(),[I,x]=K.useState(""),F=I||void 0;let w;e[0]!==F?(w={searchTerm:F},e[0]=F,e[1]=w):w=e[1];const D=vt(w);let k;e[2]!==D?(k=D??[],e[2]=D,e[3]=k):k=e[3];let O;e[4]!==k?(O=k.map(Sr),e[4]=k,e[5]=O):O=e[5];const $=O;let J;e[6]!==g?(J=g.map(wr),e[6]=g,e[7]=J):J=e[7];const P=J,{pageSize:X,streamingRefetchInterval:y}=Nt,{org:T,locator:L}=Be();let z;e[8]!==T.id||e[9]!==T.slug?(z={connectionId:hs,orgId:T.id,orgSlug:T.slug},e[8]=T.id,e[9]=T.slug,e[10]=z):z=e[10];const E=gs(z);let U;e[11]!==R?(U=Bs(R),e[11]=R,e[12]=U):U=e[12];const q=U;let V;e[13]!==p||e[14]!==T.id?(V=p?[js.SELF(T.id)]:void 0,e[13]=p,e[14]=T.id,e[15]=V):V=e[15];const Y=V;let B;e[16]===Symbol.for("react.memo_cache_sentinel")?(B=[],e[16]=B):B=e[16];const[G,A]=K.useState(B);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[M,H]=K.useState(N);let te;e[18]===Symbol.for("react.memo_cache_sentinel")?(te=[],e[18]=te):te=e[18];const[Q,re]=K.useState(te),[W,ne]=K.useState("all"),ce=(M.length>0?1:0)+(Q.length>0?1:0)+(W!=="all"?1:0);let ze;e[19]!==_?(ze=Ut(_).map(yr),e[19]=_,e[20]=ze):ze=e[20];const Ie=ze;let Ce;e[21]!==l.startDate?(Ce=l.startDate.toISOString(),e[21]=l.startDate,e[22]=Ce):Ce=e[22];let ie;e[23]!==l.endDate?(ie=l.endDate.toISOString(),e[23]=l.endDate,e[24]=ie):ie=e[24];const Le=o.length===1?o[0]:void 0,ge=c.length===1?c[0]:void 0,je=i||void 0,ve=n==="errors"?!0:n==="success"?!1:void 0;let me;e[25]!==Y||e[26]!==q||e[27]!==Ce||e[28]!==ie||e[29]!==Le||e[30]!==ge||e[31]!==je||e[32]!==ve?(me={startDate:Ce,endDate:ie,connectionId:Le,excludeConnectionIds:Y,virtualMcpId:ge,toolName:je,isError:ve,...q},e[25]=Y,e[26]=q,e[27]=Ce,e[28]=ie,e[29]=Le,e[30]=ge,e[31]=je,e[32]=ve,e[33]=me):me=e[33];const Ne=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"overview",label:"Overview"},e[34]=ue):ue=e[34];let xe;e[35]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"audit",label:"Audit"},e[35]=xe):xe=e[35];let fe;e[36]===Symbol.for("react.memo_cache_sentinel")?(fe={id:"threads",label:"Threads"},e[36]=fe):fe=e[36];let pe;e[37]===Symbol.for("react.memo_cache_sentinel")?(pe=[ue,xe,fe,{id:"automations",label:"Automations"}],e[37]=pe):pe=e[37];const ke=pe;let we;e[38]===Symbol.for("react.memo_cache_sentinel")?(we=t.jsx(De.Title,{children:"Monitoring"}),e[38]=we):we=e[38];let se;e[39]!==C?(se=Te=>C(Te),e[39]=C,e[40]=se):se=e[40];let ee;e[41]!==se||e[42]!==r?(ee=t.jsx(qt,{tabs:ke,activeTab:r,onTabChange:se}),e[41]=se,e[42]=r,e[43]=ee):ee=e[43];let oe;e[44]!==v||e[45]!==o||e[46]!==$||e[47]!==I||e[48]!==p||e[49]!==f||e[50]!==G||e[51]!==Ie||e[52]!==m||e[53]!==h||e[54]!==R||e[55]!==n||e[56]!==r||e[57]!==i||e[58]!==c||e[59]!==P?(oe=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:f?"secondary":"outline",className:"gap-1.5",onClick:m,children:[f&&t.jsx("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}),t.jsx("span",{children:"Live"}),f&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(Nr,{connectionIds:o,virtualMcpIds:c,tool:i,status:n,hideSystem:p,propertyFilters:R,connectionOptions:$,virtualMcpOptions:P,activeFiltersCount:v,onUpdateFilters:h,connectionSearchTerm:I,onConnectionSearchChange:x,memberOptions:Ie,llmUserIds:G,onLlmUserIdsChange:A,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=o,e[46]=$,e[47]=I,e[48]=p,e[49]=f,e[50]=G,e[51]=Ie,e[52]=m,e[53]=h,e[54]=R,e[55]=n,e[56]=r,e[57]=i,e[58]=c,e[59]=P,e[60]=oe):oe=e[60];let he;e[61]!==Ie||e[62]!==r||e[63]!==ce||e[64]!==M||e[65]!==W||e[66]!==Q||e[67]!==P?(he=r==="threads"&&t.jsx(ks,{filterAgentIds:M,filterUserIds:Q,filterStatus:W,virtualMcpOptions:P,memberOptions:Ie,activeFiltersCount:ce,onUpdateFilters:Te=>{const{filterAgentIds:It,filterUserIds:Ct,filterStatus:kt}=Te;It!==void 0&&H(It),Ct!==void 0&&re(Ct),kt!==void 0&&ne(kt)}}),e[61]=Ie,e[62]=r,e[63]=ce,e[64]=M,e[65]=W,e[66]=Q,e[67]=P,e[68]=he):he=e[68];let be;e[69]!==b||e[70]!==u?(be={from:b,to:u},e[69]=b,e[70]=u,e[71]=be):be=e[71];let Oe;e[72]!==j||e[73]!==be?(Oe=t.jsx(Ys,{value:be,onChange:j}),e[72]=j,e[73]=be,e[74]=Oe):Oe=e[74];let Ee;e[75]!==oe||e[76]!==he||e[77]!==Oe?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[oe,he,Oe]}),e[75]=oe,e[76]=he,e[77]=Oe,e[78]=Ee):Ee=e[78];let Pe;e[79]!==ee||e[80]!==Ee?(Pe=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ee,Ee]}),e[79]=ee,e[80]=Ee,e[81]=Pe):Pe=e[81];let Ae;e[82]!==h||e[83]!==d||e[84]!==r?(Ae=(r==="audit"||r==="threads")&&t.jsx(as,{value:d,onChange:Te=>h({search:Te}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Te=>{Te.key==="Escape"&&(h({search:""}),Te.target.blur())},className:"w-full md:w-[375px]"}),e[82]=h,e[83]=d,e[84]=r,e[85]=Ae):Ae=e[85];let Ve;e[86]!==Pe||e[87]!==Ae?(Ve=t.jsx(De.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[we,Pe,Ae]})}),e[86]=Pe,e[87]=Ae,e[88]=Ve):Ve=e[88];let Ue;e[89]!==S||e[90]!==g||e[91]!==Ne||e[92]!==E||e[93]!==o||e[94]!==l||e[95]!==a||e[96]!==Y||e[97]!==f||e[98]!==G||e[99]!==L||e[100]!==_||e[101]!==d||e[102]!==n||e[103]!==r||e[104]!==M||e[105]!==W||e[106]!==Q||e[107]!==i||e[108]!==c?(Ue=r==="automations"?t.jsx(hr,{dateRange:l}):r==="threads"?t.jsx(Ts,{client:E,locator:L,membersData:_,allConnections:S,allVirtualMcps:g,dateRange:l,searchQuery:d,filterAgentIds:M,filterUserIds:Q,filterStatus:W}):r==="audit"?t.jsx(fr,{client:E,locator:L,baseParams:Ne,pageSize:X,isStreaming:f,streamingRefetchInterval:y,connectionIds:o,virtualMcpIds:c,tool:i,status:n,searchQuery:d,allConnections:S,allVirtualMcps:g,membersData:_}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(rr,{displayDateRange:a,connectionIds:o,excludeConnectionIds:Y,toolName:i||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:f,streamingRefetchInterval:y,llmUserIds:G})}),e[89]=S,e[90]=g,e[91]=Ne,e[92]=E,e[93]=o,e[94]=l,e[95]=a,e[96]=Y,e[97]=f,e[98]=G,e[99]=L,e[100]=_,e[101]=d,e[102]=n,e[103]=r,e[104]=M,e[105]=W,e[106]=Q,e[107]=i,e[108]=c,e[109]=Ue):Ue=e[109];let We;return e[110]!==Ve||e[111]!==Ue?(We=t.jsxs(t.Fragment,{children:[Ve,Ue]}),e[110]=Ve,e[111]=Ue,e[112]=We):We=e[112],We}function yr(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:l=>{const{className:a}=l;return t.jsx(Bt,{url:r,fallback:e,shape:"circle",size:"2xs",className:de("shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title??"Decopilot";return{value:s.id??"",label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Sr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function _o(){const s=le.c(83),{org:e}=Be(),r=yt();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/settings/monitor"},s[0]=l):l=s[0];const a=ls(l),{tab:o,from:c,to:i,connectionId:n,virtualMcpId:d,tool:f,search:p,status:v,streaming:b,propertyFilters:u,hideSystem:R}=a,h=o===void 0?"overview":o;let j;s[1]!==n?(j=n===void 0?[]:n,s[1]=n,s[2]=j):j=s[2];const m=j;let C;s[3]!==d?(C=d===void 0?[]:d,s[3]=d,s[4]=C):C=s[4];const S=C,g=b===void 0?!0:b,_=u===void 0?"":u,I=R===void 0?!1:R;let x,F,w,D,k,O,$;if(s[5]!==m.length||s[6]!==c||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==_||s[11]!==a||s[12]!==v||s[13]!==g||s[14]!==i||s[15]!==f||s[16]!==S.length){k=qs(_);let A;s[24]!==r||s[25]!==e.slug||s[26]!==a?(A=Q=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...Q}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=A):A=s[27],$=A;let N;s[28]!==$?(N=Q=>{$({from:Q.from,to:Q.to})},s[28]=$,s[29]=N):N=s[29],D=N;let M,H;if(s[30]!==c||s[31]!==g||s[32]!==i){const Q=ye(c),re=ye(i);H=Q.date||new Date(Date.now()-18e5);const W=re.date||new Date;w={startDate:H,endDate:W},M=W,g&&i==="now"&&(M=new Date(W),M.setHours(M.getHours()+1)),s[30]=c,s[31]=g,s[32]=i,s[33]=w,s[34]=M,s[35]=H}else w=s[33],M=s[34],H=s[35];let te;s[36]!==M||s[37]!==H?(te={startDate:H,endDate:M},s[36]=M,s[37]=H,s[38]=te):te=s[38],F=te,x=0,m.length>0&&x++,S.length>0&&x++,f&&x++,v!=="all"&&x++,I&&x++,O=k.filter(Ir),s[5]=m.length,s[6]=c,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=_,s[11]=a,s[12]=v,s[13]=g,s[14]=i,s[15]=f,s[16]=S.length,s[17]=x,s[18]=F,s[19]=w,s[20]=D,s[21]=k,s[22]=O,s[23]=$}else x=s[17],F=s[18],w=s[19],D=s[20],k=s[21],O=s[22],$=s[23];const J=O;J.length>0&&(x=x+J.length);let P;s[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(De.Body,{className:"!pb-3",children:t.jsx(De.Title,{children:"Monitoring"})}),s[39]=P):P=s[39];let X;s[40]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs(t.Fragment,{children:[P,t.jsx(De.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(St,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=X):X=s[40];let y;s[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(De.Title,{children:"Monitoring"}),s[41]=y):y=s[41];let T;s[42]===Symbol.for("react.memo_cache_sentinel")?(T=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Threads"},{id:"automations",label:"Automations"}],s[42]=T):T=s[42];let L;s[43]!==$?(L=A=>$({tab:A}),s[43]=$,s[44]=L):L=s[44];let z;s[45]!==L||s[46]!==h?(z=t.jsx(De.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[y,t.jsx(qt,{tabs:T,activeTab:h,onTabChange:L})]})}),s[45]=L,s[46]=h,s[47]=z):z=s[47];let E;s[48]!==h?(E=h==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):h==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(or,{})}),s[48]=h,s[49]=E):E=s[49];let U;s[50]!==z||s[51]!==E?(U=t.jsxs(t.Fragment,{children:[z,E]}),s[50]=z,s[51]=E,s[52]=U):U=s[52];let q;s[53]!==D?(q=A=>{xt("monitoring_time_range_changed",{from:A.from,to:A.to}),D(A)},s[53]=D,s[54]=q):q=s[54];let V;s[55]!==g||s[56]!==$?(V=()=>{xt("monitoring_live_toggled",{enabled:!g}),$({streaming:!g})},s[55]=g,s[56]=$,s[57]=V):V=s[57];let Y;s[58]!==h||s[59]!==$?(Y=A=>{A!==h&&xt("monitoring_tab_changed",{from_tab:h,to_tab:A}),$({tab:A})},s[58]=h,s[59]=$,s[60]=Y):Y=s[60];let B;s[61]!==x||s[62]!==m||s[63]!==F||s[64]!==w||s[65]!==c||s[66]!==I||s[67]!==k||s[68]!==p||s[69]!==v||s[70]!==g||s[71]!==q||s[72]!==V||s[73]!==Y||s[74]!==h||s[75]!==i||s[76]!==f||s[77]!==$||s[78]!==S?(B=t.jsx(br,{tab:h,dateRange:F,displayDateRange:w,connectionIds:m,virtualMcpIds:S,tool:f,status:v,search:p,streaming:g,hideSystem:I,activeFiltersCount:x,from:c,to:i,propertyFilters:k,onUpdateFilters:$,onTimeRangeChange:q,onStreamingToggle:V,onTabChange:Y}),s[61]=x,s[62]=m,s[63]=F,s[64]=w,s[65]=c,s[66]=I,s[67]=k,s[68]=p,s[69]=v,s[70]=g,s[71]=q,s[72]=V,s[73]=Y,s[74]=h,s[75]=i,s[76]=f,s[77]=$,s[78]=S,s[79]=B):B=s[79];let G;return s[80]!==U||s[81]!==B?(G=t.jsx(ns,{capability:"monitoring:view",area:"monitoring",children:t.jsx(De,{children:t.jsx(os,{fallback:X,children:t.jsx(K.Suspense,{fallback:U,children:B})})})}),s[80]=U,s[81]=B,s[82]=G):G=s[82],G}function Ir(s){return s.key.trim()}export{_o as default};
|
|
8
|
+
debug?`,value:I,onChange:y=>x(y.target.value),onBlur:P,onKeyDown:y=>{y.key==="Enter"&&y.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:[g.map((y,T)=>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 ",T+1]}),t.jsx(Z,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>$(T),children:t.jsx(ys,{size:12})})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(Ge,{placeholder:"Key (e.g., thread_id)",value:y.key,onChange:L=>k(T,{key:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"flex-1 font-mono text-sm"}),t.jsxs(nt,{value:y.operator,onValueChange:L=>{const z=[...g],E=z[T];E&&(z[T]={...E,operator:L,value:L==="exists"?"":E.value},_(z),d({propertyFilters:Re(z)}))},children:[t.jsx(lt,{className:"w-28",children:t.jsx(ot,{})}),t.jsx(at,{children:vr.map(L=>t.jsx($e,{value:L.value,children:L.label},L.value))})]})]}),y.operator!=="exists"&&t.jsx(Ge,{placeholder:"Value",value:y.value,onChange:L=>k(T,{value:L.target.value}),onBlur:J,onKeyDown:L=>{L.key==="Enter"&&J()},className:"w-full font-mono text-sm"})]},T)),t.jsxs(Z,{variant:"outline",size:"sm",className:"w-full",onClick:O,children:[t.jsx(bs,{size:14,className:"mr-1.5"}),"Add filter"]})]})]})]}),n>0&&t.jsx(Z,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{S(""),_([]),x(""),d({connectionId:[],virtualMcpId:[],tool:"",status:"all",propertyFilters:""}),h(!1)},children:"Clear all filters"})]})})]})}function br(s){const e=le.c(113),{tab:r,dateRange:l,displayDateRange:a,connectionIds:o,virtualMcpIds:c,tool:i,status:n,search:d,streaming:f,hideSystem:p,activeFiltersCount:v,from:b,to:u,propertyFilters:R,onUpdateFilters:h,onTimeRangeChange:j,onStreamingToggle:m,onTabChange:C}=s,S=vt(),g=vs(),{data:_}=ps(),[I,x]=K.useState(""),F=I||void 0;let w;e[0]!==F?(w={searchTerm:F},e[0]=F,e[1]=w):w=e[1];const D=vt(w);let k;e[2]!==D?(k=D??[],e[2]=D,e[3]=k):k=e[3];let O;e[4]!==k?(O=k.map(Sr),e[4]=k,e[5]=O):O=e[5];const $=O;let J;e[6]!==g?(J=g.map(wr),e[6]=g,e[7]=J):J=e[7];const P=J,{pageSize:X,streamingRefetchInterval:y}=Nt,{org:T,locator:L}=Be();let z;e[8]!==T.id||e[9]!==T.slug?(z={connectionId:hs,orgId:T.id,orgSlug:T.slug},e[8]=T.id,e[9]=T.slug,e[10]=z):z=e[10];const E=gs(z);let U;e[11]!==R?(U=Bs(R),e[11]=R,e[12]=U):U=e[12];const q=U;let V;e[13]!==p||e[14]!==T.id?(V=p?[js.SELF(T.id)]:void 0,e[13]=p,e[14]=T.id,e[15]=V):V=e[15];const Y=V;let B;e[16]===Symbol.for("react.memo_cache_sentinel")?(B=[],e[16]=B):B=e[16];const[G,A]=K.useState(B);let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=[],e[17]=N):N=e[17];const[M,H]=K.useState(N);let te;e[18]===Symbol.for("react.memo_cache_sentinel")?(te=[],e[18]=te):te=e[18];const[Q,re]=K.useState(te),[W,ne]=K.useState("all"),ce=(M.length>0?1:0)+(Q.length>0?1:0)+(W!=="all"?1:0);let ze;e[19]!==_?(ze=Ut(_).map(yr),e[19]=_,e[20]=ze):ze=e[20];const Ie=ze;let Ce;e[21]!==l.startDate?(Ce=l.startDate.toISOString(),e[21]=l.startDate,e[22]=Ce):Ce=e[22];let ie;e[23]!==l.endDate?(ie=l.endDate.toISOString(),e[23]=l.endDate,e[24]=ie):ie=e[24];const Le=o.length===1?o[0]:void 0,ge=c.length===1?c[0]:void 0,je=i||void 0,ve=n==="errors"?!0:n==="success"?!1:void 0;let me;e[25]!==Y||e[26]!==q||e[27]!==Ce||e[28]!==ie||e[29]!==Le||e[30]!==ge||e[31]!==je||e[32]!==ve?(me={startDate:Ce,endDate:ie,connectionId:Le,excludeConnectionIds:Y,virtualMcpId:ge,toolName:je,isError:ve,...q},e[25]=Y,e[26]=q,e[27]=Ce,e[28]=ie,e[29]=Le,e[30]=ge,e[31]=je,e[32]=ve,e[33]=me):me=e[33];const Ne=me;let ue;e[34]===Symbol.for("react.memo_cache_sentinel")?(ue={id:"overview",label:"Overview"},e[34]=ue):ue=e[34];let xe;e[35]===Symbol.for("react.memo_cache_sentinel")?(xe={id:"audit",label:"Audit"},e[35]=xe):xe=e[35];let fe;e[36]===Symbol.for("react.memo_cache_sentinel")?(fe={id:"threads",label:"Threads"},e[36]=fe):fe=e[36];let pe;e[37]===Symbol.for("react.memo_cache_sentinel")?(pe=[ue,xe,fe,{id:"automations",label:"Automations"}],e[37]=pe):pe=e[37];const ke=pe;let we;e[38]===Symbol.for("react.memo_cache_sentinel")?(we=t.jsx(De.Title,{children:"Monitoring"}),e[38]=we):we=e[38];let se;e[39]!==C?(se=Te=>C(Te),e[39]=C,e[40]=se):se=e[40];let ee;e[41]!==se||e[42]!==r?(ee=t.jsx(qt,{tabs:ke,activeTab:r,onTabChange:se}),e[41]=se,e[42]=r,e[43]=ee):ee=e[43];let oe;e[44]!==v||e[45]!==o||e[46]!==$||e[47]!==I||e[48]!==p||e[49]!==f||e[50]!==G||e[51]!==Ie||e[52]!==m||e[53]!==h||e[54]!==R||e[55]!==n||e[56]!==r||e[57]!==i||e[58]!==c||e[59]!==P?(oe=(r==="overview"||r==="audit")&&t.jsxs(t.Fragment,{children:[t.jsxs(Z,{variant:f?"secondary":"outline",className:"gap-1.5",onClick:m,children:[f&&t.jsx("span",{className:"size-2 rounded-full bg-emerald-500 animate-pulse"}),t.jsx("span",{children:"Live"}),f&&t.jsx("span",{className:"text-muted-foreground text-xs",children:"3s"})]}),t.jsx(Nr,{connectionIds:o,virtualMcpIds:c,tool:i,status:n,hideSystem:p,propertyFilters:R,connectionOptions:$,virtualMcpOptions:P,activeFiltersCount:v,onUpdateFilters:h,connectionSearchTerm:I,onConnectionSearchChange:x,memberOptions:Ie,llmUserIds:G,onLlmUserIdsChange:A,showMemberFilter:r==="overview"})]}),e[44]=v,e[45]=o,e[46]=$,e[47]=I,e[48]=p,e[49]=f,e[50]=G,e[51]=Ie,e[52]=m,e[53]=h,e[54]=R,e[55]=n,e[56]=r,e[57]=i,e[58]=c,e[59]=P,e[60]=oe):oe=e[60];let he;e[61]!==Ie||e[62]!==r||e[63]!==ce||e[64]!==M||e[65]!==W||e[66]!==Q||e[67]!==P?(he=r==="threads"&&t.jsx(ks,{filterAgentIds:M,filterUserIds:Q,filterStatus:W,virtualMcpOptions:P,memberOptions:Ie,activeFiltersCount:ce,onUpdateFilters:Te=>{const{filterAgentIds:It,filterUserIds:Ct,filterStatus:kt}=Te;It!==void 0&&H(It),Ct!==void 0&&re(Ct),kt!==void 0&&ne(kt)}}),e[61]=Ie,e[62]=r,e[63]=ce,e[64]=M,e[65]=W,e[66]=Q,e[67]=P,e[68]=he):he=e[68];let be;e[69]!==b||e[70]!==u?(be={from:b,to:u},e[69]=b,e[70]=u,e[71]=be):be=e[71];let Oe;e[72]!==j||e[73]!==be?(Oe=t.jsx(Ys,{value:be,onChange:j}),e[72]=j,e[73]=be,e[74]=Oe):Oe=e[74];let Ee;e[75]!==oe||e[76]!==he||e[77]!==Oe?(Ee=t.jsxs("div",{className:"flex items-center gap-2",children:[oe,he,Oe]}),e[75]=oe,e[76]=he,e[77]=Oe,e[78]=Ee):Ee=e[78];let Pe;e[79]!==ee||e[80]!==Ee?(Pe=t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[ee,Ee]}),e[79]=ee,e[80]=Ee,e[81]=Pe):Pe=e[81];let Ae;e[82]!==h||e[83]!==d||e[84]!==r?(Ae=(r==="audit"||r==="threads")&&t.jsx(as,{value:d,onChange:Te=>h({search:Te}),placeholder:r==="threads"?"Search by title…":"Search by tool name, connection, or error...",onKeyDown:Te=>{Te.key==="Escape"&&(h({search:""}),Te.target.blur())},className:"w-full md:w-[375px]"}),e[82]=h,e[83]=d,e[84]=r,e[85]=Ae):Ae=e[85];let Ve;e[86]!==Pe||e[87]!==Ae?(Ve=t.jsx(De.Body,{className:"!pb-4",children:t.jsxs("div",{className:"flex flex-col gap-5",children:[we,Pe,Ae]})}),e[86]=Pe,e[87]=Ae,e[88]=Ve):Ve=e[88];let Ue;e[89]!==S||e[90]!==g||e[91]!==Ne||e[92]!==E||e[93]!==o||e[94]!==l||e[95]!==a||e[96]!==Y||e[97]!==f||e[98]!==G||e[99]!==L||e[100]!==_||e[101]!==d||e[102]!==n||e[103]!==r||e[104]!==M||e[105]!==W||e[106]!==Q||e[107]!==i||e[108]!==c?(Ue=r==="automations"?t.jsx(hr,{dateRange:l}):r==="threads"?t.jsx(Ts,{client:E,locator:L,membersData:_,allConnections:S,allVirtualMcps:g,dateRange:l,searchQuery:d,filterAgentIds:M,filterUserIds:Q,filterStatus:W}):r==="audit"?t.jsx(fr,{client:E,locator:L,baseParams:Ne,pageSize:X,isStreaming:f,streamingRefetchInterval:y,connectionIds:o,virtualMcpIds:c,tool:i,status:n,searchQuery:d,allConnections:S,allVirtualMcps:g,membersData:_}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto min-w-0",children:t.jsx(rr,{displayDateRange:a,connectionIds:o,excludeConnectionIds:Y,toolName:i||void 0,status:n==="errors"?"error":n==="success"?"success":void 0,connections:S,isStreaming:f,streamingRefetchInterval:y,llmUserIds:G})}),e[89]=S,e[90]=g,e[91]=Ne,e[92]=E,e[93]=o,e[94]=l,e[95]=a,e[96]=Y,e[97]=f,e[98]=G,e[99]=L,e[100]=_,e[101]=d,e[102]=n,e[103]=r,e[104]=M,e[105]=W,e[106]=Q,e[107]=i,e[108]=c,e[109]=Ue):Ue=e[109];let We;return e[110]!==Ve||e[111]!==Ue?(We=t.jsxs(t.Fragment,{children:[Ve,Ue]}),e[110]=Ve,e[111]=Ue,e[112]=We):We=e[112],We}function yr(s){const e=s.user.name??s.user.email??s.userId,r=s.user.image??void 0;return{value:s.userId,label:e,icon:l=>{const{className:a}=l;return t.jsx(Bt,{url:r,fallback:e,shape:"circle",size:"2xs",className:de("shrink-0",a)})}}}function wr(s){const e=s.icon,r=s.title??"Decopilot";return{value:s.id??"",label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Sr(s){const e=s.icon,r=s.title||s.id;return{value:s.id,label:r,icon:l=>{const{className:a}=l;return t.jsx(qe,{icon:e,name:r,size:"xs",fallbackIcon:t.jsx(Qe,{}),className:de("size-4! min-w-4! rounded-sm shrink-0",a)})}}}function Mo(){const s=le.c(83),{org:e}=Be(),r=yt();let l;s[0]===Symbol.for("react.memo_cache_sentinel")?(l={from:"/shell/$org/settings/monitor"},s[0]=l):l=s[0];const a=ls(l),{tab:o,from:c,to:i,connectionId:n,virtualMcpId:d,tool:f,search:p,status:v,streaming:b,propertyFilters:u,hideSystem:R}=a,h=o===void 0?"overview":o;let j;s[1]!==n?(j=n===void 0?[]:n,s[1]=n,s[2]=j):j=s[2];const m=j;let C;s[3]!==d?(C=d===void 0?[]:d,s[3]=d,s[4]=C):C=s[4];const S=C,g=b===void 0?!0:b,_=u===void 0?"":u,I=R===void 0?!1:R;let x,F,w,D,k,O,$;if(s[5]!==m.length||s[6]!==c||s[7]!==I||s[8]!==r||s[9]!==e.slug||s[10]!==_||s[11]!==a||s[12]!==v||s[13]!==g||s[14]!==i||s[15]!==f||s[16]!==S.length){k=qs(_);let A;s[24]!==r||s[25]!==e.slug||s[26]!==a?(A=Q=>{r({to:"/$org/settings/monitor",params:{org:e.slug},search:{...a,...Q}})},s[24]=r,s[25]=e.slug,s[26]=a,s[27]=A):A=s[27],$=A;let N;s[28]!==$?(N=Q=>{$({from:Q.from,to:Q.to})},s[28]=$,s[29]=N):N=s[29],D=N;let M,H;if(s[30]!==c||s[31]!==g||s[32]!==i){const Q=ye(c),re=ye(i);H=Q.date||new Date(Date.now()-18e5);const W=re.date||new Date;w={startDate:H,endDate:W},M=W,g&&i==="now"&&(M=new Date(W),M.setHours(M.getHours()+1)),s[30]=c,s[31]=g,s[32]=i,s[33]=w,s[34]=M,s[35]=H}else w=s[33],M=s[34],H=s[35];let te;s[36]!==M||s[37]!==H?(te={startDate:H,endDate:M},s[36]=M,s[37]=H,s[38]=te):te=s[38],F=te,x=0,m.length>0&&x++,S.length>0&&x++,f&&x++,v!=="all"&&x++,I&&x++,O=k.filter(Ir),s[5]=m.length,s[6]=c,s[7]=I,s[8]=r,s[9]=e.slug,s[10]=_,s[11]=a,s[12]=v,s[13]=g,s[14]=i,s[15]=f,s[16]=S.length,s[17]=x,s[18]=F,s[19]=w,s[20]=D,s[21]=k,s[22]=O,s[23]=$}else x=s[17],F=s[18],w=s[19],D=s[20],k=s[21],O=s[22],$=s[23];const J=O;J.length>0&&(x=x+J.length);let P;s[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(De.Body,{className:"!pb-3",children:t.jsx(De.Title,{children:"Monitoring"})}),s[39]=P):P=s[39];let X;s[40]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsxs(t.Fragment,{children:[P,t.jsx(De.Content,{children:t.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:t.jsx(St,{title:"Failed to load monitoring data",description:"There was an error loading the monitoring data. Please try again."})})})]}),s[40]=X):X=s[40];let y;s[41]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(De.Title,{children:"Monitoring"}),s[41]=y):y=s[41];let T;s[42]===Symbol.for("react.memo_cache_sentinel")?(T=[{id:"overview",label:"Overview"},{id:"audit",label:"Audit"},{id:"threads",label:"Threads"},{id:"automations",label:"Automations"}],s[42]=T):T=s[42];let L;s[43]!==$?(L=A=>$({tab:A}),s[43]=$,s[44]=L):L=s[44];let z;s[45]!==L||s[46]!==h?(z=t.jsx(De.Body,{className:"!pb-3",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[y,t.jsx(qt,{tabs:T,activeTab:h,onTabChange:L})]})}),s[45]=L,s[46]=h,s[47]=z):z=s[47];let E;s[48]!==h?(E=h==="threads"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):h==="audit"?t.jsx("div",{className:"flex-1 flex flex-col overflow-auto md:overflow-hidden",children:t.jsx(bt.Skeleton,{})}):t.jsx("div",{className:"flex-1 flex flex-col overflow-auto",children:t.jsx(or,{})}),s[48]=h,s[49]=E):E=s[49];let U;s[50]!==z||s[51]!==E?(U=t.jsxs(t.Fragment,{children:[z,E]}),s[50]=z,s[51]=E,s[52]=U):U=s[52];let q;s[53]!==D?(q=A=>{xt("monitoring_time_range_changed",{from:A.from,to:A.to}),D(A)},s[53]=D,s[54]=q):q=s[54];let V;s[55]!==g||s[56]!==$?(V=()=>{xt("monitoring_live_toggled",{enabled:!g}),$({streaming:!g})},s[55]=g,s[56]=$,s[57]=V):V=s[57];let Y;s[58]!==h||s[59]!==$?(Y=A=>{A!==h&&xt("monitoring_tab_changed",{from_tab:h,to_tab:A}),$({tab:A})},s[58]=h,s[59]=$,s[60]=Y):Y=s[60];let B;s[61]!==x||s[62]!==m||s[63]!==F||s[64]!==w||s[65]!==c||s[66]!==I||s[67]!==k||s[68]!==p||s[69]!==v||s[70]!==g||s[71]!==q||s[72]!==V||s[73]!==Y||s[74]!==h||s[75]!==i||s[76]!==f||s[77]!==$||s[78]!==S?(B=t.jsx(br,{tab:h,dateRange:F,displayDateRange:w,connectionIds:m,virtualMcpIds:S,tool:f,status:v,search:p,streaming:g,hideSystem:I,activeFiltersCount:x,from:c,to:i,propertyFilters:k,onUpdateFilters:$,onTimeRangeChange:q,onStreamingToggle:V,onTabChange:Y}),s[61]=x,s[62]=m,s[63]=F,s[64]=w,s[65]=c,s[66]=I,s[67]=k,s[68]=p,s[69]=v,s[70]=g,s[71]=q,s[72]=V,s[73]=Y,s[74]=h,s[75]=i,s[76]=f,s[77]=$,s[78]=S,s[79]=B):B=s[79];let G;return s[80]!==U||s[81]!==B?(G=t.jsx(ns,{capability:"monitoring:view",area:"monitoring",children:t.jsx(De,{children:t.jsx(os,{fallback:X,children:t.jsx(K.Suspense,{fallback:U,children:B})})})}),s[80]=U,s[81]=B,s[82]=G):G=s[82],G}function Ir(s){return s.key.trim()}export{Mo as default};
|