decocms 3.5.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-PL6o_BFM.js → AlertCircle-BbgiP1ZV.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-D0PaRtUX.js → ArrowUpRight-CR0tLc1r.js} +1 -1
- package/dist/client/assets/{Check-7lFZ8X77.js → Check-GuOoujc1.js} +1 -1
- package/dist/client/assets/{CheckCircle-Bjdxpj1j.js → CheckCircle-CIGG2Fks.js} +1 -1
- package/dist/client/assets/{ChevronDown-DBeUwQYn.js → ChevronDown-BQC7gd1Z.js} +1 -1
- package/dist/client/assets/{ChevronLeft-CPLLwlIr.js → ChevronLeft-DcquQFQv.js} +1 -1
- package/dist/client/assets/{ChevronRight-BVo14pyp.js → ChevronRight-u62q_EJA.js} +1 -1
- package/dist/client/assets/{ChevronUp-XvIiv-NV.js → ChevronUp-CEc_wZlC.js} +1 -1
- package/dist/client/assets/{Container-BoahFo7F.js → Container-BQ_ppInl.js} +1 -1
- package/dist/client/assets/{DotsVertical-ntZiwo0t.js → DotsVertical-BTb3OQch.js} +1 -1
- package/dist/client/assets/{Eye-DkuHnUAW.js → Eye-BvtzK_ld.js} +1 -1
- package/dist/client/assets/{FilterLines-DgBfCVyf.js → FilterLines-Ds07i1jJ.js} +1 -1
- package/dist/client/assets/{Globe01-CcGroxBm.js → Globe01-BDzEUH0y.js} +1 -1
- package/dist/client/assets/{HardDrive-C4j857Fq.js → HardDrive-B4XU4Plg.js} +1 -1
- package/dist/client/assets/{Key01-o0EwVLiR.js → Key01-CAz3yDJD.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CD_Gf1ZP.js → LayoutLeft-BLpDarKX.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BrUoXKJY.js → LinkExternal01-kcZAuVDT.js} +1 -1
- package/dist/client/assets/{Monitor01-D61B3ma3.js → Monitor01-CNFzHcoX.js} +1 -1
- package/dist/client/assets/{Palette-CrqqEUcE.js → Palette-CU3snEKc.js} +1 -1
- package/dist/client/assets/{Play-UJPgqc1U.js → Play-RtGFVpVA.js} +1 -1
- package/dist/client/assets/{Plus-Tnr53r7A.js → Plus-ohuOGrjV.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-Cv0pFCb4.js → RefreshCcw01-BW7QLN6f.js} +1 -1
- package/dist/client/assets/{SearchMd-UxzEV07r.js → SearchMd-BLv-HtMf.js} +1 -1
- package/dist/client/assets/{Settings02-DhqQsm8K.js → Settings02-Bmu7Y-K1.js} +1 -1
- package/dist/client/assets/{Shield01-DpLC5M3q.js → Shield01-BuSsO9Yy.js} +1 -1
- package/dist/client/assets/{Star01-sX328yCS.js → Star01-C5-avyqJ.js} +1 -1
- package/dist/client/assets/{Stars01-Dv9c4Cee.js → Stars01-DAQzL-cd.js} +1 -1
- package/dist/client/assets/{Stars02-f0XE-eqW.js → Stars02-CXyi_Vew.js} +1 -1
- package/dist/client/assets/{Sun-PyN_Wt4r.js → Sun-CcDK3tqG.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B9vZRv9t.js → SwitchHorizontal01-D0Xml2F9.js} +1 -1
- package/dist/client/assets/{Tool01-yp4kJRUu.js → Tool01-gkJ10CSc.js} +1 -1
- package/dist/client/assets/{Trash01-CZeQBZf_.js → Trash01-CxZaXkEG.js} +1 -1
- package/dist/client/assets/{Upload01-SHM-fhC7.js → Upload01-w5N1KkCJ.js} +1 -1
- package/dist/client/assets/{User01-DW9hMolk.js → User01-BPdUBEwh.js} +1 -1
- package/dist/client/assets/{Users01-D2wb7idE.js → Users01-N-UWwsUE.js} +1 -1
- package/dist/client/assets/{Users03-DbJl-FlT.js → Users03-BLiTdp6b.js} +1 -1
- package/dist/client/assets/{X-BH0VE8jB.js → X-CXuIiJcM.js} +1 -1
- package/dist/client/assets/{XCircle-DLzFRLwJ.js → XCircle-FR2hulWg.js} +1 -1
- package/dist/client/assets/{XClose-DNgFZbzC.js → XClose-5pjo9DDH.js} +1 -1
- package/dist/client/assets/{Zap-DplWtEq0.js → Zap-BZFCxgr7.js} +1 -1
- package/dist/client/assets/{ZapSquare-xDebNl-H.js → ZapSquare-C82pexYy.js} +1 -1
- package/dist/client/assets/{ZoomOut-CrlW2TUB.js → ZoomOut-BVEe82yV.js} +1 -1
- package/dist/client/assets/{access-gate-BwTL-vjj.js → access-gate-BKPvQrmd.js} +1 -1
- package/dist/client/assets/{accordion-BTEQZzrz.js → accordion-DmYaPIns.js} +1 -1
- package/dist/client/assets/{add-section-modal-DACQp29A.js → add-section-modal-D7ll-KnE.js} +1 -1
- package/dist/client/assets/{agent-capabilities-BPmYbqGN.js → agent-capabilities-Du9p4iX1.js} +1 -1
- package/dist/client/assets/{agent-icon-BzrzSnAz.js → agent-icon-CcAfypno.js} +1 -1
- package/dist/client/assets/{agent-icons-Cd0vLj6N.js → agent-icons-DyOcbxHL.js} +1 -1
- package/dist/client/assets/{agents-list-C6qqAI5_.js → agents-list-B3ESdq3t.js} +1 -1
- package/dist/client/assets/{ai-providers-kZI6pudu.js → ai-providers-B-dWFaD8.js} +1 -1
- package/dist/client/assets/{alert-CHelH7PN.js → alert-D2p5g1SE.js} +1 -1
- package/dist/client/assets/{alert-dialog-D0lyxgq7.js → alert-dialog-BH-qRmgo.js} +1 -1
- package/dist/client/assets/app-editor-DE7Fyvo6.js +1 -0
- package/dist/client/assets/{auth-catchall-eEEVSQiw.js → auth-catchall-66Weomq9.js} +1 -1
- package/dist/client/assets/{auth-split-layout-J4nbOqGk.js → auth-split-layout-7E-EPG-4.js} +1 -1
- package/dist/client/assets/{automation-list-row-qYSYtkIF.js → automation-list-row-B2-9YDik.js} +1 -1
- package/dist/client/assets/{automation-runs-C4iv4rJG.js → automation-runs-DvOvsJey.js} +1 -1
- package/dist/client/assets/{automations-BBsp-bnq.js → automations-CRD0WwXZ.js} +1 -1
- package/dist/client/assets/{avatar-dR7ViKE5.js → avatar-BLLSVymV.js} +1 -1
- package/dist/client/assets/{badge-REAPd24g.js → badge-CD_sxtRd.js} +1 -1
- package/dist/client/assets/{brand-context-DKgMKp8i.js → brand-context-_ATPhSUJ.js} +1 -1
- package/dist/client/assets/{buckets-CAG2foTd.js → buckets-Aqqe8LdA.js} +1 -1
- package/dist/client/assets/{calendar-C4DQ4fqJ.js → calendar-q7aPALld.js} +1 -1
- package/dist/client/assets/{capability-load-error-BiSiPTFT.js → capability-load-error-BZEvxpD7.js} +1 -1
- package/dist/client/assets/{card-DjJMgfjm.js → card-CQgg2XSv.js} +1 -1
- package/dist/client/assets/{chat-context-dBrooU1v.js → chat-context-D1iCjJx_.js} +1 -1
- package/dist/client/assets/{checkbox-DLgoLQSR.js → checkbox-CE0XyOMB.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Cf1STb5K.js → cli-auth-success-lMBSLhA_.js} +1 -1
- package/dist/client/assets/{collection-detail-BGZmeA1k.js → collection-detail-DxUC3btv.js} +1 -1
- package/dist/client/assets/{collection-display-button-DLtr23Rv.js → collection-display-button-C4AnEyza.js} +1 -1
- package/dist/client/assets/{collection-search-DYrAflR5.js → collection-search-Bccogvwl.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BZmV-NZH.js → collection-table-wrapper-Dru1DOFX.js} +1 -1
- package/dist/client/assets/{collection-tabs-Y_drDohR.js → collection-tabs-BAv--h4c.js} +1 -1
- package/dist/client/assets/{collections-UXWGkaFt.js → collections-CjhflW7H.js} +1 -1
- package/dist/client/assets/{command-VnXMa00z.js → command-DsVZEy4X.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-VMfxWtQ-.js → connect-desktop-dialog-BemwAUFq.js} +1 -1
- package/dist/client/assets/{connection-card-DK49rHkZ.js → connection-card-P5iTsEt_.js} +1 -1
- package/dist/client/assets/{connection-detail-DzUm5yVg.js → connection-detail-1EWWQH2b.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BSgnmPKP.js → connection-form-helpers-d0Qv3Dr_.js} +1 -1
- package/dist/client/assets/{connections-Bh992QKN.js → connections-DFNab9-6.js} +1 -1
- package/dist/client/assets/{constants-B521j7ay.js → constants-CTy7Z7Cr.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-D4rmdWQS.js → decopilot-sse-pool-F3lBB1Vq.js} +1 -1
- package/dist/client/assets/{dialog-DqPItn-g.js → dialog-D_sGNO5l.js} +1 -1
- package/dist/client/assets/{domain-settings-BXCL_xbf.js → domain-settings-C6Pi9nLR.js} +1 -1
- package/dist/client/assets/{drawer-CPIIyCcW.js → drawer-D115cuKM.js} +1 -1
- package/dist/client/assets/{dropdown-menu-2uydtPAy.js → dropdown-menu-Ck1AdglA.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-RNpkQxgu.js → dynamic-plugin-layout-BGpV-Yc9.js} +1 -1
- package/dist/client/assets/{empty-state-DLBfWl6Y.js → empty-state-BRERdsGC.js} +1 -1
- package/dist/client/assets/{empty-state-BLunjf1m.js → empty-state-D9Sh56WT.js} +1 -1
- package/dist/client/assets/{extract-connection-data-aP9VrOhv.js → extract-connection-data-BMBZo6v1.js} +1 -1
- package/dist/client/assets/{features-CA4znDNw.js → features-DirOJVyK.js} +1 -1
- package/dist/client/assets/{file-explorer-aonQXi96.js → file-explorer-DlbvIyUu.js} +1 -1
- package/dist/client/assets/{file-type-icon-CqbDePIX.js → file-type-icon-Cr5daaKU.js} +1 -1
- package/dist/client/assets/{files-d-57Qs8I.js → files-YXMjCN1s.js} +1 -1
- package/dist/client/assets/{form-BIWGXIbK.js → form-Dlwu2Vxh.js} +1 -1
- package/dist/client/assets/{general-CXp3pwbL.js → general-CiyyHPn8.js} +1 -1
- package/dist/client/assets/{generate-id-CdwRTiX7.js → generate-id-BhSFOcj8.js} +1 -1
- package/dist/client/assets/{github-repo-picker-Bu6oV3t1.js → github-repo-picker-CeMHMi-C.js} +1 -1
- package/dist/client/assets/{header-tab-button-Btqu8vce.js → header-tab-button-J53bKr6U.js} +1 -1
- package/dist/client/assets/{hover-card-reOs8OTf.js → hover-card-DQIRzcNB.js} +1 -1
- package/dist/client/assets/{image-field-DoQO0nqy.js → image-field-DkDiZxCe.js} +1 -1
- package/dist/client/assets/{index-_FSABeX9.js → index-2caNfPRd.js} +1 -1
- package/dist/client/assets/{index-C1MLUCFq.js → index-7oR89pOf.js} +1 -1
- package/dist/client/assets/{index-FhXRIQKJ.js → index-B5F4ZjnC.js} +1 -1
- package/dist/client/assets/{index-D8H8ytWG.js → index-BUy8su7z.js} +4 -4
- package/dist/client/assets/{index-DElKj3LD.js → index-Ba7zWZQz.js} +1 -1
- package/dist/client/assets/{index-CM0AvljI.js → index-Bch6Kjj7.js} +1 -1
- package/dist/client/assets/{index-DVHW5IXE.js → index-BcxwwiTx.js} +1 -1
- package/dist/client/assets/{index-C4HbvW_W.js → index-BndwjqHd.js} +3 -3
- package/dist/client/assets/{index-xesYw4pg.js → index-C1oDxcmL.js} +1 -1
- package/dist/client/assets/{index-CuEl7ZCd.js → index-D9QAOChZ.js} +1 -1
- package/dist/client/assets/{index-BYSwFuRs.js → index-DG72ZvsU.js} +1 -1
- package/dist/client/assets/{index-WNtnEHJ2.js → index-Do-z4tjh.js} +1 -1
- package/dist/client/assets/{index-CgoPiptB.js → index-TOL4L9fz.js} +1 -1
- package/dist/client/assets/{index-redirect-3tS7mNzU.js → index-redirect-DZSU_Qic.js} +1 -1
- package/dist/client/assets/{index-BIMoUWYp.js → index-tyLS2nX3.js} +1 -1
- package/dist/client/assets/{index-2xBvfJLJ.js → index-wkya9v5f.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-IbMlOZg5.js → infiniteQueryObserver-BHbqpbmn.js} +1 -1
- package/dist/client/assets/{input-B5k-Hbp3.js → input-CBDbBFOx.js} +1 -1
- package/dist/client/assets/{integration-icon-C7p8BtkI.js → integration-icon-EtDsLgsf.js} +1 -1
- package/dist/client/assets/{label-BvvzAAWu.js → label-Cgk_AkFe.js} +1 -1
- package/dist/client/assets/{layout-BMq59AVz.js → layout-CWY08LF_.js} +1 -1
- package/dist/client/assets/{login-BIU3L6eK.js → login-B_7DfniG.js} +1 -1
- package/dist/client/assets/{members-DGFZlZSL.js → members-C2z1GXJM.js} +1 -1
- package/dist/client/assets/{monaco-editor-ByT33GfF.js → monaco-editor-CCc0I3Tc.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-VdVj1bTz.js → monitoring-stats-row-BV3_mbP_.js} +1 -1
- package/dist/client/assets/{oauth-callback-C1JOUQQn.js → oauth-callback-9Po7ijhq.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CUbQRMCQ.js → oauth-callback-ai-provider-BKFDlU_Y.js} +1 -1
- package/dist/client/assets/{onboarding-CY5W5FNv.js → onboarding-BGdXk2IQ.js} +1 -1
- package/dist/client/assets/{org-install-DLtxfbHw.js → org-install-DJhyXL5L.js} +1 -1
- package/dist/client/assets/{org-layout-BqXWDd1-.js → org-layout-8kMA_jay.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-CbMQy1Lw.js → org-plugin-layout-gRpCNt-0.js} +1 -1
- package/dist/client/assets/{page-seo-form-BmCl6Xlh.js → page-seo-form-P_luAhEo.js} +1 -1
- package/dist/client/assets/page-seo-sheet-Bo1VXVD0.js +1 -0
- package/dist/client/assets/{pair-Bhj3cOFh.js → pair-BUW3N_E1.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-dJCoaDDO.js → plugin-empty-state-Bj9o6KVV.js} +1 -1
- package/dist/client/assets/{plugin-header-BmoMpOXz.js → plugin-header-Bpc0e6a1.js} +1 -1
- package/dist/client/assets/{plugin-layout-BR81jn44.js → plugin-layout-DNpD8KxV.js} +1 -1
- package/dist/client/assets/{popover-CFPzrMHB.js → popover-Ctq4Kzc9.js} +1 -1
- package/dist/client/assets/{post-editor-GGFyFznW.js → post-editor-f_DCTeob.js} +1 -1
- package/dist/client/assets/{primitives-DYqJBFCL.js → primitives-BQ9fTeMd.js} +1 -1
- package/dist/client/assets/{profile-Cfmj1cf7.js → profile-DXRkTLDh.js} +1 -1
- package/dist/client/assets/project-app-view-Crk4wit3.js +1 -0
- package/dist/client/assets/record-editor-CBB_w8UI.js +1 -0
- package/dist/client/assets/registry-D97jgeuM.js +2 -0
- package/dist/client/assets/{registry-layout-BIYEFhu4.js → registry-layout-CtfXaH8L.js} +1 -1
- package/dist/client/assets/{require-capability-OYQug4J7.js → require-capability-CkcV9JGq.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Bcp4IxxD.js → required-auth-layout-D6rmft5v.js} +1 -1
- package/dist/client/assets/{reset-password-suzhQWSU.js → reset-password-EGh3BxSR.js} +1 -1
- package/dist/client/assets/{resizable-IfVaIg_U.js → resizable-Cz2aMni5.js} +1 -1
- package/dist/client/assets/{roles-BPJBENaC.js → roles-DS3HuVtS.js} +1 -1
- package/dist/client/assets/{save-status-BxvWi0ix.js → save-status-hhIW0-bV.js} +1 -1
- package/dist/client/assets/{schema-form-DbvvSf_B.js → schema-form-ggq_Ssjy.js} +1 -1
- package/dist/client/assets/{scroll-area-DYzEAvWY.js → scroll-area-wuYeScN9.js} +1 -1
- package/dist/client/assets/{search-input-BMW004dV.js → search-input-Blw6V8aa.js} +1 -1
- package/dist/client/assets/{secrets-Bv4krrbm.js → secrets-lhfOhn4a.js} +1 -1
- package/dist/client/assets/{sections-editor-tHHOdLOL.js → sections-editor-veuICziU.js} +1 -1
- package/dist/client/assets/{select-DPygLpWH.js → select-_pE1qLfW.js} +1 -1
- package/dist/client/assets/{select-model-BS2yzBPq.js → select-model-BrrpQMv6.js} +1 -1
- package/dist/client/assets/{seo-editor-CCPmPYRi.js → seo-editor-Bz0rldlG.js} +1 -1
- package/dist/client/assets/{settings-layout-BV_kMffR.js → settings-layout-CoSGmRxV.js} +1 -1
- package/dist/client/assets/{settings-section-C7gs1p6F.js → settings-section-B_xBQiYF.js} +1 -1
- package/dist/client/assets/{sheet-D9aXq4ta.js → sheet-Di1cASFY.js} +1 -1
- package/dist/client/assets/{shell-controls-C56-Ps3x.js → shell-controls-DNGwkOVN.js} +1 -1
- package/dist/client/assets/{shell-layout-tWuhPjHz.js → shell-layout-Bp6FCKs1.js} +1 -1
- package/dist/client/assets/{shell-route-loading-Cy1LF1Kf.js → shell-route-loading-CVHnJFsX.js} +1 -1
- package/dist/client/assets/{sidebar-DB4iKQD5.js → sidebar-rU6airjG.js} +1 -1
- package/dist/client/assets/{skeleton-DH0H1fU3.js → skeleton-C5dk7YCz.js} +1 -1
- package/dist/client/assets/{sortable.esm-BKA03RQh.js → sortable.esm-tnz_NBW4.js} +1 -1
- package/dist/client/assets/{spinner-C0Im7y7X.js → spinner-D_I4Dd9a.js} +1 -1
- package/dist/client/assets/{sso-BYfRBv2e.js → sso-jQ5GAdJz.js} +1 -1
- package/dist/client/assets/{store-Cyr13yyM.js → store-CLsZ0tgl.js} +1 -1
- package/dist/client/assets/store-registry-BuOISTSU.js +2 -0
- package/dist/client/assets/{switch-BGtkcqu8.js → switch-RUCZ8mus.js} +1 -1
- package/dist/client/assets/{tab-id-B1KAdtlk.js → tab-id-DMzVkzCq.js} +1 -1
- package/dist/client/assets/{table-B34ZqNGn.js → table-Cxh6qgpR.js} +1 -1
- package/dist/client/assets/{tabs-52tGcLiU.js → tabs-BNP_i7Rf.js} +1 -1
- package/dist/client/assets/{task-status-Dq99ypn5.js → task-status-B_4gd99h.js} +1 -1
- package/dist/client/assets/{textarea-BnccT-U9.js → textarea-cejfxfYp.js} +1 -1
- package/dist/client/assets/{toggle-group-E6TPCKmI.js → toggle-group-B_44Db0Z.js} +1 -1
- package/dist/client/assets/{toolbar-B-Xmvyb0.js → toolbar-Bisx725E.js} +1 -1
- package/dist/client/assets/{tools-list-CZ0YST_J.js → tools-list-BQ5dyCzW.js} +1 -1
- package/dist/client/assets/{tooltip-DgiqborV.js → tooltip-CtCPgfHv.js} +1 -1
- package/dist/client/assets/{types-DP-Q3z5y.js → types-BTI4XrPl.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B_aWh-J8.js → use-ai-providers-BHt3xY1J.js} +1 -1
- package/dist/client/assets/{use-automations-CQqGzVrP.js → use-automations-CmN23pxu.js} +1 -1
- package/dist/client/assets/{use-capability-CzlbJT0x.js → use-capability-BNtHCVWj.js} +1 -1
- package/dist/client/assets/{use-collections-CFs8myDl.js → use-collections-DgAfwA2E.js} +1 -1
- package/dist/client/assets/{use-connection-DjURtMK5.js → use-connection-G2gCjYsj.js} +1 -1
- package/dist/client/assets/{use-copy-CKGAQPRW.js → use-copy-DGt-nJD_.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-GqhamUF-.js → use-create-virtual-mcp-bRq_Y6_a.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-iWsKgUnH.js → use-debounced-autosave-CYqI9G4K.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CjdkJ1LG.js → use-delete-connection-BhzvPTl7.js} +1 -1
- package/dist/client/assets/{use-file-configs-DD5bg8yH.js → use-file-configs-C6-LzieN.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Bo7I5Z4-.js → use-infinite-scroll-J8G13yDh.js} +1 -1
- package/dist/client/assets/{use-list-state-BxpSC3kw.js → use-list-state-BoJ2NBCR.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BNFsBgD1.js → use-mcp-prompts-Cod5Eh_M.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DCbS4kMk.js → use-mcp-tools-DU65gmiP.js} +1 -1
- package/dist/client/assets/{use-members-DZ4oSOx-.js → use-members-HAjD7HOp.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DwD_R1XG.js → use-navigate-to-agent-Bb-pqH3o.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-v3u1LDk5.js → use-org-auth-client-CPFo1ioz.js} +1 -1
- package/dist/client/assets/{use-org-sso-Ck4B3T6D.js → use-org-sso-D10Yc5vA.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BIilFNn5.js → use-organization-roles-CVov8kdC.js} +1 -1
- package/dist/client/assets/{use-organization-settings-difToZl3.js → use-organization-settings-C0N0CGyM.js} +1 -1
- package/dist/client/assets/{use-registry-connections-KEGYdtt_.js → use-registry-connections-DqmrKdG3.js} +1 -1
- package/dist/client/assets/{use-secrets-DHcsXoUs.js → use-secrets-DnC7kZ6l.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CPmXHEGX.js → use-status-sounds-E6kLXkGy.js} +1 -1
- package/dist/client/assets/{use-view-mode-Bq2h-mAH.js → use-view-mode-DRk9o2ek.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-By6PZUzg.js → use-virtual-mcp-bNdj_jBM.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BoQM2LBe.js +1 -0
- package/dist/client/assets/{useRouterState-BBlCl4XE.js → useRouterState-D1tQIUkv.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DyfJnAzO.js +1 -0
- package/dist/client/assets/{user-CBbH_JeB.js → user-Bi2GmAF1.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-B0_LJI8Z.js → view-mode-toggle-DFIjJdB6.js} +1 -1
- package/dist/client/assets/{workflow-Ce5v7OlY.js → workflow-BMrr0wfo.js} +1 -1
- package/dist/client/assets/workflow-detail-PMy6kSvV.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +427 -427
- package/dist/server/server.js +287 -287
- package/package.json +1 -1
- package/dist/client/assets/app-editor-BEzuyKZz.js +0 -1
- package/dist/client/assets/page-seo-sheet-Ced60-cr.js +0 -1
- package/dist/client/assets/project-app-view-eVezvxZo.js +0 -1
- package/dist/client/assets/record-editor-52XgVwcw.js +0 -1
- package/dist/client/assets/registry-CiIpQiyq.js +0 -2
- package/dist/client/assets/store-registry-DIjY8LQB.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BkurBcOt.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C21DKA3_.js +0 -1
- package/dist/client/assets/workflow-detail-CMT7JAKv.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aq as st,ar as me,as as it,at as nt,au as Ae,F as pe,av as rt,aw as ot,r as L,ax as lt,ay as at,az as ct,aA as dt,aB as je,aC as mt,aD as ut,aE as ft,e as $,j as i,q as V,c as K,l as Me,aF as xe,o as W,K as oe,n as le,a as ht,v as pt,E as xt,b as gt,B as we}from"./index-C4HbvW_W.js";import{u as ge}from"./tooltip-DgiqborV.js";import{i as bt,u as ee,S as Le,g as yt}from"./constants-B521j7ay.js";import{a as vt,b as jt,v as wt,u as Nt}from"./use-virtual-mcp-By6PZUzg.js";import{i as St}from"./Check-7lFZ8X77.js";import{X as _t,A as Y,Z as Ct,r as Tt,c as Et}from"./agent-icon-BzrzSnAz.js";import{s as be}from"./Plus-Tnr53r7A.js";import{i as ze}from"./X-BH0VE8jB.js";import{u as kt,b as It,h as $t,C as ne}from"./agent-capabilities-BPmYbqGN.js";import{u as At,c as Mt}from"./chat-context-dBrooU1v.js";import{N as Lt}from"./agent-icons-Cd0vLj6N.js";import{u as Oe,a as re,K as Re,P as De,D as Pe,c as zt,S as Ot,v as Rt,b as Dt,C as Pt,s as Ht,d as Ut,e as Bt,f as Ft}from"./sortable.esm-BKA03RQh.js";import{u as He,a as Ue,o as Qt}from"./use-organization-settings-difToZl3.js";import{c as ye,u as Wt,h as qt}from"./shell-layout-tWuhPjHz.js";import{I as Kt}from"./input-B5k-Hbp3.js";import{S as Xt}from"./scroll-area-DYzEAvWY.js";import{S as Gt,c as Vt,d as Zt,a as Jt,b as Yt}from"./sheet-D9aXq4ta.js";import{S as H}from"./skeleton-DH0H1fU3.js";import{t as Be}from"./ChevronDown-DBeUwQYn.js";import{d as Fe}from"./ZoomOut-CrlW2TUB.js";import{g as es,M as ts}from"./types-DP-Q3z5y.js";import{I as ss}from"./integration-icon-C7p8BtkI.js";import{u as is}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Qe,P as ns,e as rs,s as os,g as ls}from"./pair-Bhj3cOFh.js";import{a as as}from"./XCircle-DLzFRLwJ.js";import{g as cs}from"./use-mcp-prompts-BNFsBgD1.js";import{u as ds,w as ms}from"./tab-id-B1KAdtlk.js";import{D as us,a as fs,b as hs,h as ps,c as Ne,d as xs}from"./dropdown-menu-2uydtPAy.js";import{s as gs}from"./Trash01-CZeQBZf_.js";import{a as bs,u as ys}from"./use-ai-providers-B_aWh-J8.js";import{a as vs}from"./toolbar-B-Xmvyb0.js";import"./use-collections-CFs8myDl.js";import"./AlertCircle-PL6o_BFM.js";import"./Tool01-yp4kJRUu.js";import"./SwitchHorizontal01-B9vZRv9t.js";import"./RefreshCcw01-Cv0pFCb4.js";import"./ArrowUpRight-D0PaRtUX.js";import"./ZapSquare-xDebNl-H.js";import"./Users03-DbJl-FlT.js";import"./CheckCircle-Bjdxpj1j.js";import"./ChevronLeft-CPLLwlIr.js";import"./ChevronRight-BVo14pyp.js";import"./ChevronUp-XvIiv-NV.js";import"./DotsVertical-ntZiwo0t.js";import"./Container-BoahFo7F.js";import"./Eye-DkuHnUAW.js";import"./Globe01-CcGroxBm.js";import"./FilterLines-DgBfCVyf.js";import"./Star01-sX328yCS.js";import"./Palette-CrqqEUcE.js";import"./HardDrive-C4j857Fq.js";import"./Stars02-f0XE-eqW.js";import"./Key01-o0EwVLiR.js";import"./LayoutLeft-CD_Gf1ZP.js";import"./LinkExternal01-BrUoXKJY.js";import"./Monitor01-D61B3ma3.js";import"./Sun-PyN_Wt4r.js";import"./Play-UJPgqc1U.js";import"./SearchMd-UxzEV07r.js";import"./Settings02-DhqQsm8K.js";import"./Shield01-DpLC5M3q.js";import"./Stars01-Dv9c4Cee.js";import"./Upload01-SHM-fhC7.js";import"./User01-DW9hMolk.js";import"./Users01-D2wb7idE.js";import"./XClose-DNgFZbzC.js";import"./Zap-DplWtEq0.js";import"./spinner-C0Im7y7X.js";import"./dialog-DqPItn-g.js";import"./drawer-CPIIyCcW.js";import"./collection-search-DYrAflR5.js";import"./form-BIWGXIbK.js";import"./label-BvvzAAWu.js";import"./select-DPygLpWH.js";import"./tabs-52tGcLiU.js";import"./toggle-group-E6TPCKmI.js";import"./connect-desktop-dialog-VMfxWtQ-.js";import"./popover-CFPzrMHB.js";import"./command-VnXMa00z.js";import"./index-CuEl7ZCd.js";import"./useInfiniteQuery-BkurBcOt.js";import"./infiniteQueryObserver-IbMlOZg5.js";import"./index-FhXRIQKJ.js";import"./question-004-sINsf4GQ.js";import"./checkbox-DLgoLQSR.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-dR7ViKE5.js";import"./settings-section-C7gs1p6F.js";import"./card-DjJMgfjm.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DK49rHkZ.js";import"./use-registry-connections-KEGYdtt_.js";import"./use-connection-DjURtMK5.js";import"./extract-connection-data-aP9VrOhv.js";import"./generate-id-CdwRTiX7.js";import"./collections-UXWGkaFt.js";import"./collection-tabs-Y_drDohR.js";import"./badge-REAPd24g.js";import"./textarea-BnccT-U9.js";import"./connection-form-helpers-BSgnmPKP.js";import"./use-infinite-scroll-Bo7I5Z4-.js";import"./useSuspenseInfiniteQuery-C21DKA3_.js";import"./required-auth-layout-Bcp4IxxD.js";import"./useRouterState-BBlCl4XE.js";import"./use-org-sso-Ck4B3T6D.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-CKGAQPRW.js";import"./file-type-icon-CqbDePIX.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-DwD_R1XG.js";import"./decopilot-sse-pool-D4rmdWQS.js";import"./create-sse-subscription-BS5983N4.js";function Se(s,e){const t=new Set(e);return s.filter(r=>!t.has(r))}function js(s,e,t){const r=s.slice(0);return r[e]=t,r}var ws=class extends st{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(s,e,t){super(),this.#n=s,this.#i=t,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(s=>{s.subscribe(e=>{this.#f(s,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(s=>{s.destroy()})}setQueries(s,e){this.#r=s,this.#i=e,me.batch(()=>{const t=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),l=n.map(m=>m.getCurrentResult()),o=t.length!==n.length,c=n.some((m,u)=>m!==t[u]),a=o||c,d=a?!0:l.some((m,u)=>{const p=this.#e[u];return!p||!it(m,p)});!a&&!d||(a&&(this.#c=r,this.#t=n),this.#e=l,this.hasListeners()&&(a&&(Se(t,n).forEach(m=>{m.destroy()}),Se(n,t).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(s=>s.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(s,e){const t=this.#u(s),r=t.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),n=t.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>this.#m(l??r,e,n),()=>this.#d(r,t)]}#d(s,e){return e.map((t,r)=>{const n=s[r];return t.defaultedQueryOptions.notifyOnChangeProps?n:t.observer.trackResult(n,l=>{e.forEach(o=>{o.observer.trackProp(l)})})})}#m(s,e,t){if(e){const r=this.#a,n=t!==void 0&&r!==void 0&&(r.length!==t.length||t.some((l,o)=>l!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,t!==void 0&&(this.#a=t),this.#s=nt(this.#s,e(s))),this.#s}return s}#p(){return this.#i?.combine!==void 0&&this.#t.some((s,e)=>s.options.suspense&&this.#e[e]?.data===void 0)}#u(s){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const l=e.get(n);l?l.push(r):e.set(n,[r])});const t=[];return s.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ae(this.#n,n);t.push({defaultedQueryOptions:n,observer:o})}),t}#f(s,e){const t=this.#t.indexOf(s);t!==-1&&(this.#e=js(this.#e,t,e),this.#h())}#h(){if(this.hasListeners()){const s=this.#d(this.#e,this.#c),e=this.#p(),t=this.#s,r=e?t:this.#m(s,this.#i?.combine);(e||t!==r)&&me.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function Ns({queries:s,...e},t){const r=pe(t),n=rt(),l=ot(),o=L.useMemo(()=>s.map(x=>{const f=r.defaultQueryOptions(x);return f._optimisticResults=n?"isRestoring":"optimistic",f}),[s,r,n]);o.forEach(x=>{lt(x);const f=r.getQueryCache().get(x.queryHash);at(x,l,f)}),ct(l);const[c]=L.useState(()=>new ws(r,o,e)),[a,d,m]=c.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;L.useSyncExternalStore(L.useCallback(x=>u?c.subscribe(me.batchCalls(x)):dt,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),L.useEffect(()=>{c.setQueries(o,e)},[o,e,c]);const g=a.some((x,f)=>je(o[f],x))?a.flatMap((x,f)=>{const h=o[f];if(h&&je(h,x)){const y=new Ae(r,h);return mt(h,y,l)}return[]}):[];if(g.length>0)throw Promise.all(g);const b=a.find((x,f)=>{const h=o[f];return h&&ut({result:x,errorResetBoundary:l,throwOnError:h.throwOnError,query:r.getQueryCache().get(h.queryHash),suspense:h.suspense})});if(b?.error)throw b.error;return d(m())}function Ss(s,e){return Ns({...s,queries:s.queries.map(t=>({...t,suspense:!0,throwOnError:ft,enabled:!0,placeholderData:void 0}))},e)}const te=8;function _s(s){const e=$.c(16),{open:t,onOpenChange:r}=s,[n,l]=L.useState("");let o,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Gt,{children:"Manage home"}),c=i.jsx(Vt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=c):(o=e[0],c=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(_t,{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]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=x=>l(x.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Zt,{className:"px-5 py-4 border-b border-border",children:[o,c,i.jsxs("div",{className:"relative mt-3",children:[a,i.jsx(Kt,{value:n,onChange:d,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(Ys,{}),e[6]=u):u=e[6];let p;e[7]!==n?(p=i.jsx(Xt,{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(L.Suspense,{fallback:u,children:i.jsx(Ts,{search:n})})})}),e[7]=n,e[8]=p):p=e[8];let g;e[9]!==m||e[10]!==p?(g=i.jsxs(Jt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,p]}),e[9]=m,e[10]=p,e[11]=g):g=e[11];let b;return e[12]!==r||e[13]!==t||e[14]!==g?(b=i.jsx(Yt,{open:t,onOpenChange:r,children:g}),e[12]=r,e[13]=t,e[14]=g,e[15]=b):b=e[15],b}function Cs(s){const e=$.c(32),{org:t}=V(),r=He();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const l=n,o=Ue(),c=jt(),a=pe();let d;e[2]!==t||e[3]!==a?(d=()=>a.refetchQueries({queryKey:oe.homeNextActions(t.slug),type:"active"}),e[2]=t,e[3]=a,e[4]=d):d=e[4];const m=d;let u;e[5]!==l?(u=S=>l.includes(S),e[5]=l,e[6]=u):u=e[6];const p=u;let g;e[7]!==l||e[8]!==s?(g=s?l.filter(S=>s.has(S)).length:l.length,e[7]=l,e[8]=s,e[9]=g):g=e[9];const x=g>=te;let f;e[10]!==x||e[11]!==p||e[12]!==o?(f=S=>p(S)||x?Promise.resolve():o.apply(E=>E.includes(S)?null:[...E,S]),e[10]=x,e[11]=p,e[12]=o,e[13]=f):f=e[13];const h=f;let y;e[14]!==o?(y=S=>o.apply(E=>E.filter(k=>k!==S)),e[14]=o,e[15]=y):y=e[15];const w=y;let v;e[16]!==o?(v=S=>o.apply(()=>S),e[16]=o,e[17]=v):v=e[17];const j=v;let N;e[18]!==c||e[19]!==x||e[20]!==p||e[21]!==m||e[22]!==o?(N=async(S,E)=>{await c.update.mutateAsync({id:S.id,data:{metadata:E}}),!p(S.id)&&!x&&await o.apply(k=>k.includes(S.id)?null:[...k,S.id]),await m()},e[18]=c,e[19]=x,e[20]=p,e[21]=m,e[22]=o,e[23]=N):N=e[23];const _=N;let T;return e[24]!==h||e[25]!==x||e[26]!==l||e[27]!==p||e[28]!==w||e[29]!==j||e[30]!==_?(T={homeIds:l,isOnHome:p,atLimit:x,addAgent:h,removeAgent:w,reorder:j,saveAgentMetadata:_},e[24]=h,e[25]=x,e[26]=l,e[27]=p,e[28]=w,e[29]=j,e[30]=_,e[31]=T):T=e[31],T}function Ts(s){const e=$.c(21),{search:t}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=vt(r);let l;e[1]!==n?(l=new Set(n.map(As)),e[1]=n,e[2]=l):l=e[2];const o=Cs(l);let c,a,d;if(e[3]!==n||e[4]!==o||e[5]!==t){const x=new Map(n.map($s));c=t.trim().toLowerCase();const f=y=>!c||y.title?.toLowerCase().includes(c);a=o.homeIds.map(y=>x.get(y)).filter(Is).filter(f);let h;e[9]!==o?(h=y=>!o.isOnHome(y.id),e[9]=o,e[10]=h):h=e[10],d=n.filter(ks).filter(h).filter(f).sort(Es),e[3]=n,e[4]=o,e[5]=t,e[6]=c,e[7]=a,e[8]=d}else c=e[6],a=e[7],d=e[8];const m=d;let u;e[11]!==o||e[12]!==a?(u=i.jsx(Ms,{home:o,agents:a}),e[11]=o,e[12]=a,e[13]=u):u=e[13];const p=!!c;let g;e[14]!==m||e[15]!==o||e[16]!==p?(g=i.jsx(Os,{home:o,agents:m,hasSearch:p}),e[14]=m,e[15]=o,e[16]=p,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=i.jsxs(i.Fragment,{children:[u,g]}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}function Es(s,e){return(s.title??"").localeCompare(e.title??"")}function ks(s){return s.id&&!bt(s.id)}function Is(s){return!!s}function $s(s){return[s.id,s]}function As(s){return s.id}function We(s){const e=$.c(7),{title:t,hint:r}=s;let n;e[0]!==t?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t}),e[0]=t,e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let o;return e[4]!==n||e[5]!==l?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,l]}),e[4]=n,e[5]=l,e[6]=o):o=e[6],o}function Ms(s){const e=$.c(14),{home:t,agents:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={coordinateGetter:Ht},e[1]=l):l=e[1];const o=Oe(re(De,n),re(Re,l));let c;e[2]!==t?(c=g=>{const{active:b,over:x}=g;if(!x||b.id===x.id)return;const f=t.homeIds,h=f.indexOf(b.id),y=f.indexOf(x.id);h===-1||y===-1||t.reorder(Ut([...f],h,y)).catch(zs)},e[2]=t,e[3]=c):c=e[3];const a=c,d=`${t.homeIds.length}/${te}`;let m;e[4]!==d?(m=i.jsx(We,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==t||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(Pe,{sensors:o,collisionDetection:zt,onDragEnd:a,children:i.jsx(Ot,{items:r.map(Ls),strategy:Rt,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(g=>i.jsx(Ds,{agent:g,home:t},g.id))})})}),e[6]=r,e[7]=a,e[8]=t,e[9]=o,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function Ls(s){return s.id}function zs(){return W.error("Couldn't reorder home — please try again.")}function Os(s){const e=$.c(6),{home:t,agents:r,hasSearch:n}=s,[l,o]=L.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==t||e[3]!==l){const a=r.slice(0,l);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(We,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,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:a.map(m=>i.jsx(Us,{agent:m,home:t},m.id))}),r.length>l&&i.jsxs("button",{type:"button",onClick:()=>o(Rs),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-l,")"]})]})]}),e[0]=r,e[1]=n,e[2]=t,e[3]=l,e[4]=c}else c=e[4];return c}function Rs(s){return s+20}function qe(s){const e=xe(s.metadata?.ui).filter(l=>!!l.resourceUri).length,t=s.metadata?.ui?.homePrompts,r=Array.isArray(t)?t.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 Ds(s){const e=$.c(57),{agent:t,home:r}=s,[n,l]=L.useState(!1);let o;e[0]!==t.id?(o={id:t.id},e[0]=t.id,e[1]=o):o=e[1];const{attributes:c,listeners:a,setNodeRef:d,transform:m,transition:u,isDragging:p}=Dt(o),g=qe(t)||"Quick access";let b;e[2]!==m?(b=Pt.Transform.toString(m),e[2]=m,e[3]=b):b=e[3];const x=p?.5:void 0,f=p?100:void 0;let h;e[4]!==b||e[5]!==x||e[6]!==f||e[7]!==u?(h={transform:b,transition:u,opacity:x,zIndex:f},e[4]=b,e[5]=x,e[6]=f,e[7]=u,e[8]=h):h=e[8];const y=h,w=p&&"shadow-lg";let v;e[9]!==w?(v=K("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const j=`Drag to reorder ${t.title??t.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Fe,{size:14}),e[11]=N):N=e[11];let _;e[12]!==c||e[13]!==a||e[14]!==j?(_=i.jsx("button",{type:"button",...c,...a,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]=c,e[13]=a,e[14]=j,e[15]=_):_=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=()=>l(Hs),e[16]=T):T=e[16];const S=t.title??t.id;let E;e[17]!==t.icon||e[18]!==S?(E=i.jsx(Y,{icon:t.icon,name:S,size:"sm"}),e[17]=t.icon,e[18]=S,e[19]=E):E=e[19];const k=t.title??t.id;let C;e[20]!==k?(C=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:k}),e[20]=k,e[21]=C):C=e[21];let I;e[22]!==g?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:g}),e[22]=g,e[23]=I):I=e[23];let A;e[24]!==C||e[25]!==I?(A=i.jsxs("div",{className:"min-w-0 flex-1",children:[C,I]}),e[24]=C,e[25]=I,e[26]=A):A=e[26];const D=n&&"rotate-180";let z;e[27]!==D?(z=K("shrink-0 text-muted-foreground transition-transform",D),e[27]=D,e[28]=z):z=e[28];let O;e[29]!==z?(O=i.jsx(Be,{size:16,className:z}),e[29]=z,e[30]=O):O=e[30];let Q;e[31]!==n||e[32]!==E||e[33]!==A||e[34]!==O?(Q=i.jsxs("button",{type:"button",onClick:T,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[E,A,O]}),e[31]=n,e[32]=E,e[33]=A,e[34]=O,e[35]=Q):Q=e[35];let M;e[36]!==t.id||e[37]!==r?(M=()=>r.removeAgent(t.id).catch(Ps),e[36]=t.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${t.title??t.id} from home`;let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(ze,{size:14}),e[39]=P):P=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:P}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let U;e[43]!==_||e[44]!==Q||e[45]!==R?(U=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[_,Q,R]}),e[43]=_,e[44]=Q,e[45]=R,e[46]=U):U=e[46];let B;e[47]!==t||e[48]!==n||e[49]!==r?(B=n&&i.jsx(Ke,{agent:t,home:r}),e[47]=t,e[48]=n,e[49]=r,e[50]=B):B=e[50];let q;return e[51]!==d||e[52]!==y||e[53]!==U||e[54]!==B||e[55]!==v?(q=i.jsxs("div",{ref:d,style:y,className:v,children:[U,B]}),e[51]=d,e[52]=y,e[53]=U,e[54]=B,e[55]=v,e[56]=q):q=e[56],q}function Ps(){return W.error("Couldn't remove from home — please try again.")}function Hs(s){return!s}function Us({agent:s,home:e}){const[t,r]=L.useState(!1),[n,l]=L.useState(!1),o=qe(s),c=async()=>{if(!e.atLimit){l(!0);try{await e.addAgent(s.id)}catch{W.error("Couldn't add to home — please try again.")}finally{l(!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(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":t,children:[i.jsx(Y,{icon:s.icon,name:s.title??s.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:s.title??s.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(Be,{size:16,className:K("shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,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(Me,{size:12,className:"animate-spin"}):i.jsx(be,{size:14})})]}),t&&i.jsx(Ke,{agent:s,home:e})]})}function Ke(s){const e=$.c(26),{agent:t,home:r}=s;let n,l,o,c,a,d,m;if(e[0]!==t||e[1]!==r){const f=xe(t.metadata?.ui);let h;e[9]!==t.connections?(h=(t.connections??[]).map(Fs).sort(),e[9]=t.connections,e[10]=h):h=e[10];const y=h;l=t.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Ws,o=t,c=r,a=y,d=new Set(f.map(Bs)),e[0]=t,e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c,e[6]=a,e[7]=d,e[8]=m}else n=e[2],l=e[3],o=e[4],c=e[5],a=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==c||e[14]!==a||e[15]!==d?(u=i.jsx(n,{agent:o,home:c,connectionIds:a,pinnedResourceUris:d}),e[11]=n,e[12]=o,e[13]=c,e[14]=a,e[15]=d,e[16]=u):u=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(Qs,{}),e[17]=p):p=e[17];const g=l??null;let b;e[18]!==t||e[19]!==r||e[20]!==g?(b=i.jsx(L.Suspense,{fallback:p,children:i.jsx(Ks,{agent:t,home:r,curated:g})}),e[18]=t,e[19]=r,e[20]=g,e[21]=b):b=e[21];let x;return e[22]!==m||e[23]!==u||e[24]!==b?(x=i.jsxs("div",{className:m,children:[u,b]}),e[22]=m,e[23]=u,e[24]=b,e[25]=x):x=e[25],x}function Bs(s){return s.resourceUri}function Fs(s){return s.connection_id}function Qs(){const s=$.c(1);let e;return s[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"})]}),s[0]=e):e=s[0],e}function Ws({agent:s,home:e,connectionIds:t,pinnedResourceUris:r}){const{org:n}=V(),l=ee({connectionId:Le,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:c}=le({queryKey:oe.projectConnectionDetails(s.id,t),enabled:t.length>0,queryFn:async()=>(await Promise.all(t.map(async d=>{try{const m=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}}),{item:u}=is(m),p=(u?.tools??[]).flatMap(g=>{const b=es(g._meta);return b?[{name:g.name,description:g.description,resourceUri:b}]:[]});return{id:d,title:u?.title??d,icon:u?.icon??null,uiTools:p}}catch{return{id:d,title:d,icon:null,uiTools:[]}}}))).filter(d=>d.uiTools.length>0)});return t.length===0?null:c?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(a=>a.uiTools.map(d=>i.jsx(qs,{agent:s,home:e,connection:a,tool:d,isPinned:r.has(d.resourceUri)},`${a.id}:${d.name}`)))})}function qs({agent:s,home:e,connection:t,tool:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=xe(s.metadata?.ui),d=n?a.filter(u=>u.resourceUri!==r.resourceUri):[...a,{connectionId:t.id,resourceUri:r.resourceUri}],m={...s.metadata??{},ui:{...s.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle tile",a),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(ss,{icon:t.icon,name:t.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Qe(r.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Xe(s){const e=$.c(11),{isPinned:t,submitting:r,onClick:n,label:l}=s,o=t?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==o?(c=K("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]=c):c=e[1];let a;e[2]!==t||e[3]!==r?(a=r?i.jsx(Me,{size:12,className:"animate-spin"}):t?i.jsx(Ct,{size:14}):i.jsx(be,{size:14}),e[2]=t,e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==a?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":l,title:l,className:c,children:a}),e[5]=l,e[6]=n,e[7]=r,e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function Ks(s){const e=$.c(32),{agent:t,home:r,curated:n}=s,{org:l}=V();let o;e[0]!==t.id||e[1]!==l.id||e[2]!==l.slug?(o={connectionId:t.id,orgId:l.id,orgSlug:l.slug},e[0]=t.id,e[1]=l.id,e[2]=l.slug,e[3]=o):o=e[3];const c=ee(o);let a;e[4]!==t.id||e[5]!==l.id?(a=oe.agentPrompts(l.id,t.id),e[4]=t.id,e[5]=l.id,e[6]=a):a=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Zs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==a||e[10]!==d?(m={queryKey:a,queryFn:d,staleTime:3e4,retry:!1},e[9]=a,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:p,error:g}=le(m),b=ye(l.slug);let x,f;if(e[12]!==t.id||e[13]!==u||e[14]!==b.prompts){let j;e[17]!==t.id?(j=_=>_.agentId===t.id&&_.promptName,e[17]=t.id,e[18]=j):j=e[18],x=b.prompts.filter(j).map(Vs);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],f=[...N];for(const _ of x)f.some(T=>T.name===_.name)||f.push(_);e[12]=t.id,e[13]=u,e[14]=b.prompts,e[15]=x,e[16]=f}else x=e[15],f=e[16];if(p&&x.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(g&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",t.id,g),null;if(f.length===0)return null;let h;e[22]!==n||e[23]!==f?(h=n??f.map(Gs),e[22]=n,e[23]=f,e[24]=h):h=e[24];let y;e[25]!==h?(y=new Set(h),e[25]=h,e[26]=y):y=e[26];const w=y;let v;return e[27]!==t||e[28]!==r||e[29]!==f||e[30]!==w?(v=i.jsx("div",{className:"flex flex-col gap-0.5",children:f.map(j=>i.jsx(Js,{agent:t,home:r,prompt:j,allPromptNames:f.map(Xs),isPinned:w.has(j.name)},j.name))}),e[27]=t,e[28]=r,e[29]=f,e[30]=w,e[31]=v):v=e[31],v}function Xs(s){return s.name}function Gs(s){return s.name}function Vs(s){return{name:s.promptName,title:s.title,description:s.description}}function Zs(s){return{name:s.name,title:s.title,description:s.description}}function Js({agent:s,home:e,prompt:t,allPromptNames:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=s.metadata?.ui?.homePrompts;let d;Array.isArray(a)?d=n?a.filter(u=>u!==t.name):[...a,t.name]:d=n?r.filter(u=>u!==t.name):r;const m={...s.metadata??{},ui:{...s.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),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:t.title??Qe(t.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Ys(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},ei)}),s[0]=e):e=s[0],e}function ei(s,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 J=1,Ge=`home-board.layout.v${J}`;function Ve(s){return`home-board.layout.v${J}.${s}`}const Ze={version:J,tiles:{},hidden:[]};function ue(s){return!s||s.version!==J?Ze:{version:J,tiles:s.tiles??{},hidden:Array.isArray(s.hidden)?s.hidden:[]}}function ti(s){return Object.keys(s.tiles).length>0||s.hidden.length>0}function si(s){try{const e=localStorage.getItem(Ve(s));return e?ue(JSON.parse(e)):void 0}catch{return}}function _e(s,e){try{localStorage.setItem(Ve(s),JSON.stringify(e))}catch{}}async function Ce(s,e){if(!(await fetch(`/api/${s}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ii(s){const e=$.c(24),t=pe();let r;e[0]!==s?(r=oe.boardLayout(s),e[0]=s,e[1]=r):r=e[1];const n=r;let l;e[2]!==s?(l=si(s),e[2]=s,e[3]=l):l=e[3];const o=l;let c;e[4]!==o||e[5]!==s?(c=async()=>{const h=await fetch(`/api/${s}/kv/${Ge}`);if(h.status===404)return o&&ti(o)?(await Ce(s,o),o):Ze;if(!h.ok)throw new Error("Failed to load board layout");const y=await h.json(),w=ue(y.value);return _e(s,w),w},e[4]=o,e[5]=s,e[6]=c):c=e[6];let a;e[7]!==o||e[8]!==n||e[9]!==c?(a={queryKey:n,queryFn:c,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=c,e[10]=a):a=e[10];const{data:d,isLoading:m}=le(a);let u;e[11]!==s?(u={mutationFn:h=>Ce(s,h)},e[11]=s,e[12]=u):u=e[12];const p=ht(u);let g;e[13]!==p||e[14]!==s||e[15]!==t||e[16]!==n?(g=h=>{_e(s,h),t.setQueryData(n,h),p.mutate(h)},e[13]=p,e[14]=s,e[15]=t,e[16]=n,e[17]=g):g=e[17];const b=g;let x;e[18]!==d?(x=ue(d),e[18]=d,e[19]=x):x=e[19];let f;return e[20]!==m||e[21]!==b||e[22]!==x?(f={layout:x,isLoading:m,save:b},e[20]=m,e[21]=b,e[22]=x,e[23]=f):f=e[23],f}const Je=L.createContext(null);function ni(s){const e=$.c(24),{children:t}=s,{org:r}=V(),n=ii(r.slug),[l,o]=L.useState(!1),[c,a]=L.useState(null);let d;e[0]!==n.layout?(d=()=>{a(n.layout),o(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),o(!1)},e[2]=u):u=e[2];const p=u;let g;e[3]!==c||e[4]!==n?(g=()=>{c&&n.save(c),a(null),o(!1)},e[3]=c,e[4]=n,e[5]=g):g=e[5];const b=g,x=l&&c!==null,f=x?c:n.layout;let h;e[6]!==c||e[7]!==x||e[8]!==n.layout?(h=x?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=x,e[8]=n.layout,e[9]=h):h=e[9];const y=h;let w;e[10]!==l||e[11]!==n?(w=_=>{l?a(_):n.save(_)},e[10]=l,e[11]=n,e[12]=w):w=e[12];const v=w;let j;e[13]!==v||e[14]!==m||e[15]!==y||e[16]!==l||e[17]!==f||e[18]!==b||e[19]!==n.isLoading?(j={isEditMode:l,enter:m,cancel:p,save:b,hasChanges:y,layout:f,isLayoutLoading:n.isLoading,commitLayout:v},e[13]=v,e[14]=m,e[15]=y,e[16]=l,e[17]=f,e[18]=b,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==t||e[22]!==j?(N=i.jsx(Je.Provider,{value:j,children:t}),e[21]=t,e[22]=j,e[23]=N):N=e[23],N}function Ye(){const s=L.useContext(Je);if(!s)throw new Error("useHomeEdit must be used within a HomeEditProvider");return s}function ri({agentId:s}){const{org:e,locator:t}=V(),r=ee({connectionId:s,orgId:e.id,orgSlug:e.slug}),{create:n}=ds(),{setTaskId:l}=Wt(),[o,c]=L.useState(null),[a,d]=L.useState(!1),m=L.useRef(!1),u=async(f,h)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const y=await cs(r,f.name,h),w={type:"doc",content:[{type:"paragraph",content:[rs({id:f.name,name:os(f.name,ls(f._meta)),metadata:y.messages,char:"/",kind:"prompt",args:h}),{type:"text",text:" "}]}]},v=crypto.randomUUID();ms(sessionStorage,t,v,{tiptapDoc:w}),await n({id:v,virtual_mcp_id:s}),l(v,s,{autosend:!0})}catch(y){console.error("[start-thread-from-prompt] failed",y),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},p=async f=>{if(!m.current){if(f.arguments&&f.arguments.length>0){c(f);return}await u(f)}},g=async f=>{if(!o)return;const h=o;c(null),await u(h,f)};return{start:p,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const f=crypto.randomUUID();await n({id:f,virtual_mcp_id:s}),l(f,s)}catch(f){console.error("[start-thread-from-prompt] startBlank failed",f),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ns,{prompt:o,setPrompt:f=>c(f),onSubmit:g}),dialogPrompt:o,starting:a}}const G=4,X=100,Te=12,ie={S:{w:1,h:1},M:{w:1,h:2},T:{w:1,h:3},L:{w:2,h:1},XL:{w:2,h:2},LT:{w:2,h:3},XLT:{w:2,h:4},XXLT:{w:2,h:5},W:{w:4,h:1},WT:{w:4,h:3}},oi={S:"Small",M:"Tall",T:"Column",L:"Wide",XL:"Large",LT:"Showcase",XLT:"Display",XXLT:"Tower",W:"Full width",WT:"Hero"},Ee=["S","M","T","L","XL","LT","XLT","XXLT","W","WT"],li=ie.XL;class fe extends L.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,t){console.error("[home-tiles] tile crashed:",e,t.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(pt,{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 ai(s){const e=$.c(72),{tiles:t,isEditMode:r,renderTile:n,onMove:l,onResize:o,onRemove:c}=s,a=ge(),d=L.useRef(null),[m,u]=L.useState(null),[p,g]=L.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={activationConstraint:{distance:4}},e[0]=b):b=e[0];const x=Oe(re(De,b),re(Re)),f=t.reduce(ci,0),h=r?Math.max(f+2,4):Math.max(f,1);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/G,cellHeight:X}:null},e[1]=y):y=e[1];const w=y;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=M=>{u(String(M.active.id)),g(w())},e[2]=v):v=e[2];const j=v;let N;e[3]!==p||e[4]!==l||e[5]!==t?(N=M=>{const F=String(M.active.id),P=p??w();if(u(null),g(null),!P||P.cellWidth<=0)return;const R=t.find(q=>q.id===F);if(!R)return;const U=Math.round(M.delta.x/P.cellWidth),B=Math.round(M.delta.y/P.cellHeight);U===0&&B===0||l(F,{x:R.x+U,y:R.y+B})},e[3]=p,e[4]=l,e[5]=t,e[6]=N):N=e[6];const _=N;if(a){let M;if(e[7]!==n||e[8]!==t){let P;e[10]!==n?(P=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:X},children:i.jsx(fe,{children:n(R)})},R.id),e[10]=n,e[11]=P):P=e[11],M=t.map(P),e[7]=n,e[8]=t,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 T,S,E,k,C,I,A,D,z;if(e[14]!==m||e[15]!==p||e[16]!==r||e[17]!==_||e[18]!==c||e[19]!==o||e[20]!==n||e[21]!==x||e[22]!==t||e[23]!==h){const M=m?t.find(Z=>Z.id===m):null;S=Pe,D=x,z=j,E=_;const F=h*X,P=r?X*4:X;let R;e[33]!==F||e[34]!==P?(R={height:F,minHeight:P},e[33]=F,e[34]=P,e[35]=R):R=e[35];let U;e[36]!==r||e[37]!==t||e[38]!==h?(U=r&&i.jsx(di,{rows:h,tiles:t}),e[36]=r,e[37]=t,e[38]=h,e[39]=U):U=e[39];let B;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==o||e[44]!==n||e[45]!==t){let Z;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==o||e[51]!==n?(Z=se=>i.jsx(ui,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:c,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=c,e[50]=o,e[51]=n,e[52]=Z):Z=e[52],B=t.map(Z),e[40]=m,e[41]=r,e[42]=c,e[43]=o,e[44]=n,e[45]=t,e[46]=B}else B=e[46];e[53]!==R||e[54]!==U||e[55]!==B?(k=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[U,B]}),e[53]=R,e[54]=U,e[55]=B,e[56]=k):k=e[56],T=Bt,C=null;const q=M&&p?M.w*p.cellWidth-Te:void 0,ae=M&&p?M.h*p.cellHeight-Te:void 0;e[57]!==q||e[58]!==ae?(I={width:q,height:ae},e[57]=q,e[58]=ae,e[59]=I):I=e[59],A=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(fe,{children:n(M)})}),e[14]=m,e[15]=p,e[16]=r,e[17]=_,e[18]=c,e[19]=o,e[20]=n,e[21]=x,e[22]=t,e[23]=h,e[24]=T,e[25]=S,e[26]=E,e[27]=k,e[28]=C,e[29]=I,e[30]=A,e[31]=D,e[32]=z}else T=e[24],S=e[25],E=e[26],k=e[27],C=e[28],I=e[29],A=e[30],D=e[31],z=e[32];let O;e[60]!==T||e[61]!==C||e[62]!==I||e[63]!==A?(O=i.jsx(T,{dropAnimation:C,style:I,children:A}),e[60]=T,e[61]=C,e[62]=I,e[63]=A,e[64]=O):O=e[64];let Q;return e[65]!==S||e[66]!==E||e[67]!==k||e[68]!==O||e[69]!==D||e[70]!==z?(Q=i.jsxs(S,{sensors:D,onDragStart:z,onDragEnd:E,children:[k,O]}),e[65]=S,e[66]=E,e[67]=k,e[68]=O,e[69]=D,e[70]=z,e[71]=Q):Q=e[71],Q}function ci(s,e){return Math.max(s,e.y+e.h)}function di(s){const e=$.c(7),{rows:t,tiles:r}=s;let n;e[0]!==r?(n=(a,d)=>r.some(m=>a>=m.x&&a<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const l=n;let o;if(e[2]!==l||e[3]!==t){o=[];for(let a=0;a<t;a++)for(let d=0;d<G;d++)l(d,a)||o.push({x:d,y:a});e[2]=l,e[3]=t,e[4]=o}else o=e[4];let c;return e[5]!==o?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(mi)}),e[5]=o,e[6]=c):c=e[6],c}function mi(s){return i.jsx("div",{className:"absolute p-1",style:{left:`${s.x/G*100}%`,top:s.y*X,width:`${1/G*100}%`,height:X},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${s.x}-${s.y}`)}function ui(s){const e=$.c(31),{tile:t,isEditMode:r,isDragging:n,onResize:l,onRemove:o,children:c}=s,a=!r;let d;e[0]!==a||e[1]!==t.id?(d={id:t.id,disabled:a},e[0]=a,e[1]=t.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:p,isDragging:g}=Ft(d),b=`${t.x/G*100}%`,x=`${t.w/G*100}%`,f=t.y*X,h=t.h*X,y=g||n,w=!y&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=y&&"opacity-30";let j;e[3]!==w||e[4]!==v?(j=K("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=j):j=e[5];let N;e[6]!==h||e[7]!==b||e[8]!==f||e[9]!==x?(N={left:b,top:f,width:x,height:h},e[6]=h,e[7]=b,e[8]=f,e[9]=x,e[10]=N):N=e[10];const _=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let T;e[11]!==_?(T=K("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",_),e[11]=_,e[12]=T):T=e[12];let S;e[13]!==u||e[14]!==r||e[15]!==p||e[16]!==o||e[17]!==l||e[18]!==t?(S=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...p,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(Fe,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(fi,{tile:t,onResize:l,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=p,e[16]=o,e[17]=l,e[18]=t,e[19]=S):S=e[19];let E;e[20]!==c?(E=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(fe,{children:c})}),e[20]=c,e[21]=E):E=e[21];let k;e[22]!==E||e[23]!==T||e[24]!==S?(k=i.jsxs("div",{className:T,children:[S,E]}),e[22]=E,e[23]=T,e[24]=S,e[25]=k):k=e[25];let C;return e[26]!==m||e[27]!==k||e[28]!==j||e[29]!==N?(C=i.jsx("div",{ref:m,className:j,style:N,children:k}),e[26]=m,e[27]=k,e[28]=j,e[29]=N,e[30]=C):C=e[30],C}function fi(s){const e=$.c(43),{tile:t,onResize:r,onRemove:n}=s,l=t.minW??1,o=t.minH??1;let c,a,d,m,u,p,g;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==t.h||e[4]!==t.id||e[5]!==t.w){let v;e[13]!==o||e[14]!==l?(v=S=>{const E=ie[S];return E.w>=l&&E.h>=o},e[13]=o,e[14]=l,e[15]=v):v=e[15];const j=Ee.filter(v);let N;e[16]!==t.h||e[17]!==t.w?(N=(()=>{for(const E of Ee){const k=ie[E];if(k.w===t.w&&k.h===t.h)return E}return null})(),e[16]=t.h,e[17]=t.w,e[18]=N):N=e[18];const _=N;a=us,e[19]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(fs,{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(Tt,{size:16})})}),e[19]=g):g=e[19],c=hs,d="end",m="w-44",e[20]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ps,{children:"Size"}),e[20]=u):u=e[20];let T;e[21]!==_||e[22]!==r||e[23]!==t.id?(T=S=>{const E=ie[S];return i.jsxs(Ne,{onSelect:()=>r(t.id,E),className:"flex items-center justify-between",children:[i.jsx("span",{children:oi[S]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:_===S?"✓":`${E.w}×${E.h}`})]},S)},e[21]=_,e[22]=r,e[23]=t.id,e[24]=T):T=e[24],p=j.map(T),e[0]=o,e[1]=l,e[2]=r,e[3]=t.h,e[4]=t.id,e[5]=t.w,e[6]=c,e[7]=a,e[8]=d,e[9]=m,e[10]=u,e[11]=p,e[12]=g}else c=e[6],a=e[7],d=e[8],m=e[9],u=e[10],p=e[11],g=e[12];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(xs,{}),e[25]=b):b=e[25];let x;e[26]!==n||e[27]!==t.id?(x=()=>n(t.id),e[26]=n,e[27]=t.id,e[28]=x):x=e[28];let f;e[29]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(gs,{size:14,className:"mr-2"}),e[29]=f):f=e[29];let h;e[30]!==x?(h=i.jsxs(Ne,{onSelect:x,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[30]=x,e[31]=h):h=e[31];let y;e[32]!==c||e[33]!==d||e[34]!==m||e[35]!==u||e[36]!==p||e[37]!==h?(y=i.jsxs(c,{align:d,className:m,children:[u,p,b,h]}),e[32]=c,e[33]=d,e[34]=m,e[35]=u,e[36]=p,e[37]=h,e[38]=y):y=e[38];let w;return e[39]!==a||e[40]!==y||e[41]!==g?(w=i.jsxs(a,{children:[g,y]}),e[39]=a,e[40]=y,e[41]=g,e[42]=w):w=e[42],w}function hi(s,e,t){return s.some(r=>e>=r.x&&e<r.x+r.w&&t>=r.y&&t<r.y+r.h)}function he(s,e,t){for(let r=0;r<100;r++)for(let n=0;n<=G-e;n++){let l=!0;for(let o=0;o<t&&l;o++)for(let c=0;c<e&&l;c++)hi(s,n+c,r+o)&&(l=!1);if(l)return{x:n,y:r}}return{x:0,y:0}}function ce(s,e,t={w:1,h:1}){const r=Math.max(t.w,Math.min(G,s)),n=Math.max(t.h,Math.min(6,e));return{w:r,h:n}}function de(s,e,t){const r=Math.max(0,Math.min(G-t,s)),n=Math.max(0,e);return{x:r,y:n}}function pi(s,e,t){const r=s.find(a=>a.id===e);if(!r)return s;const n=s.filter(a=>a.id!==e),l=n.find(a=>t.x>=a.x&&t.x<a.x+a.w&&t.y>=a.y&&t.y<a.y+a.h);if(l&&l.w===r.w&&l.h===r.h)return s.map(a=>a.id===e?{...a,x:l.x,y:l.y}:a.id===l.id?{...a,x:r.x,y:r.y}:a);const c=[{...r,x:t.x,y:t.y}];for(const a of n){const d=he(c,a.w,a.h);c.push({...a,x:d.x,y:d.y})}return c}function xi(s){const e=$.c(35),{layout:t,isLayoutLoading:r,commitLayout:n}=Ye();let l;e[0]!==t.hidden?(l=new Set(t.hidden),e[0]=t.hidden,e[1]=l):l=e[1];const o=l;let c,a;if(e[2]!==s||e[3]!==o||e[4]!==t.tiles){a=[];let y;e[7]!==o?(y=v=>v.pinned||!o.has(v.id),e[7]=o,e[8]=y):y=e[8];const w=s.filter(y);c=new Map;for(const v of s)v.minSize&&c.set(v.id,v.minSize);for(const v of w){const j=t.tiles[v.id];if(!j)continue;const N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),{x:S,y:E}=de(j.x,j.y,_);a.push({id:v.id,x:S,y:E,w:_,h:T,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(E=>E.id===v.id))continue;const j=v.defaultSize??li,N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),S=he(a,_,T);a.push({id:v.id,x:S.x,y:S.y,w:_,h:T,minW:N?.w,minH:N?.h})}e[2]=s,e[3]=o,e[4]=t.tiles,e[5]=c,e[6]=a}else c=e[5],a=e[6];let d;e[9]!==s?(d=new Set(s.map(gi)),e[9]=s,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(y,w)=>{const v={};for(const j of y)v[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:J,tiles:v,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const p=u;let g;e[14]!==a?(g={visible:a},e[14]=a,e[15]=g):g=e[15];let b;e[16]!==p||e[17]!==t||e[18]!==a?(b=(y,w)=>{const v=a.find(_=>_.id===y);if(!v)return;const j=de(w.x,w.y,v.w);if(j.x===v.x&&j.y===v.y)return;const N=pi(a,y,j);p(N,t.hidden)},e[16]=p,e[17]=t,e[18]=a,e[19]=b):b=e[19];let x;e[20]!==p||e[21]!==t||e[22]!==c||e[23]!==a?(x=(y,w)=>{const v=a.find(k=>k.id===y);if(!v)return;const j=c.get(y),{w:N,h:_}=ce(w.w,w.h,j);if(N===v.w&&_===v.h)return;const T={...v,w:N,h:_,x:de(v.x,v.y,N).x},S=a.filter(k=>k.id!==y),E=[T];for(const k of S){const C=he(E,k.w,k.h);E.push({...k,x:C.x,y:C.y})}p(E,t.hidden)},e[20]=p,e[21]=t,e[22]=c,e[23]=a,e[24]=x):x=e[24];let f;e[25]!==p||e[26]!==t||e[27]!==a?(f=y=>{const w=a.filter(v=>v.id!==y);p(w,Array.from(new Set([...t.hidden,y])))},e[25]=p,e[26]=t,e[27]=a,e[28]=f):f=e[28];let h;return e[29]!==r||e[30]!==g||e[31]!==b||e[32]!==x||e[33]!==f?(h={snapshot:g,isLoading:r,moveTile:b,resizeTile:x,hideTile:f},e[29]=r,e[30]=g,e[31]=b,e[32]=x,e[33]=f,e[34]=h):h=e[34],h}function gi(s){return s.id}const bi={w:2,h:4},yi={w:1,h:2},vi={w:1,h:1};function ji(s){return`prompt:${s.agentId}:${s.promptName||"blank"}`}function wi(s){return`tile:${s.agentId}:${s.resourceUri}`}function Ni(s){return s.promptName?s.agentName:s.description}function Si(s){return{name:s.promptName,title:s.title,description:s.description,arguments:s.arguments,_meta:s._meta}}function ve(s){const e=$.c(10);let t;e[0]!==s?(t={agentId:s},e[0]=s,e[1]=t):t=e[1];const{start:r,startBlank:n,dialog:l,starting:o}=ri(t);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(Si(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const a=c;let d;return e[5]!==l||e[6]!==a||e[7]!==n||e[8]!==o?(d={open:a,startBlank:n,dialog:l,starting:o},e[5]=l,e[6]=a,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function _i(s){const e=$.c(32),{entry:t,isEditMode:r}=s,{open:n,dialog:l,starting:o}=ve(t.agentId);let c;e[0]!==t||e[1]!==n?(c=()=>n(t),e[0]=t,e[1]=n,e[2]=c):c=e[2];const a=o||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let p;e[3]!==d||e[4]!==m||e[5]!==u?(p=K("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=p):p=e[6];let g;e[7]!==t.agentIcon||e[8]!==t.agentName?(g=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[7]=t.agentIcon,e[8]=t.agentName,e[9]=g):g=e[9];let b;e[10]!==t.title?(b=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:t.title}),e[10]=t.title,e[11]=b):b=e[11];let x;e[12]!==t?(x=Ni(t),e[12]=t,e[13]=x):x=e[13];let f;e[14]!==x?(f=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=f):f=e[15];let h;e[16]!==f||e[17]!==b?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[b,f]}),e[16]=f,e[17]=b,e[18]=h):h=e[18];let y;e[19]!==r?(y=!r&&i.jsx(as,{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]=y):y=e[20];let w;e[21]!==o||e[22]!==c||e[23]!==h||e[24]!==y||e[25]!==a||e[26]!==p||e[27]!==g?(w=i.jsxs("button",{type:"button",onClick:c,disabled:a,"aria-busy":o,className:p,children:[g,h,y]}),e[21]=o,e[22]=c,e[23]=h,e[24]=y,e[25]=a,e[26]=p,e[27]=g,e[28]=w):w=e[28];let v;return e[29]!==l||e[30]!==w?(v=i.jsxs(i.Fragment,{children:[w,l]}),e[29]=l,e[30]=w,e[31]=v):v=e[31],v}function Ci(){const s=$.c(1);let e;return s[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},Ti)}),s[0]=e):e=s[0],e}function Ti(s,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 Ei(s){const e=$.c(59),{tile:t,prompts:r,isEditMode:n,tileWidth:l}=s,{org:o}=V();let c;e[0]!==o.id||e[1]!==o.slug||e[2]!==t.connectionId?(c={connectionId:t.connectionId,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=t.connectionId,e[3]=c):c=e[3];const a=ee(c),{open:d,startBlank:m,dialog:u,starting:p}=ve(t.agentId);let g,b,x,f,h;if(e[4]!==a||e[5]!==n||e[6]!==d||e[7]!==o.id||e[8]!==r||e[9]!==m||e[10]!==p||e[11]!==t.agentIcon||e[12]!==t.agentName||e[13]!==t.maxHeight||e[14]!==t.minHeight||e[15]!==t.resourceUri||e[16]!==l){const v=r.filter(ki);f="flex h-full w-full flex-col gap-3 p-3";let j;e[22]!==m?(j=()=>{m()},e[22]=m,e[23]=j):j=e[23];const N=p||n,_=n&&"pl-10 pr-10";let T;e[24]!==_?(T=K("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",_),e[24]=_,e[25]=T):T=e[25];let S;e[26]!==t.agentIcon||e[27]!==t.agentName?(S=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[26]=t.agentIcon,e[27]=t.agentName,e[28]=S):S=e[28];let E;e[29]!==t.agentName?(E=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[29]=t.agentName,e[30]=E):E=e[30];const k=n?"Drag to rearrange":"Open chat";let C;e[31]!==k?(C=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=C):C=e[32];let I;e[33]!==E||e[34]!==C?(I=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[E,C]}),e[33]=E,e[34]=C,e[35]=I):I=e[35],e[36]!==p||e[37]!==T||e[38]!==S||e[39]!==I||e[40]!==j||e[41]!==N?(h=i.jsxs("button",{type:"button",onClick:j,disabled:N,"aria-busy":p,className:T,children:[S,I]}),e[36]=p,e[37]=T,e[38]=S,e[39]=I,e[40]=j,e[41]=N,e[42]=h):h=e[42],g="flex min-h-0 flex-1 gap-3 overflow-hidden";let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(Ii,{}),e[43]=A):A=e[43];const D=t.minHeight??200,z=t.maxHeight??4e3;e[44]!==a||e[45]!==o.id||e[46]!==D||e[47]!==z||e[48]!==t.resourceUri?(b=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(L.Suspense,{fallback:A,children:i.jsx(ts,{resourceURI:t.resourceUri,orgId:o.id,client:a,displayMode:"fullscreen",minHeight:D,maxHeight:z,className:"h-full"})})}),e[44]=a,e[45]=o.id,e[46]=D,e[47]=z,e[48]=t.resourceUri,e[49]=b):b=e[49],x=v.length>0&&!n&&l>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(O=>i.jsx("button",{type:"button",onClick:()=>d(O),disabled:p,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:O.title})},O.promptName))}),e[4]=a,e[5]=n,e[6]=d,e[7]=o.id,e[8]=r,e[9]=m,e[10]=p,e[11]=t.agentIcon,e[12]=t.agentName,e[13]=t.maxHeight,e[14]=t.minHeight,e[15]=t.resourceUri,e[16]=l,e[17]=g,e[18]=b,e[19]=x,e[20]=f,e[21]=h}else g=e[17],b=e[18],x=e[19],f=e[20],h=e[21];let y;e[50]!==g||e[51]!==b||e[52]!==x?(y=i.jsxs("div",{className:g,children:[b,x]}),e[50]=g,e[51]=b,e[52]=x,e[53]=y):y=e[53];let w;return e[54]!==u||e[55]!==f||e[56]!==h||e[57]!==y?(w=i.jsxs("div",{className:f,children:[h,y,u]}),e[54]=u,e[55]=f,e[56]=h,e[57]=y,e[58]=w):w=e[58],w}function ki(s){return!!s.promptName}function Ii(){const s=$.c(1);let e;return s[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"})]}),s[0]=e):e=s[0],e}function $i(s){const e=$.c(14),{icon:t,name:r}=s;let n;e[0]!==t||e[1]!==r?(n=i.jsx(Y,{icon:t,name:r,size:"sm+"}),e[0]=t,e[1]=r,e[2]=n):n=e[2];let l;e[3]!==r?(l=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=l):l=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 c;e[6]!==l?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[l,o]}),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==n||e[9]!==c?(a=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=a):a=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=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]=d):d=e[11];let m;return e[12]!==a?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,d]}),e[12]=a,e[13]=m):m=e[13],m}function Ai(s){const e=$.c(33),{tile:t,prompts:r,isEditMode:n}=s,{open:l,startBlank:o,dialog:c,starting:a}=ve(t.agentId);let d,m,u;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==o||e[4]!==a||e[5]!==t.agentIcon||e[6]!==t.agentName){const g=r.filter(Mi);d="flex h-full w-full flex-col gap-3 p-4";let b;e[10]!==o?(b=()=>{o()},e[10]=o,e[11]=b):b=e[11];const x=a||n,f=n&&"pl-10 pr-10";let h;e[12]!==f?(h=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",f),e[12]=f,e[13]=h):h=e[13];let y;e[14]!==t.agentIcon||e[15]!==t.agentName?(y=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[14]=t.agentIcon,e[15]=t.agentName,e[16]=y):y=e[16];let w;e[17]!==t.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[17]=t.agentName,e[18]=w):w=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=v):v=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,v]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==b||e[24]!==x||e[25]!==h||e[26]!==y?(m=i.jsxs("button",{type:"button",onClick:b,disabled:x,className:h,children:[y,j]}),e[22]=j,e[23]=b,e[24]=x,e[25]=h,e[26]=y,e[27]=m):m=e[27],u=g.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:g.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&l(N),disabled:a,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]=l,e[2]=r,e[3]=o,e[4]=a,e[5]=t.agentIcon,e[6]=t.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let p;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(p=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=p):p=e[32],p}function Mi(s){return!!s.promptName}function et(s){const e=$.c(36),{isEditMode:t}=s,{org:r}=V(),{isLoading:n,prompts:l,tiles:o}=ye(r.slug),c=He()?.ids??[];let a;e[0]!==c?(a=new Set(c),e[0]=c,e[1]=a):a=e[1];const d=a,m=Ue();let u;e[2]!==o?(u=new Set(o.map(Di)),e[2]=o,e[3]=u):u=e[3];const p=u;let g;if(e[4]!==l){g=new Map;for(const C of l){const I=g.get(C.agentId);I?I.push(C):g.set(C.agentId,[C])}e[4]=l,e[5]=g}else g=e[5];let b;if(e[6]!==l||e[7]!==p||e[8]!==o){let C;e[10]!==p?(C=A=>!p.has(A.agentId),e[10]=p,e[11]=C):C=e[11];const I=l.filter(C);b=[...o.map(Ri),...I.map(Oi)],e[6]=l,e[7]=p,e[8]=o,e[9]=b}else b=e[9];const x=b;let f;e[12]!==x?(f=new Map(x.map(zi)),e[12]=x,e[13]=f):f=e[13];const h=f;let y;e[14]!==x||e[15]!==d?(y=x.map(C=>({id:C.id,defaultSize:C.kind==="tile"?bi:vi,minSize:C.kind==="tile"?yi:void 0,pinned:d.has(C.data.agentId)})),e[14]=x,e[15]=d,e[16]=y):y=e[16];const w=xi(y);let v;e[17]!==m?(v=C=>{m.apply(I=>I.filter(A=>A!==C)).catch(Li)},e[17]=m,e[18]=v):v=e[18];const j=v;let N;e[19]!==h||e[20]!==w||e[21]!==d||e[22]!==j?(N=C=>{const I=h.get(C);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(C)},e[19]=h,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const _=N;let T;e[24]!==h||e[25]!==t||e[26]!==g?(T=C=>{const I=h.get(C.id);if(!I)return null;if(I.kind==="tile"){const A=g.get(I.data.agentId)??[];return i.jsx(xt,{fallback:i.jsx(Ai,{tile:I.data,prompts:A,isEditMode:t}),children:i.jsx(L.Suspense,{fallback:i.jsx($i,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ei,{tile:I.data,prompts:A,isEditMode:t,tileWidth:C.w})})})}return i.jsx(_i,{entry:I.data,isEditMode:t})},e[24]=h,e[25]=t,e[26]=g,e[27]=T):T=e[27];const S=T;if(n||w.isLoading){let C;return e[28]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ci,{}),e[28]=C):C=e[28],C}if(w.snapshot.visible.length===0&&!t)return null;let k;return e[29]!==t||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==_||e[34]!==S?(k=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ai,{tiles:w.snapshot.visible,isEditMode:t,renderTile:S,onMove:w.moveTile,onResize:w.resizeTile,onRemove:_})}),e[29]=t,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=_,e[34]=S,e[35]=k):k=e[35],k}function Li(){return W.error("Couldn't remove from home — please try again.")}function zi(s){return[s.id,s]}function Oi(s){return{kind:"prompt",id:ji(s),data:s}}function Ri(s){return{kind:"tile",id:wi(s),data:s}}function Di(s){return s.agentId}function Pi(s){const e=$.c(2),{prompts:t,tiles:r}=ye(s),n=r.length>0||t.length>0;let l;return e[0]!==n?(l={hasVisibleTiles:n},e[0]=n,e[1]=l):l=e[1],l}const ke=420,Ie=305;function tt(){const s=$.c(4);let e;s[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:ke}}),s[0]=e):e=s[0];let t;s[1]===Symbol.for("react.memo_cache_sentinel")?(t=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:ke}}),s[1]=t):t=s[1];let r;s[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:Ie}}),s[2]=r):r=s[2];let n;return s[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,t,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:Ie}})]}),s[3]=n):n=s[3],n}function $e(){const s=$.c(33),{data:e}=gt.useSession(),{org:t}=V(),r=ge(),n=At(),{selectedVirtualMcp:l}=Mt();let o;s[0]!==t.id?(o=yt(t.id),s[0]=t.id,s[1]=o):o=s[1];const a=l??o;let d;s[2]!==t.slug?(d=qt(t.slug),s[2]=t.slug,s[3]=d):d=s[3],le(d);let m;s[4]!==t.id||s[5]!==t.slug?(m={connectionId:Le,orgId:t.id,orgSlug:t.slug},s[4]=t.id,s[5]=t.slug,s[6]=m):m=s[6];const u=ee(m);let p;s[7]!==t.id||s[8]!==u?(p=bs(u,t.id),s[7]=t.id,s[8]=u,s[9]=p):p=s[9];let g;s[10]!==t.id||s[11]!==u?(g=Qt(u,t.id),s[10]=t.id,s[11]=u,s[12]=g):g=s[12];let b;s[13]!==a.id||s[14]!==t.id||s[15]!==u?(b=wt(t.id,a.id,u),s[13]=a.id,s[14]=t.id,s[15]=u,s[16]=b):b=s[16];let x;s[17]!==p||s[18]!==g||s[19]!==b?(x={queries:[p,g,b]},s[17]=p,s[18]=g,s[19]=b,s[20]=x):x=s[20],Ss(x);const f=ys(),h=Nt(a.id),{hasDecoKey:y,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:j,hasOnlyDecoProvider:N}=kt(),{hasVisibleTiles:_}=Pi(t.slug),T=It(h?.metadata);if(f.length===0&&!(T&&$t(n))){let O;return s[21]===Symbol.for("react.memo_cache_sentinel")?(O=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(Lt,{})})}),s[21]=O):O=s[21],O}let E;s[22]!==e?.user?.name?(E=e?.user?.name?.split(" ")[0]||"there",s[22]=e?.user?.name,s[23]=E):E=s[23];const k=E,C=y&&v&&j!=null,I=y&&w&&N;let A;s[24]!==j||s[25]!==C||s[26]!==I?(A=C?i.jsx(ne.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(ne.NoCreditsEyebrow,{}):null,s[24]=j,s[25]=C,s[26]=I,s[27]=A):A=s[27];const D=A;let z;return s[28]!==D||s[29]!==_||s[30]!==r||s[31]!==k?(z=i.jsx(ni,{children:r?i.jsx(Hi,{eyebrow:D,userName:k}):i.jsx(Ui,{eyebrow:D,userName:k,hasVisibleTiles:_})}),s[28]=D,s[29]=_,s[30]=r,s[31]=k,s[32]=z):z=s[32],z}function Hi(s){const e=$.c(12),{eyebrow:t,userName:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(tt,{}),e[0]=n):n=e[0];let l;e[1]!==t?(l=t&&i.jsx("div",{className:"mb-4",children:t}),e[1]=t,e[2]=l):l=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 c;e[5]!==l||e[6]!==o?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[l,o]}),e[5]=l,e[6]=o,e[7]=c):c=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ne.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(et,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,a,d]}),e[10]=c,e[11]=m):m=e[11],m}function Ui(s){const e=$.c(32),{eyebrow:t,userName:r,hasVisibleTiles:n}=s,{isEditMode:l,enter:o,save:c,cancel:a,hasChanges:d}=Ye(),[m,u]=L.useState(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!0),e[0]=p):p=e[0];let g;e[1]!==a||e[2]!==o||e[3]!==d||e[4]!==l||e[5]!==c?(g=i.jsx(vs.Right,{children:i.jsx(Bi,{isEditMode:l,hasChanges:d,onEnter:o,onSave:c,onCancel:a,onAddTile:p})}),e[1]=a,e[2]=o,e[3]=d,e[4]=l,e[5]=c,e[6]=g):g=e[6];let b;e[7]!==m?(b=i.jsx(_s,{open:m,onOpenChange:u}),e[7]=m,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(tt,{}),e[9]=x):x=e[9];const f=n||l?"pt-32":"flex-1 justify-center";let h;e[10]!==f?(h=K("relative flex flex-col items-center px-10 pb-4",f),e[10]=f,e[11]=h):h=e[11];let y;e[12]!==t?(y=t&&i.jsx("div",{className:"mb-4",children:t}),e[12]=t,e[13]=y):y=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 v;e[16]!==y||e[17]!==w?(v=i.jsxs("div",{className:"text-center mb-10",children:[y,w]}),e[16]=y,e[17]=w,e[18]=v):v=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Fi,{}),i.jsx(ne.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==v?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,j]}),e[20]=v,e[21]=N):N=e[21];let _;e[22]!==l?(_=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(et,{isEditMode:l})}),e[22]=l,e[23]=_):_=e[23];let T;e[24]!==N||e[25]!==_||e[26]!==h?(T=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:h,children:[N,_]})})]}),e[24]=N,e[25]=_,e[26]=h,e[27]=T):T=e[27];let S;return e[28]!==T||e[29]!==g||e[30]!==b?(S=i.jsxs(i.Fragment,{children:[g,b,T]}),e[28]=T,e[29]=g,e[30]=b,e[31]=S):S=e[31],S}function Bi(s){const e=$.c(17),{isEditMode:t,hasChanges:r,onEnter:n,onSave:l,onCancel:o,onAddTile:c}=s;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(be,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,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]=c,e[2]=u):u=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(ze,{size:14}),e[3]=p):p=e[3];let g;e[4]!==o?(g=i.jsxs(we,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[p,"Cancel"]}),e[4]=o,e[5]=g):g=e[5];const b=!r;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(St,{size:14}),e[6]=x):x=e[6];let f;e[7]!==l||e[8]!==b?(f=i.jsxs(we,{size:"sm",onClick:l,disabled:b,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=l,e[8]=b,e[9]=f):f=e[9];let h;return e[10]!==u||e[11]!==g||e[12]!==f?(h=i.jsxs(i.Fragment,{children:[u,g,f]}),e[10]=u,e[11]=g,e[12]=f,e[13]=h):h=e[13],h}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Et,{size:14}),e[14]=a):a=e[14];let d;return e[15]!==n?(d=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:[a,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Fi(){const s=$.c(1);let e;return s[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"}),s[0]=e):e=s[0],e}function Vr(){const s=$.c(2);if(ge()){let r;return s[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($e,{})}),s[0]=r):r=s[0],r}let t;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t=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($e,{})})})}),s[1]=t):t=s[1],t}export{Vr as default};
|
|
1
|
+
import{aq as st,ar as me,as as it,at as nt,au as Ae,F as pe,av as rt,aw as ot,r as L,ax as lt,ay as at,az as ct,aA as dt,aB as je,aC as mt,aD as ut,aE as ft,e as $,j as i,q as V,c as K,l as Me,aF as xe,o as W,K as oe,n as le,a as ht,v as pt,E as xt,b as gt,B as we}from"./index-BndwjqHd.js";import{u as ge}from"./tooltip-CtCPgfHv.js";import{i as bt,u as ee,S as Le,g as yt}from"./constants-CTy7Z7Cr.js";import{a as vt,b as jt,v as wt,u as Nt}from"./use-virtual-mcp-bNdj_jBM.js";import{i as St}from"./Check-GuOoujc1.js";import{X as _t,A as Y,Z as Ct,r as Tt,c as Et}from"./agent-icon-CcAfypno.js";import{s as be}from"./Plus-ohuOGrjV.js";import{i as ze}from"./X-CXuIiJcM.js";import{u as kt,b as It,h as $t,C as ne}from"./agent-capabilities-Du9p4iX1.js";import{u as At,c as Mt}from"./chat-context-D1iCjJx_.js";import{N as Lt}from"./agent-icons-DyOcbxHL.js";import{u as Oe,a as re,K as Re,P as De,D as Pe,c as zt,S as Ot,v as Rt,b as Dt,C as Pt,s as Ht,d as Ut,e as Bt,f as Ft}from"./sortable.esm-tnz_NBW4.js";import{u as He,a as Ue,o as Qt}from"./use-organization-settings-C0N0CGyM.js";import{c as ye,u as Wt,h as qt}from"./shell-layout-Bp6FCKs1.js";import{I as Kt}from"./input-CBDbBFOx.js";import{S as Xt}from"./scroll-area-wuYeScN9.js";import{S as Gt,c as Vt,d as Zt,a as Jt,b as Yt}from"./sheet-Di1cASFY.js";import{S as H}from"./skeleton-C5dk7YCz.js";import{t as Be}from"./ChevronDown-BQC7gd1Z.js";import{d as Fe}from"./ZoomOut-BVEe82yV.js";import{g as es,M as ts}from"./types-BTI4XrPl.js";import{I as ss}from"./integration-icon-EtDsLgsf.js";import{u as is}from"./unwrap-tool-result-BYXdCQMg.js";import{t as Qe,P as ns,e as rs,s as os,g as ls}from"./pair-BUW3N_E1.js";import{a as as}from"./XCircle-FR2hulWg.js";import{g as cs}from"./use-mcp-prompts-Cod5Eh_M.js";import{u as ds,w as ms}from"./tab-id-DMzVkzCq.js";import{D as us,a as fs,b as hs,h as ps,c as Ne,d as xs}from"./dropdown-menu-Ck1AdglA.js";import{s as gs}from"./Trash01-CxZaXkEG.js";import{a as bs,u as ys}from"./use-ai-providers-BHt3xY1J.js";import{a as vs}from"./toolbar-Bisx725E.js";import"./use-collections-DgAfwA2E.js";import"./AlertCircle-BbgiP1ZV.js";import"./Tool01-gkJ10CSc.js";import"./SwitchHorizontal01-D0Xml2F9.js";import"./RefreshCcw01-BW7QLN6f.js";import"./ArrowUpRight-CR0tLc1r.js";import"./ZapSquare-C82pexYy.js";import"./Users03-BLiTdp6b.js";import"./CheckCircle-CIGG2Fks.js";import"./ChevronLeft-DcquQFQv.js";import"./ChevronRight-u62q_EJA.js";import"./ChevronUp-CEc_wZlC.js";import"./DotsVertical-BTb3OQch.js";import"./Container-BQ_ppInl.js";import"./Eye-BvtzK_ld.js";import"./Globe01-BDzEUH0y.js";import"./FilterLines-Ds07i1jJ.js";import"./Star01-C5-avyqJ.js";import"./Palette-CU3snEKc.js";import"./HardDrive-B4XU4Plg.js";import"./Stars02-CXyi_Vew.js";import"./Key01-CAz3yDJD.js";import"./LayoutLeft-BLpDarKX.js";import"./LinkExternal01-kcZAuVDT.js";import"./Monitor01-CNFzHcoX.js";import"./Sun-CcDK3tqG.js";import"./Play-RtGFVpVA.js";import"./SearchMd-BLv-HtMf.js";import"./Settings02-Bmu7Y-K1.js";import"./Shield01-BuSsO9Yy.js";import"./Stars01-DAQzL-cd.js";import"./Upload01-w5N1KkCJ.js";import"./User01-BPdUBEwh.js";import"./Users01-N-UWwsUE.js";import"./XClose-5pjo9DDH.js";import"./Zap-BZFCxgr7.js";import"./spinner-D_I4Dd9a.js";import"./dialog-D_sGNO5l.js";import"./drawer-D115cuKM.js";import"./collection-search-Bccogvwl.js";import"./form-Dlwu2Vxh.js";import"./label-Cgk_AkFe.js";import"./select-_pE1qLfW.js";import"./tabs-BNP_i7Rf.js";import"./toggle-group-B_44Db0Z.js";import"./connect-desktop-dialog-BemwAUFq.js";import"./popover-Ctq4Kzc9.js";import"./command-DsVZEy4X.js";import"./index-D9QAOChZ.js";import"./useInfiniteQuery-BoQM2LBe.js";import"./infiniteQueryObserver-BHbqpbmn.js";import"./index-B5F4ZjnC.js";import"./question-004-sINsf4GQ.js";import"./checkbox-CE0XyOMB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./avatar-BLLSVymV.js";import"./settings-section-B_xBQiYF.js";import"./card-CQgg2XSv.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-P5iTsEt_.js";import"./use-registry-connections-DqmrKdG3.js";import"./use-connection-G2gCjYsj.js";import"./extract-connection-data-BMBZo6v1.js";import"./generate-id-BhSFOcj8.js";import"./collections-CjhflW7H.js";import"./collection-tabs-BAv--h4c.js";import"./badge-CD_sxtRd.js";import"./textarea-cejfxfYp.js";import"./connection-form-helpers-d0Qv3Dr_.js";import"./use-infinite-scroll-J8G13yDh.js";import"./useSuspenseInfiniteQuery-DyfJnAzO.js";import"./required-auth-layout-D6rmft5v.js";import"./useRouterState-D1tQIUkv.js";import"./use-org-sso-D10Yc5vA.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-DGt-nJD_.js";import"./file-type-icon-Cr5daaKU.js";import"./content-blocks-o63cs2vh.js";import"./use-navigate-to-agent-Bb-pqH3o.js";import"./decopilot-sse-pool-F3lBB1Vq.js";import"./create-sse-subscription-BS5983N4.js";function Se(s,e){const t=new Set(e);return s.filter(r=>!t.has(r))}function js(s,e,t){const r=s.slice(0);return r[e]=t,r}var ws=class extends st{#n;#e;#r;#i;#t;#s;#o;#l;#a;#c=[];constructor(s,e,t){super(),this.#n=s,this.#i=t,this.#r=[],this.#t=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#t.forEach(s=>{s.subscribe(e=>{this.#f(s,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#t.forEach(s=>{s.destroy()})}setQueries(s,e){this.#r=s,this.#i=e,me.batch(()=>{const t=this.#t,r=this.#u(this.#r);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const n=r.map(m=>m.observer),l=n.map(m=>m.getCurrentResult()),o=t.length!==n.length,c=n.some((m,u)=>m!==t[u]),a=o||c,d=a?!0:l.some((m,u)=>{const p=this.#e[u];return!p||!it(m,p)});!a&&!d||(a&&(this.#c=r,this.#t=n),this.#e=l,this.hasListeners()&&(a&&(Se(t,n).forEach(m=>{m.destroy()}),Se(n,t).forEach(m=>{m.subscribe(u=>{this.#f(m,u)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#t.map(s=>s.getCurrentQuery())}getObservers(){return this.#t}getOptimisticResult(s,e){const t=this.#u(s),r=t.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),n=t.map(l=>l.defaultedQueryOptions.queryHash);return[r,l=>this.#m(l??r,e,n),()=>this.#d(r,t)]}#d(s,e){return e.map((t,r)=>{const n=s[r];return t.defaultedQueryOptions.notifyOnChangeProps?n:t.observer.trackResult(n,l=>{e.forEach(o=>{o.observer.trackProp(l)})})})}#m(s,e,t){if(e){const r=this.#a,n=t!==void 0&&r!==void 0&&(r.length!==t.length||t.some((l,o)=>l!==r[o]));return(!this.#s||this.#e!==this.#l||n||e!==this.#o)&&(this.#o=e,this.#l=this.#e,t!==void 0&&(this.#a=t),this.#s=nt(this.#s,e(s))),this.#s}return s}#p(){return this.#i?.combine!==void 0&&this.#t.some((s,e)=>s.options.suspense&&this.#e[e]?.data===void 0)}#u(s){const e=new Map;this.#t.forEach(r=>{const n=r.options.queryHash;if(!n)return;const l=e.get(n);l?l.push(r):e.set(n,[r])});const t=[];return s.forEach(r=>{const n=this.#n.defaultQueryOptions(r),o=e.get(n.queryHash)?.shift()??new Ae(this.#n,n);t.push({defaultedQueryOptions:n,observer:o})}),t}#f(s,e){const t=this.#t.indexOf(s);t!==-1&&(this.#e=js(this.#e,t,e),this.#h())}#h(){if(this.hasListeners()){const s=this.#d(this.#e,this.#c),e=this.#p(),t=this.#s,r=e?t:this.#m(s,this.#i?.combine);(e||t!==r)&&me.batch(()=>{this.listeners.forEach(n=>{n(this.#e)})})}}};function Ns({queries:s,...e},t){const r=pe(t),n=rt(),l=ot(),o=L.useMemo(()=>s.map(x=>{const f=r.defaultQueryOptions(x);return f._optimisticResults=n?"isRestoring":"optimistic",f}),[s,r,n]);o.forEach(x=>{lt(x);const f=r.getQueryCache().get(x.queryHash);at(x,l,f)}),ct(l);const[c]=L.useState(()=>new ws(r,o,e)),[a,d,m]=c.getOptimisticResult(o,e.combine),u=!n&&e.subscribed!==!1;L.useSyncExternalStore(L.useCallback(x=>u?c.subscribe(me.batchCalls(x)):dt,[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),L.useEffect(()=>{c.setQueries(o,e)},[o,e,c]);const g=a.some((x,f)=>je(o[f],x))?a.flatMap((x,f)=>{const h=o[f];if(h&&je(h,x)){const y=new Ae(r,h);return mt(h,y,l)}return[]}):[];if(g.length>0)throw Promise.all(g);const b=a.find((x,f)=>{const h=o[f];return h&&ut({result:x,errorResetBoundary:l,throwOnError:h.throwOnError,query:r.getQueryCache().get(h.queryHash),suspense:h.suspense})});if(b?.error)throw b.error;return d(m())}function Ss(s,e){return Ns({...s,queries:s.queries.map(t=>({...t,suspense:!0,throwOnError:ft,enabled:!0,placeholderData:void 0}))},e)}const te=8;function _s(s){const e=$.c(16),{open:t,onOpenChange:r}=s,[n,l]=L.useState("");let o,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(Gt,{children:"Manage home"}),c=i.jsx(Vt,{children:"Add agents to the home board and pin their interactive UIs or prompts."}),e[0]=o,e[1]=c):(o=e[0],c=e[1]);let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(_t,{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]=a):a=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=x=>l(x.target.value),e[3]=d):d=e[3];let m;e[4]!==n?(m=i.jsxs(Zt,{className:"px-5 py-4 border-b border-border",children:[o,c,i.jsxs("div",{className:"relative mt-3",children:[a,i.jsx(Kt,{value:n,onChange:d,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(Ys,{}),e[6]=u):u=e[6];let p;e[7]!==n?(p=i.jsx(Xt,{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(L.Suspense,{fallback:u,children:i.jsx(Ts,{search:n})})})}),e[7]=n,e[8]=p):p=e[8];let g;e[9]!==m||e[10]!==p?(g=i.jsxs(Jt,{side:"right",className:"w-full sm:max-w-md p-0 flex flex-col",children:[m,p]}),e[9]=m,e[10]=p,e[11]=g):g=e[11];let b;return e[12]!==r||e[13]!==t||e[14]!==g?(b=i.jsx(Yt,{open:t,onOpenChange:r,children:g}),e[12]=r,e[13]=t,e[14]=g,e[15]=b):b=e[15],b}function Cs(s){const e=$.c(32),{org:t}=V(),r=He();let n;e[0]!==r?.ids?(n=r?.ids??[],e[0]=r?.ids,e[1]=n):n=e[1];const l=n,o=Ue(),c=jt(),a=pe();let d;e[2]!==t||e[3]!==a?(d=()=>a.refetchQueries({queryKey:oe.homeNextActions(t.slug),type:"active"}),e[2]=t,e[3]=a,e[4]=d):d=e[4];const m=d;let u;e[5]!==l?(u=S=>l.includes(S),e[5]=l,e[6]=u):u=e[6];const p=u;let g;e[7]!==l||e[8]!==s?(g=s?l.filter(S=>s.has(S)).length:l.length,e[7]=l,e[8]=s,e[9]=g):g=e[9];const x=g>=te;let f;e[10]!==x||e[11]!==p||e[12]!==o?(f=S=>p(S)||x?Promise.resolve():o.apply(E=>E.includes(S)?null:[...E,S]),e[10]=x,e[11]=p,e[12]=o,e[13]=f):f=e[13];const h=f;let y;e[14]!==o?(y=S=>o.apply(E=>E.filter(k=>k!==S)),e[14]=o,e[15]=y):y=e[15];const w=y;let v;e[16]!==o?(v=S=>o.apply(()=>S),e[16]=o,e[17]=v):v=e[17];const j=v;let N;e[18]!==c||e[19]!==x||e[20]!==p||e[21]!==m||e[22]!==o?(N=async(S,E)=>{await c.update.mutateAsync({id:S.id,data:{metadata:E}}),!p(S.id)&&!x&&await o.apply(k=>k.includes(S.id)?null:[...k,S.id]),await m()},e[18]=c,e[19]=x,e[20]=p,e[21]=m,e[22]=o,e[23]=N):N=e[23];const _=N;let T;return e[24]!==h||e[25]!==x||e[26]!==l||e[27]!==p||e[28]!==w||e[29]!==j||e[30]!==_?(T={homeIds:l,isOnHome:p,atLimit:x,addAgent:h,removeAgent:w,reorder:j,saveAgentMetadata:_},e[24]=h,e[25]=x,e[26]=l,e[27]=p,e[28]=w,e[29]=j,e[30]=_,e[31]=T):T=e[31],T}function Ts(s){const e=$.c(21),{search:t}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={pageSize:1e3},e[0]=r):r=e[0];const n=vt(r);let l;e[1]!==n?(l=new Set(n.map(As)),e[1]=n,e[2]=l):l=e[2];const o=Cs(l);let c,a,d;if(e[3]!==n||e[4]!==o||e[5]!==t){const x=new Map(n.map($s));c=t.trim().toLowerCase();const f=y=>!c||y.title?.toLowerCase().includes(c);a=o.homeIds.map(y=>x.get(y)).filter(Is).filter(f);let h;e[9]!==o?(h=y=>!o.isOnHome(y.id),e[9]=o,e[10]=h):h=e[10],d=n.filter(ks).filter(h).filter(f).sort(Es),e[3]=n,e[4]=o,e[5]=t,e[6]=c,e[7]=a,e[8]=d}else c=e[6],a=e[7],d=e[8];const m=d;let u;e[11]!==o||e[12]!==a?(u=i.jsx(Ms,{home:o,agents:a}),e[11]=o,e[12]=a,e[13]=u):u=e[13];const p=!!c;let g;e[14]!==m||e[15]!==o||e[16]!==p?(g=i.jsx(Os,{home:o,agents:m,hasSearch:p}),e[14]=m,e[15]=o,e[16]=p,e[17]=g):g=e[17];let b;return e[18]!==u||e[19]!==g?(b=i.jsxs(i.Fragment,{children:[u,g]}),e[18]=u,e[19]=g,e[20]=b):b=e[20],b}function Es(s,e){return(s.title??"").localeCompare(e.title??"")}function ks(s){return s.id&&!bt(s.id)}function Is(s){return!!s}function $s(s){return[s.id,s]}function As(s){return s.id}function We(s){const e=$.c(7),{title:t,hint:r}=s;let n;e[0]!==t?(n=i.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:t}),e[0]=t,e[1]=n):n=e[1];let l;e[2]!==r?(l=r&&i.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[2]=r,e[3]=l):l=e[3];let o;return e[4]!==n||e[5]!==l?(o=i.jsxs("div",{className:"flex items-center justify-between px-1",children:[n,l]}),e[4]=n,e[5]=l,e[6]=o):o=e[6],o}function Ms(s){const e=$.c(14),{home:t,agents:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={activationConstraint:{distance:5}},e[0]=n):n=e[0];let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l={coordinateGetter:Ht},e[1]=l):l=e[1];const o=Oe(re(De,n),re(Re,l));let c;e[2]!==t?(c=g=>{const{active:b,over:x}=g;if(!x||b.id===x.id)return;const f=t.homeIds,h=f.indexOf(b.id),y=f.indexOf(x.id);h===-1||y===-1||t.reorder(Ut([...f],h,y)).catch(zs)},e[2]=t,e[3]=c):c=e[3];const a=c,d=`${t.homeIds.length}/${te}`;let m;e[4]!==d?(m=i.jsx(We,{title:"On home",hint:d}),e[4]=d,e[5]=m):m=e[5];let u;e[6]!==r||e[7]!==a||e[8]!==t||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(Pe,{sensors:o,collisionDetection:zt,onDragEnd:a,children:i.jsx(Ot,{items:r.map(Ls),strategy:Rt,children:i.jsx("div",{className:"flex flex-col gap-1",children:r.map(g=>i.jsx(Ds,{agent:g,home:t},g.id))})})}),e[6]=r,e[7]=a,e[8]=t,e[9]=o,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function Ls(s){return s.id}function zs(){return W.error("Couldn't reorder home — please try again.")}function Os(s){const e=$.c(6),{home:t,agents:r,hasSearch:n}=s,[l,o]=L.useState(20);let c;if(e[0]!==r||e[1]!==n||e[2]!==t||e[3]!==l){const a=r.slice(0,l);let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx(We,{title:"Add to home"}),e[5]=d):d=e[5],c=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[d,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:a.map(m=>i.jsx(Us,{agent:m,home:t},m.id))}),r.length>l&&i.jsxs("button",{type:"button",onClick:()=>o(Rs),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-l,")"]})]})]}),e[0]=r,e[1]=n,e[2]=t,e[3]=l,e[4]=c}else c=e[4];return c}function Rs(s){return s+20}function qe(s){const e=xe(s.metadata?.ui).filter(l=>!!l.resourceUri).length,t=s.metadata?.ui?.homePrompts,r=Array.isArray(t)?t.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 Ds(s){const e=$.c(57),{agent:t,home:r}=s,[n,l]=L.useState(!1);let o;e[0]!==t.id?(o={id:t.id},e[0]=t.id,e[1]=o):o=e[1];const{attributes:c,listeners:a,setNodeRef:d,transform:m,transition:u,isDragging:p}=Dt(o),g=qe(t)||"Quick access";let b;e[2]!==m?(b=Pt.Transform.toString(m),e[2]=m,e[3]=b):b=e[3];const x=p?.5:void 0,f=p?100:void 0;let h;e[4]!==b||e[5]!==x||e[6]!==f||e[7]!==u?(h={transform:b,transition:u,opacity:x,zIndex:f},e[4]=b,e[5]=x,e[6]=f,e[7]=u,e[8]=h):h=e[8];const y=h,w=p&&"shadow-lg";let v;e[9]!==w?(v=K("rounded-lg border border-border bg-card",w),e[9]=w,e[10]=v):v=e[10];const j=`Drag to reorder ${t.title??t.id}`;let N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=i.jsx(Fe,{size:14}),e[11]=N):N=e[11];let _;e[12]!==c||e[13]!==a||e[14]!==j?(_=i.jsx("button",{type:"button",...c,...a,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]=c,e[13]=a,e[14]=j,e[15]=_):_=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=()=>l(Hs),e[16]=T):T=e[16];const S=t.title??t.id;let E;e[17]!==t.icon||e[18]!==S?(E=i.jsx(Y,{icon:t.icon,name:S,size:"sm"}),e[17]=t.icon,e[18]=S,e[19]=E):E=e[19];const k=t.title??t.id;let C;e[20]!==k?(C=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:k}),e[20]=k,e[21]=C):C=e[21];let I;e[22]!==g?(I=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:g}),e[22]=g,e[23]=I):I=e[23];let A;e[24]!==C||e[25]!==I?(A=i.jsxs("div",{className:"min-w-0 flex-1",children:[C,I]}),e[24]=C,e[25]=I,e[26]=A):A=e[26];const D=n&&"rotate-180";let z;e[27]!==D?(z=K("shrink-0 text-muted-foreground transition-transform",D),e[27]=D,e[28]=z):z=e[28];let O;e[29]!==z?(O=i.jsx(Be,{size:16,className:z}),e[29]=z,e[30]=O):O=e[30];let Q;e[31]!==n||e[32]!==E||e[33]!==A||e[34]!==O?(Q=i.jsxs("button",{type:"button",onClick:T,className:"flex min-w-0 flex-1 items-center gap-2.5 text-left outline-none","aria-expanded":n,children:[E,A,O]}),e[31]=n,e[32]=E,e[33]=A,e[34]=O,e[35]=Q):Q=e[35];let M;e[36]!==t.id||e[37]!==r?(M=()=>r.removeAgent(t.id).catch(Ps),e[36]=t.id,e[37]=r,e[38]=M):M=e[38];const F=`Remove ${t.title??t.id} from home`;let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=i.jsx(ze,{size:14}),e[39]=P):P=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:P}),e[40]=M,e[41]=F,e[42]=R):R=e[42];let U;e[43]!==_||e[44]!==Q||e[45]!==R?(U=i.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-2.5",children:[_,Q,R]}),e[43]=_,e[44]=Q,e[45]=R,e[46]=U):U=e[46];let B;e[47]!==t||e[48]!==n||e[49]!==r?(B=n&&i.jsx(Ke,{agent:t,home:r}),e[47]=t,e[48]=n,e[49]=r,e[50]=B):B=e[50];let q;return e[51]!==d||e[52]!==y||e[53]!==U||e[54]!==B||e[55]!==v?(q=i.jsxs("div",{ref:d,style:y,className:v,children:[U,B]}),e[51]=d,e[52]=y,e[53]=U,e[54]=B,e[55]=v,e[56]=q):q=e[56],q}function Ps(){return W.error("Couldn't remove from home — please try again.")}function Hs(s){return!s}function Us({agent:s,home:e}){const[t,r]=L.useState(!1),[n,l]=L.useState(!1),o=qe(s),c=async()=>{if(!e.atLimit){l(!0);try{await e.addAgent(s.id)}catch{W.error("Couldn't add to home — please try again.")}finally{l(!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(a=>!a),className:"flex min-w-0 flex-1 items-center gap-3 text-left outline-none","aria-expanded":t,children:[i.jsx(Y,{icon:s.icon,name:s.title??s.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:s.title??s.id}),o&&i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:o})]}),i.jsx(Be,{size:16,className:K("shrink-0 text-muted-foreground transition-transform",t&&"rotate-180")})]}),i.jsx("button",{type:"button",onClick:c,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(Me,{size:12,className:"animate-spin"}):i.jsx(be,{size:14})})]}),t&&i.jsx(Ke,{agent:s,home:e})]})}function Ke(s){const e=$.c(26),{agent:t,home:r}=s;let n,l,o,c,a,d,m;if(e[0]!==t||e[1]!==r){const f=xe(t.metadata?.ui);let h;e[9]!==t.connections?(h=(t.connections??[]).map(Fs).sort(),e[9]=t.connections,e[10]=h):h=e[10];const y=h;l=t.metadata?.ui?.homePrompts,m="border-t border-border px-3 py-2 flex flex-col gap-3",n=Ws,o=t,c=r,a=y,d=new Set(f.map(Bs)),e[0]=t,e[1]=r,e[2]=n,e[3]=l,e[4]=o,e[5]=c,e[6]=a,e[7]=d,e[8]=m}else n=e[2],l=e[3],o=e[4],c=e[5],a=e[6],d=e[7],m=e[8];let u;e[11]!==n||e[12]!==o||e[13]!==c||e[14]!==a||e[15]!==d?(u=i.jsx(n,{agent:o,home:c,connectionIds:a,pinnedResourceUris:d}),e[11]=n,e[12]=o,e[13]=c,e[14]=a,e[15]=d,e[16]=u):u=e[16];let p;e[17]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(Qs,{}),e[17]=p):p=e[17];const g=l??null;let b;e[18]!==t||e[19]!==r||e[20]!==g?(b=i.jsx(L.Suspense,{fallback:p,children:i.jsx(Ks,{agent:t,home:r,curated:g})}),e[18]=t,e[19]=r,e[20]=g,e[21]=b):b=e[21];let x;return e[22]!==m||e[23]!==u||e[24]!==b?(x=i.jsxs("div",{className:m,children:[u,b]}),e[22]=m,e[23]=u,e[24]=b,e[25]=x):x=e[25],x}function Bs(s){return s.resourceUri}function Fs(s){return s.connection_id}function Qs(){const s=$.c(1);let e;return s[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"})]}),s[0]=e):e=s[0],e}function Ws({agent:s,home:e,connectionIds:t,pinnedResourceUris:r}){const{org:n}=V(),l=ee({connectionId:Le,orgId:n.id,orgSlug:n.slug}),{data:o,isLoading:c}=le({queryKey:oe.projectConnectionDetails(s.id,t),enabled:t.length>0,queryFn:async()=>(await Promise.all(t.map(async d=>{try{const m=await l.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:d}}),{item:u}=is(m),p=(u?.tools??[]).flatMap(g=>{const b=es(g._meta);return b?[{name:g.name,description:g.description,resourceUri:b}]:[]});return{id:d,title:u?.title??d,icon:u?.icon??null,uiTools:p}}catch{return{id:d,title:d,icon:null,uiTools:[]}}}))).filter(d=>d.uiTools.length>0)});return t.length===0?null:c?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(a=>a.uiTools.map(d=>i.jsx(qs,{agent:s,home:e,connection:a,tool:d,isPinned:r.has(d.resourceUri)},`${a.id}:${d.name}`)))})}function qs({agent:s,home:e,connection:t,tool:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=xe(s.metadata?.ui),d=n?a.filter(u=>u.resourceUri!==r.resourceUri):[...a,{connectionId:t.id,resourceUri:r.resourceUri}],m={...s.metadata??{},ui:{...s.metadata?.ui??{},homeTile:null,homeTiles:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle tile",a),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(ss,{icon:t.icon,name:t.title,size:"xs"}),i.jsx("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground",children:Qe(r.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Xe(s){const e=$.c(11),{isPinned:t,submitting:r,onClick:n,label:l}=s,o=t?"text-muted-foreground hover:bg-destructive/10 hover:text-destructive":"bg-foreground text-background hover:opacity-90";let c;e[0]!==o?(c=K("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]=c):c=e[1];let a;e[2]!==t||e[3]!==r?(a=r?i.jsx(Me,{size:12,className:"animate-spin"}):t?i.jsx(Ct,{size:14}):i.jsx(be,{size:14}),e[2]=t,e[3]=r,e[4]=a):a=e[4];let d;return e[5]!==l||e[6]!==n||e[7]!==r||e[8]!==c||e[9]!==a?(d=i.jsx("button",{type:"button",onClick:n,disabled:r,"aria-label":l,title:l,className:c,children:a}),e[5]=l,e[6]=n,e[7]=r,e[8]=c,e[9]=a,e[10]=d):d=e[10],d}function Ks(s){const e=$.c(32),{agent:t,home:r,curated:n}=s,{org:l}=V();let o;e[0]!==t.id||e[1]!==l.id||e[2]!==l.slug?(o={connectionId:t.id,orgId:l.id,orgSlug:l.slug},e[0]=t.id,e[1]=l.id,e[2]=l.slug,e[3]=o):o=e[3];const c=ee(o);let a;e[4]!==t.id||e[5]!==l.id?(a=oe.agentPrompts(l.id,t.id),e[4]=t.id,e[5]=l.id,e[6]=a):a=e[6];let d;e[7]!==c?(d=async()=>{const{prompts:j}=await c.listPrompts();return j.map(Zs)},e[7]=c,e[8]=d):d=e[8];let m;e[9]!==a||e[10]!==d?(m={queryKey:a,queryFn:d,staleTime:3e4,retry:!1},e[9]=a,e[10]=d,e[11]=m):m=e[11];const{data:u,isLoading:p,error:g}=le(m),b=ye(l.slug);let x,f;if(e[12]!==t.id||e[13]!==u||e[14]!==b.prompts){let j;e[17]!==t.id?(j=_=>_.agentId===t.id&&_.promptName,e[17]=t.id,e[18]=j):j=e[18],x=b.prompts.filter(j).map(Vs);let N;e[19]!==u?(N=u??[],e[19]=u,e[20]=N):N=e[20],f=[...N];for(const _ of x)f.some(T=>T.name===_.name)||f.push(_);e[12]=t.id,e[13]=u,e[14]=b.prompts,e[15]=x,e[16]=f}else x=e[15],f=e[16];if(p&&x.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(g&&x.length===0)return console.error("[home-tiles] listPrompts failed for agent",t.id,g),null;if(f.length===0)return null;let h;e[22]!==n||e[23]!==f?(h=n??f.map(Gs),e[22]=n,e[23]=f,e[24]=h):h=e[24];let y;e[25]!==h?(y=new Set(h),e[25]=h,e[26]=y):y=e[26];const w=y;let v;return e[27]!==t||e[28]!==r||e[29]!==f||e[30]!==w?(v=i.jsx("div",{className:"flex flex-col gap-0.5",children:f.map(j=>i.jsx(Js,{agent:t,home:r,prompt:j,allPromptNames:f.map(Xs),isPinned:w.has(j.name)},j.name))}),e[27]=t,e[28]=r,e[29]=f,e[30]=w,e[31]=v):v=e[31],v}function Xs(s){return s.name}function Gs(s){return s.name}function Vs(s){return{name:s.promptName,title:s.title,description:s.description}}function Zs(s){return{name:s.name,title:s.title,description:s.description}}function Js({agent:s,home:e,prompt:t,allPromptNames:r,isPinned:n}){const[l,o]=L.useState(!1),c=async()=>{if(!n&&!e.isOnHome(s.id)&&e.atLimit){W.error(`Home is full (${te}) — remove an agent first`);return}o(!0);try{const a=s.metadata?.ui?.homePrompts;let d;Array.isArray(a)?d=n?a.filter(u=>u!==t.name):[...a,t.name]:d=n?r.filter(u=>u!==t.name):r;const m={...s.metadata??{},ui:{...s.metadata?.ui??{},homePrompts:d}};await e.saveAgentMetadata(s,m)}catch(a){console.error("[home-tiles] failed to toggle prompt",a),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:t.title??Qe(t.name)}),i.jsx(Xe,{isPinned:n,submitting:l,onClick:c,label:n?"Remove from home":"Add to home"})]})}function Ys(){const s=$.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex flex-col gap-2 p-2",children:Array.from({length:4},ei)}),s[0]=e):e=s[0],e}function ei(s,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 J=1,Ge=`home-board.layout.v${J}`;function Ve(s){return`home-board.layout.v${J}.${s}`}const Ze={version:J,tiles:{},hidden:[]};function ue(s){return!s||s.version!==J?Ze:{version:J,tiles:s.tiles??{},hidden:Array.isArray(s.hidden)?s.hidden:[]}}function ti(s){return Object.keys(s.tiles).length>0||s.hidden.length>0}function si(s){try{const e=localStorage.getItem(Ve(s));return e?ue(JSON.parse(e)):void 0}catch{return}}function _e(s,e){try{localStorage.setItem(Ve(s),JSON.stringify(e))}catch{}}async function Ce(s,e){if(!(await fetch(`/api/${s}/kv/${Ge}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save board layout")}function ii(s){const e=$.c(24),t=pe();let r;e[0]!==s?(r=oe.boardLayout(s),e[0]=s,e[1]=r):r=e[1];const n=r;let l;e[2]!==s?(l=si(s),e[2]=s,e[3]=l):l=e[3];const o=l;let c;e[4]!==o||e[5]!==s?(c=async()=>{const h=await fetch(`/api/${s}/kv/${Ge}`);if(h.status===404)return o&&ti(o)?(await Ce(s,o),o):Ze;if(!h.ok)throw new Error("Failed to load board layout");const y=await h.json(),w=ue(y.value);return _e(s,w),w},e[4]=o,e[5]=s,e[6]=c):c=e[6];let a;e[7]!==o||e[8]!==n||e[9]!==c?(a={queryKey:n,queryFn:c,initialData:o,staleTime:0,refetchOnWindowFocus:!1},e[7]=o,e[8]=n,e[9]=c,e[10]=a):a=e[10];const{data:d,isLoading:m}=le(a);let u;e[11]!==s?(u={mutationFn:h=>Ce(s,h)},e[11]=s,e[12]=u):u=e[12];const p=ht(u);let g;e[13]!==p||e[14]!==s||e[15]!==t||e[16]!==n?(g=h=>{_e(s,h),t.setQueryData(n,h),p.mutate(h)},e[13]=p,e[14]=s,e[15]=t,e[16]=n,e[17]=g):g=e[17];const b=g;let x;e[18]!==d?(x=ue(d),e[18]=d,e[19]=x):x=e[19];let f;return e[20]!==m||e[21]!==b||e[22]!==x?(f={layout:x,isLoading:m,save:b},e[20]=m,e[21]=b,e[22]=x,e[23]=f):f=e[23],f}const Je=L.createContext(null);function ni(s){const e=$.c(24),{children:t}=s,{org:r}=V(),n=ii(r.slug),[l,o]=L.useState(!1),[c,a]=L.useState(null);let d;e[0]!==n.layout?(d=()=>{a(n.layout),o(!0)},e[0]=n.layout,e[1]=d):d=e[1];const m=d;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{a(null),o(!1)},e[2]=u):u=e[2];const p=u;let g;e[3]!==c||e[4]!==n?(g=()=>{c&&n.save(c),a(null),o(!1)},e[3]=c,e[4]=n,e[5]=g):g=e[5];const b=g,x=l&&c!==null,f=x?c:n.layout;let h;e[6]!==c||e[7]!==x||e[8]!==n.layout?(h=x?JSON.stringify(c)!==JSON.stringify(n.layout):!1,e[6]=c,e[7]=x,e[8]=n.layout,e[9]=h):h=e[9];const y=h;let w;e[10]!==l||e[11]!==n?(w=_=>{l?a(_):n.save(_)},e[10]=l,e[11]=n,e[12]=w):w=e[12];const v=w;let j;e[13]!==v||e[14]!==m||e[15]!==y||e[16]!==l||e[17]!==f||e[18]!==b||e[19]!==n.isLoading?(j={isEditMode:l,enter:m,cancel:p,save:b,hasChanges:y,layout:f,isLayoutLoading:n.isLoading,commitLayout:v},e[13]=v,e[14]=m,e[15]=y,e[16]=l,e[17]=f,e[18]=b,e[19]=n.isLoading,e[20]=j):j=e[20];let N;return e[21]!==t||e[22]!==j?(N=i.jsx(Je.Provider,{value:j,children:t}),e[21]=t,e[22]=j,e[23]=N):N=e[23],N}function Ye(){const s=L.useContext(Je);if(!s)throw new Error("useHomeEdit must be used within a HomeEditProvider");return s}function ri({agentId:s}){const{org:e,locator:t}=V(),r=ee({connectionId:s,orgId:e.id,orgSlug:e.slug}),{create:n}=ds(),{setTaskId:l}=Wt(),[o,c]=L.useState(null),[a,d]=L.useState(!1),m=L.useRef(!1),u=async(f,h)=>{if(!r){W.error("MCP client not available");return}if(!m.current){m.current=!0,d(!0);try{const y=await cs(r,f.name,h),w={type:"doc",content:[{type:"paragraph",content:[rs({id:f.name,name:os(f.name,ls(f._meta)),metadata:y.messages,char:"/",kind:"prompt",args:h}),{type:"text",text:" "}]}]},v=crypto.randomUUID();ms(sessionStorage,t,v,{tiptapDoc:w}),await n({id:v,virtual_mcp_id:s}),l(v,s,{autosend:!0})}catch(y){console.error("[start-thread-from-prompt] failed",y),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},p=async f=>{if(!m.current){if(f.arguments&&f.arguments.length>0){c(f);return}await u(f)}},g=async f=>{if(!o)return;const h=o;c(null),await u(h,f)};return{start:p,startBlank:async()=>{if(!m.current){m.current=!0,d(!0);try{const f=crypto.randomUUID();await n({id:f,virtual_mcp_id:s}),l(f,s)}catch(f){console.error("[start-thread-from-prompt] startBlank failed",f),W.error("Failed to start thread. Please try again.")}finally{m.current=!1,d(!1)}}},dialog:i.jsx(ns,{prompt:o,setPrompt:f=>c(f),onSubmit:g}),dialogPrompt:o,starting:a}}const G=4,X=100,Te=12,ie={S:{w:1,h:1},M:{w:1,h:2},T:{w:1,h:3},L:{w:2,h:1},XL:{w:2,h:2},LT:{w:2,h:3},XLT:{w:2,h:4},XXLT:{w:2,h:5},W:{w:4,h:1},WT:{w:4,h:3}},oi={S:"Small",M:"Tall",T:"Column",L:"Wide",XL:"Large",LT:"Showcase",XLT:"Display",XXLT:"Tower",W:"Full width",WT:"Hero"},Ee=["S","M","T","L","XL","LT","XLT","XXLT","W","WT"],li=ie.XL;class fe extends L.Component{state={hasError:!1};static getDerivedStateFromError(e){return{hasError:!0,message:e instanceof Error?e.message:"Unknown error"}}componentDidCatch(e,t){console.error("[home-tiles] tile crashed:",e,t.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(pt,{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 ai(s){const e=$.c(72),{tiles:t,isEditMode:r,renderTile:n,onMove:l,onResize:o,onRemove:c}=s,a=ge(),d=L.useRef(null),[m,u]=L.useState(null),[p,g]=L.useState(null);let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={activationConstraint:{distance:4}},e[0]=b):b=e[0];const x=Oe(re(De,b),re(Re)),f=t.reduce(ci,0),h=r?Math.max(f+2,4):Math.max(f,1);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=()=>{const M=d.current?.getBoundingClientRect();return M?{cellWidth:M.width/G,cellHeight:X}:null},e[1]=y):y=e[1];const w=y;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=M=>{u(String(M.active.id)),g(w())},e[2]=v):v=e[2];const j=v;let N;e[3]!==p||e[4]!==l||e[5]!==t?(N=M=>{const F=String(M.active.id),P=p??w();if(u(null),g(null),!P||P.cellWidth<=0)return;const R=t.find(q=>q.id===F);if(!R)return;const U=Math.round(M.delta.x/P.cellWidth),B=Math.round(M.delta.y/P.cellHeight);U===0&&B===0||l(F,{x:R.x+U,y:R.y+B})},e[3]=p,e[4]=l,e[5]=t,e[6]=N):N=e[6];const _=N;if(a){let M;if(e[7]!==n||e[8]!==t){let P;e[10]!==n?(P=R=>i.jsx("div",{className:"bg-card card-shadow rounded-2xl overflow-hidden",style:{minHeight:X},children:i.jsx(fe,{children:n(R)})},R.id),e[10]=n,e[11]=P):P=e[11],M=t.map(P),e[7]=n,e[8]=t,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 T,S,E,k,C,I,A,D,z;if(e[14]!==m||e[15]!==p||e[16]!==r||e[17]!==_||e[18]!==c||e[19]!==o||e[20]!==n||e[21]!==x||e[22]!==t||e[23]!==h){const M=m?t.find(Z=>Z.id===m):null;S=Pe,D=x,z=j,E=_;const F=h*X,P=r?X*4:X;let R;e[33]!==F||e[34]!==P?(R={height:F,minHeight:P},e[33]=F,e[34]=P,e[35]=R):R=e[35];let U;e[36]!==r||e[37]!==t||e[38]!==h?(U=r&&i.jsx(di,{rows:h,tiles:t}),e[36]=r,e[37]=t,e[38]=h,e[39]=U):U=e[39];let B;if(e[40]!==m||e[41]!==r||e[42]!==c||e[43]!==o||e[44]!==n||e[45]!==t){let Z;e[47]!==m||e[48]!==r||e[49]!==c||e[50]!==o||e[51]!==n?(Z=se=>i.jsx(ui,{tile:se,isEditMode:r,isDragging:m===se.id,onResize:o,onRemove:c,children:n(se)},se.id),e[47]=m,e[48]=r,e[49]=c,e[50]=o,e[51]=n,e[52]=Z):Z=e[52],B=t.map(Z),e[40]=m,e[41]=r,e[42]=c,e[43]=o,e[44]=n,e[45]=t,e[46]=B}else B=e[46];e[53]!==R||e[54]!==U||e[55]!==B?(k=i.jsxs("div",{ref:d,className:"relative w-full",style:R,children:[U,B]}),e[53]=R,e[54]=U,e[55]=B,e[56]=k):k=e[56],T=Bt,C=null;const q=M&&p?M.w*p.cellWidth-Te:void 0,ae=M&&p?M.h*p.cellHeight-Te:void 0;e[57]!==q||e[58]!==ae?(I={width:q,height:ae},e[57]=q,e[58]=ae,e[59]=I):I=e[59],A=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(fe,{children:n(M)})}),e[14]=m,e[15]=p,e[16]=r,e[17]=_,e[18]=c,e[19]=o,e[20]=n,e[21]=x,e[22]=t,e[23]=h,e[24]=T,e[25]=S,e[26]=E,e[27]=k,e[28]=C,e[29]=I,e[30]=A,e[31]=D,e[32]=z}else T=e[24],S=e[25],E=e[26],k=e[27],C=e[28],I=e[29],A=e[30],D=e[31],z=e[32];let O;e[60]!==T||e[61]!==C||e[62]!==I||e[63]!==A?(O=i.jsx(T,{dropAnimation:C,style:I,children:A}),e[60]=T,e[61]=C,e[62]=I,e[63]=A,e[64]=O):O=e[64];let Q;return e[65]!==S||e[66]!==E||e[67]!==k||e[68]!==O||e[69]!==D||e[70]!==z?(Q=i.jsxs(S,{sensors:D,onDragStart:z,onDragEnd:E,children:[k,O]}),e[65]=S,e[66]=E,e[67]=k,e[68]=O,e[69]=D,e[70]=z,e[71]=Q):Q=e[71],Q}function ci(s,e){return Math.max(s,e.y+e.h)}function di(s){const e=$.c(7),{rows:t,tiles:r}=s;let n;e[0]!==r?(n=(a,d)=>r.some(m=>a>=m.x&&a<m.x+m.w&&d>=m.y&&d<m.y+m.h),e[0]=r,e[1]=n):n=e[1];const l=n;let o;if(e[2]!==l||e[3]!==t){o=[];for(let a=0;a<t;a++)for(let d=0;d<G;d++)l(d,a)||o.push({x:d,y:a});e[2]=l,e[3]=t,e[4]=o}else o=e[4];let c;return e[5]!==o?(c=i.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(mi)}),e[5]=o,e[6]=c):c=e[6],c}function mi(s){return i.jsx("div",{className:"absolute p-1",style:{left:`${s.x/G*100}%`,top:s.y*X,width:`${1/G*100}%`,height:X},children:i.jsx("div",{className:"h-full w-full rounded-2xl border border-dashed border-border/60"})},`${s.x}-${s.y}`)}function ui(s){const e=$.c(31),{tile:t,isEditMode:r,isDragging:n,onResize:l,onRemove:o,children:c}=s,a=!r;let d;e[0]!==a||e[1]!==t.id?(d={id:t.id,disabled:a},e[0]=a,e[1]=t.id,e[2]=d):d=e[2];const{setNodeRef:m,attributes:u,listeners:p,isDragging:g}=Ft(d),b=`${t.x/G*100}%`,x=`${t.w/G*100}%`,f=t.y*X,h=t.h*X,y=g||n,w=!y&&"transition-[left,top,width,height,opacity] duration-200 ease-out",v=y&&"opacity-30";let j;e[3]!==w||e[4]!==v?(j=K("absolute p-1 will-change-[left,top,width,height,opacity]",w,v),e[3]=w,e[4]=v,e[5]=j):j=e[5];let N;e[6]!==h||e[7]!==b||e[8]!==f||e[9]!==x?(N={left:b,top:f,width:x,height:h},e[6]=h,e[7]=b,e[8]=f,e[9]=x,e[10]=N):N=e[10];const _=r&&"outline outline-1 outline-transparent hover:outline-primary/40";let T;e[11]!==_?(T=K("relative h-full bg-card card-shadow rounded-2xl overflow-hidden",_),e[11]=_,e[12]=T):T=e[12];let S;e[13]!==u||e[14]!==r||e[15]!==p||e[16]!==o||e[17]!==l||e[18]!==t?(S=r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",...u,...p,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(Fe,{size:16})}),i.jsx("div",{className:"absolute top-2 right-2 z-10 flex items-center gap-1",children:i.jsx(fi,{tile:t,onResize:l,onRemove:o})})]}),e[13]=u,e[14]=r,e[15]=p,e[16]=o,e[17]=l,e[18]=t,e[19]=S):S=e[19];let E;e[20]!==c?(E=i.jsx("div",{className:"h-full overflow-hidden",children:i.jsx(fe,{children:c})}),e[20]=c,e[21]=E):E=e[21];let k;e[22]!==E||e[23]!==T||e[24]!==S?(k=i.jsxs("div",{className:T,children:[S,E]}),e[22]=E,e[23]=T,e[24]=S,e[25]=k):k=e[25];let C;return e[26]!==m||e[27]!==k||e[28]!==j||e[29]!==N?(C=i.jsx("div",{ref:m,className:j,style:N,children:k}),e[26]=m,e[27]=k,e[28]=j,e[29]=N,e[30]=C):C=e[30],C}function fi(s){const e=$.c(43),{tile:t,onResize:r,onRemove:n}=s,l=t.minW??1,o=t.minH??1;let c,a,d,m,u,p,g;if(e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==t.h||e[4]!==t.id||e[5]!==t.w){let v;e[13]!==o||e[14]!==l?(v=S=>{const E=ie[S];return E.w>=l&&E.h>=o},e[13]=o,e[14]=l,e[15]=v):v=e[15];const j=Ee.filter(v);let N;e[16]!==t.h||e[17]!==t.w?(N=(()=>{for(const E of Ee){const k=ie[E];if(k.w===t.w&&k.h===t.h)return E}return null})(),e[16]=t.h,e[17]=t.w,e[18]=N):N=e[18];const _=N;a=us,e[19]===Symbol.for("react.memo_cache_sentinel")?(g=i.jsx(fs,{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(Tt,{size:16})})}),e[19]=g):g=e[19],c=hs,d="end",m="w-44",e[20]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ps,{children:"Size"}),e[20]=u):u=e[20];let T;e[21]!==_||e[22]!==r||e[23]!==t.id?(T=S=>{const E=ie[S];return i.jsxs(Ne,{onSelect:()=>r(t.id,E),className:"flex items-center justify-between",children:[i.jsx("span",{children:oi[S]}),i.jsx("span",{className:"text-xs text-muted-foreground",children:_===S?"✓":`${E.w}×${E.h}`})]},S)},e[21]=_,e[22]=r,e[23]=t.id,e[24]=T):T=e[24],p=j.map(T),e[0]=o,e[1]=l,e[2]=r,e[3]=t.h,e[4]=t.id,e[5]=t.w,e[6]=c,e[7]=a,e[8]=d,e[9]=m,e[10]=u,e[11]=p,e[12]=g}else c=e[6],a=e[7],d=e[8],m=e[9],u=e[10],p=e[11],g=e[12];let b;e[25]===Symbol.for("react.memo_cache_sentinel")?(b=i.jsx(xs,{}),e[25]=b):b=e[25];let x;e[26]!==n||e[27]!==t.id?(x=()=>n(t.id),e[26]=n,e[27]=t.id,e[28]=x):x=e[28];let f;e[29]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(gs,{size:14,className:"mr-2"}),e[29]=f):f=e[29];let h;e[30]!==x?(h=i.jsxs(Ne,{onSelect:x,className:"text-destructive focus:text-destructive",children:[f,"Remove tile"]}),e[30]=x,e[31]=h):h=e[31];let y;e[32]!==c||e[33]!==d||e[34]!==m||e[35]!==u||e[36]!==p||e[37]!==h?(y=i.jsxs(c,{align:d,className:m,children:[u,p,b,h]}),e[32]=c,e[33]=d,e[34]=m,e[35]=u,e[36]=p,e[37]=h,e[38]=y):y=e[38];let w;return e[39]!==a||e[40]!==y||e[41]!==g?(w=i.jsxs(a,{children:[g,y]}),e[39]=a,e[40]=y,e[41]=g,e[42]=w):w=e[42],w}function hi(s,e,t){return s.some(r=>e>=r.x&&e<r.x+r.w&&t>=r.y&&t<r.y+r.h)}function he(s,e,t){for(let r=0;r<100;r++)for(let n=0;n<=G-e;n++){let l=!0;for(let o=0;o<t&&l;o++)for(let c=0;c<e&&l;c++)hi(s,n+c,r+o)&&(l=!1);if(l)return{x:n,y:r}}return{x:0,y:0}}function ce(s,e,t={w:1,h:1}){const r=Math.max(t.w,Math.min(G,s)),n=Math.max(t.h,Math.min(6,e));return{w:r,h:n}}function de(s,e,t){const r=Math.max(0,Math.min(G-t,s)),n=Math.max(0,e);return{x:r,y:n}}function pi(s,e,t){const r=s.find(a=>a.id===e);if(!r)return s;const n=s.filter(a=>a.id!==e),l=n.find(a=>t.x>=a.x&&t.x<a.x+a.w&&t.y>=a.y&&t.y<a.y+a.h);if(l&&l.w===r.w&&l.h===r.h)return s.map(a=>a.id===e?{...a,x:l.x,y:l.y}:a.id===l.id?{...a,x:r.x,y:r.y}:a);const c=[{...r,x:t.x,y:t.y}];for(const a of n){const d=he(c,a.w,a.h);c.push({...a,x:d.x,y:d.y})}return c}function xi(s){const e=$.c(35),{layout:t,isLayoutLoading:r,commitLayout:n}=Ye();let l;e[0]!==t.hidden?(l=new Set(t.hidden),e[0]=t.hidden,e[1]=l):l=e[1];const o=l;let c,a;if(e[2]!==s||e[3]!==o||e[4]!==t.tiles){a=[];let y;e[7]!==o?(y=v=>v.pinned||!o.has(v.id),e[7]=o,e[8]=y):y=e[8];const w=s.filter(y);c=new Map;for(const v of s)v.minSize&&c.set(v.id,v.minSize);for(const v of w){const j=t.tiles[v.id];if(!j)continue;const N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),{x:S,y:E}=de(j.x,j.y,_);a.push({id:v.id,x:S,y:E,w:_,h:T,minW:N?.w,minH:N?.h})}for(const v of w){if(a.some(E=>E.id===v.id))continue;const j=v.defaultSize??li,N=c.get(v.id),{w:_,h:T}=ce(j.w,j.h,N),S=he(a,_,T);a.push({id:v.id,x:S.x,y:S.y,w:_,h:T,minW:N?.w,minH:N?.h})}e[2]=s,e[3]=o,e[4]=t.tiles,e[5]=c,e[6]=a}else c=e[5],a=e[6];let d;e[9]!==s?(d=new Set(s.map(gi)),e[9]=s,e[10]=d):d=e[10];const m=d;let u;e[11]!==m||e[12]!==n?(u=(y,w)=>{const v={};for(const j of y)v[j.id]={x:j.x,y:j.y,w:j.w,h:j.h};n({version:J,tiles:v,hidden:w.filter(j=>m.has(j))})},e[11]=m,e[12]=n,e[13]=u):u=e[13];const p=u;let g;e[14]!==a?(g={visible:a},e[14]=a,e[15]=g):g=e[15];let b;e[16]!==p||e[17]!==t||e[18]!==a?(b=(y,w)=>{const v=a.find(_=>_.id===y);if(!v)return;const j=de(w.x,w.y,v.w);if(j.x===v.x&&j.y===v.y)return;const N=pi(a,y,j);p(N,t.hidden)},e[16]=p,e[17]=t,e[18]=a,e[19]=b):b=e[19];let x;e[20]!==p||e[21]!==t||e[22]!==c||e[23]!==a?(x=(y,w)=>{const v=a.find(k=>k.id===y);if(!v)return;const j=c.get(y),{w:N,h:_}=ce(w.w,w.h,j);if(N===v.w&&_===v.h)return;const T={...v,w:N,h:_,x:de(v.x,v.y,N).x},S=a.filter(k=>k.id!==y),E=[T];for(const k of S){const C=he(E,k.w,k.h);E.push({...k,x:C.x,y:C.y})}p(E,t.hidden)},e[20]=p,e[21]=t,e[22]=c,e[23]=a,e[24]=x):x=e[24];let f;e[25]!==p||e[26]!==t||e[27]!==a?(f=y=>{const w=a.filter(v=>v.id!==y);p(w,Array.from(new Set([...t.hidden,y])))},e[25]=p,e[26]=t,e[27]=a,e[28]=f):f=e[28];let h;return e[29]!==r||e[30]!==g||e[31]!==b||e[32]!==x||e[33]!==f?(h={snapshot:g,isLoading:r,moveTile:b,resizeTile:x,hideTile:f},e[29]=r,e[30]=g,e[31]=b,e[32]=x,e[33]=f,e[34]=h):h=e[34],h}function gi(s){return s.id}const bi={w:2,h:4},yi={w:1,h:2},vi={w:1,h:1};function ji(s){return`prompt:${s.agentId}:${s.promptName||"blank"}`}function wi(s){return`tile:${s.agentId}:${s.resourceUri}`}function Ni(s){return s.promptName?s.agentName:s.description}function Si(s){return{name:s.promptName,title:s.title,description:s.description,arguments:s.arguments,_meta:s._meta}}function ve(s){const e=$.c(10);let t;e[0]!==s?(t={agentId:s},e[0]=s,e[1]=t):t=e[1];const{start:r,startBlank:n,dialog:l,starting:o}=ri(t);let c;e[2]!==r||e[3]!==n?(c=m=>{if(!m.promptName){n();return}r(Si(m))},e[2]=r,e[3]=n,e[4]=c):c=e[4];const a=c;let d;return e[5]!==l||e[6]!==a||e[7]!==n||e[8]!==o?(d={open:a,startBlank:n,dialog:l,starting:o},e[5]=l,e[6]=a,e[7]=n,e[8]=o,e[9]=d):d=e[9],d}function _i(s){const e=$.c(32),{entry:t,isEditMode:r}=s,{open:n,dialog:l,starting:o}=ve(t.agentId);let c;e[0]!==t||e[1]!==n?(c=()=>n(t),e[0]=t,e[1]=n,e[2]=c):c=e[2];const a=o||r,d=!r&&"cursor-pointer transition-colors hover:bg-accent/40",m=r&&"cursor-default pl-12",u=o&&"opacity-60";let p;e[3]!==d||e[4]!==m||e[5]!==u?(p=K("group/tile relative flex h-full w-full items-center gap-3 px-4 py-3 text-left bg-card",d,m,u),e[3]=d,e[4]=m,e[5]=u,e[6]=p):p=e[6];let g;e[7]!==t.agentIcon||e[8]!==t.agentName?(g=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[7]=t.agentIcon,e[8]=t.agentName,e[9]=g):g=e[9];let b;e[10]!==t.title?(b=i.jsx("div",{className:"line-clamp-2 text-sm font-medium text-foreground leading-snug",children:t.title}),e[10]=t.title,e[11]=b):b=e[11];let x;e[12]!==t?(x=Ni(t),e[12]=t,e[13]=x):x=e[13];let f;e[14]!==x?(f=i.jsx("div",{className:"truncate text-xs text-muted-foreground mt-0.5",children:x}),e[14]=x,e[15]=f):f=e[15];let h;e[16]!==f||e[17]!==b?(h=i.jsxs("div",{className:"min-w-0 flex-1",children:[b,f]}),e[16]=f,e[17]=b,e[18]=h):h=e[18];let y;e[19]!==r?(y=!r&&i.jsx(as,{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]=y):y=e[20];let w;e[21]!==o||e[22]!==c||e[23]!==h||e[24]!==y||e[25]!==a||e[26]!==p||e[27]!==g?(w=i.jsxs("button",{type:"button",onClick:c,disabled:a,"aria-busy":o,className:p,children:[g,h,y]}),e[21]=o,e[22]=c,e[23]=h,e[24]=y,e[25]=a,e[26]=p,e[27]=g,e[28]=w):w=e[28];let v;return e[29]!==l||e[30]!==w?(v=i.jsxs(i.Fragment,{children:[w,l]}),e[29]=l,e[30]=w,e[31]=v):v=e[31],v}function Ci(){const s=$.c(1);let e;return s[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},Ti)}),s[0]=e):e=s[0],e}function Ti(s,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 Ei(s){const e=$.c(59),{tile:t,prompts:r,isEditMode:n,tileWidth:l}=s,{org:o}=V();let c;e[0]!==o.id||e[1]!==o.slug||e[2]!==t.connectionId?(c={connectionId:t.connectionId,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=t.connectionId,e[3]=c):c=e[3];const a=ee(c),{open:d,startBlank:m,dialog:u,starting:p}=ve(t.agentId);let g,b,x,f,h;if(e[4]!==a||e[5]!==n||e[6]!==d||e[7]!==o.id||e[8]!==r||e[9]!==m||e[10]!==p||e[11]!==t.agentIcon||e[12]!==t.agentName||e[13]!==t.maxHeight||e[14]!==t.minHeight||e[15]!==t.resourceUri||e[16]!==l){const v=r.filter(ki);f="flex h-full w-full flex-col gap-3 p-3";let j;e[22]!==m?(j=()=>{m()},e[22]=m,e[23]=j):j=e[23];const N=p||n,_=n&&"pl-10 pr-10";let T;e[24]!==_?(T=K("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",_),e[24]=_,e[25]=T):T=e[25];let S;e[26]!==t.agentIcon||e[27]!==t.agentName?(S=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[26]=t.agentIcon,e[27]=t.agentName,e[28]=S):S=e[28];let E;e[29]!==t.agentName?(E=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[29]=t.agentName,e[30]=E):E=e[30];const k=n?"Drag to rearrange":"Open chat";let C;e[31]!==k?(C=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:k}),e[31]=k,e[32]=C):C=e[32];let I;e[33]!==E||e[34]!==C?(I=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[E,C]}),e[33]=E,e[34]=C,e[35]=I):I=e[35],e[36]!==p||e[37]!==T||e[38]!==S||e[39]!==I||e[40]!==j||e[41]!==N?(h=i.jsxs("button",{type:"button",onClick:j,disabled:N,"aria-busy":p,className:T,children:[S,I]}),e[36]=p,e[37]=T,e[38]=S,e[39]=I,e[40]=j,e[41]=N,e[42]=h):h=e[42],g="flex min-h-0 flex-1 gap-3 overflow-hidden";let A;e[43]===Symbol.for("react.memo_cache_sentinel")?(A=i.jsx(Ii,{}),e[43]=A):A=e[43];const D=t.minHeight??200,z=t.maxHeight??4e3;e[44]!==a||e[45]!==o.id||e[46]!==D||e[47]!==z||e[48]!==t.resourceUri?(b=i.jsx("div",{className:"min-h-0 flex-1 overflow-hidden rounded-lg border border-border",children:i.jsx(L.Suspense,{fallback:A,children:i.jsx(ts,{resourceURI:t.resourceUri,orgId:o.id,client:a,displayMode:"fullscreen",minHeight:D,maxHeight:z,className:"h-full"})})}),e[44]=a,e[45]=o.id,e[46]=D,e[47]=z,e[48]=t.resourceUri,e[49]=b):b=e[49],x=v.length>0&&!n&&l>=2&&i.jsx("div",{className:"flex w-44 shrink-0 flex-col gap-2 overflow-hidden",children:v.map(O=>i.jsx("button",{type:"button",onClick:()=>d(O),disabled:p,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:O.title})},O.promptName))}),e[4]=a,e[5]=n,e[6]=d,e[7]=o.id,e[8]=r,e[9]=m,e[10]=p,e[11]=t.agentIcon,e[12]=t.agentName,e[13]=t.maxHeight,e[14]=t.minHeight,e[15]=t.resourceUri,e[16]=l,e[17]=g,e[18]=b,e[19]=x,e[20]=f,e[21]=h}else g=e[17],b=e[18],x=e[19],f=e[20],h=e[21];let y;e[50]!==g||e[51]!==b||e[52]!==x?(y=i.jsxs("div",{className:g,children:[b,x]}),e[50]=g,e[51]=b,e[52]=x,e[53]=y):y=e[53];let w;return e[54]!==u||e[55]!==f||e[56]!==h||e[57]!==y?(w=i.jsxs("div",{className:f,children:[h,y,u]}),e[54]=u,e[55]=f,e[56]=h,e[57]=y,e[58]=w):w=e[58],w}function ki(s){return!!s.promptName}function Ii(){const s=$.c(1);let e;return s[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"})]}),s[0]=e):e=s[0],e}function $i(s){const e=$.c(14),{icon:t,name:r}=s;let n;e[0]!==t||e[1]!==r?(n=i.jsx(Y,{icon:t,name:r,size:"sm+"}),e[0]=t,e[1]=r,e[2]=n):n=e[2];let l;e[3]!==r?(l=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:r}),e[3]=r,e[4]=l):l=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 c;e[6]!==l?(c=i.jsxs("div",{className:"min-w-0 flex-1",children:[l,o]}),e[6]=l,e[7]=c):c=e[7];let a;e[8]!==n||e[9]!==c?(a=i.jsxs("div",{className:"flex items-center gap-2.5",children:[n,c]}),e[8]=n,e[9]=c,e[10]=a):a=e[10];let d;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=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]=d):d=e[11];let m;return e[12]!==a?(m=i.jsxs("div",{className:"flex h-full w-full flex-col gap-3 p-5 opacity-60",children:[a,d]}),e[12]=a,e[13]=m):m=e[13],m}function Ai(s){const e=$.c(33),{tile:t,prompts:r,isEditMode:n}=s,{open:l,startBlank:o,dialog:c,starting:a}=ve(t.agentId);let d,m,u;if(e[0]!==n||e[1]!==l||e[2]!==r||e[3]!==o||e[4]!==a||e[5]!==t.agentIcon||e[6]!==t.agentName){const g=r.filter(Mi);d="flex h-full w-full flex-col gap-3 p-4";let b;e[10]!==o?(b=()=>{o()},e[10]=o,e[11]=b):b=e[11];const x=a||n,f=n&&"pl-10 pr-10";let h;e[12]!==f?(h=K("flex items-center gap-3 rounded-lg text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",f),e[12]=f,e[13]=h):h=e[13];let y;e[14]!==t.agentIcon||e[15]!==t.agentName?(y=i.jsx(Y,{icon:t.agentIcon,name:t.agentName,size:"sm+"}),e[14]=t.agentIcon,e[15]=t.agentName,e[16]=y):y=e[16];let w;e[17]!==t.agentName?(w=i.jsx("div",{className:"truncate text-sm font-medium text-foreground",children:t.agentName}),e[17]=t.agentName,e[18]=w):w=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx("div",{className:"truncate text-xs text-muted-foreground",children:"UI unavailable — open chat"}),e[19]=v):v=e[19];let j;e[20]!==w?(j=i.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,v]}),e[20]=w,e[21]=j):j=e[21],e[22]!==j||e[23]!==b||e[24]!==x||e[25]!==h||e[26]!==y?(m=i.jsxs("button",{type:"button",onClick:b,disabled:x,className:h,children:[y,j]}),e[22]=j,e[23]=b,e[24]=x,e[25]=h,e[26]=y,e[27]=m):m=e[27],u=g.length>0&&!n&&i.jsx("div",{className:"grid grid-cols-1 gap-2 overflow-hidden sm:grid-cols-2",children:g.map(N=>i.jsx("button",{type:"button",onClick:()=>!n&&l(N),disabled:a,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]=l,e[2]=r,e[3]=o,e[4]=a,e[5]=t.agentIcon,e[6]=t.agentName,e[7]=d,e[8]=m,e[9]=u}else d=e[7],m=e[8],u=e[9];let p;return e[28]!==c||e[29]!==d||e[30]!==m||e[31]!==u?(p=i.jsxs("div",{className:d,children:[m,u,c]}),e[28]=c,e[29]=d,e[30]=m,e[31]=u,e[32]=p):p=e[32],p}function Mi(s){return!!s.promptName}function et(s){const e=$.c(36),{isEditMode:t}=s,{org:r}=V(),{isLoading:n,prompts:l,tiles:o}=ye(r.slug),c=He()?.ids??[];let a;e[0]!==c?(a=new Set(c),e[0]=c,e[1]=a):a=e[1];const d=a,m=Ue();let u;e[2]!==o?(u=new Set(o.map(Di)),e[2]=o,e[3]=u):u=e[3];const p=u;let g;if(e[4]!==l){g=new Map;for(const C of l){const I=g.get(C.agentId);I?I.push(C):g.set(C.agentId,[C])}e[4]=l,e[5]=g}else g=e[5];let b;if(e[6]!==l||e[7]!==p||e[8]!==o){let C;e[10]!==p?(C=A=>!p.has(A.agentId),e[10]=p,e[11]=C):C=e[11];const I=l.filter(C);b=[...o.map(Ri),...I.map(Oi)],e[6]=l,e[7]=p,e[8]=o,e[9]=b}else b=e[9];const x=b;let f;e[12]!==x?(f=new Map(x.map(zi)),e[12]=x,e[13]=f):f=e[13];const h=f;let y;e[14]!==x||e[15]!==d?(y=x.map(C=>({id:C.id,defaultSize:C.kind==="tile"?bi:vi,minSize:C.kind==="tile"?yi:void 0,pinned:d.has(C.data.agentId)})),e[14]=x,e[15]=d,e[16]=y):y=e[16];const w=xi(y);let v;e[17]!==m?(v=C=>{m.apply(I=>I.filter(A=>A!==C)).catch(Li)},e[17]=m,e[18]=v):v=e[18];const j=v;let N;e[19]!==h||e[20]!==w||e[21]!==d||e[22]!==j?(N=C=>{const I=h.get(C);I&&d.has(I.data.agentId)?j(I.data.agentId):w.hideTile(C)},e[19]=h,e[20]=w,e[21]=d,e[22]=j,e[23]=N):N=e[23];const _=N;let T;e[24]!==h||e[25]!==t||e[26]!==g?(T=C=>{const I=h.get(C.id);if(!I)return null;if(I.kind==="tile"){const A=g.get(I.data.agentId)??[];return i.jsx(xt,{fallback:i.jsx(Ai,{tile:I.data,prompts:A,isEditMode:t}),children:i.jsx(L.Suspense,{fallback:i.jsx($i,{icon:I.data.agentIcon,name:I.data.agentName}),children:i.jsx(Ei,{tile:I.data,prompts:A,isEditMode:t,tileWidth:C.w})})})}return i.jsx(_i,{entry:I.data,isEditMode:t})},e[24]=h,e[25]=t,e[26]=g,e[27]=T):T=e[27];const S=T;if(n||w.isLoading){let C;return e[28]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(Ci,{}),e[28]=C):C=e[28],C}if(w.snapshot.visible.length===0&&!t)return null;let k;return e[29]!==t||e[30]!==w.moveTile||e[31]!==w.resizeTile||e[32]!==w.snapshot.visible||e[33]!==_||e[34]!==S?(k=i.jsx("div",{className:"mt-4 flex w-full max-w-7xl flex-col gap-4",children:i.jsx(ai,{tiles:w.snapshot.visible,isEditMode:t,renderTile:S,onMove:w.moveTile,onResize:w.resizeTile,onRemove:_})}),e[29]=t,e[30]=w.moveTile,e[31]=w.resizeTile,e[32]=w.snapshot.visible,e[33]=_,e[34]=S,e[35]=k):k=e[35],k}function Li(){return W.error("Couldn't remove from home — please try again.")}function zi(s){return[s.id,s]}function Oi(s){return{kind:"prompt",id:ji(s),data:s}}function Ri(s){return{kind:"tile",id:wi(s),data:s}}function Di(s){return s.agentId}function Pi(s){const e=$.c(2),{prompts:t,tiles:r}=ye(s),n=r.length>0||t.length>0;let l;return e[0]!==n?(l={hasVisibleTiles:n},e[0]=n,e[1]=l):l=e[1],l}const ke=420,Ie=305;function tt(){const s=$.c(4);let e;s[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:ke}}),s[0]=e):e=s[0];let t;s[1]===Symbol.for("react.memo_cache_sentinel")?(t=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:ke}}),s[1]=t):t=s[1];let r;s[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:Ie}}),s[2]=r):r=s[2];let n;return s[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,t,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:Ie}})]}),s[3]=n):n=s[3],n}function $e(){const s=$.c(33),{data:e}=gt.useSession(),{org:t}=V(),r=ge(),n=At(),{selectedVirtualMcp:l}=Mt();let o;s[0]!==t.id?(o=yt(t.id),s[0]=t.id,s[1]=o):o=s[1];const a=l??o;let d;s[2]!==t.slug?(d=qt(t.slug),s[2]=t.slug,s[3]=d):d=s[3],le(d);let m;s[4]!==t.id||s[5]!==t.slug?(m={connectionId:Le,orgId:t.id,orgSlug:t.slug},s[4]=t.id,s[5]=t.slug,s[6]=m):m=s[6];const u=ee(m);let p;s[7]!==t.id||s[8]!==u?(p=bs(u,t.id),s[7]=t.id,s[8]=u,s[9]=p):p=s[9];let g;s[10]!==t.id||s[11]!==u?(g=Qt(u,t.id),s[10]=t.id,s[11]=u,s[12]=g):g=s[12];let b;s[13]!==a.id||s[14]!==t.id||s[15]!==u?(b=wt(t.id,a.id,u),s[13]=a.id,s[14]=t.id,s[15]=u,s[16]=b):b=s[16];let x;s[17]!==p||s[18]!==g||s[19]!==b?(x={queries:[p,g,b]},s[17]=p,s[18]=g,s[19]=b,s[20]=x):x=s[20],Ss(x);const f=ys(),h=Nt(a.id),{hasDecoKey:y,isZeroBalance:w,isInitialFreeCredit:v,balanceDollars:j,hasOnlyDecoProvider:N}=kt(),{hasVisibleTiles:_}=Pi(t.slug),T=It(h?.metadata);if(f.length===0&&!(T&&$t(n))){let O;return s[21]===Symbol.for("react.memo_cache_sentinel")?(O=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(Lt,{})})}),s[21]=O):O=s[21],O}let E;s[22]!==e?.user?.name?(E=e?.user?.name?.split(" ")[0]||"there",s[22]=e?.user?.name,s[23]=E):E=s[23];const k=E,C=y&&v&&j!=null,I=y&&w&&N;let A;s[24]!==j||s[25]!==C||s[26]!==I?(A=C?i.jsx(ne.CreditsEyebrow,{balanceDollars:j}):I?i.jsx(ne.NoCreditsEyebrow,{}):null,s[24]=j,s[25]=C,s[26]=I,s[27]=A):A=s[27];const D=A;let z;return s[28]!==D||s[29]!==_||s[30]!==r||s[31]!==k?(z=i.jsx(ni,{children:r?i.jsx(Hi,{eyebrow:D,userName:k}):i.jsx(Ui,{eyebrow:D,userName:k,hasVisibleTiles:_})}),s[28]=D,s[29]=_,s[30]=r,s[31]=k,s[32]=z):z=s[32],z}function Hi(s){const e=$.c(12),{eyebrow:t,userName:r}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsx(tt,{}),e[0]=n):n=e[0];let l;e[1]!==t?(l=t&&i.jsx("div",{className:"mb-4",children:t}),e[1]=t,e[2]=l):l=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 c;e[5]!==l||e[6]!==o?(c=i.jsxs("div",{className:"relative flex flex-col items-center justify-center w-full pt-28 pb-8 px-4",children:[l,o]}),e[5]=l,e[6]=o,e[7]=c):c=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx("div",{className:"relative w-full flex flex-col gap-4 pb-8 px-4",children:i.jsx(ne.Input,{showConnectionsBanner:!0})}),e[8]=a):a=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("div",{className:"relative w-full px-4 pb-8",children:i.jsx(et,{isEditMode:!1})}),e[9]=d):d=e[9];let m;return e[10]!==c?(m=i.jsxs("div",{className:"flex-1 relative flex flex-col items-center overflow-y-auto",children:[n,c,a,d]}),e[10]=c,e[11]=m):m=e[11],m}function Ui(s){const e=$.c(32),{eyebrow:t,userName:r,hasVisibleTiles:n}=s,{isEditMode:l,enter:o,save:c,cancel:a,hasChanges:d}=Ye(),[m,u]=L.useState(!1);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(!0),e[0]=p):p=e[0];let g;e[1]!==a||e[2]!==o||e[3]!==d||e[4]!==l||e[5]!==c?(g=i.jsx(vs.Right,{children:i.jsx(Bi,{isEditMode:l,hasChanges:d,onEnter:o,onSave:c,onCancel:a,onAddTile:p})}),e[1]=a,e[2]=o,e[3]=d,e[4]=l,e[5]=c,e[6]=g):g=e[6];let b;e[7]!==m?(b=i.jsx(_s,{open:m,onOpenChange:u}),e[7]=m,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(tt,{}),e[9]=x):x=e[9];const f=n||l?"pt-32":"flex-1 justify-center";let h;e[10]!==f?(h=K("relative flex flex-col items-center px-10 pb-4",f),e[10]=f,e[11]=h):h=e[11];let y;e[12]!==t?(y=t&&i.jsx("div",{className:"mb-4",children:t}),e[12]=t,e[13]=y):y=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 v;e[16]!==y||e[17]!==w?(v=i.jsxs("div",{className:"text-center mb-10",children:[y,w]}),e[16]=y,e[17]=w,e[18]=v):v=e[18];let j;e[19]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsxs("div",{className:"relative w-full",children:[i.jsx(Fi,{}),i.jsx(ne.Input,{showConnectionsBanner:!0})]}),e[19]=j):j=e[19];let N;e[20]!==v?(N=i.jsxs("div",{className:"flex flex-col items-center w-full max-w-[672px]",children:[v,j]}),e[20]=v,e[21]=N):N=e[21];let _;e[22]!==l?(_=i.jsx("div",{className:"relative w-full mt-10 mx-auto max-w-[1280px] px-2 pb-16",children:i.jsx(et,{isEditMode:l})}),e[22]=l,e[23]=_):_=e[23];let T;e[24]!==N||e[25]!==_||e[26]!==h?(T=i.jsxs("div",{className:"flex-1 relative flex flex-col min-h-0",children:[x,i.jsx("div",{className:"flex-1 relative flex flex-col overflow-y-auto",children:i.jsxs("div",{className:h,children:[N,_]})})]}),e[24]=N,e[25]=_,e[26]=h,e[27]=T):T=e[27];let S;return e[28]!==T||e[29]!==g||e[30]!==b?(S=i.jsxs(i.Fragment,{children:[g,b,T]}),e[28]=T,e[29]=g,e[30]=b,e[31]=S):S=e[31],S}function Bi(s){const e=$.c(17),{isEditMode:t,hasChanges:r,onEnter:n,onSave:l,onCancel:o,onAddTile:c}=s;if(t){let m;e[0]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(be,{size:14}),e[0]=m):m=e[0];let u;e[1]!==c?(u=i.jsxs("button",{type:"button",onClick:c,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]=c,e[2]=u):u=e[2];let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(ze,{size:14}),e[3]=p):p=e[3];let g;e[4]!==o?(g=i.jsxs(we,{size:"sm",variant:"ghost",onClick:o,className:"gap-1.5 h-7 text-xs",children:[p,"Cancel"]}),e[4]=o,e[5]=g):g=e[5];const b=!r;let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=i.jsx(St,{size:14}),e[6]=x):x=e[6];let f;e[7]!==l||e[8]!==b?(f=i.jsxs(we,{size:"sm",onClick:l,disabled:b,className:"gap-1.5 h-7 text-xs",children:[x,"Save"]}),e[7]=l,e[8]=b,e[9]=f):f=e[9];let h;return e[10]!==u||e[11]!==g||e[12]!==f?(h=i.jsxs(i.Fragment,{children:[u,g,f]}),e[10]=u,e[11]=g,e[12]=f,e[13]=h):h=e[13],h}let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(Et,{size:14}),e[14]=a):a=e[14];let d;return e[15]!==n?(d=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:[a,"Customize"]}),e[15]=n,e[16]=d):d=e[16],d}function Fi(){const s=$.c(1);let e;return s[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"}),s[0]=e):e=s[0],e}function Vr(){const s=$.c(2);if(ge()){let r;return s[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($e,{})}),s[0]=r):r=s[0],r}let t;return s[1]===Symbol.for("react.memo_cache_sentinel")?(t=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($e,{})})})}),s[1]=t):t=s[1],t}export{Vr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bv as _}from"./index-
|
|
1
|
+
import{bv as _}from"./index-BndwjqHd.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-
|
|
1
|
+
import{P as z,a as G,D as H,h as J,j as Q}from"./scroll-area-wuYeScN9.js";function V(x){var l;const{char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:v}=x,B=b&&!P,y=Q(D),F=new RegExp(`\\s${y}$`),h=j?"^":"",M=P?"":y,N=B?new RegExp(`${h}${y}.*?(?=\\s${M}|$)`,"gm"):new RegExp(`${h}(?:^)?${y}[^\\s${M}]*`,"gm"),q=((l=v.nodeBefore)==null?void 0:l.isText)&&v.nodeBefore.text;if(!q)return null;const K=v.pos-q.length,u=Array.from(q.matchAll(N)).pop();if(!u||u.input===void 0||u.index===void 0)return null;const d=u.input.slice(Math.max(0,u.index-1),u.index),e=new RegExp(`^[${E?.join("")}\0]?$`).test(d);if(E!==null&&!e)return null;const I=K+u.index;let p=I+u[0].length;return B&&F.test(q.slice(p-1,p+1))&&(u[0]+=" ",p+=1),I<v.pos&&p>=v.pos?{range:{from:I,to:p},query:u[0].slice(D.length),text:u[0]}:null}var W=new z("suggestion");function Y({pluginKey:x=W,editor:l,char:D="@",allowSpaces:b=!1,allowToIncludeChar:P=!1,allowedPrefixes:E=[" "],startOfLine:j=!1,decorationTag:v="span",decorationClass:B="suggestion",decorationContent:y="",decorationEmptyClass:F="is-empty",command:h=()=>null,items:M=()=>[],render:N=()=>({}),allow:q=()=>!0,findSuggestionMatch:K=V,shouldShow:u}){let d;const e=N?.(),I=()=>{const n=l.state.selection.$anchor.pos,a=l.view.coordsAtPos(n),{top:r,right:s,bottom:o,left:c}=a;try{return new DOMRect(c,r,s-c,o-r)}catch{return null}},p=(n,a)=>a?()=>{const r=x.getState(l.state),s=r?.decorationId,o=n.dom.querySelector(`[data-decoration-id="${s}"]`);return o?.getBoundingClientRect()||null}:I;function U(n,a){var r;try{const o=x.getState(n.state),c=o?.decorationId?n.dom.querySelector(`[data-decoration-id="${o.decorationId}"]`):null,g={editor:l,range:o?.range||{from:0,to:0},query:o?.query||null,text:o?.text||null,items:[],command:m=>h({editor:l,range:o?.range||{from:0,to:0},props:m}),decorationNode:c,clientRect:p(n,c)};(r=e?.onExit)==null||r.call(e,g)}catch{}const s=n.state.tr.setMeta(a,{exit:!0});n.dispatch(s)}const C=new G({key:x,view(){return{update:async(n,a)=>{var r,s,o,c,g,m,S;const t=(r=this.key)==null?void 0:r.getState(a),f=(s=this.key)==null?void 0:s.getState(n.state),i=t.active&&f.active&&t.range.from!==f.range.from,_=!t.active&&f.active,A=t.active&&!f.active,R=!_&&!A&&t.query!==f.query,w=_||i&&R,k=R||i,O=A||i&&R;if(!w&&!k&&!O)return;const $=O&&!w?t:f,T=n.dom.querySelector(`[data-decoration-id="${$.decorationId}"]`);d={editor:l,range:$.range,query:$.query,text:$.text,items:[],command:L=>h({editor:l,range:$.range,props:L}),decorationNode:T,clientRect:p(n,T)},w&&((o=e?.onBeforeStart)==null||o.call(e,d)),k&&((c=e?.onBeforeUpdate)==null||c.call(e,d)),(k||w)&&(d.items=await M({editor:l,query:$.query})),O&&((g=e?.onExit)==null||g.call(e,d)),k&&((m=e?.onUpdate)==null||m.call(e,d)),w&&((S=e?.onStart)==null||S.call(e,d))},destroy:()=>{var n;d&&((n=e?.onExit)==null||n.call(e,d))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(n,a,r,s){const{isEditable:o}=l,{composing:c}=l.view,{selection:g}=n,{empty:m,from:S}=g,t={...a},f=n.getMeta(x);if(f&&f.exit)return t.active=!1,t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null,t;if(t.composing=c,o&&(m||l.view.composing)){(S<a.range.from||S>a.range.to)&&!c&&!a.composing&&(t.active=!1);const i=K({char:D,allowSpaces:b,allowToIncludeChar:P,allowedPrefixes:E,startOfLine:j,$position:g.$from}),_=`id_${Math.floor(Math.random()*4294967295)}`;i&&q({editor:l,state:s,range:i.range,isActive:a.active})&&(!u||u({editor:l,range:i.range,query:i.query,text:i.text,transaction:n}))?(t.active=!0,t.decorationId=a.decorationId?a.decorationId:_,t.range=i.range,t.query=i.query,t.text=i.text):t.active=!1}else t.active=!1;return t.active||(t.decorationId=null,t.range={from:0,to:0},t.query=null,t.text=null),t}},props:{handleKeyDown(n,a){var r,s,o,c;const{active:g,range:m}=C.getState(n.state);if(!g)return!1;if(a.key==="Escape"||a.key==="Esc"){const t=C.getState(n.state),f=(r=d?.decorationNode)!=null?r:null,i=f??(t?.decorationId?n.dom.querySelector(`[data-decoration-id="${t.decorationId}"]`):null);if(((s=e?.onKeyDown)==null?void 0:s.call(e,{view:n,event:a,range:t.range}))||!1)return!0;const A={editor:l,range:t.range,query:t.query,text:t.text,items:[],command:R=>h({editor:l,range:t.range,props:R}),decorationNode:i,clientRect:i?()=>i.getBoundingClientRect()||null:null};return(o=e?.onExit)==null||o.call(e,A),U(n,x),!0}return((c=e?.onKeyDown)==null?void 0:c.call(e,{view:n,event:a,range:m}))||!1},decorations(n){const{active:a,range:r,decorationId:s,query:o}=C.getState(n);if(!a)return null;const c=!o?.length,g=[B];return c&&g.push(F),H.create(n.doc,[J.inline(r.from,r.to,{nodeName:v,class:g.join(" "),"data-decoration-id":s,"data-decoration-content":y})])}}});return C}export{Y as S};
|