decocms 3.26.0 → 3.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-BMxAKelA.js → AlertCircle-BDfUS-lh.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-DG7ncF7e.js → ArrowUpRight-8daK_Mrm.js} +1 -1
- package/dist/client/assets/{Check-DAsUax2A.js → Check-C9-fsV6-.js} +1 -1
- package/dist/client/assets/{CheckCircle-DapdRT61.js → CheckCircle-B_rVd_l8.js} +1 -1
- package/dist/client/assets/{ChevronDown-CvjjO4Q2.js → ChevronDown--2U1gfXf.js} +1 -1
- package/dist/client/assets/{ChevronLeft-Gs1RtiyX.js → ChevronLeft-TttN4toV.js} +1 -1
- package/dist/client/assets/{ChevronRight-7dNKgA1Q.js → ChevronRight-BVEygGVH.js} +1 -1
- package/dist/client/assets/{ChevronUp-Bfs32oa3.js → ChevronUp-C-xaVM7d.js} +1 -1
- package/dist/client/assets/{Container-BsPBqDvc.js → Container-Bso4WS0x.js} +1 -1
- package/dist/client/assets/{DotsVertical-CXde2oS7.js → DotsVertical-Q3F6UWC_.js} +1 -1
- package/dist/client/assets/{Eye-D6bHaQr4.js → Eye-CKz6zS_m.js} +1 -1
- package/dist/client/assets/{FilterLines-BvkIR4mw.js → FilterLines-SKQT-eWL.js} +1 -1
- package/dist/client/assets/{Globe01-DmgjAJMv.js → Globe01-iupU5eqh.js} +1 -1
- package/dist/client/assets/{HardDrive-DHhWmtHD.js → HardDrive-DpuvbJvr.js} +1 -1
- package/dist/client/assets/{Key01-B6vkSFpA.js → Key01-6eW9IRFT.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DNeQuoPU.js → LayoutLeft-BkxKKkMX.js} +1 -1
- package/dist/client/assets/{LinkExternal01-nh0BZS6k.js → LinkExternal01-BXhdtlT7.js} +1 -1
- package/dist/client/assets/{Monitor01-CL_JQxSE.js → Monitor01-DUICZH5i.js} +1 -1
- package/dist/client/assets/{Palette-DuVlRUl1.js → Palette-CS36Icvl.js} +1 -1
- package/dist/client/assets/{Play-BKWsBWVV.js → Play-CbbqvWPd.js} +1 -1
- package/dist/client/assets/{Plus--M57WnYY.js → Plus-CSNkL1o7.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-9s8U4eT2.js → RefreshCcw01-Dncu-kYd.js} +1 -1
- package/dist/client/assets/{SearchMd-CydDKgfR.js → SearchMd-B-q2EsGW.js} +1 -1
- package/dist/client/assets/{Settings02-C0Vd7Zwk.js → Settings02-CdJ0CKrL.js} +1 -1
- package/dist/client/assets/{Shield01-DQezJsaZ.js → Shield01-Crgp73nV.js} +1 -1
- package/dist/client/assets/{Star01-BqKHEuRy.js → Star01-CN33xE6w.js} +1 -1
- package/dist/client/assets/{Stars01-B4X8b1Jx.js → Stars01-BXO9Nc4-.js} +1 -1
- package/dist/client/assets/{Stars02-D1g7u2cM.js → Stars02-B4CoQ82E.js} +1 -1
- package/dist/client/assets/{Sun-BVKwIX9x.js → Sun-CEzPQTAJ.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CcFSgubQ.js → SwitchHorizontal01-BI_yHGXL.js} +1 -1
- package/dist/client/assets/{Tool01-BXNZh2qp.js → Tool01-R6WyaXsu.js} +1 -1
- package/dist/client/assets/{Trash01-2bR-uPSg.js → Trash01-C3pnsiws.js} +1 -1
- package/dist/client/assets/{Upload01-CSHw8GzO.js → Upload01-BHsRhr7X.js} +1 -1
- package/dist/client/assets/{User01-DkssIo5L.js → User01-JuGE_kA7.js} +1 -1
- package/dist/client/assets/{Users01-C4ys_X1V.js → Users01-BVUwP6xk.js} +1 -1
- package/dist/client/assets/{Users03-Ch0fsFZl.js → Users03-Bek4Ag3W.js} +1 -1
- package/dist/client/assets/{X-B_CzjCcZ.js → X-BdwzFded.js} +1 -1
- package/dist/client/assets/{XCircle-D6KmkB1w.js → XCircle-D_3MYOn4.js} +1 -1
- package/dist/client/assets/{XClose-CL_GGKfg.js → XClose-Da5LgJSi.js} +1 -1
- package/dist/client/assets/{Zap-C2NXr_2-.js → Zap-DHBAOmqP.js} +1 -1
- package/dist/client/assets/{ZapSquare-CXVEflpu.js → ZapSquare-CP91cLS8.js} +1 -1
- package/dist/client/assets/{ZoomOut-Ct_43S-M.js → ZoomOut-CaG3Pd1Z.js} +1 -1
- package/dist/client/assets/{access-gate-Cg_m2EkF.js → access-gate-AjUY-gkn.js} +1 -1
- package/dist/client/assets/{accordion-GNLNh1P7.js → accordion-JZC0q2Q6.js} +1 -1
- package/dist/client/assets/{add-section-modal-B25HWVt6.js → add-section-modal-B5en9ngD.js} +1 -1
- package/dist/client/assets/{agent-capabilities-CuO1YJHD.js → agent-capabilities-gx2lqG9R.js} +1 -1
- package/dist/client/assets/{agent-icon-BwP0Et7D.js → agent-icon-DAPplz1A.js} +1 -1
- package/dist/client/assets/{agent-icons-wvh0Gw6w.js → agent-icons-Dk-aO0GI.js} +1 -1
- package/dist/client/assets/{agents-list-BBrpBeUe.js → agents-list-Cqp5uusD.js} +1 -1
- package/dist/client/assets/{ai-providers-7gbB0ywA.js → ai-providers-DLs4iaPF.js} +1 -1
- package/dist/client/assets/{alert-CQ2VjRZO.js → alert-C04qeSRO.js} +1 -1
- package/dist/client/assets/{alert-dialog-vI1Lu2-O.js → alert-dialog-Q8M8ngFf.js} +1 -1
- package/dist/client/assets/app-editor-CNA09iLR.js +1 -0
- package/dist/client/assets/{auth-catchall-BJ1IGDyu.js → auth-catchall-BbuGVKd9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bw2IKgRr.js → auth-split-layout-sY7FyVQz.js} +1 -1
- package/dist/client/assets/{automation-list-row-CYm86TWt.js → automation-list-row-BRsSmcOA.js} +1 -1
- package/dist/client/assets/{automation-runs-Ti4wgD4j.js → automation-runs-gdpRnoA6.js} +1 -1
- package/dist/client/assets/{automations-CuSjGzDt.js → automations-zDSrpko2.js} +1 -1
- package/dist/client/assets/{avatar-B1sIFV2q.js → avatar-BqNGZrFg.js} +1 -1
- package/dist/client/assets/{badge-DRll7ujf.js → badge-BBLSXFe0.js} +1 -1
- package/dist/client/assets/{brand-context-ygYc4DVi.js → brand-context-Be4M-ZZ_.js} +1 -1
- package/dist/client/assets/{buckets-NpZ3I26S.js → buckets-D-k7xX4_.js} +1 -1
- package/dist/client/assets/{calendar-BY30pt7Q.js → calendar-CfY7gp-n.js} +1 -1
- package/dist/client/assets/{capability-load-error-C-jFkOfs.js → capability-load-error-CjE005FF.js} +1 -1
- package/dist/client/assets/{card-CAuo8u4J.js → card-D41ULrnf.js} +1 -1
- package/dist/client/assets/{chat-context-B6nnSsoK.js → chat-context-BFmJRDzy.js} +1 -1
- package/dist/client/assets/{checkbox-VYmYnWwT.js → checkbox-CBmcFqoh.js} +1 -1
- package/dist/client/assets/{cli-auth-success-vRIn_eet.js → cli-auth-success-BcBQhgvD.js} +1 -1
- package/dist/client/assets/{collection-detail-BRiBfXt1.js → collection-detail-kkp2noDH.js} +1 -1
- package/dist/client/assets/{collection-display-button-C1vhuWIV.js → collection-display-button-BNfKMIgL.js} +1 -1
- package/dist/client/assets/{collection-search-D_ABFSJm.js → collection-search-CDLcWLfd.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-TsgGm401.js → collection-table-wrapper-DrTvLn6R.js} +1 -1
- package/dist/client/assets/{collection-tabs-B3byPZ-7.js → collection-tabs-CbZbTMYY.js} +1 -1
- package/dist/client/assets/{collections-DOXzzPSi.js → collections-BxDJ4z3g.js} +1 -1
- package/dist/client/assets/{command-Cb4o9tFP.js → command-B8qtKAnE.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-D32QDb7y.js → connect-desktop-dialog-CDUh5Otr.js} +1 -1
- package/dist/client/assets/{connection-card-B5aPn-kF.js → connection-card-CSsbMtfE.js} +1 -1
- package/dist/client/assets/{connection-detail-DvVq9GrZ.js → connection-detail-E_AC0EPN.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C9KldO7w.js → connection-form-helpers-BonOFyzw.js} +1 -1
- package/dist/client/assets/{connections-BHJKqb2r.js → connections-Ca9YMoFm.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-PkZWgl1b.js → decopilot-sse-pool-BHhoQKaF.js} +1 -1
- package/dist/client/assets/{dialog-DuSQekhR.js → dialog-Cwf6uY_y.js} +1 -1
- package/dist/client/assets/{domain-settings-D_UpnRy3.js → domain-settings-oLlPZ4Z3.js} +1 -1
- package/dist/client/assets/{drawer-Bg-jxDzw.js → drawer-CF0b7Dg3.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CARiw96O.js → dropdown-menu-UGlYpK18.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-Cg6MQn9A.js → dynamic-plugin-layout-V_3blVro.js} +1 -1
- package/dist/client/assets/{empty-state-BFRGvQJV.js → empty-state-CoXt5rYF.js} +1 -1
- package/dist/client/assets/{empty-state-Bf0CnRmM.js → empty-state-h_qXtgbw.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BQN0XcpU.js → extract-connection-data-BKeaLULt.js} +1 -1
- package/dist/client/assets/{features-CbGxHgM5.js → features-u4e9ViPZ.js} +1 -1
- package/dist/client/assets/{file-explorer-CfWG7uq-.js → file-explorer-BHKOSo2p.js} +1 -1
- package/dist/client/assets/{file-type-icon-BjW0X7UA.js → file-type-icon-7TqtrpuQ.js} +1 -1
- package/dist/client/assets/{files-BexoaUh4.js → files-C9p4yssc.js} +1 -1
- package/dist/client/assets/{form-BvjKd_au.js → form-Bbpyf2N_.js} +1 -1
- package/dist/client/assets/{general-C2Wo2LII.js → general-DqO6G3WI.js} +1 -1
- package/dist/client/assets/{generate-id-DinZwiHf.js → generate-id-BHe5yw90.js} +1 -1
- package/dist/client/assets/{github-repo-picker-BYZynVZd.js → github-repo-picker-CVG2zsbh.js} +1 -1
- package/dist/client/assets/{header-tab-button-vCaN7_p9.js → header-tab-button-t5WNjrVG.js} +1 -1
- package/dist/client/assets/{hover-card-BkNpxP5y.js → hover-card-Azyk5Kxa.js} +1 -1
- package/dist/client/assets/{image-field-BcDmX0lb.js → image-field-CXkzTwa7.js} +1 -1
- package/dist/client/assets/{index-Ltotqxx3.js → index-B_tO_wVS.js} +1 -1
- package/dist/client/assets/{index-XT2ypj9o.js → index-Bjie-Vum.js} +1 -1
- package/dist/client/assets/{index-BqYAHqUy.js → index-CAs8iq4o.js} +1 -1
- package/dist/client/assets/{index-D_9lHNft.js → index-CiRQNPVt.js} +26 -26
- package/dist/client/assets/{index-DqgJBP88.js → index-Co-NpkaC.js} +1 -1
- package/dist/client/assets/{index-EkC6Wgvu.js → index-CwyiLbkO.js} +1 -1
- package/dist/client/assets/{index-C8ak9QK4.js → index-DCeOX6CY.js} +1 -1
- package/dist/client/assets/{index-DFGtbhNW.js → index-DJTEqPXf.js} +1 -1
- package/dist/client/assets/{index-D0Rl33jh.js → index-DbpajCnQ.js} +1 -1
- package/dist/client/assets/{index-TdafCTTv.js → index-DcI1sEv_.js} +1 -1
- package/dist/client/assets/{index-BV60pfZO.js → index-Dci2MWs9.js} +1 -1
- package/dist/client/assets/{index-CqIGcVM5.js → index-DkWynf6r.js} +4 -4
- package/dist/client/assets/{index-mPhRDxKC.js → index-f0X8ef8k.js} +1 -1
- package/dist/client/assets/{index-redirect-iDZ7rdjA.js → index-redirect-D6d28r6b.js} +1 -1
- package/dist/client/assets/{index-BHO4w1u1.js → index-skFG1_ns.js} +1 -1
- package/dist/client/assets/{index--csa0NIE.js → index-sqqDCA0K.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-LkZo4FLa.js → infiniteQueryObserver-BND7fiNU.js} +1 -1
- package/dist/client/assets/{input-qZmHVwVk.js → input-D3E6n6la.js} +1 -1
- package/dist/client/assets/{integration-icon-C1U-qRrw.js → integration-icon-vaGvNHHz.js} +1 -1
- package/dist/client/assets/{label-CaQIF3sq.js → label-DLUhXNk7.js} +1 -1
- package/dist/client/assets/{layout-CXMrfa7S.js → layout-PdamBSR0.js} +1 -1
- package/dist/client/assets/{login-CrnaKNOH.js → login-CX7WJC_U.js} +1 -1
- package/dist/client/assets/{members-uoozZ2e_.js → members-Bw9vSm5N.js} +1 -1
- package/dist/client/assets/{monaco-editor-DHDkzYxT.js → monaco-editor-Bgzj9gt4.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BSw7UeX-.js → monitoring-stats-row-DOXVZiRZ.js} +1 -1
- package/dist/client/assets/{oauth-callback-BUbb-Yxh.js → oauth-callback-Cfp_JeoH.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CS14SoU4.js → oauth-callback-ai-provider-DOmF-VOd.js} +1 -1
- package/dist/client/assets/{onboarding-46pq3q4-.js → onboarding-C4KH1uOA.js} +1 -1
- package/dist/client/assets/{org-install-B2vwkCv6.js → org-install-CrBGOT0T.js} +1 -1
- package/dist/client/assets/{org-layout-Ciofbts8.js → org-layout-BCdmD1Ye.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-DMOWWtN5.js → org-plugin-layout-shv3-lWc.js} +1 -1
- package/dist/client/assets/{page-seo-form-E8Xuu6pU.js → page-seo-form-qANN0Bj1.js} +1 -1
- package/dist/client/assets/page-seo-sheet-D4wNk0RY.js +1 -0
- package/dist/client/assets/{pair-BECiICOf.js → pair-CpEuUIpQ.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-proif5Kw.js → plugin-empty-state-CrO1kZyK.js} +1 -1
- package/dist/client/assets/{plugin-header-DiKWwicN.js → plugin-header-DTTyXwvF.js} +1 -1
- package/dist/client/assets/{plugin-layout-jEsqtIvi.js → plugin-layout-CXygrV9H.js} +1 -1
- package/dist/client/assets/{popover-DxfiKqtN.js → popover-C1MgHMHU.js} +1 -1
- package/dist/client/assets/{post-editor-Cd_fTA44.js → post-editor-aLUVDKW-.js} +1 -1
- package/dist/client/assets/{primitives-BTOBsqmw.js → primitives-BBsQqWkR.js} +1 -1
- package/dist/client/assets/{profile-BqAyYu-M.js → profile-CjQ0lj2q.js} +1 -1
- package/dist/client/assets/{project-app-view-DmLtoqnJ.js → project-app-view-Br1j175t.js} +1 -1
- package/dist/client/assets/record-editor-QHa9iaw5.js +1 -0
- package/dist/client/assets/registry-BkLh6mX8.js +2 -0
- package/dist/client/assets/{registry-layout-BG3AnslH.js → registry-layout-CHn-aQtX.js} +1 -1
- package/dist/client/assets/{require-capability-Dt_vTM1Z.js → require-capability-vzDtNqMc.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BDfnx0GP.js → required-auth-layout-BE5eceMw.js} +1 -1
- package/dist/client/assets/{reset-password-ChN7Tqyl.js → reset-password-8Qbe0fKB.js} +1 -1
- package/dist/client/assets/{resizable-BI-r4qXK.js → resizable-CrMJy22o.js} +1 -1
- package/dist/client/assets/{roles-CFYhpHcN.js → roles-BRTHcf_Y.js} +1 -1
- package/dist/client/assets/save-referenced-block-CBTtXYiM.js +1 -0
- package/dist/client/assets/{save-status-CawBXVDE.js → save-status-BZf4M3tc.js} +1 -1
- package/dist/client/assets/{schema-form-BjXF8RK3.js → schema-form-DNuUk0WJ.js} +1 -1
- package/dist/client/assets/{scroll-area-DVMjy47-.js → scroll-area-verb-Y8E.js} +1 -1
- package/dist/client/assets/{search-input-CkhxfIsR.js → search-input-CZKc9XZR.js} +1 -1
- package/dist/client/assets/{secrets-CbQdoHgM.js → secrets-ScbIQJha.js} +1 -1
- package/dist/client/assets/{sections-editor-DV3kpz03.js → sections-editor-CysGozit.js} +1 -1
- package/dist/client/assets/{select-PSSPlsU1.js → select-BMX9jvQG.js} +1 -1
- package/dist/client/assets/{select-model-BpdSBLsc.js → select-model-BB2-8k_v.js} +1 -1
- package/dist/client/assets/{seo-editor-Jt9dbhQY.js → seo-editor-gLS5nwCw.js} +1 -1
- package/dist/client/assets/{settings-layout-DzzgWBAF.js → settings-layout-EdgjO8iZ.js} +1 -1
- package/dist/client/assets/{settings-section-DX6xMsTR.js → settings-section-CQW36fJV.js} +1 -1
- package/dist/client/assets/{sheet-Oks1OcjX.js → sheet-Utq51ofH.js} +1 -1
- package/dist/client/assets/{shell-controls-DdX5BU8v.js → shell-controls-CXM2LvTp.js} +1 -1
- package/dist/client/assets/{shell-layout-H6jARH8O.js → shell-layout-3b4NfWya.js} +1 -1
- package/dist/client/assets/{shell-route-loading-CnyyKxEP.js → shell-route-loading-DSfyT3dO.js} +1 -1
- package/dist/client/assets/{sidebar-BwviWuqz.js → sidebar-BBqRosV0.js} +1 -1
- package/dist/client/assets/{skeleton-CmlQmFqJ.js → skeleton-dQOYuNlQ.js} +1 -1
- package/dist/client/assets/{sortable.esm-DVw3F56v.js → sortable.esm-D7AgS_lX.js} +1 -1
- package/dist/client/assets/{spinner-BbBMNj3j.js → spinner-_hqWpG0c.js} +1 -1
- package/dist/client/assets/{sso-bQ7a4Wkw.js → sso-Cg_UsaPg.js} +1 -1
- package/dist/client/assets/{store-Bsg-sLwK.js → store-BIRCadh0.js} +1 -1
- package/dist/client/assets/store-registry-Duulq-Qg.js +2 -0
- package/dist/client/assets/{switch-BRhAphGZ.js → switch-CTAzWsjZ.js} +1 -1
- package/dist/client/assets/{tab-id-GrYtygnH.js → tab-id-C7unjelb.js} +1 -1
- package/dist/client/assets/{table-BnrXHE8K.js → table-BuLHtfTA.js} +1 -1
- package/dist/client/assets/{tabs-D_s13ChS.js → tabs-DVd_y6YL.js} +1 -1
- package/dist/client/assets/{task-status-COlFRUCZ.js → task-status-5oHTrkjV.js} +1 -1
- package/dist/client/assets/{textarea-RGerMgoO.js → textarea-D1h5iq3D.js} +1 -1
- package/dist/client/assets/{toggle-group-CU0v81Ih.js → toggle-group-vA7ktrP-.js} +1 -1
- package/dist/client/assets/{toolbar-DI4zFcGt.js → toolbar-D3G0G9U8.js} +1 -1
- package/dist/client/assets/{tools-list-B0AstuUA.js → tools-list-BL4u8QMN.js} +1 -1
- package/dist/client/assets/{tooltip-Dxcglul8.js → tooltip-C47QSg8i.js} +1 -1
- package/dist/client/assets/{types-DyZd0-8M.js → types-Df_Z2FUK.js} +1 -1
- package/dist/client/assets/{use-ai-providers-YGnfRGj2.js → use-ai-providers-Bwbur0GT.js} +1 -1
- package/dist/client/assets/{use-automations-WJfWe2eO.js → use-automations-B9mdkXiu.js} +1 -1
- package/dist/client/assets/{use-capability-DicDY0V0.js → use-capability-1uxC8-oZ.js} +1 -1
- package/dist/client/assets/{use-collections-BhIpSec0.js → use-collections-B1Mg9Y32.js} +1 -1
- package/dist/client/assets/{use-connection-DyEd_53i.js → use-connection-DpxWBF4Y.js} +1 -1
- package/dist/client/assets/{use-copy-BWRM1GFQ.js → use-copy-B_uLjrw6.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-LyDs-RK7.js → use-create-virtual-mcp-BBxov1Li.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CyJDtE_p.js → use-debounced-autosave-DDZnxori.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DPGLjHu6.js → use-delete-connection-eQCNxdaR.js} +1 -1
- package/dist/client/assets/{use-file-configs-DW8b63k1.js → use-file-configs-o-LP0Blk.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Bjr74B_I.js → use-infinite-scroll-D8iZFAEQ.js} +1 -1
- package/dist/client/assets/{use-list-state-DA4uW5-F.js → use-list-state-BkETzhj1.js} +1 -1
- package/dist/client/assets/{use-mcp-client-D2Esndjo.js → use-mcp-client-D0A6RZFw.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-aNKdmxr5.js → use-mcp-prompts-BuV5LRNr.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-w8wkQWHv.js → use-mcp-tools-BTzw-W77.js} +1 -1
- package/dist/client/assets/{use-members-Cjg6uzGv.js → use-members-DDVaE5yQ.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C4slAg0v.js → use-navigate-to-agent-Drh7z3D_.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CP1VkpDC.js → use-org-auth-client-BlGBETGB.js} +1 -1
- package/dist/client/assets/{use-org-sso-BvlZOUK0.js → use-org-sso-nq4qWMpD.js} +1 -1
- package/dist/client/assets/{use-organization-roles-O_efgibr.js → use-organization-roles-i1o2TOl8.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BKtE3g0_.js → use-organization-settings-PADdytdf.js} +1 -1
- package/dist/client/assets/{use-registry-connections-ma81Jd27.js → use-registry-connections-C0VEE_YX.js} +1 -1
- package/dist/client/assets/{use-secrets-BReddp3W.js → use-secrets-DZDUsUGC.js} +1 -1
- package/dist/client/assets/{use-status-sounds-_5ZyXBn9.js → use-status-sounds-DR8WA3PU.js} +1 -1
- package/dist/client/assets/{use-view-mode-D08IYWya.js → use-view-mode-BpduDYTq.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CUzlEmy7.js → use-virtual-mcp-DciRKx1X.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C1jLiRqA.js +1 -0
- package/dist/client/assets/{useRouterState-Dm4Ahsuz.js → useRouterState-BXwm4DCl.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CHLM-3cW.js +1 -0
- package/dist/client/assets/{user-5CeIpkMN.js → user-DaO6RYsc.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B6EFa13S.js → view-mode-toggle-B-ZBNJWV.js} +1 -1
- package/dist/client/assets/{workflow-D7hXr9W_.js → workflow-C3zNP9N8.js} +1 -1
- package/dist/client/assets/workflow-detail-CFwJ5L9v.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/app-editor-XoC0K6nd.js +0 -1
- package/dist/client/assets/page-seo-sheet-CsEDXdX4.js +0 -1
- package/dist/client/assets/record-editor-D19UicJW.js +0 -1
- package/dist/client/assets/registry-m_YtY1sy.js +0 -2
- package/dist/client/assets/save-referenced-block-DPW9loZT.js +0 -1
- package/dist/client/assets/store-registry-BRkp9_j0.js +0 -2
- package/dist/client/assets/useInfiniteQuery-ZzAx8SRK.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Bt3Ej1B7.js +0 -1
- package/dist/client/assets/workflow-detail-B3ObK6-G.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ar as Ye,as as de,at as et,au as tt,av as Ie,G as he,aw as st,ax as it,r as A,ay as nt,az as rt,aA as ot,aB as lt,aC as ve,aD as at,aE as ct,aF as dt,e as T,j as i,q as Z,c as q,l as $e,aG as pe,o as W,K as re,n as oe,a as mt,v as ut,E as ft,b as ht,B as je}from"./index-D_9lHNft.js";import{u as xe}from"./tooltip-Dxcglul8.js";import{i as pt,u as ee,S as Te,g as xt}from"./use-mcp-client-D2Esndjo.js";import{a as gt,b as bt,v as yt,u as vt}from"./use-virtual-mcp-CUzlEmy7.js";import{i as jt}from"./Check-DAsUax2A.js";import{Z as wt,A as Y,$ as Nt,u as St,c as _t}from"./agent-icon-BwP0Et7D.js";import{s as ge}from"./Plus--M57WnYY.js";import{i as Ae}from"./X-B_CzjCcZ.js";import{u as Ct,b as kt,h as Et,C as ie}from"./agent-capabilities-CuO1YJHD.js";import{u as It,c as $t}from"./chat-context-B6nnSsoK.js";import{N as Tt}from"./agent-icons-wvh0Gw6w.js";import{u as Me,a as ne,K as Oe,P as Re,D as ze,c as At,S as Mt,v as Ot,b as Rt,C as zt,s as Pt,d as Dt,e as Ht,f as Lt}from"./sortable.esm-DVw3F56v.js";import{u as Pe,a as De,o as Ut}from"./use-organization-settings-BKtE3g0_.js";import{c as be,u as Bt,h as Ft}from"./shell-layout-H6jARH8O.js";import{I as Qt}from"./input-qZmHVwVk.js";import{S as Wt}from"./scroll-area-DVMjy47-.js";import{S as qt,c as Kt,d as Gt,a as Vt,b as Zt}from"./sheet-Oks1OcjX.js";import{S as H}from"./skeleton-CmlQmFqJ.js";import{t as He}from"./ChevronDown-CvjjO4Q2.js";import{d as Le}from"./ZoomOut-Ct_43S-M.js";import{g as Jt,M as Xt}from"./types-DyZd0-8M.js";import{I as Yt}from"./integration-icon-C1U-qRrw.js";import{u as es}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Ue,P as ts,e as ss,s as is,g as ns}from"./pair-BECiICOf.js";import{a as rs}from"./XCircle-D6KmkB1w.js";import{g as os}from"./use-mcp-prompts-aNKdmxr5.js";import{u as ls,w as as}from"./tab-id-GrYtygnH.js";import{a as cs,d as ds,c as ms,b as us,D as fs}from"./dropdown-menu-CARiw96O.js";import{s as hs}from"./Trash01-2bR-uPSg.js";import{a as ps,u as xs}from"./use-ai-providers-YGnfRGj2.js";import{a as gs}from"./toolbar-DI4zFcGt.js";import"./use-collections-BhIpSec0.js";import"./AlertCircle-BMxAKelA.js";import"./Tool01-BXNZh2qp.js";import"./SwitchHorizontal01-CcFSgubQ.js";import"./RefreshCcw01-9s8U4eT2.js";import"./ArrowUpRight-DG7ncF7e.js";import"./ZapSquare-CXVEflpu.js";import"./Users03-Ch0fsFZl.js";import"./CheckCircle-DapdRT61.js";import"./ChevronLeft-Gs1RtiyX.js";import"./ChevronRight-7dNKgA1Q.js";import"./ChevronUp-Bfs32oa3.js";import"./DotsVertical-CXde2oS7.js";import"./Container-BsPBqDvc.js";import"./Eye-D6bHaQr4.js";import"./Globe01-DmgjAJMv.js";import"./FilterLines-BvkIR4mw.js";import"./Star01-BqKHEuRy.js";import"./Palette-DuVlRUl1.js";import"./HardDrive-DHhWmtHD.js";import"./Stars02-D1g7u2cM.js";import"./Key01-B6vkSFpA.js";import"./LayoutLeft-DNeQuoPU.js";import"./LinkExternal01-nh0BZS6k.js";import"./Monitor01-CL_JQxSE.js";import"./Sun-BVKwIX9x.js";import"./Play-BKWsBWVV.js";import"./SearchMd-CydDKgfR.js";import"./Settings02-C0Vd7Zwk.js";import"./Shield01-DQezJsaZ.js";import"./Stars01-B4X8b1Jx.js";import"./Upload01-CSHw8GzO.js";import"./User01-DkssIo5L.js";import"./Users01-C4ys_X1V.js";import"./XClose-CL_GGKfg.js";import"./Zap-C2NXr_2-.js";import"./spinner-BbBMNj3j.js";import"./dialog-DuSQekhR.js";import"./drawer-Bg-jxDzw.js";import"./collection-search-D_ABFSJm.js";import"./form-BvjKd_au.js";import"./label-CaQIF3sq.js";import"./select-PSSPlsU1.js";import"./tabs-D_s13ChS.js";import"./toggle-group-CU0v81Ih.js";import"./connect-desktop-dialog-D32QDb7y.js";import"./popover-DxfiKqtN.js";import"./command-Cb4o9tFP.js";import"./index-DFGtbhNW.js";import"./useInfiniteQuery-ZzAx8SRK.js";import"./infiniteQueryObserver-LkZo4FLa.js";import"./index-DqgJBP88.js";import"./question-004-sINsf4GQ.js";import"./checkbox-VYmYnWwT.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-B1sIFV2q.js";import"./settings-section-DX6xMsTR.js";import"./card-CAuo8u4J.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-B5aPn-kF.js";import"./use-registry-connections-ma81Jd27.js";import"./use-connection-DyEd_53i.js";import"./extract-connection-data-BQN0XcpU.js";import"./generate-id-DinZwiHf.js";import"./collections-DOXzzPSi.js";import"./collection-tabs-B3byPZ-7.js";import"./badge-DRll7ujf.js";import"./textarea-RGerMgoO.js";import"./connection-form-helpers-C9KldO7w.js";import"./use-infinite-scroll-Bjr74B_I.js";import"./useSuspenseInfiniteQuery-Bt3Ej1B7.js";import"./required-auth-layout-BDfnx0GP.js";import"./useRouterState-Dm4Ahsuz.js";import"./use-org-sso-BvlZOUK0.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BWRM1GFQ.js";import"./file-type-icon-BjW0X7UA.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-C4slAg0v.js";import"./decopilot-sse-pool-PkZWgl1b.js";import"./create-sse-subscription-BS5983N4.js";function we(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function bs(t,e,s){const r=t.slice(0);return r[e]=s,r}var ys=class extends Ye{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#i=e,de.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),o=s.length!==n.length,d=n.some((m,u)=>m!==s[u]),l=o||d,c=l?!0:a.some((m,u)=>{const f=this.#e[u];return!f||!et(m,f)});!l&&!c||(l&&(this.#c=r,this.#t=n),this.#e=a,this.hasListeners()&&(l&&(we(s,n).forEach(m=>{m.destroy()}),we(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#m(a??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,a=>{e.forEach(o=>{o.observer.trackProp(a)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,o)=>a!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=tt(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ie(this.#n,n);s.push({defaultedQueryOptions:n,observer:o})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=bs(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#i?.combine);(e||s!==r)&&de.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function vs({queries:t,...e},s){const r=he(s),n=st(),a=it(),o=A.useMemo(()=>t.map(h=>{const x=r.defaultQueryOptions(h);return x._optimisticResults=n?"isRestoring":"optimistic",x}),[t,r,n]);o.forEach(h=>{nt(h);const x=r.getQueryCache().get(h.queryHash);rt(h,a,x)}),ot(a);const[d]=A.useState(()=>new ys(r,o,e)),[l,c,m]=d.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;A.useSyncExternalStore(A.useCallback(h=>u?d.subscribe(de.batchCalls(h)):lt,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),A.useEffect(()=>{d.setQueries(o,e)},[o,e,d]);const p=l.some((h,x)=>ve(o[x],h))?l.flatMap((h,x)=>{const b=o[x];if(b&&ve(b,h)){const v=new Ie(r,b);return at(b,v,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const g=l.find((h,x)=>{const b=o[x];return b&&ct({result:h,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g?.error)throw g.error;return c(m())}function js(t,e){return vs({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:dt,enabled:!0,placeholderData:void 0}))},e)}const te=8;function ws(t){const e=T.c(16),{open:s,onOpenChange:r}=t,[n,a]=A.useState("");let o,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(qt,{children:"Manage home"}),d=i.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=d):(o=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(wt,{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 c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h=>a(h.target.value),e[3]=c):c=e[3];let m;e[4]!==n?(m=i.jsxs(Gt,{className:"px-5 py-4 border-b border-border",children:[o,d,i.jsxs("div",{className:"relative mt-3",children:[l,i.jsx(Qt,{value:n,onChange:c,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Zs,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Wt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(A.Suspense,{fallback:u,children:i.jsx(Ss,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==f?(p=i.jsxs(Vt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=p):p=e[11];let g;return e[12]!==r||e[13]!==s||e[14]!==p?(g=i.jsx(Zt,{open:s,onOpenChange:r,children:p}),e[12]=r,e[13]=s,e[14]=p,e[15]=g):g=e[15],g}function Ns(t){const e=T.c(32),{org:s}=Z(),r=Pe();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const a=n,o=De(),d=bt(),l=he();let c;e[2]!==s||e[3]!==l?(c=()=>l.refetchQueries({queryKey:re.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=c):c=e[4];const m=c;let u;e[5]!==a?(u=C=>a.includes(C),e[5]=a,e[6]=u):u=e[6];const f=u;let p;e[7]!==a||e[8]!==t?(p=t?a.filter(C=>t.has(C)).length:a.length,e[7]=a,e[8]=t,e[9]=p):p=e[9];const h=p>=te;let x;e[10]!==h||e[11]!==f||e[12]!==o?(x=C=>f(C)||h?Promise.resolve():o.apply(I=>I.includes(C)?null:[...I,C]),e[10]=h,e[11]=f,e[12]=o,e[13]=x):x=e[13];const b=x;let v;e[14]!==o?(v=C=>o.apply(I=>I.filter(E=>E!==C)),e[14]=o,e[15]=v):v=e[15];const w=v;let y;e[16]!==o?(y=C=>o.apply(()=>C),e[16]=o,e[17]=y):y=e[17];const j=y;let N;e[18]!==d||e[19]!==h||e[20]!==f||e[21]!==m||e[22]!==o?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!h&&await o.apply(E=>E.includes(C.id)?null:[...E,C.id]),await m()},e[18]=d,e[19]=h,e[20]=f,e[21]=m,e[22]=o,e[23]=N):N=e[23];const S=N;let k;return e[24]!==b||e[25]!==h||e[26]!==a||e[27]!==f||e[28]!==w||e[29]!==j||e[30]!==S?(k={homeIds:a,isOnHome:f,atLimit:h,addAgent:b,removeAgent:w,reorder:j,saveAgentMetadata:S},e[24]=b,e[25]=h,e[26]=a,e[27]=f,e[28]=w,e[29]=j,e[30]=S,e[31]=k):k=e[31],k}function Ss(t){const e=T.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=gt(r);let a;e[1]!==n?(a=new Set(n.map(Is)),e[1]=n,e[2]=a):a=e[2];const o=Ns(a);let d,l,c;if(e[3]!==n||e[4]!==o||e[5]!==s){const h=new Map(n.map(Es));d=s.trim().toLowerCase();const x=v=>!d||v.title?.toLowerCase().includes(d);l=o.homeIds.map(v=>h.get(v)).filter(ks).filter(x);let b;e[9]!==o?(b=v=>!o.isOnHome(v.id),e[9]=o,e[10]=b):b=e[10],c=n.filter(Cs).filter(b).filter(x).sort(_s),e[3]=n,e[4]=o,e[5]=s,e[6]=d,e[7]=l,e[8]=c}else d=e[6],l=e[7],c=e[8];const m=c;let u;e[11]!==o||e[12]!==l?(u=i.jsx($s,{home:o,agents:l}),e[11]=o,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==m||e[15]!==o||e[16]!==f?(p=i.jsx(Ms,{home:o,agents:m,hasSearch:f}),e[14]=m,e[15]=o,e[16]=f,e[17]=p):p=e[17];let g;return e[18]!==u||e[19]!==p?(g=i.jsxs(i.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=g):g=e[20],g}function _s(t,e){return(t.title??"").localeCompare(e.title??"")}function Cs(t){return t.id&&!pt(t.id)}function ks(t){return!!t}function Es(t){return[t.id,t]}function Is(t){return t.id}function Be(t){const e=T.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let a;e[2]!==r?(a=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==a?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,a]}),e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function $s(t){const e=T.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:Pt},e[1]=a):a=e[1];const o=Me(ne(Re,n),ne(Oe,a));let d;e[2]!==s?(d=p=>{const{active:g,over:h}=p;if(!h||g.id===h.id)return;const x=s.homeIds,b=x.indexOf(g.id),v=x.indexOf(h.id);b===-1||v===-1||s.reorder(Dt([...x],b,v)).catch(As)},e[2]=s,e[3]=d):d=e[3];const l=d,c=`${s.homeIds.length}/${te}`;let m;e[4]!==c?(m=i.jsx(Be,{title:"On home",hint:c}),e[4]=c,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==l||e[8]!==s||e[9]!==o?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(ze,{sensors:o,collisionDetection:At,onDragEnd:l,children:i.jsx(Mt,{items:r.map(Ts),strategy:Ot,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(p=>i.jsx(Rs,{agent:p,home:s},p.id))})})}),e[6]=r,e[7]=l,e[8]=s,e[9]=o,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ts(t){return t.id}function As(){return W.error("Couldn't reorder home — please try again.")}function Ms(t){const e=T.c(6),{home:s,agents:r,hasSearch:n}=t,[a,o]=A.useState(20);let d;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a){const l=r.slice(0,a);let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Be,{title:"Add to home"}),e[5]=c):c=e[5],d=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:l.map(m=>i.jsx(Ds,{agent:m,home:s},m.id))}),r.length>a&&i.jsxs("button",{type:"button",onClick:()=>o(Os),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 (",r.length-a,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=d}else d=e[4];return d}function Os(t){return t+20}function Fe(t){const e=pe(t.metadata?.ui).filter(a=>!!a.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Rs(t){const e=T.c(57),{agent:s,home:r}=t,[n,a]=A.useState(!1);let o;e[0]!==s.id?(o={id:s.id},e[0]=s.id,e[1]=o):o=e[1];const{attributes:d,listeners:l,setNodeRef:c,transform:m,transition:u,isDragging:f}=Rt(o),p=Fe(s)||"Quick access";let g;e[2]!==m?(g=zt.Transform.toString(m),e[2]=m,e[3]=g):g=e[3];const h=f?.5:void 0,x=f?100:void 0;let b;e[4]!==g||e[5]!==h||e[6]!==x||e[7]!==u?(b={transform:g,transition:u,opacity:h,zIndex:x},e[4]=g,e[5]=h,e[6]=x,e[7]=u,e[8]=b):b=e[8];const v=b,w=f&&"shadow-lg";let y;e[9]!==w?(y=q("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=y):y=e[10];const j=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Le,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==j?(S=i.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":j,children:N}),e[12]=d,e[13]=l,e[14]=j,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a(Ps),e[16]=k):k=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=i.jsx(Y,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const E=s.title??s.id;let _;e[20]!==E?(_=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:E}),e[20]=E,e[21]=_):_=e[21];let $;e[22]!==p?($=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=$):$=e[23];let O;e[24]!==_||e[25]!==$?(O=i.jsxs("div",{className:"min-w-0 flex-1",children:[_,$]}),e[24]=_,e[25]=$,e[26]=O):O=e[26];const B=n&&"rotate-180";let z;e[27]!==B?(z=q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=z):z=e[28];let P;e[29]!==z?(P=i.jsx(He,{size:16,className:z}),e[29]=z,e[30]=P):P=e[30];let Q;e[31]!==n||e[32]!==I||e[33]!==O||e[34]!==P?(Q=i.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[I,O,P]}),e[31]=n,e[32]=I,e[33]=O,e[34]=P,e[35]=Q):Q=e[35];let M;e[36]!==s.id||e[37]!==r?(M=()=>r.removeAgent(s.id).catch(zs),e[36]=s.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx(Ae,{size:14}),e[39]=D):D=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,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]=M,e[41]=F,e[42]=R):R=e[42];let L;e[43]!==S||e[44]!==Q||e[45]!==R?(L=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,R]}),e[43]=S,e[44]=Q,e[45]=R,e[46]=L):L=e[46];let U;e[47]!==s||e[48]!==n||e[49]!==r?(U=n&&i.jsx(Qe,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=U):U=e[50];let G;return e[51]!==c||e[52]!==v||e[53]!==L||e[54]!==U||e[55]!==y?(G=i.jsxs("div",{ref:c,style:v,className:y,children:[L,U]}),e[51]=c,e[52]=v,e[53]=L,e[54]=U,e[55]=y,e[56]=G):G=e[56],G}function zs(){return W.error("Couldn't remove from home — please try again.")}function Ps(t){return!t}function Ds({agent:t,home:e}){const[s,r]=A.useState(!1),[n,a]=A.useState(!1),o=Fe(t),d=async()=>{if(!e.atLimit){a(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{a(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(He,{size:16,className:q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:d,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${te}) — 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:n?i.jsx($e,{size:12,className:"animate-spin"}):i.jsx(ge,{size:14})})]}),s&&i.jsx(Qe,{agent:t,home:e})]})}function Qe(t){const e=T.c(26),{agent:s,home:r}=t;let n,a,o,d,l,c,m;if(e[0]!==s||e[1]!==r){const x=pe(s.metadata?.ui);let b;e[9]!==s.connections?(b=(s.connections??[]).map(Ls).sort(),e[9]=s.connections,e[10]=b):b=e[10];const v=b;a=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Bs,o=s,d=r,l=v,c=new Set(x.map(Hs)),e[0]=s,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=d,e[6]=l,e[7]=c,e[8]=m}else n=e[2],a=e[3],o=e[4],d=e[5],l=e[6],c=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==d||e[14]!==l||e[15]!==c?(u=i.jsx(n,{agent:o,home:d,connectionIds:l,pinnedResourceUris:c}),e[11]=n,e[12]=o,e[13]=d,e[14]=l,e[15]=c,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Us,{}),e[17]=f):f=e[17];const p=a??null;let g;e[18]!==s||e[19]!==r||e[20]!==p?(g=i.jsx(A.Suspense,{fallback:f,children:i.jsx(Qs,{agent:s,home:r,curated:p})}),e[18]=s,e[19]=r,e[20]=p,e[21]=g):g=e[21];let h;return e[22]!==m||e[23]!==u||e[24]!==g?(h=i.jsxs("div",{className:m,children:[u,g]}),e[22]=m,e[23]=u,e[24]=g,e[25]=h):h=e[25],h}function Hs(t){return t.resourceUri}function Ls(t){return t.connection_id}function Us(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Bs({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const{org:n}=Z(),a=ee({connectionId:Te,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:d}=oe({queryKey:re.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async c=>{try{const m=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:c}}),{item:u}=es(m),f=(u?.tools??[]).flatMap(p=>{const g=Jt(p._meta);return g?[{name:p.name,description:p.description,resourceUri:g}]:[]});return{id:c,title:u?.title??c,icon:u?.icon??null,uiTools:f}}catch{return{id:c,title:c,icon:null,uiTools:[]}}}))).filter(c=>c.uiTools.length>0)});return s.length===0?null:d?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!o||o.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:o.map(l=>l.uiTools.map(c=>i.jsx(Fs,{agent:t,home:e,connection:l,tool:c,isPinned:r.has(c.resourceUri)},`${l.id}:${c.name}`)))})}function Fs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[a,o]=A.useState(!1),d=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const l=pe(t.metadata?.ui),c=n?l.filter(u=>u.resourceUri!==r.resourceUri):[...l,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:c}};await e.saveAgentMetadata(t,m)}catch(l){console.error("[home-tiles] failed to toggle tile",l),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(Yt,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Ue(r.name)}),i.jsx(We,{isPinned:n,submitting:a,onClick:d,label:n?"Remove from home":"Add to home"})]})}function We(t){const e=T.c(11),{isPinned:s,submitting:r,onClick:n,label:a}=t,o=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==o?(d=q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",o),e[0]=o,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==r?(l=r?i.jsx($e,{size:12,className:"animate-spin"}):s?i.jsx(Nt,{size:14}):i.jsx(ge,{size:14}),e[2]=s,e[3]=r,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==n||e[7]!==r||e[8]!==d||e[9]!==l?(c=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":a,title:a,className:d,children:l}),e[5]=a,e[6]=n,e[7]=r,e[8]=d,e[9]=l,e[10]=c):c=e[10],c}function Qs(t){const e=T.c(32),{agent:s,home:r,curated:n}=t,{org:a}=Z();let o;e[0]!==s.id||e[1]!==a.id||e[2]!==a.slug?(o={connectionId:s.id,orgId:a.id,orgSlug:a.slug},e[0]=s.id,e[1]=a.id,e[2]=a.slug,e[3]=o):o=e[3];const d=ee(o);let l;e[4]!==s.id||e[5]!==a.id?(l=re.agentPrompts(a.id,s.id),e[4]=s.id,e[5]=a.id,e[6]=l):l=e[6];let c;e[7]!==d?(c=async()=>{const{prompts:j}=await d.listPrompts();return j.map(Gs)},e[7]=d,e[8]=c):c=e[8];let m;e[9]!==l||e[10]!==c?(m={queryKey:l,queryFn:c,staleTime:3e4,retry:!1},e[9]=l,e[10]=c,e[11]=m):m=e[11];const{data:u,isLoading:f,error:p}=oe(m),g=be(a.slug);let h,x;if(e[12]!==s.id||e[13]!==u||e[14]!==g.prompts){let j;e[17]!==s.id?(j=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=j):j=e[18],h=g.prompts.filter(j).map(Ks);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],x=[...N];for(const S of h)x.some(k=>k.name===S.name)||x.push(S);e[12]=s.id,e[13]=u,e[14]=g.prompts,e[15]=h,e[16]=x}else h=e[15],x=e[16];if(f&&h.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(p&&h.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(x.length===0)return null;let b;e[22]!==n||e[23]!==x?(b=n??x.map(qs),e[22]=n,e[23]=x,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 w=v;let y;return e[27]!==s||e[28]!==r||e[29]!==x||e[30]!==w?(y=i.jsx("div",{className:"flex flex-col gap-0.5",children:x.map(j=>i.jsx(Vs,{agent:s,home:r,prompt:j,allPromptNames:x.map(Ws),isPinned:w.has(j.name)},j.name))}),e[27]=s,e[28]=r,e[29]=x,e[30]=w,e[31]=y):y=e[31],y}function Ws(t){return t.name}function qs(t){return t.name}function Ks(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 Vs({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[a,o]=A.useState(!1),d=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const l=t.metadata?.ui?.homePrompts;let c;Array.isArray(l)?c=n?l.filter(u=>u!==s.name):[...l,s.name]:c=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:c}};await e.saveAgentMetadata(t,m)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Ue(s.name)}),i.jsx(We,{isPinned:n,submitting:a,onClick:d,label:n?"Remove from home":"Add to home"})]})}function Zs(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Js)}),t[0]=e):e=t[0],e}function Js(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const X=1,qe=`home-board.layout.v${X}`;function Ke(t){return`home-board.layout.v${X}.${t}`}const Ge={version:X,tiles:{},hidden:[]};function me(t){return!t||t.version!==X?Ge:{version:X,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Xs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(Ke(t));return e?me(JSON.parse(e)):void 0}catch{return}}function Ne(t,e){try{localStorage.setItem(Ke(t),JSON.stringify(e))}catch{}}async function Se(t,e){if(!(await fetch(`/api/${t}/kv/${qe}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ei(t){const e=T.c(24),s=he();let r;e[0]!==t?(r=re.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let a;e[2]!==t?(a=Ys(t),e[2]=t,e[3]=a):a=e[3];const o=a;let d;e[4]!==o||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${qe}`);if(b.status===404)return o&&Xs(o)?(await Se(t,o),o):Ge;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),w=me(v.value);return Ne(t,w),w},e[4]=o,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==o||e[8]!==n||e[9]!==d?(l={queryKey:n,queryFn:d,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=d,e[10]=l):l=e[10];const{data:c,isLoading:m}=oe(l);let u;e[11]!==t?(u={mutationFn:b=>Se(t,b)},e[11]=t,e[12]=u):u=e[12];const f=mt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(p=b=>{Ne(t,b),s.setQueryData(n,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=p):p=e[17];const g=p;let h;e[18]!==c?(h=me(c),e[18]=c,e[19]=h):h=e[19];let x;return e[20]!==m||e[21]!==g||e[22]!==h?(x={layout:h,isLoading:m,save:g},e[20]=m,e[21]=g,e[22]=h,e[23]=x):x=e[23],x}const Ve=A.createContext(null);function ti(t){const e=T.c(24),{children:s}=t,{org:r}=Z(),n=ei(r.slug),[a,o]=A.useState(!1),[d,l]=A.useState(null);let c;e[0]!==n.layout?(c=()=>{l(n.layout),o(!0)},e[0]=n.layout,e[1]=c):c=e[1];const m=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),o(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==n?(p=()=>{d&&n.save(d),l(null),o(!1)},e[3]=d,e[4]=n,e[5]=p):p=e[5];const g=p,h=a&&d!==null,x=h?d:n.layout;let b;e[6]!==d||e[7]!==h||e[8]!==n.layout?(b=h?JSON.stringify(d)!==JSON.stringify(n.layout):!1,e[6]=d,e[7]=h,e[8]=n.layout,e[9]=b):b=e[9];const v=b;let w;e[10]!==a||e[11]!==n?(w=S=>{a?l(S):n.save(S)},e[10]=a,e[11]=n,e[12]=w):w=e[12];const y=w;let j;e[13]!==y||e[14]!==m||e[15]!==v||e[16]!==a||e[17]!==x||e[18]!==g||e[19]!==n.isLoading?(j={isEditMode:a,enter:m,cancel:f,save:g,hasChanges:v,layout:x,isLayoutLoading:n.isLoading,commitLayout:y},e[13]=y,e[14]=m,e[15]=v,e[16]=a,e[17]=x,e[18]=g,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==s||e[22]!==j?(N=i.jsx(Ve.Provider,{value:j,children:s}),e[21]=s,e[22]=j,e[23]=N):N=e[23],N}function Ze(){const t=A.useContext(Ve);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function si({agentId:t}){const{org:e,locator:s}=Z(),r=ee({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ls(),{setTaskId:a}=Bt(),[o,d]=A.useState(null),[l,c]=A.useState(!1),m=A.useRef(!1),u=async(x,b)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,c(!0);try{const v=await os(r,x.name,b),w={type:"doc",content:[{type:"paragraph",content:[ss({id:x.name,name:is(x.name,ns(x._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},y=crypto.randomUUID();as(sessionStorage,s,y,{tiptapDoc:w}),await n({id:y,virtual_mcp_id:t}),a(y,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,c(!1)}}},f=async x=>{if(!m.current){if(x.arguments&&x.arguments.length>0){d(x);return}await u(x)}},p=async x=>{if(!o)return;const b=o;d(null),await u(b,x)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,c(!0);try{const x=crypto.randomUUID();await n({id:x,virtual_mcp_id:t}),a(x,t)}catch(x){console.error("[start-thread-from-prompt] startBlank failed",x),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,c(!1)}}},dialog:i.jsx(ts,{prompt:o,setPrompt:x=>d(x),onSubmit:p}),dialogPrompt:o,starting:l}}const K=4,V=100,_e=12,ii=5,ni={w:2,h:2};class ue extends A.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?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(ut,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.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 ri(t){const e=T.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:a,onResize:o,onRemove:d}=t,l=xe(),c=A.useRef(null),[m,u]=A.useState(null),[f,p]=A.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:4}},e[0]=g):g=e[0];const h=Me(ne(Re,g),ne(Oe)),x=s.reduce(oi,0),b=r?Math.max(x+2,4):Math.max(x,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const M=c.current?.getBoundingClientRect();return M?{cellWidth:M.width/K,cellHeight:V}:null},e[1]=v):v=e[1];const w=v;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=M=>{u(String(M.active.id)),p(w())},e[2]=y):y=e[2];const j=y;let N;e[3]!==f||e[4]!==a||e[5]!==s?(N=M=>{const F=String(M.active.id),D=f??w();if(u(null),p(null),!D||D.cellWidth<=0)return;const R=s.find(G=>G.id===F);if(!R)return;const L=Math.round(M.delta.x/D.cellWidth),U=Math.round(M.delta.y/D.cellHeight);L===0&&U===0||a(F,{x:R.x+L,y:R.y+U})},e[3]=f,e[4]=a,e[5]=s,e[6]=N):N=e[6];const S=N;if(l){let M;if(e[7]!==n||e[8]!==s){let D;e[10]!==n?(D=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:V},children:i.jsx(ue,{children:n(R)})},R.id),e[10]=n,e[11]=D):D=e[11],M=s.map(D),e[7]=n,e[8]=s,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let k,C,I,E,_,$,O,B,z;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==o||e[20]!==n||e[21]!==h||e[22]!==s||e[23]!==b){const M=m?s.find(J=>J.id===m):null;C=ze,B=h,z=j,I=S;const F=b*V,D=r?V*4:V;let R;e[33]!==F||e[34]!==D?(R={height:F,minHeight:D},e[33]=F,e[34]=D,e[35]=R):R=e[35];let L;e[36]!==r||e[37]!==s||e[38]!==b?(L=r&&i.jsx(li,{rows:b,tiles:s}),e[36]=r,e[37]=s,e[38]=b,e[39]=L):L=e[39];let U;if(e[40]!==m||e[41]!==r||e[42]!==d||e[43]!==o||e[44]!==n||e[45]!==s){let J;e[47]!==m||e[48]!==r||e[49]!==d||e[50]!==o||e[51]!==n?(J=se=>i.jsx(ci,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:d,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=d,e[50]=o,e[51]=n,e[52]=J):J=e[52],U=s.map(J),e[40]=m,e[41]=r,e[42]=d,e[43]=o,e[44]=n,e[45]=s,e[46]=U}else U=e[46];e[53]!==R||e[54]!==L||e[55]!==U?(E=i.jsxs("div",{ref:c,className:"relative w-full",style:R,children:[L,U]}),e[53]=R,e[54]=L,e[55]=U,e[56]=E):E=e[56],k=Ht,_=null;const G=M&&f?M.w*f.cellWidth-_e:void 0,le=M&&f?M.h*f.cellHeight-_e:void 0;e[57]!==G||e[58]!==le?($={width:G,height:le},e[57]=G,e[58]=le,e[59]=$):$=e[59],O=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(ue,{children:n(M)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=o,e[20]=n,e[21]=h,e[22]=s,e[23]=b,e[24]=k,e[25]=C,e[26]=I,e[27]=E,e[28]=_,e[29]=$,e[30]=O,e[31]=B,e[32]=z}else k=e[24],C=e[25],I=e[26],E=e[27],_=e[28],$=e[29],O=e[30],B=e[31],z=e[32];let P;e[60]!==k||e[61]!==_||e[62]!==$||e[63]!==O?(P=i.jsx(k,{dropAnimation:_,style:$,children:O}),e[60]=k,e[61]=_,e[62]=$,e[63]=O,e[64]=P):P=e[64];let Q;return e[65]!==C||e[66]!==I||e[67]!==E||e[68]!==P||e[69]!==B||e[70]!==z?(Q=i.jsxs(C,{sensors:B,onDragStart:z,onDragEnd:I,children:[E,P]}),e[65]=C,e[66]=I,e[67]=E,e[68]=P,e[69]=B,e[70]=z,e[71]=Q):Q=e[71],Q}function oi(t,e){return Math.max(t,e.y+e.h)}function li(t){const e=T.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(l,c)=>r.some(m=>l>=m.x&&l<m.x+m.w&&c>=m.y&&c<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const a=n;let o;if(e[2]!==a||e[3]!==s){o=[];for(let l=0;l<s;l++)for(let c=0;c<K;c++)a(c,l)||o.push({x:c,y:l});e[2]=a,e[3]=s,e[4]=o}else o=e[4];let d;return e[5]!==o?(d=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(ai)}),e[5]=o,e[6]=d):d=e[6],d}function ai(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/K*100}%`,top:t.y*V,width:`${1/K*100}%`,height:V},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ci(t){const e=T.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:a,onRemove:o,children:d}=t,l=!r;let c;e[0]!==l||e[1]!==s.id?(c={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=c):c=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:p}=Lt(c),g=`${s.x/K*100}%`,h=`${s.w/K*100}%`,x=s.y*V,b=s.h*V,v=p||n,w=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",y=v&&"opacity-30";let j;e[3]!==w||e[4]!==y?(j=q("absolute p-1 will-change-[left,top,width,height,opacity]",w,y),e[3]=w,e[4]=y,e[5]=j):j=e[5];let N;e[6]!==b||e[7]!==g||e[8]!==x||e[9]!==h?(N={left:g,top:x,width:h,height:b},e[6]=b,e[7]=g,e[8]=x,e[9]=h,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let k;e[11]!==S?(k=q("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=k):k=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==o||e[17]!==a||e[18]!==s?(C=r&&i.jsxs(i.Fragment,{children:[i.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:i.jsx(Le,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(di,{tile:s,onResize:a,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=o,e[17]=a,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(ue,{children:d})}),e[20]=d,e[21]=I):I=e[21];let E;e[22]!==I||e[23]!==k||e[24]!==C?(E=i.jsxs("div",{className:k,children:[C,I]}),e[22]=I,e[23]=k,e[24]=C,e[25]=E):E=e[25];let _;return e[26]!==m||e[27]!==E||e[28]!==j||e[29]!==N?(_=i.jsx("div",{ref:m,className:j,style:N,children:E}),e[26]=m,e[27]=E,e[28]=j,e[29]=N,e[30]=_):_=e[30],_}function di(t){const e=T.c(20),{tile:s,onResize:r,onRemove:n}=t,[a,o]=A.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(cs,{asChild:!0,children:i.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:i.jsx(St,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==r||e[2]!==s.id?(l=x=>{r(s.id,x),o(!1)},e[1]=r,e[2]=s.id,e[3]=l):l=e[3];let c;e[4]!==l||e[5]!==s?(c=i.jsx(mi,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ds,{}),e[7]=m):m=e[7];let u;e[8]!==n||e[9]!==s.id?(u=()=>n(s.id),e[8]=n,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=i.jsxs(ms,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let g;e[14]!==c||e[15]!==p?(g=i.jsxs(us,{align:"end",className:"w-auto",children:[c,m,p]}),e[14]=c,e[15]=p,e[16]=g):g=e[16];let h;return e[17]!==a||e[18]!==g?(h=i.jsxs(fs,{open:a,onOpenChange:o,children:[d,g]}),e[17]=a,e[18]=g,e[19]=h):h=e[19],h}function mi(t){const e=T.c(19),{tile:s,onPick:r}=t,n=s.minW??1,a=s.minH??1,[o,d]=A.useState(null);let l;e[0]!==o||e[1]!==s.h||e[2]!==s.w?(l=o??{w:s.w,h:s.h},e[0]=o,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const c=l;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=m):m=e[4];let u;e[5]!==c.h||e[6]!==c.w?(u=i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[m,i.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[c.w," × ",c.h]})]}),e[5]=c.h,e[6]=c.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${K}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let g;e[10]!==c.h||e[11]!==c.w||e[12]!==a||e[13]!==n||e[14]!==r?(g=i.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:ii},(x,b)=>Array.from({length:K},(v,w)=>{const y=w+1,j=b+1,N=y<n||j<a,S=y<=c.w&&j<=c.h;return i.jsx("button",{type:"button",disabled:N,"aria-label":`${y} by ${j}`,onPointerEnter:()=>d({w:y,h:j}),onClick:()=>r({w:y,h:j}),className:q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${y}x${j}`)}))}),e[10]=c.h,e[11]=c.w,e[12]=a,e[13]=n,e[14]=r,e[15]=g):g=e[15];let h;return e[16]!==u||e[17]!==g?(h=i.jsxs("div",{className:"px-2 py-1.5",children:[u,g]}),e[16]=u,e[17]=g,e[18]=h):h=e[18],h}function ui(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function fe(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=K-e;n++){let a=!0;for(let o=0;o<s&&a;o++)for(let d=0;d<e&&a;d++)ui(t,n+d,r+o)&&(a=!1);if(a)return{x:n,y:r}}return{x:0,y:0}}function ae(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(K,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function ce(t,e,s){const r=Math.max(0,Math.min(K-s,t)),n=Math.max(0,e);return{x:r,y:n}}function fi(t,e,s){const r=t.find(l=>l.id===e);if(!r)return t;const n=t.filter(l=>l.id!==e),a=n.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(a&&a.w===r.w&&a.h===r.h)return t.map(l=>l.id===e?{...l,x:a.x,y:a.y}:l.id===a.id?{...l,x:r.x,y:r.y}:l);const d=[{...r,x:s.x,y:s.y}];for(const l of n){const c=fe(d,l.w,l.h);d.push({...l,x:c.x,y:c.y})}return d}function hi(t){const e=T.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ze();let a;e[0]!==s.hidden?(a=new Set(s.hidden),e[0]=s.hidden,e[1]=a):a=e[1];const o=a;let d,l;if(e[2]!==t||e[3]!==o||e[4]!==s.tiles){l=[];let v;e[7]!==o?(v=y=>y.pinned||!o.has(y.id),e[7]=o,e[8]=v):v=e[8];const w=t.filter(v);d=new Map;for(const y of t)y.minSize&&d.set(y.id,y.minSize);for(const y of w){const j=s.tiles[y.id];if(!j)continue;const N=d.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),{x:C,y:I}=ce(j.x,j.y,S);l.push({id:y.id,x:C,y:I,w:S,h:k,minW:N?.w,minH:N?.h})}for(const y of w){if(l.some(I=>I.id===y.id))continue;const j=y.defaultSize??ni,N=d.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),C=fe(l,S,k);l.push({id:y.id,x:C.x,y:C.y,w:S,h:k,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=o,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let c;e[9]!==t?(c=new Set(t.map(pi)),e[9]=t,e[10]=c):c=e[10];const m=c;let u;e[11]!==m||e[12]!==n?(u=(v,w)=>{const y={};for(const j of v)y[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:X,tiles:y,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,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 g;e[16]!==f||e[17]!==s||e[18]!==l?(g=(v,w)=>{const y=l.find(S=>S.id===v);if(!y)return;const j=ce(w.x,w.y,y.w);if(j.x===y.x&&j.y===y.y)return;const N=fi(l,v,j);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=g):g=e[19];let h;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(h=(v,w)=>{const y=l.find(E=>E.id===v);if(!y)return;const j=d.get(v),{w:N,h:S}=ae(w.w,w.h,j);if(N===y.w&&S===y.h)return;const k={...y,w:N,h:S,x:ce(y.x,y.y,N).x},C=l.filter(E=>E.id!==v),I=[k];for(const E of C){const _=fe(I,E.w,E.h);I.push({...E,x:_.x,y:_.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=h):h=e[24];let x;e[25]!==f||e[26]!==s||e[27]!==l?(x=v=>{const w=l.filter(y=>y.id!==v);f(w,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=x):x=e[28];let b;return e[29]!==r||e[30]!==p||e[31]!==g||e[32]!==h||e[33]!==x?(b={snapshot:p,isLoading:r,moveTile:g,resizeTile:h,hideTile:x},e[29]=r,e[30]=p,e[31]=g,e[32]=h,e[33]=x,e[34]=b):b=e[34],b}function pi(t){return t.id}const xi={w:2,h:4},gi={w:1,h:2},bi={w:1,h:1};function yi(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vi(t){return`tile:${t.agentId}:${t.resourceUri}`}function ji(t){return t.promptName?t.agentName:t.description}function wi(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ye(t){const e=T.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:a,starting:o}=si(s);let d;e[2]!==r||e[3]!==n?(d=m=>{if(!m.promptName){n();return}r(wi(m))},e[2]=r,e[3]=n,e[4]=d):d=e[4];const l=d;let c;return e[5]!==a||e[6]!==l||e[7]!==n||e[8]!==o?(c={open:l,startBlank:n,dialog:a,starting:o},e[5]=a,e[6]=l,e[7]=n,e[8]=o,e[9]=c):c=e[9],c}function Ni(t){const e=T.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:a,starting:o}=ye(s.agentId);let d;e[0]!==s||e[1]!==n?(d=()=>n(s),e[0]=s,e[1]=n,e[2]=d):d=e[2];const l=o||r,c=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let f;e[3]!==c||e[4]!==m||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",c,m,u),e[3]=c,e[4]=m,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let g;e[10]!==s.title?(g=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=g):g=e[11];let h;e[12]!==s?(h=ji(s),e[12]=s,e[13]=h):h=e[13];let x;e[14]!==h?(x=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:h}),e[14]=h,e[15]=x):x=e[15];let b;e[16]!==x||e[17]!==g?(b=i.jsxs("div",{className:"min-w-0 flex-1",children:[g,x]}),e[16]=x,e[17]=g,e[18]=b):b=e[18];let v;e[19]!==r?(v=!r&&i.jsx(rs,{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]=r,e[20]=v):v=e[20];let w;e[21]!==o||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(w=i.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":o,className:f,children:[p,b,v]}),e[21]=o,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=w):w=e[28];let y;return e[29]!==a||e[30]!==w?(y=i.jsxs(i.Fragment,{children:[w,a]}),e[29]=a,e[30]=w,e[31]=y):y=e[31],y}function Si(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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},_i)}),t[0]=e):e=t[0],e}function _i(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ci(t){const e=T.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:a}=t,{org:o}=Z(),{open:d,startBlank:l,dialog:c,starting:m}=ye(s.agentId);let u,f,p,g,h;if(e[0]!==n||e[1]!==d||e[2]!==o.id||e[3]!==o.slug||e[4]!==r||e[5]!==l||e[6]!==m||e[7]!==s||e[8]!==a){const v=r.filter(ki);g="flex h-full w-full flex-col gap-3 p-3";let w;e[14]!==l?(w=()=>{l()},e[14]=l,e[15]=w):w=e[15];const y=m||n,j=n&&"pl-10 pr-10";let N;e[16]!==j?(N=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",j),e[16]=j,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let k;e[21]!==s.agentName?(k=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=k):k=e[22];const C=n?"Drag to rearrange":"Open chat";let I;e[23]!==C?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:C}),e[23]=C,e[24]=I):I=e[24];let E;e[25]!==k||e[26]!==I?(E=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,I]}),e[25]=k,e[26]=I,e[27]=E):E=e[27],e[28]!==m||e[29]!==S||e[30]!==E||e[31]!==w||e[32]!==y||e[33]!==N?(h=i.jsxs("button",{type:"button",onClick:w,disabled:y,"aria-busy":m,className:N,children:[S,E]}),e[28]=m,e[29]=S,e[30]=E,e[31]=w,e[32]=y,e[33]=N,e[34]=h):h=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Ii,{}),e[35]=_):_=e[35],e[36]!==o.id||e[37]!==o.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(A.Suspense,{fallback:_,children:i.jsx(Ei,{tile:s,orgId:o.id,orgSlug:o.slug})})}),e[36]=o.id,e[37]=o.slug,e[38]=s,e[39]=f):f=e[39],p=v.length>0&&!n&&a>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map($=>i.jsx("button",{type:"button",onClick:()=>d($),disabled:m,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:i.jsx("span",{className:"line-clamp-2",children:$.title})},$.promptName))}),e[0]=n,e[1]=d,e[2]=o.id,e[3]=o.slug,e[4]=r,e[5]=l,e[6]=m,e[7]=s,e[8]=a,e[9]=u,e[10]=f,e[11]=p,e[12]=g,e[13]=h}else u=e[9],f=e[10],p=e[11],g=e[12],h=e[13];let x;e[40]!==u||e[41]!==f||e[42]!==p?(x=i.jsxs("div",{className:u,children:[f,p]}),e[40]=u,e[41]=f,e[42]=p,e[43]=x):x=e[43];let b;return e[44]!==c||e[45]!==g||e[46]!==h||e[47]!==x?(b=i.jsxs("div",{className:g,children:[h,x,c]}),e[44]=c,e[45]=g,e[46]=h,e[47]=x,e[48]=b):b=e[48],b}function ki(t){return!!t.promptName}function Ei(t){const e=T.c(12),{tile:s,orgId:r,orgSlug:n}=t;let a;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(a={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=a):a=e[3];const o=ee(a),d=s.minHeight??200,l=s.maxHeight??4e3;let c;return e[4]!==o||e[5]!==r||e[6]!==n||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri?(c=i.jsx(Xt,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:o,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=o,e[5]=r,e[6]=n,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=c):c=e[11],c}function Ii(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function $i(t){const e=T.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let a;e[3]!==r?(a=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=o):o=e[5];let d;e[6]!==a?(d=i.jsxs("div",{className:"min-w-0 flex-1",children:[a,o]}),e[6]=a,e[7]=d):d=e[7];let l;e[8]!==n||e[9]!==d?(l=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,d]}),e[8]=n,e[9]=d,e[10]=l):l=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=c):c=e[11];let m;return e[12]!==l?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,c]}),e[12]=l,e[13]=m):m=e[13],m}function Ti(t){const e=T.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:a,startBlank:o,dialog:d,starting:l}=ye(s.agentId);let c,m,u;if(e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==o||e[4]!==l||e[5]!==s.agentIcon||e[6]!==s.agentName){const p=r.filter(Ai);c="flex h-full w-full flex-col gap-3 p-4";let g;e[10]!==o?(g=()=>{o()},e[10]=o,e[11]=g):g=e[11];const h=l||n,x=n&&"pl-10 pr-10";let b;e[12]!==x?(b=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",x),e[12]=x,e[13]=b):b=e[13];let v;e[14]!==s.agentIcon||e[15]!==s.agentName?(v=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=v):v=e[16];let w;e[17]!==s.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=y):y=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,y]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==g||e[24]!==h||e[25]!==b||e[26]!==v?(m=i.jsxs("button",{type:"button",onClick:g,disabled:h,className:b,children:[v,j]}),e[22]=j,e[23]=g,e[24]=h,e[25]=b,e[26]=v,e[27]=m):m=e[27],u=p.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:p.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&a(N),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:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=a,e[2]=r,e[3]=o,e[4]=l,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=c,e[8]=m,e[9]=u}else c=e[7],m=e[8],u=e[9];let f;return e[28]!==d||e[29]!==c||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:c,children:[m,u,d]}),e[28]=d,e[29]=c,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Ai(t){return!!t.promptName}function Je(t){const e=T.c(36),{isEditMode:s}=t,{org:r}=Z(),{isLoading:n,prompts:a,tiles:o}=be(r.slug),d=Pe()?.ids??[];let l;e[0]!==d?(l=new Set(d),e[0]=d,e[1]=l):l=e[1];const c=l,m=De();let u;e[2]!==o?(u=new Set(o.map(Pi)),e[2]=o,e[3]=u):u=e[3];const f=u;let p;if(e[4]!==a){p=new Map;for(const _ of a){const $=p.get(_.agentId);$?$.push(_):p.set(_.agentId,[_])}e[4]=a,e[5]=p}else p=e[5];let g;if(e[6]!==a||e[7]!==f||e[8]!==o){let _;e[10]!==f?(_=O=>!f.has(O.agentId),e[10]=f,e[11]=_):_=e[11];const $=a.filter(_);g=[...o.map(zi),...$.map(Ri)],e[6]=a,e[7]=f,e[8]=o,e[9]=g}else g=e[9];const h=g;let x;e[12]!==h?(x=new Map(h.map(Oi)),e[12]=h,e[13]=x):x=e[13];const b=x;let v;e[14]!==h||e[15]!==c?(v=h.map(_=>({id:_.id,defaultSize:_.kind==="tile"?xi:bi,minSize:_.kind==="tile"?gi:void 0,pinned:c.has(_.data.agentId)})),e[14]=h,e[15]=c,e[16]=v):v=e[16];const w=hi(v);let y;e[17]!==m?(y=_=>{m.apply($=>$.filter(O=>O!==_)).catch(Mi)},e[17]=m,e[18]=y):y=e[18];const j=y;let N;e[19]!==b||e[20]!==w||e[21]!==c||e[22]!==j?(N=_=>{const $=b.get(_);$&&c.has($.data.agentId)?j($.data.agentId):w.hideTile(_)},e[19]=b,e[20]=w,e[21]=c,e[22]=j,e[23]=N):N=e[23];const S=N;let k;e[24]!==b||e[25]!==s||e[26]!==p?(k=_=>{const $=b.get(_.id);if(!$)return null;if($.kind==="tile"){const O=p.get($.data.agentId)??[];return i.jsx(ft,{fallback:i.jsx(Ti,{tile:$.data,prompts:O,isEditMode:s}),children:i.jsx(A.Suspense,{fallback:i.jsx($i,{icon:$.data.agentIcon,name:$.data.agentName}),children:i.jsx(Ci,{tile:$.data,prompts:O,isEditMode:s,tileWidth:_.w})})})}return i.jsx(Ni,{entry:$.data,isEditMode:s})},e[24]=b,e[25]=s,e[26]=p,e[27]=k):k=e[27];const C=k;if(n||w.isLoading){let _;return e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Si,{}),e[28]=_):_=e[28],_}if(w.snapshot.visible.length===0&&!s)return null;let E;return e[29]!==s||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==S||e[34]!==C?(E=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ri,{tiles:w.snapshot.visible,isEditMode:s,renderTile:C,onMove:w.moveTile,onResize:w.resizeTile,onRemove:S})}),e[29]=s,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=S,e[34]=C,e[35]=E):E=e[35],E}function Mi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:yi(t),data:t}}function zi(t){return{kind:"tile",id:vi(t),data:t}}function Pi(t){return t.agentId}function Di(t){const e=T.c(2),{prompts:s,tiles:r}=be(t),n=r.length>0||s.length>0;let a;return e[0]!==n?(a={hasVisibleTiles:n},e[0]=n,e[1]=a):a=e[1],a}const Ce=420,ke=305;function Xe(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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:Ce}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.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:Ce}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.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:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.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:ke}})]}),t[3]=n):n=t[3],n}function Ee(){const t=T.c(33),{data:e}=ht.useSession(),{org:s}=Z(),r=xe(),n=It(),{selectedVirtualMcp:a}=$t();let o;t[0]!==s.id?(o=xt(s.id),t[0]=s.id,t[1]=o):o=t[1];const l=a??o;let c;t[2]!==s.slug?(c=Ft(s.slug),t[2]=s.slug,t[3]=c):c=t[3],oe(c);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:Te,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=ee(m);let f;t[7]!==s.id||t[8]!==u?(f=ps(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==u?(p=Ut(u,s.id),t[10]=s.id,t[11]=u,t[12]=p):p=t[12];let g;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(g=yt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=g):g=t[16];let h;t[17]!==f||t[18]!==p||t[19]!==g?(h={queries:[f,p,g]},t[17]=f,t[18]=p,t[19]=g,t[20]=h):h=t[20],js(h);const x=xs(),b=vt(l.id),{hasDecoKey:v,isZeroBalance:w,isInitialFreeCredit:y,balanceDollars:j,hasOnlyDecoProvider:N}=Ct(),{hasVisibleTiles:S}=Di(s.slug),k=kt(b?.metadata);if(x.length===0&&!(k&&Et(n))){let P;return t[21]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Tt,{})})}),t[21]=P):P=t[21],P}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 E=I,_=v&&y&&j!=null,$=v&&w&&N;let O;t[24]!==j||t[25]!==_||t[26]!==$?(O=_?i.jsx(ie.CreditsEyebrow,{balanceDollars:j}):$?i.jsx(ie.NoCreditsEyebrow,{}):null,t[24]=j,t[25]=_,t[26]=$,t[27]=O):O=t[27];const B=O;let z;return t[28]!==B||t[29]!==S||t[30]!==r||t[31]!==E?(z=i.jsx(ti,{children:r?i.jsx(Hi,{eyebrow:B,userName:E}):i.jsx(Li,{eyebrow:B,userName:E,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=r,t[31]=E,t[32]=z):z=t[32],z}function Hi(t){const e=T.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Xe,{}),e[0]=n):n=e[0];let a;e[1]!==s?(a=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=a):a=e[2];let o;e[3]!==r?(o=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=o):o=e[4];let d;e[5]!==a||e[6]!==o?(d=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ie.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(Je,{isEditMode:!1})}),e[9]=c):c=e[9];let m;return e[10]!==d?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,d,l,c]}),e[10]=d,e[11]=m):m=e[11],m}function Li(t){const e=T.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:a,enter:o,save:d,cancel:l,hasChanges:c}=Ze(),[m,u]=A.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]!==o||e[3]!==c||e[4]!==a||e[5]!==d?(p=i.jsx(gs.Right,{children:i.jsx(Ui,{isEditMode:a,hasChanges:c,onEnter:o,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=o,e[3]=c,e[4]=a,e[5]=d,e[6]=p):p=e[6];let g;e[7]!==m?(g=i.jsx(ws,{open:m,onOpenChange:u}),e[7]=m,e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(Xe,{}),e[9]=h):h=e[9];const x=n||a?"pt-32":"flex-1 justify-center";let b;e[10]!==x?(b=q("relative flex flex-col items-center px-10 pb-4",x),e[10]=x,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let y;e[16]!==v||e[17]!==w?(y=i.jsxs("div",{className:"text-center mb-10",children:[v,w]}),e[16]=v,e[17]=w,e[18]=y):y=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Bi,{}),i.jsx(ie.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==y?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[y,j]}),e[20]=y,e[21]=N):N=e[21];let S;e[22]!==a?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(Je,{isEditMode:a})}),e[22]=a,e[23]=S):S=e[23];let k;e[24]!==N||e[25]!==S||e[26]!==b?(k=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[h,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:b,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=b,e[27]=k):k=e[27];let C;return e[28]!==k||e[29]!==p||e[30]!==g?(C=i.jsxs(i.Fragment,{children:[p,g,k]}),e[28]=k,e[29]=p,e[30]=g,e[31]=C):C=e[31],C}function Ui(t){const e=T.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:a,onCancel:o,onAddTile:d}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ge,{size:14}),e[0]=m):m=e[0];let u;e[1]!==d?(u=i.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:[m,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Ae,{size:14}),e[3]=f):f=e[3];let p;e[4]!==o?(p=i.jsxs(je,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=o,e[5]=p):p=e[5];const g=!r;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(jt,{size:14}),e[6]=h):h=e[6];let x;e[7]!==a||e[8]!==g?(x=i.jsxs(je,{size:"sm",onClick:a,disabled:g,className:"gap-1.5 h-7 text-xs",children:[h,"Save"]}),e[7]=a,e[8]=g,e[9]=x):x=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==x?(b=i.jsxs(i.Fragment,{children:[u,p,x]}),e[10]=u,e[11]=p,e[12]=x,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(_t,{size:14}),e[14]=l):l=e[14];let c;return e[15]!==n?(c=i.jsxs("button",{type:"button",onClick:n,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]=n,e[16]=c):c=e[16],c}function Bi(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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 Vr(){const t=T.c(2);if(xe()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{Vr as default};
|
|
1
|
+
import{ar as Ye,as as de,at as et,au as tt,av as Ie,G as he,aw as st,ax as it,r as A,ay as nt,az as rt,aA as ot,aB as lt,aC as ve,aD as at,aE as ct,aF as dt,e as T,j as i,q as Z,c as q,l as $e,aG as pe,o as W,K as re,n as oe,a as mt,v as ut,E as ft,b as ht,B as je}from"./index-CiRQNPVt.js";import{u as xe}from"./tooltip-C47QSg8i.js";import{i as pt,u as ee,S as Te,g as xt}from"./use-mcp-client-D0A6RZFw.js";import{a as gt,b as bt,v as yt,u as vt}from"./use-virtual-mcp-DciRKx1X.js";import{i as jt}from"./Check-C9-fsV6-.js";import{Z as wt,A as Y,$ as Nt,u as St,c as _t}from"./agent-icon-DAPplz1A.js";import{s as ge}from"./Plus-CSNkL1o7.js";import{i as Ae}from"./X-BdwzFded.js";import{u as Ct,b as kt,h as Et,C as ie}from"./agent-capabilities-gx2lqG9R.js";import{u as It,c as $t}from"./chat-context-BFmJRDzy.js";import{N as Tt}from"./agent-icons-Dk-aO0GI.js";import{u as Me,a as ne,K as Oe,P as Re,D as ze,c as At,S as Mt,v as Ot,b as Rt,C as zt,s as Pt,d as Dt,e as Ht,f as Lt}from"./sortable.esm-D7AgS_lX.js";import{u as Pe,a as De,o as Ut}from"./use-organization-settings-PADdytdf.js";import{c as be,u as Bt,h as Ft}from"./shell-layout-3b4NfWya.js";import{I as Qt}from"./input-D3E6n6la.js";import{S as Wt}from"./scroll-area-verb-Y8E.js";import{S as qt,c as Kt,d as Gt,a as Vt,b as Zt}from"./sheet-Utq51ofH.js";import{S as H}from"./skeleton-dQOYuNlQ.js";import{t as He}from"./ChevronDown--2U1gfXf.js";import{d as Le}from"./ZoomOut-CaG3Pd1Z.js";import{g as Jt,M as Xt}from"./types-Df_Z2FUK.js";import{I as Yt}from"./integration-icon-vaGvNHHz.js";import{u as es}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Ue,P as ts,e as ss,s as is,g as ns}from"./pair-CpEuUIpQ.js";import{a as rs}from"./XCircle-D_3MYOn4.js";import{g as os}from"./use-mcp-prompts-BuV5LRNr.js";import{u as ls,w as as}from"./tab-id-C7unjelb.js";import{a as cs,d as ds,c as ms,b as us,D as fs}from"./dropdown-menu-UGlYpK18.js";import{s as hs}from"./Trash01-C3pnsiws.js";import{a as ps,u as xs}from"./use-ai-providers-Bwbur0GT.js";import{a as gs}from"./toolbar-D3G0G9U8.js";import"./use-collections-B1Mg9Y32.js";import"./AlertCircle-BDfUS-lh.js";import"./Tool01-R6WyaXsu.js";import"./SwitchHorizontal01-BI_yHGXL.js";import"./RefreshCcw01-Dncu-kYd.js";import"./ArrowUpRight-8daK_Mrm.js";import"./ZapSquare-CP91cLS8.js";import"./Users03-Bek4Ag3W.js";import"./CheckCircle-B_rVd_l8.js";import"./ChevronLeft-TttN4toV.js";import"./ChevronRight-BVEygGVH.js";import"./ChevronUp-C-xaVM7d.js";import"./DotsVertical-Q3F6UWC_.js";import"./Container-Bso4WS0x.js";import"./Eye-CKz6zS_m.js";import"./Globe01-iupU5eqh.js";import"./FilterLines-SKQT-eWL.js";import"./Star01-CN33xE6w.js";import"./Palette-CS36Icvl.js";import"./HardDrive-DpuvbJvr.js";import"./Stars02-B4CoQ82E.js";import"./Key01-6eW9IRFT.js";import"./LayoutLeft-BkxKKkMX.js";import"./LinkExternal01-BXhdtlT7.js";import"./Monitor01-DUICZH5i.js";import"./Sun-CEzPQTAJ.js";import"./Play-CbbqvWPd.js";import"./SearchMd-B-q2EsGW.js";import"./Settings02-CdJ0CKrL.js";import"./Shield01-Crgp73nV.js";import"./Stars01-BXO9Nc4-.js";import"./Upload01-BHsRhr7X.js";import"./User01-JuGE_kA7.js";import"./Users01-BVUwP6xk.js";import"./XClose-Da5LgJSi.js";import"./Zap-DHBAOmqP.js";import"./spinner-_hqWpG0c.js";import"./dialog-Cwf6uY_y.js";import"./drawer-CF0b7Dg3.js";import"./collection-search-CDLcWLfd.js";import"./form-Bbpyf2N_.js";import"./label-DLUhXNk7.js";import"./select-BMX9jvQG.js";import"./tabs-DVd_y6YL.js";import"./toggle-group-vA7ktrP-.js";import"./connect-desktop-dialog-CDUh5Otr.js";import"./popover-C1MgHMHU.js";import"./command-B8qtKAnE.js";import"./index-DJTEqPXf.js";import"./useInfiniteQuery-C1jLiRqA.js";import"./infiniteQueryObserver-BND7fiNU.js";import"./index-Co-NpkaC.js";import"./question-004-sINsf4GQ.js";import"./checkbox-CBmcFqoh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BqNGZrFg.js";import"./settings-section-CQW36fJV.js";import"./card-D41ULrnf.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CSsbMtfE.js";import"./use-registry-connections-C0VEE_YX.js";import"./use-connection-DpxWBF4Y.js";import"./extract-connection-data-BKeaLULt.js";import"./generate-id-BHe5yw90.js";import"./collections-BxDJ4z3g.js";import"./collection-tabs-CbZbTMYY.js";import"./badge-BBLSXFe0.js";import"./textarea-D1h5iq3D.js";import"./connection-form-helpers-BonOFyzw.js";import"./use-infinite-scroll-D8iZFAEQ.js";import"./useSuspenseInfiniteQuery-CHLM-3cW.js";import"./required-auth-layout-BE5eceMw.js";import"./useRouterState-BXwm4DCl.js";import"./use-org-sso-nq4qWMpD.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-B_uLjrw6.js";import"./file-type-icon-7TqtrpuQ.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-Drh7z3D_.js";import"./decopilot-sse-pool-BHhoQKaF.js";import"./create-sse-subscription-BS5983N4.js";function we(t,e){const s=new Set(e);return t.filter(r=>!s.has(r))}function bs(t,e,s){const r=t.slice(0);return r[e]=s,r}var ys=class extends Ye{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(t,e,s){super(),this.#n=t,this.#i=s,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(t=>{t.subscribe(e=>{this.#f(t,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(t=>{t.destroy()})}setQueries(t,e){this.#r=t,this.#i=e,de.batch(()=>{const s=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),a=n.map(m=>m.getCurrentResult()),o=s.length!==n.length,d=n.some((m,u)=>m!==s[u]),l=o||d,c=l?!0:a.some((m,u)=>{const f=this.#e[u];return!f||!et(m,f)});!l&&!c||(l&&(this.#c=r,this.#t=n),this.#e=a,this.hasListeners()&&(l&&(we(s,n).forEach(m=>{m.destroy()}),we(n,s).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(t=>t.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(t,e){const s=this.#u(t),r=s.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),n=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#m(a??r,e,n),()=>this.#d(r,s)]}#d(t,e){return e.map((s,r)=>{const n=t[r];return s.defaultedQueryOptions.notifyOnChangeProps?n:s.observer.trackResult(n,a=>{e.forEach(o=>{o.observer.trackProp(a)})})})}#m(t,e,s){if(e){const r=this.#a,n=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,o)=>a!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,s!==void 0&&(this.#a=s),this.#s=tt(this.#s,e(t))),this.#s}return t}#p(){return this.#i?.combine!==void 0&&this.#t.some((t,e)=>t.options.suspense&&this.#e[e]?.data===void 0)}#u(t){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const a=e.get(n);a?a.push(r):e.set(n,[r])});const s=[];return t.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ie(this.#n,n);s.push({defaultedQueryOptions:n,observer:o})}),s}#f(t,e){const s=this.#t.indexOf(t);s!==-1&&(this.#e=bs(this.#e,s,e),this.#h())}#h(){if(this.hasListeners()){const t=this.#d(this.#e,this.#c),e=this.#p(),s=this.#s,r=e?s:this.#m(t,this.#i?.combine);(e||s!==r)&&de.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function vs({queries:t,...e},s){const r=he(s),n=st(),a=it(),o=A.useMemo(()=>t.map(h=>{const x=r.defaultQueryOptions(h);return x._optimisticResults=n?"isRestoring":"optimistic",x}),[t,r,n]);o.forEach(h=>{nt(h);const x=r.getQueryCache().get(h.queryHash);rt(h,a,x)}),ot(a);const[d]=A.useState(()=>new ys(r,o,e)),[l,c,m]=d.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;A.useSyncExternalStore(A.useCallback(h=>u?d.subscribe(de.batchCalls(h)):lt,[d,u]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),A.useEffect(()=>{d.setQueries(o,e)},[o,e,d]);const p=l.some((h,x)=>ve(o[x],h))?l.flatMap((h,x)=>{const b=o[x];if(b&&ve(b,h)){const v=new Ie(r,b);return at(b,v,a)}return[]}):[];if(p.length>0)throw Promise.all(p);const g=l.find((h,x)=>{const b=o[x];return b&&ct({result:h,errorResetBoundary:a,throwOnError:b.throwOnError,query:r.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(g?.error)throw g.error;return c(m())}function js(t,e){return vs({...t,queries:t.queries.map(s=>({...s,suspense:!0,throwOnError:dt,enabled:!0,placeholderData:void 0}))},e)}const te=8;function ws(t){const e=T.c(16),{open:s,onOpenChange:r}=t,[n,a]=A.useState("");let o,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(qt,{children:"Manage home"}),d=i.jsx(Kt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=d):(o=e[0],d=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(wt,{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 c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h=>a(h.target.value),e[3]=c):c=e[3];let m;e[4]!==n?(m=i.jsxs(Gt,{className:"px-5 py-4 border-b border-border",children:[o,d,i.jsxs("div",{className:"relative mt-3",children:[l,i.jsx(Qt,{value:n,onChange:c,placeholder:"Search agents…",className:"pl-8 h-8 text-sm"})]})]}),e[4]=n,e[5]=m):m=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(Zs,{}),e[6]=u):u=e[6];let f;e[7]!==n?(f=i.jsx(Wt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:i.jsx("div",{className:"p-3 flex flex-col gap-4",children:i.jsx(A.Suspense,{fallback:u,children:i.jsx(Ss,{search:n})})})}),e[7]=n,e[8]=f):f=e[8];let p;e[9]!==m||e[10]!==f?(p=i.jsxs(Vt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,f]}),e[9]=m,e[10]=f,e[11]=p):p=e[11];let g;return e[12]!==r||e[13]!==s||e[14]!==p?(g=i.jsx(Zt,{open:s,onOpenChange:r,children:p}),e[12]=r,e[13]=s,e[14]=p,e[15]=g):g=e[15],g}function Ns(t){const e=T.c(32),{org:s}=Z(),r=Pe();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const a=n,o=De(),d=bt(),l=he();let c;e[2]!==s||e[3]!==l?(c=()=>l.refetchQueries({queryKey:re.homeNextActions(s.slug),type:"active"}),e[2]=s,e[3]=l,e[4]=c):c=e[4];const m=c;let u;e[5]!==a?(u=C=>a.includes(C),e[5]=a,e[6]=u):u=e[6];const f=u;let p;e[7]!==a||e[8]!==t?(p=t?a.filter(C=>t.has(C)).length:a.length,e[7]=a,e[8]=t,e[9]=p):p=e[9];const h=p>=te;let x;e[10]!==h||e[11]!==f||e[12]!==o?(x=C=>f(C)||h?Promise.resolve():o.apply(I=>I.includes(C)?null:[...I,C]),e[10]=h,e[11]=f,e[12]=o,e[13]=x):x=e[13];const b=x;let v;e[14]!==o?(v=C=>o.apply(I=>I.filter(E=>E!==C)),e[14]=o,e[15]=v):v=e[15];const w=v;let y;e[16]!==o?(y=C=>o.apply(()=>C),e[16]=o,e[17]=y):y=e[17];const j=y;let N;e[18]!==d||e[19]!==h||e[20]!==f||e[21]!==m||e[22]!==o?(N=async(C,I)=>{await d.update.mutateAsync({id:C.id,data:{metadata:I}}),!f(C.id)&&!h&&await o.apply(E=>E.includes(C.id)?null:[...E,C.id]),await m()},e[18]=d,e[19]=h,e[20]=f,e[21]=m,e[22]=o,e[23]=N):N=e[23];const S=N;let k;return e[24]!==b||e[25]!==h||e[26]!==a||e[27]!==f||e[28]!==w||e[29]!==j||e[30]!==S?(k={homeIds:a,isOnHome:f,atLimit:h,addAgent:b,removeAgent:w,reorder:j,saveAgentMetadata:S},e[24]=b,e[25]=h,e[26]=a,e[27]=f,e[28]=w,e[29]=j,e[30]=S,e[31]=k):k=e[31],k}function Ss(t){const e=T.c(21),{search:s}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=gt(r);let a;e[1]!==n?(a=new Set(n.map(Is)),e[1]=n,e[2]=a):a=e[2];const o=Ns(a);let d,l,c;if(e[3]!==n||e[4]!==o||e[5]!==s){const h=new Map(n.map(Es));d=s.trim().toLowerCase();const x=v=>!d||v.title?.toLowerCase().includes(d);l=o.homeIds.map(v=>h.get(v)).filter(ks).filter(x);let b;e[9]!==o?(b=v=>!o.isOnHome(v.id),e[9]=o,e[10]=b):b=e[10],c=n.filter(Cs).filter(b).filter(x).sort(_s),e[3]=n,e[4]=o,e[5]=s,e[6]=d,e[7]=l,e[8]=c}else d=e[6],l=e[7],c=e[8];const m=c;let u;e[11]!==o||e[12]!==l?(u=i.jsx($s,{home:o,agents:l}),e[11]=o,e[12]=l,e[13]=u):u=e[13];const f=!!d;let p;e[14]!==m||e[15]!==o||e[16]!==f?(p=i.jsx(Ms,{home:o,agents:m,hasSearch:f}),e[14]=m,e[15]=o,e[16]=f,e[17]=p):p=e[17];let g;return e[18]!==u||e[19]!==p?(g=i.jsxs(i.Fragment,{children:[u,p]}),e[18]=u,e[19]=p,e[20]=g):g=e[20],g}function _s(t,e){return(t.title??"").localeCompare(e.title??"")}function Cs(t){return t.id&&!pt(t.id)}function ks(t){return!!t}function Es(t){return[t.id,t]}function Is(t){return t.id}function Be(t){const e=T.c(7),{title:s,hint:r}=t;let n;e[0]!==s?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1];let a;e[2]!==r?(a=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=a):a=e[3];let o;return e[4]!==n||e[5]!==a?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,a]}),e[4]=n,e[5]=a,e[6]=o):o=e[6],o}function $s(t){const e=T.c(14),{home:s,agents:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={coordinateGetter:Pt},e[1]=a):a=e[1];const o=Me(ne(Re,n),ne(Oe,a));let d;e[2]!==s?(d=p=>{const{active:g,over:h}=p;if(!h||g.id===h.id)return;const x=s.homeIds,b=x.indexOf(g.id),v=x.indexOf(h.id);b===-1||v===-1||s.reorder(Dt([...x],b,v)).catch(As)},e[2]=s,e[3]=d):d=e[3];const l=d,c=`${s.homeIds.length}/${te}`;let m;e[4]!==c?(m=i.jsx(Be,{title:"On home",hint:c}),e[4]=c,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==l||e[8]!==s||e[9]!==o?(u=r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:"No agents on the home yet."}):i.jsx(ze,{sensors:o,collisionDetection:At,onDragEnd:l,children:i.jsx(Mt,{items:r.map(Ts),strategy:Ot,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(p=>i.jsx(Rs,{agent:p,home:s},p.id))})})}),e[6]=r,e[7]=l,e[8]=s,e[9]=o,e[10]=u):u=e[10];let f;return e[11]!==m||e[12]!==u?(f=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=f):f=e[13],f}function Ts(t){return t.id}function As(){return W.error("Couldn't reorder home — please try again.")}function Ms(t){const e=T.c(6),{home:s,agents:r,hasSearch:n}=t,[a,o]=A.useState(20);let d;if(e[0]!==r||e[1]!==n||e[2]!==s||e[3]!==a){const l=r.slice(0,a);let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(Be,{title:"Add to home"}),e[5]=c):c=e[5],d=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[c,r.length===0?i.jsx("p",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:n?"No agents match.":"Every agent is on the home."}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-col gap-1",children:l.map(m=>i.jsx(Ds,{agent:m,home:s},m.id))}),r.length>a&&i.jsxs("button",{type:"button",onClick:()=>o(Os),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 (",r.length-a,")"]})]})]}),e[0]=r,e[1]=n,e[2]=s,e[3]=a,e[4]=d}else d=e[4];return d}function Os(t){return t+20}function Fe(t){const e=pe(t.metadata?.ui).filter(a=>!!a.resourceUri).length,s=t.metadata?.ui?.homePrompts,r=Array.isArray(s)?s.length:null,n=[];return e>0&&n.push(`${e} tile${e===1?"":"s"}`),r!==null&&r>0&&n.push(`${r} prompt${r===1?"":"s"}`),r===0&&n.push("prompts off"),n.join(" · ")}function Rs(t){const e=T.c(57),{agent:s,home:r}=t,[n,a]=A.useState(!1);let o;e[0]!==s.id?(o={id:s.id},e[0]=s.id,e[1]=o):o=e[1];const{attributes:d,listeners:l,setNodeRef:c,transform:m,transition:u,isDragging:f}=Rt(o),p=Fe(s)||"Quick access";let g;e[2]!==m?(g=zt.Transform.toString(m),e[2]=m,e[3]=g):g=e[3];const h=f?.5:void 0,x=f?100:void 0;let b;e[4]!==g||e[5]!==h||e[6]!==x||e[7]!==u?(b={transform:g,transition:u,opacity:h,zIndex:x},e[4]=g,e[5]=h,e[6]=x,e[7]=u,e[8]=b):b=e[8];const v=b,w=f&&"shadow-lg";let y;e[9]!==w?(y=q("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=y):y=e[10];const j=`Drag to reorder ${s.title??s.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Le,{size:14}),e[11]=N):N=e[11];let S;e[12]!==d||e[13]!==l||e[14]!==j?(S=i.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":j,children:N}),e[12]=d,e[13]=l,e[14]=j,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=()=>a(Ps),e[16]=k):k=e[16];const C=s.title??s.id;let I;e[17]!==s.icon||e[18]!==C?(I=i.jsx(Y,{icon:s.icon,name:C,size:"sm"}),e[17]=s.icon,e[18]=C,e[19]=I):I=e[19];const E=s.title??s.id;let _;e[20]!==E?(_=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:E}),e[20]=E,e[21]=_):_=e[21];let $;e[22]!==p?($=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:p}),e[22]=p,e[23]=$):$=e[23];let O;e[24]!==_||e[25]!==$?(O=i.jsxs("div",{className:"min-w-0 flex-1",children:[_,$]}),e[24]=_,e[25]=$,e[26]=O):O=e[26];const B=n&&"rotate-180";let z;e[27]!==B?(z=q("shrink-0 text-muted-foreground transition-transform",B),e[27]=B,e[28]=z):z=e[28];let P;e[29]!==z?(P=i.jsx(He,{size:16,className:z}),e[29]=z,e[30]=P):P=e[30];let Q;e[31]!==n||e[32]!==I||e[33]!==O||e[34]!==P?(Q=i.jsxs("button",{type:"button",onClick:k,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[I,O,P]}),e[31]=n,e[32]=I,e[33]=O,e[34]=P,e[35]=Q):Q=e[35];let M;e[36]!==s.id||e[37]!==r?(M=()=>r.removeAgent(s.id).catch(zs),e[36]=s.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${s.title??s.id} from home`;let D;e[39]===Symbol.for("react.memo_cache_sentinel")?(D=i.jsx(Ae,{size:14}),e[39]=D):D=e[39];let R;e[40]!==M||e[41]!==F?(R=i.jsx("button",{type:"button",onClick:M,"aria-label":F,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]=M,e[41]=F,e[42]=R):R=e[42];let L;e[43]!==S||e[44]!==Q||e[45]!==R?(L=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[S,Q,R]}),e[43]=S,e[44]=Q,e[45]=R,e[46]=L):L=e[46];let U;e[47]!==s||e[48]!==n||e[49]!==r?(U=n&&i.jsx(Qe,{agent:s,home:r}),e[47]=s,e[48]=n,e[49]=r,e[50]=U):U=e[50];let G;return e[51]!==c||e[52]!==v||e[53]!==L||e[54]!==U||e[55]!==y?(G=i.jsxs("div",{ref:c,style:v,className:y,children:[L,U]}),e[51]=c,e[52]=v,e[53]=L,e[54]=U,e[55]=y,e[56]=G):G=e[56],G}function zs(){return W.error("Couldn't remove from home — please try again.")}function Ps(t){return!t}function Ds({agent:t,home:e}){const[s,r]=A.useState(!1),[n,a]=A.useState(!1),o=Fe(t),d=async()=>{if(!e.atLimit){a(!0);try{await e.addAgent(t.id)}catch{W.error("Couldn't add to home — please try again.")}finally{a(!1)}}};return i.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[i.jsxs("button",{type:"button",onClick:()=>r(l=>!l),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":s,children:[i.jsx(Y,{icon:t.icon,name:t.title??t.id,size:"sm"}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.title??t.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(He,{size:16,className:q("shrink-0 text-muted-foreground transition-transform",s&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:d,disabled:n||e.atLimit,"aria-label":"Add to home",title:e.atLimit?`Home is full (${te}) — 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:n?i.jsx($e,{size:12,className:"animate-spin"}):i.jsx(ge,{size:14})})]}),s&&i.jsx(Qe,{agent:t,home:e})]})}function Qe(t){const e=T.c(26),{agent:s,home:r}=t;let n,a,o,d,l,c,m;if(e[0]!==s||e[1]!==r){const x=pe(s.metadata?.ui);let b;e[9]!==s.connections?(b=(s.connections??[]).map(Ls).sort(),e[9]=s.connections,e[10]=b):b=e[10];const v=b;a=s.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Bs,o=s,d=r,l=v,c=new Set(x.map(Hs)),e[0]=s,e[1]=r,e[2]=n,e[3]=a,e[4]=o,e[5]=d,e[6]=l,e[7]=c,e[8]=m}else n=e[2],a=e[3],o=e[4],d=e[5],l=e[6],c=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==d||e[14]!==l||e[15]!==c?(u=i.jsx(n,{agent:o,home:d,connectionIds:l,pinnedResourceUris:c}),e[11]=n,e[12]=o,e[13]=d,e[14]=l,e[15]=c,e[16]=u):u=e[16];let f;e[17]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Us,{}),e[17]=f):f=e[17];const p=a??null;let g;e[18]!==s||e[19]!==r||e[20]!==p?(g=i.jsx(A.Suspense,{fallback:f,children:i.jsx(Qs,{agent:s,home:r,curated:p})}),e[18]=s,e[19]=r,e[20]=p,e[21]=g):g=e[21];let h;return e[22]!==m||e[23]!==u||e[24]!==g?(h=i.jsxs("div",{className:m,children:[u,g]}),e[22]=m,e[23]=u,e[24]=g,e[25]=h):h=e[25],h}function Hs(t){return t.resourceUri}function Ls(t){return t.connection_id}function Us(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[i.jsx(H,{className:"h-8 w-full"}),i.jsx(H,{className:"h-8 w-2/3"})]}),t[0]=e):e=t[0],e}function Bs({agent:t,home:e,connectionIds:s,pinnedResourceUris:r}){const{org:n}=Z(),a=ee({connectionId:Te,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:d}=oe({queryKey:re.projectConnectionDetails(t.id,s),enabled:s.length>0,queryFn:async()=>(await Promise.all(s.map(async c=>{try{const m=await a.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:c}}),{item:u}=es(m),f=(u?.tools??[]).flatMap(p=>{const g=Jt(p._meta);return g?[{name:p.name,description:p.description,resourceUri:g}]:[]});return{id:c,title:u?.title??c,icon:u?.icon??null,uiTools:f}}catch{return{id:c,title:c,icon:null,uiTools:[]}}}))).filter(c=>c.uiTools.length>0)});return s.length===0?null:d?i.jsxs("div",{className:"flex flex-col gap-1 py-0.5",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}):!o||o.length===0?null:i.jsx("div",{className:"flex flex-col gap-0.5",children:o.map(l=>l.uiTools.map(c=>i.jsx(Fs,{agent:t,home:e,connection:l,tool:c,isPinned:r.has(c.resourceUri)},`${l.id}:${c.name}`)))})}function Fs({agent:t,home:e,connection:s,tool:r,isPinned:n}){const[a,o]=A.useState(!1),d=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const l=pe(t.metadata?.ui),c=n?l.filter(u=>u.resourceUri!==r.resourceUri):[...l,{connectionId:s.id,resourceUri:r.resourceUri}],m={...t.metadata??{},ui:{...t.metadata?.ui??{},homeTile:null,homeTiles:c}};await e.saveAgentMetadata(t,m)}catch(l){console.error("[home-tiles] failed to toggle tile",l),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx(Yt,{icon:s.icon,name:s.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Ue(r.name)}),i.jsx(We,{isPinned:n,submitting:a,onClick:d,label:n?"Remove from home":"Add to home"})]})}function We(t){const e=T.c(11),{isPinned:s,submitting:r,onClick:n,label:a}=t,o=s?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let d;e[0]!==o?(d=q("inline-flex size-7 shrink-0 items-center justify-center rounded-md text-xs transition-colors disabled:opacity-50 disabled:cursor-progress",o),e[0]=o,e[1]=d):d=e[1];let l;e[2]!==s||e[3]!==r?(l=r?i.jsx($e,{size:12,className:"animate-spin"}):s?i.jsx(Nt,{size:14}):i.jsx(ge,{size:14}),e[2]=s,e[3]=r,e[4]=l):l=e[4];let c;return e[5]!==a||e[6]!==n||e[7]!==r||e[8]!==d||e[9]!==l?(c=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":a,title:a,className:d,children:l}),e[5]=a,e[6]=n,e[7]=r,e[8]=d,e[9]=l,e[10]=c):c=e[10],c}function Qs(t){const e=T.c(32),{agent:s,home:r,curated:n}=t,{org:a}=Z();let o;e[0]!==s.id||e[1]!==a.id||e[2]!==a.slug?(o={connectionId:s.id,orgId:a.id,orgSlug:a.slug},e[0]=s.id,e[1]=a.id,e[2]=a.slug,e[3]=o):o=e[3];const d=ee(o);let l;e[4]!==s.id||e[5]!==a.id?(l=re.agentPrompts(a.id,s.id),e[4]=s.id,e[5]=a.id,e[6]=l):l=e[6];let c;e[7]!==d?(c=async()=>{const{prompts:j}=await d.listPrompts();return j.map(Gs)},e[7]=d,e[8]=c):c=e[8];let m;e[9]!==l||e[10]!==c?(m={queryKey:l,queryFn:c,staleTime:3e4,retry:!1},e[9]=l,e[10]=c,e[11]=m):m=e[11];const{data:u,isLoading:f,error:p}=oe(m),g=be(a.slug);let h,x;if(e[12]!==s.id||e[13]!==u||e[14]!==g.prompts){let j;e[17]!==s.id?(j=S=>S.agentId===s.id&&S.promptName,e[17]=s.id,e[18]=j):j=e[18],h=g.prompts.filter(j).map(Ks);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],x=[...N];for(const S of h)x.some(k=>k.name===S.name)||x.push(S);e[12]=s.id,e[13]=u,e[14]=g.prompts,e[15]=h,e[16]=x}else h=e[15],x=e[16];if(f&&h.length===0){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(H,{className:"h-7 w-full"}),i.jsx(H,{className:"h-7 w-2/3"})]}),e[21]=j):j=e[21],j}if(p&&h.length===0)return console.error("[home-tiles] listPrompts failed for agent",s.id,p),null;if(x.length===0)return null;let b;e[22]!==n||e[23]!==x?(b=n??x.map(qs),e[22]=n,e[23]=x,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 w=v;let y;return e[27]!==s||e[28]!==r||e[29]!==x||e[30]!==w?(y=i.jsx("div",{className:"flex flex-col gap-0.5",children:x.map(j=>i.jsx(Vs,{agent:s,home:r,prompt:j,allPromptNames:x.map(Ws),isPinned:w.has(j.name)},j.name))}),e[27]=s,e[28]=r,e[29]=x,e[30]=w,e[31]=y):y=e[31],y}function Ws(t){return t.name}function qs(t){return t.name}function Ks(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 Vs({agent:t,home:e,prompt:s,allPromptNames:r,isPinned:n}){const[a,o]=A.useState(!1),d=async()=>{if(!n&&!e.isOnHome(t.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const l=t.metadata?.ui?.homePrompts;let c;Array.isArray(l)?c=n?l.filter(u=>u!==s.name):[...l,s.name]:c=n?r.filter(u=>u!==s.name):r;const m={...t.metadata??{},ui:{...t.metadata?.ui??{},homePrompts:c}};await e.saveAgentMetadata(t,m)}catch(l){console.error("[home-tiles] failed to toggle prompt",l),W.error("Couldn't update home — please try again.")}finally{o(!1)}};return i.jsxs("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1 hover:bg-accent/40",children:[i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:s.title??Ue(s.name)}),i.jsx(We,{isPinned:n,submitting:a,onClick:d,label:n?"Remove from home":"Add to home"})]})}function Zs(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},Js)}),t[0]=e):e=t[0],e}function Js(t,e){return i.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border p-2.5",children:[i.jsx(H,{className:"size-8 rounded-md"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},e)}const X=1,qe=`home-board.layout.v${X}`;function Ke(t){return`home-board.layout.v${X}.${t}`}const Ge={version:X,tiles:{},hidden:[]};function me(t){return!t||t.version!==X?Ge:{version:X,tiles:t.tiles??{},hidden:Array.isArray(t.hidden)?t.hidden:[]}}function Xs(t){return Object.keys(t.tiles).length>0||t.hidden.length>0}function Ys(t){try{const e=localStorage.getItem(Ke(t));return e?me(JSON.parse(e)):void 0}catch{return}}function Ne(t,e){try{localStorage.setItem(Ke(t),JSON.stringify(e))}catch{}}async function Se(t,e){if(!(await fetch(`/api/${t}/kv/${qe}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ei(t){const e=T.c(24),s=he();let r;e[0]!==t?(r=re.boardLayout(t),e[0]=t,e[1]=r):r=e[1];const n=r;let a;e[2]!==t?(a=Ys(t),e[2]=t,e[3]=a):a=e[3];const o=a;let d;e[4]!==o||e[5]!==t?(d=async()=>{const b=await fetch(`/api/${t}/kv/${qe}`);if(b.status===404)return o&&Xs(o)?(await Se(t,o),o):Ge;if(!b.ok)throw new Error("Failed to load board layout");const v=await b.json(),w=me(v.value);return Ne(t,w),w},e[4]=o,e[5]=t,e[6]=d):d=e[6];let l;e[7]!==o||e[8]!==n||e[9]!==d?(l={queryKey:n,queryFn:d,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=d,e[10]=l):l=e[10];const{data:c,isLoading:m}=oe(l);let u;e[11]!==t?(u={mutationFn:b=>Se(t,b)},e[11]=t,e[12]=u):u=e[12];const f=mt(u);let p;e[13]!==f||e[14]!==t||e[15]!==s||e[16]!==n?(p=b=>{Ne(t,b),s.setQueryData(n,b),f.mutate(b)},e[13]=f,e[14]=t,e[15]=s,e[16]=n,e[17]=p):p=e[17];const g=p;let h;e[18]!==c?(h=me(c),e[18]=c,e[19]=h):h=e[19];let x;return e[20]!==m||e[21]!==g||e[22]!==h?(x={layout:h,isLoading:m,save:g},e[20]=m,e[21]=g,e[22]=h,e[23]=x):x=e[23],x}const Ve=A.createContext(null);function ti(t){const e=T.c(24),{children:s}=t,{org:r}=Z(),n=ei(r.slug),[a,o]=A.useState(!1),[d,l]=A.useState(null);let c;e[0]!==n.layout?(c=()=>{l(n.layout),o(!0)},e[0]=n.layout,e[1]=c):c=e[1];const m=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{l(null),o(!1)},e[2]=u):u=e[2];const f=u;let p;e[3]!==d||e[4]!==n?(p=()=>{d&&n.save(d),l(null),o(!1)},e[3]=d,e[4]=n,e[5]=p):p=e[5];const g=p,h=a&&d!==null,x=h?d:n.layout;let b;e[6]!==d||e[7]!==h||e[8]!==n.layout?(b=h?JSON.stringify(d)!==JSON.stringify(n.layout):!1,e[6]=d,e[7]=h,e[8]=n.layout,e[9]=b):b=e[9];const v=b;let w;e[10]!==a||e[11]!==n?(w=S=>{a?l(S):n.save(S)},e[10]=a,e[11]=n,e[12]=w):w=e[12];const y=w;let j;e[13]!==y||e[14]!==m||e[15]!==v||e[16]!==a||e[17]!==x||e[18]!==g||e[19]!==n.isLoading?(j={isEditMode:a,enter:m,cancel:f,save:g,hasChanges:v,layout:x,isLayoutLoading:n.isLoading,commitLayout:y},e[13]=y,e[14]=m,e[15]=v,e[16]=a,e[17]=x,e[18]=g,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==s||e[22]!==j?(N=i.jsx(Ve.Provider,{value:j,children:s}),e[21]=s,e[22]=j,e[23]=N):N=e[23],N}function Ze(){const t=A.useContext(Ve);if(!t)throw new Error("useHomeEdit must be used within a HomeEditProvider");return t}function si({agentId:t}){const{org:e,locator:s}=Z(),r=ee({connectionId:t,orgId:e.id,orgSlug:e.slug}),{create:n}=ls(),{setTaskId:a}=Bt(),[o,d]=A.useState(null),[l,c]=A.useState(!1),m=A.useRef(!1),u=async(x,b)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,c(!0);try{const v=await os(r,x.name,b),w={type:"doc",content:[{type:"paragraph",content:[ss({id:x.name,name:is(x.name,ns(x._meta)),metadata:v.messages,char:"/",kind:"prompt",args:b}),{type:"text",text:" "}]}]},y=crypto.randomUUID();as(sessionStorage,s,y,{tiptapDoc:w}),await n({id:y,virtual_mcp_id:t}),a(y,t,{autosend:!0})}catch(v){console.error("[start-thread-from-prompt] failed",v),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,c(!1)}}},f=async x=>{if(!m.current){if(x.arguments&&x.arguments.length>0){d(x);return}await u(x)}},p=async x=>{if(!o)return;const b=o;d(null),await u(b,x)};return{start:f,startBlank:async()=>{if(!m.current){m.current=!0,c(!0);try{const x=crypto.randomUUID();await n({id:x,virtual_mcp_id:t}),a(x,t)}catch(x){console.error("[start-thread-from-prompt] startBlank failed",x),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,c(!1)}}},dialog:i.jsx(ts,{prompt:o,setPrompt:x=>d(x),onSubmit:p}),dialogPrompt:o,starting:l}}const K=4,V=100,_e=12,ii=5,ni={w:2,h:2};class ue extends A.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?i.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-destructive/10 text-destructive",children:i.jsx(ut,{size:16})}),i.jsx("p",{className:"text-sm font-medium text-foreground",children:"This tile crashed"}),i.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 ri(t){const e=T.c(72),{tiles:s,isEditMode:r,renderTile:n,onMove:a,onResize:o,onRemove:d}=t,l=xe(),c=A.useRef(null),[m,u]=A.useState(null),[f,p]=A.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={activationConstraint:{distance:4}},e[0]=g):g=e[0];const h=Me(ne(Re,g),ne(Oe)),x=s.reduce(oi,0),b=r?Math.max(x+2,4):Math.max(x,1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{const M=c.current?.getBoundingClientRect();return M?{cellWidth:M.width/K,cellHeight:V}:null},e[1]=v):v=e[1];const w=v;let y;e[2]===Symbol.for("react.memo_cache_sentinel")?(y=M=>{u(String(M.active.id)),p(w())},e[2]=y):y=e[2];const j=y;let N;e[3]!==f||e[4]!==a||e[5]!==s?(N=M=>{const F=String(M.active.id),D=f??w();if(u(null),p(null),!D||D.cellWidth<=0)return;const R=s.find(G=>G.id===F);if(!R)return;const L=Math.round(M.delta.x/D.cellWidth),U=Math.round(M.delta.y/D.cellHeight);L===0&&U===0||a(F,{x:R.x+L,y:R.y+U})},e[3]=f,e[4]=a,e[5]=s,e[6]=N):N=e[6];const S=N;if(l){let M;if(e[7]!==n||e[8]!==s){let D;e[10]!==n?(D=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:V},children:i.jsx(ue,{children:n(R)})},R.id),e[10]=n,e[11]=D):D=e[11],M=s.map(D),e[7]=n,e[8]=s,e[9]=M}else M=e[9];let F;return e[12]!==M?(F=i.jsx("div",{className:"flex flex-col gap-3 px-4 pb-8",children:M}),e[12]=M,e[13]=F):F=e[13],F}let k,C,I,E,_,$,O,B,z;if(e[14]!==m||e[15]!==f||e[16]!==r||e[17]!==S||e[18]!==d||e[19]!==o||e[20]!==n||e[21]!==h||e[22]!==s||e[23]!==b){const M=m?s.find(J=>J.id===m):null;C=ze,B=h,z=j,I=S;const F=b*V,D=r?V*4:V;let R;e[33]!==F||e[34]!==D?(R={height:F,minHeight:D},e[33]=F,e[34]=D,e[35]=R):R=e[35];let L;e[36]!==r||e[37]!==s||e[38]!==b?(L=r&&i.jsx(li,{rows:b,tiles:s}),e[36]=r,e[37]=s,e[38]=b,e[39]=L):L=e[39];let U;if(e[40]!==m||e[41]!==r||e[42]!==d||e[43]!==o||e[44]!==n||e[45]!==s){let J;e[47]!==m||e[48]!==r||e[49]!==d||e[50]!==o||e[51]!==n?(J=se=>i.jsx(ci,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:d,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=d,e[50]=o,e[51]=n,e[52]=J):J=e[52],U=s.map(J),e[40]=m,e[41]=r,e[42]=d,e[43]=o,e[44]=n,e[45]=s,e[46]=U}else U=e[46];e[53]!==R||e[54]!==L||e[55]!==U?(E=i.jsxs("div",{ref:c,className:"relative w-full",style:R,children:[L,U]}),e[53]=R,e[54]=L,e[55]=U,e[56]=E):E=e[56],k=Ht,_=null;const G=M&&f?M.w*f.cellWidth-_e:void 0,le=M&&f?M.h*f.cellHeight-_e:void 0;e[57]!==G||e[58]!==le?($={width:G,height:le},e[57]=G,e[58]=le,e[59]=$):$=e[59],O=M&&i.jsx("div",{className:"bg-card card-shadow rounded-2xl shadow-2xl ring-2 ring-primary/40 h-full overflow-hidden opacity-95",children:i.jsx(ue,{children:n(M)})}),e[14]=m,e[15]=f,e[16]=r,e[17]=S,e[18]=d,e[19]=o,e[20]=n,e[21]=h,e[22]=s,e[23]=b,e[24]=k,e[25]=C,e[26]=I,e[27]=E,e[28]=_,e[29]=$,e[30]=O,e[31]=B,e[32]=z}else k=e[24],C=e[25],I=e[26],E=e[27],_=e[28],$=e[29],O=e[30],B=e[31],z=e[32];let P;e[60]!==k||e[61]!==_||e[62]!==$||e[63]!==O?(P=i.jsx(k,{dropAnimation:_,style:$,children:O}),e[60]=k,e[61]=_,e[62]=$,e[63]=O,e[64]=P):P=e[64];let Q;return e[65]!==C||e[66]!==I||e[67]!==E||e[68]!==P||e[69]!==B||e[70]!==z?(Q=i.jsxs(C,{sensors:B,onDragStart:z,onDragEnd:I,children:[E,P]}),e[65]=C,e[66]=I,e[67]=E,e[68]=P,e[69]=B,e[70]=z,e[71]=Q):Q=e[71],Q}function oi(t,e){return Math.max(t,e.y+e.h)}function li(t){const e=T.c(7),{rows:s,tiles:r}=t;let n;e[0]!==r?(n=(l,c)=>r.some(m=>l>=m.x&&l<m.x+m.w&&c>=m.y&&c<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const a=n;let o;if(e[2]!==a||e[3]!==s){o=[];for(let l=0;l<s;l++)for(let c=0;c<K;c++)a(c,l)||o.push({x:c,y:l});e[2]=a,e[3]=s,e[4]=o}else o=e[4];let d;return e[5]!==o?(d=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(ai)}),e[5]=o,e[6]=d):d=e[6],d}function ai(t){return i.jsx("div",{className:"absolute p-1",style:{left:`${t.x/K*100}%`,top:t.y*V,width:`${1/K*100}%`,height:V},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${t.x}-${t.y}`)}function ci(t){const e=T.c(31),{tile:s,isEditMode:r,isDragging:n,onResize:a,onRemove:o,children:d}=t,l=!r;let c;e[0]!==l||e[1]!==s.id?(c={id:s.id,disabled:l},e[0]=l,e[1]=s.id,e[2]=c):c=e[2];const{setNodeRef:m,attributes:u,listeners:f,isDragging:p}=Lt(c),g=`${s.x/K*100}%`,h=`${s.w/K*100}%`,x=s.y*V,b=s.h*V,v=p||n,w=!v&&"transition-[left,top,width,height,opacity] duration-200 ease-out",y=v&&"opacity-30";let j;e[3]!==w||e[4]!==y?(j=q("absolute p-1 will-change-[left,top,width,height,opacity]",w,y),e[3]=w,e[4]=y,e[5]=j):j=e[5];let N;e[6]!==b||e[7]!==g||e[8]!==x||e[9]!==h?(N={left:g,top:x,width:h,height:b},e[6]=b,e[7]=g,e[8]=x,e[9]=h,e[10]=N):N=e[10];const S=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let k;e[11]!==S?(k=q("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",S),e[11]=S,e[12]=k):k=e[12];let C;e[13]!==u||e[14]!==r||e[15]!==f||e[16]!==o||e[17]!==a||e[18]!==s?(C=r&&i.jsxs(i.Fragment,{children:[i.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:i.jsx(Le,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(di,{tile:s,onResize:a,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=f,e[16]=o,e[17]=a,e[18]=s,e[19]=C):C=e[19];let I;e[20]!==d?(I=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(ue,{children:d})}),e[20]=d,e[21]=I):I=e[21];let E;e[22]!==I||e[23]!==k||e[24]!==C?(E=i.jsxs("div",{className:k,children:[C,I]}),e[22]=I,e[23]=k,e[24]=C,e[25]=E):E=e[25];let _;return e[26]!==m||e[27]!==E||e[28]!==j||e[29]!==N?(_=i.jsx("div",{ref:m,className:j,style:N,children:E}),e[26]=m,e[27]=E,e[28]=j,e[29]=N,e[30]=_):_=e[30],_}function di(t){const e=T.c(20),{tile:s,onResize:r,onRemove:n}=t,[a,o]=A.useState(!1);let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(cs,{asChild:!0,children:i.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:i.jsx(St,{size:16})})}),e[0]=d):d=e[0];let l;e[1]!==r||e[2]!==s.id?(l=x=>{r(s.id,x),o(!1)},e[1]=r,e[2]=s.id,e[3]=l):l=e[3];let c;e[4]!==l||e[5]!==s?(c=i.jsx(mi,{tile:s,onPick:l}),e[4]=l,e[5]=s,e[6]=c):c=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ds,{}),e[7]=m):m=e[7];let u;e[8]!==n||e[9]!==s.id?(u=()=>n(s.id),e[8]=n,e[9]=s.id,e[10]=u):u=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(hs,{size:14,className:"mr-2"}),e[11]=f):f=e[11];let p;e[12]!==u?(p=i.jsxs(ms,{onSelect:u,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[12]=u,e[13]=p):p=e[13];let g;e[14]!==c||e[15]!==p?(g=i.jsxs(us,{align:"end",className:"w-auto",children:[c,m,p]}),e[14]=c,e[15]=p,e[16]=g):g=e[16];let h;return e[17]!==a||e[18]!==g?(h=i.jsxs(fs,{open:a,onOpenChange:o,children:[d,g]}),e[17]=a,e[18]=g,e[19]=h):h=e[19],h}function mi(t){const e=T.c(19),{tile:s,onPick:r}=t,n=s.minW??1,a=s.minH??1,[o,d]=A.useState(null);let l;e[0]!==o||e[1]!==s.h||e[2]!==s.w?(l=o??{w:s.w,h:s.h},e[0]=o,e[1]=s.h,e[2]=s.w,e[3]=l):l=e[3];const c=l;let m;e[4]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx("span",{className:"text-xs text-muted-foreground",children:"Size"}),e[4]=m):m=e[4];let u;e[5]!==c.h||e[6]!==c.w?(u=i.jsxs("div",{className:"mb-2 flex items-center justify-between gap-4",children:[m,i.jsxs("span",{className:"text-xs font-medium tabular-nums",children:[c.w," × ",c.h]})]}),e[5]=c.h,e[6]=c.w,e[7]=u):u=e[7];let f,p;e[8]===Symbol.for("react.memo_cache_sentinel")?(f={gridTemplateColumns:`repeat(${K}, 1.25rem)`},p=()=>d(null),e[8]=f,e[9]=p):(f=e[8],p=e[9]);let g;e[10]!==c.h||e[11]!==c.w||e[12]!==a||e[13]!==n||e[14]!==r?(g=i.jsx("div",{className:"grid w-max gap-1",style:f,onPointerLeave:p,children:Array.from({length:ii},(x,b)=>Array.from({length:K},(v,w)=>{const y=w+1,j=b+1,N=y<n||j<a,S=y<=c.w&&j<=c.h;return i.jsx("button",{type:"button",disabled:N,"aria-label":`${y} by ${j}`,onPointerEnter:()=>d({w:y,h:j}),onClick:()=>r({w:y,h:j}),className:q("size-5 rounded-sm border transition-colors",S?"border-primary bg-primary/30":"border-border bg-muted",N?"cursor-not-allowed opacity-40":"cursor-pointer hover:border-primary/60")},`${y}x${j}`)}))}),e[10]=c.h,e[11]=c.w,e[12]=a,e[13]=n,e[14]=r,e[15]=g):g=e[15];let h;return e[16]!==u||e[17]!==g?(h=i.jsxs("div",{className:"px-2 py-1.5",children:[u,g]}),e[16]=u,e[17]=g,e[18]=h):h=e[18],h}function ui(t,e,s){return t.some(r=>e>=r.x&&e<r.x+r.w&&s>=r.y&&s<r.y+r.h)}function fe(t,e,s){for(let r=0;r<100;r++)for(let n=0;n<=K-e;n++){let a=!0;for(let o=0;o<s&&a;o++)for(let d=0;d<e&&a;d++)ui(t,n+d,r+o)&&(a=!1);if(a)return{x:n,y:r}}return{x:0,y:0}}function ae(t,e,s={w:1,h:1}){const r=Math.max(s.w,Math.min(K,t)),n=Math.max(s.h,Math.min(6,e));return{w:r,h:n}}function ce(t,e,s){const r=Math.max(0,Math.min(K-s,t)),n=Math.max(0,e);return{x:r,y:n}}function fi(t,e,s){const r=t.find(l=>l.id===e);if(!r)return t;const n=t.filter(l=>l.id!==e),a=n.find(l=>s.x>=l.x&&s.x<l.x+l.w&&s.y>=l.y&&s.y<l.y+l.h);if(a&&a.w===r.w&&a.h===r.h)return t.map(l=>l.id===e?{...l,x:a.x,y:a.y}:l.id===a.id?{...l,x:r.x,y:r.y}:l);const d=[{...r,x:s.x,y:s.y}];for(const l of n){const c=fe(d,l.w,l.h);d.push({...l,x:c.x,y:c.y})}return d}function hi(t){const e=T.c(35),{layout:s,isLayoutLoading:r,commitLayout:n}=Ze();let a;e[0]!==s.hidden?(a=new Set(s.hidden),e[0]=s.hidden,e[1]=a):a=e[1];const o=a;let d,l;if(e[2]!==t||e[3]!==o||e[4]!==s.tiles){l=[];let v;e[7]!==o?(v=y=>y.pinned||!o.has(y.id),e[7]=o,e[8]=v):v=e[8];const w=t.filter(v);d=new Map;for(const y of t)y.minSize&&d.set(y.id,y.minSize);for(const y of w){const j=s.tiles[y.id];if(!j)continue;const N=d.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),{x:C,y:I}=ce(j.x,j.y,S);l.push({id:y.id,x:C,y:I,w:S,h:k,minW:N?.w,minH:N?.h})}for(const y of w){if(l.some(I=>I.id===y.id))continue;const j=y.defaultSize??ni,N=d.get(y.id),{w:S,h:k}=ae(j.w,j.h,N),C=fe(l,S,k);l.push({id:y.id,x:C.x,y:C.y,w:S,h:k,minW:N?.w,minH:N?.h})}e[2]=t,e[3]=o,e[4]=s.tiles,e[5]=d,e[6]=l}else d=e[5],l=e[6];let c;e[9]!==t?(c=new Set(t.map(pi)),e[9]=t,e[10]=c):c=e[10];const m=c;let u;e[11]!==m||e[12]!==n?(u=(v,w)=>{const y={};for(const j of v)y[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:X,tiles:y,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,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 g;e[16]!==f||e[17]!==s||e[18]!==l?(g=(v,w)=>{const y=l.find(S=>S.id===v);if(!y)return;const j=ce(w.x,w.y,y.w);if(j.x===y.x&&j.y===y.y)return;const N=fi(l,v,j);f(N,s.hidden)},e[16]=f,e[17]=s,e[18]=l,e[19]=g):g=e[19];let h;e[20]!==f||e[21]!==s||e[22]!==d||e[23]!==l?(h=(v,w)=>{const y=l.find(E=>E.id===v);if(!y)return;const j=d.get(v),{w:N,h:S}=ae(w.w,w.h,j);if(N===y.w&&S===y.h)return;const k={...y,w:N,h:S,x:ce(y.x,y.y,N).x},C=l.filter(E=>E.id!==v),I=[k];for(const E of C){const _=fe(I,E.w,E.h);I.push({...E,x:_.x,y:_.y})}f(I,s.hidden)},e[20]=f,e[21]=s,e[22]=d,e[23]=l,e[24]=h):h=e[24];let x;e[25]!==f||e[26]!==s||e[27]!==l?(x=v=>{const w=l.filter(y=>y.id!==v);f(w,Array.from(new Set([...s.hidden,v])))},e[25]=f,e[26]=s,e[27]=l,e[28]=x):x=e[28];let b;return e[29]!==r||e[30]!==p||e[31]!==g||e[32]!==h||e[33]!==x?(b={snapshot:p,isLoading:r,moveTile:g,resizeTile:h,hideTile:x},e[29]=r,e[30]=p,e[31]=g,e[32]=h,e[33]=x,e[34]=b):b=e[34],b}function pi(t){return t.id}const xi={w:2,h:4},gi={w:1,h:2},bi={w:1,h:1};function yi(t){return`prompt:${t.agentId}:${t.promptName||"blank"}`}function vi(t){return`tile:${t.agentId}:${t.resourceUri}`}function ji(t){return t.promptName?t.agentName:t.description}function wi(t){return{name:t.promptName,title:t.title,description:t.description,arguments:t.arguments,_meta:t._meta}}function ye(t){const e=T.c(10);let s;e[0]!==t?(s={agentId:t},e[0]=t,e[1]=s):s=e[1];const{start:r,startBlank:n,dialog:a,starting:o}=si(s);let d;e[2]!==r||e[3]!==n?(d=m=>{if(!m.promptName){n();return}r(wi(m))},e[2]=r,e[3]=n,e[4]=d):d=e[4];const l=d;let c;return e[5]!==a||e[6]!==l||e[7]!==n||e[8]!==o?(c={open:l,startBlank:n,dialog:a,starting:o},e[5]=a,e[6]=l,e[7]=n,e[8]=o,e[9]=c):c=e[9],c}function Ni(t){const e=T.c(32),{entry:s,isEditMode:r}=t,{open:n,dialog:a,starting:o}=ye(s.agentId);let d;e[0]!==s||e[1]!==n?(d=()=>n(s),e[0]=s,e[1]=n,e[2]=d):d=e[2];const l=o||r,c=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let f;e[3]!==c||e[4]!==m||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",c,m,u),e[3]=c,e[4]=m,e[5]=u,e[6]=f):f=e[6];let p;e[7]!==s.agentIcon||e[8]!==s.agentName?(p=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[7]=s.agentIcon,e[8]=s.agentName,e[9]=p):p=e[9];let g;e[10]!==s.title?(g=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:s.title}),e[10]=s.title,e[11]=g):g=e[11];let h;e[12]!==s?(h=ji(s),e[12]=s,e[13]=h):h=e[13];let x;e[14]!==h?(x=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:h}),e[14]=h,e[15]=x):x=e[15];let b;e[16]!==x||e[17]!==g?(b=i.jsxs("div",{className:"min-w-0 flex-1",children:[g,x]}),e[16]=x,e[17]=g,e[18]=b):b=e[18];let v;e[19]!==r?(v=!r&&i.jsx(rs,{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]=r,e[20]=v):v=e[20];let w;e[21]!==o||e[22]!==d||e[23]!==b||e[24]!==v||e[25]!==l||e[26]!==f||e[27]!==p?(w=i.jsxs("button",{type:"button",onClick:d,disabled:l,"aria-busy":o,className:f,children:[p,b,v]}),e[21]=o,e[22]=d,e[23]=b,e[24]=v,e[25]=l,e[26]=f,e[27]=p,e[28]=w):w=e[28];let y;return e[29]!==a||e[30]!==w?(y=i.jsxs(i.Fragment,{children:[w,a]}),e[29]=a,e[30]=w,e[31]=y):y=e[31],y}function Si(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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},_i)}),t[0]=e):e=t[0],e}function _i(t,e){return i.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl bg-card card-shadow px-3 py-2.5",children:[i.jsx(H,{className:"size-10 rounded-xl"}),i.jsxs("div",{className:"flex-1 space-y-1.5",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-2.5 w-1/3"})]})]},`chip-skeleton-${e}`)}function Ci(t){const e=T.c(49),{tile:s,prompts:r,isEditMode:n,tileWidth:a}=t,{org:o}=Z(),{open:d,startBlank:l,dialog:c,starting:m}=ye(s.agentId);let u,f,p,g,h;if(e[0]!==n||e[1]!==d||e[2]!==o.id||e[3]!==o.slug||e[4]!==r||e[5]!==l||e[6]!==m||e[7]!==s||e[8]!==a){const v=r.filter(ki);g="flex h-full w-full flex-col gap-3 p-3";let w;e[14]!==l?(w=()=>{l()},e[14]=l,e[15]=w):w=e[15];const y=m||n,j=n&&"pl-10 pr-10";let N;e[16]!==j?(N=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-progress disabled:opacity-60",j),e[16]=j,e[17]=N):N=e[17];let S;e[18]!==s.agentIcon||e[19]!==s.agentName?(S=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[18]=s.agentIcon,e[19]=s.agentName,e[20]=S):S=e[20];let k;e[21]!==s.agentName?(k=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[21]=s.agentName,e[22]=k):k=e[22];const C=n?"Drag to rearrange":"Open chat";let I;e[23]!==C?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:C}),e[23]=C,e[24]=I):I=e[24];let E;e[25]!==k||e[26]!==I?(E=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[k,I]}),e[25]=k,e[26]=I,e[27]=E):E=e[27],e[28]!==m||e[29]!==S||e[30]!==E||e[31]!==w||e[32]!==y||e[33]!==N?(h=i.jsxs("button",{type:"button",onClick:w,disabled:y,"aria-busy":m,className:N,children:[S,E]}),e[28]=m,e[29]=S,e[30]=E,e[31]=w,e[32]=y,e[33]=N,e[34]=h):h=e[34],u="flex min-h-0 flex-1 gap-3 overflow-hidden";let _;e[35]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Ii,{}),e[35]=_):_=e[35],e[36]!==o.id||e[37]!==o.slug||e[38]!==s?(f=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(A.Suspense,{fallback:_,children:i.jsx(Ei,{tile:s,orgId:o.id,orgSlug:o.slug})})}),e[36]=o.id,e[37]=o.slug,e[38]=s,e[39]=f):f=e[39],p=v.length>0&&!n&&a>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map($=>i.jsx("button",{type:"button",onClick:()=>d($),disabled:m,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:i.jsx("span",{className:"line-clamp-2",children:$.title})},$.promptName))}),e[0]=n,e[1]=d,e[2]=o.id,e[3]=o.slug,e[4]=r,e[5]=l,e[6]=m,e[7]=s,e[8]=a,e[9]=u,e[10]=f,e[11]=p,e[12]=g,e[13]=h}else u=e[9],f=e[10],p=e[11],g=e[12],h=e[13];let x;e[40]!==u||e[41]!==f||e[42]!==p?(x=i.jsxs("div",{className:u,children:[f,p]}),e[40]=u,e[41]=f,e[42]=p,e[43]=x):x=e[43];let b;return e[44]!==c||e[45]!==g||e[46]!==h||e[47]!==x?(b=i.jsxs("div",{className:g,children:[h,x,c]}),e[44]=c,e[45]=g,e[46]=h,e[47]=x,e[48]=b):b=e[48],b}function ki(t){return!!t.promptName}function Ei(t){const e=T.c(12),{tile:s,orgId:r,orgSlug:n}=t;let a;e[0]!==r||e[1]!==n||e[2]!==s.connectionId?(a={connectionId:s.connectionId,orgId:r,orgSlug:n},e[0]=r,e[1]=n,e[2]=s.connectionId,e[3]=a):a=e[3];const o=ee(a),d=s.minHeight??200,l=s.maxHeight??4e3;let c;return e[4]!==o||e[5]!==r||e[6]!==n||e[7]!==d||e[8]!==l||e[9]!==s.connectionId||e[10]!==s.resourceUri?(c=i.jsx(Xt,{resourceURI:s.resourceUri,orgId:r,orgSlug:n,connectionId:s.connectionId,client:o,displayMode:"fullscreen",minHeight:d,maxHeight:l,className:"h-full"}),e[4]=o,e[5]=r,e[6]=n,e[7]=d,e[8]=l,e[9]=s.connectionId,e[10]=s.resourceUri,e[11]=c):c=e[11],c}function Ii(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-4",children:[i.jsx(H,{className:"h-3 w-2/3"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"mt-1 h-full w-full rounded-md"})]}),t[0]=e):e=t[0],e}function $i(t){const e=T.c(14),{icon:s,name:r}=t;let n;e[0]!==s||e[1]!==r?(n=i.jsx(Y,{icon:s,name:r,size:"sm+"}),e[0]=s,e[1]=r,e[2]=n):n=e[2];let a;e[3]!==r?(a=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=a):a=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"Loading tile…"}),e[5]=o):o=e[5];let d;e[6]!==a?(d=i.jsxs("div",{className:"min-w-0 flex-1",children:[a,o]}),e[6]=a,e[7]=d):d=e[7];let l;e[8]!==n||e[9]!==d?(l=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,d]}),e[8]=n,e[9]=d,e[10]=l):l=e[10];let c;e[11]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsxs("div",{className:"flex flex-1 flex-col gap-2 pt-1",children:[i.jsx(H,{className:"h-3 w-3/4"}),i.jsx(H,{className:"h-3 w-1/2"}),i.jsx(H,{className:"h-3 w-2/3"})]}),e[11]=c):c=e[11];let m;return e[12]!==l?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[l,c]}),e[12]=l,e[13]=m):m=e[13],m}function Ti(t){const e=T.c(33),{tile:s,prompts:r,isEditMode:n}=t,{open:a,startBlank:o,dialog:d,starting:l}=ye(s.agentId);let c,m,u;if(e[0]!==n||e[1]!==a||e[2]!==r||e[3]!==o||e[4]!==l||e[5]!==s.agentIcon||e[6]!==s.agentName){const p=r.filter(Ai);c="flex h-full w-full flex-col gap-3 p-4";let g;e[10]!==o?(g=()=>{o()},e[10]=o,e[11]=g):g=e[11];const h=l||n,x=n&&"pl-10 pr-10";let b;e[12]!==x?(b=q("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",x),e[12]=x,e[13]=b):b=e[13];let v;e[14]!==s.agentIcon||e[15]!==s.agentName?(v=i.jsx(Y,{icon:s.agentIcon,name:s.agentName,size:"sm+"}),e[14]=s.agentIcon,e[15]=s.agentName,e[16]=v):v=e[16];let w;e[17]!==s.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:s.agentName}),e[17]=s.agentName,e[18]=w):w=e[18];let y;e[19]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=y):y=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,y]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==g||e[24]!==h||e[25]!==b||e[26]!==v?(m=i.jsxs("button",{type:"button",onClick:g,disabled:h,className:b,children:[v,j]}),e[22]=j,e[23]=g,e[24]=h,e[25]=b,e[26]=v,e[27]=m):m=e[27],u=p.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:p.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&a(N),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:i.jsx("span",{className:"line-clamp-2",children:N.title})},N.promptName))}),e[0]=n,e[1]=a,e[2]=r,e[3]=o,e[4]=l,e[5]=s.agentIcon,e[6]=s.agentName,e[7]=c,e[8]=m,e[9]=u}else c=e[7],m=e[8],u=e[9];let f;return e[28]!==d||e[29]!==c||e[30]!==m||e[31]!==u?(f=i.jsxs("div",{className:c,children:[m,u,d]}),e[28]=d,e[29]=c,e[30]=m,e[31]=u,e[32]=f):f=e[32],f}function Ai(t){return!!t.promptName}function Je(t){const e=T.c(36),{isEditMode:s}=t,{org:r}=Z(),{isLoading:n,prompts:a,tiles:o}=be(r.slug),d=Pe()?.ids??[];let l;e[0]!==d?(l=new Set(d),e[0]=d,e[1]=l):l=e[1];const c=l,m=De();let u;e[2]!==o?(u=new Set(o.map(Pi)),e[2]=o,e[3]=u):u=e[3];const f=u;let p;if(e[4]!==a){p=new Map;for(const _ of a){const $=p.get(_.agentId);$?$.push(_):p.set(_.agentId,[_])}e[4]=a,e[5]=p}else p=e[5];let g;if(e[6]!==a||e[7]!==f||e[8]!==o){let _;e[10]!==f?(_=O=>!f.has(O.agentId),e[10]=f,e[11]=_):_=e[11];const $=a.filter(_);g=[...o.map(zi),...$.map(Ri)],e[6]=a,e[7]=f,e[8]=o,e[9]=g}else g=e[9];const h=g;let x;e[12]!==h?(x=new Map(h.map(Oi)),e[12]=h,e[13]=x):x=e[13];const b=x;let v;e[14]!==h||e[15]!==c?(v=h.map(_=>({id:_.id,defaultSize:_.kind==="tile"?xi:bi,minSize:_.kind==="tile"?gi:void 0,pinned:c.has(_.data.agentId)})),e[14]=h,e[15]=c,e[16]=v):v=e[16];const w=hi(v);let y;e[17]!==m?(y=_=>{m.apply($=>$.filter(O=>O!==_)).catch(Mi)},e[17]=m,e[18]=y):y=e[18];const j=y;let N;e[19]!==b||e[20]!==w||e[21]!==c||e[22]!==j?(N=_=>{const $=b.get(_);$&&c.has($.data.agentId)?j($.data.agentId):w.hideTile(_)},e[19]=b,e[20]=w,e[21]=c,e[22]=j,e[23]=N):N=e[23];const S=N;let k;e[24]!==b||e[25]!==s||e[26]!==p?(k=_=>{const $=b.get(_.id);if(!$)return null;if($.kind==="tile"){const O=p.get($.data.agentId)??[];return i.jsx(ft,{fallback:i.jsx(Ti,{tile:$.data,prompts:O,isEditMode:s}),children:i.jsx(A.Suspense,{fallback:i.jsx($i,{icon:$.data.agentIcon,name:$.data.agentName}),children:i.jsx(Ci,{tile:$.data,prompts:O,isEditMode:s,tileWidth:_.w})})})}return i.jsx(Ni,{entry:$.data,isEditMode:s})},e[24]=b,e[25]=s,e[26]=p,e[27]=k):k=e[27];const C=k;if(n||w.isLoading){let _;return e[28]===Symbol.for("react.memo_cache_sentinel")?(_=i.jsx(Si,{}),e[28]=_):_=e[28],_}if(w.snapshot.visible.length===0&&!s)return null;let E;return e[29]!==s||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==S||e[34]!==C?(E=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ri,{tiles:w.snapshot.visible,isEditMode:s,renderTile:C,onMove:w.moveTile,onResize:w.resizeTile,onRemove:S})}),e[29]=s,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=S,e[34]=C,e[35]=E):E=e[35],E}function Mi(){return W.error("Couldn't remove from home — please try again.")}function Oi(t){return[t.id,t]}function Ri(t){return{kind:"prompt",id:yi(t),data:t}}function zi(t){return{kind:"tile",id:vi(t),data:t}}function Pi(t){return t.agentId}function Di(t){const e=T.c(2),{prompts:s,tiles:r}=be(t),n=r.length>0||s.length>0;let a;return e[0]!==n?(a={hasVisibleTiles:n},e[0]=n,e[1]=a):a=e[1],a}const Ce=420,ke=305;function Xe(){const t=T.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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:Ce}}),t[0]=e):e=t[0];let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.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:Ce}}),t[1]=s):s=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=i.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:ke}}),t[2]=r):r=t[2];let n;return t[3]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden",children:[e,s,r,i.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:ke}})]}),t[3]=n):n=t[3],n}function Ee(){const t=T.c(33),{data:e}=ht.useSession(),{org:s}=Z(),r=xe(),n=It(),{selectedVirtualMcp:a}=$t();let o;t[0]!==s.id?(o=xt(s.id),t[0]=s.id,t[1]=o):o=t[1];const l=a??o;let c;t[2]!==s.slug?(c=Ft(s.slug),t[2]=s.slug,t[3]=c):c=t[3],oe(c);let m;t[4]!==s.id||t[5]!==s.slug?(m={connectionId:Te,orgId:s.id,orgSlug:s.slug},t[4]=s.id,t[5]=s.slug,t[6]=m):m=t[6];const u=ee(m);let f;t[7]!==s.id||t[8]!==u?(f=ps(u,s.id),t[7]=s.id,t[8]=u,t[9]=f):f=t[9];let p;t[10]!==s.id||t[11]!==u?(p=Ut(u,s.id),t[10]=s.id,t[11]=u,t[12]=p):p=t[12];let g;t[13]!==l.id||t[14]!==s.id||t[15]!==u?(g=yt(s.id,l.id,u),t[13]=l.id,t[14]=s.id,t[15]=u,t[16]=g):g=t[16];let h;t[17]!==f||t[18]!==p||t[19]!==g?(h={queries:[f,p,g]},t[17]=f,t[18]=p,t[19]=g,t[20]=h):h=t[20],js(h);const x=xs(),b=vt(l.id),{hasDecoKey:v,isZeroBalance:w,isInitialFreeCredit:y,balanceDollars:j,hasOnlyDecoProvider:N}=Ct(),{hasVisibleTiles:S}=Di(s.slug),k=kt(b?.metadata);if(x.length===0&&!(k&&Et(n))){let P;return t[21]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"min-h-full flex items-center justify-center px-4 py-10",children:i.jsx(Tt,{})})}),t[21]=P):P=t[21],P}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 E=I,_=v&&y&&j!=null,$=v&&w&&N;let O;t[24]!==j||t[25]!==_||t[26]!==$?(O=_?i.jsx(ie.CreditsEyebrow,{balanceDollars:j}):$?i.jsx(ie.NoCreditsEyebrow,{}):null,t[24]=j,t[25]=_,t[26]=$,t[27]=O):O=t[27];const B=O;let z;return t[28]!==B||t[29]!==S||t[30]!==r||t[31]!==E?(z=i.jsx(ti,{children:r?i.jsx(Hi,{eyebrow:B,userName:E}):i.jsx(Li,{eyebrow:B,userName:E,hasVisibleTiles:S})}),t[28]=B,t[29]=S,t[30]=r,t[31]=E,t[32]=z):z=t[32],z}function Hi(t){const e=T.c(12),{eyebrow:s,userName:r}=t;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(Xe,{}),e[0]=n):n=e[0];let a;e[1]!==s?(a=s&&i.jsx("div",{className:"mb-4",children:s}),e[1]=s,e[2]=a):a=e[2];let o;e[3]!==r?(o=i.jsxs("p",{className:"text-3xl font-medium text-foreground text-center max-w-[280px]",children:["What's on your mind, ",r,"?"]}),e[3]=r,e[4]=o):o=e[4];let d;e[5]!==a||e[6]!==o?(d=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[a,o]}),e[5]=a,e[6]=o,e[7]=d):d=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ie.Input,{showConnectionsBanner:!0})}),e[8]=l):l=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(Je,{isEditMode:!1})}),e[9]=c):c=e[9];let m;return e[10]!==d?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,d,l,c]}),e[10]=d,e[11]=m):m=e[11],m}function Li(t){const e=T.c(32),{eyebrow:s,userName:r,hasVisibleTiles:n}=t,{isEditMode:a,enter:o,save:d,cancel:l,hasChanges:c}=Ze(),[m,u]=A.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]!==o||e[3]!==c||e[4]!==a||e[5]!==d?(p=i.jsx(gs.Right,{children:i.jsx(Ui,{isEditMode:a,hasChanges:c,onEnter:o,onSave:d,onCancel:l,onAddTile:f})}),e[1]=l,e[2]=o,e[3]=c,e[4]=a,e[5]=d,e[6]=p):p=e[6];let g;e[7]!==m?(g=i.jsx(ws,{open:m,onOpenChange:u}),e[7]=m,e[8]=g):g=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(Xe,{}),e[9]=h):h=e[9];const x=n||a?"pt-32":"flex-1 justify-center";let b;e[10]!==x?(b=q("relative flex flex-col items-center px-10 pb-4",x),e[10]=x,e[11]=b):b=e[11];let v;e[12]!==s?(v=s&&i.jsx("div",{className:"mb-4",children:s}),e[12]=s,e[13]=v):v=e[13];let w;e[14]!==r?(w=i.jsxs("p",{className:"text-3xl font-medium text-foreground",children:["What's on your mind, ",r,"?"]}),e[14]=r,e[15]=w):w=e[15];let y;e[16]!==v||e[17]!==w?(y=i.jsxs("div",{className:"text-center mb-10",children:[v,w]}),e[16]=v,e[17]=w,e[18]=y):y=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Bi,{}),i.jsx(ie.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==y?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[y,j]}),e[20]=y,e[21]=N):N=e[21];let S;e[22]!==a?(S=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(Je,{isEditMode:a})}),e[22]=a,e[23]=S):S=e[23];let k;e[24]!==N||e[25]!==S||e[26]!==b?(k=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[h,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:b,children:[N,S]})})]}),e[24]=N,e[25]=S,e[26]=b,e[27]=k):k=e[27];let C;return e[28]!==k||e[29]!==p||e[30]!==g?(C=i.jsxs(i.Fragment,{children:[p,g,k]}),e[28]=k,e[29]=p,e[30]=g,e[31]=C):C=e[31],C}function Ui(t){const e=T.c(17),{isEditMode:s,hasChanges:r,onEnter:n,onSave:a,onCancel:o,onAddTile:d}=t;if(s){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(ge,{size:14}),e[0]=m):m=e[0];let u;e[1]!==d?(u=i.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:[m,"Add tile"]}),e[1]=d,e[2]=u):u=e[2];let f;e[3]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Ae,{size:14}),e[3]=f):f=e[3];let p;e[4]!==o?(p=i.jsxs(je,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[f,"Cancel"]}),e[4]=o,e[5]=p):p=e[5];const g=!r;let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=i.jsx(jt,{size:14}),e[6]=h):h=e[6];let x;e[7]!==a||e[8]!==g?(x=i.jsxs(je,{size:"sm",onClick:a,disabled:g,className:"gap-1.5 h-7 text-xs",children:[h,"Save"]}),e[7]=a,e[8]=g,e[9]=x):x=e[9];let b;return e[10]!==u||e[11]!==p||e[12]!==x?(b=i.jsxs(i.Fragment,{children:[u,p,x]}),e[10]=u,e[11]=p,e[12]=x,e[13]=b):b=e[13],b}let l;e[14]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(_t,{size:14}),e[14]=l):l=e[14];let c;return e[15]!==n?(c=i.jsxs("button",{type:"button",onClick:n,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]=n,e[16]=c):c=e[16],c}function Bi(){const t=T.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.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 Vr(){const t=T.c(2);if(xe()){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx("div",{className:"flex-1 min-h-0 flex flex-col bg-background overflow-hidden",children:i.jsx(Ee,{})}),t[0]=r):r=t[0],r}let s;return t[1]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"flex-1 min-h-0 pb-1 pr-1 pl-0 pt-0",children:i.jsx("div",{className:"h-full p-0.5 pt-0.25",children:i.jsx("div",{className:"flex flex-col h-full bg-background overflow-hidden card-shadow rounded-[0.75rem]",children:i.jsx(Ee,{})})})}),t[1]=s):s=t[1],s}export{Vr as default};
|