decocms 4.29.0 → 4.30.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-CccbK4hX.js → AlertCircle-Npyn4_wF.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-BgdgTW8q.js → ArrowUpRight-zXVQKR-G.js} +1 -1
- package/dist/client/assets/{Check-WJIsHzDQ.js → Check-BxViL4rK.js} +1 -1
- package/dist/client/assets/{CheckCircle-CM68yWPW.js → CheckCircle-Cz4tJUop.js} +1 -1
- package/dist/client/assets/{ChevronDown-CAuaRLDM.js → ChevronDown-UniVHOcZ.js} +1 -1
- package/dist/client/assets/{ChevronRight-B7czck1y.js → ChevronRight-K3Ms28jw.js} +1 -1
- package/dist/client/assets/{ChevronUp-D-qnR_uM.js → ChevronUp-C_JF1YJx.js} +1 -1
- package/dist/client/assets/{Circle-KYXNByEA.js → Circle-iQbOlvwS.js} +1 -1
- package/dist/client/assets/{Copy01-gjq995Op.js → Copy01-Ctt9FUbb.js} +1 -1
- package/dist/client/assets/{DotsVertical-BVo4MRpu.js → DotsVertical-Cnet9a8h.js} +1 -1
- package/dist/client/assets/{Eye-Bn25ApPz.js → Eye-Bf8ySHj2.js} +1 -1
- package/dist/client/assets/{FilterLines-DaZCku74.js → FilterLines-DRa15Wby.js} +1 -1
- package/dist/client/assets/{Globe01-BwRmuR_8.js → Globe01-BCgVxayg.js} +1 -1
- package/dist/client/assets/{Globe04-9qIG4QhN.js → Globe04-BRhMXMEJ.js} +1 -1
- package/dist/client/assets/{HardDrive-BJOyfL1s.js → HardDrive-BaaJKDpq.js} +1 -1
- package/dist/client/assets/{Key01-CDa-PA-y.js → Key01-BvoJKmt1.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DNsGMIFw.js → LayoutLeft-Bsqu0rxT.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B-q2TCWq.js → LinkExternal01-bFRmolQv.js} +1 -1
- package/dist/client/assets/{List-CDS_Rmur.js → List-FyDw_upy.js} +1 -1
- package/dist/client/assets/{Loading02-Cv_WFApk.js → Loading02-wU_DDeXK.js} +1 -1
- package/dist/client/assets/{Monitor01-ChrDLGXa.js → Monitor01-rM21B5VM.js} +1 -1
- package/dist/client/assets/{Palette-CqqDm4G9.js → Palette-Bq3VPed6.js} +1 -1
- package/dist/client/assets/{Play-BLXO22JW.js → Play-Dqv3vBUr.js} +1 -1
- package/dist/client/assets/{Plus-CoqGiEoW.js → Plus-CIMT0C1M.js} +1 -1
- package/dist/client/assets/{SearchLg-BJoMxiDy.js → SearchLg-BqF-kB3a.js} +1 -1
- package/dist/client/assets/{SearchMd-YxzpYnNt.js → SearchMd-OCIrtgl8.js} +1 -1
- package/dist/client/assets/{Settings02-Dy5hRJWC.js → Settings02-CTtq6YOs.js} +1 -1
- package/dist/client/assets/{Shield01-Dg-emZom.js → Shield01-CCAMun7k.js} +1 -1
- package/dist/client/assets/{Star01-Bbn22eVo.js → Star01-Cw7wbAha.js} +1 -1
- package/dist/client/assets/{Stars01-0N0PIoFw.js → Stars01-CXkCYhyc.js} +1 -1
- package/dist/client/assets/{Stars02-XLaFEqA9.js → Stars02-C6DKWb0j.js} +1 -1
- package/dist/client/assets/{Sun-Cf2_RQhM.js → Sun-Cfq43Fjh.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-8YfzWW4j.js → SwitchHorizontal01-BSEQu0PJ.js} +1 -1
- package/dist/client/assets/{Tool01-CExdAfac.js → Tool01-woqhmM89.js} +1 -1
- package/dist/client/assets/{Trash01-2bgd5rb5.js → Trash01-DSTcxy5m.js} +1 -1
- package/dist/client/assets/{Upload01-Da0GcY9n.js → Upload01-DI1Xs1Z6.js} +1 -1
- package/dist/client/assets/{User01-DWmqguL8.js → User01-D-uDYDK0.js} +1 -1
- package/dist/client/assets/{Users01-qo0Pfdbq.js → Users01-DVmsZOTe.js} +1 -1
- package/dist/client/assets/{Users03-m0mGCSLF.js → Users03-DGDUIZF4.js} +1 -1
- package/dist/client/assets/{X-dW9CI9iO.js → X-DWrz2LqH.js} +1 -1
- package/dist/client/assets/{XCircle-BLHWvvQb.js → XCircle-JQbz9WmR.js} +1 -1
- package/dist/client/assets/{XClose-BsCsQOzu.js → XClose-CBrgKiaB.js} +1 -1
- package/dist/client/assets/{Zap-NxwXfCyT.js → Zap-NoORqLvM.js} +1 -1
- package/dist/client/assets/{ZapSquare-BllWW0jW.js → ZapSquare-RhqrJVTN.js} +1 -1
- package/dist/client/assets/{ZoomOut-6KFj5qIF.js → ZoomOut-nih9dlzQ.js} +1 -1
- package/dist/client/assets/{access-gate-uhjaq2Ab.js → access-gate-DW0Ym0X9.js} +1 -1
- package/dist/client/assets/{add-section-modal-WZYG5Z6d.js → add-section-modal-DgeyNgVY.js} +1 -1
- package/dist/client/assets/agent-capabilities-0FR5de0y.js +1 -0
- package/dist/client/assets/agent-icon-32aZu8f8.js +1 -0
- package/dist/client/assets/agents-list-C1UtH2E7.js +1 -0
- package/dist/client/assets/ai-providers-CNHaz-V2.js +1 -0
- package/dist/client/assets/{alert-ovMRS5yx.js → alert-D0cE0bpw.js} +1 -1
- package/dist/client/assets/{alert-dialog-DT6CiV3D.js → alert-dialog-DBrNjdaV.js} +3 -3
- package/dist/client/assets/app-editor-DVKTcnpY.js +1 -0
- package/dist/client/assets/{auth-D-3BenR-.js → auth-C9k5QFmE.js} +1 -1
- package/dist/client/assets/{auth-catchall-1c9sE0Q2.js → auth-catchall-EFYsuYup.js} +1 -1
- package/dist/client/assets/{auth-entry-CiJUVGSj.js → auth-entry-B7dEi3i4.js} +1 -1
- package/dist/client/assets/{auth-split-layout-RqSEL3ko.js → auth-split-layout-DAa980Aa.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-cOkcseWI.js → authenticate-and-persist-oauth-Dji-Zkvk.js} +1 -1
- package/dist/client/assets/{automation-list-row-DNZxP8s9.js → automation-list-row-DjnykZrH.js} +1 -1
- package/dist/client/assets/automation-runs-CyeVpPEA.js +188 -0
- package/dist/client/assets/automations-BRVTy0px.js +1 -0
- package/dist/client/assets/autosend-Lnw286aO.js +1 -0
- package/dist/client/assets/{avatar-D9dkHpvf.js → avatar-CVASN_n8.js} +1 -1
- package/dist/client/assets/{badge-C9YrQiOl.js → badge-DN1YW5R1.js} +1 -1
- package/dist/client/assets/{block-document-B3VgVdww.js → block-document-BMOnFuNo.js} +3 -3
- package/dist/client/assets/brand-context-BYp2uUo_.js +1 -0
- package/dist/client/assets/{breadcrumb-Bt63ruK5.js → breadcrumb-BylJDyxL.js} +1 -1
- package/dist/client/assets/buckets-ztIgzEwa.js +1 -0
- package/dist/client/assets/bulk-category-panel-D7ZYmK1J.js +1 -0
- package/dist/client/assets/{calendar-CVkRKG_3.js → calendar-ChXBpAOM.js} +1 -1
- package/dist/client/assets/capability-load-error-O4BtnIVr.js +1 -0
- package/dist/client/assets/{card-WdSE0wjZ.js → card-BYZEQBt8.js} +1 -1
- package/dist/client/assets/category-editor-C-eV-FDB.js +1 -0
- package/dist/client/assets/{chat-context-p7bQrjVO.js → chat-context-CCC-Byca.js} +5 -5
- package/dist/client/assets/{checkbox-Cf98ydrt.js → checkbox-C2WVbLnG.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CDfqoEnc.js → cli-auth-success-D7EMTP4Y.js} +1 -1
- package/dist/client/assets/collection-detail-CKc7ZkK-.js +1 -0
- package/dist/client/assets/{collection-display-button-DhAisvln.js → collection-display-button-oZx_AhoK.js} +1 -1
- package/dist/client/assets/{collection-search-CwfTIp5v.js → collection-search-i90jdNni.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-1Z0s75jM.js → collection-table-wrapper-BkqcRITg.js} +1 -1
- package/dist/client/assets/{collection-tabs-byFj2Ujd.js → collection-tabs-Bg1zR32u.js} +1 -1
- package/dist/client/assets/{command-Be3tajRL.js → command-D8e2ttGg.js} +1 -1
- package/dist/client/assets/commerce-onboarding-CUg63DGD.js +1 -0
- package/dist/client/assets/{connect-desktop-dialog-Af91UVe4.js → connect-desktop-dialog-CdtfQBg4.js} +1 -1
- package/dist/client/assets/{connection-card-CrmcBQ7w.js → connection-card-DGWh0T1M.js} +1 -1
- package/dist/client/assets/connection-detail-DG_Kwvgf.js +1 -0
- package/dist/client/assets/{connection-form-helpers-BEquM1Ke.js → connection-form-helpers-CvE1GCwU.js} +1 -1
- package/dist/client/assets/connections-CSSk2Lo7.js +1 -0
- package/dist/client/assets/constants-B72Xmt_K.js +1 -0
- package/dist/client/assets/{decopilot-sse-pool-wsz4kVX9.js → decopilot-sse-pool-CYJNLSex.js} +1 -1
- package/dist/client/assets/{dialog-DTR6Ld8R.js → dialog-wZUkxFBf.js} +1 -1
- package/dist/client/assets/{domain-settings-VmE96-t6.js → domain-settings-C-ClIsNf.js} +1 -1
- package/dist/client/assets/{drawer-tKmBK0sh.js → drawer-N4BBUwV9.js} +1 -1
- package/dist/client/assets/{dropdown-menu-D5GBwmj-.js → dropdown-menu-COQWVmxy.js} +1 -1
- package/dist/client/assets/{empty-state-Drp2V-gT.js → empty-state-BdREyKTx.js} +1 -1
- package/dist/client/assets/{extract-connection-data-hbWCHJzS.js → extract-connection-data-CguvuV8x.js} +1 -1
- package/dist/client/assets/file-explorer-DLrJ1FmW.js +2 -0
- package/dist/client/assets/{file-type-icon-ByfDUgJ1.js → file-type-icon-BEeYBjMh.js} +1 -1
- package/dist/client/assets/{files-CTG0VhhM.js → files-OSCRmAjy.js} +1 -1
- package/dist/client/assets/{form-Bdg2md6z.js → form-D4Sjj2S5.js} +1 -1
- package/dist/client/assets/general-EnRn7dAf.js +1 -0
- package/dist/client/assets/get-initials-D-f_fDFw.js +1 -0
- package/dist/client/assets/github-repo-picker-pjUsTLC6.js +1 -0
- package/dist/client/assets/{hooks-355Y2AQ-.js → hooks-RNhoO-Id.js} +6 -6
- package/dist/client/assets/{index-Fc19vagy.js → index-4ttWqKAk.js} +1 -1
- package/dist/client/assets/{index-Cg7efYOu.js → index-BGWTtZfz.js} +3 -3
- package/dist/client/assets/index-BYSbf1og.css +1 -0
- package/dist/client/assets/{index-D_fQ3aMM.js → index-BjUL_v0d.js} +1 -1
- package/dist/client/assets/index-C3s6kNZf.js +1 -0
- package/dist/client/assets/{index-C4qtLNrN.js → index-D6_eTKF9.js} +1 -1
- package/dist/client/assets/index-D8BXYXaV.js +1 -0
- package/dist/client/assets/index-DJ-AVzEz.js +519 -0
- package/dist/client/assets/{index-thaZU0eY.js → index-DcsErluY.js} +4 -4
- package/dist/client/assets/{index-ceQxuMuP.js → index-E0XzXtgq.js} +1 -1
- package/dist/client/assets/index-HmjC0l60.js +1 -0
- package/dist/client/assets/{index-Kblv4kfs.js → index-NrynAfgx.js} +3 -3
- package/dist/client/assets/{index-CbcN0I3P.js → index-Q0mE9w5a.js} +3 -3
- package/dist/client/assets/{index-BlDaAy7Z.js → index-etRGW8hR.js} +1 -1
- package/dist/client/assets/{index-redirect-BkSJGF9m.js → index-redirect-CtWijNin.js} +1 -1
- package/dist/client/assets/{index-Ci3919Ge.js → index-tYXe55yO.js} +1 -1
- package/dist/client/assets/{input-DEr8h15j.js → input-BLUXQaUJ.js} +1 -1
- package/dist/client/assets/{integration-icon-zZ56Ie6s.js → integration-icon-BJkk8MWl.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-QdQZxiP_.js → invite-member-dialog-CzBp_hgb.js} +2 -2
- package/dist/client/assets/{label-D9vlZKHj.js → label-CW0QYigh.js} +1 -1
- package/dist/client/assets/{login-QcZ5VwBL.js → login-BzT7SutG.js} +1 -1
- package/dist/client/assets/{mcp-oauth-HycnBVan.js → mcp-oauth-DkjiGs3f.js} +1 -1
- package/dist/client/assets/members-B-nTZKqd.js +1 -0
- package/dist/client/assets/monaco-editor-CxptfxHs.js +9 -0
- package/dist/client/assets/{monitoring-stats-row-CLjCs61g.js → monitoring-stats-row-BCom1l-r.js} +1 -1
- package/dist/client/assets/{oauth-callback-DmZkA-1Y.js → oauth-callback-BrnloLXP.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-qrMHndxu.js → oauth-callback-ai-provider-Gf3ErLGK.js} +1 -1
- package/dist/client/assets/{onboarding-D8Oj280h.js → onboarding-Bijoo7hh.js} +1 -1
- package/dist/client/assets/org-install-0y09LTw4.js +1 -0
- package/dist/client/assets/{org-layout-BdivmG72.js → org-layout-BnSZ4nrA.js} +1 -1
- package/dist/client/assets/{organization-choice-CNTMS9Qo.js → organization-choice-B0E5mbjx.js} +1 -1
- package/dist/client/assets/page-seo-form-Bgz7kJhB.js +1 -0
- package/dist/client/assets/page-seo-sheet-Ct29Vhus.js +1 -0
- package/dist/client/assets/{popover-BH74zFmN.js → popover-jVjMjIDj.js} +1 -1
- package/dist/client/assets/post-editor-BfRHhvGn.js +1 -0
- package/dist/client/assets/primitives-DaPu5vgv.js +1 -0
- package/dist/client/assets/profile-DclYxTny.js +1 -0
- package/dist/client/assets/project-app-view-BQBZobZ4.js +1 -0
- package/dist/client/assets/record-editor-BX1EoYMz.js +1 -0
- package/dist/client/assets/registry-BdbdSSDR.js +2 -0
- package/dist/client/assets/{registry-layout-BdxpZi19.js → registry-layout-BUFv94Wc.js} +1 -1
- package/dist/client/assets/{require-capability-bBFf7mtX.js → require-capability-gZyrOy_G.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DiYJUK17.js → required-auth-layout-CCig7BsQ.js} +1 -1
- package/dist/client/assets/{reset-password-Ws1sdfXL.js → reset-password-A6TbChyi.js} +1 -1
- package/dist/client/assets/reusable-new-chat-qqWu133U.js +1 -0
- package/dist/client/assets/roles-BW9vWvMW.js +1 -0
- package/dist/client/assets/{search-input-DLqCE5vh.js → search-input-5RFJsKB6.js} +1 -1
- package/dist/client/assets/secrets-T5w0qVnI.js +1 -0
- package/dist/client/assets/sections-editor-1RxueHws.js +2 -0
- package/dist/client/assets/{select-fd5CQiLd.js → select-GP-G7CYY.js} +1 -1
- package/dist/client/assets/select-model-Hh0vuEIf.js +4 -0
- package/dist/client/assets/seo-editor-BOaZSdYe.js +1 -0
- package/dist/client/assets/settings-layout-CQB5hLJw.js +1 -0
- package/dist/client/assets/{settings-section-C4B_agjR.js → settings-section-BN93dKeu.js} +1 -1
- package/dist/client/assets/shell-controls-Tu95tJS5.js +1 -0
- package/dist/client/assets/shell-layout-BktipYXq.js +1 -0
- package/dist/client/assets/sidebar-BjPm3XPY.js +1 -0
- package/dist/client/assets/{skeleton-Cz4bac5f.js → skeleton-CXWh_vT2.js} +1 -1
- package/dist/client/assets/sso-B36X_9Kv.js +1 -0
- package/dist/client/assets/store-Lh1RLabm.js +1 -0
- package/dist/client/assets/store-registry-CZQ9oZKe.js +2 -0
- package/dist/client/assets/{studio-tools-C88q8wAb.js → studio-tools-ajGrecV2.js} +1 -1
- package/dist/client/assets/{switch-Dg1aulpi.js → switch-C6ORwIf0.js} +1 -1
- package/dist/client/assets/tab-id-yjGvxWDL.js +1 -0
- package/dist/client/assets/{table-Z9PtYtMe.js → table-DyVNd3lx.js} +1 -1
- package/dist/client/assets/{tabs-BJWmaLw8.js → tabs-BbeJw3E0.js} +1 -1
- package/dist/client/assets/{textarea-DEWiELfd.js → textarea-CjjAiaC_.js} +1 -1
- package/dist/client/assets/{toggle-group-CvC6sjCU.js → toggle-group-CBKef6if.js} +1 -1
- package/dist/client/assets/toolbar-BS4jP5VP.js +1 -0
- package/dist/client/assets/{toolbar-icon-button-b0ekhhMY.js → toolbar-icon-button-aR9nKvjU.js} +1 -1
- package/dist/client/assets/tools-list-yY8qipR7.js +1 -0
- package/dist/client/assets/tooltip-CX8JDN5z.js +1 -0
- package/dist/client/assets/{types-BL5SG5y5.js → types-B4pxnIIx.js} +1 -1
- package/dist/client/assets/{use-ai-providers-C9ok3iTv.js → use-ai-providers-BFYpQ3Dm.js} +1 -1
- package/dist/client/assets/{use-automations-BGAQUfh0.js → use-automations-D2Y3aBGO.js} +1 -1
- package/dist/client/assets/{use-capability-DUO16Em8.js → use-capability-rVzvcxKr.js} +1 -1
- package/dist/client/assets/use-clock-tick-BZ0iPGQL.js +1 -0
- package/dist/client/assets/use-collections-Dkob9Q0i.js +1 -0
- package/dist/client/assets/{use-connection-DV6jfeKV.js → use-connection-BHlBIpYJ.js} +1 -1
- package/dist/client/assets/{use-copy--Yb2hvIV.js → use-copy-CQkPNAJi.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BRs1YEXm.js → use-create-virtual-mcp-Cpq2-1Qg.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-B2imKI8J.js → use-debounced-autosave-C0n83t9Y.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Dk3ZHqhr.js → use-debounced-value-HI4UvLEV.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-CdGe1kZY.js → use-decopilot-events-qPFbeAuK.js} +1 -1
- package/dist/client/assets/{use-delete-connection-YECi64fi.js → use-delete-connection-Pr4HXWhs.js} +1 -1
- package/dist/client/assets/{use-file-configs-D99FvcSf.js → use-file-configs-Bwgj83CL.js} +1 -1
- package/dist/client/assets/use-infinite-scroll-gRuFiDfW.js +1 -0
- package/dist/client/assets/{use-join-requests-KOCEnQ4v.js → use-join-requests-qOUGOtoj.js} +1 -1
- package/dist/client/assets/{use-mcp-client-B7zSFiOA.js → use-mcp-client-x-H3hM3X.js} +2 -2
- package/dist/client/assets/{use-mcp-prompts-BMNQ61Xi.js → use-mcp-prompts-CB2--qfn.js} +1 -1
- package/dist/client/assets/use-mcp-tools-BAOkrTmg.js +1 -0
- package/dist/client/assets/{use-members-ItYzCRBH.js → use-members-BAUKU0t0.js} +1 -1
- package/dist/client/assets/{use-mobile-B23FisN_.js → use-mobile-BNK4ZQXQ.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-B2zjxakj.js +1 -0
- package/dist/client/assets/{use-org-auth-client-CW518BNQ.js → use-org-auth-client-CT6ie6N1.js} +1 -1
- package/dist/client/assets/{use-org-sso-BCol3dQF.js → use-org-sso-DIb9lRy0.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DCgs3HLS.js → use-organization-roles-bMxDWnEc.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CtWuj0-0.js → use-organization-settings-QG8fys4M.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BfySsVRx.js → use-registry-connections-BvC5yqnv.js} +1 -1
- package/dist/client/assets/{use-secrets-KLMNhfAU.js → use-secrets-BUi_Va3F.js} +1 -1
- package/dist/client/assets/use-status-sounds-DV61EqQ3.js +1 -0
- package/dist/client/assets/{use-view-mode-DMcqNC4z.js → use-view-mode-BaQ_SNlr.js} +1 -1
- package/dist/client/assets/use-virtual-mcp-zN_q3qUT.js +1 -0
- package/dist/client/assets/useInfiniteQuery-W1abYeKO.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DTvKBZgn.js +1 -0
- package/dist/client/assets/variant-calendar-N7_o0k3x.js +1 -0
- package/dist/client/assets/{view-mode-toggle-oOb_3dux.js → view-mode-toggle-RdEYDkk_.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +313 -299
- package/dist/server/server.js +3 -3
- package/package.json +1 -1
- package/dist/client/assets/agent-capabilities-CUZgw2cK.js +0 -1
- package/dist/client/assets/agent-icon-8-zG6zq2.js +0 -1
- package/dist/client/assets/agents-list-NUEvPqtn.js +0 -1
- package/dist/client/assets/ai-providers-BdzkA6Ng.js +0 -1
- package/dist/client/assets/app-editor-DejM0aC5.js +0 -1
- package/dist/client/assets/automation-runs-DHORxp2E.js +0 -1
- package/dist/client/assets/automations-iHJIY2kp.js +0 -1
- package/dist/client/assets/brand-context-IlEjmRnX.js +0 -1
- package/dist/client/assets/buckets-DMOBdFu1.js +0 -1
- package/dist/client/assets/bulk-category-panel-BZWcVa6f.js +0 -1
- package/dist/client/assets/capability-load-error-mGRKLuE9.js +0 -1
- package/dist/client/assets/category-editor-B3O-6esM.js +0 -1
- package/dist/client/assets/collection-detail-Bb_s_e4f.js +0 -1
- package/dist/client/assets/commerce-onboarding-CeoQUmzc.js +0 -1
- package/dist/client/assets/connection-detail-ox7hONrA.js +0 -1
- package/dist/client/assets/connections-51GGeElE.js +0 -1
- package/dist/client/assets/constants-nH3qQ_1f.js +0 -1
- package/dist/client/assets/content-blocks-o63cs2vh.js +0 -1
- package/dist/client/assets/decopilot-Dj817txh.js +0 -4
- package/dist/client/assets/file-explorer-C432wWS3.js +0 -2
- package/dist/client/assets/general-DivwX3J2.js +0 -1
- package/dist/client/assets/github-repo-picker-BxPl8GNJ.js +0 -1
- package/dist/client/assets/index-5uzKO7q6.css +0 -1
- package/dist/client/assets/index-CwBtGV9W.js +0 -1
- package/dist/client/assets/index-DEtQBmLd.js +0 -1
- package/dist/client/assets/index-J9x3nT2B.js +0 -1
- package/dist/client/assets/index-OMZJdpqB.js +0 -513
- package/dist/client/assets/library-tab-dvlvVDBE.js +0 -7
- package/dist/client/assets/members-CKTHo3ec.js +0 -1
- package/dist/client/assets/monaco-editor-BfF7h5UL.js +0 -9
- package/dist/client/assets/org-install-LOUQXIPf.js +0 -1
- package/dist/client/assets/page-seo-form-W66oNzJN.js +0 -1
- package/dist/client/assets/page-seo-sheet-DQCQahYb.js +0 -1
- package/dist/client/assets/post-editor-BBupRkar.js +0 -1
- package/dist/client/assets/primitives-DCgBLYjb.js +0 -1
- package/dist/client/assets/profile-BCEngRby.js +0 -1
- package/dist/client/assets/project-app-view-BcPFuDsb.js +0 -1
- package/dist/client/assets/record-editor-IbXR53df.js +0 -1
- package/dist/client/assets/registry-C4jGqOi2.js +0 -2
- package/dist/client/assets/roles-B2mvqEQY.js +0 -1
- package/dist/client/assets/scroll-area-urNhBz-2.js +0 -188
- package/dist/client/assets/secrets-CxNuqWmn.js +0 -1
- package/dist/client/assets/sections-editor-D1IVqSOH.js +0 -2
- package/dist/client/assets/select-model-lznBUFcI.js +0 -1
- package/dist/client/assets/seo-editor-CU14ORD4.js +0 -1
- package/dist/client/assets/settings-layout-CX96yOJ5.js +0 -1
- package/dist/client/assets/sheet-C-KllyIc.js +0 -1
- package/dist/client/assets/shell-controls-BQwbtCrf.js +0 -1
- package/dist/client/assets/shell-layout-BnoAEqpd.js +0 -1
- package/dist/client/assets/sidebar-DSPYyChk.js +0 -1
- package/dist/client/assets/sso-DPkIABsj.js +0 -1
- package/dist/client/assets/store-C2QekUWt.js +0 -1
- package/dist/client/assets/store-registry-Da4NJevx.js +0 -2
- package/dist/client/assets/tab-id-Bgchl1bv.js +0 -1
- package/dist/client/assets/task-row-BPMcTFbK.js +0 -1
- package/dist/client/assets/task-status-pzbr--Ml.js +0 -1
- package/dist/client/assets/toolbar-Cs8I9yhI.js +0 -1
- package/dist/client/assets/tools-list-D8G7Mcid.js +0 -1
- package/dist/client/assets/tooltip-D9_AyRKs.js +0 -1
- package/dist/client/assets/use-clock-tick-Cr8Z09wV.js +0 -1
- package/dist/client/assets/use-collections-BLTNEY6D.js +0 -1
- package/dist/client/assets/use-infinite-scroll-CCgHyhHc.js +0 -1
- package/dist/client/assets/use-mcp-tools-CXGlYiLZ.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-ChQTAqDN.js +0 -1
- package/dist/client/assets/use-status-sounds-QZH24TPY.js +0 -1
- package/dist/client/assets/use-virtual-mcp-BplbsFwA.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Deh6Q8fX.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cx1a_TEJ.js +0 -1
- package/dist/client/assets/useSuspenseQueries-B5d682yj.js +0 -1
- package/dist/client/assets/variant-calendar-CqjIGqTb.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ie,j as s,B as Q,D as de,m as fe,a as he,r as q,k as ge,K as te,d as xe,v as $,t as se,l as je}from"./index-thaZU0eY.js";import{c as W,D as me,b as oe,a as ne}from"./dropdown-menu-D5GBwmj-.js";import{a as be}from"./Users03-m0mGCSLF.js";import{a as ue,b as Ce,u as ye,p as we,G as _e}from"./github-repo-picker-BxPl8GNJ.js";import{u as Ne,b as Se,c as ve}from"./use-virtual-mcp-BplbsFwA.js";import{P as Z}from"./index-Fc19vagy.js";import{i as Ie}from"./DotsVertical-BVo4MRpu.js";import{a as De,b as Ee}from"./Settings02-Dy5hRJWC.js";import{s as Ae}from"./Trash01-2bgd5rb5.js";import{A as Te,az as ke}from"./agent-icon-8-zG6zq2.js";import{u as pe}from"./use-navigate-to-agent-ChQTAqDN.js";import{C as Le}from"./card-WdSE0wjZ.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as Ge}from"./use-capability-DUO16Em8.js";import{E as Oe}from"./empty-state-Drp2V-gT.js";import{u as ze}from"./use-create-virtual-mcp-BRs1YEXm.js";import{u as Pe}from"./use-connection-DV6jfeKV.js";import{u as le}from"./use-mcp-client-B7zSFiOA.js";import{S as Me}from"./constants-nH3qQ_1f.js";import{f as $e,a as He}from"./github-installations-DzN1UQ4x.js";import{e as Re,d as Fe,c as Ue,a as Be,D as Ve}from"./dialog-DTR6Ld8R.js";import{C as Ke}from"./collection-search-CwfTIp5v.js";import{c as qe,b as Qe,d as Je,A as We,e as Ye,g as Xe,a as Ze,f as et}from"./alert-dialog-DT6CiV3D.js";import{S as tt}from"./search-input-DLqCE5vh.js";import{s as ae}from"./Plus-CoqGiEoW.js";import"./Check-WJIsHzDQ.js";import"./ChevronRight-B7czck1y.js";import"./Circle-KYXNByEA.js";import"./checkbox-Cf98ydrt.js";import"./use-debounced-value-Dk3ZHqhr.js";import"./authenticate-and-persist-oauth-cOkcseWI.js";import"./mcp-oauth-HycnBVan.js";import"./auth-D-3BenR-.js";import"./use-mcp-tools-CXGlYiLZ.js";import"./extract-connection-data-hbWCHJzS.js";import"./use-collections-BLTNEY6D.js";import"./sidebar-DSPYyChk.js";import"./LayoutLeft-DNsGMIFw.js";import"./use-mobile-B23FisN_.js";import"./sheet-C-KllyIc.js";import"./X-dW9CI9iO.js";import"./tooltip-D9_AyRKs.js";import"./AlertCircle-CccbK4hX.js";import"./Tool01-CExdAfac.js";import"./SwitchHorizontal01-8YfzWW4j.js";import"./XCircle-BLHWvvQb.js";import"./ArrowUpRight-BgdgTW8q.js";import"./ZapSquare-BllWW0jW.js";import"./Loading02-Cv_WFApk.js";import"./CheckCircle-CM68yWPW.js";import"./ChevronDown-CAuaRLDM.js";import"./ChevronUp-D-qnR_uM.js";import"./Stars02-XLaFEqA9.js";import"./Copy01-gjq995Op.js";import"./ZoomOut-6KFj5qIF.js";import"./Globe01-BwRmuR_8.js";import"./Eye-Bn25ApPz.js";import"./FilterLines-DaZCku74.js";import"./Star01-Bbn22eVo.js";import"./Globe04-9qIG4QhN.js";import"./HardDrive-BJOyfL1s.js";import"./Key01-CDa-PA-y.js";import"./LinkExternal01-B-q2TCWq.js";import"./List-CDS_Rmur.js";import"./Monitor01-ChrDLGXa.js";import"./Sun-Cf2_RQhM.js";import"./Palette-CqqDm4G9.js";import"./Play-BLXO22JW.js";import"./SearchLg-BJoMxiDy.js";import"./SearchMd-YxzpYnNt.js";import"./Shield01-Dg-emZom.js";import"./Stars01-0N0PIoFw.js";import"./Upload01-Da0GcY9n.js";import"./User01-DWmqguL8.js";import"./Users01-qo0Pfdbq.js";import"./XClose-BsCsQOzu.js";import"./Zap-NxwXfCyT.js";import"./differenceInSeconds-NQ4PDo0z.js";function ce(t){const e=ie.c(19),{onCreateFromScratch:n,onImportGitHub:i,onImportDeco:c,isCreating:C,align:y,side:d,showBetaBadge:g}=t,w=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(be,{size:14}),e[0]=x):x=e[0];let m;e[1]!==C||e[2]!==n?(m=s.jsxs(W,{disabled:C,onClick:n,children:[x,"Create from scratch"]}),e[1]=C,e[2]=n,e[3]=m):m=e[3];let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx(ue,{className:"size-3.5"}),e[4]=p):p=e[4];let l;e[5]!==g?(l=g&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[5]=g,e[6]=l):l=e[6];let f;e[7]!==i||e[8]!==l?(f=s.jsxs(W,{onClick:i,children:[p,"Import from GitHub",l]}),e[7]=i,e[8]=l,e[9]=f):f=e[9];let a;e[10]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[10]=a):a=e[10];let r;e[11]!==c?(r=s.jsxs(W,{onClick:c,children:[a,"Import from deco.cx"]}),e[11]=c,e[12]=r):r=e[12];let u;return e[13]!==w||e[14]!==d||e[15]!==m||e[16]!==f||e[17]!==r?(u=s.jsxs(me,{side:d,align:w,className:"w-48",children:[m,f,r]}),e[13]=w,e[14]=d,e[15]=m,e[16]=f,e[17]=r,e[18]=u):u=e[18],u}function st(t){const e=ie.c(45),{project:n,lastUsedAt:i,onDeleteClick:c}=t,C=pe();let y;e[0]!==C||e[1]!==n.id?(y=()=>C(n.id),e[0]=C,e[1]=n.id,e[2]=y):y=e[2];let d;e[3]!==n.title||e[4]!==y?(d=s.jsx("button",{type:"button",onClick:y,className:"absolute inset-0 z-0","aria-label":n.title}),e[3]=n.title,e[4]=y,e[5]=d):d=e[5];let g;e[6]!==n.icon||e[7]!==n.title?(g=s.jsx(Te,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=n.icon,e[7]=n.title,e[8]=g):g=e[8];let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=s.jsx(oe,{asChild:!0,children:s.jsx(Q,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(Ie,{size:20})})}),e[9]=w):w=e[9];let x;e[10]!==C||e[11]!==n.id?(x=()=>C(n.id,{search:{main:"settings"}}),e[10]=C,e[11]=n.id,e[12]=x):x=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(De,{size:16}),e[13]=m):m=e[13];let p;e[14]!==x?(p=s.jsxs(W,{onClick:x,children:[m,"Settings"]}),e[14]=x,e[15]=p):p=e[15];let l;e[16]!==c?(l=c&&s.jsxs(W,{variant:"destructive",onClick:G=>{G.stopPropagation(),c(G)},children:[s.jsx(Ae,{size:16}),"Delete"]}),e[16]=c,e[17]=l):l=e[17];let f;e[18]!==p||e[19]!==l?(f=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(ne,{children:[w,s.jsxs(me,{align:"end",children:[p,l]})]})}),e[18]=p,e[19]=l,e[20]=f):f=e[20];let a;e[21]!==g||e[22]!==f?(a=s.jsxs("div",{className:"flex items-start justify-between",children:[g,f]}),e[21]=g,e[22]=f,e[23]=a):a=e[23];let r;e[24]!==n.title?(r=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[24]=n.title,e[25]=r):r=e[25];const u=n.description||"No description";let I;e[26]!==u?(I=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:u}),e[26]=u,e[27]=I):I=e[27];let D;e[28]!==r||e[29]!==I?(D=s.jsxs("div",{className:"flex flex-col gap-1",children:[r,I]}),e[28]=r,e[29]=I,e[30]=D):D=e[30];let _;e[31]!==a||e[32]!==D?(_=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[a,D]}),e[31]=a,e[32]=D,e[33]=_):_=e[33];let T;e[34]!==i||e[35]!==n.updated_at?(T=i?`Last used ${re(new Date(i),{addSuffix:!0})}`:`Updated ${re(new Date(n.updated_at),{addSuffix:!0})}`,e[34]=i,e[35]=n.updated_at,e[36]=T):T=e[36];let N;e[37]!==T?(N=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[37]=T,e[38]=N):N=e[38];let k;e[39]!==_||e[40]!==N?(k=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[_,N]}),e[39]=_,e[40]=N,e[41]=k):k=e[41];let S;return e[42]!==k||e[43]!==d?(S=s.jsxs(Le,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[d,k]}),e[42]=k,e[43]=d,e[44]=S):S=e[44],S}const ot="deco-sites";function nt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const n=e.owner,i=e.repo;return typeof n!="string"||typeof i!="string"||n.length===0||i.length===0?null:{owner:n,repo:i}}function it(t,e){const n=e?nt(e):null,i=n?.owner??ot,c=n?.repo??t;return{owner:i,name:c,url:`https://github.com/${i}/${c}`}}function rt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function lt(t){const e=await fetch(`/api/${t}/deco-sites`);if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Failed to load sites (${e.status})`)}return e.json()}function at({open:t,onOpenChange:e,onBack:n}){const{org:i}=de(),c=pe(),C=fe(),{data:y}=he.useSession(),[d,g]=q.useState(null),[w,x]=q.useState(null),[m,p]=q.useState(""),l=le({connectionId:Me,orgId:i.id,orgSlug:i.slug}),f=Pe({slug:"mcp-github"}),a=Ce(f),r=ye({enabled:t&&a.length===0}),u=a.length===1?a[0]??null:w,I=a.length>1&&!u,D=le({connectionId:u?.id??"",orgId:i.id,orgSlug:i.slug}),_=t&&a.length===0&&(r.status==="installing"||r.status==="authenticating"||r.status==="idle"),{data:T,isLoading:N,error:k}=ge({queryKey:te.decoSites(y?.user?.email),queryFn:()=>lt(i.slug),enabled:t&&!!y?.user?.email,staleTime:6e4,retry:!1}),S=T?.sites??[],G=o=>{o||(g(null),x(null),p("")),e(o)},z=S.filter(o=>o.name.toLowerCase().includes(m.toLowerCase())||(o.domains?.[0]?.domain?.toLowerCase().includes(m.toLowerCase())??!1)),R=!d||z.some(o=>o.name===d),O=xe({mutationFn:async o=>{if(!u)throw new Error("GitHub is not connected. Complete GitHub setup and try again.");$("deco_site_import_started",{site_name:o});const{installations:L,appSlug:v}=await $e(b=>l.callTool(b),u.id),E=S.find(b=>b.name===o);if(!E)throw new Error("Selected site is no longer available");const j=it(o,E.metadata),P=He(L,j.owner);if(!P){const b=v?`https://github.com/apps/${v}/installations/new`:"https://github.com/settings/installations";throw new Error(`Install the GitHub App on the "${j.owner}" organization to import this site. ${b}`)}let V=null,F=null,U=null;const J=async()=>{U&&await l.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:U}}).catch(()=>{}),F&&await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:F,force:!0}}).catch(()=>{}),V&&await l.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:V,force:!0}}).catch(()=>{})};try{const b=await fetch(`/api/${i.slug}/deco-sites/connection`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:o})}),B=await b.json().catch(()=>({}));if(!b.ok)throw new Error(B.error??`Failed to create connection (${b.status})`);const A=B.connId;if(!A)throw new Error("Server did not return a connection ID");V=A;const{childConnectionId:M}=await we({orgSlug:i.slug,sourceConnection:u,installationId:P.installationId,owner:j.owner,repo:j.name,githubCallTool:ee=>D.callTool(ee),selfCallTool:ee=>l.callTool(ee)});F=M;const H=B.icon??null,K=rt(o),h=o.toLowerCase(),Y=await l.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:o,description:"Imported from deco.cx",pinned:!1,icon:H??null,subtype:"project",metadata:{instructions:null,enabled_plugins:[],siteSlug:h,githubRepo:{owner:j.owner,name:j.name,url:j.url,installationId:P.installationId,connectionId:M},ui:{banner:null,bannerColor:"#22C55E",icon:H,themeColor:"#22C55E",slug:K,pinnedViews:[{connectionId:A,toolName:"fetch_assets",label:"Assets",icon:null},{connectionId:A,toolName:"get_monitor_data",label:"Monitor",icon:null}],layout:{defaultMainView:{type:"preview"},chatDefaultOpen:!0}}},connections:[{connection_id:A},{connection_id:M}]}}}),X=Y.structuredContent??Y;if(!X.item?.id)throw new Error("Failed to create the imported agent");return U=X.item.id,{slug:K,virtualMcpId:X.item.id,connId:A,item:X.item}}catch(b){throw await J(),b}},onSuccess:({slug:o,virtualMcpId:L,item:v})=>{$("deco_site_import_succeeded",{site_name:v.title,virtual_mcp_id:L,slug:o}),C.setQueryData(te.collectionItem(l,i.id,"","VIRTUAL_MCP",L),{item:v}),C.invalidateQueries({predicate:E=>{const j=E.queryKey;return j[1]===i.id&&j[3]==="collection"&&j[4]==="VIRTUAL_MCP"}}),C.invalidateQueries({queryKey:te.projects(i.id)}),se.success(`Imported ${o} from deco.cx`),G(!1),localStorage.setItem("mesh:sidebar-open",JSON.stringify(!1)),c(L)},onError:o=>{$("deco_site_import_failed",{error:o instanceof Error?o.message:"Unknown error"}),se.error("Import failed: "+(o instanceof Error?o.message:"Unknown error"))}});return s.jsx(Re,{open:t,onOpenChange:G,children:s.jsxs(Fe,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[s.jsx(Ue,{className:"sr-only",children:s.jsx(Be,{children:"Import from deco.cx"})}),s.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[n&&s.jsx("button",{type:"button",onClick:n,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":"Go back",children:s.jsx(Ee,{size:18})}),s.jsx("span",{className:"text-sm font-medium text-foreground",children:"Import from deco.cx"})]}),s.jsx("div",{children:s.jsx(Ke,{value:m,onChange:p,placeholder:"Search sites...",onKeyDown:o=>{o.key==="Escape"&&p("")}})}),s.jsxs("div",{className:"pb-0 min-h-[300px]",children:[r.status==="error"&&s.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[s.jsx("p",{className:"text-sm text-destructive",children:r.error??"Failed to connect GitHub"}),s.jsx(Q,{variant:"outline",size:"sm",onClick:r.retry,children:"Retry GitHub setup"})]}),_&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Setting up GitHub connection..."}),I&&!_&&r.status!=="error"&&s.jsxs("div",{className:"flex flex-col py-2",children:[s.jsx("div",{className:"px-8 py-2",children:s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Select a GitHub connection"})}),a.map(o=>s.jsxs("button",{type:"button",onClick:()=>x(o),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[o.icon?s.jsx("img",{src:o.icon,alt:o.title,className:"size-7 rounded-full shrink-0"}):s.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:s.jsx(ue,{className:"size-3.5 text-muted-foreground"})}),s.jsx("span",{className:"text-sm font-medium",children:o.title})]},o.id))]}),N&&!_&&r.status!=="error"&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"Loading sites..."}),!N&&!_&&!I&&r.status!=="error"&&!k&&S.length===0&&s.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:"No sites found for this account."}),!N&&!_&&!I&&r.status!=="error"&&S.length>0&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[z.length===0&&s.jsxs("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:["No sites match “",m,"”"]}),z.map(o=>{const L=o.domains?.find(E=>E.production)?.domain??o.domains?.[0]?.domain,v=d===o.name;return s.jsxs("button",{type:"button",onClick:()=>g(o.name),className:je("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",v?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[s.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:o.thumb_url?s.jsx("img",{src:o.thumb_url,alt:o.name,className:"w-full h-full object-cover",loading:"lazy"}):s.jsx("div",{className:"w-full h-full bg-muted"})}),s.jsxs("div",{className:"px-4 py-3",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:o.name}),L&&s.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:L})]})]},o.name)})]})]}),s.jsxs(Ve,{className:"px-8 py-5 border-t border-border",children:[s.jsx(Q,{variant:"outline",onClick:()=>G(!1),disabled:O.isPending,children:"Cancel"}),s.jsx(Q,{disabled:!d||!R||O.isPending||N||_||I||!u||r.status==="error",onClick:()=>d&&O.mutate(d),children:O.isPending?"Importing...":"Import"})]})]})})}function Gs(){const t=ie.c(46),{org:e}=de(),n=Ne(),i=Se(),[c,C]=q.useState("");let y;t[0]===Symbol.for("react.memo_cache_sentinel")?(y={navigateOnCreate:!0},t[0]=y):y=t[0];const{createVirtualMCP:d,isCreating:g}=ze(y),[w,x]=q.useState(null),[m,p]=q.useState(!1),[l,f]=q.useState(!1),{granted:a}=Ge("agents:manage"),r=c.toLowerCase(),u=n.filter(h=>h.id!==e.id&&(h.title.toLowerCase().includes(r)||h.description?.toLowerCase().includes(r))),{data:I}=ve(u.map(ct));let D;t[1]!==i||t[2]!==w?(D=async()=>{if(!w)return;const{id:h,title:Y}=w;x(null);try{await i.delete.mutateAsync(h),$("agent_deleted",{agent_id:h,source:"agents_list"}),se.success(`Deleted "${Y}"`)}catch{}},t[1]=i,t[2]=w,t[3]=D):D=t[3];const _=D,T=Z,N=Z,k=Z;let S;t[4]===Symbol.for("react.memo_cache_sentinel")?(S=s.jsx(Z.Title,{children:"Agents"}),t[4]=S):S=t[4];let G;t[5]===Symbol.for("react.memo_cache_sentinel")?(G=h=>{h.key==="Escape"&&(C(""),h.target.blur())},t[5]=G):G=t[5];let z;t[6]!==c?(z=s.jsx(tt,{value:c,onChange:C,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:G}),t[6]=c,t[7]=z):z=t[7];let R;t[8]!==a||t[9]!==d||t[10]!==g?(R=a&&s.jsxs(ne,{children:[s.jsx(oe,{asChild:!0,children:s.jsxs(Q,{size:"sm",children:[s.jsx(ae,{size:14}),"Create Agent"]})}),s.jsx(ce,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list",method:"github"}),f(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list",method:"deco"}),p(!0)},isCreating:g,align:"end"})]}),t[8]=a,t[9]=d,t[10]=g,t[11]=R):R=t[11];let O;t[12]!==z||t[13]!==R?(O=s.jsxs("div",{className:"flex flex-col gap-6",children:[S,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[z,R]})]}),t[12]=z,t[13]=R,t[14]=O):O=t[14];const o=u.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Oe,{image:s.jsx(ke,{size:48,className:"text-muted-foreground"}),title:c?"No agents found":"No agents yet",description:c?`No agents match "${c}"`:a?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!c&&a&&s.jsxs(ne,{children:[s.jsx(oe,{asChild:!0,children:s.jsxs(Q,{size:"sm",children:[s.jsx(ae,{size:14}),"Create Agent"]})}),s.jsx(ce,{onCreateFromScratch:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),d()},onImportGitHub:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"github"}),f(!0)},onImportDeco:()=>{$("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),p(!0)},isCreating:g,align:"center",showBetaBadge:!0})]})})}),L=u.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:u.map(h=>s.jsx(st,{project:h,lastUsedAt:I?.get(h.id)?.last_used_at,onDeleteClick:a?()=>x({id:h.id,title:h.title}):void 0},h.id))})]});let v;t[15]!==L||t[16]!==k.Body||t[17]!==O||t[18]!==o?(v=s.jsxs(k.Body,{children:[O,o,L]}),t[15]=L,t[16]=k.Body,t[17]=O,t[18]=o,t[19]=v):v=t[19];let E;t[20]!==v||t[21]!==N.Content?(E=s.jsx(N.Content,{children:v}),t[20]=v,t[21]=N.Content,t[22]=E):E=t[22];let j;t[23]!==l?(j=s.jsx(_e,{open:l,onOpenChange:f}),t[23]=l,t[24]=j):j=t[24];let P;t[25]!==m?(P=s.jsx(at,{open:m,onOpenChange:p}),t[25]=m,t[26]=P):P=t[26];const V=!!w;let F;t[27]===Symbol.for("react.memo_cache_sentinel")?(F=h=>!h&&x(null),t[27]=F):F=t[27];let U;t[28]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(qe,{children:"Delete Agent?"}),t[28]=U):U=t[28];const J=w?.title;let b;t[29]!==J?(b=s.jsxs(Qe,{children:[U,s.jsxs(Je,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:J}),"."]})]}),t[29]=J,t[30]=b):b=t[30];let B;t[31]===Symbol.for("react.memo_cache_sentinel")?(B=s.jsx(We,{children:"Cancel"}),t[31]=B):B=t[31];let A;t[32]!==_?(A=s.jsxs(Ye,{children:[B,s.jsx(Xe,{onClick:_,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[32]=_,t[33]=A):A=t[33];let M;t[34]!==b||t[35]!==A?(M=s.jsxs(Ze,{children:[b,A]}),t[34]=b,t[35]=A,t[36]=M):M=t[36];let H;t[37]!==V||t[38]!==M?(H=s.jsx(et,{open:V,onOpenChange:F,children:M}),t[37]=V,t[38]=M,t[39]=H):H=t[39];let K;return t[40]!==T||t[41]!==E||t[42]!==j||t[43]!==P||t[44]!==H?(K=s.jsxs(T,{children:[E,j,P,H]}),t[40]=T,t[41]=E,t[42]=j,t[43]=P,t[44]=H,t[45]=K):K=t[45],K}function ct(t){return t.id}export{Gs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as B,s as N,aw as ae,ay as le,az as he,ax as xe,a$ as me,c as U,n as ge,p as be,r as O,j as s,a1 as Ee,t as G,a0 as ye,D as re,m as oe,d as J,K as Q,k as ve,l as ue,B as V,v as je,E as $e}from"./index-thaZU0eY.js";import{i as Re}from"./AlertCircle-CccbK4hX.js";import{P as te}from"./index-Fc19vagy.js";import{S as ne}from"./skeleton-Cz4bac5f.js";import{b as _e,a as ce,S as de,c as Fe}from"./settings-section-C4B_agjR.js";import{u as X,b as se,c as Se}from"./use-ai-providers-C9ok3iTv.js";import{i as Oe}from"./CheckCircle-CM68yWPW.js";import{n as Me,o as Te,p as Ue,S as ze}from"./chat-context-p7bQrjVO.js";import{f as qe,g as Le}from"./use-organization-settings-CtWuj0-0.js";import{M as Ve}from"./select-model-lznBUFcI.js";import{u as Be}from"./use-debounced-autosave-B2imKI8J.js";import{I as ie}from"./input-DEr8h15j.js";import{T as pe,a as Qe}from"./toggle-group-CvC6sjCU.js";import{b as ke,c as Ie,d as Ce,A as Ne,a as Pe,e as we,g as De,f as Ae}from"./alert-dialog-DT6CiV3D.js";import{u as H}from"./studio-tools-C88q8wAb.js";import{s as Ge}from"./Plus-CoqGiEoW.js";import{c as Ye}from"./Tool01-CExdAfac.js";import{s as We}from"./Trash01-2bgd5rb5.js";import{A as He}from"./avatar-D9dkHpvf.js";import{O as Ke,P as Je,C as fe}from"./decopilot-Dj817txh.js";import{i as Xe}from"./Settings02-Dy5hRJWC.js";import{s as Ze}from"./Eye-Bn25ApPz.js";import{D as et,c as tt,a as st,d as it,e as rt}from"./dialog-DTR6Ld8R.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-bBFf7mtX.js";import"./sidebar-DSPYyChk.js";import"./LayoutLeft-DNsGMIFw.js";import"./use-mobile-B23FisN_.js";import"./sheet-C-KllyIc.js";import"./X-dW9CI9iO.js";import"./tooltip-D9_AyRKs.js";import"./card-WdSE0wjZ.js";import"./ArrowUpRight-BgdgTW8q.js";import"./hooks-355Y2AQ-.js";import"./use-mcp-client-B7zSFiOA.js";import"./constants-nH3qQ_1f.js";import"./auth-D-3BenR-.js";import"./decopilot-sse-pool-wsz4kVX9.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BplbsFwA.js";import"./use-collections-BLTNEY6D.js";import"./use-decopilot-events-CdGe1kZY.js";import"./tab-id-Bgchl1bv.js";import"./drawer-tKmBK0sh.js";import"./connect-desktop-dialog-Af91UVe4.js";import"./Check-WJIsHzDQ.js";import"./Copy01-gjq995Op.js";import"./User01-DWmqguL8.js";import"./checkbox-Cf98ydrt.js";import"./select-fd5CQiLd.js";import"./ChevronDown-CAuaRLDM.js";import"./ChevronUp-D-qnR_uM.js";import"./Key01-CDa-PA-y.js";import"./SearchMd-YxzpYnNt.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-ChrDLGXa.js";import"./ChevronRight-B7czck1y.js";import"./Stars01-0N0PIoFw.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-DUO16Em8.js";import"./access-gate-uhjaq2Ab.js";import"./capability-load-error-mGRKLuE9.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Me(e),dt=e=>Te(e),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:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],O.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let p;t[7]!==i||t[8]!==u?.providerId?(p=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=p):p=t[9];const k=p;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const R=y.keyId??m??"";S(R),a({keyId:R,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let f;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(f=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=f):f=t[19],f}function pt(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function ft(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),G.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Be(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:p}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==p?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),$={};c?.id&&($[c.id]=j),u?.id&&($[u.id]=_),g?.id&&($[g.id]=p);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,$);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=p,e[19]=h):h=e[19];const f=c?.id,y=u?.id,R=g?.id;let M;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==p||e[25]!==f||e[26]!==y||e[27]!==R?(M=[o,t,j,_,p,f,y,R],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=p,e[25]=f,e[26]=y,e[27]=R,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const F=b&&!d;let D;e[30]!==S||e[31]!==F?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(pt,{isPending:S,showSaved:F})]}),e[30]=S,e[31]=F,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:$}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{$.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=O.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:f}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return f},onSuccess:yt,onError:bt}),[o,x]=O.useState(""),[S,b]=O.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(pe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(pe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Qe,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let p;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(p=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=p):p=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&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:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==p||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,p,k]})}),e[22]=_,e[23]=p,e[24]=k,e[25]=I):I=e[25],I}function bt(e){G.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=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=O.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=Q.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:p,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const f=p?.balanceCents!=null?p.balanceCents/100:null;let y;e[19]!==f?(y=f!=null?`$${f.toFixed(2)}`:"—",e[19]=f,e[20]=y):y=e[20];const R=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=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[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let F;e[23]!==c?(F=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=F):F=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[D,s.jsxs(we,{children:[A,s.jsx(De,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ae,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==f||e[33]!==R||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",f!=null&&vt(f)),children:R}),e[32]=f,e[33]=R,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const $=h&&"animate-spin";let P;e[39]!==$?(P=ue($),e[39]=$,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,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:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=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(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==F||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[F,E,Y,Z]})})}),e[54]=F,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){G.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:Q.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:Q.aiProviders(t.id)}),G.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),G.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["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]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=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]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=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]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:p}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async f=>{let y;f.apiKey?c?y=JSON.stringify({baseUrl:f.baseUrl||l||"",apiKey:f.apiKey}):y=f.apiKey:c&&f.baseUrl&&f.baseUrl!==l&&(y=JSON.stringify({baseUrl:f.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:f.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:Q.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:Q.aiProviders(S.id)}),G.success("Provider updated"),x()},onError:f=>G.error(`Failed to update: ${f.message}`)});return s.jsxs("form",{onSubmit:j(f=>I(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(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),p.label&&s.jsx("p",{className:"text-xs text-destructive",children:p.label.message})]}),c&&!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(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&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(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?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:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=Q.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let p;return t[24]!==l||t[25]!==r||t[26]!==_?(p=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=p):p=t[27],p}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=O.useState(!1),[b,d]=O.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let p;t[5]!==i.id||t[6]!==l?(p=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=p):p=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:Q.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:Q.aiProviders(r.id)}),o.invalidateQueries({queryKey:Q.aiProviderModels(r.id,i.id)}),G.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==p||t[13]!==k?(I={mutationFn:p,onSuccess:k,onError:At},t[12]=p,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:f}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let R;t[18]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ye,{size:14})}),t[18]=R):R=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(!0),T=s.jsx(We,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let F;t[21]!==f?(F=s.jsxs("div",{className:"flex items-center gap-0.5",children:[R,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:f,onClick:M,children:T})]}),t[21]=f,t[22]=F):F=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==F||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:F}),t[23]=_,t[24]=u,t[25]=F,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ne,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[v,s.jsx(De,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let $;t[38]!==E||t[39]!==w?($=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=$):$=t[40];let P;t[41]!==x||t[42]!==$?(P=s.jsx(Ae,{open:x,onOpenChange:S,children:$}),t[41]=x,t[42]=$,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return G.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter(Rt).map(S).filter($t);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Ge,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.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(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function $t(e){return e.provider!==void 0}function Rt(e){return e.providerId!=="deco"}function Ft(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Re,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Ot(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Mt),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=O.useState(!1),[x,S]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let p;e[5]!==n?(p=s.jsx(Je,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=p):p=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=R=>{R||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let f;e[8]!==k||e[9]!==h?(f=s.jsx(fe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=f):f=e[10];let y;return e[11]!==p||e[12]!==f?(y=s.jsxs(s.Fragment,{children:[p,f]}),e[11]=p,e[12]=f,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(ft,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(fe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Mt(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Fe,{children:[t,s.jsx($e,{fallback:Ut,children:s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Ot,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Ft,{error:t??new Error("Failed to load AI providers")})}function Hs(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Hs as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as gt,r as w,j as o,l as yt,t as ut,i as St}from"./index-thaZU0eY.js";import{i as _t}from"./ChevronRight-B7czck1y.js";import{S as jt}from"./scroll-area-urNhBz-2.js";import{A as kt}from"./add-section-modal-WZYG5Z6d.js";import{ap as Bt,aq as wt,ar as At,m as Nt,n as Rt,as as Ct,$ as Et,at as Kt,af as $t}from"./index-OMZJdpqB.js";import"./agent-icon-8-zG6zq2.js";import"./AlertCircle-CccbK4hX.js";import"./Tool01-CExdAfac.js";import"./SwitchHorizontal01-8YfzWW4j.js";import"./Settings02-Dy5hRJWC.js";import"./XCircle-BLHWvvQb.js";import"./ArrowUpRight-BgdgTW8q.js";import"./ZapSquare-BllWW0jW.js";import"./Users03-m0mGCSLF.js";import"./Loading02-Cv_WFApk.js";import"./CheckCircle-CM68yWPW.js";import"./Check-WJIsHzDQ.js";import"./ChevronDown-CAuaRLDM.js";import"./ChevronUp-D-qnR_uM.js";import"./Circle-KYXNByEA.js";import"./Stars02-XLaFEqA9.js";import"./Copy01-gjq995Op.js";import"./ZoomOut-6KFj5qIF.js";import"./DotsVertical-BVo4MRpu.js";import"./Globe01-BwRmuR_8.js";import"./Eye-Bn25ApPz.js";import"./FilterLines-DaZCku74.js";import"./Star01-Bbn22eVo.js";import"./Globe04-9qIG4QhN.js";import"./HardDrive-BJOyfL1s.js";import"./Key01-CDa-PA-y.js";import"./LayoutLeft-DNsGMIFw.js";import"./LinkExternal01-B-q2TCWq.js";import"./List-CDS_Rmur.js";import"./Monitor01-ChrDLGXa.js";import"./Sun-Cf2_RQhM.js";import"./Palette-CqqDm4G9.js";import"./Play-BLXO22JW.js";import"./Plus-CoqGiEoW.js";import"./SearchLg-BJoMxiDy.js";import"./SearchMd-YxzpYnNt.js";import"./Shield01-Dg-emZom.js";import"./Stars01-0N0PIoFw.js";import"./Trash01-2bgd5rb5.js";import"./Upload01-Da0GcY9n.js";import"./User01-DWmqguL8.js";import"./Users01-qo0Pfdbq.js";import"./XClose-BsCsQOzu.js";import"./X-dW9CI9iO.js";import"./Zap-NxwXfCyT.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy--Yb2hvIV.js";import"./tooltip-D9_AyRKs.js";import"./file-type-icon-ByfDUgJ1.js";import"./dialog-DTR6Ld8R.js";import"./use-mobile-B23FisN_.js";import"./tab-id-Bgchl1bv.js";import"./content-blocks-o63cs2vh.js";import"./types-BL5SG5y5.js";import"./use-mcp-client-B7zSFiOA.js";import"./constants-nH3qQ_1f.js";import"./auth-D-3BenR-.js";import"./chat-context-p7bQrjVO.js";import"./hooks-355Y2AQ-.js";import"./decopilot-sse-pool-wsz4kVX9.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BplbsFwA.js";import"./use-collections-BLTNEY6D.js";import"./use-ai-providers-C9ok3iTv.js";import"./studio-tools-C88q8wAb.js";import"./use-decopilot-events-CdGe1kZY.js";import"./use-organization-settings-CtWuj0-0.js";import"./use-clock-tick-Cr8Z09wV.js";import"./shell-layout-BnoAEqpd.js";import"./avatar-D9dkHpvf.js";import"./alert-dialog-DT6CiV3D.js";import"./required-auth-layout-DiYJUK17.js";import"./use-org-sso-BCol3dQF.js";import"./sheet-C-KllyIc.js";import"./integration-icon-zZ56Ie6s.js";import"./use-navigate-to-agent-ChQTAqDN.js";import"./use-connection-DV6jfeKV.js";import"./use-mcp-prompts-BMNQ61Xi.js";import"./form-Bdg2md6z.js";import"./label-D9vlZKHj.js";import"./input-DEr8h15j.js";import"./select-fd5CQiLd.js";import"./library-tab-dvlvVDBE.js";import"./drawer-tKmBK0sh.js";import"./collection-search-CwfTIp5v.js";import"./tabs-BJWmaLw8.js";import"./toggle-group-CvC6sjCU.js";import"./agent-capabilities-CUZgw2cK.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CrmcBQ7w.js";import"./use-registry-connections-BfySsVRx.js";import"./useInfiniteQuery-Deh6Q8fX.js";import"./use-infinite-scroll-CCgHyhHc.js";import"./extract-connection-data-hbWCHJzS.js";import"./card-WdSE0wjZ.js";import"./collection-tabs-byFj2Ujd.js";import"./badge-C9YrQiOl.js";import"./textarea-DEWiELfd.js";import"./connection-form-helpers-BEquM1Ke.js";import"./authenticate-and-persist-oauth-cOkcseWI.js";import"./mcp-oauth-HycnBVan.js";import"./useSuspenseInfiniteQuery-Cx1a_TEJ.js";import"./connect-desktop-dialog-Af91UVe4.js";import"./decopilot-Dj817txh.js";import"./checkbox-Cf98ydrt.js";import"./skeleton-Cz4bac5f.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C4B_agjR.js";import"./popover-BH74zFmN.js";import"./command-Be3tajRL.js";import"./index-Ci3919Ge.js";import"./index-CbcN0I3P.js";import"./toolbar-Cs8I9yhI.js";import"./use-debounced-value-Dk3ZHqhr.js";import"./dropdown-menu-D5GBwmj-.js";import"./index-Cg7efYOu.js";import"./question-004-sINsf4GQ.js";import"./task-row-BPMcTFbK.js";import"./task-status-pzbr--Ml.js";import"./use-status-sounds-QZH24TPY.js";import"./empty-state-Drp2V-gT.js";import"./use-mcp-tools-CXGlYiLZ.js";import"./use-capability-DUO16Em8.js";import"./tools-list-D8G7Mcid.js";import"./switch-Dg1aulpi.js";import"./use-debounced-autosave-B2imKI8J.js";import"./index-Fc19vagy.js";import"./sidebar-DSPYyChk.js";import"./search-input-DLqCE5vh.js";import"./github-repo-picker-BxPl8GNJ.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-KLMNhfAU.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-b0ekhhMY.js";import"./calendar-CVkRKG_3.js";import"./use-file-configs-D99FvcSf.js";import"./monaco-editor-BfF7h5UL.js";import"./select-model-lznBUFcI.js";import"./use-automations-BGAQUfh0.js";import"./automation-runs-DHORxp2E.js";import"./table-Z9PtYtMe.js";import"./use-members-ItYzCRBH.js";import"./use-org-auth-client-CW518BNQ.js";import"./automation-list-row-DNZxP8s9.js";function Tt(l,t){const s=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(s)&&s.length>0?s:"Section",a=Bt(t,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function Ar(l){const t=gt.c(77),{orgSlug:s,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:m,decofile:c,title:D,excludeFields:H,schemaPending:at,previewBaseUrl:nt}=l,G=at===void 0?!1:at,u=nt===void 0?null:nt,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;t[0]!==H||t[1]!==m||t[2]!==x?(R=wt(x,m,H),t[0]=H,t[1]=m,t[2]=x,t[3]=R):R=t[3];const h=R;let C;t[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,t[4]=h,t[5]=C):C=t[5];const J=C;let E;t[6]!==n||t[7]!==i||t[8]!==m||t[9]!==D?(E=D??(n?At(i,n,m):i),t[6]=n,t[7]=i,t[8]=m,t[9]=D,t[10]=E):E=t[10];const v=E;let K;t[11]!==a||t[12]!==s||t[13]!==f?(K={orgSlug:s,virtualMcpId:f,branch:a},t[11]=a,t[12]=s,t[13]=f,t[14]=K):K=t[14];const{save:b,flush:Q,isPending:W}=Nt(K);let $;t[15]!==a||t[16]!==s||t[17]!==f?($={orgSlug:s,virtualMcpId:f,branch:a},t[15]=a,t[16]=s,t[17]=f,t[18]=$):$=t[18];const X=Rt($);let T;t[19]!==b?(T=Et((e,r)=>b(e,r)),t[19]=b,t[20]=T):T=t[20];const Y=T,[ht,xt]=w.useState(i),[tt,ct]=w.useState(null),[et,dt]=w.useState(0);let F;t[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[21]=F):F=t[21];const[p,ft]=w.useState(F),[ot,rt]=w.useState(!1),P=w.useRef(null);ht!==i&&(xt(i),ct(null),dt(Pt),ft([]));let O;t[22]!==n?(O=n??{},t[22]=n,t[23]=O):O=t[23];const it=O;let g;t[24]!==tt?(g=tt??{},t[24]=tt,t[25]=g):g=t[25];let q;t[26]!==it||t[27]!==g?(q={...it,...g},t[26]=it,t[27]=g,t[28]=q):q=t[28];const mt=q;let z;t[29]!==i||t[30]!==x||t[31]!==b?(z=e=>{const r=e;ct(r),b(i,{...r,__resolveType:x})},t[29]=i,t[30]=x,t[31]=b,t[32]=z):z=t[32];const st=z;let L;t[33]===Symbol.for("react.memo_cache_sentinel")?(L=e=>{ft(e)},t[33]=L):L=t[33];const pt=L;let V;t[34]!==c||t[35]!==Q||t[36]!==X?(V=async(e,r)=>{try{const{blockKey:d,data:N}=Tt(e,c);await X.mutateAsync({blockKey:d,data:N}),ut.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,bt=N instanceof Error?N.message:"Could not add section";throw ut.error(bt),N}},t[34]=c,t[35]=Q,t[36]=X,t[37]=V):V=t[37];const y=V;let I;t[38]===Symbol.for("react.memo_cache_sentinel")?(I=e=>{P.current=e.append,rt(!0)},t[38]=I):I=t[38];const vt=I;let U;t[39]!==y?(U=async e=>{const r=P.current;if(r)try{await y(e,d=>{r(d),rt(!1),P.current=null})}catch{}},t[39]=y,t[40]=U):U=t[40];const lt=U;let M;t[41]!==p||t[42]!==v?(M=p.length>0?[v,...p]:[],t[41]=p,t[42]=v,t[43]=M):M=t[43];const A=M;let S;t[44]!==p||t[45]!==A||t[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((e,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(_t,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pt(r===0?[]:Ct(p,r)),dt(Ft)},title:e,className:yt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:e})]},`${e}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),t[44]=p,t[45]=A,t[46]=v,t[47]=S):S=t[47];let _;t[48]!==W?(_=o.jsx(Kt,{isPending:W,isError:!1}),t[48]=W,t[49]=_):_=t[49];let j;t[50]!==S||t[51]!==_?(j=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,_]}),t[50]=S,t[51]=_,t[52]=j):j=t[52];let k;t[53]!==i||t[54]!==p||t[55]!==c||t[56]!==mt||t[57]!==et||t[58]!==y||t[59]!==st||t[60]!==J||t[61]!==m||t[62]!==u||t[63]!==Y||t[64]!==h||t[65]!==G?(k=o.jsx(jt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx($t,{schema:h,value:mt,onChange:st,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pt,decofile:c,meta:m,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:vt},`${i}:${et}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(St,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),t[53]=i,t[54]=p,t[55]=c,t[56]=mt,t[57]=et,t[58]=y,t[59]=st,t[60]=J,t[61]=m,t[62]=u,t[63]=Y,t[64]=h,t[65]=G,t[66]=k):k=t[66];let B;t[67]!==ot||t[68]!==c||t[69]!==lt||t[70]!==m||t[71]!==u?(B=u&&o.jsx(kt,{open:ot,onOpenChange:e=>{rt(e),e||(P.current=null)},meta:m,decofile:c,previewBaseUrl:u,onSelect:e=>{lt(e)}}),t[67]=ot,t[68]=c,t[69]=lt,t[70]=m,t[71]=u,t[72]=B):B=t[72];let Z;return t[73]!==j||t[74]!==k||t[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[j,k,B]}),t[73]=j,t[74]=k,t[75]=B,t[76]=Z):Z=t[76],Z}function Ft(l){return l+1}function Pt(l){return l+1}export{Ar as AppEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ne,r as ce,l as be,j as t,B as fe,K as xe,k as Ve,E as tt,D as st}from"./index-thaZU0eY.js";import{u as ze}from"./useInfiniteQuery-Deh6Q8fX.js";import{u as lt}from"./use-connection-DV6jfeKV.js";import{u as nt}from"./use-mcp-client-B7zSFiOA.js";import{u as at}from"./use-virtual-mcp-BplbsFwA.js";import{i as rt,a as it,S as ot}from"./constants-nH3qQ_1f.js";import{C as ct}from"./card-WdSE0wjZ.js";import{c as Ke,d as qe,S as dt,b as mt}from"./sheet-C-KllyIc.js";import{c as Ge,d as He,a as Ne,e as se,b as Be,T as le}from"./table-Z9PtYtMe.js";import{E as Se}from"./empty-state-Drp2V-gT.js";import{u as ke}from"./use-infinite-scroll-CCgHyhHc.js";import{u as ut}from"./use-members-ItYzCRBH.js";import{S as ue}from"./task-status-pzbr--Ml.js";import{e as ft}from"./use-automations-BGAQUfh0.js";import{u as xt}from"./studio-tools-C88q8wAb.js";import{u as ht}from"./useSuspenseInfiniteQuery-Cx1a_TEJ.js";import{B as je}from"./badge-C9YrQiOl.js";import{S as gt,a as pt,b as jt,c as ge,d as bt}from"./select-fd5CQiLd.js";import{C as Le}from"./checkbox-Cf98ydrt.js";import{t as he}from"./ChevronDown-CAuaRLDM.js";import{b as Nt,C as vt,a as Fe,c as St,e as yt,d as wt}from"./command-Be3tajRL.js";import{a as Je,b as Qe,P as Ze}from"./popover-BH74zFmN.js";import{A as We}from"./avatar-D9dkHpvf.js";import{n as ye}from"./ChevronUp-D-qnR_uM.js";import{n as Ie}from"./XCircle-BLHWvvQb.js";import{i as _t}from"./FilterLines-DaZCku74.js";import{H as Ct,K as Tt}from"./scroll-area-urNhBz-2.js";import{I as Pe}from"./integration-icon-zZ56Ie6s.js";function Ue(l){const e=ne.c(74),{options:s,onValueChange:n,defaultValue:r,placeholder:i,variant:a,animation:d,maxCount:c,modalPopover:o,asChild:j,className:N,disabled:v,onSearchChange:m}=l;let b;e[0]!==r?(b=r===void 0?[]:r,e[0]=r,e[1]=b):b=e[1];const x=b,p=i===void 0?"Select items":i,h=a===void 0?"default":a,u=d===void 0?0:d,S=c===void 0?3:c,f=o===void 0?!1:o,C=j===void 0?!1:j,w=v===void 0?!1:v,[g,y]=ce.useState(x),[T,_]=ce.useState(!1);let k,P;e[2]!==x||e[3]!==g?(k=()=>{JSON.stringify(g)!==JSON.stringify(x)&&y(x)},P=[x,g],e[2]=x,e[3]=g,e[4]=k,e[5]=P):(k=e[4],P=e[5]),ce.useEffect(k,P);let I;e[6]!==n||e[7]!==g?(I=$=>{if($.key==="Enter")_(!0);else if($.key==="Backspace"&&!$.currentTarget.value){const B=[...g];B.pop(),y(B),n(B)}},e[6]=n,e[7]=g,e[8]=I):I=e[8];const D=I;let M;e[9]!==n||e[10]!==g?(M=$=>{const B=g.includes($.value)?g.filter(me=>me!==$.value):[...g,$.value];y(B),n(B)},e[9]=n,e[10]=g,e[11]=M):M=e[11];const A=M;let L;e[12]!==n?(L=()=>{y([]),n([])},e[12]=n,e[13]=L):L=e[13];const K=L;let q;e[14]===Symbol.for("react.memo_cache_sentinel")?(q=()=>{_(Mt)},e[14]=q):q=e[14];const Q=q;let J;e[15]!==K||e[16]!==n||e[17]!==s||e[18]!==g.length?(J=()=>{if(g.length===s.length)K();else{const $=s.map(Pt);y($),n($)}},e[15]=K,e[16]=n,e[17]=s,e[18]=g.length,e[19]=J):J=e[19];const E=J;let U;e[20]!==C?(U=C?{}:{variant:"outline"},e[20]=C,e[21]=U):U=e[21];let O;e[22]!==N?(O=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",N),e[22]=N,e[23]=O):O=e[23];let V;e[24]!==u||e[25]!==S||e[26]!==s||e[27]!==p||e[28]!==g||e[29]!==h?(V=g.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:[g.slice(0,S).map($=>{const B=s.find(ve=>ve.value===$),me=B?.icon;return t.jsxs(je,{variant:h==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${u}s`},children:[me&&t.jsx(me,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:B?.label})]},$)}),g.length>S&&t.jsxs(je,{variant:h==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${u}s`},children:["+",g.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]=u,e[25]=S,e[26]=s,e[27]=p,e[28]=g,e[29]=h,e[30]=V):V=e[30];let F;e[31]!==w||e[32]!==U||e[33]!==O||e[34]!==V?(F=t.jsx(Je,{asChild:!0,children:t.jsx(fe,{ref:null,...U,onClick:Q,className:O,disabled:w,children:V})}),e[31]=w,e[32]=U,e[33]=O,e[34]=V,e[35]=F):F=e[35];let G;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=()=>_(!1),e[36]=G):G=e[36];const X=!m;let z;e[37]!==D||e[38]!==m?(z=t.jsx(Nt,{placeholder:"Search...",onKeyDown:D,onValueChange:m,className:"rounded-t-xl"}),e[37]=D,e[38]=m,e[39]=z):z=e[39];let ee;e[40]===Symbol.for("react.memo_cache_sentinel")?(ee=t.jsx(vt,{children:"No results found."}),e[40]=ee):ee=e[40];let te;e[41]!==E?(te=()=>{E()},e[41]=E,e[42]=te):te=e[42];let Z;e[43]!==E?(Z=$=>{$.stopPropagation(),E()},e[43]=E,e[44]=Z):Z=e[44];const de=g.length===s.length&&s.length>0;let ae;e[45]!==de||e[46]!==E?(ae=t.jsx(Le,{checked:de,onCheckedChange:E,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:It}),e[45]=de,e[46]=E,e[47]=ae):ae=e[47];let re;e[48]===Symbol.for("react.memo_cache_sentinel")?(re=t.jsx("span",{children:"(Select All)"}),e[48]=re):re=e[48];let W;e[49]!==Z||e[50]!==ae?(W=t.jsxs("div",{className:"flex items-center w-full",onClick:Z,children:[ae,re]}),e[49]=Z,e[50]=ae,e[51]=W):W=e[51];let Y;e[52]!==te||e[53]!==W?(Y=t.jsx(Fe,{onSelect:te,className:"cursor-pointer",children:W},"all"),e[52]=te,e[53]=W,e[54]=Y):Y=e[54];let ie;if(e[55]!==s||e[56]!==g||e[57]!==A){let $;e[59]!==g||e[60]!==A?($=B=>{const me=g.includes(B.value);return t.jsx(Fe,{onSelect:()=>{A(B)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:ve=>{ve.stopPropagation(),A(B)},children:[t.jsx(Le,{checked:me,onCheckedChange:()=>{A(B)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:kt}),B.icon&&t.jsx(B.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:B.label})]})},B.value)},e[59]=g,e[60]=A,e[61]=$):$=e[61],ie=s.map($),e[55]=s,e[56]=g,e[57]=A,e[58]=ie}else ie=e[58];let R;e[62]!==Y||e[63]!==ie?(R=t.jsxs(St,{className:"rounded-b-xl",children:[ee,t.jsxs(yt,{children:[Y,ie]})]}),e[62]=Y,e[63]=ie,e[64]=R):R=e[64];let H;e[65]!==X||e[66]!==z||e[67]!==R?(H=t.jsx(Qe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:G,children:t.jsxs(wt,{shouldFilter:X,className:"rounded-xl",children:[z,R]})}),e[65]=X,e[66]=z,e[67]=R,e[68]=H):H=e[68];let oe;return e[69]!==T||e[70]!==f||e[71]!==F||e[72]!==H?(oe=t.jsxs(Ze,{open:T,onOpenChange:_,modal:f,children:[F,H]}),e[69]=T,e[70]=f,e[71]=F,e[72]=H,e[73]=oe):oe=e[73],oe}function kt(l){return l.stopPropagation()}function It(l){return l.stopPropagation()}function Pt(l){return l.value}function Mt(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"}],Dt=40;function ks(l){const s=(l.endDate.getTime()-l.startDate.getTime())/Dt;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 Rt(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 At(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 Is(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])),d=[];for(let c=r;c<=i;c+=n){const o=a.get(c),j=new Date(c).toISOString();d.push({t:j,ts:c,label:Rt(j,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 d}function Ps(l,e){return e==="requests"?l.calls:e==="errors"?l.errorRate:l.avgDurationMs}function Ms(l,e){return e==="requests"?l.calls.toLocaleString():e==="errors"?`${l.errorRate.toFixed(1)}%`:At(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=rt(l);return i?it(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=ne.c(33),{thread:s,connections:n,virtualMcps:r,selectedIndex:i,total:a,onPrev:d,onNext:c}=l;let o,j;if(e[0]!==n||e[1]!==s||e[2]!==r){const k=Ae(s);o=Ee(k,r,n,""),j=$e(k,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=o,e[4]=j}else o=e[3],j=e[4];const N=j,v=o||s.title;let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{}),e[5]=m):m=e[5];let b;e[6]!==N||e[7]!==v?(b=t.jsx(Pe,{icon:N,name:v,size:"sm",fallbackIcon:m,className:"shadow-sm shrink-0 rounded-md"}),e[6]=N,e[7]=v,e[8]=b):b=e[8];let x;e[9]!==s.title?(x=t.jsx(dt,{className:"text-sm leading-snug truncate",children:s.title}),e[9]=s.title,e[10]=x):x=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 h;e[13]!==x||e[14]!==p?(h=t.jsxs("div",{className:"min-w-0",children:[x,p]}),e[13]=x,e[14]=p,e[15]=h):h=e[15];let u;e[16]!==b||e[17]!==h?(u=t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[b,h]}),e[16]=b,e[17]=h,e[18]=u):u=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 C;e[20]!==d||e[21]!==S?(C=t.jsx(fe,{size:"icon",variant:"ghost",onClick:d,disabled:S,className:"h-7 w-7 text-muted-foreground","aria-label":"Previous thread",children:f}),e[20]=d,e[21]=S,e[22]=C):C=e[22];const w=i===a-1;let g;e[23]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(he,{size:14}),e[23]=g):g=e[23];let y;e[24]!==c||e[25]!==w?(y=t.jsx(fe,{size:"icon",variant:"ghost",onClick:c,disabled:w,className:"h-7 w-7 text-muted-foreground","aria-label":"Next thread",children:g}),e[24]=c,e[25]=w,e[26]=y):y=e[26];let T;e[27]!==C||e[28]!==y?(T=t.jsxs("div",{className:"flex items-center gap-0.5 shrink-0",children:[C,y]}),e[27]=C,e[28]=y,e[29]=T):T=e[29];let _;return e[30]!==T||e[31]!==u?(_=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:[u,T]})}),e[30]=T,e[31]=u,e[32]=_):_=e[32],_}function Et(l){const e=ne.c(48),{thread:s,connections:n,virtualMcps:r,members:i}=l;let a,d;if(e[0]!==n||e[1]!==s||e[2]!==r){const M=Ae(s);a=Ee(M,r,n,""),d=$e(M,r,n),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=d}else a=e[3],d=e[4];const c=d;let o;if(e[5]!==i||e[6]!==s.created_by){const M=Xe(i);let A;e[8]!==s.created_by?(A=L=>L.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 j=o;let N;e[10]!==j?.user.email||e[11]!==j?.user.name||e[12]!==s.created_by?(N=j?.user.name??j?.user.email??s.created_by?.substring(0,8)??"—",e[10]=j?.user.email,e[11]=j?.user.name,e[12]=s.created_by,e[13]=N):N=e[13];const v=N,m=j?.user.image??void 0;let b;e[14]!==s.created_at?(b=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]=b):b=e[15];const x=b,p=ue[s.status]??ue.completed,h=p.icon;let u;e[16]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Status"}),e[16]=u):u=e[16];let S;e[17]!==h||e[18]!==p.iconClassName?(S=t.jsx(h,{size:13,className:p.iconClassName}),e[17]=h,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 C;e[22]!==p.label||e[23]!==f?(C=t.jsx("span",{className:f,children:p.label}),e[22]=p.label,e[23]=f,e[24]=C):C=e[24];let w;e[25]!==S||e[26]!==C?(w=t.jsxs("div",{children:[u,t.jsxs("div",{className:"flex items-center gap-1.5",children:[S,C]})]}),e[25]=S,e[26]=C,e[27]=w):w=e[27];let g;e[28]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Date"}),e[28]=g):g=e[28];let y;e[29]!==x?(y=t.jsxs("div",{children:[g,t.jsx("div",{className:"text-sm text-foreground",children:x})]}),e[29]=x,e[30]=y):y=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 _;e[32]!==m||e[33]!==v?(_=t.jsx(We,{url:m,fallback:v,shape:"circle",size:"2xs",className:"shrink-0"}),e[32]=m,e[33]=v,e[34]=_):_=e[34];let k;e[35]!==v?(k=t.jsx("span",{className:"text-sm text-foreground",children:v}),e[35]=v,e[36]=k):k=e[36];let P;e[37]!==_||e[38]!==k?(P=t.jsxs("div",{children:[T,t.jsxs("div",{className:"flex items-center gap-2",children:[_,k]})]}),e[37]=_,e[38]=k,e[39]=P):P=e[39];let I;e[40]!==c||e[41]!==a?(I=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]=I):I=e[42];let D;return e[43]!==y||e[44]!==P||e[45]!==I||e[46]!==w?(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:[w,y,P,I]}),e[43]=y,e[44]=P,e[45]=I,e[46]=w,e[47]=D):D=e[47],D}function $t(l){const e=ne.c(72),{thread:s,usage:n,members:r,connections:i,virtualMcps:a,onClick:d,lastRowRef:c}=l;let o,j;if(e[0]!==i||e[1]!==s||e[2]!==a){const F=Ae(s);o=Ee(F,a,i,"—"),j=$e(F,a,i),e[0]=i,e[1]=s,e[2]=a,e[3]=o,e[4]=j}else o=e[3],j=e[4];const N=j;let v;if(e[5]!==r||e[6]!==s.created_by){const F=Xe(r);let G;e[8]!==s.created_by?(G=X=>X.userId===s.created_by,e[8]=s.created_by,e[9]=G):G=e[9],v=F.find(G),e[5]=r,e[6]=s.created_by,e[7]=v}else v=e[7];const m=v;let b;e[10]!==m?.user.email||e[11]!==m?.user.name||e[12]!==s.created_by?(b=m?.user.name??m?.user.email??s.created_by?.substring(0,8)??"—",e[10]=m?.user.email,e[11]=m?.user.name,e[12]=s.created_by,e[13]=b):b=e[13];const x=b,p=m?.user.image??void 0;let h,u;if(e[14]!==s.created_at){const F=new Date(s.created_at);h=F.toLocaleDateString("en-US",{month:"short",day:"numeric"}),u=F.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[14]=s.created_at,e[15]=h,e[16]=u}else h=e[15],u=e[16];const S=u,f=ue[s.status]??ue.completed,C=f.icon;let w;e[17]!==s.title?(w=t.jsx(le,{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]=w):w=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ie,{}),e[19]=g):g=e[19];let y;e[20]!==N||e[21]!==o?(y=t.jsx(Pe,{icon:N,name:o,size:"xs",fallbackIcon:g,className:"shrink-0 size-5! min-w-5! rounded-md"}),e[20]=N,e[21]=o,e[22]=y):y=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 _;e[25]!==y||e[26]!==T?(_=t.jsx(le,{className:"w-36 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[y,T]})}),e[25]=y,e[26]=T,e[27]=_):_=e[27];let k;e[28]!==p||e[29]!==x?(k=t.jsx(We,{url:p,fallback:x,shape:"circle",size:"2xs",className:"shrink-0"}),e[28]=p,e[29]=x,e[30]=k):k=e[30];let P;e[31]!==x?(P=t.jsx("span",{className:"truncate",children:x}),e[31]=x,e[32]=P):P=e[32];let I;e[33]!==k||e[34]!==P?(I=t.jsx(le,{className:"w-28 px-3 text-muted-foreground",children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[k,P]})}),e[33]=k,e[34]=P,e[35]=I):I=e[35];let D;e[36]!==C||e[37]!==f.iconClassName?(D=t.jsx(C,{size:14,className:f.iconClassName}),e[36]=C,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 L;e[44]!==D||e[45]!==A?(L=t.jsx(le,{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]=L):L=e[46];let K;e[47]!==n?(K=n?De(n.totalTokens):"—",e[47]=n,e[48]=K):K=e[48];let q;e[49]!==K?(q=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:K}),e[49]=K,e[50]=q):q=e[50];let Q;e[51]!==n?(Q=n&&n.costUsd>0?Re(n.costUsd):"—",e[51]=n,e[52]=Q):Q=e[52];let J;e[53]!==Q?(J=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:Q}),e[53]=Q,e[54]=J):J=e[54];let E;e[55]!==h?(E=t.jsx("div",{children:h}),e[55]=h,e[56]=E):E=e[56];let U;e[57]!==S?(U=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:S}),e[57]=S,e[58]=U):U=e[58];let O;e[59]!==E||e[60]!==U?(O=t.jsxs(le,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[E,U]}),e[59]=E,e[60]=U,e[61]=O):O=e[61];let V;return e[62]!==c||e[63]!==d||e[64]!==I||e[65]!==L||e[66]!==q||e[67]!==J||e[68]!==O||e[69]!==w||e[70]!==_?(V=t.jsxs(Ne,{ref:c,className:"h-14 md:h-16 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:d,children:[w,_,I,L,q,J,O]}),e[62]=c,e[63]=d,e[64]=I,e[65]=L,e[66]=q,e[67]=J,e[68]=O,e[69]=w,e[70]=_,e[71]=V):V=e[71],V}const _e=100;function Lt(l){const e=ne.c(37),{client:s,locator:n,thread:r,connections:i,virtualMcps:a,members:d,selectedIndex:c,total:o,onPrev:j,onNext:N}=l;let v;e[0]!==n||e[1]!==r.id?(v=xe.threadMessages(n,r.id),e[0]=n,e[1]=r.id,e[2]=v):v=e[2];let m;e[3]!==s||e[4]!==r.id?(m=async P=>{const{pageParam:I}=P,D=I===void 0?0:I;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:_e,offset:D}});return M.structuredContent??M},e[3]=s,e[4]=r.id,e[5]=m):m=e[5];let b;e[6]!==v||e[7]!==m?(b={queryKey:v,queryFn:m,initialPageParam:0,getNextPageParam:Ot,staleTime:6e4},e[6]=v,e[7]=m,e[8]=b):b=e[8];const{data:x,fetchNextPage:p,hasNextPage:h,isFetchingNextPage:u}=ht(b);let S;e[9]!==x.pages?(S=x.pages.flatMap(Ut).filter(Ft),e[9]=x.pages,e[10]=S):S=e[10];const f=S,C=Ct(f);let w;e[11]!==p||e[12]!==h||e[13]!==u?(w=()=>{h&&!u&&p()},e[11]=p,e[12]=h,e[13]=u,e[14]=w):w=e[14];const g=ke(w,h??!1,u);let y;e[15]!==i||e[16]!==N||e[17]!==j||e[18]!==c||e[19]!==r||e[20]!==o||e[21]!==a?(y=t.jsx(we,{thread:r,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[15]=i,e[16]=N,e[17]=j,e[18]=c,e[19]=r,e[20]=o,e[21]=a,e[22]=y):y=e[22];let T;e[23]!==i||e[24]!==d||e[25]!==r||e[26]!==a?(T=t.jsx(Et,{thread:r,connections:i,virtualMcps:a,members:d}),e[23]=i,e[24]=d,e[25]=r,e[26]=a,e[27]=T):T=e[27];let _;e[28]!==u||e[29]!==g||e[30]!==C||e[31]!==f.length?(_=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:[C.map((P,I)=>t.jsx("div",{ref:I===C.length-1?g:void 0,children:t.jsx(Tt,{pair:P,isLastPair:I===C.length-1,status:"ready"})},`pair-${P.user?.id??P.assistant?.id}`)),u&&t.jsx("div",{className:"py-4 text-center text-xs text-muted-foreground",children:"Loading more\\u2026"})]})}),e[28]=u,e[29]=g,e[30]=C,e[31]=f.length,e[32]=_):_=e[32];let k;return e[33]!==y||e[34]!==T||e[35]!==_?(k=t.jsxs(t.Fragment,{children:[y,T,_]}),e[33]=y,e[34]=T,e[35]=_,e[36]=k):k=e[36],k}function Ft(l){return l.role==="user"||l.role==="assistant"}function Ut(l){return l.items??[]}function Ot(l,e){const s=l,n=e;if(!((s?.items?.length??0)<_e))return n.length*_e}function et(l){const e=ne.c(39),{thread:s,client:n,locator:r,connections:i,virtualMcps:a,members:d,selectedIndex:c,total:o,onPrev:j,onNext:N}=l;let v;e[0]!==i||e[1]!==N||e[2]!==j||e[3]!==c||e[4]!==s||e[5]!==o||e[6]!==a?(v=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[0]=i,e[1]=N,e[2]=j,e[3]=c,e[4]=s,e[5]=o,e[6]=a,e[7]=v):v=e[7];let m;e[8]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-muted-foreground",children:"Failed to load messages"}),e[8]=m):m=e[8];let b;e[9]!==v?(b=t.jsxs(t.Fragment,{children:[v,m]}),e[9]=v,e[10]=b):b=e[10];let x;e[11]!==i||e[12]!==N||e[13]!==j||e[14]!==c||e[15]!==s||e[16]!==o||e[17]!==a?(x=t.jsx(we,{thread:s,connections:i,virtualMcps:a,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[11]=i,e[12]=N,e[13]=j,e[14]=c,e[15]=s,e[16]=o,e[17]=a,e[18]=x):x=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 h;e[20]!==x?(h=t.jsxs(t.Fragment,{children:[x,p]}),e[20]=x,e[21]=h):h=e[21];let u;e[22]!==n||e[23]!==i||e[24]!==r||e[25]!==d||e[26]!==N||e[27]!==j||e[28]!==c||e[29]!==s||e[30]!==o||e[31]!==a?(u=t.jsx(Lt,{client:n,locator:r,thread:s,connections:i,virtualMcps:a,members:d,selectedIndex:c,total:o,onPrev:j,onNext:N}),e[22]=n,e[23]=i,e[24]=r,e[25]=d,e[26]=N,e[27]=j,e[28]=c,e[29]=s,e[30]=o,e[31]=a,e[32]=u):u=e[32];let S;e[33]!==h||e[34]!==u?(S=t.jsx(ce.Suspense,{fallback:h,children:u}),e[33]=h,e[34]=u,e[35]=S):S=e[35];let f;return e[36]!==b||e[37]!==S?(f=t.jsx(tt,{fallback:b,children:S}),e[36]=b,e[37]=S,e[38]=f):f=e[38],f}function Ds(l){const e=ne.c(43),{filterAgentIds:s,filterUserIds:n,filterStatus:r,virtualMcpOptions:i,memberOptions:a,activeFiltersCount:d,onUpdateFilters:c}=l,[o,j]=ce.useState(!1);let N,v;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(_t,{size:16}),v=t.jsx("span",{className:"hidden sm:inline",children:"Filters"}),e[0]=N,e[1]=v):(N=e[0],v=e[1]);let m;e[2]!==d?(m=d>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:d}),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:d})]}),e[2]=d,e[3]=m):m=e[3];let b;e[4]!==m?(b=t.jsx(Je,{asChild:!0,children:t.jsxs(fe,{variant:"outline",className:"relative",children:[N,v,m]})}),e[4]=m,e[5]=b):b=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"font-medium text-sm",children:"Filter Threads"}),e[6]=x):x=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 h;e[8]!==c?(h=M=>c({filterAgentIds:M.slice(0,1)}),e[8]=c,e[9]=h):h=e[9];let u;e[10]!==s||e[11]!==h||e[12]!==i?(u=t.jsxs("div",{children:[p,t.jsx(Ue,{options:i,defaultValue:s,onValueChange:h,placeholder:"All agents",variant:"secondary",className:"w-full",maxCount:1})]}),e[10]=s,e[11]=h,e[12]=i,e[13]=u):u=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 C;e[17]!==n||e[18]!==a||e[19]!==f?(C=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]=C):C=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:"Status"}),e[21]=w):w=e[21];let g;e[22]!==c?(g=M=>c({filterStatus:M}),e[22]=c,e[23]=g):g=e[23];let y;e[24]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(gt,{className:"w-full",children:t.jsx(pt,{})}),e[24]=y):y=e[24];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsxs(jt,{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 _;e[26]!==r||e[27]!==g?(_=t.jsxs("div",{children:[w,t.jsxs(bt,{value:r,onValueChange:g,children:[y,T]})]}),e[26]=r,e[27]=g,e[28]=_):_=e[28];let k;e[29]!==C||e[30]!==_||e[31]!==u?(k=t.jsxs("div",{className:"space-y-3",children:[u,C,_]}),e[29]=C,e[30]=_,e[31]=u,e[32]=k):k=e[32];let P;e[33]!==d||e[34]!==c?(P=d>0&&t.jsx(fe,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{c({filterAgentIds:[],filterUserIds:[],filterStatus:"all"}),j(!1)},children:"Clear all filters"}),e[33]=d,e[34]=c,e[35]=P):P=e[35];let I;e[36]!==k||e[37]!==P?(I=t.jsx(Qe,{align:"end",className:"w-[280px]",children:t.jsxs("div",{className:"space-y-4",children:[x,k,P]})}),e[36]=k,e[37]=P,e[38]=I):I=e[38];let D;return e[39]!==o||e[40]!==I||e[41]!==b?(D=t.jsxs(Ze,{open:o,onOpenChange:j,children:[b,I]}),e[39]=o,e[40]=I,e[41]=b,e[42]=D):D=e[42],D}const Ce=50;function Rs(l){const e=ne.c(29),{client:s,locator:n,membersData:r,allConnections:i,allVirtualMcps:a,dateRange:d,searchQuery:c,filterAgentIds:o,filterUserIds:j,filterStatus:N}=l,[v,m]=ce.useState(null),b=d.startDate.toISOString(),x=d.endDate.toISOString(),p=JSON.stringify({startDate:b,endDate:x,search:c,agentIds:o,userIds:j,status:N}),{data:h,fetchNextPage:u,hasNextPage:S,isFetchingNextPage:f,isLoading:C}=ze({queryKey:xe.threadsInfinite(n,p),queryFn:async R=>{const{pageParam:H}=R,oe=H===void 0?0:H;if(!s)throw new Error("MCP client is not available");const $=await s.callTool({name:"COLLECTION_THREADS_LIST",arguments:{limit:Ce,offset:oe,startDate:b,endDate:x,...c?{search:c}:{},...o&&o.length>0?{agentId:o[0]}:{},...j&&j.length>0?{userId:j[0]}:{},...N&&N!=="all"?{status:N}:{}}});return $.structuredContent??$},initialPageParam:0,getNextPageParam:Ht,staleTime:3e4}),w=(h?.pages??[]).flatMap(Gt),g=w.map(qt),{data:y}=Ve({queryKey:xe.monitoringThreadUsage(n,JSON.stringify({ids:g,startDate:b,endDate:x})),queryFn:async()=>{if(!s)throw new Error("MCP client is not available");const R=await s.callTool({name:"MONITORING_THREAD_USAGE",arguments:{threadIds:g,startDate:b,endDate:x}});return R.structuredContent??R},enabled:!!s&&g.length>0,staleTime:3e4}),T=new Map((y?.items??[]).map(Kt)),[_,k]=ce.useState(null),[P,I]=ce.useState("desc");let D;e[0]!==_?(D=R=>{_===R?I(zt):(k(R),I("desc"))},e[0]=_,e[1]=D):D=e[1];const M=D,A=R=>{const H=T.get(R);return H?_==="cost"?H.costUsd:H.totalTokens:0},L=_?[...w].sort((R,H)=>{const oe=A(R.id),$=A(H.id);return P==="desc"?$-oe:oe-$}):w,K=v!==null?L[v]??null:null;let q;e[2]!==u||e[3]!==S||e[4]!==f?(q=()=>{S&&!f&&u()},e[2]=u,e[3]=S,e[4]=f,e[5]=q):q=e[5];const J=ke(q,S??!1,f),E=!!c||(o?.length??0)>0||(j?.length??0)>0||N&&N!=="all";let U;e[6]===Symbol.for("react.memo_cache_sentinel")?(U=()=>m(Vt),e[6]=U):U=e[6];const O=U,V=()=>m(R=>R!==null&&R<L.length-1?R+1:R),F="flex-1 flex flex-col overflow-auto min-w-0",G="mx-auto w-full max-w-[1200px] px-4 md:px-10 flex flex-col flex-1 min-h-0",X="flex-1 flex flex-col min-w-0",z="flex-1 min-w-0 pt-1",ee="min-w-0",te=C?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"})}):w.length===0?t.jsx("div",{className:"flex flex-1 items-center justify-center py-20",children:t.jsx(Se,{title:E?"No matching threads":"No threads in this time range",description:E?"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(se,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Title"}),t.jsx(se,{className:"w-36 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Agent"}),t.jsx(se,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"User"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(se,{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",_==="tokens"&&(P==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(se,{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",_==="cost"&&(P==="desc"?t.jsx(he,{size:12}):t.jsx(ye,{size:12}))]})}),t.jsx(se,{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:L.map((R,H)=>t.jsx($t,{thread:R,usage:T.get(R.id),members:r,connections:i,virtualMcps:a,onClick:()=>m(H),lastRowRef:H===L.length-1?J:void 0},R.id))})]}),f&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more..."})]});let Z;e[7]!==te?(Z=t.jsx("div",{className:G,children:t.jsx("div",{className:X,children:t.jsx("div",{className:z,children:t.jsx("div",{className:ee,children:te})})})}),e[7]=te,e[8]=Z):Z=e[8];const de=v!==null;let ae;e[9]===Symbol.for("react.memo_cache_sentinel")?(ae=R=>{R||m(null)},e[9]=ae):ae=e[9];let re;e[10]!==i||e[11]!==a||e[12]!==s||e[13]!==L||e[14]!==V||e[15]!==O||e[16]!==n||e[17]!==r||e[18]!==K||e[19]!==v?(re=K&&v!==null&&t.jsx(et,{thread:K,client:s,locator:n,connections:i,virtualMcps:a,members:r,selectedIndex:v,total:L.length,onPrev:O,onNext:V}),e[10]=i,e[11]=a,e[12]=s,e[13]=L,e[14]=V,e[15]=O,e[16]=n,e[17]=r,e[18]=K,e[19]=v,e[20]=re):re=e[20];let W;e[21]!==re?(W=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:re}),e[21]=re,e[22]=W):W=e[22];let Y;e[23]!==de||e[24]!==W?(Y=t.jsx(qe,{open:de,onOpenChange:ae,children:W}),e[23]=de,e[24]=W,e[25]=Y):Y=e[25];let ie;return e[26]!==Z||e[27]!==Y?(ie=t.jsxs("div",{className:F,children:[Z,Y]}),e[26]=Z,e[27]=Y,e[28]=ie):ie=e[28],ie}function Vt(l){return l!==null&&l>0?l-1:l}function zt(l){return l==="desc"?"asc":"desc"}function Kt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function qt(l){return l.id}function Gt(l){return l.items??[]}function Ht(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Ce))return n.length*Ce}const Te=50;function pe(l){const e=ne.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 d;e[4]!==r?(d=r&&t.jsx("span",{className:"text-xs text-muted-foreground",children:r}),e[4]=r,e[5]=d):d=e[5];let c;return e[6]!==i||e[7]!==a||e[8]!==d?(c=t.jsxs(ct,{className:"pt-4 px-4 pb-5 gap-1",children:[i,a,d]}),e[6]=i,e[7]=a,e[8]=d,e[9]=c):c=e[9],c}function Bt(l){const e=ne.c(27),{automationId:s,range:n}=l,{data:r,isLoading:i}=ft(s,n),a=r?.runs,d=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,j=d&&d.truncated?`last ${d.sampledRuns} runs`:void 0;let N;e[2]!==i||e[3]!==a?.total?(N=i?"…":a?.total.toLocaleString()??"0",e[2]=i,e[3]=a?.total,e[4]=N):N=e[4];const v=a?`${a.completed} ok · ${a.failed} failed${a.inProgress>0?` · ${a.inProgress} running`:""}`:void 0;let m;e[5]!==N||e[6]!==v?(m=t.jsx(pe,{title:"Runs",value:N,subtitle:v}),e[5]=N,e[6]=v,e[7]=m):m=e[7];const b=i?"…":o;let x;e[8]!==b?(x=t.jsx(pe,{title:"Success rate",value:b}),e[8]=b,e[9]=x):x=e[9];let p;e[10]!==i||e[11]!==d?.totalTokens?(p=i?"…":De(d?.totalTokens??0),e[10]=i,e[11]=d?.totalTokens,e[12]=p):p=e[12];let h;e[13]!==p||e[14]!==j?(h=t.jsx(pe,{title:"Tokens",value:p,subtitle:j}),e[13]=p,e[14]=j,e[15]=h):h=e[15];let u;e[16]!==i||e[17]!==d?(u=i?"…":d&&d.costUsd>0?Re(d.costUsd):"—",e[16]=i,e[17]=d,e[18]=u):u=e[18];let S;e[19]!==u||e[20]!==j?(S=t.jsx(pe,{title:"Cost",value:u,subtitle:j}),e[19]=u,e[20]=j,e[21]=S):S=e[21];let f;return e[22]!==S||e[23]!==m||e[24]!==x||e[25]!==h?(f=t.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[m,x,h,S]}),e[22]=S,e[23]=m,e[24]=x,e[25]=h,e[26]=f):f=e[26],f}function Jt(l){const e=ne.c(39),{run:s,usage:n,onClick:r,lastRowRef:i}=l;let a,d;if(e[0]!==s.created_at){const y=new Date(s.created_at);a=y.toLocaleDateString("en-US",{month:"short",day:"numeric"}),d=y.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),e[0]=s.created_at,e[1]=a,e[2]=d}else a=e[1],d=e[2];const c=d,o=ue[s.status]??ue.completed,j=o.icon;let N;e[3]!==s.title?(N=t.jsx(le,{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]=N):N=e[4];let v;e[5]!==j||e[6]!==o.iconClassName?(v=t.jsx(j,{size:14,className:o.iconClassName}),e[5]=j,e[6]=o.iconClassName,e[7]=v):v=e[7];let m;e[8]!==o.labelColor?(m=be("text-sm",o.labelColor),e[8]=o.labelColor,e[9]=m):m=e[9];let b;e[10]!==o.label||e[11]!==m?(b=t.jsx("span",{className:m,children:o.label}),e[10]=o.label,e[11]=m,e[12]=b):b=e[12];let x;e[13]!==v||e[14]!==b?(x=t.jsx(le,{className:"w-28 px-3",children:t.jsxs("div",{className:"flex items-center gap-1.5",children:[v,b]})}),e[13]=v,e[14]=b,e[15]=x):x=e[15];let p;e[16]!==n?(p=n?De(n.totalTokens):"—",e[16]=n,e[17]=p):p=e[17];let h;e[18]!==p?(h=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:p}),e[18]=p,e[19]=h):h=e[19];let u;e[20]!==n?(u=n&&n.costUsd>0?Re(n.costUsd):"—",e[20]=n,e[21]=u):u=e[21];let S;e[22]!==u?(S=t.jsx(le,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:u}),e[22]=u,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 C;e[26]!==c?(C=t.jsx("div",{className:"text-xs text-muted-foreground/60",children:c}),e[26]=c,e[27]=C):C=e[27];let w;e[28]!==f||e[29]!==C?(w=t.jsxs(le,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[f,C]}),e[28]=f,e[29]=C,e[30]=w):w=e[30];let g;return e[31]!==i||e[32]!==r||e[33]!==S||e[34]!==w||e[35]!==N||e[36]!==x||e[37]!==h?(g=t.jsxs(Ne,{ref:i,className:"h-14 cursor-pointer hover:bg-muted/40 transition-colors border-b-0",onClick:r,children:[N,x,h,S,w]}),e[31]=i,e[32]=r,e[33]=S,e[34]=w,e[35]=N,e[36]=x,e[37]=h,e[38]=g):g=e[38],g}function As(l){const e=ne.c(48),{automationId:s,triggerIds:n,range:r}=l,{org:i,locator:a}=st();let d;e[0]!==i.id||e[1]!==i.slug?(d={connectionId:ot,orgId:i.id,orgSlug:i.slug},e[0]=i.id,e[1]=i.slug,e[2]=d):d=e[2];const c=nt(d),o=xt(),j=lt(),N=at(),{data:v}=ut(),[m,b]=ce.useState(null),x=n.length>0;let p;e[3]!==s||e[4]!==i.id||e[5]!==n?(p=xe.automationRuns(i.id,s,n),e[3]=s,e[4]=i.id,e[5]=n,e[6]=p):p=e[6];let h;e[7]!==o||e[8]!==n?(h=async z=>{const{pageParam:ee}=z,te=ee===void 0?0:ee;return await o.call("COLLECTION_THREADS_LIST",{limit:Te,offset:te,where:{trigger_ids:n}})},e[7]=o,e[8]=n,e[9]=h):h=e[9];let u;e[10]!==x||e[11]!==p||e[12]!==h?(u={queryKey:p,queryFn:h,initialPageParam:0,getNextPageParam:Xt,enabled:x,staleTime:3e4},e[10]=x,e[11]=p,e[12]=h,e[13]=u):u=e[13];const{data:S,fetchNextPage:f,hasNextPage:C,isFetchingNextPage:w,isLoading:g}=ze(u),y=(S?.pages??[]).flatMap(Yt),T=y.map(Wt),{data:_}=Ve({queryKey:xe.monitoringThreadUsage(a,JSON.stringify({ids:T,...r})),queryFn:async()=>await o.call("MONITORING_THREAD_USAGE",{threadIds:T,...r.startDate?{startDate:r.startDate}:{},...r.endDate?{endDate:r.endDate}:{}}),enabled:T.length>0,staleTime:3e4});let k;e[14]!==_?.items?(k=new Map((_?.items??[]).map(Zt)),e[14]=_?.items,e[15]=k):k=e[15];const P=k;let I;e[16]!==f||e[17]!==C||e[18]!==w?(I=()=>{C&&!w&&f()},e[16]=f,e[17]=C,e[18]=w,e[19]=I):I=e[19];const D=ke(I,C??!1,w),M=m!==null?y[m]??null:null;let A;e[20]===Symbol.for("react.memo_cache_sentinel")?(A=()=>b(Qt),e[20]=A):A=e[20];const L=A,K=()=>b(z=>z!==null&&z<y.length-1?z+1:z),q="flex flex-col gap-5";let Q;e[21]!==s||e[22]!==r?(Q=t.jsx(Bt,{automationId:s,range:r}),e[21]=s,e[22]=r,e[23]=Q):Q=e[23];const J=x?g?t.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:"Loading runs…"}):y.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(se,{className:"pl-4 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Run"}),t.jsx(se,{className:"w-28 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Status"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Tokens"}),t.jsx(se,{className:"w-24 px-3 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide text-right",children:"Cost"}),t.jsx(se,{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:y.map((z,ee)=>t.jsx(Jt,{run:z,usage:P.get(z.id),onClick:()=>b(ee),lastRowRef:ee===y.length-1?D: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 E;e[24]!==w?(E=w&&t.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading more…"}),e[24]=w,e[25]=E):E=e[25];const U=m!==null;let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=z=>{z||b(null)},e[26]=O):O=e[26];let V;e[27]!==j||e[28]!==N||e[29]!==c||e[30]!==K||e[31]!==L||e[32]!==a||e[33]!==v||e[34]!==y||e[35]!==M||e[36]!==m?(V=M&&m!==null&&t.jsx(et,{thread:M,client:c,locator:a,connections:j,virtualMcps:N,members:v,selectedIndex:m,total:y.length,onPrev:L,onNext:K}),e[27]=j,e[28]=N,e[29]=c,e[30]=K,e[31]=L,e[32]=a,e[33]=v,e[34]=y,e[35]=M,e[36]=m,e[37]=V):V=e[37];let F;e[38]!==V?(F=t.jsx(Ke,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:V}),e[38]=V,e[39]=F):F=e[39];let G;e[40]!==U||e[41]!==F?(G=t.jsx(qe,{open:U,onOpenChange:O,children:F}),e[40]=U,e[41]=F,e[42]=G):G=e[42];let X;return e[43]!==J||e[44]!==E||e[45]!==G||e[46]!==Q?(X=t.jsxs("div",{className:q,children:[Q,J,E,G]}),e[43]=J,e[44]=E,e[45]=G,e[46]=Q,e[47]=X):X=e[47],X}function Qt(l){return l!==null&&l>0?l-1:l}function Zt(l){return[l.threadId,{calls:l.calls,inputTokens:l.inputTokens,outputTokens:l.outputTokens,totalTokens:l.totalTokens,costUsd:l.costUsd}]}function Wt(l){return l.id}function Yt(l){return l.items??[]}function Xt(l,e){const s=l,n=e;if(!((s?.items?.length??0)<Te))return n.length*Te}export{As as A,Ue as M,Ds as T,Re as a,Is as b,At as c,Ms as d,Ps as e,De as f,ks as g,Xe as h,Rs as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as B,j as o,D as L,b as T,r as $,B as M,v as N}from"./index-thaZU0eY.js";import{s as D}from"./Plus-CoqGiEoW.js";import{i as S}from"./Zap-NxwXfCyT.js";import{S as q}from"./search-input-DLqCE5vh.js";import{P as l}from"./index-Fc19vagy.js";import{E as b}from"./empty-state-Drp2V-gT.js";import{c as O}from"./use-automations-BGAQUfh0.js";import{u as V}from"./use-navigate-to-agent-ChQTAqDN.js";import{A as F}from"./automation-list-row-DNZxP8s9.js";import{e as G}from"./constants-nH3qQ_1f.js";import{u as H}from"./use-virtual-mcp-BplbsFwA.js";import{R as J}from"./require-capability-bBFf7mtX.js";import"./SearchMd-YxzpYnNt.js";import"./sidebar-DSPYyChk.js";import"./LayoutLeft-DNsGMIFw.js";import"./use-mobile-B23FisN_.js";import"./sheet-C-KllyIc.js";import"./X-dW9CI9iO.js";import"./tooltip-D9_AyRKs.js";import"./use-mcp-client-B7zSFiOA.js";import"./auth-D-3BenR-.js";import"./studio-tools-C88q8wAb.js";import"./alert-dialog-DT6CiV3D.js";import"./dropdown-menu-D5GBwmj-.js";import"./Check-WJIsHzDQ.js";import"./ChevronRight-B7czck1y.js";import"./Circle-KYXNByEA.js";import"./Stars02-XLaFEqA9.js";import"./DotsVertical-BVo4MRpu.js";import"./Trash01-2bgd5rb5.js";import"./agent-icon-8-zG6zq2.js";import"./AlertCircle-CccbK4hX.js";import"./Tool01-CExdAfac.js";import"./SwitchHorizontal01-8YfzWW4j.js";import"./Settings02-Dy5hRJWC.js";import"./XCircle-BLHWvvQb.js";import"./ArrowUpRight-BgdgTW8q.js";import"./ZapSquare-BllWW0jW.js";import"./Users03-m0mGCSLF.js";import"./Loading02-Cv_WFApk.js";import"./CheckCircle-CM68yWPW.js";import"./ChevronDown-CAuaRLDM.js";import"./ChevronUp-D-qnR_uM.js";import"./Copy01-gjq995Op.js";import"./ZoomOut-6KFj5qIF.js";import"./Globe01-BwRmuR_8.js";import"./Eye-Bn25ApPz.js";import"./FilterLines-DaZCku74.js";import"./Star01-Bbn22eVo.js";import"./Globe04-9qIG4QhN.js";import"./HardDrive-BJOyfL1s.js";import"./Key01-CDa-PA-y.js";import"./LinkExternal01-B-q2TCWq.js";import"./List-CDS_Rmur.js";import"./Monitor01-ChrDLGXa.js";import"./Sun-Cf2_RQhM.js";import"./Palette-CqqDm4G9.js";import"./Play-BLXO22JW.js";import"./SearchLg-BJoMxiDy.js";import"./Shield01-Dg-emZom.js";import"./Stars01-0N0PIoFw.js";import"./Upload01-Da0GcY9n.js";import"./User01-DWmqguL8.js";import"./Users01-qo0Pfdbq.js";import"./XClose-BsCsQOzu.js";import"./use-collections-BLTNEY6D.js";import"./use-capability-DUO16Em8.js";import"./access-gate-uhjaq2Ab.js";import"./capability-load-error-mGRKLuE9.js";function K(){const t=B.c(16),{org:i}=L(),{data:w}=O(void 0),u=w===void 0?[]:w,R=H(),k=V(),d=T(),[f,E]=$.useState(""),g=f.toLowerCase(),y=new Map(R.map(Q)),C=u.filter(e=>{if(!g||e.name.toLowerCase().includes(g))return!0;if(e.virtual_mcp_id){const a=y.get(e.virtual_mcp_id);if(a&&a.title.toLowerCase().includes(g))return!0}return!1}),P=(e,a)=>{const A=a&&y.has(a)?a:G(i.id);N("automations_list_row_clicked",{automation_id:e,agent_id:A,source:"settings_automations"}),k(A,{search:{main:"automation:"+e}})};let n;t[0]!==d||t[1]!==i.slug?(n=()=>{N("automations_empty_state_browse_agents_clicked"),d({to:"/$org/settings/agents",params:{org:i.slug}})},t[0]=d,t[1]=i.slug,t[2]=n):n=t[2];const z=n,x=l,h=l,j=l;let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx(l.Title,{children:"Automations"}),t[3]=p):p=t[3];const _=u.length>0&&o.jsx(q,{value:f,onChange:E,placeholder:"Search automations...",className:"w-full md:w-[375px]"});let r;t[4]!==_?(r=o.jsxs("div",{className:"flex flex-col gap-6",children:[p,_]}),t[4]=_,t[5]=r):r=t[5];const v=u.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations yet",description:"Automations are created per agent. Open an agent and add one from its Automations tab.",actions:o.jsxs(M,{size:"sm",onClick:z,children:[o.jsx(D,{size:14}),"Browse agents"]})})}):C.length===0?o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(b,{image:o.jsx(S,{size:48,className:"text-muted-foreground"}),title:"No automations found",description:`No automations match "${f}"`})}):o.jsx("div",{className:"mt-6 rounded-xl border border-border overflow-hidden",children:C.map(e=>o.jsx(F,{automation:e,showAgent:!0,onClick:()=>P(e.id,e.virtual_mcp_id)},e.id))});let s;t[6]!==j.Body||t[7]!==r||t[8]!==v?(s=o.jsxs(j.Body,{children:[r,v]}),t[6]=j.Body,t[7]=r,t[8]=v,t[9]=s):s=t[9];let m;t[10]!==h.Content||t[11]!==s?(m=o.jsx(h.Content,{children:s}),t[10]=h.Content,t[11]=s,t[12]=m):m=t[12];let c;return t[13]!==x||t[14]!==m?(c=o.jsx(x,{children:m}),t[13]=x,t[14]=m,t[15]=c):c=t[15],c}function Q(t){return[t.id,t]}function po(){const t=B.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=o.jsx(J,{capability:"automations:manage",area:"automations",children:o.jsx(K,{})}),t[0]=i):i=t[0],i}export{po as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as K,F as ze,D as Ie,m as Le,K as Oe,k as Ke,d as ge,j as n,B as Ae,v as H,t as L,r as Te,p as Ue,l as _e,a1 as fe}from"./index-thaZU0eY.js";import{t as Xe}from"./ChevronDown-CAuaRLDM.js";import{i as He}from"./ChevronRight-B7czck1y.js";import{s as qe,t as Me}from"./Star01-Bbn22eVo.js";import{n as Ve}from"./LinkExternal01-B-q2TCWq.js";import{s as Re}from"./Plus-CoqGiEoW.js";import{s as Qe}from"./Trash01-2bgd5rb5.js";import{i as Ge}from"./Zap-NxwXfCyT.js";import{c as Ye,b as Je,d as We,A as Ze,g as et,e as tt,a as st,f as nt}from"./alert-dialog-DT6CiV3D.js";import{I as ue}from"./input-DEr8h15j.js";import{T as lt}from"./textarea-DEWiELfd.js";import{P as Ne}from"./index-Fc19vagy.js";import{u as $e}from"./studio-tools-C88q8wAb.js";import{u as ot}from"./use-debounced-autosave-B2imKI8J.js";import{R as rt}from"./require-capability-bBFf7mtX.js";import"./sidebar-DSPYyChk.js";import"./LayoutLeft-DNsGMIFw.js";import"./use-mobile-B23FisN_.js";import"./sheet-C-KllyIc.js";import"./X-dW9CI9iO.js";import"./tooltip-D9_AyRKs.js";import"./use-capability-DUO16Em8.js";import"./access-gate-uhjaq2Ab.js";import"./capability-load-error-mGRKLuE9.js";function we(t){const e=K.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 c;e[2]!==s?(c=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]=c):c=e[3];let f;return e[4]!==o||e[5]!==r||e[6]!==c?(f=n.jsxs("div",{className:r,children:[c,o]}),e[4]=o,e[5]=r,e[6]=c,e[7]=f):f=e[7],f}function at(t){const e=K.c(25),{onExtract:s,isExtracting:o}=t,[l,r]=Te.useState("");let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10",children:n.jsx(Ge,{size:18,className:"text-primary"})}),e[0]=c):c=e[0];let f,g;e[1]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("p",{className:"text-sm font-medium text-foreground",children:"Auto-extract brand context"}),g=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]=f,e[2]=g):(f=e[1],g=e[2]);let b;e[3]===Symbol.for("react.memo_cache_sentinel")?(b=m=>r(m.target.value),e[3]=b):b=e[3];let p;e[4]!==l||e[5]!==o||e[6]!==s?(p=m=>{m.key==="Enter"&&l.trim()&&!o&&s(l.trim())},e[4]=l,e[5]=o,e[6]=s,e[7]=p):p=e[7];let d;e[8]!==l||e[9]!==p?(d=n.jsx(ue,{placeholder:"acme.com",value:l,onChange:b,className:"max-w-xs",onKeyDown:p}),e[8]=l,e[9]=p,e[10]=d):d=e[10];let a;e[11]!==l||e[12]!==o?(a=!l.trim()||o,e[11]=l,e[12]=o,e[13]=a):a=e[13];let i;e[14]!==l||e[15]!==s?(i=()=>s(l.trim()),e[14]=l,e[15]=s,e[16]=i):i=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=n.jsx(qe,{size:14}),e[17]=u):u=e[17];const h=o?"Extracting...":"Extract";let x;e[18]!==h||e[19]!==a||e[20]!==i?(x=n.jsxs(Ae,{variant:"outline",disabled:a,onClick:i,children:[u,h]}),e[18]=h,e[19]=a,e[20]=i,e[21]=x):x=e[21];let v;return e[22]!==x||e[23]!==d?(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:[c,n.jsxs("div",{className:"flex-1",children:[f,g,n.jsxs("div",{className:"mt-3 flex gap-2",children:[d,x]})]})]})}),e[22]=x,e[23]=d,e[24]=v):v=e[24],v}function it(t){const e=K.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 c=r;let f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=n.jsx("label",{className:"mb-1 block text-xs text-muted-foreground",children:"Company name"}),e[2]=f):f=e[2];let g;e[3]!==o||e[4]!==l?(g=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Acme Corp"})},e[3]=o,e[4]=l,e[5]=g):g=e[5];let b;e[6]!==s.control||e[7]!==g?(b=n.jsxs("div",{children:[f,n.jsx(fe,{control:s.control,name:"name",render:g})]}),e[6]=s.control,e[7]=g,e[8]=b):b=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=n.jsx("span",{children:"Domain"}),e[9]=p):p=e[9];let d;e[10]!==c?(d=c&&n.jsxs("a",{href:`https://${c}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 transition-colors hover:text-foreground",children:[n.jsx(Ve,{size:10}),"open"]}),e[10]=c,e[11]=d):d=e[11];let a;e[12]!==d?(a=n.jsxs("label",{className:"mb-1 flex items-center justify-between text-xs text-muted-foreground",children:[p,d]}),e[12]=d,e[13]=a):a=e[13];let i;e[14]!==o||e[15]!==l?(i=D=>{const{field:y}=D;return n.jsx(ue,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"acme.com"})},e[14]=o,e[15]=l,e[16]=i):i=e[16];let u;e[17]!==s.control||e[18]!==i?(u=n.jsx(fe,{control:s.control,name:"domain",render:i}),e[17]=s.control,e[18]=i,e[19]=u):u=e[19];let h;e[20]!==a||e[21]!==u?(h=n.jsxs("div",{children:[a,u]}),e[20]=a,e[21]=u,e[22]=h):h=e[22];let x;e[23]!==h||e[24]!==b?(x=n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b,h]}),e[23]=h,e[24]=b,e[25]=x):x=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 m;e[27]!==o||e[28]!==l?(m=D=>{const{field:y}=D;return n.jsx(lt,{...y,onChange:_=>{y.onChange(_),o()},onBlur:()=>{y.onBlur(),l()},placeholder:"Brief description of what the company does...",rows:3})},e[27]=o,e[28]=l,e[29]=m):m=e[29];let C;e[30]!==s.control||e[31]!==m?(C=n.jsxs("div",{children:[v,n.jsx(fe,{control:s.control,name:"overview",render:m})]}),e[30]=s.control,e[31]=m,e[32]=C):C=e[32];let k;return e[33]!==x||e[34]!==C?(k=n.jsx(we,{title:"Company Overview",children:n.jsxs("div",{className:"space-y-3",children:[x,C]})}),e[33]=x,e[34]=C,e[35]=k):k=e[35],k}const ct={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 Se(t){const e=K.c(22),{form:s,name:o,label:l,imgClassName:r,onFieldChange:c,onFieldCommit:f}=t,g=r===void 0?"h-full w-full object-contain p-3":r;let b;e[0]!==s||e[1]!==o?(b=s.watch(o),e[0]=s,e[1]=o,e[2]=b):b=e[2];const p=b;let d;e[3]!==g||e[4]!==l||e[5]!==p?(d=n.jsx("div",{className:"flex aspect-video w-28 shrink-0 items-center justify-center overflow-hidden rounded-xl",style:ct,children:p?n.jsx("img",{src:p,alt:l,className:g,loading:"lazy"}):n.jsxs("span",{className:"text-[10px] text-muted-foreground/70",children:["No ",l.toLowerCase()]})}),e[3]=g,e[4]=l,e[5]=p,e[6]=d):d=e[6];let a;e[7]!==l?(a=n.jsxs("label",{className:"mb-1 block text-xs text-muted-foreground",children:[l," URL"]}),e[7]=l,e[8]=a):a=e[8];let i;e[9]!==c||e[10]!==f?(i=v=>{const{field:m}=v;return n.jsx(ue,{...m,onChange:C=>{m.onChange(C),c()},onBlur:()=>{m.onBlur(),f()},placeholder:"https://..."})},e[9]=c,e[10]=f,e[11]=i):i=e[11];let u;e[12]!==s.control||e[13]!==o||e[14]!==i?(u=n.jsx(fe,{control:s.control,name:o,render:i}),e[12]=s.control,e[13]=o,e[14]=i,e[15]=u):u=e[15];let h;e[16]!==a||e[17]!==u?(h=n.jsxs("div",{className:"flex-1",children:[a,u]}),e[16]=a,e[17]=u,e[18]=h):h=e[18];let x;return e[19]!==d||e[20]!==h?(x=n.jsxs("div",{className:"flex items-start gap-3",children:[d,h]}),e[19]=d,e[20]=h,e[21]=x):x=e[21],x}function dt(t){const e=K.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(Se,{form:s,name:"logo",label:"Logo",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{form:s,name:"favicon",label:"Favicon",imgClassName:"h-12 w-12 object-contain",onFieldChange:o,onFieldCommit:l}),n.jsx(Se,{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 mt=[{key:"heading",label:"Headings"},{key:"body",label:"Body"},{key:"code",label:"Code"}];function ft(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=mt.map(f=>{const{key:g,label:b}=f,p=`fonts.${g}`,d=s.watch(p);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:b}),d&&n.jsx("span",{className:"ml-auto truncate text-foreground",style:{fontFamily:d},children:d})]}),n.jsx(fe,{control:s.control,name:p,render:a=>{const{field:i}=a;return n.jsx(ue,{...i,value:i.value??"",onChange:u=>{i.onChange(u),o()},onBlur:()=>{i.onBlur(),l()},placeholder:`Font family for ${b.toLowerCase()}`})}})]},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Fonts",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}const ut=[{key:"primary",label:"Primary"},{key:"secondary",label:"Secondary"},{key:"accent",label:"Accent"},{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}];function xt(t){const e=K.c(6),{form:s,onFieldChange:o,onFieldCommit:l}=t;let r;e[0]!==s||e[1]!==o||e[2]!==l?(r=ut.map(f=>{const{key:g,label:b}=f,p=`colors.${g}`;return n.jsx(fe,{control:s.control,name:p,render:d=>{const{field:a}=d;return n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"color",value:a.value??"#000000",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.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:a.value??"",onChange:i=>{a.onChange(i.target.value),o()},onBlur:()=>{a.onBlur(),l()},placeholder:"#000000",className:"w-28"}),n.jsx("span",{className:"flex-1 text-xs text-muted-foreground",children:b})]})}},g)}),e[0]=s,e[1]=o,e[2]=l,e[3]=r):r=e[3];let c;return e[4]!==r?(c=n.jsx(we,{title:"Colors",children:n.jsx("div",{className:"space-y-2",children:r})}),e[4]=r,e[5]=c):c=e[5],c}function gt(t){const e=K.c(127),{brand:s,onChanged:o}=t,l=$e(),[r,c]=Te.useState(s.isDefault??!1),[f,g]=Te.useState(!1),b=s.name??"",p=s.domain??"",d=s.overview??"",a=s.logo??"",i=s.favicon??"",u=s.ogImage??"";let h;e[0]!==s.fonts?(h=s.fonts??{},e[0]=s.fonts,e[1]=h):h=e[1];let x;e[2]!==s.colors?(x=s.colors??{},e[2]=s.colors,e[3]=x):x=e[3];let v;e[4]!==b||e[5]!==p||e[6]!==d||e[7]!==a||e[8]!==i||e[9]!==u||e[10]!==h||e[11]!==x?(v={values:{name:b,domain:p,overview:d,logo:a,favicon:i,ogImage:u,fonts:h,colors:x}},e[4]=b,e[5]=p,e[6]=d,e[7]=a,e[8]=i,e[9]=u,e[10]=h,e[11]=x,e[12]=v):v=e[12];const m=Ue(v);let C;e[13]!==s.id||e[14]!==l?(C={mutationFn:async j=>{const ve=Object.values(j.fonts).some(wt),Ce=Object.values(j.colors).some(_t);await l.call("BRAND_CONTEXT_UPDATE",{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})},onError:Nt},e[13]=s.id,e[14]=l,e[15]=C):C=e[15];const k=ge(C);let D;e[16]!==s.id||e[17]!==m||e[18]!==o||e[19]!==k?(D={delayMs:500,save:async()=>{const j=m.control._formState.dirtyFields,ve=Object.keys(j);if(ve.length===0)return;const Ce=m.getValues(),Pe=m.control._defaultValues;m.reset(Ce,{keepValues:!0});try{await k.mutateAsync(Ce),H("brand_updated",{brand_id:s.id,fields:ve}),L.success("Brand context updated successfully"),o()}catch{m.reset(Pe,{keepValues:!0})}}},e[16]=s.id,e[17]=m,e[18]=o,e[19]=k,e[20]=D):D=e[20];const{schedule:y,flush:_}=ot(D);let $;e[21]!==s.id||e[22]!==l?($=async()=>{await l.call("BRAND_CONTEXT_DELETE",{id:s.id})},e[21]=s.id,e[22]=l,e[23]=$):$=e[23];let P;e[24]!==s.id||e[25]!==o?(P=()=>{H("brand_deleted",{brand_id:s.id}),g(!1),o(),L.success("Brand deleted")},e[24]=s.id,e[25]=o,e[26]=P):P=e[26];let q;e[27]!==$||e[28]!==P?(q={mutationFn:$,onSuccess:P,onError:Ct},e[27]=$,e[28]=P,e[29]=q):q=e[29];const{mutate:U,isPending:N}=ge(q);let A;e[30]!==s.id||e[31]!==s.isDefault||e[32]!==l?(A=async()=>{await l.call("BRAND_CONTEXT_UPDATE",{id:s.id,isDefault:!s.isDefault})},e[30]=s.id,e[31]=s.isDefault,e[32]=l,e[33]=A):A=e[33];let B;e[34]!==s.id||e[35]!==s.isDefault||e[36]!==o?(B=()=>{H(s.isDefault?"brand_unset_as_default":"brand_set_as_default",{brand_id:s.id}),o(),L.success(s.isDefault?"Removed as default brand":"Set as default brand")},e[34]=s.id,e[35]=s.isDefault,e[36]=o,e[37]=B):B=e[37];let T;e[38]!==A||e[39]!==B?(T={mutationFn:A,onSuccess:B,onError:vt},e[38]=A,e[39]=B,e[40]=T):T=e[40];const{mutate:X}=ge(T),xe=s.isDefault?"border-primary/30":"border-border/60";let O;e[41]!==xe?(O=_e("rounded-2xl border bg-background",xe),e[41]=xe,e[42]=O):O=e[42];let z;e[43]!==r?(z=()=>c(!r),e[43]=r,e[44]=z):z=e[44];let E;e[45]!==r?(E=n.jsx("span",{className:"shrink-0 text-muted-foreground",children:r?n.jsx(Xe,{size:14}):n.jsx(He,{size:14})}),e[45]=r,e[46]=E):E=e[46];let F;e[47]!==s.logo||e[48]!==s.name?(F=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:yt})}):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[47]=s.logo,e[48]=s.name,e[49]=F):F=e[49];const I=s.name||"Untitled Brand";let S;e[50]!==I?(S=n.jsx("span",{className:"text-sm font-medium text-foreground",children:I}),e[50]=I,e[51]=S):S=e[51];let R;e[52]!==s.domain?(R=s.domain&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:s.domain}),e[52]=s.domain,e[53]=R):R=e[53];let w;e[54]!==S||e[55]!==R?(w=n.jsxs("div",{className:"flex flex-1 flex-col items-start gap-0.5 overflow-hidden text-left",children:[S,R]}),e[54]=S,e[55]=R,e[56]=w):w=e[56];let M;e[57]!==s.colors||e[58]!==r?(M=!r&&s.colors&&Object.values(s.colors).some(jt)&&n.jsx("div",{className:"flex shrink-0 gap-1",children:Object.entries(s.colors).filter(bt).map(pt)}),e[57]=s.colors,e[58]=r,e[59]=M):M=e[59];let V;e[60]!==s.fonts||e[61]!==r?(V=!r&&s.fonts&&Object.values(s.fonts).some(ht)&&n.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:Object.values(s.fonts).filter(Boolean).join(", ")}),e[60]=s.fonts,e[61]=r,e[62]=V):V=e[62];const De=s.isDefault?"opacity-100":"opacity-0 hover:bg-muted group-hover:opacity-100";let Q;e[63]!==De?(Q=_e("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg transition-opacity",De),e[63]=De,e[64]=Q):Q=e[64];let G,Y;e[65]!==X?(G=j=>{j.stopPropagation(),X()},Y=j=>{j.key==="Enter"&&(j.stopPropagation(),X())},e[65]=X,e[66]=G,e[67]=Y):(G=e[66],Y=e[67]);const ke=s.isDefault?"Unset as default":"Set as default",Be=s.isDefault?"text-primary fill-primary":"text-muted-foreground";let J;e[68]!==Be?(J=_e(Be),e[68]=Be,e[69]=J):J=e[69];let W;e[70]!==J?(W=n.jsx(Me,{size:13,className:J}),e[70]=J,e[71]=W):W=e[71];let Z;e[72]!==Q||e[73]!==G||e[74]!==Y||e[75]!==ke||e[76]!==W?(Z=n.jsx("span",{role:"button",tabIndex:0,className:Q,onClick:G,onKeyDown:Y,title:ke,children:W}),e[72]=Q,e[73]=G,e[74]=Y,e[75]=ke,e[76]=W,e[77]=Z):Z=e[77];let he,pe;e[78]===Symbol.for("react.memo_cache_sentinel")?(he=j=>{j.stopPropagation(),g(!0)},pe=j=>{j.key==="Enter"&&(j.stopPropagation(),g(!0))},e[78]=he,e[79]=pe):(he=e[78],pe=e[79]);let be;e[80]===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(Qe,{size:13,className:"text-muted-foreground"})}),e[80]=be):be=e[80];let ee;e[81]!==z||e[82]!==E||e[83]!==F||e[84]!==w||e[85]!==M||e[86]!==V||e[87]!==Z?(ee=n.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 p-5",onClick:z,children:[E,F,w,M,V,Z,be]}),e[81]=z,e[82]=E,e[83]=F,e[84]=w,e[85]=M,e[86]=V,e[87]=Z,e[88]=ee):ee=e[88];let te;e[89]!==r||e[90]!==_||e[91]!==m||e[92]!==y?(te=r&&n.jsxs("div",{className:"space-y-3 px-5 pb-5",children:[n.jsx(it,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(dt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsx(xt,{form:m,onFieldChange:y,onFieldCommit:_}),n.jsx(ft,{form:m,onFieldChange:y,onFieldCommit:_})]})]}),e[89]=r,e[90]=_,e[91]=m,e[92]=y,e[93]=te):te=e[93];let se;e[94]!==N?(se=j=>{!j&&!N&&g(!1)},e[94]=N,e[95]=se):se=e[95];let je;e[96]===Symbol.for("react.memo_cache_sentinel")?(je=n.jsx(Ye,{children:"Delete brand?"}),e[96]=je):je=e[96];const Ee=s.name||"this brand";let ne;e[97]!==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[97]=Ee,e[98]=ne):ne=e[98];let le;e[99]!==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[99]=s.isDefault,e[100]=le):le=e[100];let oe;e[101]!==ne||e[102]!==le?(oe=n.jsxs(Je,{children:[je,n.jsx(We,{asChild:!0,children:n.jsxs("div",{children:[ne,le]})})]}),e[101]=ne,e[102]=le,e[103]=oe):oe=e[103];let re;e[104]!==N?(re=n.jsx(Ze,{disabled:N,children:"Cancel"}),e[104]=N,e[105]=re):re=e[105];let ae;e[106]!==U?(ae=j=>{j.preventDefault(),U()},e[106]=U,e[107]=ae):ae=e[107];const Fe=N?"Deleting...":"Delete";let ie;e[108]!==N||e[109]!==ae||e[110]!==Fe?(ie=n.jsx(et,{onClick:ae,disabled:N,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Fe}),e[108]=N,e[109]=ae,e[110]=Fe,e[111]=ie):ie=e[111];let ce;e[112]!==re||e[113]!==ie?(ce=n.jsxs(tt,{children:[re,ie]}),e[112]=re,e[113]=ie,e[114]=ce):ce=e[114];let de;e[115]!==oe||e[116]!==ce?(de=n.jsxs(st,{children:[oe,ce]}),e[115]=oe,e[116]=ce,e[117]=de):de=e[117];let me;e[118]!==f||e[119]!==se||e[120]!==de?(me=n.jsx(nt,{open:f,onOpenChange:se,children:de}),e[118]=f,e[119]=se,e[120]=de,e[121]=me):me=e[121];let ye;return e[122]!==O||e[123]!==ee||e[124]!==te||e[125]!==me?(ye=n.jsxs("div",{className:O,children:[ee,te,me]}),e[122]=O,e[123]=ee,e[124]=te,e[125]=me,e[126]=ye):ye=e[126],ye}function ht(t){return t}function pt(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 bt(t){const[,e]=t;return e}function jt(t){return t}function yt(t){t.target.style.display="none"}function vt(){return L.error("Failed to update default brand")}function Ct(){return L.error("Failed to delete brand")}function Nt(){return L.error("Failed to save brand context")}function _t(t){return t?.trim()}function wt(t){return t?.trim()}function Dt(){const t=K.c(53),{brandExtractEnabled:e}=ze(),{org:s}=Ie(),o=$e(),l=Le();let r;t[0]!==s.id?(r=Oe.brandContext(s.id),t[0]=s.id,t[1]=r):r=t[1];let c;t[2]!==o?(c=async()=>{const{items:w}=await o.call("BRAND_CONTEXT_LIST",{includeArchived:!1});return w},t[2]=o,t[3]=c):c=t[3];let f;t[4]!==r||t[5]!==c?(f={queryKey:r,queryFn:c},t[4]=r,t[5]=c,t[6]=f):f=t[6];const{data:g}=Ke(f),p=(g===void 0?[]:g).filter(Et);let d;t[7]!==s.id||t[8]!==l?(d=()=>l.invalidateQueries({queryKey:Oe.brandContext(s.id),refetchType:"all"}),t[7]=s.id,t[8]=l,t[9]=d):d=t[9];const a=d;let i;t[10]!==o?(i=async()=>{await o.call("BRAND_CONTEXT_CREATE",{name:"New Brand",domain:"example.com",overview:""})},t[10]=o,t[11]=i):i=t[11];let u;t[12]!==a?(u=()=>{H("brand_created"),a(),L.success("Brand created")},t[12]=a,t[13]=u):u=t[13];let h;t[14]!==i||t[15]!==u?(h={mutationFn:i,onSuccess:u,onError:Bt},t[14]=i,t[15]=u,t[16]=h):h=t[16];const{mutate:x,isPending:v}=ge(h);let m;t[17]!==o?(m=async w=>{H("brand_extract_started",{domain:w}),await o.call("BRAND_CONTEXT_EXTRACT",{domain:w})},t[17]=o,t[18]=m):m=t[18];let C;t[19]!==a?(C=()=>{H("brand_extract_succeeded"),a(),L.success("Brand extracted successfully")},t[19]=a,t[20]=C):C=t[20];let k;t[21]!==m||t[22]!==C?(k={mutationFn:m,onSuccess:C,onError:kt},t[21]=m,t[22]=C,t[23]=k):k=t[23];const{mutate:D,isPending:y}=ge(k),_=Ne,$=Ne,P=Ne,q="flex flex-col gap-6";let U;t[24]===Symbol.for("react.memo_cache_sentinel")?(U=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[24]=U):U=t[24];let N;t[25]!==x?(N=()=>x(),t[25]=x,t[26]=N):N=t[26];let A;t[27]===Symbol.for("react.memo_cache_sentinel")?(A=n.jsx(Re,{size:14}),t[27]=A):A=t[27];let B;t[28]!==v||t[29]!==N?(B=n.jsxs("div",{className:"flex items-center justify-between",children:[U,n.jsxs(Ae,{variant:"outline",onClick:N,disabled:v,children:[A,"Add Brand"]})]}),t[28]=v,t[29]=N,t[30]=B):B=t[30];let T;t[31]!==e||t[32]!==D||t[33]!==y?(T=e&&n.jsx(at,{onExtract:w=>D(w),isExtracting:y}),t[31]=e,t[32]=D,t[33]=y,t[34]=T):T=t[34];const X=p.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(Ae,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>x(),disabled:v,children:[n.jsx(Re,{size:14}),"Add your first brand"]})]}),xe="group space-y-3";let O;t[35]!==a?(O=w=>n.jsx(gt,{brand:w,onChanged:a},w.id),t[35]=a,t[36]=O):O=t[36];const z=p.map(O);let E;t[37]!==z?(E=n.jsx("div",{className:xe,children:z}),t[37]=z,t[38]=E):E=t[38];let F;t[39]!==B||t[40]!==T||t[41]!==X||t[42]!==E?(F=n.jsxs("div",{className:q,children:[B,T,X,E]}),t[39]=B,t[40]=T,t[41]=X,t[42]=E,t[43]=F):F=t[43];let I;t[44]!==P.Body||t[45]!==F?(I=n.jsx(P.Body,{children:F}),t[44]=P.Body,t[45]=F,t[46]=I):I=t[46];let S;t[47]!==$.Content||t[48]!==I?(S=n.jsx($.Content,{children:I}),t[47]=$.Content,t[48]=I,t[49]=S):S=t[49];let R;return t[50]!==_||t[51]!==S?(R=n.jsx(_,{children:S}),t[50]=_,t[51]=S,t[52]=R):R=t[52],R}function kt(t){H("brand_extract_failed",{error:t instanceof Error?t.message:"unknown"}),L.error(t instanceof Error?t.message:"Failed to extract brand")}function Bt(){return L.error("Failed to create brand")}function Et(t){return!t.archivedAt}function es(){const t=K.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(rt,{capability:"org:manage",area:"brand context",children:n.jsx(Dt,{})}),t[0]=e):e=t[0],e}export{es as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as D,j as t,E as V,r as v,B as F,t as _}from"./index-thaZU0eY.js";import{i as J}from"./AlertCircle-CccbK4hX.js";import{i as O}from"./HardDrive-BJOyfL1s.js";import{s as L}from"./Plus-CoqGiEoW.js";import{s as Q}from"./Trash01-2bgd5rb5.js";import{A as X,g as Y,c as Z,b as ee,d as te,e as se,a as ie,f as re}from"./alert-dialog-DT6CiV3D.js";import{e as ne,d as le,c as ae,a as oe,b as ce,D as de}from"./dialog-DTR6Ld8R.js";import{I as N}from"./input-DEr8h15j.js";import{L as C}from"./label-D9vlZKHj.js";import{d as me,S as ue,a as fe,b as pe,c as q}from"./select-fd5CQiLd.js";import{S as xe}from"./switch-Dg1aulpi.js";import{S as he}from"./skeleton-Cz4bac5f.js";import{T as ge}from"./textarea-DEWiELfd.js";import{P}from"./index-Fc19vagy.js";import{c as je}from"./settings-section-C4B_agjR.js";import{u as ye,b as be,c as ve}from"./use-file-configs-D99FvcSf.js";import{R as Se}from"./require-capability-bBFf7mtX.js";import"./X-dW9CI9iO.js";import"./tooltip-D9_AyRKs.js";import"./Check-WJIsHzDQ.js";import"./ChevronDown-CAuaRLDM.js";import"./ChevronUp-D-qnR_uM.js";import"./sidebar-DSPYyChk.js";import"./LayoutLeft-DNsGMIFw.js";import"./use-mobile-B23FisN_.js";import"./sheet-C-KllyIc.js";import"./card-WdSE0wjZ.js";import"./ArrowUpRight-BgdgTW8q.js";import"./studio-tools-C88q8wAb.js";import"./use-capability-DUO16Em8.js";import"./access-gate-uhjaq2Ab.js";import"./capability-load-error-mGRKLuE9.js";function Ce(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 ke(s){const e=D.c(3),{error:i}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(J,{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 Ne(s){const e=D.c(44),{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(O,{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.credentialType?(o=i.credentialType==="sts-session"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"STS"}):i.credentialType==="managed"?t.jsx("span",{className:"text-[10px] uppercase tracking-wide font-medium px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:"Managed"}):null,e[3]=i.credentialType,e[4]=o):o=e[4];let g;e[5]!==i.bucket||e[6]!==i.region?(g=t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:[i.bucket," · ",i.region]}),e[5]=i.bucket,e[6]=i.region,e[7]=g):g=e[7];let c;e[8]!==l||e[9]!==o||e[10]!==g?(c=t.jsxs("div",{className:"flex items-center gap-2",children:[l,o,g]}),e[8]=l,e[9]=o,e[10]=g,e[11]=c):c=e[11];let b;e[12]!==i.description?(b=i.description?t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:i.description}):null,e[12]=i.description,e[13]=b):b=e[13];let j;e[14]!==i.endpoint||e[15]!==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[14]=i.endpoint,e[15]=i.forcePathStyle,e[16]=j):j=e[16];let d;e[17]!==i.prefix?(d=i.prefix?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["prefix: ",i.prefix]}):null,e[17]=i.prefix,e[18]=d):d=e[18];let m;e[19]!==i.publicUrlBase?(m=i.publicUrlBase?t.jsxs("p",{className:"text-xs text-muted-foreground/80 mt-0.5 truncate font-mono",children:["public: ",i.publicUrlBase]}):null,e[19]=i.publicUrlBase,e[20]=m):m=e[20];let y;e[21]!==c||e[22]!==b||e[23]!==j||e[24]!==d||e[25]!==m?(y=t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[r,t.jsxs("div",{className:"min-w-0",children:[c,b,j,d,m]})]}),e[21]=c,e[22]=b,e[23]=j,e[24]=d,e[25]=m,e[26]=y):y=e[26];let f;e[27]!==i.createdAt?(f=new Date(i.createdAt).toLocaleDateString(),e[27]=i.createdAt,e[28]=f):f=e[28];let u;e[29]!==f?(u=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[29]=f,e[30]=u):u=e[30];let p;e[31]!==i||e[32]!==n?(p=()=>n(i),e[31]=i,e[32]=n,e[33]=p):p=e[33];const x=`Delete ${i.name}`;let h;e[34]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Q,{size:14}),e[34]=h):h=e[34];let k;e[35]!==p||e[36]!==x?(k=t.jsx(F,{variant:"ghost",size:"sm",onClick:p,"aria-label":x,children:h}),e[35]=p,e[36]=x,e[37]=k):k=e[37];let S;e[38]!==u||e[39]!==k?(S=t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u,k]}),e[38]=u,e[39]=k,e[40]=S):S=e[40];let A;return e[41]!==y||e[42]!==S?(A=t.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[y,S]}),e[41]=y,e[42]=S,e[43]=A):A=e[43],A}function Ae(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(O,{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(L,{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(F,{onClick:i,size:"sm",className:"mt-2",children:[l,"Add bucket"]})]}),e[3]=i,e[4]=o):o=e[4],o}function K({open:s,onOpenChange:e}){const[i,n]=v.useState(""),[r,l]=v.useState(""),[o,g]=v.useState(""),[c,b]=v.useState(""),[j,d]=v.useState(""),[m,y]=v.useState(!1),[f,u]=v.useState(""),[p,x]=v.useState(""),[h,k]=v.useState("static"),[S,A]=v.useState(""),[R,I]=v.useState(""),[T,U]=v.useState(""),[B,E]=v.useState(""),w=be();function $(){n(""),l(""),g(""),b(""),d(""),y(!1),u(""),x(""),k("static"),A(""),I(""),U(""),E("")}const z=h==="sts-session"?!!(T.trim()&&B.trim()):!!(S&&R);async function M(a){if(a.preventDefault(),!i.trim()||!o.trim()||!c.trim()||!z)return;const W=h==="sts-session"?{credentialType:"sts-session",refreshUrl:T.trim(),apiKey:B.trim()}:{credentialType:"static",accessKeyId:S,secretAccessKey:R};try{await w.mutateAsync({name:i.trim(),description:r.trim()||void 0,bucket:o.trim(),region:c.trim(),endpoint:j.trim()||void 0,forcePathStyle:m,prefix:f.trim()||void 0,publicUrlBase:p.trim()||void 0,...W}),_.success(`Bucket "${i.trim()}" added`),$(),e(!1)}catch(H){_.error(Ce(H,"Failed to add bucket"))}}const G=w.isPending||!i.trim()||!o.trim()||!c.trim()||!z;return t.jsx(ne,{open:s,onOpenChange:e,children:t.jsxs(le,{className:"sm:max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsxs(ae,{children:[t.jsx(oe,{children:"Add S3 bucket"}),t.jsx(ce,{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:M,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-name",children:"Name"}),t.jsx(N,{id:"file-config-name",value:i,onChange:a=>n(a.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(C,{htmlFor:"file-config-bucket",children:"Bucket"}),t.jsx(N,{id:"file-config-bucket",value:o,onChange:a=>g(a.target.value),placeholder:"my-bucket",autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-region",children:"Region"}),t.jsx(N,{id:"file-config-region",value:c,onChange:a=>b(a.target.value),placeholder:"us-east-1",autoComplete:"off",required:!0})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-endpoint",children:"Endpoint (optional)"}),t.jsx(N,{id:"file-config-endpoint",type:"url",value:j,onChange:a=>d(a.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(C,{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(xe,{id:"file-config-path-style",checked:m,onCheckedChange:y})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-prefix",children:"Key prefix (optional)"}),t.jsx(N,{id:"file-config-prefix",value:f,onChange:a=>u(a.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(C,{htmlFor:"file-config-public-url-base",children:"Public URL base (optional)"}),t.jsx(N,{id:"file-config-public-url-base",type:"url",value:p,onChange:a=>x(a.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(C,{htmlFor:"file-config-credential-type",children:"Credentials"}),t.jsxs(me,{value:h,onValueChange:a=>k(a),children:[t.jsx(ue,{id:"file-config-credential-type",className:"w-full",children:t.jsx(fe,{})}),t.jsxs(pe,{children:[t.jsx(q,{value:"static",children:"Static key pair (long-lived)"}),t.jsx(q,{value:"sts-session",children:"Temporary session (STS, auto-refreshed)"})]})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:h==="sts-session"?"Stores only a refresh endpoint + API key; short-lived credentials are fetched on demand and refreshed automatically.":"A long-lived access key ID and secret, used as-is."})]}),h==="static"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-access-key",children:"Access key ID"}),t.jsx(N,{id:"file-config-access-key",value:S,onChange:a=>A(a.target.value),autoComplete:"off",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-secret-key",children:"Secret access key"}),t.jsx(N,{id:"file-config-secret-key",type:"password",value:R,onChange:a=>I(a.target.value),autoComplete:"new-password",required:!0})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-refresh-url",children:"Refresh URL"}),t.jsx(N,{id:"file-config-refresh-url",type:"url",value:T,onChange:a=>U(a.target.value),placeholder:"https://admin.example.com/api/acme/s3-credentials",autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Endpoint POSTed (with the API key below) to vend temporary credentials. Must return accessKeyId, secretAccessKey, sessionToken, and expiration."})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-api-key",children:"API key"}),t.jsx(N,{id:"file-config-api-key",type:"password",value:B,onChange:a=>E(a.target.value),autoComplete:"new-password",required:!0}),t.jsxs("p",{className:"text-xs text-muted-foreground",children:["Sent as the ",t.jsx("code",{children:"x-api-key"})," header on each refresh call."]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(C,{htmlFor:"file-config-description",children:"Description (optional)"}),t.jsx(ge,{id:"file-config-description",value:r,onChange:a=>l(a.target.value),rows:2,placeholder:"What is this bucket used for?"})]}),t.jsxs(de,{children:[t.jsx(F,{type:"button",variant:"outline",onClick:()=>{$(),e(!1)},disabled:w.isPending,children:"Cancel"}),t.jsx(F,{type:"submit",disabled:G,children:w.isPending?"Adding…":"Add bucket"})]})]})]})})}function De(s){const e=D.c(25),{config:i,onClose:n}=s,r=ve();let l;e[0]!==i||e[1]!==r||e[2]!==n?(l=async function(){if(i)try{await r.mutateAsync(i.id),_.success(`Bucket "${i.name}" removed`),n()}catch(k){const S=k;_.error(S instanceof Error?S.message:"Failed to remove bucket")}},e[0]=i,e[1]=r,e[2]=n,e[3]=l):l=e[3];const o=l,g=i!==null;let c;e[4]!==n?(c=h=>!h&&n(),e[4]=n,e[5]=c):c=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Z,{children:"Remove bucket configuration?"}),e[6]=b):b=e[6];const j=i?.name;let d;e[7]!==j?(d=t.jsxs(ee,{children:[b,t.jsxs(te,{children:["This deletes the encrypted credentials for"," ",t.jsx("span",{className:"font-medium",children:j}),". The bucket itself is not affected. This cannot be undone."]})]}),e[7]=j,e[8]=d):d=e[8];let m;e[9]!==r.isPending?(m=t.jsx(X,{disabled:r.isPending,children:"Cancel"}),e[9]=r.isPending,e[10]=m):m=e[10];const y=r.isPending?"Removing…":"Remove";let f;e[11]!==r.isPending||e[12]!==o||e[13]!==y?(f=t.jsx(Y,{onClick:o,disabled:r.isPending,children:y}),e[11]=r.isPending,e[12]=o,e[13]=y,e[14]=f):f=e[14];let u;e[15]!==m||e[16]!==f?(u=t.jsxs(se,{children:[m,f]}),e[15]=m,e[16]=f,e[17]=u):u=e[17];let p;e[18]!==u||e[19]!==d?(p=t.jsxs(ie,{children:[d,u]}),e[18]=u,e[19]=d,e[20]=p):p=e[20];let x;return e[21]!==p||e[22]!==g||e[23]!==c?(x=t.jsx(re,{open:g,onOpenChange:c,children:p}),e[21]=p,e[22]=g,e[23]=c,e[24]=x):x=e[24],x}function Fe(){const s=D.c(25),e=ye(),[i,n]=v.useState(!1),[r,l]=v.useState(null);if(e.length===0){let x;s[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(Ae,{onCreate:()=>n(!0)}),s[0]=x):x=s[0];let h;return s[1]!==i?(h=t.jsxs(t.Fragment,{children:[x,t.jsx(K,{open:i,onOpenChange:n})]}),s[1]=i,s[2]=h):h=s[2],h}const o=e.length===1?"":"s";let g;s[3]!==e.length||s[4]!==o?(g=t.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length," bucket",o," configured"]}),s[3]=e.length,s[4]=o,s[5]=g):g=s[5];let c;s[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n(!0),s[6]=c):c=s[6];let b;s[7]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsxs(F,{onClick:c,size:"sm",children:[t.jsx(L,{size:14}),"Add bucket"]}),s[7]=b):b=s[7];let j;s[8]!==g?(j=t.jsxs("div",{className:"flex items-center justify-between",children:[g,b]}),s[8]=g,s[9]=j):j=s[9];let d;if(s[10]!==e){let x;s[12]===Symbol.for("react.memo_cache_sentinel")?(x=h=>t.jsx(Ne,{config:h,onDelete:l},h.id),s[12]=x):x=s[12],d=e.map(x),s[10]=e,s[11]=d}else d=s[11];let m;s[13]!==d?(m=t.jsx("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:t.jsx("div",{children:d})}),s[13]=d,s[14]=m):m=s[14];let y;s[15]!==i?(y=t.jsx(K,{open:i,onOpenChange:n}),s[15]=i,s[16]=y):y=s[16];let f;s[17]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),s[17]=f):f=s[17];let u;s[18]!==r?(u=t.jsx(De,{config:r,onClose:f}),s[18]=r,s[19]=u):u=s[19];let p;return s[20]!==j||s[21]!==m||s[22]!==y||s[23]!==u?(p=t.jsxs(t.Fragment,{children:[j,m,y,u]}),s[20]=j,s[21]=m,s[22]=y,s[23]=u,s[24]=p):p=s[24],p}function we(){const s=D.c(2);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(P.Title,{children:"Buckets"}),s[0]=e):e=s[0];let i;return s[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(P,{children:t.jsx(P.Content,{children:t.jsx(P.Body,{children:t.jsxs(je,{children:[e,t.jsx(V,{fallback:Pe,children:t.jsx(v.Suspense,{fallback:t.jsx(he,{className:"h-32 w-full"}),children:t.jsx(Fe,{})})})]})})})}),s[1]=i):i=s[1],i}function Pe(s){const{error:e}=s;return t.jsx(ke,{error:e??new Error("Failed to load file configs")})}function ct(){const s=D.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Se,{capability:"file-configs:manage",area:"files",children:t.jsx(we,{})}),s[0]=e):e=s[0],e}export{ct as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Q,l as Y,j as t,r as W,B as J,i as le}from"./index-thaZU0eY.js";import{_ as Z}from"./agent-icon-8-zG6zq2.js";import{i as ie}from"./X-dW9CI9iO.js";import{L as O}from"./label-D9vlZKHj.js";import{I as oe,R as re,a as ae}from"./index-C4qtLNrN.js";import{i as ce}from"./Circle-KYXNByEA.js";import{d as ne,S as me,a as de,b as pe,c as xe}from"./select-fd5CQiLd.js";import{a as fe,b as ue,T as he}from"./tooltip-D9_AyRKs.js";import"./AlertCircle-CccbK4hX.js";import"./Tool01-CExdAfac.js";import"./SwitchHorizontal01-8YfzWW4j.js";import"./Settings02-Dy5hRJWC.js";import"./XCircle-BLHWvvQb.js";import"./ArrowUpRight-BgdgTW8q.js";import"./ZapSquare-BllWW0jW.js";import"./Users03-m0mGCSLF.js";import"./Loading02-Cv_WFApk.js";import"./CheckCircle-CM68yWPW.js";import"./Check-WJIsHzDQ.js";import"./ChevronDown-CAuaRLDM.js";import"./ChevronRight-B7czck1y.js";import"./ChevronUp-D-qnR_uM.js";import"./Stars02-XLaFEqA9.js";import"./Copy01-gjq995Op.js";import"./ZoomOut-6KFj5qIF.js";import"./DotsVertical-BVo4MRpu.js";import"./Globe01-BwRmuR_8.js";import"./Eye-Bn25ApPz.js";import"./FilterLines-DaZCku74.js";import"./Star01-Bbn22eVo.js";import"./Globe04-9qIG4QhN.js";import"./HardDrive-BJOyfL1s.js";import"./Key01-CDa-PA-y.js";import"./LayoutLeft-DNsGMIFw.js";import"./LinkExternal01-B-q2TCWq.js";import"./List-CDS_Rmur.js";import"./Monitor01-ChrDLGXa.js";import"./Sun-Cf2_RQhM.js";import"./Palette-CqqDm4G9.js";import"./Play-BLXO22JW.js";import"./Plus-CoqGiEoW.js";import"./SearchLg-BJoMxiDy.js";import"./SearchMd-YxzpYnNt.js";import"./Shield01-Dg-emZom.js";import"./Stars01-0N0PIoFw.js";import"./Trash01-2bgd5rb5.js";import"./Upload01-Da0GcY9n.js";import"./User01-DWmqguL8.js";import"./Users01-qo0Pfdbq.js";import"./XClose-BsCsQOzu.js";import"./Zap-NxwXfCyT.js";function ge(i){const e=Q.c(8);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=Y("grid gap-3",o),e[3]=o,e[4]=r):r=e[4];let l;return e[5]!==s||e[6]!==r?(l=t.jsx(re,{"data-slot":"radio-group",className:r,...s}),e[5]=s,e[6]=r,e[7]=l):l=e[7],l}function X(i){const e=Q.c(9);let o,s;e[0]!==i?({className:o,...s}=i,e[0]=i,e[1]=o,e[2]=s):(o=e[1],s=e[2]);let r;e[3]!==o?(r=Y("border-input text-primary 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 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:opacity-50",o),e[3]=o,e[4]=r):r=e[4];let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ae,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:t.jsx(ce,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})}),e[5]=l):l=e[5];let c;return e[6]!==s||e[7]!==r?(c=t.jsx(oe,{"data-slot":"radio-group-item",className:r,...s,children:l}),e[6]=s,e[7]=r,e[8]=c):c=e[8],c}function gt(i){const e=Q.c(69),{posts:o,categories:s,initialSlug:r,isPending:l,onApply:c,onClose:d}=i,[n,ee]=W.useState(r&&s.some(m=>m.slug===r)?r:s[0]?.slug??""),[p,te]=W.useState("add");let T;if(e[0]!==s||e[1]!==n){let m;e[3]!==n?(m=se=>se.slug===n,e[3]=n,e[4]=m):m=e[4],T=s.find(m),e[0]=s,e[1]=n,e[2]=T}else T=e[2];const x=T,a=o.length,K=a===1?"post":"posts";let f;e[5]!==a||e[6]!==K?(f=t.jsxs("span",{className:"truncate text-sm font-medium",children:[a," ",K," selected"]}),e[5]=a,e[6]=K,e[7]=f):f=e[7];let E;e[8]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ie,{size:14}),e[8]=E):E=e[8];let u;e[9]!==l||e[10]!==d?(u=t.jsx(fe,{asChild:!0,children:t.jsx(J,{type:"button",variant:"ghost",size:"icon",disabled:l,onClick:d,"aria-label":"Exit selection",children:E})}),e[9]=l,e[10]=d,e[11]=u):u=e[11];let I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ue,{side:"bottom",children:"Exit selection"}),e[12]=I):I=e[12];let h;e[13]!==u?(h=t.jsxs(he,{children:[u,I]}),e[13]=u,e[14]=h):h=e[14];let g;e[15]!==f||e[16]!==h?(g=t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[f,h]}),e[15]=f,e[16]=h,e[17]=g):g=e[17];let A;e[18]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Update category"}),e[18]=A):A=e[18];const M=a===0?"Select posts from the list to choose what this update applies to.":`Choose a category to apply to ${a} ${a===1?"post":"posts"}.`;let j;e[19]!==M?(j=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:M}),e[19]=M,e[20]=j):j=e[20];let B;e[21]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(O,{children:"Category"}),e[21]=B):B=e[21];let b;e[22]!==s||e[23]!==n?(b=t.jsxs("div",{className:"space-y-2",children:[B,s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground",children:"No categories yet — create one in the Categories collection."}):t.jsxs(ne,{value:n,onValueChange:ee,children:[t.jsx(me,{className:"w-full",children:t.jsx(de,{placeholder:"Select a category"})}),t.jsx(pe,{children:s.map(be)})]})]}),e[22]=s,e[23]=n,e[24]=b):b=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=m=>te(m),e[25]=F):F=e[25];let V;e[26]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(X,{value:"add",id:"cat-mode-add",className:"mt-0.5"}),e[26]=V):V=e[26];let G;e[27]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsxs(O,{htmlFor:"cat-mode-add",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[V,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Add category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Keep existing categories and add this one."})]})]}),e[27]=G):G=e[27];let L;e[28]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(X,{value:"replace",id:"cat-mode-replace",className:"mt-0.5"}),e[28]=L):L=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs(O,{htmlFor:"cat-mode-replace",className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3",children:[L,t.jsxs("span",{className:"space-y-0.5",children:[t.jsx("span",{className:"block text-sm font-medium",children:"Replace category"}),t.jsx("span",{className:"block text-xs text-muted-foreground",children:"Remove all current categories and set only this one."})]})]}),e[29]=P):P=e[29];let y;e[30]!==p?(y=t.jsxs(ge,{value:p,onValueChange:F,className:"gap-2",children:[G,P]}),e[30]=p,e[31]=y):y=e[31];let N;e[32]!==l||e[33]!==d?(N=t.jsx(J,{type:"button",variant:"outline",onClick:d,disabled:l,children:"Cancel"}),e[32]=l,e[33]=d,e[34]=N):N=e[34];const D=!x||l||a===0;let v;e[35]!==p||e[36]!==c||e[37]!==x?(v=()=>x&&c(p,{name:x.name,slug:x.slug}),e[35]=p,e[36]=c,e[37]=x,e[38]=v):v=e[38];let S;e[39]!==l?(S=l?t.jsxs(t.Fragment,{children:[t.jsx(le,{size:14,className:"animate-spin"}),"Updating…"]}):"Apply",e[39]=l,e[40]=S):S=e[40];let _;e[41]!==D||e[42]!==v||e[43]!==S?(_=t.jsx(J,{type:"button",disabled:D,onClick:v,children:S}),e[41]=D,e[42]=v,e[43]=S,e[44]=_):_=e[44];let k;e[45]!==N||e[46]!==_?(k=t.jsxs("div",{className:"flex justify-end gap-2",children:[N,_]}),e[45]=N,e[46]=_,e[47]=k):k=e[47];let C;e[48]!==b||e[49]!==y||e[50]!==k?(C=t.jsxs("div",{className:"mt-6 space-y-4",children:[b,y,k]}),e[48]=b,e[49]=y,e[50]=k,e[51]=C):C=e[51];let U;e[52]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(Z,{size:16,className:"shrink-0 text-muted-foreground"}),e[52]=U):U=e[52];const H=a===1?"post":"posts";let w;e[53]!==a||e[54]!==H?(w=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",children:[U,t.jsxs("span",{className:"text-sm",children:[a," selected ",H]})]}),e[53]=a,e[54]=H,e[55]=w):w=e[55];let R;e[56]!==a||e[57]!==o?(R=a===0?t.jsx("p",{className:"border-t bg-background px-4 py-3 text-sm text-muted-foreground",children:"No posts selected yet — pick them from the list on the left."}):t.jsx("ul",{className:"divide-y border-t bg-background",children:o.map(je)}),e[56]=a,e[57]=o,e[58]=R):R=e[58];let $;e[59]!==w||e[60]!==R?($=t.jsxs("div",{className:"mt-8 overflow-hidden rounded-lg border bg-muted/30",children:[w,R]}),e[59]=w,e[60]=R,e[61]=$):$=e[61];let z;e[62]!==j||e[63]!==C||e[64]!==$?(z=t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-2xl px-8 py-8",children:[A,j,C,$]})}),e[62]=j,e[63]=C,e[64]=$,e[65]=z):z=e[65];let q;return e[66]!==z||e[67]!==g?(q=t.jsxs("div",{className:"flex h-full flex-col",children:[g,z]}),e[66]=z,e[67]=g,e[68]=q):q=e[68],q}function je(i){return t.jsxs("li",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[t.jsx(Z,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:i.title}),i.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:i.slug})]})]},i.key)}function be(i){return t.jsx(xe,{value:i.slug,children:t.jsx("span",{className:"truncate",children:i.name})},i.slug)}export{gt as BulkCategoryPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as a,m as o,D as c,j as t,W as m,B as u,K as x}from"./index-thaZU0eY.js";function f(){const e=a.c(5),l=o(),{locator:n}=c();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(m,{size:28})}),e[0]=s):s=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Couldn't load your permissions"}),t.jsx("p",{className:"mx-auto max-w-sm text-sm text-muted-foreground",children:"Something went wrong checking your access. This is usually temporary."})]}),e[1]=i):i=e[1];let r;return e[2]!==n||e[3]!==l?(r=t.jsxs("div",{className:"flex h-full min-h-[60vh] flex-1 flex-col items-center justify-center gap-4 p-6 text-center",children:[s,i,t.jsx(u,{variant:"outline",size:"sm",onClick:()=>l.invalidateQueries({queryKey:x.myCapabilities(n)}),children:"Try again"})]}),e[2]=n,e[3]=l,e[4]=r):r=e[4],r}export{f as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as J,r as S,l as Q,j as t,B as U,i as V,t as I}from"./index-thaZU0eY.js";import{i as X}from"./XCircle-BLHWvvQb.js";import{aE as Y,_ as T}from"./agent-icon-8-zG6zq2.js";import{n as Z}from"./LinkExternal01-B-q2TCWq.js";import{f as _,a as K,b as tt,c as et,d as ot,e as rt,A as it,g as st}from"./alert-dialog-DT6CiV3D.js";import{I as L}from"./input-DEr8h15j.js";import{L as M}from"./label-D9vlZKHj.js";import{au as at,av as mt,aD as nt,at as lt,aw as R,ay as pt,aE as ct}from"./index-OMZJdpqB.js";import{c as dt,B as ut,a as gt}from"./block-document-B3VgVdww.js";import{u as xt,s as v,E as ft}from"./primitives-DCgBLYjb.js";import{t as ht}from"./ChevronDown-CAuaRLDM.js";import{h as jt,j as yt,f as vt}from"./scroll-area-urNhBz-2.js";import"./AlertCircle-CccbK4hX.js";import"./Tool01-CExdAfac.js";import"./SwitchHorizontal01-8YfzWW4j.js";import"./Settings02-Dy5hRJWC.js";import"./ArrowUpRight-BgdgTW8q.js";import"./ZapSquare-BllWW0jW.js";import"./Users03-m0mGCSLF.js";import"./Loading02-Cv_WFApk.js";import"./CheckCircle-CM68yWPW.js";import"./Check-WJIsHzDQ.js";import"./ChevronRight-B7czck1y.js";import"./ChevronUp-D-qnR_uM.js";import"./Circle-KYXNByEA.js";import"./Stars02-XLaFEqA9.js";import"./Copy01-gjq995Op.js";import"./ZoomOut-6KFj5qIF.js";import"./DotsVertical-BVo4MRpu.js";import"./Globe01-BwRmuR_8.js";import"./Eye-Bn25ApPz.js";import"./FilterLines-DaZCku74.js";import"./Star01-Bbn22eVo.js";import"./Globe04-9qIG4QhN.js";import"./HardDrive-BJOyfL1s.js";import"./Key01-CDa-PA-y.js";import"./LayoutLeft-DNsGMIFw.js";import"./List-CDS_Rmur.js";import"./Monitor01-ChrDLGXa.js";import"./Sun-Cf2_RQhM.js";import"./Palette-CqqDm4G9.js";import"./Play-BLXO22JW.js";import"./Plus-CoqGiEoW.js";import"./SearchLg-BJoMxiDy.js";import"./SearchMd-YxzpYnNt.js";import"./Shield01-Dg-emZom.js";import"./Stars01-0N0PIoFw.js";import"./Trash01-2bgd5rb5.js";import"./Upload01-Da0GcY9n.js";import"./User01-DWmqguL8.js";import"./Users01-qo0Pfdbq.js";import"./XClose-BsCsQOzu.js";import"./X-dW9CI9iO.js";import"./Zap-NxwXfCyT.js";import"./library-tab-dvlvVDBE.js";import"./chat-context-p7bQrjVO.js";import"./hooks-355Y2AQ-.js";import"./use-mcp-client-B7zSFiOA.js";import"./constants-nH3qQ_1f.js";import"./auth-D-3BenR-.js";import"./decopilot-sse-pool-wsz4kVX9.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-BplbsFwA.js";import"./use-collections-BLTNEY6D.js";import"./use-ai-providers-C9ok3iTv.js";import"./studio-tools-C88q8wAb.js";import"./use-decopilot-events-CdGe1kZY.js";import"./tab-id-Bgchl1bv.js";import"./use-organization-settings-CtWuj0-0.js";import"./tooltip-D9_AyRKs.js";import"./dialog-DTR6Ld8R.js";import"./drawer-tKmBK0sh.js";import"./collection-search-CwfTIp5v.js";import"./use-mobile-B23FisN_.js";import"./use-mcp-prompts-BMNQ61Xi.js";import"./shell-layout-BnoAEqpd.js";import"./avatar-D9dkHpvf.js";import"./required-auth-layout-DiYJUK17.js";import"./use-org-sso-BCol3dQF.js";import"./form-Bdg2md6z.js";import"./select-fd5CQiLd.js";import"./tabs-BJWmaLw8.js";import"./toggle-group-CvC6sjCU.js";import"./agent-capabilities-CUZgw2cK.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-CrmcBQ7w.js";import"./use-registry-connections-BfySsVRx.js";import"./use-connection-DV6jfeKV.js";import"./useInfiniteQuery-Deh6Q8fX.js";import"./use-infinite-scroll-CCgHyhHc.js";import"./extract-connection-data-hbWCHJzS.js";import"./card-WdSE0wjZ.js";import"./integration-icon-zZ56Ie6s.js";import"./collection-tabs-byFj2Ujd.js";import"./badge-C9YrQiOl.js";import"./textarea-DEWiELfd.js";import"./connection-form-helpers-BEquM1Ke.js";import"./authenticate-and-persist-oauth-cOkcseWI.js";import"./mcp-oauth-HycnBVan.js";import"./useSuspenseInfiniteQuery-Cx1a_TEJ.js";import"./connect-desktop-dialog-Af91UVe4.js";import"./decopilot-Dj817txh.js";import"./checkbox-Cf98ydrt.js";import"./skeleton-Cz4bac5f.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-C4B_agjR.js";import"./popover-BH74zFmN.js";import"./command-Be3tajRL.js";import"./index-Ci3919Ge.js";import"./index-CbcN0I3P.js";import"./file-type-icon-ByfDUgJ1.js";import"./toolbar-Cs8I9yhI.js";import"./use-debounced-value-Dk3ZHqhr.js";import"./dropdown-menu-D5GBwmj-.js";import"./index-Cg7efYOu.js";import"./question-004-sINsf4GQ.js";import"./task-row-BPMcTFbK.js";import"./task-status-pzbr--Ml.js";import"./format-time-Cy7tTmZp.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-clock-tick-Cr8Z09wV.js";import"./use-status-sounds-QZH24TPY.js";import"./empty-state-Drp2V-gT.js";import"./use-mcp-tools-CXGlYiLZ.js";import"./types-BL5SG5y5.js";import"./use-capability-DUO16Em8.js";import"./tools-list-D8G7Mcid.js";import"./switch-Dg1aulpi.js";import"./use-debounced-autosave-B2imKI8J.js";import"./index-Fc19vagy.js";import"./sidebar-DSPYyChk.js";import"./sheet-C-KllyIc.js";import"./search-input-DLqCE5vh.js";import"./github-repo-picker-BxPl8GNJ.js";import"./use-navigate-to-agent-ChQTAqDN.js";import"./github-installations-DzN1UQ4x.js";import"./use-secrets-KLMNhfAU.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./toolbar-icon-button-b0ekhhMY.js";import"./calendar-CVkRKG_3.js";import"./use-file-configs-D99FvcSf.js";import"./monaco-editor-BfF7h5UL.js";import"./select-model-lznBUFcI.js";import"./use-automations-BGAQUfh0.js";import"./automation-runs-DHORxp2E.js";import"./table-Z9PtYtMe.js";import"./use-members-ItYzCRBH.js";import"./use-org-auth-client-CW518BNQ.js";import"./automation-list-row-DNZxP8s9.js";import"./use-copy--Yb2hvIV.js";import"./content-blocks-o63cs2vh.js";function bt(k){const e=J.c(18),{icon:f,title:n,defaultOpen:b,children:d}=k,D=b===void 0?!1:b,[x,A]=S.useState(D);let l;e[0]!==f?(l=t.jsx(f,{size:15}),e[0]=f,e[1]=l):l=e[1];let i;e[2]!==n?(i=t.jsx("span",{className:"flex-1 text-left",children:n}),e[2]=n,e[3]=i):i=e[3];const h=x&&"rotate-180";let r;e[4]!==h?(r=Q("transition-transform",h),e[4]=h,e[5]=r):r=e[5];let p;e[6]!==r?(p=t.jsx(ht,{size:15,className:r}),e[6]=r,e[7]=p):p=e[7];let c;e[8]!==l||e[9]!==i||e[10]!==p?(c=t.jsx(jt,{asChild:!0,children:t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground cursor-pointer",children:[l,i,p]})}),e[8]=l,e[9]=i,e[10]=p,e[11]=c):c=e[11];let s;e[12]!==d?(s=t.jsx(yt,{className:"px-2 pt-4",children:d}),e[12]=d,e[13]=s):s=e[13];let u;return e[14]!==x||e[15]!==c||e[16]!==s?(u=t.jsxs(vt,{open:x,onOpenChange:A,className:"mt-4",children:[c,s]}),e[14]=x,e[15]=c,e[16]=s,e[17]=u):u=e[17],u}function ur({orgSlug:k,virtualMcpId:e,branch:f,blockKey:n,block:b,decofile:d,meta:D,onManagePosts:x,onOpenPost:A,previewBaseUrl:l}){const i=at({orgSlug:k,virtualMcpId:e,branch:f}),h=mt(b,"categories"),[r,p,c]=xt(h,o=>{i.mutate({blockKey:n,data:R(n,"categories",o)})}),s=(o,w)=>p({...r,[o]:w}),u=dt({decofile:d,category:r,previewBaseUrl:l}),a=v(r.slug),[B,j]=S.useState(a),[m,C]=S.useState(null),[N,E]=S.useState(!1),$=a?nt(d).filter(o=>o.categorySlugs.includes(a)):[],y=$.length,H=o=>s("slug",o),W=async(o,w)=>{const G=v(r.name);E(!0);try{let g=0;for(const{key:P,payload:O}of pt(d,"posts")){const F=ct(O,o,{name:G,slug:w});F!==O&&(await i.mutateAsync({blockKey:P,data:R(P,"posts",F)}),g+=1)}const z={...r,slug:w};await i.mutateAsync({blockKey:n,data:R(n,"categories",z)}),c(z),I.success(g>0?`Renamed slug and updated ${g} ${g===1?"post":"posts"}`:"Renamed slug"),C(null)}catch(g){j(o),C(null),I.error(g instanceof Error?g.message:"Rename failed")}finally{E(!1)}},q=()=>{const o=B.trim();if(o===a){B!==o&&j(o);return}if(!o){j(a);return}if(y===0){H(o);return}C({oldSlug:a,newSlug:o,count:y})};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[t.jsx("span",{className:"truncate text-sm font-medium",children:v(r.name)||"Untitled category"}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx(lt,{isPending:i.isPending,isError:i.isError}),u&&t.jsxs(U,{type:"button",variant:"outline",size:"sm",title:"Open the category preview in a new tab",onClick:()=>window.open(u,"_blank","noopener,noreferrer"),children:[t.jsx(Z,{size:14}),"See category preview"]})]})]}),t.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:t.jsxs("div",{className:"mx-auto max-w-4xl px-8 py-8",children:[t.jsx(ft,{value:v(r.name),onChange:o=>s("name",o),placeholder:"Category name",className:"py-1 text-3xl font-bold text-foreground"}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-slug",children:"Slug"}),t.jsx(L,{id:"category-slug",value:B,onChange:o=>j(o.target.value),onBlur:q,placeholder:"my-category",className:"h-10"})]}),t.jsxs("div",{className:"mt-4 space-y-2",children:[t.jsx(M,{htmlFor:"category-description",children:"Description"}),t.jsx(L,{id:"category-description",value:v(r.description),onChange:o=>s("description",o.target.value),placeholder:"Short description for this category",className:"h-10"})]}),t.jsx(bt,{icon:Y,title:"Content",defaultOpen:!0,children:t.jsx(ut,{value:gt(r.sections),onChange:o=>s("sections",o),meta:D,emptyMessage:"This category has no content yet. Use ⊕ to add your first block."})}),t.jsxs("div",{className:"mt-6 overflow-hidden rounded-lg border bg-muted/30",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx(T,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"text-sm",children:[y," ",y===1?"post":"posts"," in this category"]})]}),t.jsxs(U,{type:"button",variant:"outline",size:"sm",disabled:!a,title:a?"Pick posts to add to this category":"Set a slug to add posts to this category",onClick:()=>x(a),children:["Add posts",t.jsx(X,{size:14})]})]}),y>0&&t.jsx("ul",{className:"divide-y border-t bg-background",children:$.map(o=>t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>A(o.key),className:"flex w-full items-center gap-2.5 px-4 py-2.5 text-left transition-colors hover:bg-muted cursor-pointer",children:[t.jsx(T,{size:14,className:"shrink-0 text-muted-foreground"}),t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block truncate text-sm",children:o.title||"Untitled post"}),o.slug&&t.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o.slug})]})]})},o.key))})]})]})})]}),t.jsx(_,{open:!!m,onOpenChange:o=>{o||N||(j(a),C(null))},children:t.jsxs(K,{children:[t.jsxs(tt,{children:[t.jsx(et,{children:"Rename category slug?"}),t.jsx(ot,{children:m?`Changing the slug from "${m.oldSlug}" to "${m.newSlug}" will update ${m.count} ${m.count===1?"post":"posts"} that reference this category.`:null})]}),t.jsxs(rt,{children:[t.jsx(it,{disabled:N,children:"Cancel"}),t.jsx(st,{onClick:o=>{o.preventDefault(),m&&W(m.oldSlug,m.newSlug)},disabled:N,children:N?t.jsxs(t.Fragment,{children:[t.jsx(V,{size:14,className:"animate-spin"}),"Renaming…"]}):"Rename & update posts"})]})]})})]})}export{ur as CategoryEditor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as O,j as t,B as F,i as Y,o as Qe,s as te,E as Pe,r as $,D as re,p as Ge,u as Ye,T as W,t as Xe,l as je,e as le,aW as ke}from"./index-thaZU0eY.js";import{E as Ee}from"./empty-state-Drp2V-gT.js";import{u as Ze,a as Ae}from"./use-collections-BLTNEY6D.js";import{u as ae}from"./use-mcp-client-B7zSFiOA.js";import{F as se,a as et,b as ce,d as de}from"./form-Bdg2md6z.js";import{I as me}from"./input-DEr8h15j.js";import{T as ie}from"./textarea-DEWiELfd.js";import{a as tt,b as st,V as ue,O as nt,M as ot}from"./index-BlDaAy7Z.js";import{ao as it,B as rt,ad as lt,Q as at,a1 as ct,ap as dt,K as be}from"./agent-icon-8-zG6zq2.js";import{g as mt,M as ut,a as Ne}from"./types-BL5SG5y5.js";import{A as xt,a as pt,b as ft}from"./alert-ovMRS5yx.js";import{d as ve,S as Se,a as ye,b as we,c as ne}from"./select-fd5CQiLd.js";import{c as ht,T as Ce,a as Ie,b as $e}from"./tooltip-D9_AyRKs.js";import{i as gt}from"./AlertCircle-CccbK4hX.js";import{s as jt}from"./Stars02-XLaFEqA9.js";import{a as bt}from"./Copy01-gjq995Op.js";import{i as Nt}from"./Play-BLXO22JW.js";import{a as Oe,b as Re,B as J,c as Q,d as G,e as _e}from"./breadcrumb-Bt63ruK5.js";import{g as vt}from"./connection-slug-eyAPH6o3.js";import{u as St,T as yt}from"./tools-list-D8G7Mcid.js";import{a as De,u as Me}from"./use-connection-DV6jfeKV.js";import{a as wt}from"./use-mcp-tools-CXGlYiLZ.js";import{c as Ct}from"./content-blocks-o63cs2vh.js";import{I as Te}from"./integration-icon-zZ56Ie6s.js";import{j as It,m as $t}from"./chat-context-p7bQrjVO.js";import{b as Tt}from"./shell-layout-BnoAEqpd.js";import{M as Pt}from"./monaco-editor-BfF7h5UL.js";import{n as kt}from"./XCircle-BLHWvvQb.js";import"./constants-nH3qQ_1f.js";import"./auth-D-3BenR-.js";import"./label-D9vlZKHj.js";import"./index-Fc19vagy.js";import"./sidebar-DSPYyChk.js";import"./LayoutLeft-DNsGMIFw.js";import"./use-mobile-B23FisN_.js";import"./sheet-C-KllyIc.js";import"./X-dW9CI9iO.js";import"./ZoomOut-6KFj5qIF.js";import"./Key01-CDa-PA-y.js";import"./extract-connection-data-hbWCHJzS.js";import"./use-registry-connections-BfySsVRx.js";import"./use-organization-settings-CtWuj0-0.js";import"./studio-tools-C88q8wAb.js";import"./Plus-CoqGiEoW.js";import"./index-ceQxuMuP.js";import"./index-C4qtLNrN.js";import"./index-Ci3919Ge.js";import"./popover-BH74zFmN.js";import"./use-virtual-mcp-BplbsFwA.js";import"./Check-WJIsHzDQ.js";import"./SearchMd-YxzpYnNt.js";import"./Users03-m0mGCSLF.js";import"./use-create-virtual-mcp-BRs1YEXm.js";import"./use-navigate-to-agent-ChQTAqDN.js";import"./Tool01-CExdAfac.js";import"./SwitchHorizontal01-8YfzWW4j.js";import"./Settings02-Dy5hRJWC.js";import"./ArrowUpRight-BgdgTW8q.js";import"./ZapSquare-BllWW0jW.js";import"./Loading02-Cv_WFApk.js";import"./CheckCircle-CM68yWPW.js";import"./ChevronDown-CAuaRLDM.js";import"./ChevronRight-B7czck1y.js";import"./ChevronUp-D-qnR_uM.js";import"./Circle-KYXNByEA.js";import"./DotsVertical-BVo4MRpu.js";import"./Globe01-BwRmuR_8.js";import"./Eye-Bn25ApPz.js";import"./FilterLines-DaZCku74.js";import"./Star01-Bbn22eVo.js";import"./Globe04-9qIG4QhN.js";import"./HardDrive-BJOyfL1s.js";import"./LinkExternal01-B-q2TCWq.js";import"./List-CDS_Rmur.js";import"./Monitor01-ChrDLGXa.js";import"./Sun-Cf2_RQhM.js";import"./Palette-CqqDm4G9.js";import"./SearchLg-BJoMxiDy.js";import"./Shield01-Dg-emZom.js";import"./Stars01-0N0PIoFw.js";import"./Trash01-2bgd5rb5.js";import"./Upload01-Da0GcY9n.js";import"./User01-DWmqguL8.js";import"./Users01-qo0Pfdbq.js";import"./XClose-BsCsQOzu.js";import"./Zap-NxwXfCyT.js";import"./mcp-oauth-HycnBVan.js";import"./badge-C9YrQiOl.js";import"./hooks-355Y2AQ-.js";import"./decopilot-sse-pool-wsz4kVX9.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-ai-providers-C9ok3iTv.js";import"./use-decopilot-events-CdGe1kZY.js";import"./tab-id-Bgchl1bv.js";import"./avatar-D9dkHpvf.js";import"./dialog-DTR6Ld8R.js";import"./alert-dialog-DT6CiV3D.js";import"./required-auth-layout-DiYJUK17.js";import"./use-org-sso-BCol3dQF.js";import"./index-Cg7efYOu.js";function Et(s){const e=O.c(15),{onSave:r,onUndo:o,isDirty:l,isSaving:i,saveLabel:c,undoLabel:d}=s,n=c===void 0?"Save":c,u=d===void 0?"Undo":d;if(!l)return null;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(it,{size:14}),e[0]=x):x=e[0];let m;e[1]!==i||e[2]!==o||e[3]!==u?(m=t.jsxs(F,{variant:"outline",size:"sm",onClick:o,disabled:i,"aria-label":u,children:[x,u]}),e[1]=i,e[2]=o,e[3]=u,e[4]=m):m=e[4];let p;e[5]!==i?(p=i?t.jsx(Y,{size:14,className:"animate-spin"}):t.jsx(rt,{size:14}),e[5]=i,e[6]=p):p=e[6];let f;e[7]!==i||e[8]!==r||e[9]!==n||e[10]!==p?(f=t.jsxs(F,{variant:"default",size:"sm",onClick:r,disabled:i,"aria-label":n,children:[p,n]}),e[7]=i,e[8]=r,e[9]=n,e[10]=p,e[11]=f):f=e[11];let g;return e[12]!==m||e[13]!==f?(g=t.jsxs(t.Fragment,{children:[m,f]}),e[12]=m,e[13]=f,e[14]=g):g=e[14],g}Qe({title:te().min(1),description:te().nullable(),body:te()});function oe(s){for(const e of s.messages??[])if(e.role==="user"&&e.content?.type==="text")return e.content.text??"";return""}function At(){const s=window.location.pathname.split("/").filter(Boolean),e=s.findIndex(o=>o==="mcps"),r=e>=0?s[e+1]:void 0;return r?decodeURIComponent(r):void 0}function Ot(s){const e=O.c(13),{form:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Details"}),e[0]=o):o=e[0];let l;e[1]!==r.control?(l=t.jsxs("div",{className:"flex flex-col gap-4",children:[o,t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(se,{control:r.control,name:"title",render:Dt}),t.jsx(se,{control:r.control,name:"description",render:_t})]})]}),e[1]=r.control,e[2]=l):l=e[2];let i,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"text-sm font-medium text-foreground",children:"Message"}),c=t.jsx("div",{className:"text-xs text-muted-foreground",children:"This becomes the user message in the prompt."}),e[3]=i,e[4]=c):(i=e[3],c=e[4]);let d;e[5]!==r.control?(d=t.jsxs("div",{className:"flex flex-col gap-2",children:[i,c,t.jsx(se,{control:r.control,name:"body",render:Rt})]}),e[5]=r.control,e[6]=d):d=e[6];let n;e[7]!==l||e[8]!==d?(n=t.jsxs("div",{className:"h-full py-6 flex flex-col max-w-3xl mx-auto w-full min-w-0 gap-8 overflow-y-auto px-4",children:[l,d]}),e[7]=l,e[8]=d,e[9]=n):n=e[9];let u;return e[10]!==r||e[11]!==n?(u=t.jsx(et,{...r,children:n}),e[10]=r,e[11]=n,e[12]=u):u=e[12],u}function Rt(s){const{field:e}=s;return t.jsx(ce,{children:t.jsx(de,{children:t.jsx(ie,{...e,value:e.value??"",placeholder:"Write the prompt message…",className:"min-h-[240px] resize-none text-base leading-relaxed font-normal rounded-xl border border-border bg-muted/20 px-4 py-3 shadow-none focus-visible:ring-0"})})})}function _t(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Description"}),t.jsx(de,{children:t.jsx(me,{...e,value:e.value??"",placeholder:"Add a description…",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Dt(s){const{field:e}=s;return t.jsxs(ce,{children:[t.jsx("div",{className:"text-xs text-muted-foreground",children:"Title"}),t.jsx(de,{children:t.jsx(me,{...e,placeholder:"Untitled prompt",className:"h-9 rounded-lg border border-border bg-muted/20 shadow-none focus-visible:ring-0"})})]})}function Mt(s){const e=O.c(36),{providerId:r,promptId:o}=s,{org:l}=re(),i=r||null;let c;e[0]!==l.id||e[1]!==l.slug||e[2]!==i?(c={connectionId:i,orgId:l.id,orgSlug:l.slug},e[0]=l.id,e[1]=l.slug,e[2]=i,e[3]=c):c=e[3];const d=ae(c),n=Ze(r,"PROMPT",o,d),u=Ae(r,"PROMPT",d),x=u.update.isPending;let m;e[4]!==n?(m=n?{title:n.title,description:n.description??null,body:oe(n)}:void 0,e[4]=n,e[5]=m):m=e[5];let p;e[6]!==m?(p={values:m},e[6]=m,e[7]=p):p=e[7];const f=Ge(p);let g;e[8]!==f||e[9]!==n?(g=()=>{n&&f.reset({title:n.title,description:n.description??null,body:oe(n)})},e[8]=f,e[9]=n,e[10]=g):g=e[10];const S=g;let C;e[11]!==u.update||e[12]!==f||e[13]!==o?(C=f.handleSubmit(async N=>{const E=await u.update.mutateAsync({id:o,data:{title:N.title,description:N.description,arguments:[],icons:[],messages:[{role:"user",content:{type:"text",text:N.body}}]}});f.reset({title:E.title,description:E.description??null,body:oe(E)})}),e[11]=u.update,e[12]=f,e[13]=o,e[14]=C):C=e[14];const R=C;if(!n){let N;return e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"This prompt may have been deleted or you may not have access to it."})}),e[15]=N):N=e[15],N}let I;e[16]!==n.title?(I=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[16]=n.title,e[17]=I):I=e[17];let k;e[18]!==n.description?(k=n.description?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"•"}),t.jsx("span",{className:"text-xs text-muted-foreground font-normal truncate min-w-0 max-w-[20ch]",children:n.description})]}):null,e[18]=n.description,e[19]=k):k=e[19];let T;e[20]!==I||e[21]!==k?(T=t.jsx(st,{children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[I,k]})}),e[20]=I,e[21]=k,e[22]=T):T=e[22];let b;e[23]!==R?(b=()=>{R()},e[23]=R,e[24]=b):b=e[24];let y;e[25]!==f.formState.isDirty||e[26]!==x||e[27]!==S||e[28]!==b?(y=t.jsx(tt,{children:t.jsx(Et,{onSave:b,onUndo:S,isDirty:f.formState.isDirty,isSaving:x})}),e[25]=f.formState.isDirty,e[26]=x,e[27]=S,e[28]=b,e[29]=y):y=e[29];let w;e[30]!==f?(w=t.jsx("div",{className:"h-full",children:t.jsx(Ot,{form:f})}),e[30]=f,e[31]=w):w=e[31];let P;return e[32]!==y||e[33]!==w||e[34]!==T?(P=t.jsxs(ue,{children:[T,y,w]}),e[32]=y,e[33]=w,e[34]=T,e[35]=P):P=e[35],P}function zt(s){const e=O.c(4),{itemId:r}=s;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=At(),e[0]=o):o=e[0];const l=o;if(!l){let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ee,{title:"Prompt not found",description:"Missing connection information in the current route."})}),e[1]=c):c=e[1],c}let i;return e[2]!==r?(i=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:null,children:t.jsx(Mt,{providerId:l,promptId:r})})}),e[2]=r,e[3]=i):i=e[3],i}const Lt=s=>s.replace(/_/g," ").replace(/\b\w/g,e=>e.toLocaleLowerCase());function Ut(s){const e=O.c(11),{toolName:r,connectionId:o,siblings:l,onSelectInstance:i,onBack:c}=s;let d;e[0]!==o?(d={connectionId:o},e[0]=o,e[1]=d):d=e[1];const n=St(d);if(!n.isAuthenticated){let m;return e[2]!==n.supportsOAuth||e[3]!==c?(m=t.jsx("div",{className:"flex h-full items-center justify-center",children:n.supportsOAuth?t.jsx(nt,{onAuthenticate:()=>c(),buttonText:"Go back to authenticate"}):t.jsx(ot,{hasReadme:!1})}),e[2]=n.supportsOAuth,e[3]=c,e[4]=m):m=e[4],m}const u=`${o}:${r}`;let x;return e[5]!==o||e[6]!==i||e[7]!==l||e[8]!==u||e[9]!==r?(x=t.jsx(Bt,{toolName:r,connectionId:o,siblings:l,onSelectInstance:i},u),e[5]=o,e[6]=i,e[7]=l,e[8]=u,e[9]=r,e[10]=x):x=e[10],x}function Bt({toolName:s,connectionId:e,siblings:r,onSelectInstance:o}){const{replayId:l}=Ye({strict:!1}),i=(()=>{if(!l)return null;const a=`replay-${l}`,h=sessionStorage.getItem(a);if(!h)return null;sessionStorage.removeItem(a);try{return JSON.parse(h)}catch{return null}})(),c=(()=>{if(!i)return null;const a={};for(const[h,v]of Object.entries(i))v!==null&&typeof v=="object"?a[h]=JSON.stringify(v,null,2):a[h]=v;return a})(),[d,n]=$.useState(c??{}),[u,x]=$.useState(i?JSON.stringify(i,null,2):"{}"),[m,p]=$.useState(null),[f,g]=$.useState(null),[S,C]=$.useState(null),[R,I]=$.useState(null),[k,T]=$.useState(!1),[b,y]=$.useState(null),{org:w}=re(),P=De(e),N=It(),E=$t(),{setChatOpen:U}=Tt(),z=`${e}:${s}`,_=ae({connectionId:e,orgId:w.id,orgSlug:w.slug}),L=wt({client:_}),j=L.data?.tools?.find(a=>a.name===s),A=mt(j?._meta),V=a=>{if(!N)return;const h=Ct(a.content);h.content.length>0&&(U(!0),N.sendMessage({tiptapDoc:h}))},[D,X]=$.useState("json"),[ze,Le]=$.useState(!1);A&&!ze&&(X("ui"),Le(!0));const xe=j?.inputSchema?.properties,pe=xe?Object.keys(xe):[],q=pe.length>0,H={};if(q&&j?.inputSchema?.properties)for(const a of pe)H[a]=j.inputSchema.required?.includes(a)?"":void 0;const Z=a=>Object.prototype.hasOwnProperty.call(d,a),Ue=async()=>{T(!0),I(null),p(null),g(null),C(null),y(null);const a=performance.now();try{if(!_)throw new Error("MCP client is not available");const h=q?{...H,...d}:(()=>{const M=u.trim();if(!M)return{};const B=JSON.parse(M);if(B&&typeof B=="object")return B;throw new Error("Raw JSON input must be an object.")})();q&&j?.inputSchema?.properties&&Object.entries(j.inputSchema.properties).forEach(([M,B])=>{if((B.type==="object"||B.type==="array")&&typeof h[M]=="string")try{h[M]=JSON.parse(h[M])}catch{}else if((B.type==="number"||B.type==="integer")&&typeof h[M]=="string"&&h[M]!==""){const ge=Number(h[M]);Number.isNaN(ge)||(h[M]=ge)}});const v=await _.callTool({name:s,arguments:h}),K=v.structuredContent??v,He=performance.now(),Ke=Math.round(He-a);p(K),g(v),C(h);const We=JSON.stringify(K),he=new TextEncoder().encode(We).length;y({duration:`${Ke}ms`,bytes:`${he} bytes`,tokens:`~${Math.ceil(he/4)} tokens`,cost:"$0.0000"})}catch(h){const v=h instanceof Error?h.message:String(h);I(v||"Unknown error occurred");const K=performance.now();y({duration:`${Math.round(K-a)}ms`})}finally{T(!1)}},ee=(a,h)=>{n(v=>({...v,[a]:h}))},Be=()=>{p(null),g(null),C(null),I(null),y(null)},Fe=j?.name??Lt(s),Ve=t.jsx(Oe,{children:t.jsxs(Re,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections",params:{org:w.slug},children:"Connections"})})}),t.jsx(G,{}),P&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections/$appSlug",params:{org:w.slug,appSlug:vt(P)},search:{tab:"tools"},children:P.title})})}),t.jsx(G,{})]}),t.jsx(J,{children:t.jsx(_e,{children:Fe})})]})}),fe=r.length>1&&t.jsxs(ve,{value:e,onValueChange:o,children:[t.jsx(Se,{className:"h-8 w-auto min-w-[200px]",children:t.jsx(ye,{})}),t.jsx(we,{children:r.map(a=>t.jsx(ne,{value:a.id,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Te,{icon:a.icon,name:a.title,size:"xs",className:"shrink-0"}),a.title]})},a.id))})]}),Je=t.jsxs("div",{className:"flex flex-col p-6 gap-4 overflow-auto",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-foreground uppercase tracking-wide",children:"Parameters"}),j?.inputSchema?.required&&j.inputSchema.required.length>0&&t.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-red-500",children:"*"})," Required"]})]}),t.jsx("div",{className:"space-y-4",children:q&&j?.inputSchema?.properties?Object.entries(j.inputSchema.properties).map(([a,h])=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("label",{className:"text-sm font-medium leading-none flex items-center gap-1.5",children:[a,j.inputSchema?.required?.includes(a)&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"})]}),t.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:h.type})]}),h.description&&t.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:h.description}),h.type==="object"||h.type==="array"?t.jsx(ie,{className:"font-mono text-xs",value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a} as JSON...`,rows:3}):h.type==="boolean"?t.jsxs(ve,{value:Z(a)?String(d[a]??""):"",onValueChange:v=>ee(a,v==="true"),children:[t.jsx(Se,{children:t.jsx(ye,{placeholder:"Select true or false..."})}),t.jsxs(we,{children:[t.jsx(ne,{value:"true",children:"true"}),t.jsx(ne,{value:"false",children:"false"})]})]}):t.jsx(me,{value:Z(a)?d[a]??"":H[a]??"",onChange:v=>ee(a,v.target.value),placeholder:`Enter ${a}...`})]},a)):j?.inputSchema&&!q?t.jsxs("div",{className:"space-y-2",children:[t.jsx("label",{className:"text-sm font-medium",children:"Raw JSON Input"}),t.jsx(ie,{className:"font-mono text-xs min-h-[120px]",value:u,onChange:a=>x(a.target.value),placeholder:'e.g. { "foo": "bar" }'})]}):t.jsx("div",{className:"flex items-center justify-center p-8 bg-muted/30 rounded-lg border border-dashed border-border",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:"No parameters required"})})}),t.jsx("div",{className:"flex items-center gap-2 pt-2",children:k?t.jsxs(F,{size:"sm",variant:"destructive",className:"h-8 gap-2",onClick:Be,children:[t.jsx(lt,{className:"h-3.5 w-3.5"}),"Cancel"]}):t.jsxs(F,{size:"sm",variant:"default",className:"h-8 gap-2",onClick:Ue,children:[t.jsx(Nt,{className:"h-3.5 w-3.5 fill-current"}),"Execute Tool"]})})]}),qe=t.jsxs("div",{className:"flex flex-col @3xl:h-full @3xl:overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 h-14 border-b border-border bg-background",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground uppercase tracking-wide",children:"Result"}),t.jsxs("div",{className:"flex items-center gap-3",children:[b&&t.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(jt,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.duration})]}),b.tokens&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(at,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.tokens})]}),b.bytes&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx(ct,{className:"h-3 w-3 text-muted-foreground"}),t.jsx("span",{className:"font-mono text-foreground",children:b.bytes})]}),b.cost&&t.jsx("div",{className:"flex items-center gap-1.5",children:t.jsx("span",{className:"font-mono text-foreground",children:b.cost})})]}),A&&t.jsx(ht,{children:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="ui"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("ui"),children:t.jsx(dt,{size:14})})}),t.jsx($e,{children:"Interactive view"})]}),t.jsxs(Ce,{children:[t.jsx(Ie,{asChild:!0,children:t.jsx(F,{size:"icon",variant:D==="json"?"secondary":"ghost",className:"h-8 w-8",onClick:()=>X("json"),children:t.jsx(be,{size:14})})}),t.jsx($e,{children:"JSON view"})]})]})})]})]}),R&&t.jsx("div",{className:"px-6 py-4 bg-background",children:t.jsx(xt,{variant:"destructive",children:t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"h-4 w-4"}),t.jsx(pt,{className:"mb-0",children:"Execution Failed"})]}),t.jsx(ft,{className:"text-xs text-destructive",children:R})]})})}),t.jsx("div",{className:"relative flex-1 min-h-[400px] @3xl:min-h-0 @3xl:overflow-auto bg-muted/50",children:A&&D==="ui"&&_?t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex items-center justify-center h-48",children:t.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[t.jsx("div",{className:"size-4 border-2 border-current border-t-transparent rounded-full animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading app..."})]})}),children:t.jsx(ut,{resourceURI:A,toolInfo:j?{tool:j}:void 0,toolInput:S??void 0,toolResult:f??void 0,displayMode:"fullscreen",minHeight:Ne.view.minHeight,maxHeight:Ne.view.maxHeight,client:_,onMessage:V,onUpdateModelContext:a=>E?.setAppContext(z,a),onTeardown:()=>E?.clearAppContext(z),className:"h-full"})}):m?t.jsxs(t.Fragment,{children:[t.jsx(Pt,{code:JSON.stringify(m,null,2),language:"json",height:"100%",readOnly:!0}),t.jsx(F,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 h-8 w-8 bg-background/80 hover:bg-background border border-border shadow-sm",onClick:()=>{navigator.clipboard.writeText(JSON.stringify(m,null,2)),Xe.success("Copied to clipboard")},children:t.jsx(bt,{className:"h-3.5 w-3.5"})})]}):t.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground",children:[t.jsx(be,{className:"h-12 w-12 mb-3 opacity-40"}),t.jsx("p",{className:"text-sm",children:"Run the tool to see results"})]})})]});return t.jsx(ue,{breadcrumb:Ve,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden @container",children:[t.jsxs("div",{className:"flex flex-col gap-3 py-7 px-8 bg-background border-b border-border shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(Te,{icon:P?.icon||null,name:P?.title||s,size:"xl",className:"shrink-0"}),t.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground leading-none truncate",children:s}),t.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-muted/50 rounded-md h-fit shrink-0",children:[L.isSuccess?t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-green-500 animate-pulse shrink-0"}):L.isLoading?t.jsx(Y,{size:10,className:"animate-spin text-yellow-500 shrink-0"}):t.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-red-500 shrink-0"}),t.jsx("span",{className:"font-mono text-xs capitalize text-muted-foreground leading-none",children:L.isSuccess?"ready":L.isLoading?"connecting":"error"})]}),t.jsx(yt,{annotations:j?.annotations,_meta:j?._meta}),t.jsx("div",{className:"hidden @3xl:flex items-center ml-auto shrink-0",children:fe})]}),t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:j?.description||"No description available"})]}),r.length>1&&t.jsxs("div",{className:"flex @3xl:hidden items-center gap-3 px-8 py-3 border-b border-border",children:[t.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Instance"}),fe]}),t.jsx("div",{className:"flex-1 overflow-auto @3xl:overflow-hidden",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-[minmax(0,2fr)_minmax(0,5fr)] @3xl:h-full @3xl:grid-rows-1",children:[t.jsx("div",{className:"@3xl:border-r border-border @3xl:overflow-auto",children:Je}),qe]})})]})})}function Ft(s){const e=O.c(10),{itemId:r,siblings:o,onBack:l}=s,[i,c]=$.useState(o[0]?.id??"");let d;e[0]!==i||e[1]!==o?(d=o.find(p=>p.id===i)?.id??o[0]?.id??"",e[0]=i,e[1]=o,e[2]=d):d=e[2];const n=d;if(!De(n||void 0)||!n){let p;return e[3]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[t.jsx("h3",{className:"text-lg font-semibold",children:"Connection not found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"This connection may have been deleted or you may not have access."})]})}),e[3]=p):p=e[3],p}let x;e[4]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),e[4]=x):x=e[4];let m;return e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==r?(m=t.jsx($.Suspense,{fallback:x,children:t.jsx(Ut,{toolName:r,connectionId:n,siblings:o,onSelectInstance:c,onBack:l})}),e[5]=n,e[6]=l,e[7]=o,e[8]=r,e[9]=m):m=e[9],m}function Vt(s){const e=O.c(21),{icon:r,illustration:o,title:l,description:i,buttonProps:c,buttonComponent:d,className:n,children:u}=s;let x;e[0]!==n?(x=je("flex flex-col items-center justify-center py-16 text-center",n),e[0]=n,e[1]=x):x=e[1];let m;e[2]!==r||e[3]!==o?(m=o?t.jsx("div",{className:"mb-4 text-muted-foreground/50",children:o}):r?t.jsx("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-muted/50 text-muted-foreground",children:r}):null,e[2]=r,e[3]=o,e[4]=m):m=e[4];let p;e[5]!==l?(p=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:l}),e[5]=l,e[6]=p):p=e[6];let f;e[7]!==i?(f=i&&t.jsx("div",{className:"text-sm text-muted-foreground",children:i}),e[7]=i,e[8]=f):f=e[8];let g;e[9]!==p||e[10]!==f?(g=t.jsxs("div",{className:"flex flex-col items-center gap-1 max-w-sm",children:[p,f]}),e[9]=p,e[10]=f,e[11]=g):g=e[11];let S;e[12]!==d||e[13]!==c?(S=(d??c)&&t.jsx("div",{className:"mt-4",children:d??(c&&t.jsx(F,{size:"sm",className:je(c?.className),...c}))}),e[12]=d,e[13]=c,e[14]=S):S=e[14];let C;return e[15]!==u||e[16]!==x||e[17]!==m||e[18]!==g||e[19]!==S?(C=t.jsxs("div",{className:x,children:[m,g,S,u]}),e[15]=u,e[16]=x,e[17]=m,e[18]=g,e[19]=S,e[20]=C):C=e[20],C}const Jt={prompt:zt};function qt(){const s=O.c(9),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.itemId);let i;s[1]!==o.appSlug?(i={slug:o.appSlug},s[1]=o.appSlug,s[2]=i):i=s[2];const c=Me(i);let d;s[3]!==e.history?(d=()=>{e.history.back()},s[3]=e.history,s[4]=d):d=s[4];const n=d,u=Ht;let x;return s[5]!==n||s[6]!==l||s[7]!==c?(x=t.jsx(Ft,{itemId:l,siblings:c,onBack:n,onUpdate:u}),s[5]=n,s[6]=l,s[7]=c,s[8]=x):x=s[8],x}async function Ht(s){return Promise.resolve()}function Kt(s){return s.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Wt(){const s=O.c(41),e=ke();let r;s[0]===Symbol.for("react.memo_cache_sentinel")?(r={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=r):r=s[0];const o=le(r),l=decodeURIComponent(o.collectionName),i=decodeURIComponent(o.itemId);let c;s[1]!==e.history?(c=()=>{e.history.back()},s[1]=e.history,s[2]=c):c=s[2];const d=c,{org:n}=re();let u;s[3]!==o.appSlug?(u={slug:o.appSlug},s[3]=o.appSlug,s[4]=u):u=s[4];const m=Me(u)[0]??null,p=m?.id??"",f=p||"no-connection",g=p??null;let S;s[5]!==n.id||s[6]!==n.slug||s[7]!==g?(S={connectionId:g,orgId:n.id,orgSlug:n.slug},s[5]=n.id,s[6]=n.slug,s[7]=g,s[8]=S):S=s[8];const C=ae(S),R=Ae(f,l,C);let I;s[9]!==R||s[10]!==i?(I=async D=>{i&&await R.update.mutateAsync({id:i,data:D})},s[9]=R,s[10]=i,s[11]=I):I=s[11];const k=I;let T;s[12]!==l?(T=l?.toLowerCase(),s[12]=l,s[13]=T):T=s[13];const b=T,y=b&&Jt[b];let w;s[14]!==l?(w=Kt(l),s[14]=l,s[15]=w):w=s[15];const P=w;let N;s[16]!==n.slug?(N=t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections",params:{org:n.slug},children:"Connections"})})}),s[16]=n.slug,s[17]=N):N=s[17];let E;s[18]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(G,{}),s[18]=E):E=s[18];let U;s[19]!==l||s[20]!==m||s[21]!==n.slug||s[22]!==o.appSlug?(U=m&&t.jsxs(t.Fragment,{children:[t.jsx(J,{children:t.jsx(Q,{asChild:!0,children:t.jsx(W,{to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:o.appSlug},search:{tab:l},children:m.title})})}),t.jsx(G,{})]}),s[19]=l,s[20]=m,s[21]=n.slug,s[22]=o.appSlug,s[23]=U):U=s[23];let z;s[24]!==P?(z=t.jsx(J,{children:t.jsx(_e,{children:P})}),s[24]=P,s[25]=z):z=s[25];let _;s[26]!==U||s[27]!==z||s[28]!==N?(_=t.jsx(Oe,{children:t.jsxs(Re,{children:[N,E,U,z]})}),s[26]=U,s[27]=z,s[28]=N,s[29]=_):_=s[29];const L=_;if(y){let D;return s[30]!==y||s[31]!==d||s[32]!==k||s[33]!==i?(D=t.jsx(y,{itemId:i,onBack:d,onUpdate:k}),s[30]=y,s[31]=d,s[32]=k,s[33]=i,s[34]=D):D=s[34],D}let j;s[35]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(kt,{size:36,className:"text-muted-foreground"}),s[35]=j):j=s[35];let A;s[36]!==d?(A=t.jsx(Vt,{icon:j,title:"No component defined",description:"No component for this collection was defined",buttonProps:{onClick:d,children:"Go back"}}),s[36]=d,s[37]=A):A=s[37];let V;return s[38]!==L||s[39]!==A?(V=t.jsx(ue,{breadcrumb:L,children:A}),s[38]=L,s[39]=A,s[40]=V):V=s[40],V}function Qt(){const s=O.c(3);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org/settings/connections/$appSlug/$collectionName/$itemId"},s[0]=e):e=s[0];const r=le(e);if(decodeURIComponent(r.collectionName)==="tools"){let c;return s[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(qt,{}),s[1]=c):c=s[1],c}let i;return s[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{}),s[2]=i):i=s[2],i}function Jn(){const s=O.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Pe,{children:t.jsx($.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Y,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Qt,{})})}),s[0]=e):e=s[0],e}export{Jn as default};
|