decocms 3.26.2 → 3.27.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-9EFUZenf.js → AlertCircle-Dk6vk346.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-97355q5v.js → ArrowUpRight-4oEjocH3.js} +1 -1
- package/dist/client/assets/{Check-D-9dblUn.js → Check-xMlMIzVH.js} +1 -1
- package/dist/client/assets/{CheckCircle-C2ualSpf.js → CheckCircle-ieh2HpZJ.js} +1 -1
- package/dist/client/assets/{ChevronDown-Cf2Q-GlB.js → ChevronDown-DXk0XLak.js} +1 -1
- package/dist/client/assets/{ChevronLeft-BaV4nFMQ.js → ChevronLeft-z0R4UDTf.js} +1 -1
- package/dist/client/assets/{ChevronRight-CrZy8tHx.js → ChevronRight-TZkuqway.js} +1 -1
- package/dist/client/assets/{ChevronUp-BAxoXhnT.js → ChevronUp-CDwUhj6r.js} +1 -1
- package/dist/client/assets/{Container-CYcITvPW.js → Container-BuYdkyve.js} +1 -1
- package/dist/client/assets/{DotsVertical-SvwN4CeV.js → DotsVertical-dauL8_mz.js} +1 -1
- package/dist/client/assets/{Eye-ByuwKsdh.js → Eye-DjmQZ2p3.js} +1 -1
- package/dist/client/assets/{FilterLines-BJZdiggU.js → FilterLines-DCVUz1mF.js} +1 -1
- package/dist/client/assets/{Globe01-DfGFlik1.js → Globe01-BFX2DjNo.js} +1 -1
- package/dist/client/assets/{HardDrive-DNFvbooP.js → HardDrive-ep-sJwLU.js} +1 -1
- package/dist/client/assets/{Key01-CzmPnHuw.js → Key01-u8nOkLN5.js} +1 -1
- package/dist/client/assets/{LayoutLeft-CQ8Vq9nI.js → LayoutLeft-Ozgz9jeL.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CgI1VTqi.js → LinkExternal01-C_bnt3ki.js} +1 -1
- package/dist/client/assets/{Monitor01-Cw6kmClm.js → Monitor01-BBuvzSNf.js} +1 -1
- package/dist/client/assets/{Palette-Druykvzw.js → Palette-CJj0LVDj.js} +1 -1
- package/dist/client/assets/{Play-CMJ2IWYR.js → Play-BUy7F0as.js} +1 -1
- package/dist/client/assets/{Plus-CjrtKB-Y.js → Plus-CSmw6cpp.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-3BsQQkRx.js → RefreshCcw01-Ct_5xx8z.js} +1 -1
- package/dist/client/assets/{SearchMd-BL2y99rx.js → SearchMd-DXp3IUvU.js} +1 -1
- package/dist/client/assets/{Settings02-Cd4DIqaJ.js → Settings02-DttqwSGe.js} +1 -1
- package/dist/client/assets/{Shield01-zIbMct6w.js → Shield01-BlrpeOP8.js} +1 -1
- package/dist/client/assets/{Star01-eRdSY4QW.js → Star01-s_hRJjwq.js} +1 -1
- package/dist/client/assets/{Stars01-v0yz6PCZ.js → Stars01-U1zM7H-d.js} +1 -1
- package/dist/client/assets/{Stars02-EuAFDZ5E.js → Stars02-Cg2K8h2t.js} +1 -1
- package/dist/client/assets/{Sun-CH2HWLCn.js → Sun-D1pch37z.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BMnNI1Fi.js → SwitchHorizontal01-DUBxuMB8.js} +1 -1
- package/dist/client/assets/{Tool01-Dcq7KP8Y.js → Tool01-CSM07Bd3.js} +1 -1
- package/dist/client/assets/{Trash01-Cup7-ZTT.js → Trash01-BOiUMUTV.js} +1 -1
- package/dist/client/assets/{Upload01-C9yi1Bdg.js → Upload01-B45bupsd.js} +1 -1
- package/dist/client/assets/{User01-thAIxsAs.js → User01-CMlKZMq6.js} +1 -1
- package/dist/client/assets/{Users01-DPJm6-u-.js → Users01-CHcmgQX1.js} +1 -1
- package/dist/client/assets/{Users03-BlNe2PnN.js → Users03-C19XPgsH.js} +1 -1
- package/dist/client/assets/{X-1KR4wibP.js → X-LT7RIKGm.js} +1 -1
- package/dist/client/assets/{XCircle-UPVnJx4i.js → XCircle-fZmWWsk8.js} +1 -1
- package/dist/client/assets/{XClose-pR-QU0OQ.js → XClose-CXQHotFO.js} +1 -1
- package/dist/client/assets/{Zap-Cl-JM7N9.js → Zap-DhYBCL8w.js} +1 -1
- package/dist/client/assets/{ZapSquare-B1o2Q9OR.js → ZapSquare-Br5HjwCx.js} +1 -1
- package/dist/client/assets/{ZoomOut-D8vQ49we.js → ZoomOut-DiWWUJB1.js} +1 -1
- package/dist/client/assets/{access-gate-CWPebMdP.js → access-gate-CAbN0Agd.js} +1 -1
- package/dist/client/assets/{accordion-aX0NKKKh.js → accordion-CqS3rCYY.js} +1 -1
- package/dist/client/assets/add-section-modal-Xtytp9xF.js +1 -0
- package/dist/client/assets/agent-capabilities-CH2iEpSS.js +3 -0
- package/dist/client/assets/{agent-icon-DT8dQ9tq.js → agent-icon-DyETFFvd.js} +1 -1
- package/dist/client/assets/agent-icons-0as3WkuR.js +4 -0
- package/dist/client/assets/{agents-list-DDhPNISh.js → agents-list-CDTD2QQV.js} +1 -1
- package/dist/client/assets/ai-providers-CmBK6tVa.js +1 -0
- package/dist/client/assets/{alert-DyB_hFGI.js → alert-BvaxqAIW.js} +1 -1
- package/dist/client/assets/{alert-dialog-CSkQIwm8.js → alert-dialog-C_C5CWIi.js} +1 -1
- package/dist/client/assets/app-editor-BeU6l_dS.js +1 -0
- package/dist/client/assets/{auth-catchall-BUwhIhze.js → auth-catchall-DBSfiKWC.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CY4CpKKX.js → auth-split-layout-CEZXGHtA.js} +1 -1
- package/dist/client/assets/{automation-list-row-5M4PNEWw.js → automation-list-row-s3KQqnbA.js} +1 -1
- package/dist/client/assets/automation-runs-RFg521Hi.js +1 -0
- package/dist/client/assets/{automations-Cy981ltn.js → automations-C4zBnLxc.js} +1 -1
- package/dist/client/assets/{avatar-BHEXMwdE.js → avatar-DI2KQvq0.js} +1 -1
- package/dist/client/assets/{badge-Da0IsrqH.js → badge-DqS5s_eb.js} +1 -1
- package/dist/client/assets/brand-context-Cg_N2T5g.js +1 -0
- package/dist/client/assets/buckets-CGFQSBKU.js +1 -0
- package/dist/client/assets/{calendar-BbhbS2FE.js → calendar-CuCfbpTI.js} +1 -1
- package/dist/client/assets/{capability-load-error-Dfw4xb8a.js → capability-load-error-DMe1nIxk.js} +1 -1
- package/dist/client/assets/{card-BUTabNLA.js → card-C0qmaAJH.js} +1 -1
- package/dist/client/assets/chat-context-DEKG6yp4.js +20 -0
- package/dist/client/assets/{checkbox--nDaSUZE.js → checkbox-ClCQ7aIa.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CUSnxWUp.js → cli-auth-success-YaavH1FD.js} +1 -1
- package/dist/client/assets/collection-detail-TiY0uzM1.js +1 -0
- package/dist/client/assets/{collection-display-button-BfQyXSIv.js → collection-display-button-C6_DwOqJ.js} +1 -1
- package/dist/client/assets/{collection-search-LsgoMrVO.js → collection-search-uQS9yrST.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-D3ciIIEv.js → collection-table-wrapper-CTY0qyxJ.js} +1 -1
- package/dist/client/assets/{collection-tabs-CQJiHDMR.js → collection-tabs-dTL9gxGq.js} +1 -1
- package/dist/client/assets/{collections-C_j8CeI8.js → collections-5f6Mz9W3.js} +1 -1
- package/dist/client/assets/{command-BehF6pb8.js → command-DZekvH1G.js} +1 -1
- package/dist/client/assets/connect-desktop-dialog-Bi-Fd5NF.js +1 -0
- package/dist/client/assets/{connection-card-EXvV7rxl.js → connection-card-CVH5Hy6F.js} +1 -1
- package/dist/client/assets/connection-detail-mj8sHl20.js +1 -0
- package/dist/client/assets/{connection-form-helpers-DoJomSCQ.js → connection-form-helpers-DFXgro4O.js} +1 -1
- package/dist/client/assets/connections-D3Q6bIzz.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-BUhEcft-.js → decopilot-sse-pool-Keqs3wfV.js} +1 -1
- package/dist/client/assets/{dialog-Bm1pP7Vu.js → dialog-BE3BWPis.js} +1 -1
- package/dist/client/assets/domain-settings-Bq8L3_pf.js +1 -0
- package/dist/client/assets/{drawer-B51jkLaX.js → drawer-BSFXr7hp.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CIu58K9q.js → dropdown-menu-D7fqzmBS.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-CK3Aqazw.js +1 -0
- package/dist/client/assets/{empty-state-1AbmTLd7.js → empty-state-BumLAiri.js} +1 -1
- package/dist/client/assets/{empty-state-BfmCVPeb.js → empty-state-Eik7Dn7e.js} +1 -1
- package/dist/client/assets/{extract-connection-data-LoMqboL3.js → extract-connection-data-BLVQkjXZ.js} +1 -1
- package/dist/client/assets/{features-DWJ09Fdz.js → features-BPRhAfHF.js} +1 -1
- package/dist/client/assets/file-explorer-D9JJ-ABp.js +2 -0
- package/dist/client/assets/{file-type-icon-CX5JEvCQ.js → file-type-icon-I99Qy2JI.js} +1 -1
- package/dist/client/assets/{files-QExlaPCQ.js → files-Bo9D7ZcJ.js} +1 -1
- package/dist/client/assets/{form-BcPtow5O.js → form-Bn5_lJ6b.js} +1 -1
- package/dist/client/assets/general-BKEEaSjd.js +1 -0
- package/dist/client/assets/{generate-id-CadHbHqX.js → generate-id-D0pLsbUu.js} +1 -1
- package/dist/client/assets/{github-repo-picker-B24_pGAu.js → github-repo-picker-CKp3ba8m.js} +1 -1
- package/dist/client/assets/header-tab-button-CbbR6n8q.js +5 -0
- package/dist/client/assets/{hover-card-DE2_8MLP.js → hover-card-NLGI_Z11.js} +1 -1
- package/dist/client/assets/image-field-Baxidks4.js +1 -0
- package/dist/client/assets/{index-BflNEs6l.js → index-B-No0lhl.js} +1 -1
- package/dist/client/assets/{index-50-dmJFK.js → index-B6YB9tmn.js} +1 -1
- package/dist/client/assets/{index-B1bHiM-j.js → index-BE8dVooN.js} +1 -1
- package/dist/client/assets/index-BGdRrrmO.js +1 -0
- package/dist/client/assets/{index-J2NhKqyZ.js → index-BM5cVzVa.js} +5 -5
- package/dist/client/assets/{index-Dr4Isy1j.js → index-BTFwMarm.js} +1 -1
- package/dist/client/assets/{index-r7-3fAFf.js → index-Bgv8YQhF.js} +1 -1
- package/dist/client/assets/{index-biiHZ5l9.js → index-Bll1AlZi.js} +26 -26
- package/dist/client/assets/{index-D6ELOmUq.js → index-Bz4SrPhc.js} +1 -1
- package/dist/client/assets/{index-Bo5bzoUm.js → index-CF_awNaT.js} +1 -1
- package/dist/client/assets/{index-YdX5UjUB.js → index-ClpGtndr.js} +1 -1
- package/dist/client/assets/{index-CZJ35dl3.css → index-DfYyH4IW.css} +1 -1
- package/dist/client/assets/{index-CR_LeyNj.js → index-DxNfIzhJ.js} +1 -1
- package/dist/client/assets/{index-CHdFXpqc.js → index-YVfCniqO.js} +1 -1
- package/dist/client/assets/index-apuzt69p.js +310 -0
- package/dist/client/assets/index-bSiT8Vjd.js +1 -0
- package/dist/client/assets/{index-redirect-pPYMz5D6.js → index-redirect-DjHBgih0.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B0VBGXv5.js → infiniteQueryObserver-B-dakPwk.js} +1 -1
- package/dist/client/assets/{input-5PMMNPU9.js → input-CMMOM0dD.js} +1 -1
- package/dist/client/assets/{integration-icon-Dy-a3x5R.js → integration-icon-DblM7d27.js} +1 -1
- package/dist/client/assets/{label-CcC4_aKf.js → label-cKO6vIjy.js} +1 -1
- package/dist/client/assets/{layout-CbTbCjmA.js → layout-QBDJ_skY.js} +1 -1
- package/dist/client/assets/{login-Dn4EF5EK.js → login-BAGu_SJp.js} +1 -1
- package/dist/client/assets/members-C7uPVWw3.js +3 -0
- package/dist/client/assets/{monaco-editor-CJVi8Ty8.js → monaco-editor-BD33gVrt.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BAplEVfE.js → monitoring-stats-row-Bvt3RsAI.js} +1 -1
- package/dist/client/assets/{oauth-callback-D5XAAL8p.js → oauth-callback-DvAeoSNI.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-tGQCB63I.js → oauth-callback-ai-provider-BuhDe7NV.js} +1 -1
- package/dist/client/assets/{onboarding-CgvYwT2C.js → onboarding-DiyHWSGI.js} +1 -1
- package/dist/client/assets/{org-install-CV5qvXsE.js → org-install-B1rM2juw.js} +1 -1
- package/dist/client/assets/{org-layout-BFil8fwL.js → org-layout-Ck7vt_mB.js} +1 -1
- package/dist/client/assets/org-plugin-layout-Cc5oLilE.js +1 -0
- package/dist/client/assets/{page-seo-form-Bbna5w2y.js → page-seo-form-CTM0Xp8N.js} +1 -1
- package/dist/client/assets/page-seo-sheet-nSdCZ-KL.js +1 -0
- package/dist/client/assets/pair-BidrJ4sX.js +39 -0
- package/dist/client/assets/{plugin-empty-state-DM8dR2Wk.js → plugin-empty-state-CERz9K1r.js} +1 -1
- package/dist/client/assets/{plugin-header-CaWKfaZE.js → plugin-header-CISIxXxk.js} +1 -1
- package/dist/client/assets/plugin-layout-UkXtyZlZ.js +1 -0
- package/dist/client/assets/{popover-Cvcd3A1d.js → popover-CNh3Ozeq.js} +1 -1
- package/dist/client/assets/{post-editor-CM-ESdP7.js → post-editor-C3YLiXXM.js} +3 -3
- package/dist/client/assets/{primitives-DWXKnou4.js → primitives-Y0YbWOD4.js} +1 -1
- package/dist/client/assets/{profile-DmCC3zYK.js → profile-o29P_MC2.js} +1 -1
- package/dist/client/assets/project-app-view-DHVFZPIZ.js +1 -0
- package/dist/client/assets/record-editor-DtXRmftd.js +1 -0
- package/dist/client/assets/registry-jlRh9TsH.js +2 -0
- package/dist/client/assets/registry-layout-zUgwlIce.js +27 -0
- package/dist/client/assets/{require-capability-DVI2cKO3.js → require-capability-CQkA6hP5.js} +1 -1
- package/dist/client/assets/{required-auth-layout-zYH6NIDF.js → required-auth-layout-Sv9_QEzP.js} +1 -1
- package/dist/client/assets/{reset-password-DXXx8e6Q.js → reset-password-C1pH8pyn.js} +1 -1
- package/dist/client/assets/{resizable-BbbLszRZ.js → resizable-BTpQlX-z.js} +1 -1
- package/dist/client/assets/{roles-vHYrQg5g.js → roles-CL5RMNps.js} +1 -1
- package/dist/client/assets/save-referenced-block-JBVOc1Wy.js +1 -0
- package/dist/client/assets/{save-status-pJVz5vCQ.js → save-status-Dfy3Cw0L.js} +1 -1
- package/dist/client/assets/{schema-form-nZH-67HX.js → schema-form-BLq0KNxn.js} +1 -1
- package/dist/client/assets/{scroll-area-BqOijBAI.js → scroll-area-SRbC7c25.js} +1 -1
- package/dist/client/assets/{search-input-BgGthWir.js → search-input-JFEU6QlH.js} +1 -1
- package/dist/client/assets/secrets-DvkQvbwt.js +1 -0
- package/dist/client/assets/sections-editor-HXjdp6eB.js +2 -0
- package/dist/client/assets/{select-CNSUv3cw.js → select-CTk6Rsq0.js} +1 -1
- package/dist/client/assets/{select-model-0CGh6cKF.js → select-model-D2KMm6n2.js} +1 -1
- package/dist/client/assets/seo-editor-ifMY-Fw8.js +1 -0
- package/dist/client/assets/{settings-layout-DRYgevr6.js → settings-layout-BCPOwwNR.js} +1 -1
- package/dist/client/assets/{settings-section-V9kb8x32.js → settings-section-CcspUfab.js} +1 -1
- package/dist/client/assets/{sheet-D99KevZC.js → sheet-DokH5LKH.js} +1 -1
- package/dist/client/assets/{shell-controls-DSSWZ7Ia.js → shell-controls-rZZhpuW4.js} +1 -1
- package/dist/client/assets/{shell-layout-4LsIVsl3.js → shell-layout-DO1LZiwY.js} +1 -1
- package/dist/client/assets/shell-route-loading-DI9OtFHe.js +1 -0
- package/dist/client/assets/{sidebar-CPZXU-2w.js → sidebar-hk7mPADd.js} +1 -1
- package/dist/client/assets/{skeleton--DN75sg7.js → skeleton-CxMjy9Kg.js} +1 -1
- package/dist/client/assets/{sortable.esm-g7bq1nDZ.js → sortable.esm-BnSJaRIy.js} +1 -1
- package/dist/client/assets/{spinner-DJD6-9r-.js → spinner-Dstb6AhM.js} +1 -1
- package/dist/client/assets/sso-lfWsp7Wf.js +1 -0
- package/dist/client/assets/{store-DTK5DubB.js → store-CHpKgn9g.js} +1 -1
- package/dist/client/assets/store-registry-D9xAoVoW.js +2 -0
- package/dist/client/assets/studio-tools-I8Y7AvNq.js +1 -0
- package/dist/client/assets/{switch-D6SWnoi2.js → switch-Ds4XHhlB.js} +1 -1
- package/dist/client/assets/{tab-id-D4SJwEQy.js → tab-id-D_jK7L5o.js} +2 -2
- package/dist/client/assets/{table-Cx3PhNth.js → table-BvWfaT33.js} +1 -1
- package/dist/client/assets/{tabs-DCDCb9Pz.js → tabs-2_PrfGe1.js} +1 -1
- package/dist/client/assets/{task-status-P3BULAyA.js → task-status-CyBgq1B0.js} +1 -1
- package/dist/client/assets/{textarea-QEULyLXh.js → textarea-D7mZzw_Y.js} +1 -1
- package/dist/client/assets/{toggle-group-DhVqXGfs.js → toggle-group-CcV2qfqh.js} +1 -1
- package/dist/client/assets/{toolbar-BsB4Mvyv.js → toolbar-Vk0X9zFW.js} +1 -1
- package/dist/client/assets/{tools-list-Ch5RlbiL.js → tools-list-DZyHvyxj.js} +1 -1
- package/dist/client/assets/{tooltip-bsrBmmjV.js → tooltip-B2vnmSMM.js} +1 -1
- package/dist/client/assets/{types-jBdXInU0.js → types-DsBzghfJ.js} +1 -1
- package/dist/client/assets/use-ai-providers-BDbyWdvc.js +1 -0
- package/dist/client/assets/{use-automations-Db8x6SNU.js → use-automations-DjpksCFK.js} +1 -1
- package/dist/client/assets/{use-capability-BPM45mbW.js → use-capability-cYRWRLhr.js} +1 -1
- package/dist/client/assets/{use-collections-B5Jh_wGd.js → use-collections-DI2EpqEk.js} +1 -1
- package/dist/client/assets/{use-connection-DyJtuHQI.js → use-connection-Cam2HslE.js} +1 -1
- package/dist/client/assets/{use-copy-P6tx-uOp.js → use-copy-CyNGh3eK.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CWYOy45e.js → use-create-virtual-mcp-TPoPQ6hG.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-ClLbciGl.js → use-debounced-autosave-b8Qk2OvK.js} +1 -1
- package/dist/client/assets/use-delete-connection-DXpw9Kqu.js +1 -0
- package/dist/client/assets/use-file-configs-J3tDrhRd.js +1 -0
- package/dist/client/assets/{use-infinite-scroll-xQQ6lYk4.js → use-infinite-scroll-CF4jvsDL.js} +1 -1
- package/dist/client/assets/{use-list-state-BZmeG7gi.js → use-list-state-C3OBf8IN.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CWFUu1lY.js → use-mcp-client-Des-fSV9.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-B5RhBVzg.js → use-mcp-prompts-d7xtcVsP.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DePRGZE5.js → use-mcp-tools-DVBLMBo3.js} +1 -1
- package/dist/client/assets/{use-members-Cw70r_Wh.js → use-members-CTowYB9Z.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CdsMYUzL.js → use-navigate-to-agent-TzPRxzJx.js} +1 -1
- package/dist/client/assets/{use-org-auth-client--i_Sx92M.js → use-org-auth-client-uSzlmndB.js} +1 -1
- package/dist/client/assets/{use-org-sso-C1cJTBIx.js → use-org-sso-Bez1Sajf.js} +1 -1
- package/dist/client/assets/{use-organization-roles-ATKYiNpl.js → use-organization-roles-DfnjRa-5.js} +1 -1
- package/dist/client/assets/{use-organization-settings-Izqk1Gkk.js → use-organization-settings-B5dKExdR.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C-WVKjSU.js → use-registry-connections-CWiPZtVM.js} +1 -1
- package/dist/client/assets/use-secrets-CrukgaJs.js +1 -0
- package/dist/client/assets/{use-status-sounds-BJ_LqdGJ.js → use-status-sounds-B1WepgCG.js} +1 -1
- package/dist/client/assets/{use-view-mode-CbT8E3wV.js → use-view-mode-q_aFx9Fj.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-0jbEmvOc.js → use-virtual-mcp-71PpEQrs.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Dl7i7ptk.js +1 -0
- package/dist/client/assets/{useRouterState-Dm0UHjU4.js → useRouterState-l6E4h2DF.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CmT2FyND.js +1 -0
- package/dist/client/assets/user-ZvpM4E3a.js +1 -0
- package/dist/client/assets/{view-mode-toggle-G0qNMbJ1.js → view-mode-toggle-oQJDkJzK.js} +1 -1
- package/dist/client/assets/workflow-detail-Ba-EIKe1.js +1 -0
- package/dist/client/assets/workflow-i0CMnn6N.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +439 -419
- package/dist/server/migrate.js +95 -95
- package/dist/server/server.js +287 -282
- package/package.json +1 -1
- package/dist/client/assets/add-section-modal-DbuGc2qc.js +0 -1
- package/dist/client/assets/agent-capabilities-BJLQSkAN.js +0 -3
- package/dist/client/assets/agent-icons-DRrDyR7j.js +0 -4
- package/dist/client/assets/ai-providers-GxPLAPId.js +0 -1
- package/dist/client/assets/app-editor-BsxVHV86.js +0 -1
- package/dist/client/assets/automation-runs-BJTRztep.js +0 -1
- package/dist/client/assets/brand-context-DTmvDRqf.js +0 -1
- package/dist/client/assets/buckets-Cv3AB_TT.js +0 -1
- package/dist/client/assets/chat-context-Bu6qpu9K.js +0 -20
- package/dist/client/assets/collection-detail-DHxXW6T4.js +0 -1
- package/dist/client/assets/connect-desktop-dialog-DPqrgnkS.js +0 -1
- package/dist/client/assets/connection-detail-58UbdFd3.js +0 -1
- package/dist/client/assets/connections-BMZIGugH.js +0 -1
- package/dist/client/assets/domain-settings-DHsRsnmX.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-DWE13BKk.js +0 -1
- package/dist/client/assets/file-explorer-Dmpsw-4-.js +0 -2
- package/dist/client/assets/general-CLesrOe8.js +0 -1
- package/dist/client/assets/header-tab-button-DSX6YPkf.js +0 -5
- package/dist/client/assets/image-field-D00iYa4G.js +0 -1
- package/dist/client/assets/index-BZvxagUr.js +0 -310
- package/dist/client/assets/index-CCs3Chg3.js +0 -1
- package/dist/client/assets/index-Db3P8pHg.js +0 -1
- package/dist/client/assets/members-BwcNzXwU.js +0 -3
- package/dist/client/assets/org-plugin-layout-DyCflrr1.js +0 -1
- package/dist/client/assets/page-seo-sheet-D9M3CoUb.js +0 -1
- package/dist/client/assets/pair-Ba1UoSSJ.js +0 -39
- package/dist/client/assets/plugin-layout-DrVKV-lp.js +0 -1
- package/dist/client/assets/project-app-view-C9azYjZP.js +0 -1
- package/dist/client/assets/record-editor-DJucp492.js +0 -1
- package/dist/client/assets/registry-hKns5OCc.js +0 -2
- package/dist/client/assets/registry-layout-DPaKDLDg.js +0 -27
- package/dist/client/assets/save-referenced-block-q2CPWVkl.js +0 -1
- package/dist/client/assets/secrets-YkTDT7yT.js +0 -1
- package/dist/client/assets/sections-editor-CSz4pxMw.js +0 -2
- package/dist/client/assets/seo-editor-CspZxazh.js +0 -1
- package/dist/client/assets/shell-route-loading-5KSwc3hj.js +0 -1
- package/dist/client/assets/sso-D04DjSnZ.js +0 -1
- package/dist/client/assets/store-registry-nABlp_7k.js +0 -2
- package/dist/client/assets/unwrap-tool-result-BYXdCQMg.js +0 -1
- package/dist/client/assets/use-ai-providers-v0sCRzMO.js +0 -1
- package/dist/client/assets/use-delete-connection-C60uGs0b.js +0 -1
- package/dist/client/assets/use-file-configs-CC8ghNUa.js +0 -1
- package/dist/client/assets/use-secrets-BpdIBEe6.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BGg7INCQ.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B4dQiTEq.js +0 -1
- package/dist/client/assets/user-DRDdFgUw.js +0 -1
- package/dist/client/assets/workflow-D1PUPL3K.js +0 -1
- package/dist/client/assets/workflow-detail-CRUxUbKb.js +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as P,aU as Qe,e as W,j as s,T as Te,W as re,q as le,G as fe,I as ze,H as Re,a as de,K as te,o as Q,B as ee,t as X,u as Je,c as ue,n as Ze,f as et,E as tt,v as st}from"./index-biiHZ5l9.js";import{C as it}from"./checkbox--nDaSUZE.js";import{I as ne}from"./input-5PMMNPU9.js";import{d as nt,S as lt,a as ot,b as rt,c as at}from"./select-CNSUv3cw.js";import{S as q}from"./skeleton--DN75sg7.js";import{a as Le,i as Pe,b as ct,s as dt}from"./RefreshCcw01-3BsQQkRx.js";import{b as ut,a as mt,c as ht,d as ft}from"./Tool01-Dcq7KP8Y.js";import{i as pt}from"./Key01-CzmPnHuw.js";import{i as $e}from"./SearchMd-BL2y99rx.js";import{a as xt}from"./Settings02-Cd4DIqaJ.js";import{c as pe,u as gt,b as vt}from"./use-ai-providers-v0sCRzMO.js";import{u as bt,c as yt}from"./chat-context-Bu6qpu9K.js";import{g as xe}from"./ai-providers-logos-DD3qZ33J.js";import{i as jt}from"./Monitor01-Cw6kmClm.js";import{i as St}from"./AlertCircle-9EFUZenf.js";import{d as Fe,D as Nt,a as kt,b as wt,c as _t,e as Ct}from"./dialog-Bm1pP7Vu.js";import{S as be}from"./spinner-DJD6-9r-.js";import{S as me,u as he}from"./use-mcp-client-CWFUu1lY.js";import{i as It}from"./ChevronRight-CrZy8tHx.js";import{A as Mt}from"./avatar-BHEXMwdE.js";import{S as ye,a as je,b as Ke}from"./settings-section-V9kb8x32.js";import{s as De}from"./Eye-ByuwKsdh.js";import{u as Et}from"./unwrap-tool-result-BYXdCQMg.js";import{C as Ot}from"./connect-desktop-dialog-DPqrgnkS.js";import{t as Se}from"./ChevronDown-Cf2Q-GlB.js";import{t as At}from"./Stars01-v0yz6PCZ.js";function ie(i,e,t){let n=t.initialDeps??[],l,o=!0;function r(){var a,c,d;let u;t.key&&((a=t.debug)!=null&&a.call(t))&&(u=Date.now());const p=i();if(!(p.length!==n.length||p.some((v,g)=>n[g]!==v)))return l;n=p;let h;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(h=Date.now()),l=e(...p),t.key&&((d=t.debug)!=null&&d.call(t))){const v=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-h)*100)/100,S=g/16,j=(w,_)=>{for(w=String(w);w.length<_;)w=" "+w;return w};console.info(`%c⏱ ${j(g,5)} /${j(v,5)} ms`,`
|
|
2
|
-
font-size: .6rem;
|
|
3
|
-
font-weight: bold;
|
|
4
|
-
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(l),o=!1,l}return r.updateDeps=a=>{n=a},r}function Ne(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Tt=(i,e)=>Math.abs(i-e)<1.01,zt=(i,e,t)=>{let n;return function(...l){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,l),t)}},ke=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Rt=i=>i,Lt=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let l=e;l<=t;l++)n.push(l);return n},Pt=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const l=r=>{const{width:a,height:c}=r;e({width:Math.round(a),height:Math.round(c)})};if(l(ke(t)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const c=r[0];if(c?.borderBoxSize){const d=c.borderBoxSize[0];if(d){l({width:d.inlineSize,height:d.blockSize});return}}l(ke(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},we={passive:!0},_e=typeof window>"u"?!0:"onscrollend"in window,$t=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let l=0;const o=i.options.useScrollendEvent&&_e?()=>{}:zt(n,()=>{e(l,!1)},i.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:p,isRtl:f}=i.options;l=p?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(l,u)},a=r(!0),c=r(!1);t.addEventListener("scroll",a,we);const d=i.options.useScrollendEvent&&_e;return d&&t.addEventListener("scrollend",c,we),()=>{t.removeEventListener("scroll",a),d&&t.removeEventListener("scrollend",c)}},Ft=(i,e,t)=>{if(e?.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},Kt=(i,{adjustments:e=0,behavior:t},n)=>{var l,o;const r=i+e;(o=(l=n.scrollElement)==null?void 0:l.scrollTo)==null||o.call(l,{[n.options.horizontal?"left":"top"]:r,behavior:t})};class Dt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,n,l;return((l=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:l.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(l=>{l.forEach(o=>{const r=()=>{const a=o.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var l;(l=n())==null||l.disconnect(),t=null},observe:l=>{var o;return(o=n())==null?void 0:o.observe(l,{box:"border-box"})},unobserve:l=>{var o;return(o=n())==null?void 0:o.unobserve(l)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,l])=>{typeof l>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Rt,rangeExtractor:Lt,onChange:()=>{},measureElement:Ft,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var n,l;(l=(n=this.options).onChange)==null||l.call(n,this,t)},this.maybeNotify=ie(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(l=>{this.observer.observe(l)}),this.unsubs.push(this.options.observeElementRect(this,l=>{this.scrollRect=l,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(l,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<l?"forward":"backward":null,this.scrollOffset=l,this.isScrolling=o,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const l=new Map,o=new Map;for(let r=n-1;r>=0;r--){const a=t[r];if(l.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&l.set(a.lane,!0),l.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=ie(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,l,o,r,a,c)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c}),{key:!1}),this.getMeasurements=ie(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:l,getItemKey:o,enabled:r,lanes:a,laneAssignmentMode:c},d)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const h of this.laneAssignments.keys())h>=t&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,u),f=new Array(a).fill(void 0);for(let h=0;h<u;h++){const v=p[h];v&&(f[v.lane]=h)}for(let h=u;h<t;h++){const v=o(h),g=this.laneAssignments.get(h);let S,j;const w=c==="estimate"||d.has(v);if(g!==void 0&&this.options.lanes>1){S=g;const x=f[S],N=x!==void 0?p[x]:void 0;j=N?N.end+this.options.gap:n+l}else{const x=this.options.lanes===1?p[h-1]:this.getFurthestMeasurement(p,h);j=x?x.end+this.options.gap:n+l,S=x?x.lane:h%this.options.lanes,this.options.lanes>1&&w&&this.laneAssignments.set(h,S)}const _=d.get(v),k=typeof _=="number"?_:this.options.estimateSize(h),T=j+k;p[h]={index:h,start:j,size:k,end:T,key:v,lane:S},f[S]=h}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ie(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,l,o)=>this.range=t.length>0&&n>0?Ut({measurements:t,outerSize:n,scrollOffset:l,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ie(()=>{let t=null,n=null;const l=this.calculateRange();return l&&(t=l.startIndex,n=l.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,l,o,r)=>o===null||r===null?[]:t({startIndex:o,endIndex:r,overscan:n,count:l}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,l=t.getAttribute(n);return l?parseInt(l,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const l=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(l!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,l-o),a=Math.min(this.options.count-1,l+o);return t>=r&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,a)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(a))});return}const n=this.indexFromElement(t),l=this.options.getItemKey(n),o=this.elementsCache.get(l);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(l,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var l;const o=this.measurementsCache[t];if(!o)return;const r=this.itemSizeCache.get(o.key)??o.size,a=n-r;a!==0&&(((l=this.scrollState)==null?void 0:l.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,a,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,n)),this.notify(!1))},this.getVirtualItems=ie(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const l=[];for(let o=0,r=t.length;o<r;o++){const a=t[o],c=n[a];l.push(c)}return l},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return Ne(n[Ue(0,n.length-1,l=>Ne(n[l]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,n,l=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=t>=r+o?"end":"start"),n==="center"?t+=(l-o)/2:n==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getSize(),o=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(n==="auto")if(r.end>=o+l-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const a=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,r.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:l="auto"}={})=>{const o=this.getOffsetForAlignment(t,n),r=this.now();this.scrollState={index:null,align:n,behavior:l,startedAt:r,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:l="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getOffsetForIndex(t,n);if(!o)return;const[r,a]=o,c=this.now();this.scrollState={index:t,align:a,behavior:l,startedAt:c,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:l}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const l=this.getScrollOffset()+t,o=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:o,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let l;if(n.length===0)l=this.options.paddingStart;else if(this.options.lanes===1)l=((t=n[n.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&o.some(a=>a===null);){const a=n[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}l=Math.max(...o.filter(a=>a!==null))}return Math.max(l-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:l})=>{this.options.scrollToFn(t,{behavior:l,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,l=n?n[0]:this.scrollState.lastTargetOffset,o=1,r=l!==this.scrollState.lastTargetOffset;if(!r&&Tt(l,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=l,this.scrollState.behavior="auto",this._scrollToOffset(l,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ue=(i,e,t,n)=>{for(;i<=e;){const l=(i+e)/2|0,o=t(l);if(o<n)i=l+1;else if(o>n)e=l-1;else return l}return i>0?i-1:0};function Ut({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const l=i.length-1,o=c=>i[c].start;if(i.length<=n)return{startIndex:0,endIndex:l};let r=Ue(0,l,o,t),a=r;if(n===1)for(;a<l&&i[a].end<t+e;)a++;else if(n>1){const c=Array(n).fill(0);for(;a<l&&c.some(u=>u<t+e);){const u=i[a];c[u.lane]=u.end,a++}const d=Array(n).fill(t+e);for(;r>=0&&d.some(u=>u>=t);){const u=i[r];d[u.lane]=u.start,r--}r=Math.max(0,r-r%n),a=Math.min(l,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const Ce=typeof document<"u"?P.useLayoutEffect:P.useEffect;function Bt({useFlushSync:i=!0,...e}){const t=P.useReducer(()=>({}),{})[1],n={...e,onChange:(o,r)=>{var a;i&&r?Qe.flushSync(t):t(),(a=e.onChange)==null||a.call(e,o,r)}},[l]=P.useState(()=>new Dt(n));return l.setOptions(n),Ce(()=>l._didMount(),[]),Ce(()=>l._willUpdate()),l}function Wt(i){return Bt({observeElementRect:Pt,observeElementOffset:$t,scrollToFn:Kt,...i})}const ae=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function Ie(i){if(i)return ae.find(e=>e.id===i)}const Me=4;function oe(i){const e=W.c(8),{logo:t,name:n,description:l,onClick:o}=i;let r;e[0]!==t||e[1]!==n?(r=t?s.jsx("img",{src:t,alt:n,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(Mt,{fallback:n.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=n,e[2]=r):r=e[2];let a;return e[3]!==l||e[4]!==n||e[5]!==o||e[6]!==r?(a=s.jsx(Ke,{onClick:o,icon:r,title:n,description:l}),e[3]=l,e[4]=n,e[5]=o,e[6]=r,e[7]=a):a=e[7],a}function Be(i){const e=W.c(32),{providers:t,onSelect:n,onShowAll:l}=i;let o;e[0]!==t?(o=t.find(Yt),e[0]=t,e[1]=o):o=e[1];const r=o;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a={openrouter:0,anthropic:1,google:2},e[2]=a):a=e[2];const c=a;let d;if(e[3]!==n||e[4]!==t){let _;e[6]===Symbol.for("react.memo_cache_sentinel")?(_=(b,A)=>{const M=c[b.id]??Number.MAX_SAFE_INTEGER,O=c[A.id]??Number.MAX_SAFE_INTEGER;return M-O},e[6]=_):_=e[6];const k=t.filter(Gt).sort(_);let T;e[7]!==t?(T=t.find(qt),e[7]=t,e[8]=T):T=e[8];const x=T;let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=ae.find(Ht),e[9]=N):N=e[9];const C=N;let I;e[10]!==n?(I=b=>s.jsx(oe,{logo:b.logo,name:b.name,description:b.description,onClick:()=>n({kind:"provider",provider:b})},b.id),e[10]=n,e[11]=I):I=e[11];let m,y;e[12]!==n||e[13]!==x?(m=x&&C?[s.jsx(oe,{logo:C.logo,name:C.name,description:C.description,onClick:()=>n({kind:"openai-compatible",provider:x,preset:C})},C.id)]:[],y=x?[...ae.filter(Vt).map(b=>s.jsx(oe,{logo:b.logo,name:b.name,description:b.description,onClick:()=>n({kind:"openai-compatible",provider:x,preset:b})},b.id)),s.jsx(oe,{logo:x.logo,name:"Custom OpenAI-compatible",description:"Bring your own model server (advanced)",onClick:()=>n({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[12]=n,e[13]=x,e[14]=m,e[15]=y):(m=e[14],y=e[15]),d=[...k.map(I),...m,...y],e[3]=n,e[4]=t,e[5]=d}else d=e[5];const u=d,p=u.length-Me,f=!!l&&p>0;let h;e[16]!==u||e[17]!==f?(h=f?u.slice(0,Me):u,e[16]=u,e[17]=f,e[18]=h):h=e[18];const v=h;let g;e[19]!==r||e[20]!==n?(g=r&&s.jsx(ye,{children:s.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[s.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),s.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:"Recommended — 100+ models, pay as you go"}),s.jsx(je,{className:"relative",children:s.jsx(oe,{logo:r.logo,name:r.name,description:r.description,onClick:()=>n({kind:"provider",provider:r})})})]})}),e[19]=r,e[20]=n,e[21]=g):g=e[21];let S;e[22]!==p||e[23]!==l||e[24]!==f?(S=f&&s.jsx(Ke,{onClick:l,title:`${p} more provider${p===1?"":"s"}`,action:s.jsx(It,{size:16,className:"text-muted-foreground"})}),e[22]=p,e[23]=l,e[24]=f,e[25]=S):S=e[25];let j;e[26]!==S||e[27]!==v?(j=s.jsx(ye,{children:s.jsxs(je,{children:[v,S]})}),e[26]=S,e[27]=v,e[28]=j):j=e[28];let w;return e[29]!==g||e[30]!==j?(w=s.jsxs("div",{className:"flex flex-col gap-6",children:[g,j]}),e[29]=g,e[30]=j,e[31]=w):w=e[31],w}function Vt(i){return i.id!=="openai"}function Ht(i){return i.id==="openai"}function qt(i){return i.id==="openai-compatible"}function Gt(i){return i.id!=="deco"&&i.id!=="openai-compatible"}function Yt(i){return i.id==="deco"}const Xt=Te({label:re().optional(),apiKey:re().min(1,"API key is required")});function Qt(i){const e=W.c(62),{providerId:t,onCancel:n,onSuccess:l}=i,{org:o}=le();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:me,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=he(r),c=fe(),[d,u]=P.useState(!1);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={resolver:ze(Xt),defaultValues:{label:"",apiKey:""}},e[3]=p):p=e[3];const{register:f,handleSubmit:h,formState:v}=Re(p),{errors:g}=v;let S;e[4]!==a||e[5]!==t?(S=async H=>{await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:t,label:H.label||"Personal key",apiKey:H.apiKey}})},e[4]=a,e[5]=t,e[6]=S):S=e[6];let j;e[7]!==l||e[8]!==o.id||e[9]!==c?(j=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:te.aiProviders(o.id)}),Q.success("Key saved successfully"),l()},e[7]=l,e[8]=o.id,e[9]=c,e[10]=j):j=e[10];let w;e[11]!==S||e[12]!==j?(w={mutationFn:S,onSuccess:j,onError:Jt},e[11]=S,e[12]=j,e[13]=w):w=e[13];const{mutate:_,isPending:k,error:T}=de(w);let x;e[14]!==_?(x=H=>_(H),e[14]=_,e[15]=x):x=e[15];let N;e[16]!==h||e[17]!==x?(N=h(x),e[16]=h,e[17]=x,e[18]=N):N=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[19]=C):C=e[19];let I;e[20]!==f?(I=f("label"),e[20]=f,e[21]=I):I=e[21];let m;e[22]!==I?(m=s.jsxs("div",{className:"space-y-1",children:[C,s.jsx(ne,{placeholder:"e.g. Personal key",...I,className:"h-8 text-sm"})]}),e[22]=I,e[23]=m):m=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"API Key"}),e[24]=y):y=e[24];const b=d?"text":"password";let A;e[25]!==f?(A=f("apiKey"),e[25]=f,e[26]=A):A=e[26];let M;e[27]!==b||e[28]!==A?(M=s.jsx(ne,{type:b,placeholder:"sk-...",...A,className:"ph-no-capture h-8 text-sm pr-8"}),e[27]=b,e[28]=A,e[29]=M):M=e[29];let O;e[30]!==d?(O=()=>u(!d),e[30]=d,e[31]=O):O=e[31];let z;e[32]!==d?(z=d?s.jsx(Le,{size:14}):s.jsx(De,{size:14}),e[32]=d,e[33]=z):z=e[33];let F;e[34]!==O||e[35]!==z?(F=s.jsx("button",{type:"button",onClick:O,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:z}),e[34]=O,e[35]=z,e[36]=F):F=e[36];let B;e[37]!==M||e[38]!==F?(B=s.jsxs("div",{className:"relative",children:[M,F]}),e[37]=M,e[38]=F,e[39]=B):B=e[39];let R;e[40]!==g.apiKey?(R=g.apiKey&&s.jsx("p",{className:"text-xs text-destructive",children:g.apiKey.message}),e[40]=g.apiKey,e[41]=R):R=e[41];let K;e[42]!==B||e[43]!==R?(K=s.jsxs("div",{className:"space-y-1",children:[y,B,R]}),e[42]=B,e[43]=R,e[44]=K):K=e[44];let $;e[45]!==T?($=T&&s.jsx("p",{className:"text-xs text-destructive",children:T.message}),e[45]=T,e[46]=$):$=e[46];let D;e[47]!==k||e[48]!==n?(D=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:k,children:"Cancel"}),e[47]=k,e[48]=n,e[49]=D):D=e[49];const V=k?"Saving...":"Save Key";let L;e[50]!==k||e[51]!==V?(L=s.jsx(ee,{type:"submit",size:"sm",disabled:k,children:V}),e[50]=k,e[51]=V,e[52]=L):L=e[52];let U;e[53]!==D||e[54]!==L?(U=s.jsxs(Fe,{children:[D,L]}),e[53]=D,e[54]=L,e[55]=U):U=e[55];let E;return e[56]!==m||e[57]!==K||e[58]!==$||e[59]!==U||e[60]!==N?(E=s.jsxs("form",{onSubmit:N,className:"space-y-3",children:[m,K,$,U]}),e[56]=m,e[57]=K,e[58]=$,e[59]=U,e[60]=N,e[61]=E):E=e[61],E}function Jt(i){Q.error(`Failed to save key: ${i.message}`)}const Zt=Te({label:re().optional(),baseUrl:re().min(1,"Base URL is required"),apiKey:re().optional()});function es(i){const e=W.c(73),{preset:t,onCancel:n,onSuccess:l}=i,{org:o}=le();let r;e[0]!==o.id||e[1]!==o.slug?(r={connectionId:me,orgId:o.id,orgSlug:o.slug},e[0]=o.id,e[1]=o.slug,e[2]=r):r=e[2];const a=he(r),c=fe(),[d,u]=P.useState(!1);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=ze(Zt),e[3]=p):p=e[3];const f=t?.defaultBaseUrl??"";let h;e[4]!==f?(h={resolver:p,defaultValues:{label:"",baseUrl:f,apiKey:""}},e[4]=f,e[5]=h):h=e[5];const{register:v,handleSubmit:g,formState:S}=Re(h),{errors:j}=S;let w;e[6]!==a||e[7]!==t?(w=async se=>{const Xe=JSON.stringify({baseUrl:se.baseUrl,apiKey:se.apiKey||""});await a.callTool({name:"AI_PROVIDER_KEY_CREATE",arguments:{providerId:"openai-compatible",label:se.label||t?.name||se.baseUrl,apiKey:Xe,...t?{presetId:t.id}:{}}})},e[6]=a,e[7]=t,e[8]=w):w=e[8];let _;e[9]!==l||e[10]!==o.id||e[11]!==c?(_=()=>{c.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),c.invalidateQueries({queryKey:te.aiProviders(o.id)}),Q.success("Connection saved successfully"),l()},e[9]=l,e[10]=o.id,e[11]=c,e[12]=_):_=e[12];let k;e[13]!==w||e[14]!==_?(k={mutationFn:w,onSuccess:_,onError:ts},e[13]=w,e[14]=_,e[15]=k):k=e[15];const{mutate:T,isPending:x,error:N}=de(k),C=t?`e.g. ${t.name} prod, ${t.name} dev`:"e.g. My OpenAI-compatible server",I=t?.baseUrlPlaceholder??"http://localhost:4000/v1";let m;e[16]!==T?(m=se=>T(se),e[16]=T,e[17]=m):m=e[17];let y;e[18]!==g||e[19]!==m?(y=g(m),e[18]=g,e[19]=m,e[20]=y):y=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),e[21]=b):b=e[21];let A;e[22]!==v?(A=v("label"),e[22]=v,e[23]=A):A=e[23];let M;e[24]!==C||e[25]!==A?(M=s.jsxs("div",{className:"space-y-1",children:[b,s.jsx(ne,{placeholder:C,...A,className:"h-8 text-sm"})]}),e[24]=C,e[25]=A,e[26]=M):M=e[26];let O;e[27]!==I||e[28]!==j||e[29]!==t?.defaultBaseUrl||e[30]!==v?(O=t?.defaultBaseUrl?s.jsx("input",{type:"hidden",...v("baseUrl")}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ne,{type:"url",placeholder:I,...v("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&s.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[27]=I,e[28]=j,e[29]=t?.defaultBaseUrl,e[30]=v,e[31]=O):O=e[31];const z=t?.apiKeyRecommended?"recommended":"optional";let F;e[32]!==z?(F=s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API Key"," ",s.jsxs("span",{className:"text-muted-foreground/60",children:["(",z,")"]})]}),e[32]=z,e[33]=F):F=e[33];const B=d?"text":"password";let R;e[34]!==v?(R=v("apiKey"),e[34]=v,e[35]=R):R=e[35];let K;e[36]!==B||e[37]!==R?(K=s.jsx(ne,{type:B,placeholder:"sk-...",...R,className:"ph-no-capture h-8 text-sm pr-8"}),e[36]=B,e[37]=R,e[38]=K):K=e[38];let $;e[39]!==d?($=()=>u(!d),e[39]=d,e[40]=$):$=e[40];let D;e[41]!==d?(D=d?s.jsx(Le,{size:14}):s.jsx(De,{size:14}),e[41]=d,e[42]=D):D=e[42];let V;e[43]!==$||e[44]!==D?(V=s.jsx("button",{type:"button",onClick:$,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:D}),e[43]=$,e[44]=D,e[45]=V):V=e[45];let L;e[46]!==K||e[47]!==V?(L=s.jsxs("div",{className:"relative",children:[K,V]}),e[46]=K,e[47]=V,e[48]=L):L=e[48];let U;e[49]!==F||e[50]!==L?(U=s.jsxs("div",{className:"space-y-1",children:[F,L]}),e[49]=F,e[50]=L,e[51]=U):U=e[51];let E;e[52]!==t?(E=t?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[52]=t,e[53]=E):E=e[53];let H;e[54]!==N?(H=N&&s.jsx("p",{className:"text-xs text-destructive",children:N.message}),e[54]=N,e[55]=H):H=e[55];let G;e[56]!==x||e[57]!==n?(G=s.jsx(ee,{type:"button",variant:"ghost",size:"sm",onClick:n,disabled:x,children:"Cancel"}),e[56]=x,e[57]=n,e[58]=G):G=e[58];const J=x?"Saving...":"Save Connection";let Y;e[59]!==x||e[60]!==J?(Y=s.jsx(ee,{type:"submit",size:"sm",disabled:x,children:J}),e[59]=x,e[60]=J,e[61]=Y):Y=e[61];let Z;e[62]!==G||e[63]!==Y?(Z=s.jsxs(Fe,{children:[G,Y]}),e[62]=G,e[63]=Y,e[64]=Z):Z=e[64];let ce;return e[65]!==y||e[66]!==M||e[67]!==O||e[68]!==U||e[69]!==E||e[70]!==H||e[71]!==Z?(ce=s.jsxs("form",{onSubmit:y,className:"space-y-3",children:[M,O,U,E,H,Z]}),e[65]=y,e[66]=M,e[67]=O,e[68]=U,e[69]=E,e[70]=H,e[71]=Z,e[72]=ce):ce=e[72],ce}function ts(i){Q.error(`Failed to save connection: ${i.message}`)}const ss={kind:"closed"};function is(i,e){switch(e.type){case"open":return i.kind==="closed"?{kind:"grid"}:i;case"close":return{kind:"closed"};case"back":switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return i}case"select-form":return i.kind!=="grid"?i:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return i.kind!=="grid"?i:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return i.kind==="oauth-pending"?{kind:"grid"}:i;case"select-provision":return i.kind!=="grid"?i:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return i.kind!=="provision-pending"?i:{kind:"provision-error",providerId:i.providerId,error:e.error};case"retry-provision":return i.kind!=="provision-error"?i:{kind:"provision-pending",providerId:i.providerId}}}function ns(i){switch(i.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return i.providerId;default:return null}}function ls({open:i,onOpenChange:e,initialProvider:t}){const l=pe()?.providers??[],{org:o}=le(),r=he({connectionId:me,orgId:o.id,orgSlug:o.slug}),a=fe(),[c,d]=P.useReducer(is,ss),u=P.useRef(!1);P.useEffect(()=>{i&&c.kind==="closed"?d({type:"open"}):!i&&c.kind!=="closed"&&d({type:"close"})},[i,c.kind]);const p=()=>{u.current=!1,d({type:"close"}),e(!1)},f=()=>{a.invalidateQueries({queryKey:te.aiProviderKeys(o.id)}),a.invalidateQueries({queryKey:te.aiProviders(o.id)})},{mutate:h}=de({mutationFn:async({providerId:m,code:y,stateToken:b,label:A})=>{const M=await r.callTool({name:"AI_PROVIDER_OAUTH_EXCHANGE",arguments:{providerId:m,code:y,stateToken:b,label:A}});if(M?.isError)throw new Error(M.content?.[0]?.text??"OAuth exchange failed");return m},onSuccess:m=>{X("ai_provider_oauth_succeeded",{provider_id:m}),f();const y=l.find(b=>b.id===m);Q.success(`${y?.name??"Provider"} connected successfully`),p()},onError:(m,y)=>{X("ai_provider_oauth_failed",{provider_id:y.providerId,error:m.message}),Q.error(`OAuth connection failed: ${m.message}`),d({type:"oauth-failed"})}}),{mutate:v}=de({mutationFn:async m=>{const y=await r.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:m}});if(y?.isError)throw new Error(y.content?.[0]?.text??"Key provisioning failed");return m},onSuccess:m=>{X("ai_provider_provision_succeeded",{provider_id:m}),f();const y=l.find(b=>b.id===m);Q.success(`${y?.name??"Provider"} connected successfully`),p()},onError:(m,y)=>{X("ai_provider_provision_failed",{provider_id:y,error:m.message}),d({type:"provision-error",error:m.message})}}),g=async m=>{const{provider:y}=m,b=m.kind==="openai-compatible"?m.preset?.id??null:null,A=y.supportedMethods.includes("oauth-pkce"),M=y.supportedMethods.includes("api-key");if(y.supportsProvision===!0){X("ai_provider_connect_clicked",{provider_id:y.id,method:"provision"}),d({type:"select-provision",providerId:y.id}),v(y.id);return}if(A){X("ai_provider_connect_clicked",{provider_id:y.id,method:"oauth-pkce"});try{const z=await r.callTool({name:"AI_PROVIDER_OAUTH_URL",arguments:{providerId:y.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`}});if(!z.structuredContent)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");d({type:"select-oauth",providerId:y.id,stateToken:z.structuredContent.stateToken}),window.open(z.structuredContent.url,"AiProviderOAuth","width=600,height=700")}catch(z){Q.error(`Failed to start OAuth: ${z instanceof Error?z.message:String(z)}`)}return}M&&(X("ai_provider_connect_clicked",{provider_id:y.id,...b!==null?{preset_id:b}:{},method:"api-key"}),d({type:"select-form",providerId:y.id,presetId:b}))},S=P.useRef(g);S.current=g;const j=P.useRef(t);j.current=t,P.useEffect(()=>{!j.current||c.kind!=="grid"||u.current||(u.current=!0,S.current(j.current))},[c.kind]);const w=c.kind==="oauth-pending"?c.stateToken:null,_=c.kind==="oauth-pending"?c.providerId:null;P.useEffect(()=>{if(c.kind!=="oauth-pending")return;let m=!1;const y=c.stateToken,b=c.providerId,A=O=>{if(O.origin!==window.location.origin||O.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:z,stateToken:F}=O.data;if(F!==y){Q.error("Security check failed: State token mismatch"),d({type:"oauth-failed"});return}m=!0;const B=l.find(R=>R.id===b);h({providerId:b,code:z,stateToken:y,label:B?.name??b})};window.addEventListener("message",A);const M=setTimeout(()=>{m||(X("ai_provider_oauth_timeout",{provider_id:b}),d({type:"oauth-failed"}),Q.error("Connection timed out"))},12e4);return()=>{window.removeEventListener("message",A),clearTimeout(M)}},[c.kind,w,_,h]);const k=ns(c),T=k?l.find(m=>m.id===k):null,N=(c.kind==="form"&&c.presetId?ae.find(m=>m.id===c.presetId):null)?.name??T?.name??"Connect an AI provider",C=c.kind!=="grid"&&c.kind!=="closed",I=()=>{t?p():d({type:"back"})};return s.jsx(Nt,{open:c.kind!=="closed",onOpenChange:m=>!m&&p(),children:s.jsxs(kt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsxs(wt,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[C&&s.jsx(ee,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:I,children:s.jsx(Pe,{size:16})}),s.jsx(_t,{children:N})]}),c.kind==="grid"&&!t&&s.jsx(Ct,{children:"Pick a provider — we'll handle the rest."})]}),c.kind==="grid"&&!t&&s.jsx(Be,{providers:l,onSelect:g}),c.kind==="form"&&(c.providerId==="openai-compatible"?s.jsx(es,{preset:c.presetId?ae.find(m=>m.id===c.presetId):void 0,onCancel:()=>d({type:"back"}),onSuccess:()=>{f(),p()}}):s.jsx(Qt,{providerId:c.providerId,onCancel:()=>d({type:"back"}),onSuccess:()=>{f(),p()}})),c.kind==="oauth-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(be,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"Authorize the connection in the popup window. This dialog will close once authorization completes."})]}),c.kind==="provision-pending"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[s.jsx(be,{size:"lg"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connecting…"})]}),c.kind==="provision-error"&&s.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[s.jsx(St,{size:28,className:"text-destructive"}),s.jsx("p",{className:"text-sm text-foreground text-center",children:c.error}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ee,{variant:"outline",size:"sm",onClick:()=>d({type:"back"}),children:"Back"}),s.jsx(ee,{size:"sm",onClick:()=>{d({type:"retry-provision"}),v(c.providerId)},children:"Retry"})]})]})]})})}function os(){const i=W.c(10),{org:e}=le();let t;i[0]!==e.id||i[1]!==e.slug?(t={connectionId:me,orgId:e.id,orgSlug:e.slug},i[0]=e.id,i[1]=e.slug,i[2]=t):t=i[2];const n=he(t);let l;i[3]!==e.id?(l=te.defaultBrand(e.id),i[3]=e.id,i[4]=l):l=i[4];let o;i[5]!==n?(o=async()=>{const c=await n.callTool({name:"BRAND_CONTEXT_LIST",arguments:{}}),d=Et(c);return(Array.isArray(d?.items)?d.items:[]).find(rs)??null},i[5]=n,i[6]=o):o=i[6];let r;i[7]!==l||i[8]!==o?(r={queryKey:l,queryFn:o},i[7]=l,i[8]=o,i[9]=r):r=i[9];const{data:a}=Ze(r);return a??null}function rs(i){return i.isDefault&&!i.archivedAt}function as(i){const e=i.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(l=>typeof l=="object"&&l!==null&&"label"in l&&/primary|brand|main/i.test(l.label)),n=t?t.value:e[0]?.value;return typeof n=="string"?n:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function cs(i){const e=W.c(39);let t;e[0]!==i?(t=i===void 0?{}:i,e[0]=i,e[1]=t):t=e[1];const{title:n,description:l}=t,{org:o}=le(),{localMode:r}=Je(),a=os(),c=bt(),[d,u]=P.useState(null),[p,f]=P.useState(!1),[h,v]=P.useState(!1),g=pe();let S;e[2]!==g?.providers?(S=g?.providers??[],e[2]=g?.providers,e[3]=S):S=e[3];const j=S,w=o.name;let _;e[4]!==a?(_=a?as(a):null,e[4]=a,e[5]=_):_=e[5];const k=_,T=a?.favicon??a?.logo??null,x=n??(w?`${w} is ready for agents`:"Your agents are almost ready"),N=l??(r?"Connect a provider, or run `bunx decocms link` on your desktop for Claude Code, Codex, and local files.":"Connect a provider — or run `bunx decocms link` on your desktop to use Claude Code, Codex, or your local files."),C=!!(T||k);let I;e[6]!==k?(I=k?{backgroundColor:`${k}18`,borderColor:`${k}30`}:void 0,e[6]=k,e[7]=I):I=e[7];const m=I,y=C?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let b;e[8]!==y||e[9]!==m||e[10]!==T||e[11]!==c||e[12]!==k?(b=T?s.jsx("div",{className:y,style:m,children:s.jsx("img",{src:T,alt:"",className:"size-7 rounded object-contain"})}):s.jsx("button",{type:"button",onClick:()=>v(!0),"aria-label":c.online?"Desktop linked":"Connect your desktop",className:ue(y,"cursor-pointer transition-colors hover:bg-accent"),style:m,children:s.jsxs("span",{className:"relative inline-flex items-center justify-center",children:[s.jsx(jt,{size:24,style:k?{color:k}:void 0,className:ue(!k&&"text-muted-foreground")}),c.online&&s.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2.5 rounded-full bg-success ring-2 ring-background animate-pulse"})]})}),e[8]=y,e[9]=m,e[10]=T,e[11]=c,e[12]=k,e[13]=b):b=e[13];let A;e[14]!==x?(A=s.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:x}),e[14]=x,e[15]=A):A=e[15];let M;e[16]!==N?(M=s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:N}),e[16]=N,e[17]=M):M=e[17];let O;e[18]!==A||e[19]!==M?(O=s.jsxs("div",{className:"space-y-2",children:[A,M]}),e[18]=A,e[19]=M,e[20]=O):O=e[20];let z;e[21]!==b||e[22]!==O?(z=s.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[b,O]}),e[21]=b,e[22]=O,e[23]=z):z=e[23];let F,B;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=E=>u(E),B=()=>f(!0),e[24]=F,e[25]=B):(F=e[24],B=e[25]);let R;e[26]!==j?(R=s.jsx("div",{className:"w-full",children:s.jsx(Be,{providers:j,onSelect:F,onShowAll:B})}),e[26]=j,e[27]=R):R=e[27];const K=d!==null||p;let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=E=>{E||(u(null),f(!1))},e[28]=$):$=e[28];const D=d??void 0;let V;e[29]!==K||e[30]!==D?(V=s.jsx(ls,{open:K,onOpenChange:$,initialProvider:D}),e[29]=K,e[30]=D,e[31]=V):V=e[31];let L;e[32]!==h?(L=s.jsx(Ot,{open:h,onOpenChange:v}),e[32]=h,e[33]=L):L=e[33];let U;return e[34]!==R||e[35]!==V||e[36]!==L||e[37]!==z?(U=s.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[z,R,V,L]}),e[34]=R,e[35]=V,e[36]=L,e[37]=z,e[38]=U):U=e[38],U}function ge(i){const e=i.title.includes(": ");return{provider:e?i.title.split(": ")[0]??"":i.modelId.split("/")[0]??"",displayName:e?i.title.split(": ").slice(1).join(": "):i.title}}function ds(i){return i<32e3?{level:1,label:"Small",description:"Short conversations"}:i<2e5?{level:2,label:"Medium",description:"Good for most tasks"}:i<5e5?{level:3,label:"Large",description:"Long projects & research"}:{level:4,label:"Very large",description:"Massive files & data"}}const us=["bg-destructive","bg-warning","bg-success","bg-success"],ms=["text-success","text-warning","text-warning","text-destructive"];function hs(i){const e=Math.round(i*.75/1e3);return e>=1?`~${e}K words`:`~${Math.round(i*.75)} words`}function fs(i){return i<1?{level:1,label:"Cheap"}:i<5?{level:2,label:"Moderate"}:i<15?{level:3,label:"High"}:{level:4,label:"Expensive"}}const ps={text:{icon:s.jsx(ht,{className:"size-3.5"}),label:"Text"},vision:{icon:s.jsx(mt,{className:"size-3.5"}),label:"Vision"},image:{icon:s.jsx(ct,{className:"size-3.5"}),label:"Image"},tools:{icon:s.jsx(ut,{className:"size-3.5"}),label:"Tools"},reasoning:{icon:s.jsx(At,{className:"size-3.5"}),label:"Reasoning"},"web-search":{icon:s.jsx($e,{className:"size-3.5"}),label:"Web search"}};function xs(i){const e=W.c(5),{capability:t}=i;let n;e[0]!==t?(n=ps[t]??{icon:null,label:t.charAt(0).toUpperCase()+t.slice(1)},e[0]=t,e[1]=n):n=e[1];const l=n;let o;return e[2]!==l.icon||e[3]!==l.label?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[l.icon,l.label]}),e[2]=l.icon,e[3]=l.label,e[4]=o):o=e[4],o}function gs(i){const e=W.c(49),{model:t,compact:n}=i,l=n===void 0?!1:n;if(!t){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=x):x=e[0],x}const o=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let a;e[1]!==t?(a=ge(t),e[1]=t,e[2]=a):a=e[2];const{provider:c,displayName:d}=a;if(l){let x;e[3]!==t.limits?(x=t.limits?.contextWindow&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Context"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]}),e[3]=t.limits,e[4]=x):x=e[4];let N;e[5]!==o?(N=o!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",o.toFixed(2)," / 1M"]})]}),e[5]=o,e[6]=N):N=e[6];let C;e[7]!==r?(C=r!=null&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[7]=r,e[8]=C):C=e[8];let I;e[9]!==t.limits?(I=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),s.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[9]=t.limits,e[10]=I):I=e[10];let m;return e[11]!==x||e[12]!==N||e[13]!==C||e[14]!==I?(m=s.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,N,C,I]}),e[11]=x,e[12]=N,e[13]=C,e[14]=I,e[15]=m):m=e[15],m}let u;e[16]!==c?(u=s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c}),e[16]=c,e[17]=u):u=e[17];let p;e[18]!==t.logo||e[19]!==t.title?(p=t.logo&&s.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[18]=t.logo,e[19]=t.title,e[20]=p):p=e[20];let f;e[21]!==d?(f=s.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:d}),e[21]=d,e[22]=f):f=e[22];let h;e[23]!==p||e[24]!==f?(h=s.jsxs("div",{className:"flex items-center gap-2.5",children:[p,f]}),e[23]=p,e[24]=f,e[25]=h):h=e[25];let v;e[26]!==t.modelId?(v=s.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[26]=t.modelId,e[27]=v):v=e[27];let g;e[28]!==u||e[29]!==h||e[30]!==v?(g=s.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[u,h,v]}),e[28]=u,e[29]=h,e[30]=v,e[31]=g):g=e[31];let S;e[32]!==t.capabilities?(S=t.capabilities&&t.capabilities.length>0&&s.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(vs)}),e[32]=t.capabilities,e[33]=S):S=e[33];let j;e[34]!==t.limits?(j=t.limits?.contextWindow&&(()=>{const{level:x,label:N,description:C}=ds(t.limits.contextWindow);return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Context window"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(I=>s.jsx("div",{className:ue("w-2 h-2 rounded-full",I<=x?us[x-1]:"bg-muted")},I))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",C]})]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," tokens"]})]})})(),e[34]=t.limits,e[35]=j):j=e[35];let w;e[36]!==t.limits?(w=t.limits?.maxOutputTokens&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output limit"}),s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," tokens"]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:hs(t.limits.maxOutputTokens)})]})]}),e[36]=t.limits,e[37]=w):w=e[37];let _;e[38]!==o||e[39]!==r?(_=(o!=null||r!=null)&&(()=>{const{level:x,label:N}=o!=null?fs(o):{level:0,label:""};return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Pricing"}),o!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>s.jsx("span",{className:ue("text-sm font-bold leading-none",C<=x?ms[x-1]:"text-muted-foreground/20"),children:"$"},C))}),s.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N})]}),s.jsxs("div",{className:"flex flex-col gap-1",children:[o!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Input"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",o.toFixed(2)," / 1M tokens"]})]}),r!=null&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Output"}),s.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M tokens"]})]})]})]})})(),e[38]=o,e[39]=r,e[40]=_):_=e[40];let k;e[41]!==j||e[42]!==w||e[43]!==_?(k=s.jsxs("div",{className:"flex flex-col gap-6",children:[j,w,_]}),e[41]=j,e[42]=w,e[43]=_,e[44]=k):k=e[44];let T;return e[45]!==k||e[46]!==g||e[47]!==S?(T=s.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[g,S,k]}),e[45]=k,e[46]=g,e[47]=S,e[48]=T):T=e[48],T}function vs(i){return s.jsx(xs,{capability:i},i)}function fi(i){const e=W.c(19),{model:t,placeholder:n,isLoading:l}=i,o=n===void 0?"Select model":n;if(l===void 0?!1:l){let g;return e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(q,{className:"w-5 h-5 rounded-sm shrink-0"}),s.jsx(q,{className:"w-16 h-3 hidden md:block"})]}),e[0]=g):g=e[0],g}if(!t){let g;e[1]!==o?(g=s.jsx("span",{className:"text-sm text-muted-foreground",children:o}),e[1]=o,e[2]=g):g=e[2];let S;e[3]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Se,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[3]=S):S=e[3];let j;return e[4]!==g?(j=s.jsxs("div",{className:"flex items-center gap-1.5",children:[g,S]}),e[4]=g,e[5]=j):j=e[5],j}let a;e[6]!==t?(a=ge(t),e[6]=t,e[7]=a):a=e[7];const{displayName:c}=a;let d;e[8]!==t?(d=xe(t),e[8]=t,e[9]=d):d=e[9];const u=d;let p;e[10]!==t.title||e[11]!==u?(p=s.jsx("img",{src:u,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[10]=t.title,e[11]=u,e[12]=p):p=e[12];let f;e[13]!==c?(f=s.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:c}),e[13]=c,e[14]=f):f=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Se,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[15]=h):h=e[15];let v;return e[16]!==p||e[17]!==f?(v=s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[p,f,h]}),e[16]=p,e[17]=f,e[18]=v):v=e[18],v}const bs=["vision","image","file","audio","video"],We=["image/png","image/jpeg","image/gif","image/webp"],Ve=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function ve(i){const e=i?.capabilities;return e?bs.some(t=>e.includes(t)):!1}function pi(i,e){if(!i)return!1;if(i.startsWith("text/"))return!0;const t=e?.capabilities??[],n=t.includes("vision")||t.includes("image"),l=t.includes("file"),o=t.includes("audio"),r=t.includes("video");return!!(n&&We.includes(i)||l&&i==="application/pdf"||o&&i.startsWith("audio/")||r&&i.startsWith("video/")||ve(e)&&Ve.includes(i))}function xi(i){const e=i?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...We),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),ve(i)&&t.push(...Ve),t.join(",")}function gi(i){const e=i?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("images"),e.includes("file")&&t.push("PDFs"),e.includes("audio")&&t.push("audio"),e.includes("video")&&t.push("video"),ve(i)&&t.push("Office files"),t.length===0?"text only":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`}const He=["smarter","faster","cheaper"],qe={smarter:"Smarter",faster:"Faster",cheaper:"Cheaper"},ys=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],js=ys.flatMap(({tier:i,prefixes:e})=>e.map(t=>({tier:i,prefix:t}))).sort((i,e)=>e.prefix.length-i.prefix.length),Ss=new Set(["google/gemini-2.5-pro"]),Ee=new Map;function Ns(i){const e=Ee.get(i);if(e!==void 0)return e;let t=null;if(i.endsWith(":free"))t="cheaper";else e:for(const{tier:n,prefix:l}of js)if(i.startsWith(l)){if(Ss.has(l)&&i.length>l.length&&i[l.length]==="-"){const r=i[l.length+1];if(!r||!/\d/.test(r))continue e}t=n;break}return Ee.set(i,t),t}function Oe(i){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of i){const n=Ns(t.modelId);e[n??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((n,l)=>n.title.localeCompare(l.title));return e}const Ge="mesh:model-shortlist:",ks=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function ws(i){try{const e=localStorage.getItem(Ge+i);return e?new Set(JSON.parse(e)):null}catch{return null}}function _s(i,e){localStorage.setItem(Ge+i,JSON.stringify([...e]))}function Cs(i){const e=W.c(21),{model:t,onHover:n}=i;let l;e[0]!==t?(l=ge(t),e[0]=t,e[1]=l):l=e[1];const{displayName:o,provider:r}=l;let a;e[2]!==t?(a=xe(t),e[2]=t,e[3]=a):a=e[3];const c=a;let d;e[4]!==t||e[5]!==n?(d=()=>n(t),e[4]=t,e[5]=n,e[6]=d):d=e[6];let u;e[7]!==t.title||e[8]!==c?(u=s.jsx("img",{src:c,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=c,e[9]=u):u=e[9];let p;e[10]!==o?(p=s.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:o}),e[10]=o,e[11]=p):p=e[11];let f;e[12]!==r?(f=s.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:r}),e[12]=r,e[13]=f):f=e[13];let h;e[14]!==p||e[15]!==f?(h=s.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[p,f]}),e[14]=p,e[15]=f,e[16]=h):h=e[16];let v;return e[17]!==d||e[18]!==u||e[19]!==h?(v=s.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[u,h]}),e[17]=d,e[18]=u,e[19]=h,e[20]=v):v=e[20],v}function Is(i){const e=W.c(10),{error:t,onRetry:n}=i;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:s.jsx(st,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("p",{className:"text-sm font-medium text-foreground",children:"Failed to load models"}),e[1]=o):o=e[1];const r=t?.message||"Could not fetch models from this provider.";let a;e[2]!==r?(a=s.jsxs("div",{className:"flex flex-col gap-1",children:[o,s.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[r," Try another provider or retry."]})]}),e[2]=r,e[3]=a):a=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(dt,{className:"size-3.5"}),e[4]=c):c=e[4];let d;e[5]!==n?(d=s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(ee,{variant:"outline",size:"sm",onClick:n,className:"gap-1.5",children:[c,"Retry"]})}),e[5]=n,e[6]=d):d=e[6];let u;return e[7]!==a||e[8]!==d?(u=s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,a,d]}),e[7]=a,e[8]=d,e[9]=u):u=e[9],u}function Ms(){const i=W.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Es)}),i[0]=e):e=i[0],e}function Es(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(q,{className:"flex-1 h-4"}),s.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ae(i){const e=W.c(12),{label:t,models:n,onSelect:l,onHover:o}=i;if(n.length===0)return null;let r;e[0]!==t?(r=s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=r):r=e[1];let a;if(e[2]!==n||e[3]!==o||e[4]!==l){let d;e[6]!==o||e[7]!==l?(d=u=>s.jsx("div",{onClick:()=>l(u),className:"cursor-pointer",children:s.jsx(Cs,{model:u,onHover:o})},u.modelId),e[6]=o,e[7]=l,e[8]=d):d=e[8],a=n.map(d),e[2]=n,e[3]=o,e[4]=l,e[5]=a}else a=e[5];let c;return e[9]!==r||e[10]!==a?(c=s.jsxs("div",{children:[r,a]}),e[9]=r,e[10]=a,e[11]=c):c=e[11],c}function Os(i){const e=W.c(21),{model:t,isChecked:n,onToggle:l,onHover:o}=i,[r,a]=P.useState(n);r!==n&&a(n);let c;e[0]!==t?(c=xe(t),e[0]=t,e[1]=c):c=e[1];const d=c;let u;e[2]!==t||e[3]!==o?(u=()=>o(t),e[2]=t,e[3]=o,e[4]=u):u=e[4];let p;e[5]!==t.modelId||e[6]!==l?(p=()=>{a(As),l(t.modelId)},e[5]=t.modelId,e[6]=l,e[7]=p):p=e[7];let f;e[8]!==r||e[9]!==p?(f=s.jsx(it,{checked:r,onCheckedChange:p}),e[8]=r,e[9]=p,e[10]=f):f=e[10];let h;e[11]!==d||e[12]!==t.title?(h=s.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=h):h=e[13];let v;e[14]!==t.title?(v=s.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=v):v=e[15];let g;return e[16]!==u||e[17]!==f||e[18]!==h||e[19]!==v?(g=s.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:u,children:[f,h,v]}),e[16]=u,e[17]=f,e[18]=h,e[19]=v,e[20]=g):g=e[20],g}function As(i){return!i}function Ts(i){const e=[];for(const t of He)if(i[t].length>0){e.push({type:"header",label:qe[t]});for(const n of i[t])e.push({type:"model",model:n})}if(i.other.length>0){e.push({type:"header",label:"Other"});for(const t of i.other)e.push({type:"model",model:t})}return e}function zs({items:i,shortlistSet:e,onToggle:t,onHover:n}){const l=P.useRef(null),o=Wt({count:i.length,getScrollElement:()=>l.current,estimateSize:r=>i[r]?.type==="header"?36:44,overscan:6});return s.jsx("div",{ref:l,className:"flex-1 overflow-y-auto",children:s.jsx("div",{className:"relative",style:{height:o.getTotalSize()},children:o.getVirtualItems().map(r=>{const a=i[r.index];return a?s.jsx("div",{"data-index":r.index,ref:o.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${r.start}px)`},children:a.type==="header"?s.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:a.label}):s.jsx(Os,{model:a.model,isChecked:e.has(a.model.modelId),onToggle:t,onHover:n})},r.key):null})})})}function Rs(i){const e=W.c(23),{keyId:t,searchTerm:n,onHover:l,onModelSelect:o,managing:r,onToggleManage:a,filterModels:c}=i,{models:d}=vt(t),u=c?d.filter(c):d.filter(Ls);let p;e[0]!==t?(p=()=>(t?ws(t):null)??ks,e[0]=t,e[1]=p):p=e[1];const[f,h]=P.useState(p),[,v]=P.useTransition();let g;e[2]!==t||e[3]!==v?(g=m=>{t&&v(()=>{h(y=>{const b=new Set(y);return b.has(m)?b.delete(m):b.add(m),_s(t,b),b})})},e[2]=t,e[3]=v,e[4]=g):g=e[4];const S=g,j=n.toLowerCase().trim(),w=m=>j?m.filter(y=>y.title.toLowerCase().includes(j)||y.modelId.toLowerCase().includes(j)):m;if(r){const m=Oe(w(u)),y=Ts(m);let b;e[5]!==f?(b=z=>f.has(z.modelId),e[5]=f,e[6]=b):b=e[6];const A=u.filter(b).length;let M;e[7]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsx(Pe,{size:14}),e[7]=M):M=e[7];let O;return e[8]!==a?(O=s.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[M,"Back"]}),e[8]=a,e[9]=O):O=e[9],s.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[O,s.jsxs("span",{className:"text-xs text-muted-foreground",children:[A," selected"]})]}),s.jsx(zs,{items:y,shortlistSet:f,onToggle:S,onHover:l})]})}let _;e[10]!==f?(_=m=>f.has(m.modelId),e[10]=f,e[11]=_):_=e[11];const k=u.filter(_),T=k.length>0?k:u,x=Oe(w(T));let N;e[12]!==x||e[13]!==l||e[14]!==o?(N=He.map(m=>s.jsx(Ae,{label:qe[m],models:x[m],onSelect:o,onHover:l},m)),e[12]=x,e[13]=l,e[14]=o,e[15]=N):N=e[15];let C;e[16]!==x.other||e[17]!==l||e[18]!==o?(C=s.jsx(Ae,{label:"Other",models:x.other,onSelect:o,onHover:l}),e[16]=x.other,e[17]=l,e[18]=o,e[19]=C):C=e[19];let I;return e[20]!==N||e[21]!==C?(I=s.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,C]}),e[20]=N,e[21]=C,e[22]=I):I=e[22],I}function Ls(i){return i.asyncResearch!==!0}function vi(){const i=W.c(6);let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[s.jsx(q,{className:"size-4 shrink-0"}),s.jsx(q,{className:"flex-1 h-6"}),s.jsx(q,{className:"w-[140px] h-8 shrink-0"})]})}),i[0]=e):e=i[0];let t;i[1]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Ps)})]}),i[1]=t):t=i[1];let n;i[2]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx(q,{className:"size-6 shrink-0"}),s.jsx(q,{className:"h-6 w-32"})]}),i[2]=n):n=i[2];let l;i[3]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[n,s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(q,{className:"h-6 w-20 rounded-md"}),s.jsx(q,{className:"h-6 w-24 rounded-md"})]})]}),i[3]=l):l=i[3];let o;i[4]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(q,{className:"h-4 w-24"}),s.jsx(q,{className:"h-4 w-32"})]}),i[4]=o):o=i[4];let r;return i[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,s.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:s.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[l,s.jsxs("div",{className:"flex flex-col gap-4",children:[o,s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx(q,{className:"h-4 w-16"}),s.jsx(q,{className:"h-4 w-40"})]})]})]})})]}),i[5]=r):r=i[5],r}function Ps(i,e){return s.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[s.jsx(q,{className:"size-5 shrink-0 rounded-sm"}),s.jsx(q,{className:"flex-1 h-4"}),s.jsx(q,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Ye(i){const e=W.c(49),{onClose:t,credentialId:n,onCredentialChange:l,selectedModel:o,onModelChange:r,filterModels:a}=i,[c,d]=P.useState(null),[u,p]=P.useState(""),[f,h]=P.useState(!1),v=P.useRef(null),g=pe(),S=gt();let j;e[0]!==g?.providers?(j=Object.fromEntries((g?.providers??[]).map(Ks)),e[0]=g?.providers,e[1]=j):j=e[1];const w=j,_=et(),{org:k}=le();let T;e[2]!==l?(T=E=>{l(E),d(null)},e[2]=l,e[3]=T):T=e[3];const x=T;let N;e[4]!==n||e[5]!==t||e[6]!==r?(N=E=>{n&&(r(E),p(""),t())},e[4]=n,e[5]=t,e[6]=r,e[7]=N):N=e[7];const C=N;if(S.length===0){let E;return e[8]===Symbol.for("react.memo_cache_sentinel")?(E=s.jsx("div",{className:"flex items-center justify-center p-8 w-full sm:w-[740px]",children:s.jsx(cs,{})}),e[8]=E):E=e[8],E}let I;e[9]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx($e,{size:16,className:"text-muted-foreground shrink-0"}),e[9]=I):I=e[9];const m=f?"Search all models...":"Search for a model...";let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=E=>p(E.target.value),e[10]=y):y=e[10];let b;e[11]!==u||e[12]!==m?(b=s.jsx(ne,{ref:v,type:"text",placeholder:m,value:u,onChange:y,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[11]=u,e[12]=m,e[13]=b):b=e[13];let A;e[14]!==n||e[15]!==x||e[16]!==S||e[17]!==w?(A=S.length>0&&s.jsxs(nt,{value:n??"",onValueChange:x,children:[s.jsxs(lt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:Fs,children:[s.jsx(ot,{placeholder:"Key",children:(()=>{const E=S.find(Z=>Z.id===n),H=E?w[E.providerId]:void 0,G=Ie(E?.presetId),J=G?.logo??H?.logo,Y=G?.name??H?.name??E?.providerId??"Key";return s.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[J?s.jsx("img",{src:J,alt:Y,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:Y.slice(0,1).toUpperCase()}),s.jsx("span",{className:"text-xs truncate",children:Y})]})})()}),s.jsx(ft,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),s.jsx(rt,{children:S.map(E=>{const H=w[E.providerId],G=Ie(E.presetId),J=G?.logo??H?.logo,Y=G?.name??H?.name??E.providerId;return s.jsx(at,{value:E.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[J?s.jsx("img",{src:J,alt:Y,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):s.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:Y.slice(0,1).toUpperCase()}),s.jsxs("span",{children:[Y," — ",E.label]})]})},E.id)})})]}),e[14]=n,e[15]=x,e[16]=S,e[17]=w,e[18]=A):A=e[18];let M;e[19]!==b||e[20]!==A?(M=s.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:s.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[I,b,A]})}),e[19]=b,e[20]=A,e[21]=M):M=e[21];let O;e[22]!==n?(O=E=>{const{error:H,resetError:G}=E;return s.jsx(Is,{error:H,onRetry:G,credentialId:n??void 0})},e[22]=n,e[23]=O):O=e[23];let z;e[24]===Symbol.for("react.memo_cache_sentinel")?(z=s.jsx(Ms,{}),e[24]=z):z=e[24];const F=n??void 0;let B;e[25]===Symbol.for("react.memo_cache_sentinel")?(B=()=>h($s),e[25]=B):B=e[25];let R;e[26]!==a||e[27]!==C||e[28]!==f||e[29]!==u||e[30]!==F?(R=s.jsx(P.Suspense,{fallback:z,children:s.jsx(Rs,{keyId:F,searchTerm:u,onHover:d,onModelSelect:C,managing:f,onToggleManage:B,filterModels:a})}),e[26]=a,e[27]=C,e[28]=f,e[29]=u,e[30]=F,e[31]=R):R=e[31];let K;e[32]!==n||e[33]!==O||e[34]!==R?(K=s.jsx(tt,{fallback:O,children:R},n),e[32]=n,e[33]=O,e[34]=R,e[35]=K):K=e[35];let $;e[36]!==f||e[37]!==_||e[38]!==k?($=!f&&s.jsxs("div",{className:"border-t border-border flex",children:[s.jsxs("button",{type:"button",onClick:()=>P.startTransition(()=>h(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(xt,{className:"size-3.5 shrink-0"}),"Manage models"]}),s.jsx("div",{className:"w-px bg-border shrink-0"}),s.jsxs("button",{type:"button",onClick:()=>_({to:"/$org/settings/ai-providers",params:{org:k.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[s.jsx(pt,{className:"size-3.5 shrink-0"}),"Manage API keys"]})]}),e[36]=f,e[37]=_,e[38]=k,e[39]=$):$=e[39];let D;e[40]!==K||e[41]!==$||e[42]!==M?(D=s.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[M,K,$]}),e[40]=K,e[41]=$,e[42]=M,e[43]=D):D=e[43];const V=c??o??null;let L;e[44]!==V?(L=s.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:s.jsx(gs,{model:V})}),e[44]=V,e[45]=L):L=e[45];let U;return e[46]!==D||e[47]!==L?(U=s.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[D,L]}),e[46]=D,e[47]=L,e[48]=U):U=e[48],U}function $s(i){return!i}function Fs(i){return i.stopPropagation()}function Ks(i){return[i.id,i]}function Ds(i){const e=W.c(12),{onClose:t}=i,{credentialId:n,setCredentialId:l,selectedModel:o,setModel:r}=yt();let a;e[0]!==l?(a=u=>{X("chat_credential_changed",{credential_id:u}),l(u)},e[0]=l,e[1]=a):a=e[1];let c;e[2]!==n||e[3]!==o?.modelId||e[4]!==r?(c=u=>{n&&(X("chat_model_changed",{from_model_id:o?.modelId??null,to_model_id:u.modelId,to_model_provider:u.providerId??null,credential_id:n}),r({...u,keyId:n}))},e[2]=n,e[3]=o?.modelId,e[4]=r,e[5]=c):c=e[5];let d;return e[6]!==n||e[7]!==t||e[8]!==o||e[9]!==a||e[10]!==c?(d=s.jsx(Ye,{onClose:t,credentialId:n,onCredentialChange:a,selectedModel:o,onModelChange:c}),e[6]=n,e[7]=t,e[8]=o,e[9]=a,e[10]=c,e[11]=d):d=e[11],d}function bi(i){const e=W.c(2),{onClose:t}=i;let n;return e[0]!==t?(n=s.jsx(Ds,{onClose:t}),e[0]=t,e[1]=n):n=e[1],n}function yi(i){const e=W.c(2);let t;return e[0]!==i?(t=s.jsx(Ye,{...i}),e[0]=i,e[1]=t):t=e[1],t}function ji(i){const e=W.c(3),{size:t}=i,n=t===void 0?16:t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("path",{d:"M13 12L18.5 5M7.63965 3L12.5 12L13.6865 3M4.48381 6.71679L11.9872 12M3 12L11.9872 12.473M12.2244 13.177L7 20M4.84194 16.8682L11.2824 12.9758M11.5 21L12.665 13.177M21 14L13.1846 12.668M21 10.5788L13 12.3223M16.779 19.646L12.8876 13.3772M19.3566 18.207L13.313 12.9893"}),e[0]=l):l=e[0];let o;return e[1]!==n?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:n,height:n,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:l}),e[1]=n,e[2]=o):o=e[2],o}function Si(i){const e=W.c(3),{size:t}=i,n=t===void 0?16:t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("path",{clipRule:"evenodd",d:"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z"}),e[0]=l):l=e[0];let o;return e[1]!==n?(o=s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:n,height:n,fill:"currentColor",fillRule:"evenodd","aria-hidden":"true",children:l}),e[1]=n,e[2]=o):o=e[2],o}export{ji as C,yi as D,vi as M,cs as N,ae as O,Be as P,fi as S,Si as a,xi as b,ls as c,bi as d,gi as g,pi as i,ve as m};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{T as B,W as C,aH as ce,aJ as ae,aK as be,aI as ye,ba as pe,e as M,I as ve,H as je,r as T,j as s,D as $e,o as Q,C as _e,q as H,G as ne,a as ee,K as G,n as Ie,c as ge,B as V,t as Se,E as Te}from"./index-biiHZ5l9.js";import{i as Oe}from"./AlertCircle-9EFUZenf.js";import{P as oe}from"./index-r7-3fAFf.js";import{S as de}from"./skeleton--DN75sg7.js";import{b as ke,a as me,S as ue,c as Me}from"./settings-section-V9kb8x32.js";import{u as te,b as re,c as Ce}from"./use-ai-providers-v0sCRzMO.js";import{i as Ue}from"./CheckCircle-C2ualSpf.js";import{p as ze}from"./chat-context-Bu6qpu9K.js";import{e as Le,f as qe}from"./use-organization-settings-Izqk1Gkk.js";import{M as Ve}from"./select-model-0CGh6cKF.js";import{u as Be}from"./use-debounced-autosave-ClLbciGl.js";import{I as le}from"./input-5PMMNPU9.js";import{a as he,T as Ge}from"./toggle-group-DhVqXGfs.js";import{b as Ne,c as we,d as Pe,f as Ae,a as De,e as Ke,g as Ee,A as Fe}from"./alert-dialog-CSkQIwm8.js";import{S as J,u as X}from"./use-mcp-client-CWFUu1lY.js";import{s as Qe}from"./Plus-CjrtKB-Y.js";import{i as We}from"./Tool01-Dcq7KP8Y.js";import{s as Ye}from"./Trash01-Cup7-ZTT.js";import{A as He}from"./avatar-BHEXMwdE.js";import{O as Re,P as Je,c as xe}from"./agent-icons-DRrDyR7j.js";import{a as Xe}from"./RefreshCcw01-3BsQQkRx.js";import{s as Ze}from"./Eye-ByuwKsdh.js";import{d as et,b as tt,c as st,a as it,D as ot}from"./dialog-Bm1pP7Vu.js";import{S as rt}from"./spinner-DJD6-9r-.js";import{f as lt}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as nt}from"./require-capability-DVI2cKO3.js";import"./sidebar-CPZXU-2w.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./tooltip-bsrBmmjV.js";import"./sheet-D99KevZC.js";import"./X-1KR4wibP.js";import"./card-BUTabNLA.js";import"./ArrowUpRight-97355q5v.js";import"./tab-id-D4SJwEQy.js";import"./decopilot-sse-pool-BUhEcft-.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-0jbEmvOc.js";import"./use-collections-B5Jh_wGd.js";import"./drawer-B51jkLaX.js";import"./User01-thAIxsAs.js";import"./checkbox--nDaSUZE.js";import"./Check-D-9dblUn.js";import"./select-CNSUv3cw.js";import"./ChevronDown-Cf2Q-GlB.js";import"./ChevronUp-BAxoXhnT.js";import"./Key01-CzmPnHuw.js";import"./SearchMd-BL2y99rx.js";import"./Settings02-Cd4DIqaJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-Cw6kmClm.js";import"./ChevronRight-CrZy8tHx.js";import"./connect-desktop-dialog-DPqrgnkS.js";import"./Stars01-v0yz6PCZ.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-BPM45mbW.js";import"./access-gate-CWPebMdP.js";import"./capability-load-error-Dfw4xb8a.js";B({title:C(),url:C(),icon:C()});B({registries:ae(C(),B({enabled:be()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ce(C()).describe("List of MCP app_name or app_id values to hide from the store.")});const Z=B({keyId:C(),modelId:C(),title:C().optional()}).nullable();ye(["fast","smart","thinking","image","web_research"]);ye(["fast","smart","thinking"]);const at=B({tiers:B({fast:Z,smart:Z,thinking:Z,image:Z,web_research:Z})});B({ids:ce(C()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:C().describe("Brand context ID"),name:C().describe("Company name"),domain:C().describe("Company domain (e.g. example.com)"),overview:C().describe("Company overview / description"),logo:C().nullable().optional().describe("Logo URL"),favicon:C().nullable().optional().describe("Favicon URL"),ogImage:C().nullable().optional().describe("OG image URL"),fonts:B({heading:C().optional().describe("Font family for headings"),body:C().optional().describe("Font family for body text"),code:C().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:C().optional().describe("Primary brand color (hex)"),secondary:C().optional().describe("Secondary brand color (hex)"),accent:C().optional().describe("Accent / highlight color (hex)"),background:C().optional().describe("Background color (hex)"),foreground:C().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ce(ae(C(),pe())).nullable().optional().describe("Brand images"),metadata:ae(C(),pe()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:C().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:be().optional().describe("Whether this is the default brand for the organization")});const ct=e=>e.capabilities?.includes("image")===!0,dt=e=>{if(e.asyncResearch===!0)return!0;const t=e.modelId.toLowerCase().replace(/[^a-z0-9]/g,"");return t.includes("sonar")||t.includes("deepresearch")},mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:ct},{key:"web_research",label:"Web research",description:"Web search and deep research",filter:dt}];function ut(e){const t=M.c(20),{slot:i,onSlotChange:l,filterModels:o,defaultKeyId:a}=e,r=te(),[n,p]=T.useState(i?.keyId??a);let y;t[0]!==i?(y=()=>{i?.keyId&&p(i.keyId)},t[0]=i,t[1]=y):y=t[1];const I=i?.keyId;let h;t[2]!==I?(h=[I],t[2]=I,t[3]=h):h=t[3],T.useEffect(y,h);const c=n??a;let u;t[4]!==c||t[5]!==r?(u=c?r.find(d=>d.id===c):null,t[4]=c,t[5]=r,t[6]=u):u=t[6];const k=u,{models:m,isLoading:S}=re(o?c??void 0:void 0),v=o?S||m.some(o):!0;let g;t[7]!==i||t[8]!==k?.providerId?(g=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:k?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=k?.providerId,t[9]=g):g=t[9];const x=g;if(o&&!v){let d;return t[10]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=d):d=t[10],d}let b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=d=>p(d),t[11]=b):b=t[11];let j;t[12]!==c||t[13]!==l?(j=d=>{const w=d.keyId??c??"";p(w),l({keyId:w,modelId:d.modelId,title:d.title})},t[12]=c,t[13]=l,t[14]=j):j=t[14];let f;return t[15]!==c||t[16]!==o||t[17]!==x||t[18]!==j?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:x,credentialId:c,filterModels:o,onCredentialChange:b,onModelChange:j}),t[15]=c,t[16]=o,t[17]=x,t[18]=j,t[19]=f):f=t[19],f}function ft(e){const t=M.c(2),{isPending:i,showSaved:l}=e;if(i){let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(_e,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=o):o=t[0],o}if(l){let o;return t[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Ue,{size:12}),"Saved"]}),t[1]=o):o=t[1],o}return null}function pt(){const e=M.c(42),t=te(),i=Le(),l=t.length>0;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=ve(at),e[0]=o):o=e[0];let a;e[1]!==i?(a={resolver:o,values:i,mode:"onChange"},e[1]=i,e[2]=a):a=e[2];const r=je(a),{mutate:n,isPending:p,isSuccess:y}=qe(),I=r.formState.isDirty;let h;e[3]!==r||e[4]!==i||e[5]!==n?(h={delayMs:250,save:async()=>{const _=r.getValues();n(_,{onSuccess:()=>r.reset(_,{keepValues:!0}),onError:F=>{r.reset(i),Q.error(`Failed to save: ${F.message}`)}})}},e[3]=r,e[4]=i,e[5]=n,e[6]=h):h=e[6];const{schedule:c}=Be(h),u=t[0],k=t[1],m=t[2],{models:S}=re(u?.id),{models:v}=re(k?.id),{models:g}=re(m?.id);let x,b;e[7]!==r||e[8]!==l?(x=()=>{l||r.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_research:null}})},b=[l,r],e[7]=r,e[8]=l,e[9]=x,e[10]=b):(x=e[9],b=e[10]),T.useEffect(x,b);let j;e[11]!==t||e[12]!==r||e[13]!==u||e[14]!==k||e[15]!==m||e[16]!==S||e[17]!==v||e[18]!==g?(j=()=>{const _=r.getValues(),F=new Set(t.map(gt)),P={};u?.id&&(P[u.id]=S),k?.id&&(P[k.id]=v),m?.id&&(P[m.id]=g);const E=W=>W!=null&&!F.has(W.keyId),N={fast:E(_.tiers.fast)?null:_.tiers.fast,smart:E(_.tiers.smart)?null:_.tiers.smart,thinking:E(_.tiers.thinking)?null:_.tiers.thinking,image:E(_.tiers.image)?null:_.tiers.image,web_research:E(_.tiers.web_research)?null:_.tiers.web_research},L=!N.fast||!N.smart||!N.thinking||!N.image||!N.web_research,q=N.fast===_.tiers.fast&&N.smart===_.tiers.smart&&N.thinking===_.tiers.thinking&&N.image===_.tiers.image&&N.web_research===_.tiers.web_research;if(!L&&q)return;const R=ze(t,P);r.reset({tiers:{fast:N.fast??R.chat.fast,smart:N.smart??R.chat.smart,thinking:N.thinking??R.chat.thinking,image:N.image??R.image,web_research:N.web_research??R.webResearch}},{keepDirty:!0})},e[11]=t,e[12]=r,e[13]=u,e[14]=k,e[15]=m,e[16]=S,e[17]=v,e[18]=g,e[19]=j):j=e[19];const f=u?.id,d=k?.id,w=m?.id;let U;e[20]!==t||e[21]!==r||e[22]!==S||e[23]!==v||e[24]!==g||e[25]!==f||e[26]!==d||e[27]!==w?(U=[r,t,S,v,g,f,d,w],e[20]=t,e[21]=r,e[22]=S,e[23]=v,e[24]=g,e[25]=f,e[26]=d,e[27]=w,e[28]=U):U=e[28],T.useEffect(j,U);let O;e[29]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=O):O=e[29];const z=y&&!I;let A;e[30]!==p||e[31]!==z?(A=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[O,s.jsx(ft,{isPending:p,showSaved:z})]}),e[30]=p,e[31]=z,e[32]=A):A=e[32];let D;e[33]!==t[0]?.id||e[34]!==r.control||e[35]!==c?(D=mt.map(_=>s.jsx($e,{control:r.control,name:`tiers.${_.key}`,render:F=>{const{field:P}=F;return s.jsx(ke,{title:_.label,description:_.description,action:s.jsx(ut,{slot:P.value,defaultKeyId:t[0]?.id??null,filterModels:_.filter,onSlotChange:E=>{P.onChange(E),c()}})})}},_.key)),e[33]=t[0]?.id,e[34]=r.control,e[35]=c,e[36]=D):D=e[36];let K;e[37]!==D?(K=s.jsx(me,{children:D}),e[37]=D,e[38]=K):K=e[38];let $;return e[39]!==A||e[40]!==K?($=s.jsxs(ue,{title:"Default models",headerClassName:"pl-0",children:[A,K]}),e[39]=A,e[40]=K,e[41]=$):$=e[41],$}function gt(e){return e.id}const ht={usd:[10,20,100],brl:[50,100,500]};function xt(){const e=M.c(29),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),[o,a]=T.useState(!1),{mutate:r,isPending:n}=ee({mutationFn:async d=>{const w=await l.callTool({name:"AI_PROVIDER_TOPUP_URL",arguments:{providerId:"deco",amountCents:d,currency:c}});if(w?.isError)throw new Error(w.content?.[0]?.text??"Failed to get top-up URL");return w.structuredContent?.url},onSuccess:yt,onError:bt}),[p,y]=T.useState(""),[I,h]=T.useState("usd"),c=I,u=parseFloat(p),k=!isNaN(u)&&u>=1,m=c==="brl"?"R$":"$";let S;e[3]!==h?(S=d=>{d&&h(d)},e[3]=h,e[4]=S):S=e[4];let v,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(he,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),g=s.jsx(he,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[5]=v,e[6]=g):(v=e[5],g=e[6]);let x;e[7]!==c||e[8]!==S?(x=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:c,onValueChange:S,children:[v,g]}),e[7]=c,e[8]=S,e[9]=x):x=e[9];let b;e[10]!==c||e[11]!==m||e[12]!==o||e[13]!==n||e[14]!==r?(b=!o&&s.jsxs(s.Fragment,{children:[ht[c].map(d=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:n,onClick:()=>r(d*100),children:[m,d]},d)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:n,children:"Custom"})]}),e[10]=c,e[11]=m,e[12]=o,e[13]=n,e[14]=r,e[15]=b):b=e[15];let j;e[16]!==m||e[17]!==p||e[18]!==u||e[19]!==o||e[20]!==k||e[21]!==n||e[22]!==y||e[23]!==r?(j=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:m}),s.jsx(le,{type:"number",min:"1",step:"1",placeholder:"50",value:p,onChange:d=>y(d.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!k||n,onClick:()=>r(Math.round(u*100)),children:n?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),y("")},children:"Cancel"})]}),e[16]=m,e[17]=p,e[18]=u,e[19]=o,e[20]=k,e[21]=n,e[22]=y,e[23]=r,e[24]=j):j=e[24];let f;return e[25]!==x||e[26]!==b||e[27]!==j?(f=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x,b,j]})}),e[25]=x,e[26]=b,e[27]=j,e[28]=f):f=e[28],f}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=M.c(61),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne(),a=te();let r;e[3]!==a?(r=a.find(It),e[3]=a,e[4]=r):r=e[4];const n=r,[p,y]=T.useState(!1);let I;e[5]!==l||e[6]!==n?(I=async()=>{n&&await l.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:n.id}})},e[5]=l,e[6]=n,e[7]=I):I=e[7];let h;e[8]!==t.id||e[9]!==o?(h=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),y(!1)},e[8]=t.id,e[9]=o,e[10]=h):h=e[10];let c;e[11]!==I||e[12]!==h?(c={mutationFn:I,onSuccess:h,onError:_t},e[11]=I,e[12]=h,e[13]=c):c=e[13];const{mutate:u,isPending:k}=ee(c);let m;e[14]!==t.id?(m=G.aiProviderCredits(t.id,"deco"),e[14]=t.id,e[15]=m):m=e[15];const S=!!n;let v;e[16]!==l?(v=async()=>{const fe=await l.callTool({name:"AI_PROVIDER_CREDITS",arguments:{providerId:"deco"}});return fe?.isError?null:fe.structuredContent??null},e[16]=l,e[17]=v):v=e[17];let g;e[18]!==m||e[19]!==S||e[20]!==v?(g={queryKey:m,enabled:S,staleTime:6e4,queryFn:v},e[18]=m,e[19]=S,e[20]=v,e[21]=g):g=e[21];const{data:x,isLoading:b,refetch:j,isFetching:f}=Ie(g);if(!n)return null;const d=x?.balanceCents!=null?x.balanceCents/100:null;let w;e[22]!==d?(w=d!=null?`$${d.toFixed(2)}`:"—",e[22]=d,e[23]=w):w=e[23];const U=w;let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[24]=O):O=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),e[25]=z):z=e[25];let A;e[26]!==k?(A=s.jsxs("div",{className:"flex items-center justify-between",children:[O,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:z,disabled:k,children:"Disconnect"})]}),e[26]=k,e[27]=A):A=e[27];let D;e[28]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(Ne,{children:[s.jsx(we,{children:"Disconnect Deco AI Gateway"}),s.jsx(Pe,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[28]=D):D=e[28];let K;e[29]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ae,{children:"Cancel"}),e[29]=K):K=e[29];let $;e[30]!==u?($=s.jsxs(De,{children:[D,s.jsxs(Ke,{children:[K,s.jsx(Ee,{onClick:()=>u(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[30]=u,e[31]=$):$=e[31];let _;e[32]!==p||e[33]!==$?(_=s.jsx(Fe,{open:p,onOpenChange:y,children:$}),e[32]=p,e[33]=$,e[34]=_):_=e[34];let F;e[35]!==d||e[36]!==U||e[37]!==f||e[38]!==b?(F=b||f?s.jsx(de,{className:"h-9 w-24"}):s.jsx("span",{className:ge("text-3xl font-semibold tabular-nums tracking-tight",d!=null&&vt(d)),children:U}),e[35]=d,e[36]=U,e[37]=f,e[38]=b,e[39]=F):F=e[39];let P;e[40]!==j?(P=()=>j(),e[40]=j,e[41]=P):P=e[41];const E=f&&"animate-spin";let N;e[42]!==E?(N=ge(E),e[42]=E,e[43]=N):N=e[43];let L;e[44]!==N?(L=s.jsx(_e,{size:14,className:N}),e[44]=N,e[45]=L):L=e[45];let q;e[46]!==f||e[47]!==P||e[48]!==L?(q=s.jsx("button",{type:"button",onClick:P,disabled:f,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:L}),e[46]=f,e[47]=P,e[48]=L,e[49]=q):q=e[49];let R;e[50]!==F||e[51]!==q?(R=s.jsxs("div",{className:"flex items-baseline gap-2",children:[F,q]}),e[50]=F,e[51]=q,e[52]=R):R=e[52];let W;e[53]===Symbol.for("react.memo_cache_sentinel")?(W=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[53]=W):W=e[53];let Y;e[54]!==R?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[R,W]}),e[54]=R,e[55]=Y):Y=e[55];let se;e[56]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(xt,{})]}),e[56]=se):se=e[56];let ie;return e[57]!==A||e[58]!==_||e[59]!==Y?(ie=s.jsx(ue,{title:"Deco AI Gateway",children:s.jsx(me,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[A,_,Y,se]})})}),e[57]=A,e[58]=_,e[59]=Y,e[60]=ie):ie=e[60],ie}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function It(e){return e.providerId==="deco"}function St(){const e=M.c(11),{org:t}=H();let i;e[0]!==t.id||e[1]!==t.slug?(i={connectionId:J,orgId:t.id,orgSlug:t.slug},e[0]=t.id,e[1]=t.slug,e[2]=i):i=e[2];const l=X(i),o=ne();let a;e[3]!==l?(a=async()=>{const p=await l.callTool({name:"AI_PROVIDER_PROVISION_KEY",arguments:{providerId:"deco"}});if(p?.isError)throw new Error(p.content?.[0]?.text??"Key provisioning failed")},e[3]=l,e[4]=a):a=e[4];let r;e[5]!==t.id||e[6]!==o?(r=()=>{Se("ai_provider_provision_succeeded",{provider_id:"deco"}),o.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),o.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[5]=t.id,e[6]=o,e[7]=r):r=e[7];let n;return e[8]!==a||e[9]!==r?(n={mutationFn:a,onSuccess:r,onError:kt},e[8]=a,e[9]=r,e[10]=n):n=e[10],ee(n)}function kt(e){Se("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=M.c(10),{mutate:t,isPending:i}=St();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=l):l=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:l.join(", ")}}),e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=a):a=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=r):r=e[3];let n;e[4]!==t?(n=()=>t(),e[4]=t,e[5]=n):n=e[5];const p=i?"Connecting…":"Connect Deco";let y;return e[6]!==i||e[7]!==n||e[8]!==p?(y=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[o,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[a,r,s.jsx(V,{variant:"outline",disabled:i,onClick:n,children:p})]})]}),e[6]=i,e[7]=n,e[8]=p,e[9]=y):y=e[9],y}const Nt=B({label:C().min(1,"Label is required").max(100),apiKey:C().optional(),baseUrl:C().optional()});function wt({providerKey:e,provider:t,preset:i,maskedKey:l,currentLabel:o,currentBaseUrl:a,onCancel:r,onSuccess:n}){const{org:p}=H(),y=X({connectionId:J,orgId:p.id,orgSlug:p.slug}),I=ne(),[h,c]=T.useState(!1),u=t.id==="openai-compatible",k=t.supportedMethods.includes("api-key"),{register:m,handleSubmit:S,watch:v,formState:{errors:g}}=je({resolver:ve(Nt),defaultValues:{label:o,apiKey:"",baseUrl:a??""}}),x=v("apiKey")??"",{mutate:b,isPending:j}=ee({mutationFn:async f=>{let d;f.apiKey?u?d=JSON.stringify({baseUrl:f.baseUrl||a||"",apiKey:f.apiKey}):d=f.apiKey:u&&f.baseUrl&&f.baseUrl!==a&&(d=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await y.callTool({name:"AI_PROVIDER_KEY_UPDATE",arguments:{keyId:e.id,label:f.label,...d!==void 0?{apiKey:d}:{}}})},onSuccess:()=>{I.invalidateQueries({queryKey:G.aiProviderKeys(p.id)}),I.invalidateQueries({queryKey:G.aiProviders(p.id)}),Q.success("Provider updated"),n()},onError:f=>Q.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:S(f=>b(f)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(le,{placeholder:"e.g. Personal key",...m("label"),className:"h-8 text-sm"}),g.label&&s.jsx("p",{className:"text-xs text-destructive",children:g.label.message})]}),u&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(le,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...m("baseUrl"),className:"h-8 text-sm"})]}),k&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(le,{type:h&&x?"text":"password",placeholder:l,...m("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),x&&s.jsx("button",{type:"button",onClick:()=>c(!h),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:h?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:r,disabled:j,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:j,children:j?"Saving...":"Save"})]})]})}function Pt(e){const t=M.c(31),{providerKey:i,provider:l,open:o,onOpenChange:a}=e,{org:r}=H();let n;t[0]!==r.id||t[1]!==r.slug?(n={connectionId:J,orgId:r.id,orgSlug:r.slug},t[0]=r.id,t[1]=r.slug,t[2]=n):n=t[2];const p=X(n);let y;t[3]!==l.id||t[4]!==i.presetId?(y=l.id==="openai-compatible"&&i.presetId?Re.find(j=>j.id===i.presetId):void 0,t[3]=l.id,t[4]=i.presetId,t[5]=y):y=t[5];const I=y,h=I?.name??l.name;let c;t[6]!==i.id?(c=G.aiProviderKeyPreview(i.id),t[6]=i.id,t[7]=c):c=t[7];let u;t[8]!==p||t[9]!==i.id?(u=async()=>(await p.callTool({name:"AI_PROVIDER_KEY_PREVIEW",arguments:{keyId:i.id}})).structuredContent,t[8]=p,t[9]=i.id,t[10]=u):u=t[10];let k;t[11]!==o||t[12]!==c||t[13]!==u?(k={queryKey:c,queryFn:u,enabled:o,staleTime:0},t[11]=o,t[12]=c,t[13]=u,t[14]=k):k=t[14];const{data:m,isLoading:S}=Ie(k);let v;t[15]!==h?(v=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",h]})}),t[15]=h,t[16]=v):v=t[16];let g;t[17]!==S||t[18]!==a||t[19]!==I||t[20]!==m||t[21]!==l||t[22]!==i?(g=S||!m?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(rt,{})}):s.jsx(wt,{providerKey:i,provider:l,preset:I,maskedKey:m.maskedKey,currentLabel:m.label,currentBaseUrl:m.baseUrl,onCancel:()=>a(!1),onSuccess:()=>a(!1)}),t[17]=S,t[18]=a,t[19]=I,t[20]=m,t[21]=l,t[22]=i,t[23]=g):g=t[23];let x;t[24]!==v||t[25]!==g?(x=s.jsxs(it,{className:"sm:max-w-md",children:[v,g]}),t[24]=v,t[25]=g,t[26]=x):x=t[26];let b;return t[27]!==a||t[28]!==o||t[29]!==x?(b=s.jsx(ot,{open:o,onOpenChange:a,children:x}),t[27]=a,t[28]=o,t[29]=x,t[30]=b):b=t[30],b}function At(e){const t=M.c(51),{providerKey:i,provider:l}=e,{org:o}=H();let a;t[0]!==o.id||t[1]!==o.slug?(a={connectionId:J,orgId:o.id,orgSlug:o.slug},t[0]=o.id,t[1]=o.slug,t[2]=a):a=t[2];const r=X(a),n=ne(),[p,y]=T.useState(!1),[I,h]=T.useState(!1),c=l.id==="openai-compatible";let u;t[3]!==c||t[4]!==i.presetId?(u=c&&i.presetId?Re.find(q=>q.id===i.presetId):void 0,t[3]=c,t[4]=i.presetId,t[5]=u):u=t[5];const k=u,m=k?k.name:c?"Custom OpenAI-compatible":l.name,S=k?.logo??l.logo;let v;e:{if(c){v=i.label;break e}const q=i.label;let R;t[6]!==i.createdAt?(R=lt(new Date(i.createdAt)),t[6]=i.createdAt,t[7]=R):R=t[7],v=`${q} · added ${R} ago`}const g=v;let x;t[8]!==r||t[9]!==i.id?(x=async()=>{await r.callTool({name:"AI_PROVIDER_KEY_DELETE",arguments:{keyId:i.id}})},t[8]=r,t[9]=i.id,t[10]=x):x=t[10];let b;t[11]!==o.id||t[12]!==i.id||t[13]!==n?(b=()=>{n.invalidateQueries({queryKey:G.aiProviderKeys(o.id)}),n.invalidateQueries({queryKey:G.aiProviders(o.id)}),n.invalidateQueries({queryKey:G.aiProviderModels(o.id,i.id)}),Q.success("Key deleted"),y(!1)},t[11]=o.id,t[12]=i.id,t[13]=n,t[14]=b):b=t[14];let j;t[15]!==x||t[16]!==b?(j={mutationFn:x,onSuccess:b,onError:Dt},t[15]=x,t[16]=b,t[17]=j):j=t[17];const{mutate:f,isPending:d}=ee(j);let w;t[18]!==m||t[19]!==S?(w=S?s.jsx("img",{src:S,alt:m,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:m.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[18]=m,t[19]=S,t[20]=w):w=t[20];let U;t[21]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>h(!0),children:s.jsx(We,{size:14})}),t[21]=U):U=t[21];let O,z;t[22]===Symbol.for("react.memo_cache_sentinel")?(z=()=>y(!0),O=s.jsx(Ye,{size:14}),t[22]=O,t[23]=z):(O=t[22],z=t[23]);let A;t[24]!==d?(A=s.jsxs("div",{className:"flex items-center gap-0.5",children:[U,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:d,onClick:z,children:O})]}),t[24]=d,t[25]=A):A=t[25];let D;t[26]!==g||t[27]!==m||t[28]!==A||t[29]!==w?(D=s.jsx(ke,{icon:w,title:m,description:g,action:A}),t[26]=g,t[27]=m,t[28]=A,t[29]=w,t[30]=D):D=t[30];let K;t[31]!==I||t[32]!==l||t[33]!==i?(K=s.jsx(Pt,{providerKey:i,provider:l,open:I,onOpenChange:h}),t[31]=I,t[32]=l,t[33]=i,t[34]=K):K=t[34];let $;t[35]===Symbol.for("react.memo_cache_sentinel")?($=s.jsx(we,{children:"Delete API key"}),t[35]=$):$=t[35];let _;t[36]!==i.label?(_=s.jsxs(Ne,{children:[$,s.jsxs(Pe,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[36]=i.label,t[37]=_):_=t[37];let F;t[38]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(Ae,{children:"Cancel"}),t[38]=F):F=t[38];let P;t[39]!==f?(P=s.jsxs(Ke,{children:[F,s.jsx(Ee,{onClick:()=>f(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[39]=f,t[40]=P):P=t[40];let E;t[41]!==_||t[42]!==P?(E=s.jsxs(De,{children:[_,P]}),t[41]=_,t[42]=P,t[43]=E):E=t[43];let N;t[44]!==p||t[45]!==E?(N=s.jsx(Fe,{open:p,onOpenChange:y,children:E}),t[44]=p,t[45]=E,t[46]=N):N=t[46];let L;return t[47]!==D||t[48]!==K||t[49]!==N?(L=s.jsxs(s.Fragment,{children:[D,K,N]}),t[47]=D,t[48]=K,t[49]=N,t[50]=L):L=t[50],L}function Dt(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=M.c(11),{onConnectClick:i}=e,l=te(),o=Ce();let a;t[0]!==o?.providers?(a=o?.providers??[],t[0]=o?.providers,t[1]=a):a=t[1];const r=a;let n;if(t[2]!==l||t[3]!==i||t[4]!==r){let p;t[6]!==r?(p=c=>({key:c,provider:r.find(u=>u.id===c.providerId)}),t[6]=r,t[7]=p):p=t[7];const y=l.filter(Rt).map(p).filter(Ft);let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I=s.jsx(Qe,{size:14}),t[8]=I):I=t[8];let h;t[9]!==i?(h=s.jsxs(V,{size:"sm",onClick:i,children:[I,"Connect provider"]}),t[9]=i,t[10]=h):h=t[10],n=s.jsx(ue,{title:"Connected providers",headerClassName:"px-0",actions:h,children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(me,{children:y.map(Et)})}),t[2]=l,t[3]=i,t[4]=r,t[5]=n}else n=t[5];return n}function Et(e){const{key:t,provider:i}=e;return s.jsx(At,{providerKey:t,provider:i},t.id)}function Ft(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function $t(e){const t=M.c(3),{error:i}=e;let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Oe,{size:16}),t[0]=l):l=t[0];let o;return t[1]!==i.message?(o=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=o):o=t[2],o}function Tt(){const e=M.c(23),t=te();let i;e[0]!==t?(i=t.some(Ot),e[0]=t,e[1]=i):i=e[1];const l=i,o=t.length>0,[a,r]=T.useState(!1),[n,p]=T.useState(null),y=Ce();let I;e[2]!==y?.providers?(I=y?.providers??[],e[2]=y?.providers,e[3]=I):I=e[3];const h=I;if(!o){let v;e[4]===Symbol.for("react.memo_cache_sentinel")?(v=()=>r(!0),e[4]=v):v=e[4];let g;e[5]!==h?(g=s.jsx(Je,{providers:h,onSelect:p,onShowAll:v}),e[5]=h,e[6]=g):g=e[6];const x=n!==null||a;let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=w=>{w||(p(null),r(!1))},e[7]=b):b=e[7];const j=n??void 0;let f;e[8]!==x||e[9]!==j?(f=s.jsx(xe,{open:x,onOpenChange:b,initialProvider:j}),e[8]=x,e[9]=j,e[10]=f):f=e[10];let d;return e[11]!==g||e[12]!==f?(d=s.jsxs(s.Fragment,{children:[g,f]}),e[11]=g,e[12]=f,e[13]=d):d=e[13],d}let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=c):c=e[14];let u;e[15]!==l?(u=l?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=l,e[16]=u):u=e[16];let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(Kt,{onConnectClick:()=>r(!0)}),e[17]=k):k=e[17];let m;e[18]!==a?(m=s.jsx(xe,{open:a,onOpenChange:r}),e[18]=a,e[19]=m):m=e[19];let S;return e[20]!==u||e[21]!==m?(S=s.jsxs(s.Fragment,{children:[c,u,k,m]}),e[20]=u,e[21]=m,e[22]=S):S=e[22],S}function Ot(e){return e.providerId==="deco"}function Mt(){const e=M.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(oe.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(oe,{children:s.jsx(oe.Content,{children:s.jsx(oe.Body,{children:s.jsxs(Me,{children:[t,s.jsx(Te,{fallback:Ut,children:s.jsx(T.Suspense,{fallback:s.jsx(de,{className:"h-64 w-full"}),children:s.jsx(Tt,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx($t,{error:t??new Error("Failed to load AI providers")})}function Bs(){const e=M.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(nt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Mt,{})}),e[0]=t):t=e[0],t}export{Bs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as W,r as B,j as e,c as X,l as Y}from"./index-biiHZ5l9.js";import{i as Z}from"./ChevronRight-CrZy8tHx.js";import{S as tt}from"./scroll-area-BqOijBAI.js";import{aa as et,ab as rt,e as ot}from"./index-BZvxagUr.js";import{c as it}from"./save-referenced-block-q2CPWVkl.js";import{S as mt}from"./schema-form-nZH-67HX.js";import{S as pt}from"./save-status-pJVz5vCQ.js";import"./select-CNSUv3cw.js";import"./tooltip-bsrBmmjV.js";import"./Check-D-9dblUn.js";import"./ChevronDown-Cf2Q-GlB.js";import"./ChevronUp-BAxoXhnT.js";import"./agent-capabilities-BJLQSkAN.js";import"./chat-context-Bu6qpu9K.js";import"./tab-id-D4SJwEQy.js";import"./use-mcp-client-CWFUu1lY.js";import"./decopilot-sse-pool-BUhEcft-.js";import"./create-sse-subscription-BS5983N4.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-virtual-mcp-0jbEmvOc.js";import"./use-collections-B5Jh_wGd.js";import"./use-ai-providers-v0sCRzMO.js";import"./use-organization-settings-Izqk1Gkk.js";import"./pair-Ba1UoSSJ.js";import"./agent-icon-DT8dQ9tq.js";import"./AlertCircle-9EFUZenf.js";import"./Tool01-Dcq7KP8Y.js";import"./SwitchHorizontal01-BMnNI1Fi.js";import"./RefreshCcw01-3BsQQkRx.js";import"./XCircle-UPVnJx4i.js";import"./ArrowUpRight-97355q5v.js";import"./ZapSquare-B1o2Q9OR.js";import"./Users03-BlNe2PnN.js";import"./CheckCircle-C2ualSpf.js";import"./ChevronLeft-BaV4nFMQ.js";import"./DotsVertical-SvwN4CeV.js";import"./Container-CYcITvPW.js";import"./Eye-ByuwKsdh.js";import"./ZoomOut-D8vQ49we.js";import"./Globe01-DfGFlik1.js";import"./FilterLines-BJZdiggU.js";import"./Star01-eRdSY4QW.js";import"./Palette-Druykvzw.js";import"./HardDrive-DNFvbooP.js";import"./Stars02-EuAFDZ5E.js";import"./Key01-CzmPnHuw.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./LinkExternal01-CgI1VTqi.js";import"./Monitor01-Cw6kmClm.js";import"./Sun-CH2HWLCn.js";import"./Play-CMJ2IWYR.js";import"./Plus-CjrtKB-Y.js";import"./SearchMd-BL2y99rx.js";import"./Settings02-Cd4DIqaJ.js";import"./Shield01-zIbMct6w.js";import"./Stars01-v0yz6PCZ.js";import"./Trash01-Cup7-ZTT.js";import"./Upload01-C9yi1Bdg.js";import"./User01-thAIxsAs.js";import"./Users01-DPJm6-u-.js";import"./XClose-pR-QU0OQ.js";import"./X-1KR4wibP.js";import"./Zap-Cl-JM7N9.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-P6tx-uOp.js";import"./file-type-icon-CX5JEvCQ.js";import"./dialog-Bm1pP7Vu.js";import"./content-blocks-o63cs2vh.js";import"./types-jBdXInU0.js";import"./shell-layout-4LsIVsl3.js";import"./avatar-BHEXMwdE.js";import"./required-auth-layout-zYH6NIDF.js";import"./useRouterState-Dm0UHjU4.js";import"./use-org-sso-C1cJTBIx.js";import"./integration-icon-Dy-a3x5R.js";import"./use-navigate-to-agent-CdsMYUzL.js";import"./use-connection-DyJtuHQI.js";import"./use-mcp-prompts-B5RhBVzg.js";import"./form-BcPtow5O.js";import"./label-CcC4_aKf.js";import"./input-5PMMNPU9.js";import"./spinner-DJD6-9r-.js";import"./drawer-B51jkLaX.js";import"./collection-search-LsgoMrVO.js";import"./tabs-DCDCb9Pz.js";import"./toggle-group-DhVqXGfs.js";import"./connect-desktop-dialog-DPqrgnkS.js";import"./agent-icons-DRrDyR7j.js";import"./checkbox--nDaSUZE.js";import"./skeleton--DN75sg7.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-V9kb8x32.js";import"./card-BUTabNLA.js";import"./popover-Cvcd3A1d.js";import"./command-BehF6pb8.js";import"./index-CR_LeyNj.js";import"./useInfiniteQuery-BGg7INCQ.js";import"./infiniteQueryObserver-B0VBGXv5.js";import"./sortable.esm-g7bq1nDZ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-EXvV7rxl.js";import"./use-registry-connections-C-WVKjSU.js";import"./extract-connection-data-LoMqboL3.js";import"./generate-id-CadHbHqX.js";import"./collections-C_j8CeI8.js";import"./collection-tabs-CQJiHDMR.js";import"./badge-Da0IsrqH.js";import"./textarea-QEULyLXh.js";import"./connection-form-helpers-DoJomSCQ.js";import"./use-infinite-scroll-xQQ6lYk4.js";import"./useSuspenseInfiniteQuery-B4dQiTEq.js";import"./index-Bo5bzoUm.js";import"./dropdown-menu-CIu58K9q.js";import"./question-004-sINsf4GQ.js";import"./shell-route-loading-5KSwc3hj.js";import"./sidebar-CPZXU-2w.js";import"./sheet-D99KevZC.js";import"./toolbar-BsB4Mvyv.js";import"./use-create-virtual-mcp-CWYOy45e.js";import"./github-repo-picker-B24_pGAu.js";import"./use-mcp-tools-DePRGZE5.js";import"./alert-dialog-CSkQIwm8.js";import"./index-B1bHiM-j.js";import"./use-org-auth-client--i_Sx92M.js";import"./hover-card-DE2_8MLP.js";import"./task-status-P3BULAyA.js";import"./use-status-sounds-BJ_LqdGJ.js";import"./empty-state-1AbmTLd7.js";import"./resizable-BbbLszRZ.js";import"./use-capability-BPM45mbW.js";import"./header-tab-button-DSX6YPkf.js";import"./index-BflNEs6l.js";import"./user-DRDdFgUw.js";import"./tools-list-Ch5RlbiL.js";import"./switch-D6SWnoi2.js";import"./use-debounced-autosave-ClLbciGl.js";import"./index-r7-3fAFf.js";import"./search-input-BgGthWir.js";import"./use-secrets-BpdIBEe6.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./accordion-aX0NKKKh.js";import"./view-mode-toggle-G0qNMbJ1.js";import"./select-model-0CGh6cKF.js";import"./use-automations-Db8x6SNU.js";import"./monaco-editor-CJVi8Ty8.js";import"./automation-runs-BJTRztep.js";import"./table-Cx3PhNth.js";import"./use-members-Cw70r_Wh.js";import"./automation-list-row-5M4PNEWw.js";import"./calendar-BbhbS2FE.js";import"./image-field-D00iYa4G.js";import"./use-file-configs-CC8ghNUa.js";function to(E){const t=W.c(51),{orgSlug:R,virtualMcpId:P,branch:$,blockKey:r,block:m,meta:p,decofile:C,title:F,excludeFields:K,schemaPending:M}=E,V=M===void 0?!1:M,a=typeof m?.__resolveType=="string"?m.__resolveType:"";let v;t[0]!==K||t[1]!==p||t[2]!==a?(v=et(a,p,K),t[0]=K,t[1]=p,t[2]=a,t[3]=v):v=t[3];const s=v;let b;t[4]!==s?(b=!!s&&Object.keys(s.properties??{}).length>0,t[4]=s,t[5]=b):b=t[5];const T=b;let g;t[6]!==m||t[7]!==r||t[8]!==p||t[9]!==F?(g=F??(m?rt(r,m,p):r),t[6]=m,t[7]=r,t[8]=p,t[9]=F,t[10]=g):g=t[10];const n=g;let j;t[11]!==$||t[12]!==R||t[13]!==P?(j={orgSlug:R,virtualMcpId:P,branch:$},t[11]=$,t[12]=R,t[13]=P,t[14]=j):j=t[14];const{save:c,isPending:A}=ot(j);let y;t[15]!==c?(y=it((l,i)=>c(l,i)),t[15]=c,t[16]=y):y=t[16];const L=y,[G,H]=B.useState(r),[J,q]=B.useState(null),[z,Q]=B.useState(0);let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=[],t[17]=S):S=t[17];const[o,O]=B.useState(S);G!==r&&(H(r),q(null),Q(st),O([]));let N;t[18]!==m?(N=m??{},t[18]=m,t[19]=N):N=t[19];const D=J??N;let k;t[20]!==r||t[21]!==a||t[22]!==c?(k=l=>{const i=l;q(i),c(r,{...i,__resolveType:a})},t[20]=r,t[21]=a,t[22]=c,t[23]=k):k=t[23];const I=k;let _;t[24]!==o||t[25]!==n?(_=o.length>0?[n,...o]:[],t[24]=o,t[25]=n,t[26]=_):_=t[26];const h=_;let d;t[27]!==o||t[28]!==h||t[29]!==n?(d=h.length>0?e.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:h.map((l,i)=>{const U=i===h.length-1;return e.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[i>0&&e.jsx(Z,{className:"size-3 shrink-0 text-muted-foreground/60"}),e.jsx("button",{type:"button",onClick:()=>O(i===0?[]:o.slice(0,i)),title:l,className:X("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",U?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:l})]},`${l}-${i}`)})}):e.jsx("span",{className:"text-sm font-medium",children:n}),t[27]=o,t[28]=h,t[29]=n,t[30]=d):d=t[30];let f;t[31]!==A?(f=e.jsx(pt,{isPending:A,isError:!1}),t[31]=A,t[32]=f):f=t[32];let u;t[33]!==d||t[34]!==f?(u=e.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[d,f]}),t[33]=d,t[34]=f,t[35]=u):u=t[35];let x;t[36]!==r||t[37]!==o||t[38]!==C||t[39]!==D||t[40]!==z||t[41]!==I||t[42]!==T||t[43]!==p||t[44]!==L||t[45]!==s||t[46]!==V?(x=e.jsx(tt,{className:"min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:e.jsx("div",{className:"px-6 py-6",children:e.jsx("div",{className:"mx-auto max-w-xl",children:T?e.jsx(mt,{schema:s,value:D,onChange:I,basePath:"",breadcrumbPath:o,onBreadcrumbChange:O,decofile:C,meta:p,onSaveReferencedBlock:L},`${r}:${z}`):V?e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[e.jsx(Y,{size:16,className:"animate-spin"}),"Loading app schema…"]}):e.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[36]=r,t[37]=o,t[38]=C,t[39]=D,t[40]=z,t[41]=I,t[42]=T,t[43]=p,t[44]=L,t[45]=s,t[46]=V,t[47]=x):x=t[47];let w;return t[48]!==u||t[49]!==x?(w=e.jsxs("div",{className:"flex h-full flex-col",children:[u,x]}),t[48]=u,t[49]=x,t[50]=w):w=t[50],w}function st(E){return E+1}export{to as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as le,r as oe,c as be,j as t,B as fe,K as xe,n as Ve,E as tt,q as st}from"./index-biiHZ5l9.js";import{u as ze}from"./useInfiniteQuery-BGg7INCQ.js";import{u as lt}from"./use-connection-DyJtuHQI.js";import{i as nt,g as at,S as rt,u as it}from"./use-mcp-client-CWFUu1lY.js";import{a as ot}from"./use-virtual-mcp-0jbEmvOc.js";import{C as ct}from"./card-BUTabNLA.js";import{a as Ke,b as qe,S as dt,d as mt}from"./sheet-D99KevZC.js";import{c as Ge,d as He,a as Ne,e as te,b as Be,T as se}from"./table-Cx3PhNth.js";import{E as Se}from"./empty-state-1AbmTLd7.js";import{u as ke}from"./use-infinite-scroll-xQQ6lYk4.js";import{u as ut}from"./use-members-Cw70r_Wh.js";import{S as ue}from"./task-status-P3BULAyA.js";import{e as ft}from"./use-automations-Db8x6SNU.js";import{u as xt}from"./useSuspenseInfiniteQuery-B4dQiTEq.js";import{B as je}from"./badge-Da0IsrqH.js";import{S as ht,a as gt,b as pt,c as ge,d as jt}from"./select-CNSUv3cw.js";import{C as Le}from"./checkbox--nDaSUZE.js";import{t as he}from"./ChevronDown-Cf2Q-GlB.js";import{c as bt,C as Nt,e as Fe,d as vt,a as St,b as yt}from"./command-BehF6pb8.js";import{a as Je,b as Qe,P as Ze}from"./popover-Cvcd3A1d.js";import{A as We}from"./avatar-BHEXMwdE.js";import{n as ye}from"./ChevronUp-BAxoXhnT.js";import{n as Ie}from"./Container-CYcITvPW.js";import{i as wt}from"./FilterLines-BJZdiggU.js";import{m as Ct,n as _t}from"./pair-Ba1UoSSJ.js";import{I as Pe}from"./integration-icon-Dy-a3x5R.js";function Ue(l){const e=le.c(74),{options:s,onValueChange:n,defaultValue:r,placeholder:i,variant:a,animation:m,maxCount:c,modalPopover:o,asChild:b,className:v,disabled:x,onSearchChange:h}=l;let N;e[0]!==r?(N=r===void 0?[]:r,e[0]=r,e[1]=N):N=e[1];const u=N,p=i===void 0?"Select items":i,j=a===void 0?"default":a,g=m===void 0?0:m,S=c===void 0?3:c,f=o===void 0?!1:o,y=b===void 0?!1:b,_=x===void 0?!1:x,[d,C]=oe.useState(u),[T,w]=oe.useState(!1);let I,k;e[2]!==u||e[3]!==d?(I=()=>{JSON.stringify(d)!==JSON.stringify(u)&&C(u)},k=[u,d],e[2]=u,e[3]=d,e[4]=I,e[5]=k):(I=e[4],k=e[5]),oe.useEffect(I,k);let P;e[6]!==n||e[7]!==d?(P=E=>{if(E.key==="Enter")w(!0);else if(E.key==="Backspace"&&!E.currentTarget.value){const H=[...d];H.pop(),C(H),n(H)}},e[6]=n,e[7]=d,e[8]=P):P=e[8];const D=P;let M;e[9]!==n||e[10]!==d?(M=E=>{const H=d.includes(E.value)?d.filter(me=>me!==E.value):[...d,E.value];C(H),n(H)},e[9]=n,e[10]=d,e[11]=M):M=e[11];const A=M;let $;e[12]!==n?($=()=>{C([]),n([])},e[12]=n,e[13]=$):$=e[13];const B=$;let F;e[14]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{w(Pt)},e[14]=F):F=e[14];const Z=F;let q;e[15]!==B||e[16]!==n||e[17]!==s||e[18]!==d.length?(q=()=>{if(d.length===s.length)B();else{const E=s.map(It);C(E),n(E)}},e[15]=B,e[16]=n,e[17]=s,e[18]=d.length,e[19]=q):q=e[19];const U=q;let O;e[20]!==y?(O=y?{}:{variant:"outline"},e[20]=y,e[21]=O):O=e[21];let L;e[22]!==v?(L=be("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 rounded-xl border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",v),e[22]=v,e[23]=L):L=e[23];let K;e[24]!==g||e[25]!==S||e[26]!==s||e[27]!==p||e[28]!==d||e[29]!==j?(K=d.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[d.slice(0,S).map(E=>{const H=s.find(ve=>ve.value===E),me=H?.icon;return t.jsxs(je,{variant:j==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${g}s`},children:[me&&t.jsx(me,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:H?.label})]},E)}),d.length>S&&t.jsxs(je,{variant:j==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${g}s`},children:["+",d.length-S]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(he,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:p}),t.jsx(he,{size:20,className:"shrink-0 opacity-50"})]}),e[24]=g,e[25]=S,e[26]=s,e[27]=p,e[28]=d,e[29]=j,e[30]=K):K=e[30];let V;e[31]!==_||e[32]!==O||e[33]!==L||e[34]!==K?(V=t.jsx(Je,{asChild:!0,children:t.jsx(fe,{ref:null,...O,onClick:Z,className:L,disabled:_,children:K})}),e[31]=_,e[32]=O,e[33]=L,e[34]=K,e[35]=V):V=e[35];let J;e[36]===Symbol.for("react.memo_cache_sentinel")?(J=()=>w(!1),e[36]=J):J=e[36];const z=!h;let Q;e[37]!==D||e[38]!==h?(Q=t.jsx(bt,{placeholder:"Search...",onKeyDown:D,onValueChange:h,className:"rounded-t-xl"}),e[37]=D,e[38]=h,e[39]=Q):Q=e[39];let ce;e[40]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx(Nt,{children:"No results found."}),e[40]=ce):ce=e[40];let W;e[41]!==U?(W=()=>{U()},e[41]=U,e[42]=W):W=e[42];let Y;e[43]!==U?(Y=E=>{E.stopPropagation(),U()},e[43]=U,e[44]=Y):Y=e[44];const de=d.length===s.length&&s.length>0;let ne;e[45]!==de||e[46]!==U?(ne=t.jsx(Le,{checked:de,onCheckedChange:U,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:kt}),e[45]=de,e[46]=U,e[47]=ne):ne=e[47];let ae;e[48]===Symbol.for("react.memo_cache_sentinel")?(ae=t.jsx("span",{children:"(Select All)"}),e[48]=ae):ae=e[48];let X;e[49]!==Y||e[50]!==ne?(X=t.jsxs("div",{className:"flex items-center w-full",onClick:Y,children:[ne,ae]}),e[49]=Y,e[50]=ne,e[51]=X):X=e[51];let ee;e[52]!==W||e[53]!==X?(ee=t.jsx(Fe,{onSelect:W,className:"cursor-pointer",children:X},"all"),e[52]=W,e[53]=X,e[54]=ee):ee=e[54];let re;if(e[55]!==s||e[56]!==d||e[57]!==A){let E;e[59]!==d||e[60]!==A?(E=H=>{const me=d.includes(H.value);return t.jsx(Fe,{onSelect:()=>{A(H)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:ve=>{ve.stopPropagation(),A(H)},children:[t.jsx(Le,{checked:me,onCheckedChange:()=>{A(H)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Tt}),H.icon&&t.jsx(H.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:H.label})]})},H.value)},e[59]=d,e[60]=A,e[61]=E):E=e[61],re=s.map(E),e[55]=s,e[56]=d,e[57]=A,e[58]=re}else re=e[58];let R;e[62]!==ee||e[63]!==re?(R=t.jsxs(vt,{className:"rounded-b-xl",children:[ce,t.jsxs(St,{children:[ee,re]})]}),e[62]=ee,e[63]=re,e[64]=R):R=e[64];let G;e[65]!==z||e[66]!==Q||e[67]!==R?(G=t.jsx(Qe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:J,children:t.jsxs(yt,{shouldFilter:z,className:"rounded-xl",children:[Q,R]})}),e[65]=z,e[66]=Q,e[67]=R,e[68]=G):G=e[68];let ie;return e[69]!==T||e[70]!==f||e[71]!==V||e[72]!==G?(ie=t.jsxs(Ze,{open:T,onOpenChange:w,modal:f,children:[V,G]}),e[69]=T,e[70]=f,e[71]=V,e[72]=G,e[73]=ie):ie=e[73],ie}function Tt(l){return l.stopPropagation()}function kt(l){return l.stopPropagation()}function It(l){return l.value}function Pt(l){return!l}const Ye=[{ms:6e4,label:"1m"},{ms:12e4,label:"2m"},{ms:3e5,label:"5m"},{ms:6e5,label:"10m"},{ms:9e5,label:"15m"},{ms:18e5,label:"30m"},{ms:36e5,label:"1h"},{ms:72e5,label:"2h"},{ms:216e5,label:"6h"},{ms:432e5,label:"12h"},{ms:864e5,label:"1d"},{ms:6048e5,label:"7d"}],Mt=40;function Cs(l){const s=(l.endDate.getTime()-l.startDate.getTime())/Mt;return Ye.find(r=>r.ms>=s)?.label??"1d"}function Me(l){const e=Ye.find(i=>i.label===l);if(e)return e.ms;const s=/^(\d+)([mhd])$/.exec(l);if(!s)return 6e4;const n=parseInt(s[1],10),r=s[2];return r==="h"?n*36e5:r==="d"?n*864e5:n*6e4}function Dt(l,e){const s=new Date(l);return Me(e)>=864e5?s.toLocaleDateString([],{month:"short",day:"numeric"}):s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Oe(l,e){const s=Me(e);return new Date(Math.floor(l.getTime()/s)*s)}function Rt(l){return l>=1e4?`${(l/1e3).toFixed(1)}s`:`${Math.round(l)}ms`}function De(l){return Number.isFinite(l)?l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:Math.round(l).toLocaleString():"0"}function Re(l){return Number.isFinite(l)?`$${l.toFixed(l<1?4:2)}`:"$0.00"}function _s(l,e,s){const n=Me(s),r=Oe(e.startDate,s).getTime(),i=e.endDate.getTime(),a=new Map(l.map(c=>[Oe(new Date(c.timestamp),s).getTime(),c])),m=[];for(let c=r;c<=i;c+=n){const o=a.get(c),b=new Date(c).toISOString();m.push({t:b,ts:c,label:Dt(b,s),calls:o?.calls??0,errors:o?.errors??0,errorRate:o?.errorRate??0,avg:o?.avg??0,p50:o?.p50??0,p95:o?.p95??0,inputTokens:o?.inputTokens??0,outputTokens:o?.outputTokens??0,totalTokens:o?.totalTokens??0,costUsd:o?.costUsd??0})}return m}function Ts(l,e){return e==="requests"?l.calls:e==="errors"?l.errorRate:l.avgDurationMs}function ks(l,e){return e==="requests"?l.calls.toLocaleString():e==="errors"?`${l.errorRate.toFixed(1)}%`:Rt(l.avgDurationMs)}function Ae(l){return(l.run_config??{}).agent?.id??(l.virtual_mcp_id||null)}function Ee(l,e,s,n){if(!l)return n;const r=e.find(a=>a.id===l)??s?.find(a=>a.id===l);if(r?.title)return r.title;const i=nt(l);return i?at(i).title??n:l}function $e(l,e,s){return l?(e.find(r=>r.id===l)??s?.find(r=>r.id===l))?.icon??null:null}function Xe(l){return l?.data?.members??[]}function we(l){const e=le.c(33),{thread:s,connections:n,virtualMcps:r,selectedIndex:i,total:a,onPrev:m,onNext:c}=l;let o,b;if(e[0]!==n||e[1]!==s||e[2]!==r){const I=Ae(s);o=Ee(I,r,n,""),b=$e(I,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=b}else o=e[3],b=e[4];const v=b,x=o||s.title;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Ie,{}),e[5]=h):h=e[5];let N;e[6]!==v||e[7]!==x?(N=t.jsx(Pe,{icon:v,name:x,size:"sm",fallbackIcon:h,className:"shadow-sm shrink-0 rounded-md"}),e[6]=v,e[7]=x,e[8]=N):N=e[8];let u;e[9]!==s.title?(u=t.jsx(dt,{className:"text-sm leading-snug truncate",children:s.title}),e[9]=s.title,e[10]=u):u=e[10];let p;e[11]!==o?(p=o&&t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:o}),e[11]=o,e[12]=p):p=e[12];let j;e[13]!==u||e[14]!==p?(j=t.jsxs("div",{className:"min-w-0",children:[u,p]}),e[13]=u,e[14]=p,e[15]=j):j=e[15];let g;e[16]!==N||e[17]!==j?(g=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[N,j]}),e[16]=N,e[17]=j,e[18]=g):g=e[18];const S=i===0;let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ye,{size:14}),e[19]=f):f=e[19];let y;e[20]!==m||e[21]!==S?(y=t.jsx(fe,{size:"icon",variant:"ghost",onClick:m,disabled:S,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous thread",children:f}),e[20]=m,e[21]=S,e[22]=y):y=e[22];const _=i===a-1;let d;e[23]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(he,{size:14}),e[23]=d):d=e[23];let C;e[24]!==c||e[25]!==_?(C=t.jsx(fe,{size:"icon",variant:"ghost",onClick:c,disabled:_,className:"h-7 w-7 text-muted-foreground","aria-label":"Next thread",children:d}),e[24]=c,e[25]=_,e[26]=C):C=e[26];let T;e[27]!==y||e[28]!==C?(T=t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[y,C]}),e[27]=y,e[28]=C,e[29]=T):T=e[29];let w;return e[30]!==T||e[31]!==g?(w=t.jsx(mt,{className:"px-5 md:px-6 pt-6 pb-5 border-b border-border shrink-0",children:t.jsxs("div",{className:"flex items-start justify-between gap-3 pr-8",children:[g,T]})}),e[30]=T,e[31]=g,e[32]=w):w=e[32],w}function At(l){const e=le.c(48),{thread:s,connections:n,virtualMcps:r,members:i}=l;let a,m;if(e[0]!==n||e[1]!==s||e[2]!==r){const M=Ae(s);a=Ee(M,r,n,""),m=$e(M,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=m}else a=e[3],m=e[4];const c=m;let o;if(e[5]!==i||e[6]!==s.created_by){const M=Xe(i);let A;e[8]!==s.created_by?(A=$=>$.userId===s.created_by,e[8]=s.created_by,e[9]=A):A=e[9],o=M.find(A),e[5]=i,e[6]=s.created_by,e[7]=o}else o=e[7];const b=o;let v;e[10]!==b?.user.email||e[11]!==b?.user.name||e[12]!==s.created_by?(v=b?.user.name??b?.user.email??s.created_by?.substring(0,8)??"—",e[10]=b?.user.email,e[11]=b?.user.name,e[12]=s.created_by,e[13]=v):v=e[13];const x=v,h=b?.user.image??void 0;let N;e[14]!==s.created_at?(N=new Date(s.created_at).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),e[14]=s.created_at,e[15]=N):N=e[15];const u=N,p=ue[s.status]??ue.completed,j=p.icon;let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Status"}),e[16]=g):g=e[16];let S;e[17]!==j||e[18]!==p.iconClassName?(S=t.jsx(j,{size:13,className:p.iconClassName}),e[17]=j,e[18]=p.iconClassName,e[19]=S):S=e[19];let f;e[20]!==p.labelColor?(f=be("text-sm",p.labelColor),e[20]=p.labelColor,e[21]=f):f=e[21];let y;e[22]!==p.label||e[23]!==f?(y=t.jsx("span",{className:f,children:p.label}),e[22]=p.label,e[23]=f,e[24]=y):y=e[24];let _;e[25]!==S||e[26]!==y?(_=t.jsxs("div",{children:[g,t.jsxs("div",{className:"flex items-center gap-1.5",children:[S,y]})]}),e[25]=S,e[26]=y,e[27]=_):_=e[27];let d;e[28]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Date"}),e[28]=d):d=e[28];let C;e[29]!==u?(C=t.jsxs("div",{children:[d,t.jsx("div",{className:"text-sm text-foreground",children:u})]}),e[29]=u,e[30]=C):C=e[30];let T;e[31]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"User"}),e[31]=T):T=e[31];let w;e[32]!==h||e[33]!==x?(w=t.jsx(We,{url:h,fallback:x,shape:"circle",size:"2xs",className:"shrink-0"}),e[32]=h,e[33]=x,e[34]=w):w=e[34];let I;e[35]!==x?(I=t.jsx("span",{className:"text-sm text-foreground",children:x}),e[35]=x,e[36]=I):I=e[36];let k;e[37]!==w||e[38]!==I?(k=t.jsxs("div",{children:[T,t.jsxs("div",{className:"flex items-center gap-2",children:[w,I]})]}),e[37]=w,e[38]=I,e[39]=k):k=e[39];let P;e[40]!==c||e[41]!==a?(P=a&&t.jsxs("div",{children:[t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Agent"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Pe,{icon:c,name:a,size:"xs",fallbackIcon:t.jsx(Ie,{}),className:"shrink-0 size-5! min-w-5! rounded-md"}),t.jsx("span",{className:"text-sm text-foreground",children:a})]})]}),e[40]=c,e[41]=a,e[42]=P):P=e[42];let D;return e[43]!==C||e[44]!==k||e[45]!==P||e[46]!==_?(D=t.jsxs("div",{className:"px-5 md:px-6 py-5 border-b border-border grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4 text-sm",children:[_,C,k,P]}),e[43]=C,e[44]=k,e[45]=P,e[46]=_,e[47]=D):D=e[47],D}function Et(l){const e=le.c(72),{thread:s,usage:n,members:r,connections:i,virtualMcps:a,onClick:m,lastRowRef:c}=l;let o,b;if(e[0]!==i||e[1]!==s||e[2]!==a){const V=Ae(s);o=Ee(V,a,i,"—"),b=$e(V,a,i),e[0]=i,e[1]=s,e[2]=a,e[3]=o,e[4]=b}else o=e[3],b=e[4];const v=b;let x;if(e[5]!==r||e[6]!==s.created_by){const V=Xe(r);let J;e[8]!==s.created_by?(J=z=>z.userId===s.created_by,e[8]=s.created_by,e[9]=J):J=e[9],x=V.find(J),e[5]=r,e[6]=s.created_by,e[7]=x}else x=e[7];const h=x;let N;e[10]!==h?.user.email||e[11]!==h?.user.name||e[12]!==s.created_by?(N=h?.user.name??h?.user.email??s.created_by?.substring(0,8)??"—",e[10]=h?.user.email,e[11]=h?.user.name,e[12]=s.created_by,e[13]=N):N=e[13];const u=N,p=h?.user.image??void 0;let j,g;if(e[14]!==s.created_at){const V=new Date(s.created_at);j=V.toLocaleDateString("en-US",{month:"short",day:"numeric"}),g=V.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[14]=s.created_at,e[15]=j,e[16]=g}else j=e[15],g=e[16];const S=g,f=ue[s.status]??ue.completed,y=f.icon;let _;e[17]!==s.title?(_=t.jsx(se,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[17]=s.title,e[18]=_):_=e[18];let d;e[19]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ie,{}),e[19]=d):d=e[19];let C;e[20]!==v||e[21]!==o?(C=t.jsx(Pe,{icon:v,name:o,size:"xs",fallbackIcon:d,className:"shrink-0 size-5! min-w-5! rounded-md"}),e[20]=v,e[21]=o,e[22]=C):C=e[22];let T;e[23]!==o?(T=t.jsx("span",{className:"truncate",children:o}),e[23]=o,e[24]=T):T=e[24];let w;e[25]!==C||e[26]!==T?(w=t.jsx(se,{className:"w-36 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[C,T]})}),e[25]=C,e[26]=T,e[27]=w):w=e[27];let I;e[28]!==p||e[29]!==u?(I=t.jsx(We,{url:p,fallback:u,shape:"circle",size:"2xs",className:"shrink-0"}),e[28]=p,e[29]=u,e[30]=I):I=e[30];let k;e[31]!==u?(k=t.jsx("span",{className:"truncate",children:u}),e[31]=u,e[32]=k):k=e[32];let P;e[33]!==I||e[34]!==k?(P=t.jsx(se,{className:"w-28 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[33]=I,e[34]=k,e[35]=P):P=e[35];let D;e[36]!==y||e[37]!==f.iconClassName?(D=t.jsx(y,{size:14,className:f.iconClassName}),e[36]=y,e[37]=f.iconClassName,e[38]=D):D=e[38];let M;e[39]!==f.labelColor?(M=be("text-sm",f.labelColor),e[39]=f.labelColor,e[40]=M):M=e[40];let A;e[41]!==f.label||e[42]!==M?(A=t.jsx("span",{className:M,children:f.label}),e[41]=f.label,e[42]=M,e[43]=A):A=e[43];let $;e[44]!==D||e[45]!==A?($=t.jsx(se,{className:"w-24 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[D,A]})}),e[44]=D,e[45]=A,e[46]=$):$=e[46];let B;e[47]!==n?(B=n?De(n.totalTokens):"—",e[47]=n,e[48]=B):B=e[48];let F;e[49]!==B?(F=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:B}),e[49]=B,e[50]=F):F=e[50];let Z;e[51]!==n?(Z=n&&n.costUsd>0?Re(n.costUsd):"—",e[51]=n,e[52]=Z):Z=e[52];let q;e[53]!==Z?(q=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:Z}),e[53]=Z,e[54]=q):q=e[54];let U;e[55]!==j?(U=t.jsx("div",{children:j}),e[55]=j,e[56]=U):U=e[56];let O;e[57]!==S?(O=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:S}),e[57]=S,e[58]=O):O=e[58];let L;e[59]!==U||e[60]!==O?(L=t.jsxs(se,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[U,O]}),e[59]=U,e[60]=O,e[61]=L):L=e[61];let K;return e[62]!==c||e[63]!==m||e[64]!==P||e[65]!==$||e[66]!==F||e[67]!==q||e[68]!==L||e[69]!==_||e[70]!==w?(K=t.jsxs(Ne,{ref:c,className:"h-14 md:h-16 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:m,children:[_,w,P,$,F,q,L]}),e[62]=c,e[63]=m,e[64]=P,e[65]=$,e[66]=F,e[67]=q,e[68]=L,e[69]=_,e[70]=w,e[71]=K):K=e[71],K}const Ce=100;function $t(l){const e=le.c(37),{client:s,locator:n,thread:r,connections:i,virtualMcps:a,members:m,selectedIndex:c,total:o,onPrev:b,onNext:v}=l;let x;e[0]!==n||e[1]!==r.id?(x=xe.threadMessages(n,r.id),e[0]=n,e[1]=r.id,e[2]=x):x=e[2];let h;e[3]!==s||e[4]!==r.id?(h=async k=>{const{pageParam:P}=k,D=P===void 0?0:P;if(!s)throw new Error("MCP client is not available");const M=await s.callTool({name:"COLLECTION_THREAD_MESSAGES_LIST",arguments:{thread_id:r.id,limit:Ce,offset:D}});return M.structuredContent??M},e[3]=s,e[4]=r.id,e[5]=h):h=e[5];let N;e[6]!==x||e[7]!==h?(N={queryKey:x,queryFn:h,initialPageParam:0,getNextPageParam:Ut,staleTime:6e4},e[6]=x,e[7]=h,e[8]=N):N=e[8];const{data:u,fetchNextPage:p,hasNextPage:j,isFetchingNextPage:g}=xt(N);let S;e[9]!==u.pages?(S=u.pages.flatMap(Ft).filter(Lt),e[9]=u.pages,e[10]=S):S=e[10];const f=S,y=Ct(f);let _;e[11]!==p||e[12]!==j||e[13]!==g?(_=()=>{j&&!g&&p()},e[11]=p,e[12]=j,e[13]=g,e[14]=_):_=e[14];const d=ke(_,j??!1,g);let C;e[15]!==i||e[16]!==v||e[17]!==b||e[18]!==c||e[19]!==r||e[20]!==o||e[21]!==a?(C=t.jsx(we,{thread:r,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[15]=i,e[16]=v,e[17]=b,e[18]=c,e[19]=r,e[20]=o,e[21]=a,e[22]=C):C=e[22];let T;e[23]!==i||e[24]!==m||e[25]!==r||e[26]!==a?(T=t.jsx(At,{thread:r,connections:i,virtualMcps:a,members:m}),e[23]=i,e[24]=m,e[25]=r,e[26]=a,e[27]=T):T=e[27];let w;e[28]!==g||e[29]!==d||e[30]!==y||e[31]!==f.length?(w=f.length===0?t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"No messages in this thread"}):t.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:t.jsxs("div",{className:"flex flex-col min-w-0 max-w-2xl mx-auto w-full",children:[y.map((k,P)=>t.jsx("div",{ref:P===y.length-1?d:void 0,children:t.jsx(_t,{pair:k,isLastPair:P===y.length-1,status:"ready"})},`pair-${k.user?.id??k.assistant?.id}`)),g&&t.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"Loading more\\u2026"})]})}),e[28]=g,e[29]=d,e[30]=y,e[31]=f.length,e[32]=w):w=e[32];let I;return e[33]!==C||e[34]!==T||e[35]!==w?(I=t.jsxs(t.Fragment,{children:[C,T,w]}),e[33]=C,e[34]=T,e[35]=w,e[36]=I):I=e[36],I}function Lt(l){return l.role==="user"||l.role==="assistant"}function Ft(l){return l.items??[]}function Ut(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Ce))return n.length*Ce}function et(l){const e=le.c(39),{thread:s,client:n,locator:r,connections:i,virtualMcps:a,members:m,selectedIndex:c,total:o,onPrev:b,onNext:v}=l;let x;e[0]!==i||e[1]!==v||e[2]!==b||e[3]!==c||e[4]!==s||e[5]!==o||e[6]!==a?(x=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[0]=i,e[1]=v,e[2]=b,e[3]=c,e[4]=s,e[5]=o,e[6]=a,e[7]=x):x=e[7];let h;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Failed to load messages"}),e[8]=h):h=e[8];let N;e[9]!==x?(N=t.jsxs(t.Fragment,{children:[x,h]}),e[9]=x,e[10]=N):N=e[10];let u;e[11]!==i||e[12]!==v||e[13]!==b||e[14]!==c||e[15]!==s||e[16]!==o||e[17]!==a?(u=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[11]=i,e[12]=v,e[13]=b,e[14]=c,e[15]=s,e[16]=o,e[17]=a,e[18]=u):u=e[18];let p;e[19]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Loading conversation\\u2026"}),e[19]=p):p=e[19];let j;e[20]!==u?(j=t.jsxs(t.Fragment,{children:[u,p]}),e[20]=u,e[21]=j):j=e[21];let g;e[22]!==n||e[23]!==i||e[24]!==r||e[25]!==m||e[26]!==v||e[27]!==b||e[28]!==c||e[29]!==s||e[30]!==o||e[31]!==a?(g=t.jsx($t,{client:n,locator:r,thread:s,connections:i,virtualMcps:a,members:m,selectedIndex:c,total:o,onPrev:b,onNext:v}),e[22]=n,e[23]=i,e[24]=r,e[25]=m,e[26]=v,e[27]=b,e[28]=c,e[29]=s,e[30]=o,e[31]=a,e[32]=g):g=e[32];let S;e[33]!==j||e[34]!==g?(S=t.jsx(oe.Suspense,{fallback:j,children:g}),e[33]=j,e[34]=g,e[35]=S):S=e[35];let f;return e[36]!==N||e[37]!==S?(f=t.jsx(tt,{fallback:N,children:S}),e[36]=N,e[37]=S,e[38]=f):f=e[38],f}function Is(l){const e=le.c(43),{filterAgentIds:s,filterUserIds:n,filterStatus:r,virtualMcpOptions:i,memberOptions:a,activeFiltersCount:m,onUpdateFilters:c}=l,[o,b]=oe.useState(!1);let v,x;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(wt,{size:16}),x=t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),e[0]=v,e[1]=x):(v=e[0],x=e[1]);let h;e[2]!==m?(h=m>0&&t.jsxs(t.Fragment,{children:[t.jsx(je,{variant:"default",className:"sm:hidden absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:m}),t.jsx(je,{variant:"default",className:"hidden sm:flex ml-1 h-5 w-5 rounded-full p-0 items-center justify-center text-xs",children:m})]}),e[2]=m,e[3]=h):h=e[3];let N;e[4]!==h?(N=t.jsx(Je,{asChild:!0,children:t.jsxs(fe,{variant:"outline",className:"relative",children:[v,x,h]})}),e[4]=h,e[5]=N):N=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"font-medium text-sm",children:"Filter Threads"}),e[6]=u):u=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Agent"}),e[7]=p):p=e[7];let j;e[8]!==c?(j=M=>c({filterAgentIds:M.slice(0,1)}),e[8]=c,e[9]=j):j=e[9];let g;e[10]!==s||e[11]!==j||e[12]!==i?(g=t.jsxs("div",{children:[p,t.jsx(Ue,{options:i,defaultValue:s,onValueChange:j,placeholder:"All agents",variant:"secondary",className:"w-full",maxCount:1})]}),e[10]=s,e[11]=j,e[12]=i,e[13]=g):g=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"User"}),e[14]=S):S=e[14];let f;e[15]!==c?(f=M=>c({filterUserIds:M.slice(0,1)}),e[15]=c,e[16]=f):f=e[16];let y;e[17]!==n||e[18]!==a||e[19]!==f?(y=t.jsxs("div",{children:[S,t.jsx(Ue,{options:a,defaultValue:n,onValueChange:f,placeholder:"All users",variant:"secondary",className:"w-full",maxCount:1})]}),e[17]=n,e[18]=a,e[19]=f,e[20]=y):y=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),e[21]=_):_=e[21];let d;e[22]!==c?(d=M=>c({filterStatus:M}),e[22]=c,e[23]=d):d=e[23];let C;e[24]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(ht,{className:"w-full",children:t.jsx(gt,{})}),e[24]=C):C=e[24];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(pt,{children:[t.jsx(ge,{value:"all",children:"All statuses"}),t.jsx(ge,{value:"completed",children:"Completed"}),t.jsx(ge,{value:"active",children:"Active"}),t.jsx(ge,{value:"failed",children:"Failed"})]}),e[25]=T):T=e[25];let w;e[26]!==r||e[27]!==d?(w=t.jsxs("div",{children:[_,t.jsxs(jt,{value:r,onValueChange:d,children:[C,T]})]}),e[26]=r,e[27]=d,e[28]=w):w=e[28];let I;e[29]!==y||e[30]!==w||e[31]!==g?(I=t.jsxs("div",{className:"space-y-3",children:[g,y,w]}),e[29]=y,e[30]=w,e[31]=g,e[32]=I):I=e[32];let k;e[33]!==m||e[34]!==c?(k=m>0&&t.jsx(fe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{c({filterAgentIds:[],filterUserIds:[],filterStatus:"all"}),b(!1)},children:"Clear all filters"}),e[33]=m,e[34]=c,e[35]=k):k=e[35];let P;e[36]!==I||e[37]!==k?(P=t.jsx(Qe,{align:"end",className:"w-[280px]",children:t.jsxs("div",{className:"space-y-4",children:[u,I,k]})}),e[36]=I,e[37]=k,e[38]=P):P=e[38];let D;return e[39]!==o||e[40]!==P||e[41]!==N?(D=t.jsxs(Ze,{open:o,onOpenChange:b,children:[N,P]}),e[39]=o,e[40]=P,e[41]=N,e[42]=D):D=e[42],D}const _e=50;function Ps(l){const e=le.c(29),{client:s,locator:n,membersData:r,allConnections:i,allVirtualMcps:a,dateRange:m,searchQuery:c,filterAgentIds:o,filterUserIds:b,filterStatus:v}=l,[x,h]=oe.useState(null),N=m.startDate.toISOString(),u=m.endDate.toISOString(),p=JSON.stringify({startDate:N,endDate:u,search:c,agentIds:o,userIds:b,status:v}),{data:j,fetchNextPage:g,hasNextPage:S,isFetchingNextPage:f,isLoading:y}=ze({queryKey:xe.threadsInfinite(n,p),queryFn:async R=>{const{pageParam:G}=R,ie=G===void 0?0:G;if(!s)throw new Error("MCP client is not available");const E=await s.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:_e,offset:ie,startDate:N,endDate:u,...c?{search:c}:{},...o&&o.length>0?{agentId:o[0]}:{},...b&&b.length>0?{userId:b[0]}:{},...v&&v!=="all"?{status:v}:{}}});return E.structuredContent??E},initialPageParam:0,getNextPageParam:Gt,staleTime:3e4}),_=(j?.pages??[]).flatMap(qt),d=_.map(Kt),{data:C}=Ve({queryKey:xe.monitoringThreadUsage(n,JSON.stringify({ids:d,startDate:N,endDate:u})),queryFn:async()=>{if(!s)throw new Error("MCP client is not available");const R=await s.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:d,startDate:N,endDate:u}});return R.structuredContent??R},enabled:!!s&&d.length>0,staleTime:3e4}),T=new Map((C?.items??[]).map(zt)),[w,I]=oe.useState(null),[k,P]=oe.useState("desc");let D;e[0]!==w?(D=R=>{w===R?P(Vt):(I(R),P("desc"))},e[0]=w,e[1]=D):D=e[1];const M=D,A=R=>{const G=T.get(R);return G?w==="cost"?G.costUsd:G.totalTokens:0},$=w?[..._].sort((R,G)=>{const ie=A(R.id),E=A(G.id);return k==="desc"?E-ie:ie-E}):_,B=x!==null?$[x]??null:null;let F;e[2]!==g||e[3]!==S||e[4]!==f?(F=()=>{S&&!f&&g()},e[2]=g,e[3]=S,e[4]=f,e[5]=F):F=e[5];const q=ke(F,S??!1,f),U=!!c||(o?.length??0)>0||(b?.length??0)>0||v&&v!=="all";let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=()=>h(Ot),e[6]=O):O=e[6];const L=O,K=()=>h(R=>R!==null&&R<$.length-1?R+1:R),V="flex-1 flex flex-col overflow-auto min-w-0",J="mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",z="flex-1 flex flex-col min-w-0",Q="flex-1 min-w-0 pt-1",ce="min-w-0",W=y?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx("span",{className:"text-sm text-muted-foreground",children:"Loading\\u2026"})}):_.length===0?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx(Se,{title:U?"No matching threads":"No threads in this time range",description:U?"Try adjusting your filters or search query.":"Try expanding the time range to see older threads."})}):t.jsxs(t.Fragment,{children:[t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0 z-20",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(te,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Title"}),t.jsx(te,{className:"w-36 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(te,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("tokens"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Tokens",w==="tokens"&&(k==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:t.jsxs("button",{type:"button",onClick:()=>M("cost"),className:"inline-flex items-center gap-1 ml-auto hover:text-foreground transition-colors uppercase",children:["Cost",w==="cost"&&(k==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(te,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Date"})]})}),t.jsx(Be,{children:$.map((R,G)=>t.jsx(Et,{thread:R,usage:T.get(R.id),members:r,connections:i,virtualMcps:a,onClick:()=>h(G),lastRowRef:G===$.length-1?q:void 0},R.id))})]}),f&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more..."})]});let Y;e[7]!==W?(Y=t.jsx("div",{className:J,children:t.jsx("div",{className:z,children:t.jsx("div",{className:Q,children:t.jsx("div",{className:ce,children:W})})})}),e[7]=W,e[8]=Y):Y=e[8];const de=x!==null;let ne;e[9]===Symbol.for("react.memo_cache_sentinel")?(ne=R=>{R||h(null)},e[9]=ne):ne=e[9];let ae;e[10]!==i||e[11]!==a||e[12]!==s||e[13]!==$||e[14]!==K||e[15]!==L||e[16]!==n||e[17]!==r||e[18]!==B||e[19]!==x?(ae=B&&x!==null&&t.jsx(et,{thread:B,client:s,locator:n,connections:i,virtualMcps:a,members:r,selectedIndex:x,total:$.length,onPrev:L,onNext:K}),e[10]=i,e[11]=a,e[12]=s,e[13]=$,e[14]=K,e[15]=L,e[16]=n,e[17]=r,e[18]=B,e[19]=x,e[20]=ae):ae=e[20];let X;e[21]!==ae?(X=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:ae}),e[21]=ae,e[22]=X):X=e[22];let ee;e[23]!==de||e[24]!==X?(ee=t.jsx(qe,{open:de,onOpenChange:ne,children:X}),e[23]=de,e[24]=X,e[25]=ee):ee=e[25];let re;return e[26]!==Y||e[27]!==ee?(re=t.jsxs("div",{className:V,children:[Y,ee]}),e[26]=Y,e[27]=ee,e[28]=re):re=e[28],re}function Ot(l){return l!==null&&l>0?l-1:l}function Vt(l){return l==="desc"?"asc":"desc"}function zt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function Kt(l){return l.id}function qt(l){return l.items??[]}function Gt(l,e){const s=l,n=e;if(!((s?.items?.length??0)<_e))return n.length*_e}const Te=50;function pe(l){const e=le.c(10),{title:s,value:n,subtitle:r}=l;let i;e[0]!==s?(i=t.jsx("span",{className:"text-sm text-foreground/70",children:s}),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n?(a=t.jsx("span",{className:"text-3xl font-normal tabular-nums",children:n}),e[2]=n,e[3]=a):a=e[3];let m;e[4]!==r?(m=r&&t.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=m):m=e[5];let c;return e[6]!==i||e[7]!==a||e[8]!==m?(c=t.jsxs(ct,{className:"pt-4 px-4 pb-5 gap-1",children:[i,a,m]}),e[6]=i,e[7]=a,e[8]=m,e[9]=c):c=e[9],c}function Ht(l){const e=le.c(27),{automationId:s,range:n}=l,{data:r,isLoading:i}=ft(s,n),a=r?.runs,m=r?.usage;let c;e[0]!==a?(c=a&&a.total>0?`${Math.round(a.completed/a.total*100)}%`:"—",e[0]=a,e[1]=c):c=e[1];const o=c,b=m&&m.truncated?`last ${m.sampledRuns} runs`:void 0;let v;e[2]!==i||e[3]!==a?.total?(v=i?"…":a?.total.toLocaleString()??"0",e[2]=i,e[3]=a?.total,e[4]=v):v=e[4];const x=a?`${a.completed} ok · ${a.failed} failed${a.inProgress>0?` · ${a.inProgress} running`:""}`:void 0;let h;e[5]!==v||e[6]!==x?(h=t.jsx(pe,{title:"Runs",value:v,subtitle:x}),e[5]=v,e[6]=x,e[7]=h):h=e[7];const N=i?"…":o;let u;e[8]!==N?(u=t.jsx(pe,{title:"Success rate",value:N}),e[8]=N,e[9]=u):u=e[9];let p;e[10]!==i||e[11]!==m?.totalTokens?(p=i?"…":De(m?.totalTokens??0),e[10]=i,e[11]=m?.totalTokens,e[12]=p):p=e[12];let j;e[13]!==p||e[14]!==b?(j=t.jsx(pe,{title:"Tokens",value:p,subtitle:b}),e[13]=p,e[14]=b,e[15]=j):j=e[15];let g;e[16]!==i||e[17]!==m?(g=i?"…":m&&m.costUsd>0?Re(m.costUsd):"—",e[16]=i,e[17]=m,e[18]=g):g=e[18];let S;e[19]!==g||e[20]!==b?(S=t.jsx(pe,{title:"Cost",value:g,subtitle:b}),e[19]=g,e[20]=b,e[21]=S):S=e[21];let f;return e[22]!==S||e[23]!==h||e[24]!==u||e[25]!==j?(f=t.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[h,u,j,S]}),e[22]=S,e[23]=h,e[24]=u,e[25]=j,e[26]=f):f=e[26],f}function Bt(l){const e=le.c(39),{run:s,usage:n,onClick:r,lastRowRef:i}=l;let a,m;if(e[0]!==s.created_at){const C=new Date(s.created_at);a=C.toLocaleDateString("en-US",{month:"short",day:"numeric"}),m=C.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[0]=s.created_at,e[1]=a,e[2]=m}else a=e[1],m=e[2];const c=m,o=ue[s.status]??ue.completed,b=o.icon;let v;e[3]!==s.title?(v=t.jsx(se,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:t.jsx("div",{className:"font-medium text-foreground truncate",children:s.title})}),e[3]=s.title,e[4]=v):v=e[4];let x;e[5]!==b||e[6]!==o.iconClassName?(x=t.jsx(b,{size:14,className:o.iconClassName}),e[5]=b,e[6]=o.iconClassName,e[7]=x):x=e[7];let h;e[8]!==o.labelColor?(h=be("text-sm",o.labelColor),e[8]=o.labelColor,e[9]=h):h=e[9];let N;e[10]!==o.label||e[11]!==h?(N=t.jsx("span",{className:h,children:o.label}),e[10]=o.label,e[11]=h,e[12]=N):N=e[12];let u;e[13]!==x||e[14]!==N?(u=t.jsx(se,{className:"w-28 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[x,N]})}),e[13]=x,e[14]=N,e[15]=u):u=e[15];let p;e[16]!==n?(p=n?De(n.totalTokens):"—",e[16]=n,e[17]=p):p=e[17];let j;e[18]!==p?(j=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:p}),e[18]=p,e[19]=j):j=e[19];let g;e[20]!==n?(g=n&&n.costUsd>0?Re(n.costUsd):"—",e[20]=n,e[21]=g):g=e[21];let S;e[22]!==g?(S=t.jsx(se,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:g}),e[22]=g,e[23]=S):S=e[23];let f;e[24]!==a?(f=t.jsx("div",{children:a}),e[24]=a,e[25]=f):f=e[25];let y;e[26]!==c?(y=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:c}),e[26]=c,e[27]=y):y=e[27];let _;e[28]!==f||e[29]!==y?(_=t.jsxs(se,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[f,y]}),e[28]=f,e[29]=y,e[30]=_):_=e[30];let d;return e[31]!==i||e[32]!==r||e[33]!==S||e[34]!==_||e[35]!==v||e[36]!==u||e[37]!==j?(d=t.jsxs(Ne,{ref:i,className:"h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:r,children:[v,u,j,S,_]}),e[31]=i,e[32]=r,e[33]=S,e[34]=_,e[35]=v,e[36]=u,e[37]=j,e[38]=d):d=e[38],d}function Ms(l){const e=le.c(48),{automationId:s,triggerIds:n,range:r}=l,{org:i,locator:a}=st();let m;e[0]!==i.id||e[1]!==i.slug?(m={connectionId:rt,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=m):m=e[2];const c=it(m),o=lt(),b=ot(),{data:v}=ut(),[x,h]=oe.useState(null),N=n.length>0;let u;e[3]!==s||e[4]!==i.id||e[5]!==n?(u=xe.automationRuns(i.id,s,n),e[3]=s,e[4]=i.id,e[5]=n,e[6]=u):u=e[6];let p;e[7]!==c||e[8]!==n?(p=async z=>{const{pageParam:Q}=z,ce=Q===void 0?0:Q,W=await c.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:Te,offset:ce,where:{trigger_ids:n}}});return W.structuredContent??W},e[7]=c,e[8]=n,e[9]=p):p=e[9];let j;e[10]!==N||e[11]!==u||e[12]!==p?(j={queryKey:u,queryFn:p,initialPageParam:0,getNextPageParam:Yt,enabled:N,staleTime:3e4},e[10]=N,e[11]=u,e[12]=p,e[13]=j):j=e[13];const{data:g,fetchNextPage:S,hasNextPage:f,isFetchingNextPage:y,isLoading:_}=ze(j),d=(g?.pages??[]).flatMap(Wt),C=d.map(Zt),{data:T}=Ve({queryKey:xe.monitoringThreadUsage(a,JSON.stringify({ids:C,...r})),queryFn:async()=>{const z=await c.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:C,...r.startDate?{startDate:r.startDate}:{},...r.endDate?{endDate:r.endDate}:{}}});return z.structuredContent??z},enabled:C.length>0,staleTime:3e4});let w;e[14]!==T?.items?(w=new Map((T?.items??[]).map(Qt)),e[14]=T?.items,e[15]=w):w=e[15];const I=w;let k;e[16]!==S||e[17]!==f||e[18]!==y?(k=()=>{f&&!y&&S()},e[16]=S,e[17]=f,e[18]=y,e[19]=k):k=e[19];const P=ke(k,f??!1,y),D=x!==null?d[x]??null:null;let M;e[20]===Symbol.for("react.memo_cache_sentinel")?(M=()=>h(Jt),e[20]=M):M=e[20];const A=M,$=()=>h(z=>z!==null&&z<d.length-1?z+1:z),B="flex flex-col gap-5";let F;e[21]!==s||e[22]!==r?(F=t.jsx(Ht,{automationId:s,range:r}),e[21]=s,e[22]=r,e[23]=F):F=e[23];const Z=N?_?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading runs…"}):d.length===0?t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No runs yet",description:"This automation hasn't run yet. Trigger it or wait for a starter to fire."})}):t.jsxs(Ge,{className:"w-full border-collapse",children:[t.jsx(He,{className:"border-b-0",children:t.jsxs(Ne,{className:"h-9 hover:bg-transparent border-b border-border",children:[t.jsx(te,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Run"}),t.jsx(te,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Tokens"}),t.jsx(te,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Cost"}),t.jsx(te,{className:"w-32 px-3 pr-5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Started"})]})}),t.jsx(Be,{children:d.map((z,Q)=>t.jsx(Bt,{run:z,usage:I.get(z.id),onClick:()=>h(Q),lastRowRef:Q===d.length-1?P:void 0},z.id))})]}):t.jsx("div",{className:"py-16",children:t.jsx(Se,{title:"No starters yet",description:"Add a starter (cron, event, or webhook) to start collecting runs."})});let q;e[24]!==y?(q=y&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more…"}),e[24]=y,e[25]=q):q=e[25];const U=x!==null;let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=z=>{z||h(null)},e[26]=O):O=e[26];let L;e[27]!==o||e[28]!==b||e[29]!==c||e[30]!==$||e[31]!==A||e[32]!==a||e[33]!==v||e[34]!==d||e[35]!==D||e[36]!==x?(L=D&&x!==null&&t.jsx(et,{thread:D,client:c,locator:a,connections:o,virtualMcps:b,members:v,selectedIndex:x,total:d.length,onPrev:A,onNext:$}),e[27]=o,e[28]=b,e[29]=c,e[30]=$,e[31]=A,e[32]=a,e[33]=v,e[34]=d,e[35]=D,e[36]=x,e[37]=L):L=e[37];let K;e[38]!==L?(K=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:L}),e[38]=L,e[39]=K):K=e[39];let V;e[40]!==U||e[41]!==K?(V=t.jsx(qe,{open:U,onOpenChange:O,children:K}),e[40]=U,e[41]=K,e[42]=V):V=e[42];let J;return e[43]!==Z||e[44]!==q||e[45]!==V||e[46]!==F?(J=t.jsxs("div",{className:B,children:[F,Z,q,V]}),e[43]=Z,e[44]=q,e[45]=V,e[46]=F,e[47]=J):J=e[47],J}function Jt(l){return l!==null&&l>0?l-1:l}function Qt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function Zt(l){return l.id}function Wt(l){return l.items??[]}function Yt(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Te))return n.length*Te}export{Ms as A,Ue as M,Is as T,Re as a,_s as b,Rt as c,ks as d,Ts as e,De as f,Cs as g,Xe as h,Ps as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as H,X as Ie,q as ze,G as Le,K as Re,n as Ke,a as ge,j as n,B as Te,t as V,o as X,r as Oe,H as Xe,c as _e,D as fe}from"./index-biiHZ5l9.js";import{S as He,u as Ue}from"./use-mcp-client-CWFUu1lY.js";import{t as qe}from"./ChevronDown-Cf2Q-GlB.js";import{i as Me}from"./ChevronRight-CrZy8tHx.js";import{s as Ve,t as Ge}from"./Star01-eRdSY4QW.js";import{n as Qe}from"./LinkExternal01-CgI1VTqi.js";import{s as Pe}from"./Plus-CjrtKB-Y.js";import{s as Ye}from"./Trash01-Cup7-ZTT.js";import{i as Je}from"./Zap-Cl-JM7N9.js";import{c as We,b as Ze,d as et,f as tt,g as st,e as nt,a as lt,A as ot}from"./alert-dialog-CSkQIwm8.js";import{I as ue}from"./input-5PMMNPU9.js";import{T as rt}from"./textarea-QEULyLXh.js";import{P as Ne}from"./index-r7-3fAFf.js";import{u as $e}from"./unwrap-tool-result-BYXdCQMg.js";import{u as at}from"./use-debounced-autosave-ClLbciGl.js";import{R as it}from"./require-capability-DVI2cKO3.js";import"./sidebar-CPZXU-2w.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./tooltip-bsrBmmjV.js";import"./sheet-D99KevZC.js";import"./X-1KR4wibP.js";import"./use-capability-BPM45mbW.js";import"./access-gate-CWPebMdP.js";import"./capability-load-error-Dfw4xb8a.js";function we(t){const e=H.c(8),{title:s,children:o,className:l}=t;let r;e[0]!==l?(r=_e("rounded-2xl border border-border/60 bg-background p-5",l),e[0]=l,e[1]=r):r=e[1];let i;e[2]!==s?(i=n.jsx("div",{className:"mb-4",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s})}),e[2]=s,e[3]=i):i=e[3];let d;return e[4]!==o||e[5]!==r||e[6]!==i?(d=n.jsxs("div",{className:r,children:[i,o]}),e[4]=o,e[5]=r,e[6]=i,e[7]=d):d=e[7],d}function ct(t){const e=H.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Oe.useState("");let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Je,{size:18,className:"text-primary"})}),e[0]=i):i=e[0];let d,u;e[1]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),u=n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Enter your website URL and we'll automatically extract your brand colors, fonts, logos, and company overview."}),e[1]=d,e[2]=u):(d=e[1],u=e[2]);let p;e[3]===Symbol.for("react.memo_cache_sentinel")?(p=f=>r(f.target.value),e[3]=p):p=e[3];let b;e[4]!==l||e[5]!==o||e[6]!==s?(b=f=>{f.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=b):b=e[7];let m;e[8]!==l||e[9]!==b?(m=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:p,className:"max-w-xs",onKeyDown:b}),e[8]=l,e[9]=b,e[10]=m):m=e[10];let c;e[11]!==l||e[12]!==o?(c=!l.trim()||o,e[11]=l,e[12]=o,e[13]=c):c=e[13];let a;e[14]!==l||e[15]!==s?(a=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=a):a=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(Ve,{size:14}),e[17]=x):x=e[17];const g=o?"Extracting...":"Extract";let h;e[18]!==g||e[19]!==c||e[20]!==a?(h=n.jsxs(Te,{variant:"outline",disabled:c,onClick:a,children:[x,g]}),e[18]=g,e[19]=c,e[20]=a,e[21]=h):h=e[21];let v;return e[22]!==h||e[23]!==m?(v=n.jsx("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-5",children:n.jsxs("div",{className:"flex items-start gap-4",children:[i,n.jsxs("div",{className:"flex-1",children:[d,u,n.jsxs("div",{className:"mt-3 flex gap-2",children:[m,h]})]})]})}),e[22]=h,e[23]=m,e[24]=v):v=e[24],v}function dt(t){const e=H.c(36),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s?(r=s.watch("domain"),e[0]=s,e[1]=r):r=e[1];const i=r;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=d):d=e[2];let u;e[3]!==o||e[4]!==l?(u=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=u):u=e[5];let p;e[6]!==s.control||e[7]!==u?(p=n.jsxs("div",{children:[d,n.jsx(fe,{control:s.control,name:"name",render:u})]}),e[6]=s.control,e[7]=u,e[8]=p):p=e[8];let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("span",{children:"Domain"}),e[9]=b):b=e[9];let m;e[10]!==i?(m=i&&n.jsxs("a",{href:`https://${i}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Qe,{size:10}),"open"]}),e[10]=i,e[11]=m):m=e[11];let c;e[12]!==m?(c=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[b,m]}),e[12]=m,e[13]=c):c=e[13];let a;e[14]!==o||e[15]!==l?(a=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=a):a=e[16];let x;e[17]!==s.control||e[18]!==a?(x=n.jsx(fe,{control:s.control,name:"domain",render:a}),e[17]=s.control,e[18]=a,e[19]=x):x=e[19];let g;e[20]!==c||e[21]!==x?(g=n.jsxs("div",{children:[c,x]}),e[20]=c,e[21]=x,e[22]=g):g=e[22];let h;e[23]!==g||e[24]!==p?(h=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[p,g]}),e[23]=g,e[24]=p,e[25]=h):h=e[25];let v;e[26]===Symbol.for("react.memo_cache_sentinel")?(v=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Overview"}),e[26]=v):v=e[26];let f;e[27]!==o||e[28]!==l?(f=D=>{const{field:y}=D;return n.jsx(rt,{...y,onChange:N=>{y.onChange(N),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=f):f=e[29];let C;e[30]!==s.control||e[31]!==f?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:f})]}),e[30]=s.control,e[31]=f,e[32]=C):C=e[32];let w;return e[33]!==h||e[34]!==C?(w=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[h,C]})}),e[33]=h,e[34]=C,e[35]=w):w=e[35],w}const mt={backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 4px",backgroundColor:"#fff"};function Ae(t){const e=H.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:i,onFieldCommit:d}=t,u=r===void 0?"h-full w-full object-contain p-3":r;let p;e[0]!==s||e[1]!==o?(p=s.watch(o),e[0]=s,e[1]=o,e[2]=p):p=e[2];const b=p;let m;e[3]!==u||e[4]!==l||e[5]!==b?(m=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:mt,children:b?n.jsx("img",{src:b,alt:l,className:u,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=u,e[4]=l,e[5]=b,e[6]=m):m=e[6];let c;e[7]!==l?(c=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=c):c=e[8];let a;e[9]!==i||e[10]!==d?(a=v=>{const{field:f}=v;return n.jsx(ue,{...f,onChange:C=>{f.onChange(C),i()},onBlur:()=>{f.onBlur(),d()},placeholder:"https://..."})},e[9]=i,e[10]=d,e[11]=a):a=e[11];let x;e[12]!==s.control||e[13]!==o||e[14]!==a?(x=n.jsx(fe,{control:s.control,name:o,render:a}),e[12]=s.control,e[13]=o,e[14]=a,e[15]=x):x=e[15];let g;e[16]!==c||e[17]!==x?(g=n.jsxs("div",{className:"flex-1",children:[c,x]}),e[16]=c,e[17]=x,e[18]=g):g=e[18];let h;return e[19]!==m||e[20]!==g?(h=n.jsxs("div",{className:"flex items-start gap-3",children:[m,g]}),e[19]=m,e[20]=g,e[21]=h):h=e[21],h}function ft(t){const e=H.c(4),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;return e[0]!==s||e[1]!==o||e[2]!==l?(r=n.jsx(we,{title:"Logos & Images",children:n.jsxs("div",{className:"space-y-3",children:[n.jsx(Ae,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Ae,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Ae,{form:s,name:"ogImage",label:"SEO / OG image",imgClassName:"h-full w-full object-contain",onFieldChange:o,onFieldCommit:l})]})}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3],r}const ut=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function xt(t){const e=H.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(d=>{const{key:u,label:p}=d,b=`fonts.${u}`,m=s.watch(b);return n.jsxs("div",{children:[n.jsxs("label",{className:"mb-1 flex items-center gap-3 text-xs text-muted-foreground",children:[n.jsx("span",{className:"w-7 text-base font-medium leading-none text-foreground",children:"Aa"}),n.jsx("span",{children:p}),m&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:m},children:m})]}),n.jsx(fe,{control:s.control,name:b,render:c=>{const{field:a}=c;return n.jsx(ue,{...a,value:a.value??"",onChange:x=>{a.onChange(x),o()},onBlur:()=>{a.onBlur(),l()},placeholder:`Font family for ${p.toLowerCase()}`})}})]},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}const gt=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function ht(t){const e=H.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=gt.map(d=>{const{key:u,label:p}=d,b=`colors.${u}`;return n.jsx(fe,{control:s.control,name:b,render:m=>{const{field:c}=m;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:c.value??"#000000",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},className:"h-9 w-9 shrink-0 cursor-pointer rounded-lg border border-border bg-transparent p-0.5"}),n.jsx(ue,{value:c.value??"",onChange:a=>{c.onChange(a.target.value),o()},onBlur:()=>{c.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:p})]})}},u)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let i;return e[4]!==r?(i=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=i):i=e[5],i}function pt(t){const e=H.c(128),{brand:s,client:o,onChanged:l}=t,[r,i]=Oe.useState(s.isDefault??!1),[d,u]=Oe.useState(!1),p=s.name??"",b=s.domain??"",m=s.overview??"",c=s.logo??"",a=s.favicon??"",x=s.ogImage??"";let g;e[0]!==s.fonts?(g=s.fonts??{},e[0]=s.fonts,e[1]=g):g=e[1];let h;e[2]!==s.colors?(h=s.colors??{},e[2]=s.colors,e[3]=h):h=e[3];let v;e[4]!==p||e[5]!==b||e[6]!==m||e[7]!==c||e[8]!==a||e[9]!==x||e[10]!==g||e[11]!==h?(v={values:{name:p,domain:b,overview:m,logo:c,favicon:a,ogImage:x,fonts:g,colors:h}},e[4]=p,e[5]=b,e[6]=m,e[7]=c,e[8]=a,e[9]=x,e[10]=g,e[11]=h,e[12]=v):v=e[12];const f=Xe(v);let C;e[13]!==s.id||e[14]!==s.images||e[15]!==o?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(kt),Ce=Object.values(j.colors).some(Dt),Se={id:s.id,name:j.name,domain:j.domain,overview:j.overview,logo:j.logo||null,favicon:j.favicon||null,ogImage:j.ogImage||null,fonts:ve?j.fonts:null,colors:Ce?j.colors:null,images:s.images};await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:Se})},onError:wt},e[13]=s.id,e[14]=s.images,e[15]=o,e[16]=C):C=e[16];const w=ge(C);let D;e[17]!==s.id||e[18]!==f||e[19]!==l||e[20]!==w?(D={delayMs:500,save:async()=>{const j=f.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=f.getValues(),Se=f.control._defaultValues;f.reset(Ce,{keepValues:!0});try{await w.mutateAsync(Ce),V("brand_updated",{brand_id:s.id,fields:ve}),X.success("Brand context updated successfully"),l()}catch{f.reset(Se,{keepValues:!0})}}},e[17]=s.id,e[18]=f,e[19]=l,e[20]=w,e[21]=D):D=e[21];const{schedule:y,flush:N}=at(D);let I;e[22]!==s.id||e[23]!==o?(I=async()=>{await o.callTool({name:"BRAND_CONTEXT_DELETE",arguments:{id:s.id}})},e[22]=s.id,e[23]=o,e[24]=I):I=e[24];let z;e[25]!==s.id||e[26]!==l?(z=()=>{V("brand_deleted",{brand_id:s.id}),u(!1),l(),X.success("Brand deleted")},e[25]=s.id,e[26]=l,e[27]=z):z=e[27];let U;e[28]!==I||e[29]!==z?(U={mutationFn:I,onSuccess:z,onError:_t},e[28]=I,e[29]=z,e[30]=U):U=e[30];const{mutate:xe,isPending:k}=ge(U);let B;e[31]!==s.id||e[32]!==s.isDefault||e[33]!==o?(B=async()=>{await o.callTool({name:"BRAND_CONTEXT_UPDATE",arguments:{id:s.id,isDefault:!s.isDefault}})},e[31]=s.id,e[32]=s.isDefault,e[33]=o,e[34]=B):B=e[34];let A;e[35]!==s.id||e[36]!==s.isDefault||e[37]!==l?(A=()=>{V(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),l(),X.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[35]=s.id,e[36]=s.isDefault,e[37]=l,e[38]=A):A=e[38];let T;e[39]!==B||e[40]!==A?(T={mutationFn:B,onSuccess:A,onError:Nt},e[39]=B,e[40]=A,e[41]=T):T=e[41];const{mutate:O}=ge(T),M=s.isDefault?"border-primary/30":"border-border/60";let q;e[42]!==M?(q=_e("rounded-2xl border bg-background",M),e[42]=M,e[43]=q):q=e[43];let R;e[44]!==r?(R=()=>i(!r),e[44]=r,e[45]=R):R=e[45];let L;e[46]!==r?(L=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(qe,{size:14}):n.jsx(Me,{size:14})}),e[46]=r,e[47]=L):L=e[47];let E;e[48]!==s.logo||e[49]!==s.name?(E=s.logo?n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",style:{backgroundImage:"linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%), linear-gradient(45deg, #e5e7eb 25%, transparent 25%, transparent 75%, #e5e7eb 75%)",backgroundSize:"6px 6px",backgroundPosition:"0 0, 3px 3px",backgroundColor:"#fff"},children:n.jsx("img",{src:s.logo,alt:"",className:"h-full w-full object-contain p-1",onError:Ct})}):n.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-muted",children:n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}),e[48]=s.logo,e[49]=s.name,e[50]=E):E=e[50];const K=s.name||"Untitled Brand";let F;e[51]!==K?(F=n.jsx("span",{className:"text-sm font-medium text-foreground",children:K}),e[51]=K,e[52]=F):F=e[52];let S;e[53]!==s.domain?(S=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[53]=s.domain,e[54]=S):S=e[54];let P;e[55]!==F||e[56]!==S?(P=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[F,S]}),e[55]=F,e[56]=S,e[57]=P):P=e[57];let _;e[58]!==s.colors||e[59]!==r?(_=!r&&s.colors&&Object.values(s.colors).some(vt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(yt).map(jt)}),e[58]=s.colors,e[59]=r,e[60]=_):_=e[60];let $;e[61]!==s.fonts||e[62]!==r?($=!r&&s.fonts&&Object.values(s.fonts).some(bt)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[61]=s.fonts,e[62]=r,e[63]=$):$=e[63];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let G;e[64]!==De?(G=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[64]=De,e[65]=G):G=e[65];let Q,Y;e[66]!==O?(Q=j=>{j.stopPropagation(),O()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),O())},e[66]=O,e[67]=Q,e[68]=Y):(Q=e[67],Y=e[68]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[69]!==Be?(J=_e(Be),e[69]=Be,e[70]=J):J=e[70];let W;e[71]!==J?(W=n.jsx(Ge,{size:13,className:J}),e[71]=J,e[72]=W):W=e[72];let Z;e[73]!==G||e[74]!==Q||e[75]!==Y||e[76]!==ke||e[77]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:G,onClick:Q,onKeyDown:Y,title:ke,children:W}),e[73]=G,e[74]=Q,e[75]=Y,e[76]=ke,e[77]=W,e[78]=Z):Z=e[78];let he,pe;e[79]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),u(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),u(!0))},e[79]=he,e[80]=pe):(he=e[79],pe=e[80]);let be;e[81]===Symbol.for("react.memo_cache_sentinel")?(be=n.jsx("span",{role:"button",tabIndex:0,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg opacity-0 transition-opacity hover:bg-destructive/10 group-hover:opacity-100",onClick:he,onKeyDown:pe,title:"Delete brand",children:n.jsx(Ye,{size:13,className:"text-muted-foreground"})}),e[81]=be):be=e[81];let ee;e[82]!==R||e[83]!==L||e[84]!==E||e[85]!==P||e[86]!==_||e[87]!==$||e[88]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:R,children:[L,E,P,_,$,Z,be]}),e[82]=R,e[83]=L,e[84]=E,e[85]=P,e[86]=_,e[87]=$,e[88]=Z,e[89]=ee):ee=e[89];let te;e[90]!==r||e[91]!==N||e[92]!==f||e[93]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(dt,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(ft,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(ht,{form:f,onFieldChange:y,onFieldCommit:N}),n.jsx(xt,{form:f,onFieldChange:y,onFieldCommit:N})]})]}),e[90]=r,e[91]=N,e[92]=f,e[93]=y,e[94]=te):te=e[94];let se;e[95]!==k?(se=j=>{!j&&!k&&u(!1)},e[95]=k,e[96]=se):se=e[96];let je;e[97]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(We,{children:"Delete brand?"}),e[97]=je):je=e[97];const Ee=s.name||"this brand";let ne;e[98]!==Ee?(ne=n.jsxs("p",{children:["This will permanently delete"," ",n.jsx("span",{className:"font-medium text-foreground",children:Ee}),". This action cannot be undone."]}),e[98]=Ee,e[99]=ne):ne=e[99];let le;e[100]!==s.isDefault?(le=s.isDefault&&n.jsxs("p",{className:"mt-2 rounded-lg border border-destructive/30 bg-destructive/5 p-2 text-destructive",children:[n.jsx("span",{className:"font-medium",children:"Heads up:"})," this is your organization's default brand. Deleting it will leave your organization without a default brand until you set another."]}),e[100]=s.isDefault,e[101]=le):le=e[101];let oe;e[102]!==ne||e[103]!==le?(oe=n.jsxs(Ze,{children:[je,n.jsx(et,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[102]=ne,e[103]=le,e[104]=oe):oe=e[104];let re;e[105]!==k?(re=n.jsx(tt,{disabled:k,children:"Cancel"}),e[105]=k,e[106]=re):re=e[106];let ae;e[107]!==xe?(ae=j=>{j.preventDefault(),xe()},e[107]=xe,e[108]=ae):ae=e[108];const Fe=k?"Deleting...":"Delete";let ie;e[109]!==k||e[110]!==ae||e[111]!==Fe?(ie=n.jsx(st,{onClick:ae,disabled:k,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[109]=k,e[110]=ae,e[111]=Fe,e[112]=ie):ie=e[112];let ce;e[113]!==re||e[114]!==ie?(ce=n.jsxs(nt,{children:[re,ie]}),e[113]=re,e[114]=ie,e[115]=ce):ce=e[115];let de;e[116]!==oe||e[117]!==ce?(de=n.jsxs(lt,{children:[oe,ce]}),e[116]=oe,e[117]=ce,e[118]=de):de=e[118];let me;e[119]!==d||e[120]!==se||e[121]!==de?(me=n.jsx(ot,{open:d,onOpenChange:se,children:de}),e[119]=d,e[120]=se,e[121]=de,e[122]=me):me=e[122];let ye;return e[123]!==q||e[124]!==ee||e[125]!==te||e[126]!==me?(ye=n.jsxs("div",{className:q,children:[ee,te,me]}),e[123]=q,e[124]=ee,e[125]=te,e[126]=me,e[127]=ye):ye=e[127],ye}function bt(t){return t}function jt(t){const[e,s]=t;return n.jsx("div",{className:"h-5 w-5 rounded-full border border-border/40",style:{backgroundColor:s},title:`${e}: ${s}`},e)}function yt(t){const[,e]=t;return e}function vt(t){return t}function Ct(t){t.target.style.display="none"}function Nt(){return X.error("Failed to update default brand")}function _t(){return X.error("Failed to delete brand")}function wt(){return X.error("Failed to save brand context")}function Dt(t){return t?.trim()}function kt(t){return t?.trim()}function Bt(){const t=H.c(57),{brandExtractEnabled:e}=Ie(),{org:s}=ze();let o;t[0]!==s.id||t[1]!==s.slug?(o={connectionId:He,orgId:s.id,orgSlug:s.slug},t[0]=s.id,t[1]=s.slug,t[2]=o):o=t[2];const l=Ue(o),r=Le();let i;t[3]!==s.id?(i=Re.brandContext(s.id),t[3]=s.id,t[4]=i):i=t[4];let d;t[5]!==l?(d=async()=>{const _=await l.callTool({name:"BRAND_CONTEXT_LIST",arguments:{includeArchived:!1}}),$=$e(_);return Array.isArray($?.items)?$.items:[]},t[5]=l,t[6]=d):d=t[6];let u;t[7]!==i||t[8]!==d?(u={queryKey:i,queryFn:d},t[7]=i,t[8]=d,t[9]=u):u=t[9];const{data:p}=Ke(u),m=(p===void 0?[]:p).filter(St);let c;t[10]!==s.id||t[11]!==r?(c=()=>r.invalidateQueries({queryKey:Re.brandContext(s.id),refetchType:"all"}),t[10]=s.id,t[11]=r,t[12]=c):c=t[12];const a=c;let x;t[13]!==l?(x=async()=>{await l.callTool({name:"BRAND_CONTEXT_CREATE",arguments:{name:"New Brand",domain:"example.com",overview:""}})},t[13]=l,t[14]=x):x=t[14];let g;t[15]!==a?(g=()=>{V("brand_created"),a(),X.success("Brand created")},t[15]=a,t[16]=g):g=t[16];let h;t[17]!==x||t[18]!==g?(h={mutationFn:x,onSuccess:g,onError:Ft},t[17]=x,t[18]=g,t[19]=h):h=t[19];const{mutate:v,isPending:f}=ge(h);let C;t[20]!==l?(C=async _=>{V("brand_extract_started",{domain:_});const $=await l.callTool({name:"BRAND_CONTEXT_EXTRACT",arguments:{domain:_}});$e($)},t[20]=l,t[21]=C):C=t[21];let w;t[22]!==a?(w=()=>{V("brand_extract_succeeded"),a(),X.success("Brand extracted successfully")},t[22]=a,t[23]=w):w=t[23];let D;t[24]!==w||t[25]!==C?(D={mutationFn:C,onSuccess:w,onError:Et},t[24]=w,t[25]=C,t[26]=D):D=t[26];const{mutate:y,isPending:N}=ge(D),I=Ne,z=Ne,U=Ne,xe="flex flex-col gap-6";let k;t[27]===Symbol.for("react.memo_cache_sentinel")?(k=n.jsxs("div",{children:[n.jsx(Ne.Title,{children:"Brand Context"}),n.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Define your brand profiles. Each brand is available as an MCP prompt for AI clients."})]}),t[27]=k):k=t[27];let B;t[28]!==v?(B=()=>v(),t[28]=v,t[29]=B):B=t[29];let A;t[30]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Pe,{size:14}),t[30]=A):A=t[30];let T;t[31]!==f||t[32]!==B?(T=n.jsxs("div",{className:"flex items-center justify-between",children:[k,n.jsxs(Te,{variant:"outline",onClick:B,disabled:f,children:[A,"Add Brand"]})]}),t[31]=f,t[32]=B,t[33]=T):T=t[33];let O;t[34]!==e||t[35]!==y||t[36]!==N?(O=e&&n.jsx(ct,{onExtract:_=>y(_),isExtracting:N}),t[34]=e,t[35]=y,t[36]=N,t[37]=O):O=t[37];const M=m.length===0&&n.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-muted/30 p-8 text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"No brands configured yet."}),n.jsxs(Te,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>v(),disabled:f,children:[n.jsx(Pe,{size:14}),"Add your first brand"]})]}),q="group space-y-3";let R;t[38]!==l||t[39]!==a?(R=_=>n.jsx(pt,{brand:_,client:l,onChanged:a},_.id),t[38]=l,t[39]=a,t[40]=R):R=t[40];const L=m.map(R);let E;t[41]!==L?(E=n.jsx("div",{className:q,children:L}),t[41]=L,t[42]=E):E=t[42];let K;t[43]!==T||t[44]!==O||t[45]!==M||t[46]!==E?(K=n.jsxs("div",{className:xe,children:[T,O,M,E]}),t[43]=T,t[44]=O,t[45]=M,t[46]=E,t[47]=K):K=t[47];let F;t[48]!==U.Body||t[49]!==K?(F=n.jsx(U.Body,{children:K}),t[48]=U.Body,t[49]=K,t[50]=F):F=t[50];let S;t[51]!==z.Content||t[52]!==F?(S=n.jsx(z.Content,{children:F}),t[51]=z.Content,t[52]=F,t[53]=S):S=t[53];let P;return t[54]!==I||t[55]!==S?(P=n.jsx(I,{children:S}),t[54]=I,t[55]=S,t[56]=P):P=t[56],P}function Et(t){V("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),X.error(t instanceof Error?t.message:"Failed to extract brand")}function Ft(){return X.error("Failed to create brand")}function St(t){return!t.archivedAt}function ss(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(it,{capability:"org:manage",area:"brand context",children:n.jsx(Bt,{})}),t[0]=e):e=t[0],e}export{ss as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as D,j as t,E as q,r as v,B as A,o as P}from"./index-biiHZ5l9.js";import{i as O}from"./AlertCircle-9EFUZenf.js";import{i as $}from"./HardDrive-DNFvbooP.js";import{s as E}from"./Plus-CjrtKB-Y.js";import{s as T}from"./Trash01-Cup7-ZTT.js";import{f as L,g as K,c as G,b as M,d as W,e as H,a as J,A as Q}from"./alert-dialog-CSkQIwm8.js";import{D as V,a as X,b as Y,c as Z,e as ee,d as te}from"./dialog-Bm1pP7Vu.js";import{I as N}from"./input-5PMMNPU9.js";import{L as k}from"./label-CcC4_aKf.js";import{S as se}from"./switch-D6SWnoi2.js";import{S as ie}from"./skeleton--DN75sg7.js";import{T as re}from"./textarea-QEULyLXh.js";import{P as _}from"./index-r7-3fAFf.js";import{c as ne}from"./settings-section-V9kb8x32.js";import{u as le,a as oe,b as ae}from"./use-file-configs-CC8ghNUa.js";import{R as ce}from"./require-capability-DVI2cKO3.js";import"./X-1KR4wibP.js";import"./sidebar-CPZXU-2w.js";import"./LayoutLeft-CQ8Vq9nI.js";import"./tooltip-bsrBmmjV.js";import"./sheet-D99KevZC.js";import"./card-BUTabNLA.js";import"./ArrowUpRight-97355q5v.js";import"./use-mcp-client-CWFUu1lY.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./use-capability-BPM45mbW.js";import"./access-gate-CWPebMdP.js";import"./capability-load-error-Dfw4xb8a.js";function de(s,e){if(!(s instanceof Error))return e;const i=s.message.match(/\[\s*\{[\s\S]*\}\s*\]/);if(i)try{const r=JSON.parse(i[0])[0];if(r?.message){const l=r.path?.join(".");return l?`${l}: ${r.message}`:r.message}}catch{}return s.message||e}function me(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(O,{size:16}),e[0]=n):n=e[0];let r;return e[1]!==i.message?(r=t.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[n,t.jsxs("span",{className:"text-sm font-medium",children:["Failed to load file configurations: ",i.message]})]}),e[1]=i.message,e[2]=r):r=e[2],r}function fe(s){const e=D.c(41),{config:i,onDelete:n}=s;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:t.jsx($,{size:16,className:"text-muted-foreground"})}),e[0]=r):r=e[0];let l;e[1]!==i.name?(l=t.jsx("span",{className:"font-medium text-sm truncate",children:i.name}),e[1]=i.name,e[2]=l):l=e[2];let o;e[3]!==i.bucket||e[4]!==i.region?(o=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[3]=i.bucket,e[4]=i.region,e[5]=o):o=e[5];let p;e[6]!==l||e[7]!==o?(p=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o]}),e[6]=l,e[7]=o,e[8]=p):p=e[8];let a;e[9]!==i.description?(a=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[9]=i.description,e[10]=a):a=e[10];let j;e[11]!==i.endpoint||e[12]!==i.forcePathStyle?(j=i.endpoint?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:[i.endpoint,i.forcePathStyle?" (path-style)":""]}):null,e[11]=i.endpoint,e[12]=i.forcePathStyle,e[13]=j):j=e[13];let h;e[14]!==i.prefix?(h=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[14]=i.prefix,e[15]=h):h=e[15];let c;e[16]!==i.publicUrlBase?(c=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[16]=i.publicUrlBase,e[17]=c):c=e[17];let d;e[18]!==p||e[19]!==a||e[20]!==j||e[21]!==h||e[22]!==c?(d=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[p,a,j,h,c]})]}),e[18]=p,e[19]=a,e[20]=j,e[21]=h,e[22]=c,e[23]=d):d=e[23];let g;e[24]!==i.createdAt?(g=new Date(i.createdAt).toLocaleDateString(),e[24]=i.createdAt,e[25]=g):g=e[25];let x;e[26]!==g?(x=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[26]=g,e[27]=x):x=e[27];let m;e[28]!==i||e[29]!==n?(m=()=>n(i),e[28]=i,e[29]=n,e[30]=m):m=e[30];const y=`Delete ${i.name}`;let f;e[31]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(T,{size:14}),e[31]=f):f=e[31];let u;e[32]!==m||e[33]!==y?(u=t.jsx(A,{variant:"ghost",size:"sm",onClick:m,"aria-label":y,children:f}),e[32]=m,e[33]=y,e[34]=u):u=e[34];let S;e[35]!==x||e[36]!==u?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[x,u]}),e[35]=x,e[36]=u,e[37]=S):S=e[37];let C;return e[38]!==S||e[39]!==d?(C=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[d,S]}),e[38]=S,e[39]=d,e[40]=C):C=e[40],C}function ue(s){const e=D.c(5),{onCreate:i}=s;let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:t.jsx($,{size:20,className:"text-muted-foreground"})}),r=t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-sm",children:"No buckets configured"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:"Add an S3-compatible bucket (AWS S3, Cloudflare R2, Google Cloud Storage, MinIO). Access keys are encrypted at rest and never returned over the API."})]}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(E,{size:14}),e[2]=l):l=e[2];let o;return e[3]!==i?(o=t.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[n,r,t.jsxs(A,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function B({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,p]=v.useState(""),[a,j]=v.useState(""),[h,c]=v.useState(""),[d,g]=v.useState(!1),[x,m]=v.useState(""),[y,f]=v.useState(""),[u,S]=v.useState(""),[C,w]=v.useState(""),F=oe();function R(){n(""),l(""),p(""),j(""),c(""),g(!1),m(""),f(""),S(""),w("")}async function z(b){if(b.preventDefault(),!(!i.trim()||!o.trim()||!a.trim())&&!(!u||!C))try{await F.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:a.trim(),endpoint:h.trim()||void 0,forcePathStyle:d,prefix:x.trim()||void 0,publicUrlBase:y.trim()||void 0,accessKeyId:u,secretAccessKey:C}),P.success(`Bucket "${i.trim()}" added`),R(),e(!1)}catch(I){P.error(de(I,"Failed to add bucket"))}}const U=F.isPending||!i.trim()||!o.trim()||!a.trim()||!u||!C;return t.jsx(V,{open:s,onOpenChange:e,children:t.jsxs(X,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(Y,{children:[t.jsx(Z,{children:"Add S3 bucket"}),t.jsx(ee,{children:"Credentials are encrypted at rest and never returned over the API. For Cloudflare R2, Google Cloud Storage, or MinIO, set a custom endpoint."})]}),t.jsxs("form",{onSubmit:z,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:b=>n(b.target.value),placeholder:"production-uploads",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Letters, digits, underscore, dot, hyphen. Unique within the organization."})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:b=>p(b.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:a,onChange:b=>j(b.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:h,onChange:b=>c(b.target.value),placeholder:"https://<account>.r2.cloudflarestorage.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Required for non-AWS providers (R2, GCS, MinIO)."})]}),t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border/60 p-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx(k,{htmlFor:"file-config-path-style",className:"text-sm",children:"Force path-style URLs"}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Required for Google Cloud Storage and most MinIO setups."})]}),t.jsx(se,{id:"file-config-path-style",checked:d,onCheckedChange:g})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:x,onChange:b=>m(b.target.value),placeholder:"tenants/acme/",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"All object keys are written under this prefix. Useful for multi-tenant buckets or credentials scoped to a sub-path. A trailing slash is added automatically."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:y,onChange:b=>f(b.target.value),placeholder:"https://pub-xxxx.r2.dev or https://cdn.example.com",autoComplete:"off"}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Host used to build public URLs returned by the picker (R2 dev domain, CDN, custom host). Leave blank to use the bucket's S3 host (AWS default)."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:u,onChange:b=>S(b.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:C,onChange:b=>w(b.target.value),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(k,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(re,{id:"file-config-description",value:r,onChange:b=>l(b.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(te,{children:[t.jsx(A,{type:"button",variant:"outline",onClick:()=>{R(),e(!1)},disabled:F.isPending,children:"Cancel"}),t.jsx(A,{type:"submit",disabled:U,children:F.isPending?"Adding…":"Add bucket"})]})]})]})})}function xe(s){const e=D.c(25),{config:i,onClose:n}=s,r=ae();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),P.success(`Bucket "${i.name}" removed`),n()}catch(S){const C=S;P.error(C instanceof Error?C.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,p=i!==null;let a;e[4]!==n?(a=u=>!u&&n(),e[4]=n,e[5]=a):a=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(G,{children:"Remove bucket configuration?"}),e[6]=j):j=e[6];const h=i?.name;let c;e[7]!==h?(c=t.jsxs(M,{children:[j,t.jsxs(W,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:h}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=h,e[8]=c):c=e[8];let d;e[9]!==r.isPending?(d=t.jsx(L,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=d):d=e[10];const g=r.isPending?"Removing…":"Remove";let x;e[11]!==r.isPending||e[12]!==o||e[13]!==g?(x=t.jsx(K,{onClick:o,disabled:r.isPending,children:g}),e[11]=r.isPending,e[12]=o,e[13]=g,e[14]=x):x=e[14];let m;e[15]!==d||e[16]!==x?(m=t.jsxs(H,{children:[d,x]}),e[15]=d,e[16]=x,e[17]=m):m=e[17];let y;e[18]!==m||e[19]!==c?(y=t.jsxs(J,{children:[c,m]}),e[18]=m,e[19]=c,e[20]=y):y=e[20];let f;return e[21]!==y||e[22]!==p||e[23]!==a?(f=t.jsx(Q,{open:p,onOpenChange:a,children:y}),e[21]=y,e[22]=p,e[23]=a,e[24]=f):f=e[24],f}function pe(){const s=D.c(25),e=le(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let f;s[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ue,{onCreate:()=>n(!0)}),s[0]=f):f=s[0];let u;return s[1]!==i?(u=t.jsxs(t.Fragment,{children:[f,t.jsx(B,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=u):u=s[2],u}const o=e.length===1?"":"s";let p;s[3]!==e.length||s[4]!==o?(p=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=p):p=s[5];let a;s[6]===Symbol.for("react.memo_cache_sentinel")?(a=()=>n(!0),s[6]=a):a=s[6];let j;s[7]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsxs(A,{onClick:a,size:"sm",children:[t.jsx(E,{size:14}),"Add bucket"]}),s[7]=j):j=s[7];let h;s[8]!==p?(h=t.jsxs("div",{className:"flex items-center justify-between",children:[p,j]}),s[8]=p,s[9]=h):h=s[9];let c;if(s[10]!==e){let f;s[12]===Symbol.for("react.memo_cache_sentinel")?(f=u=>t.jsx(fe,{config:u,onDelete:l},u.id),s[12]=f):f=s[12],c=e.map(f),s[10]=e,s[11]=c}else c=s[11];let d;s[13]!==c?(d=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:c})}),s[13]=c,s[14]=d):d=s[14];let g;s[15]!==i?(g=t.jsx(B,{open:i,onOpenChange:n}),s[15]=i,s[16]=g):g=s[16];let x;s[17]===Symbol.for("react.memo_cache_sentinel")?(x=()=>l(null),s[17]=x):x=s[17];let m;s[18]!==r?(m=t.jsx(xe,{config:r,onClose:x}),s[18]=r,s[19]=m):m=s[19];let y;return s[20]!==h||s[21]!==d||s[22]!==g||s[23]!==m?(y=t.jsxs(t.Fragment,{children:[h,d,g,m]}),s[20]=h,s[21]=d,s[22]=g,s[23]=m,s[24]=y):y=s[24],y}function he(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_,{children:t.jsx(_.Content,{children:t.jsx(_.Body,{children:t.jsxs(ne,{children:[e,t.jsx(q,{fallback:ge,children:t.jsx(v.Suspense,{fallback:t.jsx(ie,{className:"h-32 w-full"}),children:t.jsx(pe,{})})})]})})})}),s[1]=i):i=s[1],i}function ge(s){const{error:e}=s;return t.jsx(me,{error:e??new Error("Failed to load file configs")})}function We(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ce,{capability:"file-configs:manage",area:"files",children:t.jsx(he,{})}),s[0]=e):e=s[0],e}export{We as default};
|