decocms 4.364.0 → 4.364.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-EniJtD8E.js → AlertCircle-CfOItn1b.js} +1 -1
- package/dist/client/assets/{AreaChart-DZpAPo6a.js → AreaChart-B9tk92oC.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Clu1mSdY.js → ArrowLeft-B4kTLC80.js} +1 -1
- package/dist/client/assets/{ArrowRight-Cu8UuHNR.js → ArrowRight-B4GAIQKI.js} +1 -1
- package/dist/client/assets/{ArrowUp-C0eratGp.js → ArrowUp-Be_FwN-E.js} +1 -1
- package/dist/client/assets/{Check-BWpBE9uf.js → Check-_wGz2-IJ.js} +1 -1
- package/dist/client/assets/{CheckCircle-cinYKmPU.js → CheckCircle-BQEdmdLU.js} +1 -1
- package/dist/client/assets/{ChevronRight-DzRB-rdO.js → ChevronRight-DfnK-irb.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BiIbFU31.js → ChevronSelectorVertical-DTb5009V.js} +1 -1
- package/dist/client/assets/{ChevronUp-DGrguvGW.js → ChevronUp-SbK1Bh_A.js} +1 -1
- package/dist/client/assets/{Copy01-DayLu0dF.js → Copy01-DoHw-_s5.js} +1 -1
- package/dist/client/assets/{CreditCard01-4OsjIT5f.js → CreditCard01-CkbbYVCy.js} +1 -1
- package/dist/client/assets/{Database01-2gG_9E30.js → Database01-DDqP2OWW.js} +1 -1
- package/dist/client/assets/{DotsVertical-CucJCL9y.js → DotsVertical-Ct2yI8vr.js} +1 -1
- package/dist/client/assets/{Download01-BC2rKbuh.js → Download01-IytcAces.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CRh7XbJc.js → ErrorBarContext-Cgip1CtP.js} +1 -1
- package/dist/client/assets/{Eye-dnrP5DkM.js → Eye-Ccu8gsxq.js} +1 -1
- package/dist/client/assets/{File02-BhckHV8N.js → File02-CODRlzC9.js} +1 -1
- package/dist/client/assets/{GitBranch01-BBn4dN5f.js → GitBranch01-y6_LtrpC.js} +1 -1
- package/dist/client/assets/{Globe01-SLAc63wC.js → Globe01-BHsBANMN.js} +1 -1
- package/dist/client/assets/{HardDrive-FlnOYA_8.js → HardDrive-Cr2Uhzo6.js} +1 -1
- package/dist/client/assets/{Image01-BrHSH-Vi.js → Image01-PUenBySa.js} +1 -1
- package/dist/client/assets/{Key01-CKcg8G1v.js → Key01-ugSjw0sl.js} +1 -1
- package/dist/client/assets/{Link01-3t9JrUgl.js → Link01-CUXePRyB.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Cp7uxK1i.js → LinkExternal01-DLDyK_TN.js} +1 -1
- package/dist/client/assets/{Monitor01-BUruMK2r.js → Monitor01-J9g_ep-X.js} +1 -1
- package/dist/client/assets/{Package-CdfyZYxN.js → Package-Dm9TBHk7.js} +1 -1
- package/dist/client/assets/{Palette-CglyAOTg.js → Palette-BywMlwsu.js} +1 -1
- package/dist/client/assets/{Play-rnw1eV52.js → Play-HfzzXB20.js} +1 -1
- package/dist/client/assets/{Plus-Bxp02MWl.js → Plus-zXs3aP31.js} +1 -1
- package/dist/client/assets/{Printer-fz_zwxfT.js → Printer-kkmv6XzS.js} +1 -1
- package/dist/client/assets/{SearchLg-FC9suxna.js → SearchLg-BkMCmJSN.js} +1 -1
- package/dist/client/assets/{SearchMd-DRRptSJN.js → SearchMd-uhtNwnF8.js} +1 -1
- package/dist/client/assets/{Sector-CJIPfQ5Z.js → Sector-DNcwKKFv.js} +1 -1
- package/dist/client/assets/{Settings02-D2oiGU4q.js → Settings02-DPUnnUpS.js} +1 -1
- package/dist/client/assets/{Share07-D_kiq5Fr.js → Share07-ezwRb3nU.js} +1 -1
- package/dist/client/assets/{Shield01-CjyLhqlS.js → Shield01-BcXJFwaP.js} +1 -1
- package/dist/client/assets/{Stars01-COChWymR.js → Stars01-DdrI1AvW.js} +1 -1
- package/dist/client/assets/{Sun-nKOZMh9n.js → Sun-DZjMucTf.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-CxlKjkIX.js → SwitchHorizontal01-Dne29Upz.js} +1 -1
- package/dist/client/assets/{Tool01-BnKd95Y1.js → Tool01-duhLcQNq.js} +1 -1
- package/dist/client/assets/{Tool02-C_xRWqQk.js → Tool02-CnClhfmX.js} +1 -1
- package/dist/client/assets/{Trash01-DqUm2RRh.js → Trash01-CH5l96iG.js} +1 -1
- package/dist/client/assets/{TrendUp01-PFzYDizC.js → TrendUp01-fYoe36da.js} +1 -1
- package/dist/client/assets/{Upload01-CqWnAR1-.js → Upload01-DksJHtIE.js} +1 -1
- package/dist/client/assets/{User01-BJoNdkjl.js → User01-DZs8rqql.js} +1 -1
- package/dist/client/assets/{UserSquare-CCDsU001.js → UserSquare-CXNfIfPy.js} +1 -1
- package/dist/client/assets/{Users01-DSQPwtP5.js → Users01-DZlg18P8.js} +1 -1
- package/dist/client/assets/{Users03-CRtXqa1Q.js → Users03-pPPKVW_h.js} +1 -1
- package/dist/client/assets/{XCircle-9Cb0khfg.js → XCircle-CoSRJnuK.js} +1 -1
- package/dist/client/assets/{XClose-Cw4b4Uag.js → XClose-BYsCvLXW.js} +1 -1
- package/dist/client/assets/{Zap-ChVc0p76.js → Zap-BLQffepl.js} +1 -1
- package/dist/client/assets/{ZoomOut-BXPGwF_O.js → ZoomOut-B6xnZLKD.js} +1 -1
- package/dist/client/assets/{access-gate-BZbNb1lq.js → access-gate-Cc7o9awR.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-s1GRGQ63.js → add-connection-dialog-ColILHSg.js} +1 -1
- package/dist/client/assets/{agent-analytics-C4aHsqYV.js → agent-analytics-BuUA9_zB.js} +1 -1
- package/dist/client/assets/agent-app-CvjgfHdj.js +1 -0
- package/dist/client/assets/{agent-assets-B6lPIA_2.js → agent-assets-CHRAa4hr.js} +1 -1
- package/dist/client/assets/{agent-automation-Bmdy2mNK.js → agent-automation-COYuXB1l.js} +1 -1
- package/dist/client/assets/{agent-automations-5exIOZ--.js → agent-automations-CVa9zvpd.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-ozaEzrP4.js → agent-connect-sources-D-qScFZM.js} +1 -1
- package/dist/client/assets/agent-deck-CtPxHug1.js +1 -0
- package/dist/client/assets/{agent-e2e-s-Nk1F2Y.js → agent-e2e-BJ7p3EFw.js} +1 -1
- package/dist/client/assets/agent-file-r5wJ9MHq.js +1 -0
- package/dist/client/assets/{agent-git-Bu3r6tWp.js → agent-git-RSuMQ7we.js} +1 -1
- package/dist/client/assets/{agent-hosting-CdYzW_dA.js → agent-hosting-C6HCUd84.js} +1 -1
- package/dist/client/assets/{agent-icon-DrlilhFJ.js → agent-icon-DlT0cyOd.js} +1 -1
- package/dist/client/assets/agent-library-file-CDc9dHKg.js +1 -0
- package/dist/client/assets/{agent-monitor-DEQ-34KF.js → agent-monitor-Yob-hhJJ.js} +1 -1
- package/dist/client/assets/{agent-overview-BQIF-rwN.js → agent-overview-Cmt3_HNP.js} +1 -1
- package/dist/client/assets/agent-settings-E30r5sKL.js +1 -0
- package/dist/client/assets/{agent-site-editor-DtPpWjDD.js → agent-site-editor-C9RAIEyo.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-hlPdL0sy.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-6zQLGSyR.js → agent-site-editor-content-5xiQM6XU.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-D8mxBZIU.js → agent-site-editor-preview-CEEI7DH8.js} +3 -3
- package/dist/client/assets/agent-view-DclyqFK6.js +1 -0
- package/dist/client/assets/{agent-view-guard-nj1TYVsk.js → agent-view-guard-BYjSQEWP.js} +1 -1
- package/dist/client/assets/{agents-list-hiZ_XS0O.js → agents-list-D-V7lKYi.js} +1 -1
- package/dist/client/assets/{ai-providers-oY9ilqJZ.js → ai-providers-CnrPu6-b.js} +1 -1
- package/dist/client/assets/{alert-D-emvPaG.js → alert-CKcqWgEA.js} +1 -1
- package/dist/client/assets/{alert-dialog-BE9ltHtr.js → alert-dialog-B19dFL0f.js} +1 -1
- package/dist/client/assets/{api-keys-4NMR09V3.js → api-keys-B82gXphc.js} +1 -1
- package/dist/client/assets/api-keys-C5nyTMkG.js +1 -0
- package/dist/client/assets/app-editor-Ce9aJoOB.js +1 -0
- package/dist/client/assets/{asset-utils-CR65HphV.js → asset-utils-DCSDKdD5.js} +1 -1
- package/dist/client/assets/{auth-RjDDTUUT.js → auth-BRT05k6V.js} +1 -1
- package/dist/client/assets/{auth-catchall-qxwSZGuB.js → auth-catchall-CKtZG-ZL.js} +1 -1
- package/dist/client/assets/{auth-entry-ddblLMjc.js → auth-entry-B04CeC2I.js} +1 -1
- package/dist/client/assets/{auth-split-layout-oGs_kK_4.js → auth-split-layout-Cr7N993d.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DXlrPDSv.js → authenticate-and-persist-oauth-VFbyMRtb.js} +1 -1
- package/dist/client/assets/{automation-list-row-XibuWgpW.js → automation-list-row-Cpi5Xmll.js} +1 -1
- package/dist/client/assets/{automation-runs-nZP284NC.js → automation-runs-pUP2_-kz.js} +1 -1
- package/dist/client/assets/automations-DsASrpQ_.js +1 -0
- package/dist/client/assets/{autosend-HdosN86x.js → autosend-BfRMZFUN.js} +1 -1
- package/dist/client/assets/{avatar-DcDvs8Zz.js → avatar-CAI2JETZ.js} +1 -1
- package/dist/client/assets/{badge-DJpaBl8u.js → badge-ByfZPYh0.js} +1 -1
- package/dist/client/assets/{block-document-LCYQj9PJ.js → block-document-DBxhUTBx.js} +1 -1
- package/dist/client/assets/{breadcrumb-BOAVRiAa.js → breadcrumb-CFkPvTBR.js} +1 -1
- package/dist/client/assets/{buckets-Ze5fok7v.js → buckets-DKSvTBD6.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Dn9xs_5X.js → build-improve-prompt-doc-Bni1nFjn.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-D-Hh71MB.js → bulk-category-panel-B7Aw8gAs.js} +1 -1
- package/dist/client/assets/{calendar-DTnssie4.js → calendar-BPRd4cON.js} +1 -1
- package/dist/client/assets/{capability-load-error-CJ3e1sqb.js → capability-load-error-B39q7sVS.js} +1 -1
- package/dist/client/assets/{cards-DTFINi5r.js → cards-C9H7r60q.js} +1 -1
- package/dist/client/assets/category-editor-C6NG-7y-.js +1 -0
- package/dist/client/assets/{chart-Jb0gHMLD.js → chart-ChK_Oq3k.js} +1 -1
- package/dist/client/assets/{chat-context-CXknhaDs.js → chat-context-BdJniD3E.js} +1 -1
- package/dist/client/assets/{checkbox-D8Ab2Vb-.js → checkbox-Cx7-cMI2.js} +1 -1
- package/dist/client/assets/{choose-editor-Chy2VB_F.js → choose-editor-BFMfKqGX.js} +1 -1
- package/dist/client/assets/{cli-auth-success-B27gos5d.js → cli-auth-success-BXUI2QIq.js} +1 -1
- package/dist/client/assets/{client-icons-CoIMqlIz.js → client-icons-DH8XqhqX.js} +1 -1
- package/dist/client/assets/{collapsible-DH_CZdwE.js → collapsible-DWXt85UZ.js} +1 -1
- package/dist/client/assets/{collection-detail-D8Sq0PzS.js → collection-detail-yuoxb5ei.js} +1 -1
- package/dist/client/assets/{collection-display-button-P_aK73Om.js → collection-display-button-CYeWeHPn.js} +1 -1
- package/dist/client/assets/{collection-search-CzGq8Uso.js → collection-search-DBiZveMp.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-ChqJqpKo.js → collection-table-wrapper-GiH-7xKS.js} +1 -1
- package/dist/client/assets/{collection-tabs-BLgGMB42.js → collection-tabs-BxTayoNr.js} +1 -1
- package/dist/client/assets/{command-palette-store-BwHku_Zt.js → command-palette-store-D4d7ysBD.js} +1 -1
- package/dist/client/assets/{command-B6LMVdkQ.js → command-vCLlEnld.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-EmIMFBqV.js → commerce-onboarding-DOo_j1fY.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BszDkkOp.js → companion-mcps-section-RMajitXP.js} +1 -1
- package/dist/client/assets/{connect-CM-97gwN.js → connect-DIZq-DN2.js} +1 -1
- package/dist/client/assets/{connect-layout-C_MQVbrT.js → connect-layout-CcZHYYLs.js} +1 -1
- package/dist/client/assets/{connection-OmoYXqZk.js → connection-D3sgkgc8.js} +1 -1
- package/dist/client/assets/{connection-card-Cy-GdKQl.js → connection-card-BUk8IuWl.js} +1 -1
- package/dist/client/assets/{connection-detail-CuBiFvjK.js → connection-detail-DI7dS0mq.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-D3hdN_Pk.js → connection-form-helpers-CjZ0gF9p.js} +1 -1
- package/dist/client/assets/{connections-BnO49Vti.js → connections-DtcRjsIv.js} +1 -1
- package/dist/client/assets/{create-organization-dialog--p2RMsV5.js → create-organization-dialog-D3-ZW85P.js} +1 -1
- package/dist/client/assets/{decode-html-entities-DDqE27I4.js → decode-html-entities-DI0z1GlS.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-CfYFArSW.js → decopilot-sse-pool-C4pTRblZ.js} +1 -1
- package/dist/client/assets/{dialog-otnvxVN0.js → dialog-BAfLND_C.js} +1 -1
- package/dist/client/assets/{discover-BZKxvY_j.js → discover-CgETi5Ba.js} +1 -1
- package/dist/client/assets/{domain-settings-QORwmdcG.js → domain-settings-DGeWS67L.js} +1 -1
- package/dist/client/assets/{download-app-dialog-BqNRF4Sn.js → download-app-dialog-inqOoiFR.js} +1 -1
- package/dist/client/assets/{drawer-s7gtDrb4.js → drawer-CftCt6Vc.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BxKUbUkE.js → dropdown-menu-DlZDenrk.js} +1 -1
- package/dist/client/assets/{editor-DCxsAs7o.js → editor-VCziEYAl.js} +1 -1
- package/dist/client/assets/{empty-state-CL4F2BS4.js → empty-state-85cr_pDj.js} +1 -1
- package/dist/client/assets/{empty-state-Cz1DkYZE.js → empty-state-DrLFtqMC.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CqGCTPdZ.js → extract-connection-data-DuAiwl2M.js} +1 -1
- package/dist/client/assets/{file-explorer-Uvp7ogK8.js → file-explorer-Dd6bLbvS.js} +1 -1
- package/dist/client/assets/{file-preview-18IJQMnU.js → file-preview-B9gO9A7B.js} +1 -1
- package/dist/client/assets/{file-share-button-Cef5f1VZ.js → file-share-button-Zm0jPBUd.js} +1 -1
- package/dist/client/assets/{file-type-icon-DGllFDOf.js → file-type-icon-ChixCG5B.js} +1 -1
- package/dist/client/assets/{folder-icon-p8jB76CU.js → folder-icon-jWW7DiXp.js} +1 -1
- package/dist/client/assets/{form-KjPevg0A.js → form-B2aJ1tMr.js} +1 -1
- package/dist/client/assets/{general-t-IB2WC3.js → general-Dbd-M2oy.js} +1 -1
- package/dist/client/assets/{github-icon-D51q_6S8.js → github-icon-BHD2Mc12.js} +1 -1
- package/dist/client/assets/{home-Bhl8U_ph.js → home-DRVwgYU_.js} +1 -1
- package/dist/client/assets/{hooks-BhviOOpn.js → hooks-CrGRDkCO.js} +1 -1
- package/dist/client/assets/{hooks-k1OxvonE.js → hooks-D-bAuZ0C.js} +1 -1
- package/dist/client/assets/{index-Bwc7J041.js → index-5lUn2NYU.js} +1 -1
- package/dist/client/assets/{index-CRCvoACn.js → index-BFLLIz5j.js} +1 -1
- package/dist/client/assets/{index-m01im2kT.js → index-Bm0CRiXJ.js} +1 -1
- package/dist/client/assets/{index-B3yBTWEk.js → index-BodvdIMk.js} +3 -3
- package/dist/client/assets/{index-w1d_dmEj.js → index-CFD2Tmax.js} +1 -1
- package/dist/client/assets/{index-D4YJGrDI.js → index-CMW740A7.js} +3 -3
- package/dist/client/assets/{index-fTs6ROSj.js → index-CV73SUyV.js} +1 -1
- package/dist/client/assets/{index-DD-r2o4M.js → index-CenLE2Y1.js} +1 -1
- package/dist/client/assets/{index-C1N-CFMR.js → index-CgWFi-UY.js} +1 -1
- package/dist/client/assets/{index-DlQKfvnq.js → index-D7HQX0oQ.js} +1 -1
- package/dist/client/assets/{index-C7WIaN4y.js → index-DFPd3Z7H.js} +1 -1
- package/dist/client/assets/{index-DOk05MCp.js → index-DTnAWEs3.js} +1 -1
- package/dist/client/assets/{index-DqX9hbqM.js → index-b0vxPrwt.js} +1 -1
- package/dist/client/assets/{index-xVQnUsdi.js → index-o8mv6JmO.js} +1 -1
- package/dist/client/assets/{index-redirect-e7Kr1hOd.js → index-redirect-CAUT4Gir.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DgAoAIrN.js → infiniteQueryObserver-BXxOeKaH.js} +1 -1
- package/dist/client/assets/{infra-billing-B2HwpfSN.js → infra-billing-C6s3jgkP.js} +1 -1
- package/dist/client/assets/{input-BnbYz5_9.js → input-2i3nmZXT.js} +1 -1
- package/dist/client/assets/{input-DxAgQLPa.js → input-7HsiiE3O.js} +1 -1
- package/dist/client/assets/{input-HFOrJf5B.js → input-CyCfmV2v.js} +1 -1
- package/dist/client/assets/{integration-icon-BPwWRlNG.js → integration-icon-BqCQeMla.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-vPcEYe6v.js → invite-member-dialog-l7jaUM00.js} +1 -1
- package/dist/client/assets/{label-CqlSWrLn.js → label-oySBL-hw.js} +1 -1
- package/dist/client/assets/{layout-aU1eoqDA.js → layout-C_9zPyLB.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CpKjJlPs.js → legacy-agents-deep-BGj1G-G6.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-ZPChWdtD.js → legacy-main-redirect-BAMIoUmF.js} +1 -1
- package/dist/client/assets/{library-uYIcEGdr.js → library-jBDBHa3X.js} +1 -1
- package/dist/client/assets/{login-CfxNz6kc.js → login-jcZJlm87.js} +1 -1
- package/dist/client/assets/{markdown-B1038zFJ.js → markdown-CuYSLr0D.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-Cb8Ud-E7.js → mcp-app-renderer-CAyJEYdf.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D6isOO_s.js → mcp-oauth-D4sc2QRH.js} +1 -1
- package/dist/client/assets/{members-DHLsomPg.js → members-DZnhlZB5.js} +1 -1
- package/dist/client/assets/{mini-report-page-iTjakIrU.js → mini-report-page-DZcKIwCW.js} +1 -1
- package/dist/client/assets/{monaco-editor-WNMTPDp9.js → monaco-editor-miL0A9cI.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-B_mR1zw-.js → monitoring-stats-row-Bkr0yo_k.js} +1 -1
- package/dist/client/assets/{multi-select-D54pM3d4.js → multi-select-HV-sxpT4.js} +1 -1
- package/dist/client/assets/{mustache-r9snVmI4.js → mustache-8iDNlOWo.js} +1 -1
- package/dist/client/assets/{oauth-callback-GAK1H0Is.js → oauth-callback-CdbS4grS.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-sdaHeEFx.js → oauth-callback-ai-provider-B6UEwW8h.js} +1 -1
- package/dist/client/assets/{onboarding-BKPW4du6.js → onboarding-CXn2uZdK.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-yrtk59Mo.js → optimistic-project-sidebar-views-Crt809gH.js} +1 -1
- package/dist/client/assets/{org-layout-BNIg984j.js → org-layout-Bh2799KC.js} +1 -1
- package/dist/client/assets/{organization-choice-DvXG7tgx.js → organization-choice-Dim_EV8w.js} +1 -1
- package/dist/client/assets/{orgs-NTyzCYi-.js → orgs-BiHhUqle.js} +1 -1
- package/dist/client/assets/{page-seo-form-DAkbVQPg.js → page-seo-form-Byw6I6v1.js} +1 -1
- package/dist/client/assets/{pair-C08OPQNP.js → pair-BryCAS3L.js} +1 -1
- package/dist/client/assets/{popover-DIqZ2IKF.js → popover-BaPHFXoA.js} +1 -1
- package/dist/client/assets/{post-calendar-DuH_hA9y.js → post-calendar-CX_aQZ9o.js} +1 -1
- package/dist/client/assets/{post-editor-BAf6FqSQ.js → post-editor-Bik9xGuM.js} +1 -1
- package/dist/client/assets/{preview-content-B5xB74fu.js → preview-content-C25g1Qjg.js} +1 -1
- package/dist/client/assets/{preview-dialog-b2QyOGzU.js → preview-dialog-Bd71VPLl.js} +1 -1
- package/dist/client/assets/{primitives-4_D03rJK.js → primitives-C2ZKBNVE.js} +1 -1
- package/dist/client/assets/{profile-COT-hKKD.js → profile-Cvk7HYLO.js} +1 -1
- package/dist/client/assets/{project-app-view-DJ_q7UHg.js → project-app-view-BBFfxMn2.js} +1 -1
- package/dist/client/assets/{project-feed-DJ_jJM3E.js → project-feed-CuafBwOd.js} +1 -1
- package/dist/client/assets/{project-icon-Bl3bXnhv.js → project-icon-D14m61tO.js} +1 -1
- package/dist/client/assets/project-reports-FoQBd9tt.js +1 -0
- package/dist/client/assets/project-tasks-CtrmnVYd.js +1 -0
- package/dist/client/assets/{prompts-CI44HEcf.js → prompts-CdPbev6G.js} +1 -1
- package/dist/client/assets/record-editor-BeEtgfek.js +1 -0
- package/dist/client/assets/redirect-editor-qcgiHklQ.js +1 -0
- package/dist/client/assets/registry-DINMxyfR.js +2 -0
- package/dist/client/assets/{registry-layout-CvRfdld3.js → registry-layout-C94XAKOB.js} +1 -1
- package/dist/client/assets/{reports-C-eaYxW3.js → reports-CxUD1psy.js} +1 -1
- package/dist/client/assets/reports-DbvBqGHI.js +1 -0
- package/dist/client/assets/{reports-tab-qffeKlGd.js → reports-tab-BpUXLiNq.js} +2 -2
- package/dist/client/assets/{repositories-ao250fUH.js → repositories-cLgzNGhX.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Bg_h8YsG.js → repository-import-picker-Bz4mO0xC.js} +1 -1
- package/dist/client/assets/{repository-picker-BDWGy2xY.js → repository-picker-aHa7Yens.js} +1 -1
- package/dist/client/assets/{require-capability-CmR_46yt.js → require-capability-CGWy1zcW.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BEc3NUsQ.js → required-auth-layout-C8ueG7DN.js} +1 -1
- package/dist/client/assets/{reset-password-BlF157J6.js → reset-password-Dfhn1DHs.js} +1 -1
- package/dist/client/assets/{review-settings-BBciVvfB.js → review-settings-yj2xfDNH.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-CrwbAR31.js → rich-text-link-control-D8pkIadD.js} +1 -1
- package/dist/client/assets/{roles-CuHUTdKb.js → roles-CtsHlJ7R.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-2CMWc-S3.js → runnable-block-editor-DQQgPGex.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-CXd9Um8u.js → sandbox-lifecycle-context-KgLleS3y.js} +1 -1
- package/dist/client/assets/{schema-BQbhQoxs.js → schema-DVRYVU-6.js} +1 -1
- package/dist/client/assets/{scroll-area-BgZjjLM3.js → scroll-area-DrpmDXmv.js} +1 -1
- package/dist/client/assets/{search-input-uXtJ6IU8.js → search-input-BEuwwr9P.js} +1 -1
- package/dist/client/assets/{secrets-C1mCKV1g.js → secrets-BfNyBKtt.js} +1 -1
- package/dist/client/assets/{sections-editor-Bv2odcBq.js → sections-editor-CyOHOz8a.js} +1 -1
- package/dist/client/assets/{select-Bc5UZb4n.js → select-bwhAgSkw.js} +1 -1
- package/dist/client/assets/{select-model-BDGEzt-Y.js → select-model-BUtG_o-5.js} +1 -1
- package/dist/client/assets/{seo-editor-DJw3ydvJ.js → seo-editor-liBqGoJ2.js} +1 -1
- package/dist/client/assets/settings-layout-8_4ivRpO.js +1 -0
- package/dist/client/assets/{settings-sidebar-DswZBMwm.js → settings-sidebar-D1CImlJ7.js} +1 -1
- package/dist/client/assets/{settings-tab-Ru2atFmZ.js → settings-tab-DfPM9bhj.js} +1 -1
- package/dist/client/assets/{shell-controls-DkLEUvEw.js → shell-controls-oSe12Dvv.js} +1 -1
- package/dist/client/assets/{shell-layout-1dFmVwYI.js → shell-layout-DfKFME9s.js} +1 -1
- package/dist/client/assets/{skill-preview-CGe8kUoa.js → skill-preview-e4uQz0Dy.js} +1 -1
- package/dist/client/assets/{skills-BGdKR-aF.js → skills-C-9wX-VV.js} +1 -1
- package/dist/client/assets/{sso-M-OsbEtw.js → sso-BRhlLrJf.js} +1 -1
- package/dist/client/assets/{store-BY4ZRY7y.js → store-BESxBvzo.js} +1 -1
- package/dist/client/assets/store-registry-C5Y2YACE.js +2 -0
- package/dist/client/assets/{switch-CJ5Ir2Zx.js → switch-B1nJbGCG.js} +1 -1
- package/dist/client/assets/{synced-repos-9D-CfhL7.js → synced-repos-DSIN0NR4.js} +1 -1
- package/dist/client/assets/{table-Di_WRNkb.js → table-y_mRJ9Zn.js} +1 -1
- package/dist/client/assets/{tabs-DV8akPGb.js → tabs-BUVbbLAT.js} +1 -1
- package/dist/client/assets/{task-board-CXsHf2Zn.js → task-board-B_FYv6yr.js} +1 -1
- package/dist/client/assets/{task-route-D79aS9d_.js → task-route-D8DTrzfK.js} +1 -1
- package/dist/client/assets/{task-status-DIr_2V94.js → task-status-Cm28QQwf.js} +1 -1
- package/dist/client/assets/tasks-C2bVBzhE.js +1 -0
- package/dist/client/assets/{tasks-CiIHA5f1.js → tasks-CIHytgaT.js} +1 -1
- package/dist/client/assets/{textarea-CneoU2lJ.js → textarea-2MjTWIvv.js} +1 -1
- package/dist/client/assets/{thread-intent-DVKldCEq.js → thread-intent-C_TUHShU.js} +1 -1
- package/dist/client/assets/{thread-route-CKY-dKC0.js → thread-route-BPX5b65a.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-CcUGPZXB.js → thread-sheet-body-hrROtD20.js} +1 -1
- package/dist/client/assets/{toggle-group-9HQCpj-q.js → toggle-group-yY_Yhls6.js} +1 -1
- package/dist/client/assets/{tool-namespace-BVMQcKlk.js → tool-namespace-CCb8MkTr.js} +1 -1
- package/dist/client/assets/{toolbar-D0oe2g2b.js → toolbar-DK-dWmgo.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-EOE8J-Ai.js → toolbar-icon-button-D7IEoYBH.js} +1 -1
- package/dist/client/assets/{track-BzMi8kcZ.js → track-CzfYfVMq.js} +1 -1
- package/dist/client/assets/{types-Csu6Ims7.js → types-CJQ5rOJz.js} +1 -1
- package/dist/client/assets/{usage-stats-BNse37Wk.js → usage-stats-Cp4Mqdjr.js} +1 -1
- package/dist/client/assets/{use-ai-providers-qnkcjapR.js → use-ai-providers-BHw3Z_he.js} +1 -1
- package/dist/client/assets/{use-automations-CYOC_eS5.js → use-automations-B_2Eci9k.js} +1 -1
- package/dist/client/assets/{use-autosave-CCprSQ13.js → use-autosave-CGgcTeeH.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-mdvL2BW-.js → use-commerce-diagnostic-BQRYyoWw.js} +1 -1
- package/dist/client/assets/{use-connect-companion-2fL060lG.js → use-connect-companion-0NSfsYdR.js} +1 -1
- package/dist/client/assets/{use-connection-DCLPda2h.js → use-connection-B0HreEyO.js} +1 -1
- package/dist/client/assets/{use-copy-14DzRp8J.js → use-copy-Cc2PzrxF.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DoCSQs95.js → use-create-virtual-mcp-GYM-p3SY.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DYzMvrWB.js → use-date-fns-locale-C1uUurom.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BRAVEUZc.js → use-debounced-autosave-D2DtaMQY.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Cud3o3Fq.js → use-debounced-value-Dci7_Qwe.js} +1 -1
- package/dist/client/assets/{use-deco-credits-rwNQ1gMg.js → use-deco-credits-CQYk77NF.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DYRVevWg.js → use-decopilot-events-HctMj33h.js} +1 -1
- package/dist/client/assets/{use-delete-connection-ueGIYWMK.js → use-delete-connection-Do6SoZ3c.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-D6IzoXV0.js → use-deployment-admin-CRRFLUPy.js} +1 -1
- package/dist/client/assets/{use-file-configs-BwD1CaWo.js → use-file-configs-CMLhU-Fj.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DkLPxlOu.js → use-infinite-scroll-TMy8eEjN.js} +1 -1
- package/dist/client/assets/{use-join-requests-DTGTfD21.js → use-join-requests-DxlLP6Wr.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-EW6rbxam.js → use-main-panel-tabs-CbcTcl9J.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CPh3Lmzs.js → use-mcp-auth-status-gxHqvxAC.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DsJzBus3.js → use-mcp-client-DO1cH-Rq.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-i0LZ2nQA.js → use-mcp-prompts-DZqLLTvQ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-Dc3F6Krl.js → use-mcp-tools-BIFTy-Ao.js} +1 -1
- package/dist/client/assets/{use-members-C0MdJrYz.js → use-members-Ca1m7gk-.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-Bbq0oQ0Y.js → use-navigate-to-agent-DbrSvmvC.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-DvTk9GH0.js → use-open-billing-url-CpZXluVO.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-4o0wRx2Q.js → use-org-auth-client-S952sZID.js} +1 -1
- package/dist/client/assets/{use-org-fs-BEoPvlnI.js → use-org-fs-C1ai334S.js} +1 -1
- package/dist/client/assets/{use-org-notice-CXYMfMUq.js → use-org-notice-CJiZMwf2.js} +1 -1
- package/dist/client/assets/{use-org-sso-CdSz0xa8.js → use-org-sso-CFwon6Ac.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DzWM9Nv-.js → use-organization-roles--bC30gnD.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BAVHurZk.js → use-organization-settings-C7uzGCkO.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-Byvx0cbx.js → use-panel-navigate-BgqqPVEC.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-D-AyEulW.js → use-project-native-view-presence-DqW-vLSC.js} +1 -1
- package/dist/client/assets/{use-project-scope-B2cuvtTy.js → use-project-scope-cOFjIv3F.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DikbDR8w.js → use-registry-connections-XlfVpqo2.js} +1 -1
- package/dist/client/assets/{use-secrets-D-c1ciPZ.js → use-secrets-DEa3ZFkm.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CwIWGkgy.js → use-section-preview-base-DfU-w-9v.js} +1 -1
- package/dist/client/assets/{use-session-runtime-BHahDP0E.js → use-session-runtime-D2nv6bTI.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CnCb1h48.js → use-status-sounds-CBYC79_Y.js} +1 -1
- package/dist/client/assets/{use-tags-C2LhenRb.js → use-tags-6rI6kyxz.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CB3EJ29f.js → use-task-metadata-DuwC-TmK.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-9oZhiYbB.js → use-thread-outputs-DwE-nO-h.js} +1 -1
- package/dist/client/assets/{use-view-mode-BvOL5I4W.js → use-view-mode-2goLAQJg.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bk09OpEg.js → use-virtual-mcp-DY2qk06G.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B3TKIUIz.js +1 -0
- package/dist/client/assets/{useQueries-qr8TAkZc.js → useQueries-CDFEvGc1.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BuAksfER.js +1 -0
- package/dist/client/assets/{users-C1ExMDuM.js → users-xM0kvyFO.js} +1 -1
- package/dist/client/assets/{utils-B14U8IKK.js → utils-DPVkkzea.js} +1 -1
- package/dist/client/assets/{variant-calendar-urd0wE-3.js → variant-calendar-C1Gzo9bi.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-DvY-JiuY.js → variant-matcher-override-GDeATfJn.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-swSorpD7.js → view-mode-toggle-VHYgVEtv.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DGQbDtgM.js → virtual-mcp-CSoIE5pZ.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-CzbKRw1_.js +0 -1
- package/dist/client/assets/agent-deck-D5-mvZ5i.js +0 -1
- package/dist/client/assets/agent-file-DkGApBvp.js +0 -1
- package/dist/client/assets/agent-library-file-CK85m8fH.js +0 -1
- package/dist/client/assets/agent-settings-gb3smN_4.js +0 -1
- package/dist/client/assets/agent-site-editor-code-DkcL_YVi.js +0 -2
- package/dist/client/assets/agent-view-D9WzU94g.js +0 -1
- package/dist/client/assets/api-keys-BQayHq-8.js +0 -1
- package/dist/client/assets/app-editor-DeI0TeES.js +0 -1
- package/dist/client/assets/automations-CDxxuCym.js +0 -1
- package/dist/client/assets/category-editor-4KcN0JRt.js +0 -1
- package/dist/client/assets/project-reports-q4w3pT5T.js +0 -1
- package/dist/client/assets/project-tasks-DqlAyIfE.js +0 -1
- package/dist/client/assets/record-editor-n0M7yiQw.js +0 -1
- package/dist/client/assets/redirect-editor-CK3YSOdb.js +0 -1
- package/dist/client/assets/registry-DkzCUqTc.js +0 -2
- package/dist/client/assets/reports-C2LVTrmJ.js +0 -1
- package/dist/client/assets/settings-layout-DlH0gQXK.js +0 -1
- package/dist/client/assets/store-registry-DQHLJpOA.js +0 -2
- package/dist/client/assets/tasks-C6DyE2q-.js +0 -1
- package/dist/client/assets/useInfiniteQuery-GKCP1c_7.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-DmEiIBI4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ie,r as Q,I as Ge,x as jt,K as de,m as Ke,j as s,l as Z,h as Oe,B as ae,c as J,ak as Je,a_ as Me,am as re,b2 as Ve,b1 as We,n as it,aF as Dt,b0 as Pt,e as rt,t as ve,o as Fe,P as Ce,D as at,ex as Xe,ey as et,ez as tt,F as Mt,a8 as be,a9 as je,a6 as De,a7 as Pe,ap as st,e4 as vt,u as ct,fC as dt,fG as Lt,E as yt,d as wt}from"./index-B3yBTWEk.js";import{u as Gt}from"./use-organization-roles-DzWM9Nv-.js";import{u as ze}from"./use-org-auth-client-4o0wRx2Q.js";import{g as mt,a as kt}from"./role-color-Dn2tXDDF.js";import{B as Le}from"./badge-DJpaBl8u.js";import{A as ut,a as ft,c as gt,d as ht,b as Tt,f as xt,g as _t,e as pt}from"./alert-dialog-BE9ltHtr.js";import{c as Ut,D as Bt,b as Vt,a as Yt}from"./dropdown-menu-BxKUbUkE.js";import{i as Kt}from"./DotsVertical-CucJCL9y.js";import{s as Ye}from"./Plus-Bxp02MWl.js";import{s as Ft}from"./Trash01-DqUm2RRh.js";import{C as zt}from"./collection-table-wrapper-ChqJqpKo.js";import{E as lt}from"./empty-state-Cz1DkYZE.js";import{S as Qe}from"./search-input-uXtJ6IU8.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as $e}from"./integration-icon-BPwWRlNG.js";import{u as Qt}from"./use-infinite-scroll-DkLPxlOu.js";import{C as ke}from"./checkbox-D8Ab2Vb-.js";import{i as $t}from"./ArrowLeft-Clu1mSdY.js";import{u as Ht}from"./useSuspenseInfiniteQuery-DmEiIBI4.js";import{u as Zt}from"./use-mcp-client-DsJzBus3.js";import{C as qt}from"./collection-search-CzGq8Uso.js";import{p as Jt}from"./connection-OmoYXqZk.js";import{a as Rt}from"./use-members-C0MdJrYz.js";import{g as St}from"./get-initials-D-f_fDFw.js";import{u as Wt}from"./use-connection-DCLPda2h.js";import{c as Xt}from"./use-virtual-mcp-Bk09OpEg.js";import{u as es,g as ts}from"./use-ai-providers-qnkcjapR.js";import{A as At}from"./avatar-DcDvs8Zz.js";import{S as me}from"./switch-CJ5Ir2Zx.js";import{P as ss}from"./project-icon-Bl3bXnhv.js";import{s as ls}from"./use-project-scope-B2cuvtTy.js";import{t as os}from"./ChevronUp-DGrguvGW.js";import{i as ns}from"./ChevronRight-DzRB-rdO.js";import{A as is}from"./access-gate-BZbNb1lq.js";import"./Check-BWpBE9uf.js";import"./table-Di_WRNkb.js";import"./ArrowUp-C0eratGp.js";import"./SearchMd-DRRptSJN.js";import"./Tool02-C_xRWqQk.js";import"./agent-icon-DrlilhFJ.js";import"./AlertCircle-EniJtD8E.js";import"./Tool01-BnKd95Y1.js";import"./ArrowRight-Cu8UuHNR.js";import"./TrendUp01-PFzYDizC.js";import"./ZoomOut-BXPGwF_O.js";import"./Users03-CRtXqa1Q.js";import"./CheckCircle-cinYKmPU.js";import"./ChevronSelectorVertical-BiIbFU31.js";import"./UserSquare-CCDsU001.js";import"./Copy01-DayLu0dF.js";import"./CreditCard01-4OsjIT5f.js";import"./Database01-2gG_9E30.js";import"./Download01-BC2rKbuh.js";import"./Printer-fz_zwxfT.js";import"./Settings02-D2oiGU4q.js";import"./Eye-dnrP5DkM.js";import"./File02-BhckHV8N.js";import"./Share07-D_kiq5Fr.js";import"./GitBranch01-BBn4dN5f.js";import"./Globe01-SLAc63wC.js";import"./SwitchHorizontal01-CxlKjkIX.js";import"./HardDrive-FlnOYA_8.js";import"./Image01-BrHSH-Vi.js";import"./Key01-CKcg8G1v.js";import"./Link01-3t9JrUgl.js";import"./LinkExternal01-Cp7uxK1i.js";import"./Monitor01-BUruMK2r.js";import"./Sun-nKOZMh9n.js";import"./Package-CdfyZYxN.js";import"./Palette-CglyAOTg.js";import"./Play-rnw1eV52.js";import"./SearchLg-FC9suxna.js";import"./Shield01-CjyLhqlS.js";import"./Stars01-COChWymR.js";import"./Upload01-CqWnAR1-.js";import"./User01-BJoNdkjl.js";import"./Users01-DSQPwtP5.js";import"./XCircle-9Cb0khfg.js";import"./XClose-Cw4b4Uag.js";import"./Zap-ChVc0p76.js";import"./infiniteQueryObserver-DgAoAIrN.js";import"./auth-RjDDTUUT.js";import"./github-repo-C0igpkr9.js";import"./capability-load-error-CJ3e1sqb.js";const He="basic-usage",Ze=[{id:He,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","ORGANIZATION_HAS_SITE","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_AUTOMATION_LIST","TASK_BOARD_AUTOMATION_UPSERT","TASK_BOARD_AUTOMATION_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_AUTOMATION_DELETE","JIRA_RUN_START"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS","COMMERCE_DISCOVERY_SET_REPOSITORY"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Ze.find(t=>t.id===He)?.tools??[]];const rs=["agents:manage","connections:manage"];new Set(Ze.filter(t=>rs.includes(t.id)).flatMap(t=>t.tools));function as(){const t=new Map;for(const e of Ze){if(e.id===He)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function cs(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ds(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}const qe="projects",ot="*";function ms(t){if(!t)return null;const e=t[qe];return Array.isArray(e)?e:null}function us(t){const e=J.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:d,onSelect:f,onToggle:m}=t,c=r?"bg-accent/50":"hover:bg-muted/50";let g;e[0]!==c?(g=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),e[0]=c,e[1]=g):g=e[1];let u;e[2]!==l.icon||e[3]!==l.title?(u=s.jsx($e,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=u):u=e[4];let h;e[5]!==l.title?(h=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=h):h=e[6];let x;e[7]!==f||e[8]!==u||e[9]!==h?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:f,children:[u,h]}),e[7]=f,e[8]=u,e[9]=h,e[10]=x):x=e[10];let a;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==m||e[15]!==d?(a=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",d]}),s.jsx(ke,{checked:n,onCheckedChange:m,onClick:fs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=m,e[15]=d,e[16]=a):a=e[16];let T;return e[17]!==g||e[18]!==x||e[19]!==a?(T=s.jsxs("div",{className:g,children:[x,a]}),e[17]=g,e[18]=x,e[19]=a,e[20]=T):T=e[20],T}function fs(t){return t.stopPropagation()}function gs(t){const e=J.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,d=`tool-${l}-${r.name}`,f=n?"text-foreground":"text-muted-foreground";let m;e[0]!==f?(m=Z("text-sm font-medium",f),e[0]=f,e[1]=m):m=e[1];let c;e[2]!==m||e[3]!==r.name?(c=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:r.name})}),e[2]=m,e[3]=r.name,e[4]=c):c=e[4];let g;e[5]!==r.description?(g=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=g):g=e[6];let u;e[7]!==c||e[8]!==g?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,g]}),e[7]=c,e[8]=g,e[9]=u):u=e[9];const h=`tool-${l}-${r.name}`;let x;e[10]!==n||e[11]!==o||e[12]!==h?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ke,{id:h,checked:n,onCheckedChange:o,onClick:hs})}),e[10]=n,e[11]=o,e[12]=h,e[13]=x):x=e[13];let a;return e[14]!==d||e[15]!==u||e[16]!==x?(a=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[u,x]}),e[14]=d,e[15]=u,e[16]=x,e[17]=a):a=e[17],a}function hs(t){return t.stopPropagation()}function Ts({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,d]=Q.useState(""),f=r!==void 0?r:o,m=Q.useDeferredValue(f),[c,g]=Q.useState("all"),[u,h]=Q.useState(!1),x=Q.useRef(new Set(Object.keys(t))),{org:a}=Ge(),T=Zt({connectionId:jt,orgId:a.id,orgSlug:a.slug}),S=100,E=m.trim(),I=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,b=!!l,N={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:0,...b&&{include_virtual:!0}},D=JSON.stringify(N),{data:A,fetchNextPage:j,hasNextPage:P,isFetchingNextPage:_}=Ht({queryKey:de.collectionListInfinite(T,a.id,"","CONNECTIONS",D),queryFn:async({pageParam:p=0})=>(await T.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:p,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(p,w)=>{if(p?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),O=A?.pages.flatMap(p=>p?.items??[])??[],C=Qt(j,P??!1,_),i=l?O.filter(p=>p.connection_type!=="VIRTUAL"?!0:Jt(p.connection_url)!==l):O,R=x.current,k=[...R.values()].map(p=>i.find(w=>w.id===p)).filter(p=>p!==void 0),G=i.filter(p=>!R.has(p.id)),Y=[...k,...G],v=p=>{const w=t[p];return w!==void 0&&w.length>0},K=Y.filter(p=>{if(c==="all")return!0;const w=v(p.id);return c==="selected"?w:c==="unselected"?!w:!0}),[L,F]=Q.useState(Y[0]?.id??null),V=L?Y.find(p=>p.id===L)??null:null,{data:U,isFetching:B}=Ke({queryKey:de.collectionItem(T,a.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await T.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=U?.tools??[],W=(p,w)=>t[p]?.includes(w)??!1,te=(p,w)=>{const H=t[p]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[p]:se[p]=le}else se[p]=[...H,w];e(se)},oe=p=>{const w=p===L?$:[];if(!w.length)return;const H=t[p]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[p]:(le[p]=q,F(p)),e(le)},z=p=>{F(p),h(!0)},X=()=>{h(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[r===void 0&&s.jsx(qt,{value:o,onChange:d,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>g("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>g("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>g("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:K.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(f?"common.toolSetSelector.noConnectionsFound":c==="selected"?"common.toolSetSelector.noServersSelected":c==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(p=>{const w=L===p.id,H=w?$.length:0,q=t[p.id]?.length??0;return s.jsx(us,{connection:{...p,tools:w?$:p.tools},isSelected:w,hasToolsEnabled:v(p.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>z(p.id),onToggle:()=>oe(p.id)},p.id)}),s.jsx("div",{ref:C,className:"h-4"}),_&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",u?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:X,className:"h-8 w-8 p-0 shrink-0",children:s.jsx($t,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx($e,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:$.map(p=>s.jsx(gs,{connectionId:V.id,tool:p,isSelected:W(V.id,p.name),onToggle:()=>te(V.id,p.name)},p.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const xs=Je({role:Je({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Ve(),staticPermissions:Me(re()),toolSet:We(re(),Me(re())),allowAllModels:Ve(),modelSet:We(re(),Me(re())),allowAllProjects:Ve(),projectSet:Me(re()),memberIds:Me(re())});function nt(t,e,l,r){const n=s.jsx(me,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(Pe,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function _s(t){const e=J.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie();let g;e[0]!==f?(g=f.trim().toLowerCase(),e[0]=f,e[1]=g):g=e[1];const u=Q.useDeferredValue(g);let h;if(e[2]!==l||e[3]!==u||e[4]!==n||e[5]!==o||e[6]!==m||e[7]!==f||e[8]!==r||e[9]!==c){const x=as(),a=(_,O)=>{if(!m){if(l&&O){const C=x.flatMap(Is).flatMap(Es);n(!1),o(C.filter(i=>!_.tools.includes(i)));return}l||o(ds(_,r,!O))}};let T;e[11]!==u?(T=_=>{const{section:O,capabilities:C}=_;return{section:O,capabilities:C.filter(i=>!u||i.label.toLowerCase().includes(u)||i.description.toLowerCase().includes(u))}},e[11]=u,e[12]=T):T=e[12];const S=x.map(T).filter(ps);let E;e[13]!==c?(E=c("settings.orgRoleDetail.general"),e[13]=c,e[14]=E):E=e[14];let I;e[15]!==c?(I=c("settings.orgRoleDetail.allOrgPermissions"),e[15]=c,e[16]=I):I=e[16];let b;e[17]!==c?(b=c("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=c,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==n||e[21]!==o?(N=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=N):N=e[22];let D;e[23]!==l||e[24]!==m||e[25]!==c||e[26]!==N?(D=nt(c,l,m,N),e[23]=l,e[24]=m,e[25]=c,e[26]=N,e[27]=D):D=e[27];let A;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m?(A=m?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=A):A=e[32];let j;e[33]!==A||e[34]!==I||e[35]!==b||e[36]!==D?(j=s.jsx(et,{children:s.jsx(tt,{title:I,description:b,action:D,onClick:A})}),e[33]=A,e[34]=I,e[35]=b,e[36]=D,e[37]=j):j=e[37];let P;e[38]!==j||e[39]!==E?(P=s.jsx(Xe,{title:E,children:j}),e[38]=j,e[39]=E,e[40]=P):P=e[40],h=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[P,S.length===0&&u?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:c("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:f})}):S.map(_=>{const{section:O,capabilities:C}=_;return s.jsx(Xe,{title:O,children:s.jsx(et,{children:C.map(i=>{const R=cs(i,r,l);return s.jsx(tt,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(Mt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:nt(c,R,m,()=>a(i,R)),onClick:m?void 0:()=>a(i,R)},i.id)})})},O)})]})}),e[2]=l,e[3]=u,e[4]=n,e[5]=o,e[6]=m,e[7]=f,e[8]=r,e[9]=c,e[10]=h}else h=e[10];return h}function ps(t){return t.capabilities.length>0}function Es(t){return t.tools}function Is(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},Rs={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ss(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function As(t){return Rs[t]??Nt[t]??t}function Ns(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ct=30;function Cs(t){const e=J.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:d,allConnectionModelIds:f,selectedModels:m,allowAllModels:c,allConnectionModelsSelected:g,onToggleModel:u,onExitAllowAll:h,readOnly:x,defaultExpanded:a}=t,T=ie(),[S,E]=Q.useState(a),I=a||S,b=E,[N,D]=Q.useState(Ct);let A;e[0]!==g||e[1]!==c||e[2]!==m?(A=_=>c||g||m.includes("*")||m.includes(_),e[0]=g,e[1]=c,e[2]=m,e[3]=A):A=e[3];const j=A;let P;if(e[4]!==f||e[5]!==c||e[6]!==l||e[7]!==I||e[8]!==o||e[9]!==j||e[10]!==d||e[11]!==h||e[12]!==u||e[13]!==x||e[14]!==r||e[15]!==n||e[16]!==T||e[17]!==N){let _;e[19]!==j?(_=B=>j(B.id),e[19]=j,e[20]=_):_=e[20];const O=d.filter(_).length,C=d.slice(0,N),i=d.length>N;let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=()=>b(Ds),e[21]=R):R=e[21];const k=o??Et[r]??It;let G;e[22]!==n||e[23]!==k?(G=s.jsx($e,{icon:k,name:n,size:"sm"}),e[22]=n,e[23]=k,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let v;e[27]!==G||e[28]!==Y?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=v):v=e[29];const K=T("settings.orgRoleDetail.enabledCount",{enabledCount:O,total:d.length});let L;e[30]!==K?(L=s.jsx(Le,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let F;e[32]!==I?(F=I?s.jsx(os,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(ns,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=I,e[33]=F):F=e[33];let V;e[34]!==L||e[35]!==F?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[L,F]}),e[34]=L,e[35]=F,e[36]=V):V=e[36];let U;e[37]!==V||e[38]!==v?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:R,children:[v,V]}),e[37]=V,e[38]=v,e[39]=U):U=e[39],P=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[C.map(B=>{const $=j(B.id),W=()=>{if(!x){if(c){h(l,f,B.id);return}u(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:W,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:js,children:x?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:$,disabled:!0,onCheckedChange:bs})})}),s.jsx(Pe,{children:s.jsx("p",{children:T("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:$,onCheckedChange:W})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>D(Os),children:T("settings.orgRoleDetail.showMore",{remaining:d.length-N})})]})]}),e[4]=f,e[5]=c,e[6]=l,e[7]=I,e[8]=o,e[9]=j,e[10]=d,e[11]=h,e[12]=u,e[13]=x,e[14]=r,e[15]=n,e[16]=T,e[17]=N,e[18]=P}else P=e[18];return P}function Os(t){return t+Ct}function bs(){}function js(t){return t.stopPropagation()}function Ds(t){return!t}function Ps(t){const e=J.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:d,allConnectionModelsSelected:f,searchQuery:m,readOnly:c}=t,g=ts(l.id);let u,h,x,a,T;if(e[0]!==f||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==d||e[6]!==o||e[7]!==g||e[8]!==c||e[9]!==m||e[10]!==r){T=Symbol.for("react.early_return_sentinel");e:{let I;e[16]!==l.label?(I=R=>({...R,id:R.modelId,provider:l.label}),e[16]=l.label,e[17]=I):I=e[17];const b=g.filter(ys).map(I),N=m.trim().toLowerCase(),D=N?b.filter(R=>R.title.toLowerCase().includes(N)||R.id.toLowerCase().includes(N)||R.provider?.toLowerCase().includes(N)):b;if(D.length===0){T=null;break e}const A=new Map;for(const R of D){const k=Ss(R.id,l.providerId),G=A.get(k)??{models:[],logo:null};G.models.push({id:R.id,title:Ns(R.title),logo:R.logo}),!G.logo&&R.logo&&(G.logo=R.logo),A.set(k,G)}const j=Array.from(A.entries()).map(Ls).sort(vs),P=j.length===1||N.length>0;x="flex flex-col gap-3";const _=Et[l.providerId]??It;let O;e[18]!==l.providerId||e[19]!==_?(O=s.jsx("img",{src:_,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=_,e[20]=O):O=e[20];const C=Nt[l.providerId]??l.providerId;let i;e[21]!==C?(i=s.jsx("h4",{className:"text-sm font-medium",children:C}),e[21]=C,e[22]=i):i=e[22],e[23]!==i||e[24]!==O?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[O,i]}),e[23]=i,e[24]=O,e[25]=a):a=e[25],u="flex flex-col gap-3",h=j.map(R=>s.jsx(Cs,{connectionId:l.id,subProviderId:R.id,subProviderName:R.name,groupLogo:R.logo,models:R.models,allConnectionModelIds:b.map(Ms),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:f,onToggleModel:o,onExitAllowAll:d,readOnly:c,defaultExpanded:P},R.id))}e[0]=f,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=d,e[6]=o,e[7]=g,e[8]=c,e[9]=m,e[10]=r,e[11]=u,e[12]=h,e[13]=x,e[14]=a,e[15]=T}else u=e[11],h=e[12],x=e[13],a=e[14],T=e[15];if(T!==Symbol.for("react.early_return_sentinel"))return T;let S;e[26]!==u||e[27]!==h?(S=s.jsx("div",{className:u,children:h}),e[26]=u,e[27]=h,e[28]=S):S=e[28];let E;return e[29]!==x||e[30]!==a||e[31]!==S?(E=s.jsxs("div",{className:x,children:[a,S]}),e[29]=x,e[30]=a,e[31]=S,e[32]=E):E=e[32],E}function Ms(t){return t.id}function vs(t,e){return t.name.localeCompare(e.name)}function Ls(t){const[e,l]=t;return{id:e,name:As(e),logo:l.logo,models:l.models}}function ys(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function ws(t){const e=J.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie(),g=Q.useDeferredValue(f),u=es();let h;e[0]!==r||e[1]!==o?(h=(_,O)=>{const C=r[_]??[],i={...r};if(C.includes(O)){const R=C.filter(k=>k!==O);R.length===0?delete i[_]:i[_]=R}else i[_]=[...C,O];o(i)},e[0]=r,e[1]=o,e[2]=h):h=e[2];const x=h;let a;e[3]!==r||e[4]!==n||e[5]!==o?(a=(_,O,C)=>{n(!1),o({...r,[_]:O.filter(i=>i!==C)})},e[3]=r,e[4]=n,e[5]=o,e[6]=a):a=e[6];const T=a,S=!m&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==S?(E=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=E):E=e[8];let I;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==m?(I=()=>{if(m)return;const _=!l;n(_),_&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=m,e[13]=I):I=e[13];let b;e[14]!==c?(b=c("settings.orgRoleDetail.allModels"),e[14]=c,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let D;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==m||e[22]!==c?(D=s.jsx("div",{onClick:ks,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:l,disabled:!0,onCheckedChange:Gs})})}),s.jsx(Pe,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:l,onCheckedChange:_=>{n(_),_&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=m,e[22]=c,e[23]=D):D=e[23];let A;e[24]!==E||e[25]!==I||e[26]!==N||e[27]!==D?(A=s.jsxs("div",{className:E,onClick:I,children:[N,D]}),e[24]=E,e[25]=I,e[26]=N,e[27]=D,e[28]=A):A=e[28];let j;e[29]!==u||e[30]!==l||e[31]!==g||e[32]!==T||e[33]!==r||e[34]!==m||e[35]!==c||e[36]!==x?(j=u.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noLlmConnectionsConfigured")}):u.map(_=>s.jsx(Q.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Oe,{className:"size-4"}),c("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ps,{connection:_,selectedModels:r[_.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:T,allConnectionModelsSelected:(r[_.id]??[]).includes("*"),searchQuery:g,readOnly:m})},_.id)),e[29]=u,e[30]=l,e[31]=g,e[32]=T,e[33]=r,e[34]=m,e[35]=c,e[36]=x,e[37]=j):j=e[37];let P;return e[38]!==A||e[39]!==j?(P=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[A,j]}),e[38]=A,e[39]=j,e[40]=P):P=e[40],P}function Gs(){}function ks(t){return t.stopPropagation()}function Us(t){const e=J.c(39),{allowAllProjects:l,projectSet:r,onAllowAllChange:n,onProjectSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie(),g=Q.useDeferredValue(f),u=Xt();let h;if(e[0]!==l||e[1]!==g||e[2]!==n||e[3]!==o||e[4]!==r||e[5]!==m||e[6]!==f||e[7]!==c||e[8]!==u){const x=ls(u),a=g.trim().toLowerCase(),T=a?x.filter(C=>C.title.toLowerCase().includes(a)):x,S=C=>{if(l){n(!1),o(x.map(Ys).filter(i=>i!==C));return}r.includes(C)?o(r.filter(i=>i!==C)):o([...r,C])},E=!m&&"hover:bg-muted/50 cursor-pointer";let I;e[10]!==E?(I=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",E),e[10]=E,e[11]=I):I=e[11];let b;e[12]!==l||e[13]!==n||e[14]!==o||e[15]!==m?(b=()=>{if(m)return;const C=!l;n(C),C&&o([])},e[12]=l,e[13]=n,e[14]=o,e[15]=m,e[16]=b):b=e[16];let N;e[17]!==c?(N=c("settings.orgRoleDetail.allProjects"),e[17]=c,e[18]=N):N=e[18];let D;e[19]!==N?(D=s.jsx("span",{className:"text-sm font-medium",children:N}),e[19]=N,e[20]=D):D=e[20];let A;e[21]!==c?(A=c("settings.orgRoleDetail.allProjectsDescription"),e[21]=c,e[22]=A):A=e[22];let j;e[23]!==A?(j=s.jsx("span",{className:"text-xs text-muted-foreground",children:A}),e[23]=A,e[24]=j):j=e[24];let P;e[25]!==D||e[26]!==j?(P=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,j]}),e[25]=D,e[26]=j,e[27]=P):P=e[27];let _;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m||e[32]!==c?(_=s.jsx("div",{onClick:Vs,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:l,disabled:!0,onCheckedChange:Bs})})}),s.jsx(Pe,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:l,onCheckedChange:C=>{n(C),C&&o([])}})}),e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=c,e[33]=_):_=e[33];let O;e[34]!==P||e[35]!==_||e[36]!==I||e[37]!==b?(O=s.jsxs("div",{className:I,onClick:b,children:[P,_]}),e[34]=P,e[35]=_,e[36]=I,e[37]=b,e[38]=O):O=e[38],h=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 p-4",children:[O,x.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsAvailable")}):T.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsMatch",{searchQuery:f})}):s.jsx("div",{className:"flex flex-col gap-1",children:T.map(C=>{const i=l||r.includes(C.id);return s.jsxs("label",{className:Z("flex items-center gap-3 px-3 py-2 rounded-lg border border-transparent",m?"cursor-default":"hover:bg-muted/50 cursor-pointer"),children:[s.jsx(ke,{checked:i,disabled:m,onCheckedChange:()=>{m||S(C.id)}}),s.jsx(ss,{icon:C.icon,name:C.title}),s.jsx("span",{className:"text-sm truncate",children:C.title})]},C.id)})})]}),e[0]=l,e[1]=g,e[2]=n,e[3]=o,e[4]=r,e[5]=m,e[6]=f,e[7]=c,e[8]=u,e[9]=h}else h=e[9];return h}function Bs(){}function Vs(t){return t.stopPropagation()}function Ys(t){return t.id}function Ks(t){const e=J.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,d=ie(),[f,m]=Q.useState(""),c=Q.useDeferredValue(f);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[u,h]=Q.useState(g),{data:x}=Rt();let a,T,S,E,I,b,N,D,A,j,P;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==u||e[7]!==f||e[8]!==n||e[9]!==d){const L=x?.data?.members??[];let F;e[21]!==c?(F=z=>{const X=c.toLowerCase();return z.user?.name?.toLowerCase().includes(X)||z.user?.email?.toLowerCase().includes(X)},e[21]=c,e[22]=F):F=e[22];const V=L.filter(F);let U;e[23]!==o||e[24]!==r||e[25]!==u?(U=()=>{o(u),h([]),r(!1)},e[23]=o,e[24]=r,e[25]=u,e[26]=U):U=e[26],S=U,T=ut,j=l,P=r,a=ft,D="sm:max-w-md p-0";let B;e[27]!==d?(B=d("settings.orgRoleDetail.addMembersToRole"),e[27]=d,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(gt,{children:B}),e[29]=B,e[30]=$):$=e[30];let W;e[31]!==d?(W=d("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=d,e[32]=W):W=e[32];let te;e[33]!==W?(te=s.jsx(ht,{children:W}),e[33]=W,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(A=s.jsxs(Tt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=A):A=e[37],b="flex flex-col h-80";let oe;e[38]!==d?(oe=d("settings.orgRoleDetail.searchMembers"),e[38]=d,e[39]=oe):oe=e[39],e[40]!==f||e[41]!==oe?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:f,onChange:m,placeholder:oe,className:"w-full"})}),e[40]=f,e[41]=oe,e[42]=N):N=e[42],E="flex-1 overflow-auto",I=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d(f?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(z=>{const X=z.role!=="owner",p=n.includes(z.id),w=u.includes(z.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!X||p?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ke,{checked:w||p,onCheckedChange:()=>{!X||p||h(H=>H.includes(z.id)?H.filter(q=>q!==z.id):[...H,z.id])},disabled:!X||p}),s.jsx(At,{url:z.user?.image??void 0,fallback:St(z.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:z.user?.name||d("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:z.user?.email})]}),!X&&s.jsx(Le,{variant:"secondary",className:"shrink-0",children:d("settings.orgRoleDetail.owner")}),p&&X&&s.jsx(Le,{variant:"outline",className:"shrink-0",children:d("settings.orgRoleDetail.added")})]},z.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=o,e[4]=r,e[5]=l,e[6]=u,e[7]=f,e[8]=n,e[9]=d,e[10]=a,e[11]=T,e[12]=S,e[13]=E,e[14]=I,e[15]=b,e[16]=N,e[17]=D,e[18]=A,e[19]=j,e[20]=P}else a=e[10],T=e[11],S=e[12],E=e[13],I=e[14],b=e[15],N=e[16],D=e[17],A=e[18],j=e[19],P=e[20];let _;e[43]!==E||e[44]!==I?(_=s.jsx("div",{className:E,children:I}),e[43]=E,e[44]=I,e[45]=_):_=e[45];let O;e[46]!==_||e[47]!==b||e[48]!==N?(O=s.jsxs("div",{className:b,children:[N,_]}),e[46]=_,e[47]=b,e[48]=N,e[49]=O):O=e[49];let C;e[50]!==d?(C=d("settings.orgRoleDetail.cancel"),e[50]=d,e[51]=C):C=e[51];let i;e[52]!==C?(i=s.jsx(xt,{children:C}),e[52]=C,e[53]=i):i=e[53];const R=u.length===0;let k;e[54]!==u.length||e[55]!==d?(k=d("settings.orgRoleDetail.addWithCount",{count:u.length}),e[54]=u.length,e[55]=d,e[56]=k):k=e[56];let G;e[57]!==S||e[58]!==R||e[59]!==k?(G=s.jsx(_t,{onClick:S,disabled:R,children:k}),e[57]=S,e[58]=R,e[59]=k,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(pt,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==a||e[65]!==O||e[66]!==Y||e[67]!==D||e[68]!==A?(v=s.jsxs(a,{className:D,children:[A,O,Y]}),e[64]=a,e[65]=O,e[66]=Y,e[67]=D,e[68]=A,e[69]=v):v=e[69];let K;return e[70]!==T||e[71]!==v||e[72]!==j||e[73]!==P?(K=s.jsx(T,{open:j,onOpenChange:P,children:v}),e[70]=T,e[71]=v,e[72]=j,e[73]=P,e[74]=K):K=e[74],K}function Fs(t){const e=J.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:d,addMemberDialogOpen:f,onAddMemberDialogOpenChange:m}=t,c=n===void 0?!1:n,g=o===void 0?void 0:o,u=ie(),h=Q.useDeferredValue(d),{data:x}=Rt();let a,T,S;if(e[0]!==x?.data?.members||e[1]!==h||e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==g||e[6]!==d||e[7]!==u){const D=x?.data?.members??[];let A;e[11]!==l?(A=i=>l.includes(i.id),e[11]=l,e[12]=A):A=e[12];const j=D.filter(A);let P;e[13]!==h?(P=i=>{const R=h.toLowerCase();return i.user?.name?.toLowerCase().includes(R)||i.user?.email?.toLowerCase().includes(R)},e[13]=h,e[14]=P):P=e[14];const _=j.filter(P);let O;e[15]!==g||e[16]!==u?(O=g??u("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=g,e[16]=u,e[17]=O):O=e[17];const C=O;S="flex flex-col h-full",a="flex-1 overflow-auto",T=j.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:u("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):_.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.noMembersMatch",{searchQuery:d})})}):s.jsx("div",{className:"p-4 space-y-2",children:_.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(At,{url:i.user?.image??void 0,fallback:St(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||u("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),c?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),children:s.jsx(st,{size:16})})})}),s.jsx(Pe,{children:s.jsx("p",{children:C})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(R=>R!==i.id)),children:s.jsx(st,{size:16})})]},i.id))}),e[0]=x?.data?.members,e[1]=h,e[2]=l,e[3]=r,e[4]=c,e[5]=g,e[6]=d,e[7]=u,e[8]=a,e[9]=T,e[10]=S}else a=e[8],T=e[9],S=e[10];let E;e[18]!==a||e[19]!==T?(E=s.jsx("div",{className:a,children:T}),e[18]=a,e[19]=T,e[20]=E):E=e[20];let I;e[21]!==l||e[22]!==r?(I=D=>r([...l,...D]),e[21]=l,e[22]=r,e[23]=I):I=e[23];let b;e[24]!==f||e[25]!==l||e[26]!==m||e[27]!==I?(b=s.jsx(Ks,{open:f,onOpenChange:m,selectedMemberIds:l,onAddMembers:I}),e[24]=f,e[25]=l,e[26]=m,e[27]=I,e[28]=b):b=e[28];let N;return e[29]!==S||e[30]!==E||e[31]!==b?(N=s.jsxs("div",{className:S,children:[E,b]}),e[29]=S,e[30]=E,e[31]=b,e[32]=N):N=e[32],N}function zs(t){const e=J.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx(Q.Suspense,{fallback:l,children:s.jsx(Fs,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const Qs={owner:[],admin:[],user:[]};function $s(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:Qs[t],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Hs(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),d=o?[]:n.filter(a=>a!=="*"),f={};for(const[a,T]of Object.entries(r))if(!(a==="self"||a==="models"||a===qe))if(a==="*")for(const S of l)f[S.id]=T.includes("*")?S.tools?.map(E=>E.name)??[]:T;else{const S=l.find(E=>E.id===a);S&&(f[a]=T.includes("*")?S.tools?.map(E=>E.name)??[]:T)}const m=r.models||[],c=m.length===0||m.includes("*:*"),g={};if(!c)for(const a of m){const T=a.indexOf(":");if(T===-1)continue;const S=a.slice(0,T),E=a.slice(T+1);g[S]||(g[S]=[]),g[S].push(E)}const u=ms(r),h=u===null||u.includes(ot),x=h?[]:u.filter(a=>a!==ot);return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:d,toolSet:f,allowAllModels:c,modelSet:g,allowAllProjects:h,projectSet:x,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Zs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const d=e.find(f=>f.id===r)?.tools?.map(f=>f.name)??[];l[r]=d.length>0&&d.every(f=>n.includes(f))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const d of o)r.push(`${n}:${d}`);r.length>0&&(l.models=r)}return t.allowAllProjects||(l[qe]=t.projectSet),l}function qs(t,e,l){return t.kind==="builtin"?$s(t.role,e,void 0):t.kind==="custom"?Hs(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:[]}}function Js(t){const e=J.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,d=ie();let f;e[0]!==o||e[1]!==d?(f=o??d("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=d,e[2]=f):f=e[2];const m=f;if(l){let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ye,{size:16}),e[3]=h):h=e[3];let x;e[4]!==d?(x=d("settings.orgRoleDetail.addMember"),e[4]=d,e[5]=x):x=e[5];let a;e[6]!==x?(a=s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[h,x]})})}),e[6]=x,e[7]=a):a=e[7];let T;e[8]!==m?(T=s.jsx(Pe,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=T):T=e[9];let S;return e[10]!==a||e[11]!==T?(S=s.jsx(be,{children:s.jsxs(je,{children:[a,T]})}),e[10]=a,e[11]=T,e[12]=S):S=e[12],S}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ye,{size:16}),e[13]=c):c=e[13];let g;e[14]!==d?(g=d("settings.orgRoleDetail.addMember"),e[14]=d,e[15]=g):g=e[15];let u;return e[16]!==n||e[17]!==g?(u=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[c,g]}),e[16]=n,e[17]=g,e[18]=u):u=e[18],u}function Ws(t){const e=J.c(14),{locator:l}=Ge(),r=ze(),n=Wt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==r?(d=()=>r.organization.listMembers(),e[2]=r,e[3]=d):d=e[3];let f;e[4]!==o||e[5]!==d?(f={queryKey:o,queryFn:d},e[4]=o,e[5]=d,e[6]=f):f=e[6];const{data:m,isPending:c}=Ke(f);if(c||!n){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=x):x=e[7],x}let g;e[8]!==m?.data?.members?(g=m?.data?.members??[],e[8]=m?.data?.members,e[9]=g):g=e[9];const u=g;let h;return e[10]!==n||e[11]!==u||e[12]!==t?(h=s.jsx(Xs,{...t,members:u,connections:n}),e[10]=n,e[11]=u,e[12]=t,e[13]=h):h=e[13],h}function Xs({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:d}=Ge(),f=ze(),m=it(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",u=t.kind==="new",[h,x]=Q.useState(c?"org":"mcp"),a=Dt({resolver:Pt(xs),defaultValues:qs(t,r,n)}),T=a.formState.isValid,S=a.formState.isDirty,E=rt({mutationFn:async i=>{const R=Zs(i,n),k=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(v,K)=>{const L=r.filter(U=>U.role===(K??v)).map(U=>U.id),F=i.memberIds.filter(U=>!L.includes(U)),V=L.filter(U=>!i.memberIds.includes(U));for(const U of F){const B=await f.organization.updateMemberRole({memberId:U,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await f.organization.updateMemberRole({memberId:U,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const v=i.role.label.toLowerCase().replace(/\s+/g,"-"),K=i.role.slug,L=v!==K,F=await f.organization.updateRole({roleId:i.role.id,data:{permission:R,...L?{roleName:v}:{}}});if(F?.error)throw new Error(F.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(L?v:K,L?K:void 0),L?{...i,role:{...i.role,slug:v}}:i}else{const v=await f.organization.createRole({role:k,permission:R});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await f.organization.updateMemberRole({memberId:K,role:[k]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:k}}}},onSuccess:(i,R)=>{m.invalidateQueries({queryKey:de.members(d)}),m.invalidateQueries({queryKey:de.organizationRoles(d)});const k=!R.role.id&&!R.role.slug,G=R.role.slug==="owner"&&!R.role.id;Fe(G?"role_members_updated":k?"role_created":"role_updated",{role_slug:R.role.slug??null}),ve.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),a.reset(i),l(i.role.id)},onError:i=>{ve.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),I=a.handleSubmit(i=>{if(!i.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),a.setFocus("role.label");return}E.mutate(i)}),b=!g,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",D=[...g?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"projects",label:o("settings.orgRoleDetail.projects")},{id:"members",label:o("settings.orgRoleDetail.members")}],[A,j]=Q.useState(""),[P,_]=Q.useState(!1),O=i=>{x(i),j("")},C={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),projects:o("settings.orgRoleDetail.searchProjects"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ce,{children:s.jsxs(Ce.Content,{className:Z("flex flex-col",h!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ce.Title,{actions:b&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:I,disabled:E.isPending||!T||!S,children:E.isPending?o("settings.orgRoleDetail.saving"):o(u?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?mt(t.role,!0):kt(a.watch("role.label")))}),g&&s.jsx(at,{size:16,className:"text-muted-foreground shrink-0"}),u||t.kind==="custom"?s.jsx("input",{...a.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:u}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:D.map(i=>s.jsx("button",{type:"button",onClick:()=>O(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",h===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Qe,{value:A,onChange:j,placeholder:C[h]??"Search...",className:"w-full md:w-[375px]"}),h==="members"&&s.jsx(Js,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>_(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",h!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(h!=="org"&&"h-full overflow-hidden",h!=="models"&&h!=="projects"&&h!=="org"&&"border border-border rounded-xl bg-card"),children:[h==="mcp"&&!g&&s.jsx(Ts,{toolSet:a.watch("toolSet"),onToolSetChange:i=>a.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:A}),h==="org"&&s.jsx(_s,{allowAllStaticPermissions:a.watch("allowAllStaticPermissions"),staticPermissions:a.watch("staticPermissions"),onAllowAllChange:i=>a.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>a.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="models"&&s.jsx(ws,{allowAllModels:a.watch("allowAllModels"),modelSet:a.watch("modelSet"),onAllowAllChange:i=>a.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>a.setValue("modelSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="projects"&&s.jsx(Us,{allowAllProjects:a.watch("allowAllProjects"),projectSet:a.watch("projectSet"),onAllowAllChange:i=>a.setValue("allowAllProjects",i,{shouldDirty:!0}),onProjectSetChange:i=>a.setValue("projectSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="members"&&s.jsx(zs,{memberIds:a.watch("memberIds"),onMemberIdsChange:i=>a.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:A,addMemberDialogOpen:P,onAddMemberDialogOpenChange:_})]})})]})})}function el(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function tl(t){const e=J.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:d}=vt();let f;return e[0]!==l||e[1]!==r||e[2]!==d||e[3]!==n||e[4]!==o?(f=s.jsx(is,{granted:n,loading:o,error:d,area:l,children:r}),e[0]=l,e[1]=r,e[2]=d,e[3]=n,e[4]=o,e[5]=f):f=e[5],f}const sl=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function ll(){const t=J.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),d=wt();let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={strict:!1},t[0]=f):f=t[0];const{role:m}=ct(f),{locator:c}=Ge(),g=ze(),u=it(),{customRoles:h,refetch:x}=Gt();let a;t[1]!==d?(a=M=>d({to:".",search:y=>({...y,role:M})}),t[1]=d,t[2]=a):a=t[2];const T=a;let S;e:{if(!m){S=null;break e}if(m==="new"){S={kind:"new"};break e}if(m.startsWith("builtin-")){S={kind:"builtin",role:m.slice(8)};break e}let M;t[3]!==m?(M=ee=>ee.id===m,t[3]=m,t[4]=M):M=t[4];const y=h.find(M);S=y?{kind:"custom",role:y}:null}const E=S;let I;t[5]!==c?(I=de.members(c),t[5]=c,t[6]=I):I=t[6];let b;t[7]!==g?(b=()=>g.organization.listMembers(),t[7]=g,t[8]=b):b=t[8];let N;t[9]!==I||t[10]!==b?(N={queryKey:I,queryFn:b},t[9]=I,t[10]=b,t[11]=N):N=t[11];const{data:D}=Ke(N);let A;t[12]!==D?.data?.members?(A=D?.data?.members??[],t[12]=D?.data?.members,t[13]=A):A=t[13];const j=A;let P;t[14]!==j?(P=M=>j.filter(y=>y.role===M).length,t[14]=j,t[15]=P):P=t[15];const _=P;let O;if(t[16]!==h||t[17]!==_||t[18]!==l||t[19]!==e){let M;t[21]!==_||t[22]!==e?(M=ce=>({kind:"builtin",role:{...ce,memberCount:_(ce.role),label:e(ce.labelKey)}}),t[21]=_,t[22]=e,t[23]=M):M=t[23];const y=sl.map(M);let ee;t[24]!==_?(ee=ce=>({kind:"custom",role:{...ce,memberCount:_(ce.role)}}),t[24]=_,t[25]=ee):ee=t[25];const Ot=h.map(ee);if(O=[...y,...Ot],l){const ce=l.toLowerCase();O=O.filter(bt=>bt.role.label.toLowerCase().includes(ce))}t[16]=h,t[17]=_,t[18]=l,t[19]=e,t[20]=O}else O=t[20];let C;t[26]!==g?(C=async M=>{const y=await g.organization.deleteRole({roleId:M});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=g,t[27]=C):C=t[27];const i=rt({mutationFn:C,onSuccess:(M,y)=>{Fe("role_deleted",{role_id:y}),u.invalidateQueries({queryKey:de.members(c)}),u.invalidateQueries({queryKey:de.organizationRoles(c)}),ve.success(e("settings.roles.deletedSuccessfully")),x(),E?.kind==="custom"&&E.role.id===y&&T(void 0)},onError:al});let R;t[28]!==e?(R=e("settings.roles.columnRole"),t[28]=e,t[29]=R):R=t[29];let k;t[30]!==R?(k={id:"role",header:R,render:rl,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=R,t[31]=k):k=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=M=>M.kind==="builtin"?s.jsx(Le,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Le,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let v;t[36]!==G||t[37]!==Y?(v={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=v):v=t[38];let K;t[39]!==e?(K=e("settings.roles.columnPermissions"),t[39]=e,t[40]=K):K=t[40];let L;t[41]!==e?(L=M=>{if(M.kind==="builtin")return M.role.role==="owner"||M.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=M.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=L):L=t[42];let F;t[43]!==K||t[44]!==L?(F={id:"permissions",header:K,render:L,cellClassName:"flex-1 min-w-0"},t[43]=K,t[44]=L,t[45]=F):F=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let U;t[48]!==V?(U={id:"members",header:V,render:il,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:M=>M.kind==="builtin"?null:s.jsxs(Ut,{children:[s.jsx(Bt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:nl,children:s.jsx(Kt,{size:16})})}),s.jsx(Vt,{align:"end",onClick:ol,children:s.jsxs(Yt,{variant:"destructive",onClick:()=>{const y=M.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Ft,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==k||t[53]!==v||t[54]!==F||t[55]!==U||t[56]!==B?($=[k,v,F,U,B],t[52]=k,t[53]=v,t[54]=F,t[55]=U,t[56]=B,t[57]=$):$=t[57];const W=$;let te;t[58]!==T?(te=M=>{if(M.kind==="builtin")T(`builtin-${M.role.role}`);else{const y=M.role;T(y.id)}},t[58]=T,t[59]=te):te=t[59];const oe=te;if(E){let M;t[60]!==T?(M=()=>T(void 0),t[60]=T,t[61]=M):M=t[61];let y;return t[62]!==x||t[63]!==T?(y=()=>{x(),T(void 0)},t[62]=x,t[63]=T,t[64]=y):y=t[64],s.jsx(Ws,{target:E,onBack:M,onSaved:y},el(E))}let z;t[65]!==e?(z=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=z):z=t[66];let X;t[67]===Symbol.for("react.memo_cache_sentinel")?(X=M=>{M.key==="Escape"&&(r(""),M.target.blur())},t[67]=X):X=t[67];let p;t[68]!==l||t[69]!==z?(p=s.jsx(Qe,{value:l,onChange:r,placeholder:z,className:"w-full md:w-[375px]",onKeyDown:X}),t[68]=l,t[69]=z,t[70]=p):p=t[70];let w;t[71]!==T?(w=()=>T("new"),t[71]=T,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ye,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==p||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p,se]}),t[79]=p,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(lt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(lt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let ue;t[85]!==O||t[86]!==W||t[87]!==oe||t[88]!==ne?(ue=s.jsx(zt,{columns:W,data:O,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=O,t[86]=W,t[87]=oe,t[88]=ne,t[89]=ue):ue=t[89];const Ue=n!==null;let ye;t[90]===Symbol.for("react.memo_cache_sentinel")?(ye=M=>!M&&o(null),t[90]=ye):ye=t[90];let fe;t[91]!==e?(fe=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=fe):fe=t[92];let ge;t[93]!==fe?(ge=s.jsx(gt,{children:fe}),t[93]=fe,t[94]=ge):ge=t[94];const Be=n?.label??"";let he;t[95]!==e||t[96]!==Be?(he=e("settings.roles.deleteRoleConfirm",{role:Be}),t[95]=e,t[96]=Be,t[97]=he):he=t[97];let Te;t[98]!==he?(Te=s.jsx(ht,{children:he}),t[98]=he,t[99]=Te):Te=t[99];let xe;t[100]!==ge||t[101]!==Te?(xe=s.jsxs(Tt,{children:[ge,Te]}),t[100]=ge,t[101]=Te,t[102]=xe):xe=t[102];let _e;t[103]!==e?(_e=e("settings.roles.cancel"),t[103]=e,t[104]=_e):_e=t[104];let pe;t[105]!==_e?(pe=s.jsx(xt,{children:_e}),t[105]=_e,t[106]=pe):pe=t[106];let Ee;t[107]!==i||t[108]!==n?(Ee=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ee):Ee=t[109];let Ie;t[110]!==e?(Ie=e("settings.roles.delete"),t[110]=e,t[111]=Ie):Ie=t[111];let Re;t[112]!==Ee||t[113]!==Ie?(Re=s.jsx(_t,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ie}),t[112]=Ee,t[113]=Ie,t[114]=Re):Re=t[114];let Se;t[115]!==pe||t[116]!==Re?(Se=s.jsxs(pt,{children:[pe,Re]}),t[115]=pe,t[116]=Re,t[117]=Se):Se=t[117];let Ae;t[118]!==xe||t[119]!==Se?(Ae=s.jsxs(ft,{children:[xe,Se]}),t[118]=xe,t[119]=Se,t[120]=Ae):Ae=t[120];let Ne;t[121]!==Ue||t[122]!==Ae?(Ne=s.jsx(ut,{open:Ue,onOpenChange:ye,children:Ae}),t[121]=Ue,t[122]=Ae,t[123]=Ne):Ne=t[123];let we;return t[124]!==le||t[125]!==ue||t[126]!==Ne?(we=s.jsxs(dt,{group:"members",className:"gap-6",children:[le,ue,Ne]}),t[124]=le,t[125]=ue,t[126]=Ne,t[127]=we):we=t[127],we}function ol(t){return t.stopPropagation()}function nl(t){return t.stopPropagation()}function il(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function rl(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",mt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(at,{size:12,className:"text-muted-foreground shrink-0"})]})}function al(t,e){Fe("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ve.error(t instanceof Error?t.message:"Failed to delete role")}function cl(){const t=J.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=ct(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let d;t[5]!==r?(d=r?s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(dt,{group:"members",className:"gap-6",children:s.jsx(Lt,{})}),t[5]=r,t[6]=d):d=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ll,{}),t[7]=f):f=t[7];let m;t[8]!==d?(m=s.jsx(Q.Suspense,{fallback:d,children:f}),t[8]=d,t[9]=m):m=t[9];let c;return t[10]!==o||t[11]!==m?(c=s.jsx(yt,{fallback:o,children:m}),t[10]=o,t[11]=m,t[12]=c):c=t[12],c}function Vo(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(tl,{area:"roles",children:s.jsx(cl,{})}),t[0]=e):e=t[0],e}export{Vo as default};
|
|
1
|
+
import{b as ie,r as Q,I as Ge,x as jt,K as de,m as Ke,j as s,l as Z,h as Oe,B as ae,c as J,ak as Je,a_ as Me,am as re,b2 as Ve,b1 as We,n as it,aF as Dt,b0 as Pt,e as rt,t as ve,o as Fe,P as Ce,D as at,ex as Xe,ey as et,ez as tt,F as Mt,a8 as be,a9 as je,a6 as De,a7 as Pe,ap as st,e4 as vt,u as ct,fC as dt,fG as Lt,E as yt,d as wt}from"./index-BodvdIMk.js";import{u as Gt}from"./use-organization-roles--bC30gnD.js";import{u as ze}from"./use-org-auth-client-S952sZID.js";import{g as mt,a as kt}from"./role-color-Dn2tXDDF.js";import{B as Le}from"./badge-ByfZPYh0.js";import{A as ut,a as ft,c as gt,d as ht,b as Tt,f as xt,g as _t,e as pt}from"./alert-dialog-B19dFL0f.js";import{c as Ut,D as Bt,b as Vt,a as Yt}from"./dropdown-menu-DlZDenrk.js";import{i as Kt}from"./DotsVertical-Ct2yI8vr.js";import{s as Ye}from"./Plus-zXs3aP31.js";import{s as Ft}from"./Trash01-CH5l96iG.js";import{C as zt}from"./collection-table-wrapper-GiH-7xKS.js";import{E as lt}from"./empty-state-DrLFtqMC.js";import{S as Qe}from"./search-input-BEuwwr9P.js";import{P as Et,D as It}from"./ai-providers-logos-DD3qZ33J.js";import{I as $e}from"./integration-icon-BqCQeMla.js";import{u as Qt}from"./use-infinite-scroll-TMy8eEjN.js";import{C as ke}from"./checkbox-Cx7-cMI2.js";import{i as $t}from"./ArrowLeft-B4kTLC80.js";import{u as Ht}from"./useSuspenseInfiniteQuery-BuAksfER.js";import{u as Zt}from"./use-mcp-client-DO1cH-Rq.js";import{C as qt}from"./collection-search-DBiZveMp.js";import{p as Jt}from"./connection-D3sgkgc8.js";import{a as Rt}from"./use-members-Ca1m7gk-.js";import{g as St}from"./get-initials-D-f_fDFw.js";import{u as Wt}from"./use-connection-B0HreEyO.js";import{c as Xt}from"./use-virtual-mcp-DY2qk06G.js";import{u as es,g as ts}from"./use-ai-providers-BHw3Z_he.js";import{A as At}from"./avatar-CAI2JETZ.js";import{S as me}from"./switch-B1nJbGCG.js";import{P as ss}from"./project-icon-D14m61tO.js";import{s as ls}from"./use-project-scope-cOFjIv3F.js";import{t as os}from"./ChevronUp-SbK1Bh_A.js";import{i as ns}from"./ChevronRight-DfnK-irb.js";import{A as is}from"./access-gate-Cc7o9awR.js";import"./Check-_wGz2-IJ.js";import"./table-y_mRJ9Zn.js";import"./ArrowUp-Be_FwN-E.js";import"./SearchMd-uhtNwnF8.js";import"./Tool02-CnClhfmX.js";import"./agent-icon-DlT0cyOd.js";import"./AlertCircle-CfOItn1b.js";import"./Tool01-duhLcQNq.js";import"./ArrowRight-B4GAIQKI.js";import"./TrendUp01-fYoe36da.js";import"./ZoomOut-B6xnZLKD.js";import"./Users03-pPPKVW_h.js";import"./CheckCircle-BQEdmdLU.js";import"./ChevronSelectorVertical-DTb5009V.js";import"./UserSquare-CXNfIfPy.js";import"./Copy01-DoHw-_s5.js";import"./CreditCard01-CkbbYVCy.js";import"./Database01-DDqP2OWW.js";import"./Download01-IytcAces.js";import"./Printer-kkmv6XzS.js";import"./Settings02-DPUnnUpS.js";import"./Eye-Ccu8gsxq.js";import"./File02-CODRlzC9.js";import"./Share07-ezwRb3nU.js";import"./GitBranch01-y6_LtrpC.js";import"./Globe01-BHsBANMN.js";import"./SwitchHorizontal01-Dne29Upz.js";import"./HardDrive-Cr2Uhzo6.js";import"./Image01-PUenBySa.js";import"./Key01-ugSjw0sl.js";import"./Link01-CUXePRyB.js";import"./LinkExternal01-DLDyK_TN.js";import"./Monitor01-J9g_ep-X.js";import"./Sun-DZjMucTf.js";import"./Package-Dm9TBHk7.js";import"./Palette-BywMlwsu.js";import"./Play-HfzzXB20.js";import"./SearchLg-BkMCmJSN.js";import"./Shield01-BcXJFwaP.js";import"./Stars01-DdrI1AvW.js";import"./Upload01-DksJHtIE.js";import"./User01-DZs8rqql.js";import"./Users01-DZlg18P8.js";import"./XCircle-CoSRJnuK.js";import"./XClose-BYsCvLXW.js";import"./Zap-BLQffepl.js";import"./infiniteQueryObserver-BXxOeKaH.js";import"./auth-BRT05k6V.js";import"./github-repo-C0igpkr9.js";import"./capability-load-error-B39q7sVS.js";const He="basic-usage",Ze=[{id:He,label:"Basic Usage",description:"Tools all org members can access by default",section:"Basic Usage",tools:["COLLECTION_CONNECTIONS_LIST","COLLECTION_CONNECTIONS_GET","CONNECTION_TEST","COLLECTION_VIRTUAL_MCP_LIST","COLLECTION_VIRTUAL_MCP_GET","VIRTUAL_MCP_PLUGIN_CONFIG_GET","VIRTUAL_MCP_LAST_USED_LIST","AUTOMATION_GET","AUTOMATION_LIST","AUTOMATION_RUN_STATS","AI_PROVIDERS_LIST","AI_PROVIDERS_LIST_MODELS","AI_PROVIDERS_ACTIVE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_CREDITS","AI_PROVIDER_TOPUP_URL","LIST_OBJECTS","GET_OBJECT_METADATA","GET_PRESIGNED_URL","PUT_PRESIGNED_URL","FILE_OBJECTS_LIST","ORG_REPO_SYNC_LIST","SANDBOX_START","SANDBOX_DELETE","REPOSITORY_SEARCH_BRANCHES","GIT_PROVIDER_CAPABILITIES","GIT_ACCOUNT_LIST","REPOSITORY_LIST","REPOSITORY_SEARCH","CHANGE_REQUEST_STATE","CHANGE_REQUEST_LAST_MERGED","CHANGE_REQUEST_LIST_OPEN","CHANGE_REQUEST_CHECK_LOG","GLOBAL_SEARCH","ORGANIZATION_SETTINGS_GET","USER_GET","BRAND_CONTEXT_LIST","ORGANIZATION_HAS_SITE","COLLECTION_THREADS_CREATE","COLLECTION_THREADS_LIST","COLLECTION_THREADS_GET","COLLECTION_THREADS_UPDATE","COLLECTION_THREADS_DELETE","COLLECTION_THREAD_MESSAGES_LIST","TASK_BOARD_ITEM_CREATE","TASK_BOARD_ITEM_LIST","TASK_BOARD_ITEM_UPDATE","TASK_BOARD_ITEM_DELETE","TASK_BOARD_AUTOMATION_LIST","TASK_BOARD_AUTOMATION_UPSERT","TASK_BOARD_AUTOMATION_DELETE","TASK_BOARD_PROMPT_LIST","TASK_BOARD_PROMPT_UPSERT","TASK_BOARD_PROMPT_DELETE","TASK_BOARD_ITEM_PRS_GET","TASK_BOARD_PREVIEW_PROBE","TASK_BOARD_ITEM_RERUN","TASK_BOARD_REVIEW_DECISION","TASK_BOARD_PROMOTE_TO_PRODUCTION","TASK_BOARD_ACTIVITY_LIST","TASK_BOARD_COMMENT_LIST","TASK_BOARD_COMMENT_CREATE","TASK_BOARD_COMMENT_UPDATE","TASK_BOARD_COMMENT_DELETE","TASK_BOARD_DISMISSED_LIST","TASK_BOARD_DISMISSED_RESTORE","NOTIFICATION_LIST","NOTIFICATION_MARK_READ","NOTIFICATION_SUBSCRIPTION_SET","NOTIFICATION_SUBSCRIPTION_LIST"]},{id:"org:manage",label:"Manage organization",description:"Edit organization settings, brand context, and domain configuration",section:"Organization",tools:["ORGANIZATION_GET","ORGANIZATION_LIST","ORGANIZATION_UPDATE","ORGANIZATION_SETTINGS_GET","ORGANIZATION_SETTINGS_UPDATE","BRAND_CONTEXT_LIST","BRAND_CONTEXT_GET","BRAND_CONTEXT_CREATE","BRAND_CONTEXT_UPDATE","BRAND_CONTEXT_DELETE","BRAND_CONTEXT_EXTRACT","BRAND_GET","BRAND_LIST","ORGANIZATION_DOMAIN_LIST","ORGANIZATION_DOMAIN_ADD","ORGANIZATION_DOMAIN_UPDATE","ORGANIZATION_DOMAIN_VERIFY","ORGANIZATION_DOMAIN_REMOVE","JIRA_INTEGRATION_GET","JIRA_INTEGRATION_UPSERT","JIRA_INTEGRATION_DELETE","JIRA_BOARDS_LIST","JIRA_BOARD_COLUMNS_LIST","JIRA_AUTOMATION_LIST","JIRA_AUTOMATION_UPSERT","JIRA_AUTOMATION_DELETE","JIRA_RUN_START"]},{id:"members:manage",label:"Manage members",description:"Invite members, remove them, and change their roles",section:"Organization",tools:["ORGANIZATION_MEMBER_LIST","ORGANIZATION_MEMBER_ADD","ORGANIZATION_MEMBER_REMOVE","ORGANIZATION_MEMBER_UPDATE_ROLE","ORGANIZATION_BILLING_CHECKOUT_START","ORGANIZATION_BILLING_PORTAL","ORGANIZATION_TASK_QUOTA_GET","INFRA_BILLING_SITES_LIST","INFRA_BILLING_GET","INFRA_BILLING_PORTAL","ORGANIZATION_JOIN_REQUEST_LIST","ORGANIZATION_JOIN_REQUEST_APPROVE","ORGANIZATION_JOIN_REQUEST_DENY"],dangerous:!0},{id:"connections:manage",label:"Manage connections",description:"Create, update, and delete connections",section:"Connections & Agents",tools:["COLLECTION_CONNECTIONS_CREATE","COLLECTION_CONNECTIONS_UPDATE","COLLECTION_CONNECTIONS_DELETE","COMMERCE_DISCOVERY_SETUP","COMMERCE_DISCOVERY_RUN","COMMERCE_DISCOVERY_BIND","COMMERCE_DISCOVERY_CONNECTION_STATUS","COMMERCE_DISCOVERY_SET_REPOSITORY"],dangerous:!0},{id:"agents:manage",label:"Manage agents",description:"Create, configure, and delete agents",section:"Connections & Agents",tools:["COLLECTION_VIRTUAL_MCP_CREATE","COLLECTION_VIRTUAL_MCP_UPDATE","COLLECTION_VIRTUAL_MCP_DELETE","VIRTUAL_MCP_PLUGIN_CONFIG_UPDATE","VIRTUAL_MCP_PINNED_VIEWS_UPDATE"],dangerous:!0},{id:"automations:manage",label:"Manage automations",description:"Create, update, run, and delete automations",section:"Automations",tools:["AUTOMATION_CREATE","AUTOMATION_UPDATE","AUTOMATION_DELETE","AUTOMATION_TRIGGER_ADD","AUTOMATION_TRIGGER_REMOVE","AUTOMATION_TRIGGER_ROTATE_TOKEN","AUTOMATION_RUN"],dangerous:!0},{id:"monitoring:view",label:"View monitoring",description:"Access logs and usage statistics",section:"Monitoring",tools:["MONITORING_HEATMAP","MONITORING_LOG_GET","MONITORING_LOGS_LIST","MONITORING_STATS","MONITORING_THREAD_USAGE"]},{id:"secrets:manage",label:"Manage secrets",description:"Create and list secrets stored in the credential vault",section:"Organization",tools:["SECRET_CREATE","SECRET_LIST"]},{id:"file-configs:manage",label:"Manage file configs",description:"Create, list, update and delete S3 bucket configurations and synced GitHub repositories",section:"Organization",tools:["FILE_CONFIG_CREATE","FILE_CONFIG_LIST","FILE_CONFIG_UPDATE","FILE_CONFIG_DELETE","FILE_OBJECTS_LIST","FILE_OBJECT_DELETE","ORG_REPO_SYNC_CREATE","ORG_REPO_SYNC_LIST","ORG_REPO_SYNC_UPDATE","ORG_REPO_SYNC_DELETE","ORG_REPO_SYNC_RUN"]},{id:"ai-providers:manage",label:"Manage AI providers",description:"Add or remove API keys and provision provider credentials",section:"AI Providers",tools:["AI_PROVIDER_KEY_CREATE","AI_PROVIDER_KEY_LIST","AI_PROVIDER_KEY_DELETE","AI_PROVIDER_KEY_UPDATE","AI_PROVIDER_KEY_PREVIEW","AI_PROVIDER_OAUTH_URL","AI_PROVIDER_OAUTH_EXCHANGE","AI_PROVIDER_PROVISION_KEY","AI_PROVIDER_TOPUP_URL","AI_PROVIDER_CREDITS","CLAUDE_SUBSCRIPTION_CONNECT","CLAUDE_SUBSCRIPTION_STATUS","CLAUDE_SUBSCRIPTION_DISCONNECT"]},{id:"tags:manage",label:"Manage tags",description:"Create, assign, and delete organization tags",section:"Organization",tools:["TAGS_LIST","TAGS_CREATE","TAGS_DELETE","MEMBER_TAGS_GET","MEMBER_TAGS_SET"]},{id:"registry:manage",label:"Manage registry",description:"Browse, publish, and manage items in the registry",section:"Store & Registry",tools:["COLLECTION_REGISTRY_APP_LIST","COLLECTION_REGISTRY_APP_GET","COLLECTION_REGISTRY_APP_VERSIONS","COLLECTION_REGISTRY_APP_FILTERS","REGISTRY_ITEM_LIST","REGISTRY_ITEM_SEARCH","REGISTRY_ITEM_GET","REGISTRY_ITEM_VERSIONS","REGISTRY_ITEM_FILTERS","REGISTRY_DISCOVER_TOOLS","REGISTRY_ITEM_CREATE","REGISTRY_ITEM_BULK_CREATE","REGISTRY_ITEM_UPDATE","REGISTRY_ITEM_DELETE","REGISTRY_AI_GENERATE","REGISTRY_PUBLISH_REQUEST_LIST","REGISTRY_PUBLISH_REQUEST_REVIEW","REGISTRY_PUBLISH_REQUEST_COUNT","REGISTRY_PUBLISH_REQUEST_DELETE","REGISTRY_PUBLISH_API_KEY_GENERATE","REGISTRY_PUBLISH_API_KEY_LIST","REGISTRY_PUBLISH_API_KEY_REVOKE"],dangerous:!0},{id:"registry:monitor",label:"Monitor registry health",description:"Run health checks on registry connections and view results",section:"Store & Registry",tools:["REGISTRY_MONITOR_RUN_START","REGISTRY_MONITOR_RUN_LIST","REGISTRY_MONITOR_RUN_GET","REGISTRY_MONITOR_RUN_CANCEL","REGISTRY_MONITOR_RESULT_LIST","REGISTRY_MONITOR_CONNECTION_LIST","REGISTRY_MONITOR_CONNECTION_SYNC","REGISTRY_MONITOR_CONNECTION_UPDATE_AUTH"]},{id:"api-keys:manage",label:"Manage API keys",description:"Create, update, and revoke API keys",section:"Developer",tools:["API_KEY_CREATE","API_KEY_LIST","API_KEY_UPDATE","API_KEY_DELETE"]},{id:"storage:delete",label:"Delete from storage",description:"Permanently delete files from object storage",section:"Developer",tools:["DELETE_OBJECT","DELETE_OBJECTS"],dangerous:!0},{id:"connections:sql",label:"Run SQL queries",description:"Execute raw SQL against connected databases",section:"Developer",tools:["DATABASES_RUN_SQL"],dangerous:!0}];[...Ze.find(t=>t.id===He)?.tools??[]];const rs=["agents:manage","connections:manage"];new Set(Ze.filter(t=>rs.includes(t.id)).flatMap(t=>t.tools));function as(){const t=new Map;for(const e of Ze){if(e.id===He)continue;const l=t.get(e.section)??[];l.push(e),t.set(e.section,l)}return Array.from(t.entries()).map(([e,l])=>({section:e,capabilities:l}))}function cs(t,e,l){return l?!0:t.tools.every(r=>e.includes(r))}function ds(t,e,l){if(l){const n=new Set(e);for(const o of t.tools)n.add(o);return Array.from(n)}const r=new Set(e);for(const n of t.tools)r.delete(n);return Array.from(r)}const qe="projects",ot="*";function ms(t){if(!t)return null;const e=t[qe];return Array.isArray(e)?e:null}function us(t){const e=J.c(21),{connection:l,isSelected:r,hasToolsEnabled:n,activeToolsCount:o,totalToolsCount:d,onSelect:f,onToggle:m}=t,c=r?"bg-accent/50":"hover:bg-muted/50";let g;e[0]!==c?(g=Z("flex items-center gap-3 p-2 rounded-lg transition-colors will-change-auto",c),e[0]=c,e[1]=g):g=e[1];let u;e[2]!==l.icon||e[3]!==l.title?(u=s.jsx($e,{icon:l.icon,name:l.title,size:"xs"}),e[2]=l.icon,e[3]=l.title,e[4]=u):u=e[4];let h;e[5]!==l.title?(h=s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:l.title})}),e[5]=l.title,e[6]=h):h=e[6];let x;e[7]!==f||e[8]!==u||e[9]!==h?(x=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 cursor-pointer",onClick:f,children:[u,h]}),e[7]=f,e[8]=u,e[9]=h,e[10]=x):x=e[10];let a;e[11]!==o||e[12]!==l.tools||e[13]!==n||e[14]!==m||e[15]!==d?(a=l.tools&&l.tools.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"text-xs text-muted-foreground shrink-0",children:[o,"/",d]}),s.jsx(ke,{checked:n,onCheckedChange:m,onClick:fs})]}),e[11]=o,e[12]=l.tools,e[13]=n,e[14]=m,e[15]=d,e[16]=a):a=e[16];let T;return e[17]!==g||e[18]!==x||e[19]!==a?(T=s.jsxs("div",{className:g,children:[x,a]}),e[17]=g,e[18]=x,e[19]=a,e[20]=T):T=e[20],T}function fs(t){return t.stopPropagation()}function gs(t){const e=J.c(18),{connectionId:l,tool:r,isSelected:n,onToggle:o}=t,d=`tool-${l}-${r.name}`,f=n?"text-foreground":"text-muted-foreground";let m;e[0]!==f?(m=Z("text-sm font-medium",f),e[0]=f,e[1]=m):m=e[1];let c;e[2]!==m||e[3]!==r.name?(c=s.jsx("div",{className:"flex items-center gap-2 mb-1",children:s.jsx("span",{className:m,children:r.name})}),e[2]=m,e[3]=r.name,e[4]=c):c=e[4];let g;e[5]!==r.description?(g=r.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:r.description}),e[5]=r.description,e[6]=g):g=e[6];let u;e[7]!==c||e[8]!==g?(u=s.jsxs("div",{className:"flex-1 min-w-0",children:[c,g]}),e[7]=c,e[8]=g,e[9]=u):u=e[9];const h=`tool-${l}-${r.name}`;let x;e[10]!==n||e[11]!==o||e[12]!==h?(x=s.jsx("div",{className:"flex items-center shrink-0",children:s.jsx(ke,{id:h,checked:n,onCheckedChange:o,onClick:hs})}),e[10]=n,e[11]=o,e[12]=h,e[13]=x):x=e[13];let a;return e[14]!==d||e[15]!==u||e[16]!==x?(a=s.jsxs("label",{className:"flex items-center gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer group will-change-auto",htmlFor:d,children:[u,x]}),e[14]=d,e[15]=u,e[16]=x,e[17]=a):a=e[17],a}function hs(t){return t.stopPropagation()}function Ts({toolSet:t,onToolSetChange:e,excludeVirtualMcpId:l,searchQuery:r}){const n=ie(),[o,d]=Q.useState(""),f=r!==void 0?r:o,m=Q.useDeferredValue(f),[c,g]=Q.useState("all"),[u,h]=Q.useState(!1),x=Q.useRef(new Set(Object.keys(t))),{org:a}=Ge(),T=Zt({connectionId:jt,orgId:a.id,orgSlug:a.slug}),S=100,E=m.trim(),I=E?{operator:"or",conditions:[{field:["title"],operator:"contains",value:E},{field:["description"],operator:"contains",value:E}]}:void 0,b=!!l,N={...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:0,...b&&{include_virtual:!0}},D=JSON.stringify(N),{data:A,fetchNextPage:j,hasNextPage:P,isFetchingNextPage:_}=Ht({queryKey:de.collectionListInfinite(T,a.id,"","CONNECTIONS",D),queryFn:async({pageParam:p=0})=>(await T.callTool({name:"COLLECTION_CONNECTIONS_LIST",arguments:{...I&&{where:I},orderBy:[{field:["updated_at"],direction:"asc"}],limit:S,offset:p,...b&&{include_virtual:!0}}})).structuredContent,initialPageParam:0,getNextPageParam:(p,w)=>{if(p?.hasMore)return w.reduce((H,q)=>H+(q?.items?.length??0),0)},staleTime:3e4}),O=A?.pages.flatMap(p=>p?.items??[])??[],C=Qt(j,P??!1,_),i=l?O.filter(p=>p.connection_type!=="VIRTUAL"?!0:Jt(p.connection_url)!==l):O,R=x.current,k=[...R.values()].map(p=>i.find(w=>w.id===p)).filter(p=>p!==void 0),G=i.filter(p=>!R.has(p.id)),Y=[...k,...G],v=p=>{const w=t[p];return w!==void 0&&w.length>0},K=Y.filter(p=>{if(c==="all")return!0;const w=v(p.id);return c==="selected"?w:c==="unselected"?!w:!0}),[L,F]=Q.useState(Y[0]?.id??null),V=L?Y.find(p=>p.id===L)??null:null,{data:U,isFetching:B}=Ke({queryKey:de.collectionItem(T,a.id,"","CONNECTIONS",L??""),queryFn:async()=>L?(await T.callTool({name:"COLLECTION_CONNECTIONS_GET",arguments:{id:L}})).structuredContent?.item??null:null,enabled:!!L,staleTime:3e4}),$=U?.tools??[],W=(p,w)=>t[p]?.includes(w)??!1,te=(p,w)=>{const H=t[p]??[],q=H.includes(w),se={...t};if(q){const le=H.filter(ne=>ne!==w);le.length===0?delete se[p]:se[p]=le}else se[p]=[...H,w];e(se)},oe=p=>{const w=p===L?$:[];if(!w.length)return;const H=t[p]??[],q=w.map(ne=>ne.name),se=H.length>0&&q.every(ne=>H.includes(ne)),le={...t};se?delete le[p]:(le[p]=q,F(p)),e(le)},z=p=>{F(p),h(!0)},X=()=>{h(!1)};return s.jsxs("div",{className:"flex h-full",children:[s.jsxs("div",{className:Z("w-full md:w-80 border-r border-border flex flex-col",u&&"hidden md:flex"),children:[r===void 0&&s.jsx(qt,{value:o,onChange:d,placeholder:n("common.toolSetSelector.searchPlaceholder")}),s.jsxs("div",{className:"flex gap-1 p-2 border-b border-border",children:[s.jsx("button",{onClick:()=>g("all"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="all"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterAll")}),s.jsx("button",{onClick:()=>g("selected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="selected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterSelected")}),s.jsx("button",{onClick:()=>g("unselected"),className:Z("flex-1 px-3 py-1.5 text-xs font-medium rounded-md transition-colors border cursor-pointer",c==="unselected"?"bg-muted border-border":"border-border opacity-75 hover:opacity-100"),children:n("common.toolSetSelector.filterUnselected")})]}),s.jsx("div",{className:"flex-1 overflow-auto",children:K.length===0?s.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:n(f?"common.toolSetSelector.noConnectionsFound":c==="selected"?"common.toolSetSelector.noServersSelected":c==="unselected"?"common.toolSetSelector.noUnselectedServers":"common.toolSetSelector.noConnectionsAvailable")}):s.jsxs("div",{className:"p-2 space-y-1",children:[K.map(p=>{const w=L===p.id,H=w?$.length:0,q=t[p.id]?.length??0;return s.jsx(us,{connection:{...p,tools:w?$:p.tools},isSelected:w,hasToolsEnabled:v(p.id),activeToolsCount:q,totalToolsCount:H,onSelect:()=>z(p.id),onToggle:()=>oe(p.id)},p.id)}),s.jsx("div",{ref:C,className:"h-4"}),_&&s.jsx("div",{className:"flex justify-center py-3",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})})]})})]}),s.jsx("div",{className:Z("flex-1 flex-col",u?"flex":"hidden md:flex"),children:V?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"md:hidden border-b border-border p-4 flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"sm",onClick:X,className:"h-8 w-8 p-0 shrink-0",children:s.jsx($t,{size:20})}),s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[s.jsx($e,{icon:V.icon,name:V.title,size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:V.title}),V.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:V.description})]})]})]}),s.jsx("div",{className:"flex-1 overflow-auto p-4",children:B?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(Oe,{className:"size-4.5 text-muted-foreground"})}):$.length===0?s.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:n("common.toolSetSelector.noToolsAvailable")}):s.jsx("div",{className:"space-y-2",children:$.map(p=>s.jsx(gs,{connectionId:V.id,tool:p,isSelected:W(V.id,p.name),onToggle:()=>te(V.id,p.name)},p.name))})})]}):s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:n("common.toolSetSelector.selectConnection")})})})]})}const xs=Je({role:Je({id:re().optional(),slug:re().optional(),label:re()}),allowAllStaticPermissions:Ve(),staticPermissions:Me(re()),toolSet:We(re(),Me(re())),allowAllModels:Ve(),modelSet:We(re(),Me(re())),allowAllProjects:Ve(),projectSet:Me(re()),memberIds:Me(re())});function nt(t,e,l,r){const n=s.jsx(me,{checked:e,disabled:l,onCheckedChange:r});return l?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:n})}),s.jsx(Pe,{children:s.jsx("p",{children:t("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):n}function _s(t){const e=J.c(41),{allowAllStaticPermissions:l,staticPermissions:r,onAllowAllChange:n,onPermissionsChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie();let g;e[0]!==f?(g=f.trim().toLowerCase(),e[0]=f,e[1]=g):g=e[1];const u=Q.useDeferredValue(g);let h;if(e[2]!==l||e[3]!==u||e[4]!==n||e[5]!==o||e[6]!==m||e[7]!==f||e[8]!==r||e[9]!==c){const x=as(),a=(_,O)=>{if(!m){if(l&&O){const C=x.flatMap(Is).flatMap(Es);n(!1),o(C.filter(i=>!_.tools.includes(i)));return}l||o(ds(_,r,!O))}};let T;e[11]!==u?(T=_=>{const{section:O,capabilities:C}=_;return{section:O,capabilities:C.filter(i=>!u||i.label.toLowerCase().includes(u)||i.description.toLowerCase().includes(u))}},e[11]=u,e[12]=T):T=e[12];const S=x.map(T).filter(ps);let E;e[13]!==c?(E=c("settings.orgRoleDetail.general"),e[13]=c,e[14]=E):E=e[14];let I;e[15]!==c?(I=c("settings.orgRoleDetail.allOrgPermissions"),e[15]=c,e[16]=I):I=e[16];let b;e[17]!==c?(b=c("settings.orgRoleDetail.grantFullAccessToAllFeaturesBelow"),e[17]=c,e[18]=b):b=e[18];let N;e[19]!==l||e[20]!==n||e[21]!==o?(N=()=>{n(!l),o([])},e[19]=l,e[20]=n,e[21]=o,e[22]=N):N=e[22];let D;e[23]!==l||e[24]!==m||e[25]!==c||e[26]!==N?(D=nt(c,l,m,N),e[23]=l,e[24]=m,e[25]=c,e[26]=N,e[27]=D):D=e[27];let A;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m?(A=m?void 0:()=>{n(!l),o([])},e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=A):A=e[32];let j;e[33]!==A||e[34]!==I||e[35]!==b||e[36]!==D?(j=s.jsx(et,{children:s.jsx(tt,{title:I,description:b,action:D,onClick:A})}),e[33]=A,e[34]=I,e[35]=b,e[36]=D,e[37]=j):j=e[37];let P;e[38]!==j||e[39]!==E?(P=s.jsx(Xe,{title:E,children:j}),e[38]=j,e[39]=E,e[40]=P):P=e[40],h=s.jsx("div",{children:s.jsxs("div",{className:"flex flex-col gap-10 py-4",children:[P,S.length===0&&u?s.jsx("p",{className:"text-sm text-muted-foreground py-4",children:c("settings.orgRoleDetail.noPermissionsMatch",{searchQuery:f})}):S.map(_=>{const{section:O,capabilities:C}=_;return s.jsx(Xe,{title:O,children:s.jsx(et,{children:C.map(i=>{const R=cs(i,r,l);return s.jsx(tt,{title:s.jsxs("span",{className:"flex items-center gap-1.5",children:[i.label,i.dangerous&&s.jsx(Mt,{size:12,className:"text-warning shrink-0"})]}),description:i.description,action:nt(c,R,m,()=>a(i,R)),onClick:m?void 0:()=>a(i,R)},i.id)})})},O)})]})}),e[2]=l,e[3]=u,e[4]=n,e[5]=o,e[6]=m,e[7]=f,e[8]=r,e[9]=c,e[10]=h}else h=e[10];return h}function ps(t){return t.capabilities.length>0}function Es(t){return t.tools}function Is(t){return t.capabilities}const Nt={anthropic:"Anthropic",openrouter:"OpenRouter"},Rs={openai:"OpenAI",anthropic:"Anthropic",google:"Google","meta-llama":"Meta",mistralai:"Mistral","x-ai":"xAI",deepseek:"DeepSeek",qwen:"Qwen",moonshotai:"MoonshotAI",nvidia:"NVIDIA",perplexity:"Perplexity",cohere:"Cohere",amazon:"Amazon",microsoft:"Microsoft","z-ai":"Z.ai","ibm-granite":"IBM Granite",alibaba:"Alibaba",baidu:"Baidu",bytedance:"ByteDance",tencent:"Tencent",minimax:"MiniMax",nousresearch:"Nous Research",allenai:"Allen AI",inception:"Inception"};function Ss(t,e){const l=t.indexOf("/"),r=l>0?t.slice(0,l):e;return r.startsWith("~")?r.slice(1):r}function As(t){return Rs[t]??Nt[t]??t}function Ns(t){const e=t.indexOf(": ");return e>0&&e<32?t.slice(e+2):t}const Ct=30;function Cs(t){const e=J.c(40),{connectionId:l,subProviderId:r,subProviderName:n,groupLogo:o,models:d,allConnectionModelIds:f,selectedModels:m,allowAllModels:c,allConnectionModelsSelected:g,onToggleModel:u,onExitAllowAll:h,readOnly:x,defaultExpanded:a}=t,T=ie(),[S,E]=Q.useState(a),I=a||S,b=E,[N,D]=Q.useState(Ct);let A;e[0]!==g||e[1]!==c||e[2]!==m?(A=_=>c||g||m.includes("*")||m.includes(_),e[0]=g,e[1]=c,e[2]=m,e[3]=A):A=e[3];const j=A;let P;if(e[4]!==f||e[5]!==c||e[6]!==l||e[7]!==I||e[8]!==o||e[9]!==j||e[10]!==d||e[11]!==h||e[12]!==u||e[13]!==x||e[14]!==r||e[15]!==n||e[16]!==T||e[17]!==N){let _;e[19]!==j?(_=B=>j(B.id),e[19]=j,e[20]=_):_=e[20];const O=d.filter(_).length,C=d.slice(0,N),i=d.length>N;let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=()=>b(Ds),e[21]=R):R=e[21];const k=o??Et[r]??It;let G;e[22]!==n||e[23]!==k?(G=s.jsx($e,{icon:k,name:n,size:"sm"}),e[22]=n,e[23]=k,e[24]=G):G=e[24];let Y;e[25]!==n?(Y=s.jsx("span",{className:"text-sm font-medium truncate",children:n}),e[25]=n,e[26]=Y):Y=e[26];let v;e[27]!==G||e[28]!==Y?(v=s.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[G,Y]}),e[27]=G,e[28]=Y,e[29]=v):v=e[29];const K=T("settings.orgRoleDetail.enabledCount",{enabledCount:O,total:d.length});let L;e[30]!==K?(L=s.jsx(Le,{variant:"secondary",className:"text-xs text-muted-foreground",children:K}),e[30]=K,e[31]=L):L=e[31];let F;e[32]!==I?(F=I?s.jsx(os,{size:16,className:"text-muted-foreground shrink-0"}):s.jsx(ns,{size:16,className:"text-muted-foreground shrink-0"}),e[32]=I,e[33]=F):F=e[33];let V;e[34]!==L||e[35]!==F?(V=s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[L,F]}),e[34]=L,e[35]=F,e[36]=V):V=e[36];let U;e[37]!==V||e[38]!==v?(U=s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3 hover:bg-muted/50 cursor-pointer",onClick:R,children:[v,V]}),e[37]=V,e[38]=v,e[39]=U):U=e[39],P=s.jsxs("div",{className:"border border-border rounded-lg overflow-hidden bg-card",children:[U,I&&s.jsxs("div",{className:"border-t border-border bg-muted/20",children:[C.map(B=>{const $=j(B.id),W=()=>{if(!x){if(c){h(l,f,B.id);return}u(l,B.id)}};return s.jsxs("div",{className:Z("flex items-center justify-between gap-3 px-4 py-3 border-b border-border last:border-b-0",!x&&"hover:bg-muted/50 cursor-pointer"),onClick:W,children:[s.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:s.jsx("span",{className:"text-sm truncate",children:B.title})}),s.jsx("div",{onClick:js,children:x?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:$,disabled:!0,onCheckedChange:bs})})}),s.jsx(Pe,{children:s.jsx("p",{children:T("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:$,onCheckedChange:W})})]},B.id)}),i&&s.jsx("button",{type:"button",className:"w-full px-4 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",onClick:()=>D(Os),children:T("settings.orgRoleDetail.showMore",{remaining:d.length-N})})]})]}),e[4]=f,e[5]=c,e[6]=l,e[7]=I,e[8]=o,e[9]=j,e[10]=d,e[11]=h,e[12]=u,e[13]=x,e[14]=r,e[15]=n,e[16]=T,e[17]=N,e[18]=P}else P=e[18];return P}function Os(t){return t+Ct}function bs(){}function js(t){return t.stopPropagation()}function Ds(t){return!t}function Ps(t){const e=J.c(33),{connection:l,selectedModels:r,allowAllModels:n,onToggleModel:o,onExitAllowAll:d,allConnectionModelsSelected:f,searchQuery:m,readOnly:c}=t,g=ts(l.id);let u,h,x,a,T;if(e[0]!==f||e[1]!==n||e[2]!==l.id||e[3]!==l.label||e[4]!==l.providerId||e[5]!==d||e[6]!==o||e[7]!==g||e[8]!==c||e[9]!==m||e[10]!==r){T=Symbol.for("react.early_return_sentinel");e:{let I;e[16]!==l.label?(I=R=>({...R,id:R.modelId,provider:l.label}),e[16]=l.label,e[17]=I):I=e[17];const b=g.filter(ys).map(I),N=m.trim().toLowerCase(),D=N?b.filter(R=>R.title.toLowerCase().includes(N)||R.id.toLowerCase().includes(N)||R.provider?.toLowerCase().includes(N)):b;if(D.length===0){T=null;break e}const A=new Map;for(const R of D){const k=Ss(R.id,l.providerId),G=A.get(k)??{models:[],logo:null};G.models.push({id:R.id,title:Ns(R.title),logo:R.logo}),!G.logo&&R.logo&&(G.logo=R.logo),A.set(k,G)}const j=Array.from(A.entries()).map(Ls).sort(vs),P=j.length===1||N.length>0;x="flex flex-col gap-3";const _=Et[l.providerId]??It;let O;e[18]!==l.providerId||e[19]!==_?(O=s.jsx("img",{src:_,alt:l.providerId,className:"w-4 h-4 rounded-sm dark:bg-white dark:rounded-sm dark:p-px"}),e[18]=l.providerId,e[19]=_,e[20]=O):O=e[20];const C=Nt[l.providerId]??l.providerId;let i;e[21]!==C?(i=s.jsx("h4",{className:"text-sm font-medium",children:C}),e[21]=C,e[22]=i):i=e[22],e[23]!==i||e[24]!==O?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[O,i]}),e[23]=i,e[24]=O,e[25]=a):a=e[25],u="flex flex-col gap-3",h=j.map(R=>s.jsx(Cs,{connectionId:l.id,subProviderId:R.id,subProviderName:R.name,groupLogo:R.logo,models:R.models,allConnectionModelIds:b.map(Ms),selectedModels:r,allowAllModels:n,allConnectionModelsSelected:f,onToggleModel:o,onExitAllowAll:d,readOnly:c,defaultExpanded:P},R.id))}e[0]=f,e[1]=n,e[2]=l.id,e[3]=l.label,e[4]=l.providerId,e[5]=d,e[6]=o,e[7]=g,e[8]=c,e[9]=m,e[10]=r,e[11]=u,e[12]=h,e[13]=x,e[14]=a,e[15]=T}else u=e[11],h=e[12],x=e[13],a=e[14],T=e[15];if(T!==Symbol.for("react.early_return_sentinel"))return T;let S;e[26]!==u||e[27]!==h?(S=s.jsx("div",{className:u,children:h}),e[26]=u,e[27]=h,e[28]=S):S=e[28];let E;return e[29]!==x||e[30]!==a||e[31]!==S?(E=s.jsxs("div",{className:x,children:[a,S]}),e[29]=x,e[30]=a,e[31]=S,e[32]=E):E=e[32],E}function Ms(t){return t.id}function vs(t,e){return t.name.localeCompare(e.name)}function Ls(t){const[e,l]=t;return{id:e,name:As(e),logo:l.logo,models:l.models}}function ys(t,e,l){return l.findIndex(r=>r.modelId===t.modelId)===e}function ws(t){const e=J.c(41),{allowAllModels:l,modelSet:r,onAllowAllChange:n,onModelSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie(),g=Q.useDeferredValue(f),u=es();let h;e[0]!==r||e[1]!==o?(h=(_,O)=>{const C=r[_]??[],i={...r};if(C.includes(O)){const R=C.filter(k=>k!==O);R.length===0?delete i[_]:i[_]=R}else i[_]=[...C,O];o(i)},e[0]=r,e[1]=o,e[2]=h):h=e[2];const x=h;let a;e[3]!==r||e[4]!==n||e[5]!==o?(a=(_,O,C)=>{n(!1),o({...r,[_]:O.filter(i=>i!==C)})},e[3]=r,e[4]=n,e[5]=o,e[6]=a):a=e[6];const T=a,S=!m&&"hover:bg-muted/50 cursor-pointer";let E;e[7]!==S?(E=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",S),e[7]=S,e[8]=E):E=e[8];let I;e[9]!==l||e[10]!==n||e[11]!==o||e[12]!==m?(I=()=>{if(m)return;const _=!l;n(_),_&&o({})},e[9]=l,e[10]=n,e[11]=o,e[12]=m,e[13]=I):I=e[13];let b;e[14]!==c?(b=c("settings.orgRoleDetail.allModels"),e[14]=c,e[15]=b):b=e[15];let N;e[16]!==b?(N=s.jsx("span",{className:"text-sm font-medium",children:b}),e[16]=b,e[17]=N):N=e[17];let D;e[18]!==l||e[19]!==n||e[20]!==o||e[21]!==m||e[22]!==c?(D=s.jsx("div",{onClick:ks,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:l,disabled:!0,onCheckedChange:Gs})})}),s.jsx(Pe,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:l,onCheckedChange:_=>{n(_),_&&o({})}})}),e[18]=l,e[19]=n,e[20]=o,e[21]=m,e[22]=c,e[23]=D):D=e[23];let A;e[24]!==E||e[25]!==I||e[26]!==N||e[27]!==D?(A=s.jsxs("div",{className:E,onClick:I,children:[N,D]}),e[24]=E,e[25]=I,e[26]=N,e[27]=D,e[28]=A):A=e[28];let j;e[29]!==u||e[30]!==l||e[31]!==g||e[32]!==T||e[33]!==r||e[34]!==m||e[35]!==c||e[36]!==x?(j=u.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noLlmConnectionsConfigured")}):u.map(_=>s.jsx(Q.Suspense,{fallback:s.jsxs("div",{className:"px-4 py-3 flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Oe,{className:"size-4"}),c("settings.orgRoleDetail.loadingModels")]}),children:s.jsx(Ps,{connection:_,selectedModels:r[_.id]??[],allowAllModels:l,onToggleModel:x,onExitAllowAll:T,allConnectionModelsSelected:(r[_.id]??[]).includes("*"),searchQuery:g,readOnly:m})},_.id)),e[29]=u,e[30]=l,e[31]=g,e[32]=T,e[33]=r,e[34]=m,e[35]=c,e[36]=x,e[37]=j):j=e[37];let P;return e[38]!==A||e[39]!==j?(P=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 pb-6",children:[A,j]}),e[38]=A,e[39]=j,e[40]=P):P=e[40],P}function Gs(){}function ks(t){return t.stopPropagation()}function Us(t){const e=J.c(39),{allowAllProjects:l,projectSet:r,onAllowAllChange:n,onProjectSetChange:o,readOnly:d,searchQuery:f}=t,m=d===void 0?!1:d,c=ie(),g=Q.useDeferredValue(f),u=Xt();let h;if(e[0]!==l||e[1]!==g||e[2]!==n||e[3]!==o||e[4]!==r||e[5]!==m||e[6]!==f||e[7]!==c||e[8]!==u){const x=ls(u),a=g.trim().toLowerCase(),T=a?x.filter(C=>C.title.toLowerCase().includes(a)):x,S=C=>{if(l){n(!1),o(x.map(Ys).filter(i=>i!==C));return}r.includes(C)?o(r.filter(i=>i!==C)):o([...r,C])},E=!m&&"hover:bg-muted/50 cursor-pointer";let I;e[10]!==E?(I=Z("flex items-center justify-between px-4 py-3 rounded-lg border border-border bg-card",E),e[10]=E,e[11]=I):I=e[11];let b;e[12]!==l||e[13]!==n||e[14]!==o||e[15]!==m?(b=()=>{if(m)return;const C=!l;n(C),C&&o([])},e[12]=l,e[13]=n,e[14]=o,e[15]=m,e[16]=b):b=e[16];let N;e[17]!==c?(N=c("settings.orgRoleDetail.allProjects"),e[17]=c,e[18]=N):N=e[18];let D;e[19]!==N?(D=s.jsx("span",{className:"text-sm font-medium",children:N}),e[19]=N,e[20]=D):D=e[20];let A;e[21]!==c?(A=c("settings.orgRoleDetail.allProjectsDescription"),e[21]=c,e[22]=A):A=e[22];let j;e[23]!==A?(j=s.jsx("span",{className:"text-xs text-muted-foreground",children:A}),e[23]=A,e[24]=j):j=e[24];let P;e[25]!==D||e[26]!==j?(P=s.jsxs("div",{className:"flex flex-col gap-0.5",children:[D,j]}),e[25]=D,e[26]=j,e[27]=P):P=e[27];let _;e[28]!==l||e[29]!==n||e[30]!==o||e[31]!==m||e[32]!==c?(_=s.jsx("div",{onClick:Vs,children:m?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(me,{checked:l,disabled:!0,onCheckedChange:Bs})})}),s.jsx(Pe,{children:s.jsx("p",{children:c("settings.orgRoleDetail.builtinRolePermissionsCannotBeChanged")})})]})}):s.jsx(me,{checked:l,onCheckedChange:C=>{n(C),C&&o([])}})}),e[28]=l,e[29]=n,e[30]=o,e[31]=m,e[32]=c,e[33]=_):_=e[33];let O;e[34]!==P||e[35]!==_||e[36]!==I||e[37]!==b?(O=s.jsxs("div",{className:I,onClick:b,children:[P,_]}),e[34]=P,e[35]=_,e[36]=I,e[37]=b,e[38]=O):O=e[38],h=s.jsxs("div",{className:"flex flex-col h-full overflow-auto gap-6 p-4",children:[O,x.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsAvailable")}):T.length===0?s.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:c("settings.orgRoleDetail.noProjectsMatch",{searchQuery:f})}):s.jsx("div",{className:"flex flex-col gap-1",children:T.map(C=>{const i=l||r.includes(C.id);return s.jsxs("label",{className:Z("flex items-center gap-3 px-3 py-2 rounded-lg border border-transparent",m?"cursor-default":"hover:bg-muted/50 cursor-pointer"),children:[s.jsx(ke,{checked:i,disabled:m,onCheckedChange:()=>{m||S(C.id)}}),s.jsx(ss,{icon:C.icon,name:C.title}),s.jsx("span",{className:"text-sm truncate",children:C.title})]},C.id)})})]}),e[0]=l,e[1]=g,e[2]=n,e[3]=o,e[4]=r,e[5]=m,e[6]=f,e[7]=c,e[8]=u,e[9]=h}else h=e[9];return h}function Bs(){}function Vs(t){return t.stopPropagation()}function Ys(t){return t.id}function Ks(t){const e=J.c(75),{open:l,onOpenChange:r,selectedMemberIds:n,onAddMembers:o}=t,d=ie(),[f,m]=Q.useState(""),c=Q.useDeferredValue(f);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];const[u,h]=Q.useState(g),{data:x}=Rt();let a,T,S,E,I,b,N,D,A,j,P;if(e[1]!==x?.data?.members||e[2]!==c||e[3]!==o||e[4]!==r||e[5]!==l||e[6]!==u||e[7]!==f||e[8]!==n||e[9]!==d){const L=x?.data?.members??[];let F;e[21]!==c?(F=z=>{const X=c.toLowerCase();return z.user?.name?.toLowerCase().includes(X)||z.user?.email?.toLowerCase().includes(X)},e[21]=c,e[22]=F):F=e[22];const V=L.filter(F);let U;e[23]!==o||e[24]!==r||e[25]!==u?(U=()=>{o(u),h([]),r(!1)},e[23]=o,e[24]=r,e[25]=u,e[26]=U):U=e[26],S=U,T=ut,j=l,P=r,a=ft,D="sm:max-w-md p-0";let B;e[27]!==d?(B=d("settings.orgRoleDetail.addMembersToRole"),e[27]=d,e[28]=B):B=e[28];let $;e[29]!==B?($=s.jsx(gt,{children:B}),e[29]=B,e[30]=$):$=e[30];let W;e[31]!==d?(W=d("settings.orgRoleDetail.selectMembersToAddToThisRole"),e[31]=d,e[32]=W):W=e[32];let te;e[33]!==W?(te=s.jsx(ht,{children:W}),e[33]=W,e[34]=te):te=e[34],e[35]!==$||e[36]!==te?(A=s.jsxs(Tt,{className:"px-6 pt-6",children:[$,te]}),e[35]=$,e[36]=te,e[37]=A):A=e[37],b="flex flex-col h-80";let oe;e[38]!==d?(oe=d("settings.orgRoleDetail.searchMembers"),e[38]=d,e[39]=oe):oe=e[39],e[40]!==f||e[41]!==oe?(N=s.jsx("div",{className:"border-b border-border px-4 py-3",children:s.jsx(Qe,{value:f,onChange:m,placeholder:oe,className:"w-full"})}),e[40]=f,e[41]=oe,e[42]=N):N=e[42],E="flex-1 overflow-auto",I=V.length===0?s.jsx("div",{className:"flex items-center justify-center h-full px-6",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:d(f?"settings.orgRoleDetail.noMembersFound":"settings.orgRoleDetail.noMembersAvailable")})}):s.jsx("div",{className:"px-6 py-2 space-y-1",children:V.map(z=>{const X=z.role!=="owner",p=n.includes(z.id),w=u.includes(z.id);return s.jsxs("label",{className:Z("flex items-center gap-3 p-2 rounded-lg",!X||p?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-muted/50"),children:[s.jsx(ke,{checked:w||p,onCheckedChange:()=>{!X||p||h(H=>H.includes(z.id)?H.filter(q=>q!==z.id):[...H,z.id])},disabled:!X||p}),s.jsx(At,{url:z.user?.image??void 0,fallback:St(z.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:z.user?.name||d("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:z.user?.email})]}),!X&&s.jsx(Le,{variant:"secondary",className:"shrink-0",children:d("settings.orgRoleDetail.owner")}),p&&X&&s.jsx(Le,{variant:"outline",className:"shrink-0",children:d("settings.orgRoleDetail.added")})]},z.id)})}),e[1]=x?.data?.members,e[2]=c,e[3]=o,e[4]=r,e[5]=l,e[6]=u,e[7]=f,e[8]=n,e[9]=d,e[10]=a,e[11]=T,e[12]=S,e[13]=E,e[14]=I,e[15]=b,e[16]=N,e[17]=D,e[18]=A,e[19]=j,e[20]=P}else a=e[10],T=e[11],S=e[12],E=e[13],I=e[14],b=e[15],N=e[16],D=e[17],A=e[18],j=e[19],P=e[20];let _;e[43]!==E||e[44]!==I?(_=s.jsx("div",{className:E,children:I}),e[43]=E,e[44]=I,e[45]=_):_=e[45];let O;e[46]!==_||e[47]!==b||e[48]!==N?(O=s.jsxs("div",{className:b,children:[N,_]}),e[46]=_,e[47]=b,e[48]=N,e[49]=O):O=e[49];let C;e[50]!==d?(C=d("settings.orgRoleDetail.cancel"),e[50]=d,e[51]=C):C=e[51];let i;e[52]!==C?(i=s.jsx(xt,{children:C}),e[52]=C,e[53]=i):i=e[53];const R=u.length===0;let k;e[54]!==u.length||e[55]!==d?(k=d("settings.orgRoleDetail.addWithCount",{count:u.length}),e[54]=u.length,e[55]=d,e[56]=k):k=e[56];let G;e[57]!==S||e[58]!==R||e[59]!==k?(G=s.jsx(_t,{onClick:S,disabled:R,children:k}),e[57]=S,e[58]=R,e[59]=k,e[60]=G):G=e[60];let Y;e[61]!==i||e[62]!==G?(Y=s.jsxs(pt,{className:"px-6 pb-6",children:[i,G]}),e[61]=i,e[62]=G,e[63]=Y):Y=e[63];let v;e[64]!==a||e[65]!==O||e[66]!==Y||e[67]!==D||e[68]!==A?(v=s.jsxs(a,{className:D,children:[A,O,Y]}),e[64]=a,e[65]=O,e[66]=Y,e[67]=D,e[68]=A,e[69]=v):v=e[69];let K;return e[70]!==T||e[71]!==v||e[72]!==j||e[73]!==P?(K=s.jsx(T,{open:j,onOpenChange:P,children:v}),e[70]=T,e[71]=v,e[72]=j,e[73]=P,e[74]=K):K=e[74],K}function Fs(t){const e=J.c(33),{memberIds:l,onMemberIdsChange:r,readOnly:n,readOnlyMessage:o,searchQuery:d,addMemberDialogOpen:f,onAddMemberDialogOpenChange:m}=t,c=n===void 0?!1:n,g=o===void 0?void 0:o,u=ie(),h=Q.useDeferredValue(d),{data:x}=Rt();let a,T,S;if(e[0]!==x?.data?.members||e[1]!==h||e[2]!==l||e[3]!==r||e[4]!==c||e[5]!==g||e[6]!==d||e[7]!==u){const D=x?.data?.members??[];let A;e[11]!==l?(A=i=>l.includes(i.id),e[11]=l,e[12]=A):A=e[12];const j=D.filter(A);let P;e[13]!==h?(P=i=>{const R=h.toLowerCase();return i.user?.name?.toLowerCase().includes(R)||i.user?.email?.toLowerCase().includes(R)},e[13]=h,e[14]=P):P=e[14];const _=j.filter(P);let O;e[15]!==g||e[16]!==u?(O=g??u("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[15]=g,e[16]=u,e[17]=O):O=e[17];const C=O;S="flex flex-col h-full",a="flex-1 overflow-auto",T=j.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-base font-medium mb-1",children:u("settings.orgRoleDetail.noMembers")}),s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.addMembersToGrantPermissions")})]})}):_.length===0?s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:u("settings.orgRoleDetail.noMembersMatch",{searchQuery:d})})}):s.jsx("div",{className:"p-4 space-y-2",children:_.map(i=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/30",children:[s.jsx(At,{url:i.user?.image??void 0,fallback:St(i.user?.name),shape:"circle",size:"sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:i.user?.name||u("settings.orgRoleDetail.unknown")}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.user?.email})]}),c?s.jsx(be,{children:s.jsxs(je,{children:[s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsx(ae,{variant:"ghost",size:"sm",disabled:!0,"aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),children:s.jsx(st,{size:16})})})}),s.jsx(Pe,{children:s.jsx("p",{children:C})})]})}):s.jsx(ae,{variant:"ghost",size:"sm","aria-label":u("settings.orgRoleDetail.removeMember",{name:i.user?.name||u("settings.orgRoleDetail.unknown")}),onClick:()=>r(l.filter(R=>R!==i.id)),children:s.jsx(st,{size:16})})]},i.id))}),e[0]=x?.data?.members,e[1]=h,e[2]=l,e[3]=r,e[4]=c,e[5]=g,e[6]=d,e[7]=u,e[8]=a,e[9]=T,e[10]=S}else a=e[8],T=e[9],S=e[10];let E;e[18]!==a||e[19]!==T?(E=s.jsx("div",{className:a,children:T}),e[18]=a,e[19]=T,e[20]=E):E=e[20];let I;e[21]!==l||e[22]!==r?(I=D=>r([...l,...D]),e[21]=l,e[22]=r,e[23]=I):I=e[23];let b;e[24]!==f||e[25]!==l||e[26]!==m||e[27]!==I?(b=s.jsx(Ks,{open:f,onOpenChange:m,selectedMemberIds:l,onAddMembers:I}),e[24]=f,e[25]=l,e[26]=m,e[27]=I,e[28]=b):b=e[28];let N;return e[29]!==S||e[30]!==E||e[31]!==b?(N=s.jsxs("div",{className:S,children:[E,b]}),e[29]=S,e[30]=E,e[31]=b,e[32]=N):N=e[32],N}function zs(t){const e=J.c(3);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-6 text-muted-foreground"})}),e[0]=l):l=e[0];let r;return e[1]!==t?(r=s.jsx(Q.Suspense,{fallback:l,children:s.jsx(Fs,{...t})}),e[1]=t,e[2]=r):r=e[2],r}const Qs={owner:[],admin:[],user:[]};function $s(t,e,l,r){const n=t==="owner"||t==="admin";return{role:{id:l?.id,slug:t,label:t.charAt(0).toUpperCase()+t.slice(1)},allowAllStaticPermissions:n,staticPermissions:Qs[t],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:e.filter(o=>o.role===t).map(o=>o.id)}}function Hs(t,e,l){const r=t.permission||{},n=r.self||[],o=n.includes("*"),d=o?[]:n.filter(a=>a!=="*"),f={};for(const[a,T]of Object.entries(r))if(!(a==="self"||a==="models"||a===qe))if(a==="*")for(const S of l)f[S.id]=T.includes("*")?S.tools?.map(E=>E.name)??[]:T;else{const S=l.find(E=>E.id===a);S&&(f[a]=T.includes("*")?S.tools?.map(E=>E.name)??[]:T)}const m=r.models||[],c=m.length===0||m.includes("*:*"),g={};if(!c)for(const a of m){const T=a.indexOf(":");if(T===-1)continue;const S=a.slice(0,T),E=a.slice(T+1);g[S]||(g[S]=[]),g[S].push(E)}const u=ms(r),h=u===null||u.includes(ot),x=h?[]:u.filter(a=>a!==ot);return{role:{id:t.id,slug:t.role,label:t.label},allowAllStaticPermissions:o,staticPermissions:d,toolSet:f,allowAllModels:c,modelSet:g,allowAllProjects:h,projectSet:x,memberIds:e.filter(a=>a.role===t.role).map(a=>a.id)}}function Zs(t,e){const l={};t.allowAllStaticPermissions?l.self=["*"]:t.staticPermissions.length>0&&(l.self=t.staticPermissions);for(const[r,n]of Object.entries(t.toolSet))if(n.length>0){const d=e.find(f=>f.id===r)?.tools?.map(f=>f.name)??[];l[r]=d.length>0&&d.every(f=>n.includes(f))?["*"]:n}if(t.allowAllModels)l.models=["*:*"];else{const r=[];for(const[n,o]of Object.entries(t.modelSet))for(const d of o)r.push(`${n}:${d}`);r.length>0&&(l.models=r)}return t.allowAllProjects||(l[qe]=t.projectSet),l}function qs(t,e,l){return t.kind==="builtin"?$s(t.role,e,void 0):t.kind==="custom"?Hs(t.role,e,l):{role:{id:void 0,slug:void 0,label:""},allowAllStaticPermissions:!1,staticPermissions:[],toolSet:{},allowAllModels:!0,modelSet:{},allowAllProjects:!0,projectSet:[],memberIds:[]}}function Js(t){const e=J.c(19),{readOnly:l,readOnlyMessage:r,onOpen:n}=t,o=r===void 0?void 0:r,d=ie();let f;e[0]!==o||e[1]!==d?(f=o??d("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),e[0]=o,e[1]=d,e[2]=f):f=e[2];const m=f;if(l){let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ye,{size:16}),e[3]=h):h=e[3];let x;e[4]!==d?(x=d("settings.orgRoleDetail.addMember"),e[4]=d,e[5]=x):x=e[5];let a;e[6]!==x?(a=s.jsx(De,{asChild:!0,children:s.jsx("div",{children:s.jsxs(ae,{variant:"outline",size:"sm",disabled:!0,children:[h,x]})})}),e[6]=x,e[7]=a):a=e[7];let T;e[8]!==m?(T=s.jsx(Pe,{children:s.jsx("p",{children:m})}),e[8]=m,e[9]=T):T=e[9];let S;return e[10]!==a||e[11]!==T?(S=s.jsx(be,{children:s.jsxs(je,{children:[a,T]})}),e[10]=a,e[11]=T,e[12]=S):S=e[12],S}let c;e[13]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(Ye,{size:16}),e[13]=c):c=e[13];let g;e[14]!==d?(g=d("settings.orgRoleDetail.addMember"),e[14]=d,e[15]=g):g=e[15];let u;return e[16]!==n||e[17]!==g?(u=s.jsxs(ae,{variant:"outline",size:"sm",onClick:n,children:[c,g]}),e[16]=n,e[17]=g,e[18]=u):u=e[18],u}function Ws(t){const e=J.c(14),{locator:l}=Ge(),r=ze(),n=Wt();let o;e[0]!==l?(o=de.members(l),e[0]=l,e[1]=o):o=e[1];let d;e[2]!==r?(d=()=>r.organization.listMembers(),e[2]=r,e[3]=d):d=e[3];let f;e[4]!==o||e[5]!==d?(f={queryKey:o,queryFn:d},e[4]=o,e[5]=d,e[6]=f):f=e[6];const{data:m,isPending:c}=Ke(f);if(c||!n){let x;return e[7]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}),e[7]=x):x=e[7],x}let g;e[8]!==m?.data?.members?(g=m?.data?.members??[],e[8]=m?.data?.members,e[9]=g):g=e[9];const u=g;let h;return e[10]!==n||e[11]!==u||e[12]!==t?(h=s.jsx(Xs,{...t,members:u,connections:n}),e[10]=n,e[11]=u,e[12]=t,e[13]=h):h=e[13],h}function Xs({target:t,onBack:e,onSaved:l,members:r,connections:n}){const o=ie(),{locator:d}=Ge(),f=ze(),m=it(),c=t.kind==="builtin",g=t.kind==="builtin"&&t.role==="owner",u=t.kind==="new",[h,x]=Q.useState(c?"org":"mcp"),a=Dt({resolver:Pt(xs),defaultValues:qs(t,r,n)}),T=a.formState.isValid,S=a.formState.isDirty,E=rt({mutationFn:async i=>{const R=Zs(i,n),k=i.role.slug||i.role.label.toLowerCase().replace(/\s+/g,"-"),G=(i.role.slug==="owner"||i.role.slug==="admin"||i.role.slug==="user")&&!i.role.id,Y=async(v,K)=>{const L=r.filter(U=>U.role===(K??v)).map(U=>U.id),F=i.memberIds.filter(U=>!L.includes(U)),V=L.filter(U=>!i.memberIds.includes(U));for(const U of F){const B=await f.organization.updateMemberRole({memberId:U,role:[v]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}for(const U of V){const B=await f.organization.updateMemberRole({memberId:U,role:["user"]});if(B?.error)throw new Error(B.error.message??o("settings.orgRoleDetail.somethingWentWrong"))}};if(G)return await Y(i.role.slug),i;if(i.role.id){const v=i.role.label.toLowerCase().replace(/\s+/g,"-"),K=i.role.slug,L=v!==K,F=await f.organization.updateRole({roleId:i.role.id,data:{permission:R,...L?{roleName:v}:{}}});if(F?.error)throw new Error(F.error.message??o("settings.orgRoleDetail.somethingWentWrong"));return await Y(L?v:K,L?K:void 0),L?{...i,role:{...i.role,slug:v}}:i}else{const v=await f.organization.createRole({role:k,permission:R});if(v?.error)throw new Error(v.error.message??o("settings.orgRoleDetail.somethingWentWrong"));for(const K of i.memberIds){const L=await f.organization.updateMemberRole({memberId:K,role:[k]});if(L?.error)throw new Error(L.error.message)}return{...i,role:{...i.role,id:v.data?.roleData?.id,slug:k}}}},onSuccess:(i,R)=>{m.invalidateQueries({queryKey:de.members(d)}),m.invalidateQueries({queryKey:de.organizationRoles(d)});const k=!R.role.id&&!R.role.slug,G=R.role.slug==="owner"&&!R.role.id;Fe(G?"role_members_updated":k?"role_created":"role_updated",{role_slug:R.role.slug??null}),ve.success(o(G?"settings.orgRoleDetail.membersUpdatedSuccessfully":k?"settings.orgRoleDetail.roleCreatedSuccessfully":"settings.orgRoleDetail.roleUpdatedSuccessfully")),a.reset(i),l(i.role.id)},onError:i=>{ve.error(i instanceof Error?i.message:o("settings.orgRoleDetail.failedToSaveRole"))}}),I=a.handleSubmit(i=>{if(!i.role.label.trim()){ve.error(o("settings.orgRoleDetail.roleNameIsRequired")),a.setFocus("role.label");return}E.mutate(i)}),b=!g,N=t.kind==="builtin"?t.role.charAt(0).toUpperCase()+t.role.slice(1):t.kind==="custom"?t.role.label:"",D=[...g?[]:[{id:"mcp",label:o("settings.orgRoleDetail.mcpPermissions")}],{id:"org",label:o("settings.orgRoleDetail.organizationPermissions")},{id:"models",label:o("settings.orgRoleDetail.models")},{id:"projects",label:o("settings.orgRoleDetail.projects")},{id:"members",label:o("settings.orgRoleDetail.members")}],[A,j]=Q.useState(""),[P,_]=Q.useState(!1),O=i=>{x(i),j("")},C={mcp:o("settings.orgRoleDetail.searchMcpServers"),org:o("settings.orgRoleDetail.searchPermissions"),models:o("settings.orgRoleDetail.searchModels"),projects:o("settings.orgRoleDetail.searchProjects"),members:o("settings.orgRoleDetail.searchMembers")};return s.jsx(Ce,{children:s.jsxs(Ce.Content,{className:Z("flex flex-col",h!=="org"&&"overflow-hidden"),children:[s.jsx("div",{className:"shrink-0 mx-auto w-full max-w-[1200px] px-4 md:px-10 pt-8 md:pt-12 pb-4",children:s.jsxs("div",{className:"flex flex-col gap-5",children:[s.jsx(Ce.Title,{actions:b&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:e,disabled:E.isPending,children:o("settings.orgRoleDetail.cancel")}),s.jsx(ae,{size:"sm",onClick:I,disabled:E.isPending||!T||!S,children:E.isPending?o("settings.orgRoleDetail.saving"):o(u?"settings.orgRoleDetail.createRole":"settings.orgRoleDetail.saveChanges")})]}),children:s.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",t.kind==="builtin"?mt(t.role,!0):kt(a.watch("role.label")))}),g&&s.jsx(at,{size:16,className:"text-muted-foreground shrink-0"}),u||t.kind==="custom"?s.jsx("input",{...a.register("role.label"),placeholder:o("settings.orgRoleDetail.roleName"),className:"leading-tight text-foreground bg-transparent border-none outline-none px-1 -mx-1 rounded hover:bg-input/25 focus:bg-input/25 transition-colors w-64 placeholder:text-muted-foreground/50",autoFocus:u}):s.jsx("span",{className:"truncate",children:N})]})}),s.jsx("div",{className:"flex items-center gap-2",children:D.map(i=>s.jsx("button",{type:"button",onClick:()=>O(i.id),className:Z("h-7 px-2 text-sm rounded-lg border border-input transition-colors inline-flex items-center",h===i.id?"bg-accent border-border text-foreground":"bg-transparent text-muted-foreground hover:border-border hover:bg-accent/50 hover:text-foreground"),children:i.label},i.id))}),s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(Qe,{value:A,onChange:j,placeholder:C[h]??"Search...",className:"w-full md:w-[375px]"}),h==="members"&&s.jsx(Js,{readOnly:t.kind==="builtin"&&t.role==="owner",onOpen:()=>_(!0)})]})]})}),s.jsx("div",{className:Z("mx-auto w-full max-w-[1200px] px-4 md:px-10 pb-6",h!=="org"&&"flex-1 min-h-0"),children:s.jsxs("div",{className:Z(h!=="org"&&"h-full overflow-hidden",h!=="models"&&h!=="projects"&&h!=="org"&&"border border-border rounded-xl bg-card"),children:[h==="mcp"&&!g&&s.jsx(Ts,{toolSet:a.watch("toolSet"),onToolSetChange:i=>a.setValue("toolSet",i,{shouldDirty:!0}),searchQuery:A}),h==="org"&&s.jsx(_s,{allowAllStaticPermissions:a.watch("allowAllStaticPermissions"),staticPermissions:a.watch("staticPermissions"),onAllowAllChange:i=>a.setValue("allowAllStaticPermissions",i,{shouldDirty:!0}),onPermissionsChange:i=>a.setValue("staticPermissions",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="models"&&s.jsx(ws,{allowAllModels:a.watch("allowAllModels"),modelSet:a.watch("modelSet"),onAllowAllChange:i=>a.setValue("allowAllModels",i,{shouldDirty:!0}),onModelSetChange:i=>a.setValue("modelSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="projects"&&s.jsx(Us,{allowAllProjects:a.watch("allowAllProjects"),projectSet:a.watch("projectSet"),onAllowAllChange:i=>a.setValue("allowAllProjects",i,{shouldDirty:!0}),onProjectSetChange:i=>a.setValue("projectSet",i,{shouldDirty:!0}),readOnly:g,searchQuery:A}),h==="members"&&s.jsx(zs,{memberIds:a.watch("memberIds"),onMemberIdsChange:i=>a.setValue("memberIds",i,{shouldDirty:!0}),readOnly:t.kind==="builtin"&&(t.role==="owner"||t.role==="user"),readOnlyMessage:t.kind==="builtin"&&t.role==="user"?o("settings.orgRoleDetail.userIsDefaultRoleMessage"):o("settings.orgRoleDetail.ownerMembershipCannotBeChanged"),searchQuery:A,addMemberDialogOpen:P,onAddMemberDialogOpenChange:_})]})})]})})}function el(t){return t.kind==="builtin"?`builtin-${t.role}`:t.kind==="custom"?`custom-${t.role.id}`:"new"}function tl(t){const e=J.c(6),{area:l,children:r}=t,{isPrivileged:n,loading:o,error:d}=vt();let f;return e[0]!==l||e[1]!==r||e[2]!==d||e[3]!==n||e[4]!==o?(f=s.jsx(is,{granted:n,loading:o,error:d,area:l,children:r}),e[0]=l,e[1]=r,e[2]=d,e[3]=n,e[4]=o,e[5]=f):f=e[5],f}const sl=[{role:"owner",labelKey:"settings.roles.roleOwner"},{role:"admin",labelKey:"settings.roles.roleAdmin"},{role:"user",labelKey:"settings.roles.roleUser"}];function ll(){const t=J.c(128),e=ie(),[l,r]=Q.useState(""),[n,o]=Q.useState(null),d=wt();let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={strict:!1},t[0]=f):f=t[0];const{role:m}=ct(f),{locator:c}=Ge(),g=ze(),u=it(),{customRoles:h,refetch:x}=Gt();let a;t[1]!==d?(a=M=>d({to:".",search:y=>({...y,role:M})}),t[1]=d,t[2]=a):a=t[2];const T=a;let S;e:{if(!m){S=null;break e}if(m==="new"){S={kind:"new"};break e}if(m.startsWith("builtin-")){S={kind:"builtin",role:m.slice(8)};break e}let M;t[3]!==m?(M=ee=>ee.id===m,t[3]=m,t[4]=M):M=t[4];const y=h.find(M);S=y?{kind:"custom",role:y}:null}const E=S;let I;t[5]!==c?(I=de.members(c),t[5]=c,t[6]=I):I=t[6];let b;t[7]!==g?(b=()=>g.organization.listMembers(),t[7]=g,t[8]=b):b=t[8];let N;t[9]!==I||t[10]!==b?(N={queryKey:I,queryFn:b},t[9]=I,t[10]=b,t[11]=N):N=t[11];const{data:D}=Ke(N);let A;t[12]!==D?.data?.members?(A=D?.data?.members??[],t[12]=D?.data?.members,t[13]=A):A=t[13];const j=A;let P;t[14]!==j?(P=M=>j.filter(y=>y.role===M).length,t[14]=j,t[15]=P):P=t[15];const _=P;let O;if(t[16]!==h||t[17]!==_||t[18]!==l||t[19]!==e){let M;t[21]!==_||t[22]!==e?(M=ce=>({kind:"builtin",role:{...ce,memberCount:_(ce.role),label:e(ce.labelKey)}}),t[21]=_,t[22]=e,t[23]=M):M=t[23];const y=sl.map(M);let ee;t[24]!==_?(ee=ce=>({kind:"custom",role:{...ce,memberCount:_(ce.role)}}),t[24]=_,t[25]=ee):ee=t[25];const Ot=h.map(ee);if(O=[...y,...Ot],l){const ce=l.toLowerCase();O=O.filter(bt=>bt.role.label.toLowerCase().includes(ce))}t[16]=h,t[17]=_,t[18]=l,t[19]=e,t[20]=O}else O=t[20];let C;t[26]!==g?(C=async M=>{const y=await g.organization.deleteRole({roleId:M});if(y?.error)throw new Error(y.error.message);return y?.data},t[26]=g,t[27]=C):C=t[27];const i=rt({mutationFn:C,onSuccess:(M,y)=>{Fe("role_deleted",{role_id:y}),u.invalidateQueries({queryKey:de.members(c)}),u.invalidateQueries({queryKey:de.organizationRoles(c)}),ve.success(e("settings.roles.deletedSuccessfully")),x(),E?.kind==="custom"&&E.role.id===y&&T(void 0)},onError:al});let R;t[28]!==e?(R=e("settings.roles.columnRole"),t[28]=e,t[29]=R):R=t[29];let k;t[30]!==R?(k={id:"role",header:R,render:rl,cellClassName:"flex-1 min-w-0",sortable:!0},t[30]=R,t[31]=k):k=t[31];let G;t[32]!==e?(G=e("settings.roles.columnType"),t[32]=e,t[33]=G):G=t[33];let Y;t[34]!==e?(Y=M=>M.kind==="builtin"?s.jsx(Le,{variant:"secondary",className:"text-xs",children:e("settings.roles.builtIn")}):s.jsx(Le,{variant:"outline",className:"text-xs",children:e("settings.roles.custom")}),t[34]=e,t[35]=Y):Y=t[35];let v;t[36]!==G||t[37]!==Y?(v={id:"type",header:G,render:Y,cellClassName:"w-28 shrink-0"},t[36]=G,t[37]=Y,t[38]=v):v=t[38];let K;t[39]!==e?(K=e("settings.roles.columnPermissions"),t[39]=e,t[40]=K):K=t[40];let L;t[41]!==e?(L=M=>{if(M.kind==="builtin")return M.role.role==="owner"||M.role.role==="admin"?s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.fullAccess")}):s.jsx("span",{className:"text-sm text-muted-foreground",children:e("settings.roles.basicAccess")});const y=M.role,ee=[];return y.allowsAllStaticPermissions?ee.push(e("settings.roles.fullOrgAccess")):y.staticPermissionCount&&y.staticPermissionCount>0&&ee.push(e("settings.roles.orgPermsCount",{count:y.staticPermissionCount})),y.allowsAllConnections?ee.push(e("settings.roles.allConnections")):y.connectionCount&&y.connectionCount>0&&ee.push(e("settings.roles.connectionCount",{count:y.connectionCount})),s.jsx("span",{className:"text-sm text-muted-foreground truncate",children:ee.length>0?ee.join(", "):e("settings.roles.noPermissions")})},t[41]=e,t[42]=L):L=t[42];let F;t[43]!==K||t[44]!==L?(F={id:"permissions",header:K,render:L,cellClassName:"flex-1 min-w-0"},t[43]=K,t[44]=L,t[45]=F):F=t[45];let V;t[46]!==e?(V=e("settings.roles.columnMembers"),t[46]=e,t[47]=V):V=t[47];let U;t[48]!==V?(U={id:"members",header:V,render:il,cellClassName:"w-24 shrink-0"},t[48]=V,t[49]=U):U=t[49];let B;t[50]!==e?(B={id:"actions",header:"",render:M=>M.kind==="builtin"?null:s.jsxs(Ut,{children:[s.jsx(Bt,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:nl,children:s.jsx(Kt,{size:16})})}),s.jsx(Vt,{align:"end",onClick:ol,children:s.jsxs(Yt,{variant:"destructive",onClick:()=>{const y=M.role;y.id&&o({id:y.id,label:y.label})},children:[s.jsx(Ft,{size:16}),e("settings.roles.delete")]})})]}),cellClassName:"w-12 shrink-0"},t[50]=e,t[51]=B):B=t[51];let $;t[52]!==k||t[53]!==v||t[54]!==F||t[55]!==U||t[56]!==B?($=[k,v,F,U,B],t[52]=k,t[53]=v,t[54]=F,t[55]=U,t[56]=B,t[57]=$):$=t[57];const W=$;let te;t[58]!==T?(te=M=>{if(M.kind==="builtin")T(`builtin-${M.role.role}`);else{const y=M.role;T(y.id)}},t[58]=T,t[59]=te):te=t[59];const oe=te;if(E){let M;t[60]!==T?(M=()=>T(void 0),t[60]=T,t[61]=M):M=t[61];let y;return t[62]!==x||t[63]!==T?(y=()=>{x(),T(void 0)},t[62]=x,t[63]=T,t[64]=y):y=t[64],s.jsx(Ws,{target:E,onBack:M,onSaved:y},el(E))}let z;t[65]!==e?(z=e("settings.roles.searchPlaceholder"),t[65]=e,t[66]=z):z=t[66];let X;t[67]===Symbol.for("react.memo_cache_sentinel")?(X=M=>{M.key==="Escape"&&(r(""),M.target.blur())},t[67]=X):X=t[67];let p;t[68]!==l||t[69]!==z?(p=s.jsx(Qe,{value:l,onChange:r,placeholder:z,className:"w-full md:w-[375px]",onKeyDown:X}),t[68]=l,t[69]=z,t[70]=p):p=t[70];let w;t[71]!==T?(w=()=>T("new"),t[71]=T,t[72]=w):w=t[72];let H;t[73]===Symbol.for("react.memo_cache_sentinel")?(H=s.jsx(Ye,{size:16}),t[73]=H):H=t[73];let q;t[74]!==e?(q=e("settings.roles.createRole"),t[74]=e,t[75]=q):q=t[75];let se;t[76]!==w||t[77]!==q?(se=s.jsxs(ae,{onClick:w,children:[H,q]}),t[76]=w,t[77]=q,t[78]=se):se=t[78];let le;t[79]!==p||t[80]!==se?(le=s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[p,se]}),t[79]=p,t[80]=se,t[81]=le):le=t[81];let ne;t[82]!==l||t[83]!==e?(ne=l?s.jsx(lt,{title:e("settings.roles.noRolesFound"),description:e("settings.roles.noRolesMatchSearch",{search:l})}):s.jsx(lt,{title:e("settings.roles.noRoles"),description:e("settings.roles.createRoleGetStarted")}),t[82]=l,t[83]=e,t[84]=ne):ne=t[84];let ue;t[85]!==O||t[86]!==W||t[87]!==oe||t[88]!==ne?(ue=s.jsx(zt,{columns:W,data:O,isLoading:!1,onRowClick:oe,emptyState:ne}),t[85]=O,t[86]=W,t[87]=oe,t[88]=ne,t[89]=ue):ue=t[89];const Ue=n!==null;let ye;t[90]===Symbol.for("react.memo_cache_sentinel")?(ye=M=>!M&&o(null),t[90]=ye):ye=t[90];let fe;t[91]!==e?(fe=e("settings.roles.deleteRoleTitle"),t[91]=e,t[92]=fe):fe=t[92];let ge;t[93]!==fe?(ge=s.jsx(gt,{children:fe}),t[93]=fe,t[94]=ge):ge=t[94];const Be=n?.label??"";let he;t[95]!==e||t[96]!==Be?(he=e("settings.roles.deleteRoleConfirm",{role:Be}),t[95]=e,t[96]=Be,t[97]=he):he=t[97];let Te;t[98]!==he?(Te=s.jsx(ht,{children:he}),t[98]=he,t[99]=Te):Te=t[99];let xe;t[100]!==ge||t[101]!==Te?(xe=s.jsxs(Tt,{children:[ge,Te]}),t[100]=ge,t[101]=Te,t[102]=xe):xe=t[102];let _e;t[103]!==e?(_e=e("settings.roles.cancel"),t[103]=e,t[104]=_e):_e=t[104];let pe;t[105]!==_e?(pe=s.jsx(xt,{children:_e}),t[105]=_e,t[106]=pe):pe=t[106];let Ee;t[107]!==i||t[108]!==n?(Ee=()=>{n?.id&&i.mutate(n.id),o(null)},t[107]=i,t[108]=n,t[109]=Ee):Ee=t[109];let Ie;t[110]!==e?(Ie=e("settings.roles.delete"),t[110]=e,t[111]=Ie):Ie=t[111];let Re;t[112]!==Ee||t[113]!==Ie?(Re=s.jsx(_t,{onClick:Ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:Ie}),t[112]=Ee,t[113]=Ie,t[114]=Re):Re=t[114];let Se;t[115]!==pe||t[116]!==Re?(Se=s.jsxs(pt,{children:[pe,Re]}),t[115]=pe,t[116]=Re,t[117]=Se):Se=t[117];let Ae;t[118]!==xe||t[119]!==Se?(Ae=s.jsxs(ft,{children:[xe,Se]}),t[118]=xe,t[119]=Se,t[120]=Ae):Ae=t[120];let Ne;t[121]!==Ue||t[122]!==Ae?(Ne=s.jsx(ut,{open:Ue,onOpenChange:ye,children:Ae}),t[121]=Ue,t[122]=Ae,t[123]=Ne):Ne=t[123];let we;return t[124]!==le||t[125]!==ue||t[126]!==Ne?(we=s.jsxs(dt,{group:"members",className:"gap-6",children:[le,ue,Ne]}),t[124]=le,t[125]=ue,t[126]=Ne,t[127]=we):we=t[127],we}function ol(t){return t.stopPropagation()}function nl(t){return t.stopPropagation()}function il(t){return s.jsx("span",{className:"text-sm text-foreground",children:t.role.memberCount})}function rl(t){return s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:Z("size-2.5 rounded-full shrink-0",mt(t.role.role,t.kind==="builtin"))}),s.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:t.role.label}),t.kind==="builtin"&&s.jsx(at,{size:12,className:"text-muted-foreground shrink-0"})]})}function al(t,e){Fe("role_delete_failed",{role_id:e,error:t instanceof Error?t.message:String(t)}),ve.error(t instanceof Error?t.message:"Failed to delete role")}function cl(){const t=J.c(13),e=ie();let l;t[0]===Symbol.for("react.memo_cache_sentinel")?(l={strict:!1},t[0]=l):l=t[0];const{role:r}=ct(l);let n;t[1]!==e?(n=e("settings.roles.failedToLoad"),t[1]=e,t[2]=n):n=t[2];let o;t[3]!==n?(o=s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx("div",{className:"text-sm text-muted-foreground",children:n})})}),t[3]=n,t[4]=o):o=t[4];let d;t[5]!==r?(d=r?s.jsx(Ce,{children:s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Oe,{className:"size-8 text-muted-foreground"})})}):s.jsx(dt,{group:"members",className:"gap-6",children:s.jsx(Lt,{})}),t[5]=r,t[6]=d):d=t[6];let f;t[7]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(ll,{}),t[7]=f):f=t[7];let m;t[8]!==d?(m=s.jsx(Q.Suspense,{fallback:d,children:f}),t[8]=d,t[9]=m):m=t[9];let c;return t[10]!==o||t[11]!==m?(c=s.jsx(yt,{fallback:o,children:m}),t[10]=o,t[11]=m,t[12]=c):c=t[12],c}function Vo(){const t=J.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(tl,{area:"roles",children:s.jsx(cl,{})}),t[0]=e):e=t[0],e}export{Vo as default};
|
package/dist/client/assets/{runnable-block-editor-2CMWc-S3.js → runnable-block-editor-DQQgPGex.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as W,n as Pt,m as D0,K as q9,b as a9,j as r,l as e9,B as d9,F as ks,aq as Ts,e as It,r as D,t as v9,a6 as M9,a7 as P9,a9 as I9,ar as Rt,h as j0,as as Ns,E as _s,at as Cs,ap as Ft}from"./index-B3yBTWEk.js";import{u as Se}from"./use-session-runtime-BHahDP0E.js";import{Q as ws,H as Ot,T as O9,U as Dt,z as $9,V as As,i as x9,W as J9,X as Z9,N as S0,Y as y9,Z as Ze,_ as o0,$ as Es,a0 as Ms,a1 as Ps,a2 as Is,a3 as Qe,a4 as $t,A as zt,a5 as Xe,a6 as Rs,a7 as Fs,a8 as Bt,a9 as p0,o as Os,aa as Ds,v as $s,c as zs,ab as Bs,ac as Vs}from"./index-DOk05MCp.js";import{e as Vt}from"./backoff-CrEUbyZT.js";import{s as Us,d as Ks,a as Gs}from"./utils-B14U8IKK.js";import{b as ke}from"./sandbox-url-D3mC8qhT.js";import{K as Hs,L as Ws,M as Ys,N as qs,O as Js,P as Zs,Q as Qs,R as Xs,S as e1,C as t1,T as Te,J as Ne,o as Ut,U as et,V as _e,W as n1,F as s1,G as r1,X as i1,Y as o1}from"./agent-icon-DrlilhFJ.js";import{i as Kt}from"./Play-rnw1eV52.js";import{S as tt}from"./sandbox-lifecycle-context-CXd9Um8u.js";import{G as l1}from"./pair-C08OPQNP.js";import{i as Q9}from"./Check-BWpBE9uf.js";import{i as Ce}from"./ChevronSelectorVertical-BiIbFU31.js";import{d as W0,e as Y0,a as G9,C as l0,b as q0,c as we,f as a1}from"./command-B6LMVdkQ.js";import{a as k0,b as T0,P as N0}from"./popover-DIqZ2IKF.js";import{b as Gt}from"./chat-context-CXknhaDs.js";import{i as c1}from"./ArrowLeft-Clu1mSdY.js";import{i as J0}from"./ChevronRight-DzRB-rdO.js";import{n as Ht}from"./LinkExternal01-Cp7uxK1i.js";import{S as L1}from"./scroll-area-BgZjjLM3.js";import{M as Wt}from"./monaco-editor-WNMTPDp9.js";import{C as d1}from"./calendar-DTnssie4.js";import{I as _9}from"./input-HFOrJf5B.js";import{T as u1}from"./textarea-CneoU2lJ.js";import{L as z9}from"./label-CqlSWrLn.js";import{a as Yt}from"./use-virtual-mcp-Bk09OpEg.js";import{a as f1}from"./Tool01-BnKd95Y1.js";import{i as m1}from"./SwitchHorizontal01-CxlKjkIX.js";import{s as Ae}from"./Plus-Bxp02MWl.js";import{E as t0,M as p1,m as h1,g as _0,u as g1,s as x1,a as y1,b as v1}from"./usage-stats-BNse37Wk.js";import{S as Z0,b as Q0,a as X0,d as ee,c as a0}from"./select-Bc5UZb4n.js";import{a as b1}from"./Palette-CglyAOTg.js";import{T as T9,R as j1,u as qt,C as Jt,a as Zt,b as $0,s as Qt,K as Xt,P as en,D as tn,c as nn,S as sn,v as rn,d as on,e as he}from"./rich-text-link-control-CrwbAR31.js";import{S as Ee}from"./switch-CJ5Ir2Zx.js";import{s as S1}from"./safe-image-url-D5z803Ot.js";import{a as Me}from"./Copy01-DayLu0dF.js";import{i as k1}from"./Settings02-D2oiGU4q.js";import{s as T1}from"./Eye-dnrP5DkM.js";import{s as C0}from"./Trash01-DqUm2RRh.js";import{D as te,a as D9,b as ne,c as se}from"./dropdown-menu-BxKUbUkE.js";import{t as Pe}from"./ChevronUp-DGrguvGW.js";import{i as ln}from"./Globe01-SLAc63wC.js";import{d as an,h as cn,c as Ln,e as N1,b as dn,D as un}from"./dialog-otnvxVN0.js";import{i as ge}from"./File02-BhckHV8N.js";import{i as w0}from"./Upload01-CqWnAR1-.js";import{i as fn}from"./AlertCircle-EniJtD8E.js";import{i as mn}from"./DotsVertical-CucJCL9y.js";import{a as c0}from"./Image01-BrHSH-Vi.js";import{S as _1}from"./search-input-uXtJ6IU8.js";import{T as C1,a as w1,b as A1,c as E1}from"./tabs-DV8akPGb.js";import{u as M1}from"./use-debounced-value-Cud3o3Fq.js";import{u as P1,a as pn}from"./use-file-configs-BwD1CaWo.js";import{u as I1,a as Ie,i as hn,e as R1,b as nt,f as F1}from"./asset-utils-CR65HphV.js";import{m as gn}from"./match-site-slug-config-D3fUJ6vX.js";import{T as O1,a as D1}from"./toggle-group-9HQCpj-q.js";import{s as xn}from"./TrendUp01-PFzYDizC.js";import{a as $1}from"./Printer-fz_zwxfT.js";import{i as z1}from"./Tool02-C_xRWqQk.js";import{c as B1,d as V1,b as U1,f as K1,g as G1,e as H1,a as W1,A as Y1}from"./alert-dialog-BE9ltHtr.js";import{s as q1}from"./decode-html-entities-DDqE27I4.js";function Re(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function J1(t){let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||Array.isArray(e)?null:e}function Z1(t,e){return ke(t,e)}function Q1(t,e){return ke(t,"preview-fetch",{path:e})}function X1(t){return Z1(t,"preview-invoke")}function yn(t){try{const{hostname:e}=new URL(t);return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}function e2(){if(typeof document>"u")return null;const t=Array.from(document.querySelectorAll("iframe"));for(const e of t){const n=e.getAttribute("src");if(n&&yn(n))return n}return null}function vn(t,e){const n=t.previewUrl??t.getFallbackPreviewUrl?.()??e2();return n&&yn(n)?new URL(e,n).toString():Q1(t,e)}function t2(t){return vn(t,"/.decofile")}function n2(t){return t===400?"absent":t===404?"unavailable":t>=200&&t<300?"ok":"error"}function st(t){return t.liveOk||t.committedAbsent?404:t.liveStatus??502}async function bn(t,e){const n=ke(t,"read"),s=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,full:!0})}),i=n2(s.status);if(i==="absent")return{kind:"absent"};if(i==="unavailable")return{kind:"unavailable"};if(i==="error"){const l=new Error(`Failed to read ${e}: ${s.status}`);throw l.status=s.status,l}const o=await s.json();if(typeof o.content!="string")return{kind:"unavailable"};try{return{kind:"data",data:JSON.parse(Us(o.content))}}catch{return{kind:"unavailable"}}}async function s2(t){const e=`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}/meta`,n=await fetch(e,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const s=new Error(`Failed to read committed meta: ${n.status}`);throw s.status=n.status,s}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Fe(t){return Yt(t)?.metadata?.runtime?.path??null}function d5(t,e){const n=W.c(15),s=t?`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`:"",i=e?.fetchEnabled??!0,o=Fe(t?.virtualMcpId),l=Se(t?.virtualMcpId).runtime==="cms",a=Pt();let c;n[0]!==s?(c=q9.decofile(s),n[0]=s,n[1]=c):c=n[1];let L;n[2]!==l||n[3]!==i||n[4]!==o||n[5]!==t||n[6]!==a?(L=async()=>{if(l)return ws(a,t);const b=()=>bn(t,Re(o,".deco/blocks.gen.json"));if(i){const S=await fetch(t2(t),{cache:"no-store"}).catch(i2);if(S?.ok){const v=J1(await S.text());if(v)return v}const h=await b();if(h.kind==="data")return h.data;const g=new Error(`Failed to fetch decofile: ${S?.status??"network error"}`);throw g.status=st({liveOk:!!S?.ok,liveStatus:S?.status,committedAbsent:h.kind==="absent"}),g}const p=await b();if(p.kind==="data")return p.data;const m=new Error("decofile unavailable (preview down, no committed snapshot)");throw m.status=st({liveOk:!1,committedAbsent:p.kind==="absent"}),m},n[2]=l,n[3]=i,n[4]=o,n[5]=t,n[6]=a,n[7]=L):L=n[7];const d=!!t;let u;n[8]!==l?(u=(b,p)=>{if(l)return b<3;const m=p.status;return m!==502&&m!==404&&b<2},n[8]=l,n[9]=u):u=n[9];let f;return n[10]!==c||n[11]!==L||n[12]!==d||n[13]!==u?(f={queryKey:c,queryFn:L,enabled:d,staleTime:3e4,retry:u,retryDelay:r2},n[10]=c,n[11]=L,n[12]=d,n[13]=u,n[14]=f):f=n[14],D0(f)}function r2(t){return Vt(5e3,1e3,t,2,0)}function i2(){return null}const o2=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function l2(t){return t.includes("matchers")||t.includes("Match")}function jn(t,e){const n=t.__resolveType;return typeof n!="string"||!n||o2.has(n)?!1:e?As(e,n):l2(n)}function a2(t,e){const n=[];for(const[s,i]of Object.entries(e)){if(s.includes("/")||!O9(s)||Dt(s)||!i||typeof i!="object"||Array.isArray(i))continue;const o=i;jn(o,t)&&n.push({blockKey:s,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return n.sort((s,i)=>(s.name??s.blockKey).localeCompare(i.name??i.blockKey))}function A0(t,e,n){if(!t)return!1;const s=t.__resolveType;if(typeof s!="string"||!O9(s)||!Object.hasOwn(e,s))return!1;const i=e[s];return!i||typeof i!="object"||Array.isArray(i)?!1:jn(i,n)}function u5(t,e,n){return A0(t,e,n)?t?.__resolveType??null:null}function Sn(t,e,n){if(!t)return null;const s=t.__resolveType??"";if(!s)return null;if(A0(t,e,n)){const l=e[s]??{},a=l.__resolveType??s,{__resolveType:c,name:L,...d}=l;return{resolveType:a,data:d,blockKey:s}}const{__resolveType:i,...o}=t;return{resolveType:s,data:o}}function kn(t,e,n){const s=Sn(t,e,n);return s?{__resolveType:s.resolveType,...s.data}:{__resolveType:""}}function f5(t,e,n){if(t)return A0(t,e,n)?kn(t,e,n):t}function c2(t,e,n,s){if(!t)return"Default";if(A0(t,e,s)){const i=t.__resolveType??"",o=e[i];return Ot(i,o)}return n(t)}function m5(t,e,n){return{__resolveType:t,...e,name:n}}function L2(t){return{__resolveType:t}}function p5(t,e,n){const s=Sn(t,e,n);return s?{resolveType:s.resolveType,formValue:s.data}:{resolveType:"",formValue:{}}}function d2(t,e){const n={__resolveType:t};if(!t||!e)return n;const s=$9(t,e),i=s?.type==="inline-union"?s.inlineUnionBranches?.[0]?.discriminators:void 0;return i?{...n,...i}:n}function u2(t){const e=[];return t.fastPreviewActive?e.push({kind:"committed"}):(t.fetchEnabled&&t.previewUrl&&e.push({kind:"live",baseUrl:t.previewUrl}),e.push({kind:"committed"})),t.productionUrl&&e.push({kind:"production",baseUrl:t.productionUrl}),e}function f2(t){return q9.liveMeta(t.orgSlug,t.virtualMcpId,t.branch,t.previewUrl??"",t.productionUrl??"")}function h5(t,e){const n=W.c(19),s=e?.fetchEnabled??!0,i=t?.previewUrl,o=Fe(t?.virtualMcpId),{previewServerUrl:l,runtime:a}=Se(t?.virtualMcpId),c=a==="cms";let L;n[0]!==t||n[1]!==i||n[2]!==l?(L=t?f2({...t,previewUrl:i,productionUrl:l}):q9.liveMeta(""),n[0]=t,n[1]=i,n[2]=l,n[3]=L):L=n[3];let d;n[4]!==c||n[5]!==s||n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==l?(d=async()=>{const m=p2,S=()=>c?s2(t):bn(t,Re(o,".deco/meta.gen.json")),h=u2({fetchEnabled:s,previewUrl:i,productionUrl:l,fastPreviewActive:c});for(const v of h){if(v.kind==="committed"){const x=await S();if(x.kind==="data")return x.data;continue}const j=await m(v.baseUrl);if(j)return j}const g=new Error("live meta unavailable (dev server down, no committed snapshot, no production fallback)");throw g.status=502,g},n[4]=c,n[5]=s,n[6]=o,n[7]=t,n[8]=i,n[9]=l,n[10]=d):d=n[10];const u=!!t,f=e?.refetchInterval;let b;n[11]!==c?(b=(m,S)=>(c||S.status!==502)&&m<3,n[11]=c,n[12]=b):b=n[12];let p;return n[13]!==L||n[14]!==d||n[15]!==u||n[16]!==f||n[17]!==b?(p={queryKey:L,queryFn:d,enabled:u,refetchInterval:f,refetchIntervalInBackground:!1,staleTime:3e5,retry:b,retryDelay:m2},n[13]=L,n[14]=d,n[15]=u,n[16]=f,n[17]=b,n[18]=p):p=n[18],D0(p)}function m2(t){return Vt(5e3,1e3,t,2,0)}async function p2(t){const e=new URL("/live/_meta",t).href,n=await fetch(e,{cache:"no-store"}).catch(h2);if(!n?.ok)return null;try{return await n.json()}catch{return null}}function h2(){return null}function ce(t,e,n){const s=n[t];return typeof s?.name=="string"&&s.name||t.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase())||`Section ${e+1}`}function g5(t,e){return t.map((n,s)=>{const i=n.__resolveType??"",o=x9(i);if(!o&&i!==""&&O9(i)&&i in e)return{index:s,resolveType:i,label:ce(i,s,e),isLazy:!1,isSavedBlock:!0};const l=o?n.section:void 0,a=o?l?.__resolveType??"":i;if(a===J9||a===Z9){const L=o?l:n,d=Array.isArray(L?.variants)?L.variants:[];if(d.length===1&&(d[0]?.rule?.__resolveType??"")===S0){const b=d[0]?.value??{};let p=b.__resolveType??"";const m=x9(p);let S=b;if(m){const h=b.section;p=h?.__resolveType??p,h&&(S=h)}if(p===J9||p===Z9){const g=(Array.isArray(S.variants)?S.variants:[])[0]?.value?.__resolveType,v=g?y9(g):"Section";return{index:s,resolveType:i,label:`Variants of ${v}`,isHidden:!0,isLazy:m}}return p!==""&&O9(p)&&p in e?{index:s,resolveType:i,label:ce(p,s,e),isHidden:!0,isLazy:m,isSavedBlock:!0}:{index:s,resolveType:i,label:y9(p)||`Section ${s+1}`,isHidden:!0,isLazy:m}}const u=d[0]?.value?.__resolveType,f=u?y9(u):"Section";return{index:s,resolveType:i,label:`Variants of ${f}`,isMultivariate:!0,isLazy:o}}const c=o?n.section?.__resolveType??i:i;return o&&c!==""&&O9(c)&&c in e?{index:s,resolveType:i,label:ce(c,s,e),isLazy:!0,isSavedBlock:!0}:{index:s,resolveType:i,label:y9(c)||`Section ${s+1}`,isLazy:o}})}function Tn(t){const e=t.__resolveType??"";return x9(e)?t.section??t:t}function z0(t){const i=(x9(t.__resolveType??"")?t.section:t)?.variants?.[0];return i?.rule?.__resolveType!==S0?null:i?.value??null}function x5(t){const e=Tn(t);return{__resolveType:Z9,variants:[{value:e,rule:{__resolveType:S0}}]}}function y5(t){const e=t.__resolveType??"";if(!e)return null;if(x9(e))return t.section??null;const n=z0(t);return n?x9(n.__resolveType??"")?n:{__resolveType:Ze,section:Tn(n)}:{__resolveType:Ze,section:t}}function E0(t){const e=t.__resolveType??"";if(!e)return null;if(x9(e)){const n=t.section,s=n?.__resolveType??"";return!s||!n?null:{resolveType:s,data:n}}return{resolveType:e,data:t}}function v5(t){const e=z0(t);if(e)return E0(e);if(x9(t.__resolveType??"")){const s=t.section;if(!s)return null;const i=z0(s);return E0(i||s)}return E0(t)}function b5(t){return z0(t)}const g2=["website/matchers/always.ts","$live/matchers/MatchAlways.ts"];function Oe(t){if(!t)return!1;const e=t.__resolveType??"";return e===""?Object.keys(t).length===0:g2.includes(e)||e.includes("always")}function x2(t){const e=t.variants??[];if(e.length===0)return-1;const n=e.findIndex(s=>Oe(s.rule));return n!==-1?n:e.length-1}function j5(t,e,n){const s=n.variants??[];if(s.length===0)return null;const i=x2(n),o=s[i]?.value;if(!o)return null;const l=structuredClone(o);return e.isLazy?{...t,section:l}:l}function Nn(t,e){return e.isMultivariate?e.isLazy?t.section??null:t:null}function S5(t,e){return Array.isArray(t.variants)?t.variants.map((n,s)=>({label:e(n.rule)||`Variant ${s+1}`,value:n.value??{},rule:n.rule})):[]}function k5(t,e){const n=t.__resolveType??"";if(!n)return null;if(x9(n)){const s=t.section??t,i=s.__resolveType??n;if(!i.includes("/")&&i in e){const o=e[i]??{};return{data:{...o},resolveType:o.__resolveType??i}}return{data:{...s},resolveType:i}}if(!n.includes("/")&&n in e){const s=e[n]??{};return{data:{...s},resolveType:s.__resolveType??n}}return{data:{...t},resolveType:n}}function y2(t,e){const n=t.__resolveType??"";return x9(n)?{...t,section:e}:e}function v2(t,e,n){return e.isLazy?{...t,section:n}:n}function T5(t,e,n){const s=[...t.variants??[]],i=s[e];if(!i)return t;const o=i.value??{};return s[e]={...i,value:y2(o,n)},{...t,variants:s}}function N5(t,e,n){const s=[...t.variants??[]];return s[e]?(s[e]={...s[e],rule:n},{...t,variants:s}):t}function _5(t,e){const n=[...t.variants??[]],s=n[e];return s?(n.splice(e+1,0,structuredClone(s)),{...t,variants:n}):t}function C5(t,e,n){const s=[...t.variants??[]];if(e===n||e<0||n<0||e>=s.length||n>=s.length)return t;const[i]=s.splice(e,1);return i?(s.splice(n,0,i),{...t,variants:s}):t}function w5(t,e){const n=[...t.variants??[]];return n.length<=1?null:(n.splice(e,1),{...t,variants:n})}function xe(t){return{rule:o0(),value:structuredClone(t)}}function _n(t,e){return{...e,__resolveType:Z9,variants:t}}function A5(t){return t.isHidden!==!0&&t.isSavedBlock!==!0}function b2(t,e){if(e.isHidden)return null;if(e.isMultivariate){const s=Nn(t,e)?.variants??[],i=s[s.length-1]?.value;return i?structuredClone(i):null}if(e.isLazy){const n=t.section;return n?structuredClone(n):null}return structuredClone(t)}function j2(t,e,n){if(e.isMultivariate||e.isHidden)return null;const s=b2(t,e);if(!s)return null;const i=_n([xe(s),xe(s)]);return e.isLazy?{...t,section:i}:i}function E5(t,e,n){if(e.isHidden||e.isSavedBlock)return null;if(e.isMultivariate){const i=Nn(t,e);if(!i)return null;const o=i.variants??[],l=o[o.length-1]?.value;if(!l)return null;const a=_n([...o,xe(l)],i);return{section:v2(t,e,a),newVariantIndex:o.length}}const s=j2(t,e);return s?{section:s,newVariantIndex:1}:null}const S2=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function re(t){return t.anyOfRefs?.some(e=>e.resolveType!==J9?!1:e.schema?.properties?.variants?.items?.properties?.value?.type==="array")??!1}function k2(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return e.__resolveType===Z9&&Array.isArray(e.variants)}function B0(t){return!t||typeof t!="object"||Array.isArray(t)?!1:t.__resolveType===J9}function T2(t){if(!B0(t))return null;const e=t.variants;if(!Array.isArray(e))return null;const n=e[0]?.value;return Array.isArray(n)?n:null}function N2(t,e){if(!B0(t))return e;const n=structuredClone(t),s=[...n.variants??[]];return s.length===0?s.push({rule:o0(),value:e}):s[0]={...s[0],value:e},{...n,variants:s}}function _2(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return typeof e.__resolveType=="string"&&S2.has(e.__resolveType)&&typeof e.path=="string"}function M5(t,e){const s=t[e]?.sections;if(!s||Array.isArray(s))return 1;const i=s;return Array.isArray(i.variants)?i.variants.length:1}function P5(t,e,n){const i=t[e]?.sections;if(Array.isArray(i))return n===0?i:[];if(i&&typeof i=="object"){const o=i.variants;if(Array.isArray(o)){const l=o[n];return Array.isArray(l?.value)?l.value:[]}}return[]}function C2(t,e,n){if(Array.isArray(t))return[{label:"Default",sections:t}];if(t&&typeof t=="object"){const s=t;if(Array.isArray(s.variants)){const i=s.variants,o=i.map(c=>c2(c.rule,e,n)),l=o.reduce((c,L)=>(c[L]=(c[L]??0)+1,c),{}),a={};return i.map((c,L)=>{const d=o[L]??`Variant ${L+1}`,u=l[d]??1;let f=d;return u>1&&(a[d]=(a[d]??0)+1,f=`${d} ${a[d]}`),{label:f||`Variant ${L+1}`,sections:Array.isArray(c.value)?c.value:[],rule:c.rule}})}}return[]}function m0(t){return{rule:o0(),value:t}}function r0(t,e){return{...e,__resolveType:J9,variants:t}}function I5(t,e){const n=structuredClone(e);if(Array.isArray(t))return r0([m0(t),m0(n)]);if(t&&typeof t=="object"){const s=t;return Array.isArray(s.variants)?r0([...s.variants,m0(n)],s):null}return r0([m0([]),m0(n)])}function R5(t){const e=t.variants;return Array.isArray(e)?e.length-1:1}function F5(t,e){const n=t[e];if(!n)return null;const s=[...t];return s.splice(e+1,0,structuredClone(n)),s}function O5(t,e){if(e.length===0)return r0([],t);if(e.length===1){const n=e[0],s=n?.rule;if(!Oe(s))return r0(e,t);if(Array.isArray(n?.value))return n.value}return r0(e,t)}function w2(t,e){for(const[n,s]of Object.entries(t)){if(!_2(s))continue;const i=s.sections;if(Array.isArray(i)){e(void 0,n,0);continue}if(!i||typeof i!="object")continue;const o=i.variants;if(Array.isArray(o))for(let l=0;l<o.length;l++){const a=o[l];e(a?.rule,n,l)}}}function D5(t,e,n){let s=0;return w2(t,i=>{if(!i)return;(i.__resolveType??"")===e&&A0(i,t,n)&&s++}),s}const A2={provision:0,cloning:1,install:2,dev:3};function E2(t){return A2[t.step]}const rt=48,Cn=28,wn=3,M2=(()=>{const t=[];let e=0;for(let n=0;n<rt;n++)n===Cn?t.push(null):(t.push(e/(rt-1)*wn),e++);return t})();function P2(t){return{provision:t("sandbox.bootingVisual.phaseProvision"),cloning:t("sandbox.bootingVisual.phaseCloning"),install:t("sandbox.bootingVisual.phaseInstall"),dev:t("sandbox.bootingVisual.phaseDev")}}function I2(t,e,n){return t.step==="provision"&&e!=null&&e.kind!=="ready"&&e.kind!=="failed"?Es[e.kind].long:n[t.step]}const F9="bg-foreground/[0.05]",w9="bg-foreground/[0.09]",R2=Array.from({length:35},()=>Math.random()*1.8),F2=Array.from({length:35},()=>Math.random()<.4);function O2(t){const e=W.c(31),{progress:n,claimPhase:s}=t,i=a9();let o;e[0]!==n?(o=E2(n),e[0]=n,e[1]=o):o=e[1];const l=o;let a;e[2]!==s||e[3]!==n||e[4]!==i?(a=I2(n,s,P2(i)),e[2]=s,e[3]=n,e[4]=i,e[5]=a):a=e[5];const c=a;let L;e[6]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(l1,{}),e[6]=L):L=e[6];const d=`${n.step}-${c}`;let u;e[7]!==c||e[8]!==d?(u=r.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-foreground/10 bg-background px-3.5 py-1.5 shadow-[0_4px_20px_-4px_rgb(0_0_0_/_0.12)]",children:[L,r.jsxs("span",{className:"animate-in fade-in text-[13px] font-medium text-foreground/85 duration-500",children:[c,"…"]},d)]}),e[7]=c,e[8]=d,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(D2,{}),e[10]=f):f=e[10];let b;e[11]!==l?(b=r.jsx(M0,{phase:0,current:l,children:f}),e[11]=l,e[12]=b):b=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx(z2,{}),e[13]=p):p=e[13];let m;e[14]!==l?(m=r.jsx(M0,{phase:1,current:l,children:p}),e[14]=l,e[15]=m):m=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(B2,{}),e[16]=S):S=e[16];let h;e[17]!==l?(h=r.jsx(M0,{phase:2,current:l,children:S}),e[17]=l,e[18]=h):h=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(U2,{}),e[19]=g):g=e[19];let v;e[20]!==l?(v=r.jsx(M0,{phase:3,current:l,children:g}),e[20]=l,e[21]=v):v=e[21];let j;e[22]!==h||e[23]!==v||e[24]!==b||e[25]!==m?(j=r.jsxs("div",{className:"relative aspect-[4/3] w-[min(78%,560px)]",children:[b,m,h,v]}),e[22]=h,e[23]=v,e[24]=b,e[25]=m,e[26]=j):j=e[26];let x;e[27]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx("style",{children:`
|
|
1
|
+
import{c as W,n as Pt,m as D0,K as q9,b as a9,j as r,l as e9,B as d9,F as ks,aq as Ts,e as It,r as D,t as v9,a6 as M9,a7 as P9,a9 as I9,ar as Rt,h as j0,as as Ns,E as _s,at as Cs,ap as Ft}from"./index-BodvdIMk.js";import{u as Se}from"./use-session-runtime-D2nv6bTI.js";import{Q as ws,H as Ot,T as O9,U as Dt,z as $9,V as As,i as x9,W as J9,X as Z9,N as S0,Y as y9,Z as Ze,_ as o0,$ as Es,a0 as Ms,a1 as Ps,a2 as Is,a3 as Qe,a4 as $t,A as zt,a5 as Xe,a6 as Rs,a7 as Fs,a8 as Bt,a9 as p0,o as Os,aa as Ds,v as $s,c as zs,ab as Bs,ac as Vs}from"./index-DTnAWEs3.js";import{e as Vt}from"./backoff-CrEUbyZT.js";import{s as Us,d as Ks,a as Gs}from"./utils-DPVkkzea.js";import{b as ke}from"./sandbox-url-D3mC8qhT.js";import{K as Hs,L as Ws,M as Ys,N as qs,O as Js,P as Zs,Q as Qs,R as Xs,S as e1,C as t1,T as Te,J as Ne,o as Ut,U as et,V as _e,W as n1,F as s1,G as r1,X as i1,Y as o1}from"./agent-icon-DlT0cyOd.js";import{i as Kt}from"./Play-HfzzXB20.js";import{S as tt}from"./sandbox-lifecycle-context-KgLleS3y.js";import{G as l1}from"./pair-BryCAS3L.js";import{i as Q9}from"./Check-_wGz2-IJ.js";import{i as Ce}from"./ChevronSelectorVertical-DTb5009V.js";import{d as W0,e as Y0,a as G9,C as l0,b as q0,c as we,f as a1}from"./command-vCLlEnld.js";import{a as k0,b as T0,P as N0}from"./popover-BaPHFXoA.js";import{b as Gt}from"./chat-context-BdJniD3E.js";import{i as c1}from"./ArrowLeft-B4kTLC80.js";import{i as J0}from"./ChevronRight-DfnK-irb.js";import{n as Ht}from"./LinkExternal01-DLDyK_TN.js";import{S as L1}from"./scroll-area-DrpmDXmv.js";import{M as Wt}from"./monaco-editor-miL0A9cI.js";import{C as d1}from"./calendar-BPRd4cON.js";import{I as _9}from"./input-CyCfmV2v.js";import{T as u1}from"./textarea-2MjTWIvv.js";import{L as z9}from"./label-oySBL-hw.js";import{a as Yt}from"./use-virtual-mcp-DY2qk06G.js";import{a as f1}from"./Tool01-duhLcQNq.js";import{i as m1}from"./SwitchHorizontal01-Dne29Upz.js";import{s as Ae}from"./Plus-zXs3aP31.js";import{E as t0,M as p1,m as h1,g as _0,u as g1,s as x1,a as y1,b as v1}from"./usage-stats-Cp4Mqdjr.js";import{S as Z0,b as Q0,a as X0,d as ee,c as a0}from"./select-bwhAgSkw.js";import{a as b1}from"./Palette-BywMlwsu.js";import{T as T9,R as j1,u as qt,C as Jt,a as Zt,b as $0,s as Qt,K as Xt,P as en,D as tn,c as nn,S as sn,v as rn,d as on,e as he}from"./rich-text-link-control-D8pkIadD.js";import{S as Ee}from"./switch-B1nJbGCG.js";import{s as S1}from"./safe-image-url-D5z803Ot.js";import{a as Me}from"./Copy01-DoHw-_s5.js";import{i as k1}from"./Settings02-DPUnnUpS.js";import{s as T1}from"./Eye-Ccu8gsxq.js";import{s as C0}from"./Trash01-CH5l96iG.js";import{D as te,a as D9,b as ne,c as se}from"./dropdown-menu-DlZDenrk.js";import{t as Pe}from"./ChevronUp-SbK1Bh_A.js";import{i as ln}from"./Globe01-BHsBANMN.js";import{d as an,h as cn,c as Ln,e as N1,b as dn,D as un}from"./dialog-BAfLND_C.js";import{i as ge}from"./File02-CODRlzC9.js";import{i as w0}from"./Upload01-DksJHtIE.js";import{i as fn}from"./AlertCircle-CfOItn1b.js";import{i as mn}from"./DotsVertical-Ct2yI8vr.js";import{a as c0}from"./Image01-PUenBySa.js";import{S as _1}from"./search-input-BEuwwr9P.js";import{T as C1,a as w1,b as A1,c as E1}from"./tabs-BUVbbLAT.js";import{u as M1}from"./use-debounced-value-Dci7_Qwe.js";import{u as P1,a as pn}from"./use-file-configs-CMLhU-Fj.js";import{u as I1,a as Ie,i as hn,e as R1,b as nt,f as F1}from"./asset-utils-DCSDKdD5.js";import{m as gn}from"./match-site-slug-config-D3fUJ6vX.js";import{T as O1,a as D1}from"./toggle-group-yY_Yhls6.js";import{s as xn}from"./TrendUp01-fYoe36da.js";import{a as $1}from"./Printer-kkmv6XzS.js";import{i as z1}from"./Tool02-CnClhfmX.js";import{c as B1,d as V1,b as U1,f as K1,g as G1,e as H1,a as W1,A as Y1}from"./alert-dialog-B19dFL0f.js";import{s as q1}from"./decode-html-entities-DI0z1GlS.js";function Re(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function J1(t){let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||Array.isArray(e)?null:e}function Z1(t,e){return ke(t,e)}function Q1(t,e){return ke(t,"preview-fetch",{path:e})}function X1(t){return Z1(t,"preview-invoke")}function yn(t){try{const{hostname:e}=new URL(t);return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}function e2(){if(typeof document>"u")return null;const t=Array.from(document.querySelectorAll("iframe"));for(const e of t){const n=e.getAttribute("src");if(n&&yn(n))return n}return null}function vn(t,e){const n=t.previewUrl??t.getFallbackPreviewUrl?.()??e2();return n&&yn(n)?new URL(e,n).toString():Q1(t,e)}function t2(t){return vn(t,"/.decofile")}function n2(t){return t===400?"absent":t===404?"unavailable":t>=200&&t<300?"ok":"error"}function st(t){return t.liveOk||t.committedAbsent?404:t.liveStatus??502}async function bn(t,e){const n=ke(t,"read"),s=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,full:!0})}),i=n2(s.status);if(i==="absent")return{kind:"absent"};if(i==="unavailable")return{kind:"unavailable"};if(i==="error"){const l=new Error(`Failed to read ${e}: ${s.status}`);throw l.status=s.status,l}const o=await s.json();if(typeof o.content!="string")return{kind:"unavailable"};try{return{kind:"data",data:JSON.parse(Us(o.content))}}catch{return{kind:"unavailable"}}}async function s2(t){const e=`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}/meta`,n=await fetch(e,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const s=new Error(`Failed to read committed meta: ${n.status}`);throw s.status=n.status,s}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function Fe(t){return Yt(t)?.metadata?.runtime?.path??null}function d5(t,e){const n=W.c(15),s=t?`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`:"",i=e?.fetchEnabled??!0,o=Fe(t?.virtualMcpId),l=Se(t?.virtualMcpId).runtime==="cms",a=Pt();let c;n[0]!==s?(c=q9.decofile(s),n[0]=s,n[1]=c):c=n[1];let L;n[2]!==l||n[3]!==i||n[4]!==o||n[5]!==t||n[6]!==a?(L=async()=>{if(l)return ws(a,t);const b=()=>bn(t,Re(o,".deco/blocks.gen.json"));if(i){const S=await fetch(t2(t),{cache:"no-store"}).catch(i2);if(S?.ok){const v=J1(await S.text());if(v)return v}const h=await b();if(h.kind==="data")return h.data;const g=new Error(`Failed to fetch decofile: ${S?.status??"network error"}`);throw g.status=st({liveOk:!!S?.ok,liveStatus:S?.status,committedAbsent:h.kind==="absent"}),g}const p=await b();if(p.kind==="data")return p.data;const m=new Error("decofile unavailable (preview down, no committed snapshot)");throw m.status=st({liveOk:!1,committedAbsent:p.kind==="absent"}),m},n[2]=l,n[3]=i,n[4]=o,n[5]=t,n[6]=a,n[7]=L):L=n[7];const d=!!t;let u;n[8]!==l?(u=(b,p)=>{if(l)return b<3;const m=p.status;return m!==502&&m!==404&&b<2},n[8]=l,n[9]=u):u=n[9];let f;return n[10]!==c||n[11]!==L||n[12]!==d||n[13]!==u?(f={queryKey:c,queryFn:L,enabled:d,staleTime:3e4,retry:u,retryDelay:r2},n[10]=c,n[11]=L,n[12]=d,n[13]=u,n[14]=f):f=n[14],D0(f)}function r2(t){return Vt(5e3,1e3,t,2,0)}function i2(){return null}const o2=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function l2(t){return t.includes("matchers")||t.includes("Match")}function jn(t,e){const n=t.__resolveType;return typeof n!="string"||!n||o2.has(n)?!1:e?As(e,n):l2(n)}function a2(t,e){const n=[];for(const[s,i]of Object.entries(e)){if(s.includes("/")||!O9(s)||Dt(s)||!i||typeof i!="object"||Array.isArray(i))continue;const o=i;jn(o,t)&&n.push({blockKey:s,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return n.sort((s,i)=>(s.name??s.blockKey).localeCompare(i.name??i.blockKey))}function A0(t,e,n){if(!t)return!1;const s=t.__resolveType;if(typeof s!="string"||!O9(s)||!Object.hasOwn(e,s))return!1;const i=e[s];return!i||typeof i!="object"||Array.isArray(i)?!1:jn(i,n)}function u5(t,e,n){return A0(t,e,n)?t?.__resolveType??null:null}function Sn(t,e,n){if(!t)return null;const s=t.__resolveType??"";if(!s)return null;if(A0(t,e,n)){const l=e[s]??{},a=l.__resolveType??s,{__resolveType:c,name:L,...d}=l;return{resolveType:a,data:d,blockKey:s}}const{__resolveType:i,...o}=t;return{resolveType:s,data:o}}function kn(t,e,n){const s=Sn(t,e,n);return s?{__resolveType:s.resolveType,...s.data}:{__resolveType:""}}function f5(t,e,n){if(t)return A0(t,e,n)?kn(t,e,n):t}function c2(t,e,n,s){if(!t)return"Default";if(A0(t,e,s)){const i=t.__resolveType??"",o=e[i];return Ot(i,o)}return n(t)}function m5(t,e,n){return{__resolveType:t,...e,name:n}}function L2(t){return{__resolveType:t}}function p5(t,e,n){const s=Sn(t,e,n);return s?{resolveType:s.resolveType,formValue:s.data}:{resolveType:"",formValue:{}}}function d2(t,e){const n={__resolveType:t};if(!t||!e)return n;const s=$9(t,e),i=s?.type==="inline-union"?s.inlineUnionBranches?.[0]?.discriminators:void 0;return i?{...n,...i}:n}function u2(t){const e=[];return t.fastPreviewActive?e.push({kind:"committed"}):(t.fetchEnabled&&t.previewUrl&&e.push({kind:"live",baseUrl:t.previewUrl}),e.push({kind:"committed"})),t.productionUrl&&e.push({kind:"production",baseUrl:t.productionUrl}),e}function f2(t){return q9.liveMeta(t.orgSlug,t.virtualMcpId,t.branch,t.previewUrl??"",t.productionUrl??"")}function h5(t,e){const n=W.c(19),s=e?.fetchEnabled??!0,i=t?.previewUrl,o=Fe(t?.virtualMcpId),{previewServerUrl:l,runtime:a}=Se(t?.virtualMcpId),c=a==="cms";let L;n[0]!==t||n[1]!==i||n[2]!==l?(L=t?f2({...t,previewUrl:i,productionUrl:l}):q9.liveMeta(""),n[0]=t,n[1]=i,n[2]=l,n[3]=L):L=n[3];let d;n[4]!==c||n[5]!==s||n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==l?(d=async()=>{const m=p2,S=()=>c?s2(t):bn(t,Re(o,".deco/meta.gen.json")),h=u2({fetchEnabled:s,previewUrl:i,productionUrl:l,fastPreviewActive:c});for(const v of h){if(v.kind==="committed"){const x=await S();if(x.kind==="data")return x.data;continue}const j=await m(v.baseUrl);if(j)return j}const g=new Error("live meta unavailable (dev server down, no committed snapshot, no production fallback)");throw g.status=502,g},n[4]=c,n[5]=s,n[6]=o,n[7]=t,n[8]=i,n[9]=l,n[10]=d):d=n[10];const u=!!t,f=e?.refetchInterval;let b;n[11]!==c?(b=(m,S)=>(c||S.status!==502)&&m<3,n[11]=c,n[12]=b):b=n[12];let p;return n[13]!==L||n[14]!==d||n[15]!==u||n[16]!==f||n[17]!==b?(p={queryKey:L,queryFn:d,enabled:u,refetchInterval:f,refetchIntervalInBackground:!1,staleTime:3e5,retry:b,retryDelay:m2},n[13]=L,n[14]=d,n[15]=u,n[16]=f,n[17]=b,n[18]=p):p=n[18],D0(p)}function m2(t){return Vt(5e3,1e3,t,2,0)}async function p2(t){const e=new URL("/live/_meta",t).href,n=await fetch(e,{cache:"no-store"}).catch(h2);if(!n?.ok)return null;try{return await n.json()}catch{return null}}function h2(){return null}function ce(t,e,n){const s=n[t];return typeof s?.name=="string"&&s.name||t.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase())||`Section ${e+1}`}function g5(t,e){return t.map((n,s)=>{const i=n.__resolveType??"",o=x9(i);if(!o&&i!==""&&O9(i)&&i in e)return{index:s,resolveType:i,label:ce(i,s,e),isLazy:!1,isSavedBlock:!0};const l=o?n.section:void 0,a=o?l?.__resolveType??"":i;if(a===J9||a===Z9){const L=o?l:n,d=Array.isArray(L?.variants)?L.variants:[];if(d.length===1&&(d[0]?.rule?.__resolveType??"")===S0){const b=d[0]?.value??{};let p=b.__resolveType??"";const m=x9(p);let S=b;if(m){const h=b.section;p=h?.__resolveType??p,h&&(S=h)}if(p===J9||p===Z9){const g=(Array.isArray(S.variants)?S.variants:[])[0]?.value?.__resolveType,v=g?y9(g):"Section";return{index:s,resolveType:i,label:`Variants of ${v}`,isHidden:!0,isLazy:m}}return p!==""&&O9(p)&&p in e?{index:s,resolveType:i,label:ce(p,s,e),isHidden:!0,isLazy:m,isSavedBlock:!0}:{index:s,resolveType:i,label:y9(p)||`Section ${s+1}`,isHidden:!0,isLazy:m}}const u=d[0]?.value?.__resolveType,f=u?y9(u):"Section";return{index:s,resolveType:i,label:`Variants of ${f}`,isMultivariate:!0,isLazy:o}}const c=o?n.section?.__resolveType??i:i;return o&&c!==""&&O9(c)&&c in e?{index:s,resolveType:i,label:ce(c,s,e),isLazy:!0,isSavedBlock:!0}:{index:s,resolveType:i,label:y9(c)||`Section ${s+1}`,isLazy:o}})}function Tn(t){const e=t.__resolveType??"";return x9(e)?t.section??t:t}function z0(t){const i=(x9(t.__resolveType??"")?t.section:t)?.variants?.[0];return i?.rule?.__resolveType!==S0?null:i?.value??null}function x5(t){const e=Tn(t);return{__resolveType:Z9,variants:[{value:e,rule:{__resolveType:S0}}]}}function y5(t){const e=t.__resolveType??"";if(!e)return null;if(x9(e))return t.section??null;const n=z0(t);return n?x9(n.__resolveType??"")?n:{__resolveType:Ze,section:Tn(n)}:{__resolveType:Ze,section:t}}function E0(t){const e=t.__resolveType??"";if(!e)return null;if(x9(e)){const n=t.section,s=n?.__resolveType??"";return!s||!n?null:{resolveType:s,data:n}}return{resolveType:e,data:t}}function v5(t){const e=z0(t);if(e)return E0(e);if(x9(t.__resolveType??"")){const s=t.section;if(!s)return null;const i=z0(s);return E0(i||s)}return E0(t)}function b5(t){return z0(t)}const g2=["website/matchers/always.ts","$live/matchers/MatchAlways.ts"];function Oe(t){if(!t)return!1;const e=t.__resolveType??"";return e===""?Object.keys(t).length===0:g2.includes(e)||e.includes("always")}function x2(t){const e=t.variants??[];if(e.length===0)return-1;const n=e.findIndex(s=>Oe(s.rule));return n!==-1?n:e.length-1}function j5(t,e,n){const s=n.variants??[];if(s.length===0)return null;const i=x2(n),o=s[i]?.value;if(!o)return null;const l=structuredClone(o);return e.isLazy?{...t,section:l}:l}function Nn(t,e){return e.isMultivariate?e.isLazy?t.section??null:t:null}function S5(t,e){return Array.isArray(t.variants)?t.variants.map((n,s)=>({label:e(n.rule)||`Variant ${s+1}`,value:n.value??{},rule:n.rule})):[]}function k5(t,e){const n=t.__resolveType??"";if(!n)return null;if(x9(n)){const s=t.section??t,i=s.__resolveType??n;if(!i.includes("/")&&i in e){const o=e[i]??{};return{data:{...o},resolveType:o.__resolveType??i}}return{data:{...s},resolveType:i}}if(!n.includes("/")&&n in e){const s=e[n]??{};return{data:{...s},resolveType:s.__resolveType??n}}return{data:{...t},resolveType:n}}function y2(t,e){const n=t.__resolveType??"";return x9(n)?{...t,section:e}:e}function v2(t,e,n){return e.isLazy?{...t,section:n}:n}function T5(t,e,n){const s=[...t.variants??[]],i=s[e];if(!i)return t;const o=i.value??{};return s[e]={...i,value:y2(o,n)},{...t,variants:s}}function N5(t,e,n){const s=[...t.variants??[]];return s[e]?(s[e]={...s[e],rule:n},{...t,variants:s}):t}function _5(t,e){const n=[...t.variants??[]],s=n[e];return s?(n.splice(e+1,0,structuredClone(s)),{...t,variants:n}):t}function C5(t,e,n){const s=[...t.variants??[]];if(e===n||e<0||n<0||e>=s.length||n>=s.length)return t;const[i]=s.splice(e,1);return i?(s.splice(n,0,i),{...t,variants:s}):t}function w5(t,e){const n=[...t.variants??[]];return n.length<=1?null:(n.splice(e,1),{...t,variants:n})}function xe(t){return{rule:o0(),value:structuredClone(t)}}function _n(t,e){return{...e,__resolveType:Z9,variants:t}}function A5(t){return t.isHidden!==!0&&t.isSavedBlock!==!0}function b2(t,e){if(e.isHidden)return null;if(e.isMultivariate){const s=Nn(t,e)?.variants??[],i=s[s.length-1]?.value;return i?structuredClone(i):null}if(e.isLazy){const n=t.section;return n?structuredClone(n):null}return structuredClone(t)}function j2(t,e,n){if(e.isMultivariate||e.isHidden)return null;const s=b2(t,e);if(!s)return null;const i=_n([xe(s),xe(s)]);return e.isLazy?{...t,section:i}:i}function E5(t,e,n){if(e.isHidden||e.isSavedBlock)return null;if(e.isMultivariate){const i=Nn(t,e);if(!i)return null;const o=i.variants??[],l=o[o.length-1]?.value;if(!l)return null;const a=_n([...o,xe(l)],i);return{section:v2(t,e,a),newVariantIndex:o.length}}const s=j2(t,e);return s?{section:s,newVariantIndex:1}:null}const S2=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function re(t){return t.anyOfRefs?.some(e=>e.resolveType!==J9?!1:e.schema?.properties?.variants?.items?.properties?.value?.type==="array")??!1}function k2(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return e.__resolveType===Z9&&Array.isArray(e.variants)}function B0(t){return!t||typeof t!="object"||Array.isArray(t)?!1:t.__resolveType===J9}function T2(t){if(!B0(t))return null;const e=t.variants;if(!Array.isArray(e))return null;const n=e[0]?.value;return Array.isArray(n)?n:null}function N2(t,e){if(!B0(t))return e;const n=structuredClone(t),s=[...n.variants??[]];return s.length===0?s.push({rule:o0(),value:e}):s[0]={...s[0],value:e},{...n,variants:s}}function _2(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return typeof e.__resolveType=="string"&&S2.has(e.__resolveType)&&typeof e.path=="string"}function M5(t,e){const s=t[e]?.sections;if(!s||Array.isArray(s))return 1;const i=s;return Array.isArray(i.variants)?i.variants.length:1}function P5(t,e,n){const i=t[e]?.sections;if(Array.isArray(i))return n===0?i:[];if(i&&typeof i=="object"){const o=i.variants;if(Array.isArray(o)){const l=o[n];return Array.isArray(l?.value)?l.value:[]}}return[]}function C2(t,e,n){if(Array.isArray(t))return[{label:"Default",sections:t}];if(t&&typeof t=="object"){const s=t;if(Array.isArray(s.variants)){const i=s.variants,o=i.map(c=>c2(c.rule,e,n)),l=o.reduce((c,L)=>(c[L]=(c[L]??0)+1,c),{}),a={};return i.map((c,L)=>{const d=o[L]??`Variant ${L+1}`,u=l[d]??1;let f=d;return u>1&&(a[d]=(a[d]??0)+1,f=`${d} ${a[d]}`),{label:f||`Variant ${L+1}`,sections:Array.isArray(c.value)?c.value:[],rule:c.rule}})}}return[]}function m0(t){return{rule:o0(),value:t}}function r0(t,e){return{...e,__resolveType:J9,variants:t}}function I5(t,e){const n=structuredClone(e);if(Array.isArray(t))return r0([m0(t),m0(n)]);if(t&&typeof t=="object"){const s=t;return Array.isArray(s.variants)?r0([...s.variants,m0(n)],s):null}return r0([m0([]),m0(n)])}function R5(t){const e=t.variants;return Array.isArray(e)?e.length-1:1}function F5(t,e){const n=t[e];if(!n)return null;const s=[...t];return s.splice(e+1,0,structuredClone(n)),s}function O5(t,e){if(e.length===0)return r0([],t);if(e.length===1){const n=e[0],s=n?.rule;if(!Oe(s))return r0(e,t);if(Array.isArray(n?.value))return n.value}return r0(e,t)}function w2(t,e){for(const[n,s]of Object.entries(t)){if(!_2(s))continue;const i=s.sections;if(Array.isArray(i)){e(void 0,n,0);continue}if(!i||typeof i!="object")continue;const o=i.variants;if(Array.isArray(o))for(let l=0;l<o.length;l++){const a=o[l];e(a?.rule,n,l)}}}function D5(t,e,n){let s=0;return w2(t,i=>{if(!i)return;(i.__resolveType??"")===e&&A0(i,t,n)&&s++}),s}const A2={provision:0,cloning:1,install:2,dev:3};function E2(t){return A2[t.step]}const rt=48,Cn=28,wn=3,M2=(()=>{const t=[];let e=0;for(let n=0;n<rt;n++)n===Cn?t.push(null):(t.push(e/(rt-1)*wn),e++);return t})();function P2(t){return{provision:t("sandbox.bootingVisual.phaseProvision"),cloning:t("sandbox.bootingVisual.phaseCloning"),install:t("sandbox.bootingVisual.phaseInstall"),dev:t("sandbox.bootingVisual.phaseDev")}}function I2(t,e,n){return t.step==="provision"&&e!=null&&e.kind!=="ready"&&e.kind!=="failed"?Es[e.kind].long:n[t.step]}const F9="bg-foreground/[0.05]",w9="bg-foreground/[0.09]",R2=Array.from({length:35},()=>Math.random()*1.8),F2=Array.from({length:35},()=>Math.random()<.4);function O2(t){const e=W.c(31),{progress:n,claimPhase:s}=t,i=a9();let o;e[0]!==n?(o=E2(n),e[0]=n,e[1]=o):o=e[1];const l=o;let a;e[2]!==s||e[3]!==n||e[4]!==i?(a=I2(n,s,P2(i)),e[2]=s,e[3]=n,e[4]=i,e[5]=a):a=e[5];const c=a;let L;e[6]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(l1,{}),e[6]=L):L=e[6];const d=`${n.step}-${c}`;let u;e[7]!==c||e[8]!==d?(u=r.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-foreground/10 bg-background px-3.5 py-1.5 shadow-[0_4px_20px_-4px_rgb(0_0_0_/_0.12)]",children:[L,r.jsxs("span",{className:"animate-in fade-in text-[13px] font-medium text-foreground/85 duration-500",children:[c,"…"]},d)]}),e[7]=c,e[8]=d,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(D2,{}),e[10]=f):f=e[10];let b;e[11]!==l?(b=r.jsx(M0,{phase:0,current:l,children:f}),e[11]=l,e[12]=b):b=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx(z2,{}),e[13]=p):p=e[13];let m;e[14]!==l?(m=r.jsx(M0,{phase:1,current:l,children:p}),e[14]=l,e[15]=m):m=e[15];let S;e[16]===Symbol.for("react.memo_cache_sentinel")?(S=r.jsx(B2,{}),e[16]=S):S=e[16];let h;e[17]!==l?(h=r.jsx(M0,{phase:2,current:l,children:S}),e[17]=l,e[18]=h):h=e[18];let g;e[19]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(U2,{}),e[19]=g):g=e[19];let v;e[20]!==l?(v=r.jsx(M0,{phase:3,current:l,children:g}),e[20]=l,e[21]=v):v=e[21];let j;e[22]!==h||e[23]!==v||e[24]!==b||e[25]!==m?(j=r.jsxs("div",{className:"relative aspect-[4/3] w-[min(78%,560px)]",children:[b,m,h,v]}),e[22]=h,e[23]=v,e[24]=b,e[25]=m,e[26]=j):j=e[26];let x;e[27]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx("style",{children:`
|
|
2
2
|
@keyframes vm-pulse-soft {
|
|
3
3
|
0%, 100% { opacity: 0.25; }
|
|
4
4
|
50% { opacity: 1; }
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as Q,r as o,dS as _e,dQ as ke,c as De,e as Pe,dN as ee,I as ye,j as Re,K as G,x as Le}from"./index-
|
|
1
|
+
import{n as Q,r as o,dS as _e,dQ as ke,c as De,e as Pe,dN as ee,I as ye,j as Re,K as G,x as Le}from"./index-BodvdIMk.js";import{u as Oe}from"./use-mcp-client-DO1cH-Rq.js";import{u as Ue}from"./use-session-runtime-D2nv6bTI.js";import{b as ge,a as Ne}from"./chat-context-BdJniD3E.js";import{b as Be}from"./hooks-D-bAuZ0C.js";import{e as be}from"./backoff-CrEUbyZT.js";import{b as Fe}from"./sandbox-url-D3mC8qhT.js";import{a as $e}from"./use-virtual-mcp-DY2qk06G.js";function Ke(e,t){const n=Q(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=Q(t).getMutationCache(),r=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{r.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=_e(u.current,fe(n,r.current));u.current!==a&&(u.current=a,ke.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function He(e,t,n){const r=await e.callTool({name:t,arguments:n});if(r.isError){const u=r.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return r}const Te=["SANDBOX_START"],W=new Map,Ie=e=>`${e.virtualMcpId}::${e.branch??""}`,Me=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function qe(e,t){const n=Q();return Pe({mutationKey:Te,retry:(r,u)=>Me(u)&&r<6,retryDelay:r=>be(5e3,500,r,2,0),mutationFn:async r=>{r.branch&&le.clear(r.virtualMcpId,r.branch);const u=Ie(r),c=W.get(u);if(c)return c;const a=(async()=>(await He(e,"SANDBOX_START",r)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function gt(e,t){const n=De.c(3);let r;return n[0]!==t||n[1]!==e?(r={mutationKey:Te,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=r):r=n[2],Ke(r)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Ge={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Ge),me=16384;class Qe{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const Ye=1e3,Xe=3e4,je=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],Ee="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(je)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function bt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:r=!0,children:u}){const{org:c}=ye(),a=Q(),V=ge()?.taskId??null,[Y,p]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,O]=o.useState({state:"running"}),[se,y]=o.useState({kind:"unknown"}),[X,h]=o.useState(!1),[x,H]=o.useState([]),[re,R]=o.useState([]),[,I]=o.useState(0),T=o.useRef(new Map),U=o.useRef(new Set),v=o.useRef(new Set),A=o.useRef(null),E=Je(n),M=$e(e)?.metadata?.runtime?.selected==="deno",P=d=>{let S=T.current.get(d);return S||(S=new Qe,T.current.set(d,S)),S};o.useEffect(()=>{if(p(null),b({phase:"idle"}),O({state:"running"}),y({kind:"unknown"}),A.current=null,h(!1),H([]),R([]),T.current.clear(),!e||!t||!r)return;const d=Fe({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,_=0,L=null,w=null,k=null,g=null,m=null,D=null;const j=s=>{try{const i=JSON.parse(s.data);p(i),i.kind!=="failed"&&(h(!1),_=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},N=()=>{h(!0),p(null),b({phase:"idle"}),O({state:"running"}),y({kind:"unknown"}),H([]),R([]),T.current.clear()},q=s=>{try{const i=JSON.parse(s.data);if(typeof i.data!="string")return;_=0;const f=i.data.replace(/\r?\n/g,`\r
|
|
2
2
|
`);P(i.source).append(f);for(const l of U.current)try{l(i.source,f)}catch{}I(l=>l+1)}catch{}},J=s=>{const i=s.type;try{const f=JSON.parse(s.data);switch(_=0,i){case"lifecycle":{const l=f;b(l.state);const F=`${c.slug}/${e}/${t}`;if(Se(l.state.phase)&&!(D&&Se(D))){ee(a,c.id);const K=G.decofile(F);a.getQueryData(K)===void 0&&a.invalidateQueries({queryKey:K})}l.state.phase==="running"&&D!=="running"&&(ee(a,c.id),a.invalidateQueries({queryKey:G.decofile(F)}),a.invalidateQueries({queryKey:G.liveMeta(c.slug,e,t)})),D=l.state.phase;const $=l.state.phase==="running"?l.state.port:null,ce=A.current;if(A.current=$,ce!==null&&$!==null&&ce!==$)for(const K of v.current)try{K()}catch{}return}case"status":O(f);return;case"tasks":{const F=f.active.map($=>$.logName??"").filter(Boolean);R(F);return}case"scripts":H(f.scripts);return;case"branch":{const l=f.meta;y(l);return}case"reload":for(const l of v.current)try{l()}catch{}return;case"file-changed":{const{path:l}=f,F=`${c.slug}/${e}/${t}`;if(l.startsWith(".deco/")||l.includes("/.deco/")){if(!(D==="running"))return;k&&clearTimeout(k),k=setTimeout(()=>{if(k=null,a.invalidateQueries({queryKey:G.decofile(F)}),M)for(const K of v.current)try{K()}catch{}},500)}else w&&clearTimeout(w),w=setTimeout(()=>{w=null,a.invalidateQueries({queryKey:G.liveMeta(c.slug,e,t)})},1e3);return}}}catch{}};function B(){if(S)return;const s=new EventSource(d);g=s,s.onopen=()=>{},s.onerror=()=>{g===s&&s.readyState===EventSource.CLOSED&&C("studio")},s.addEventListener("phase",j),s.addEventListener("gone",N),s.addEventListener(Ee,q);for(const i of he)s.addEventListener(i,J)}function ae(){if(S||!E||m)return;const s=new EventSource(E);m=s;let i=!1;s.onopen=()=>{if(S||m!==s)return;i=!0,_=0;const f=g;g=null,f?.close()},s.onerror=()=>{m===s&&s.readyState===EventSource.CLOSED&&ue(s,i)},s.addEventListener(Ee,q);for(const f of he)s.addEventListener(f,J)}async function ue(s,i){const f=E?await ze(E):!1;if(!(S||m!==s)){if(s.close(),m=null,f){N(),g||B();return}i&&C("direct")}}function C(s){if(S||L)return;const i=be(Xe,Ye,_,2,0);_++,L=setTimeout(()=>{if(L=null,!S){if(s==="direct"){m?.close(),m=null,ae();return}g?.close(),g=null,B()}},i)}return B(),()=>{S=!0,g?.close(),m?.close(),L&&clearTimeout(L),w&&clearTimeout(w),k&&clearTimeout(k)}},[e,t,c.slug,r,V,E,a,M]);const oe={phase:Y,lifecycle:te,status:ne,branch:se,notFound:X,scripts:x,activeProcesses:re,getBuffer:d=>T.current.get(d)?.get()??"",hasData:d=>(T.current.get(d)?.get().length??0)>0,subscribeChunks:d=>(U.current.add(d),()=>{U.current.delete(d)}),subscribeReload:d=>(v.current.add(d),()=>{v.current.delete(d)})};return Re.jsx(ve,{value:oe,children:u})}function de(){return o.use(ve)}function Tt(e){const{subscribeChunks:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t((c,a)=>{n.current?.(c,a)}),[t])}function vt(e){const{subscribeReload:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t(()=>{n.current?.()}),[t])}function Ze(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}const et={githubNotAuthenticated:"GITHUB_NOT_AUTHENTICATED",githubConnectionMissing:"GITHUB_CONNECTION_MISSING"},pe="::";function tt(e){const t=e.indexOf(pe);if(t>0){const n=e.slice(0,t);if(Object.values(et).includes(n))return{code:n,message:e.slice(t+pe.length)}}return{code:null,message:e}}function nt(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveGithubRepo&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function wt(e){return e.threadLoaded&&e.isOwner&&e.hasActiveGithubRepo&&!e.branch&&!e.attempted}function st(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function Ct(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:r,branch:u}=e,c=e.ownerId??r;if(!r||!c||!u)return t;const a=n?.[c]?.[u];return a?{...t??{},[r]:{...t?.[r]??{},[u]:a}}:t}function z(e,t,n){const r={virtualMcpId:e};return t&&(r.branch=t),n&&(r.threadId=n),r}const we=2,rt=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function Ce(e){return rt.has(e)}function ot(e){return e.executionEnabled&&e.failedReason!==null&&Ce(e.failedReason)&&e.attempts<we&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const at={branch:null,count:0,handled:!1};function ut(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function ct(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function it(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function xe(e,t){return`${e??""}::${t??""}`}function lt(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function Z(e){const{data:t,virtualMcpId:n,branch:r}=e;t?.branch&&!r&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:xe(n,t.branch??r),url:t.previewUrl})}const dt={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},Ae=o.createContext(dt);function xt(){return o.use(Ae)}function At({executionEnabled:e,virtualMcpId:t,branch:n,userId:r,hasActiveGithubRepo:u,vmEntry:c,threadId:a,children:V}){const{org:Y}=ye(),{setCurrentTaskBranch:p}=Ne(),te=Be(),b=de(),ne=Q(),O=Ue(t),se=O.resolved?O.runtime:null,y=ge()?.taskId??null,X=Oe({connectionId:Le,orgId:Y.id,orgSlug:Y.slug}),h=qe(X,{onStarted:()=>{a&&te?.refreshThreadMetadata(a)}}),{mutate:x,reset:H}=h,[re,R]=o.useState(null),I=o.useRef(new Set),T=o.useRef(null),[U,v]=o.useState(at),A=ut(U,n);A!==U&&v(A);const E=b.phase?.kind==="failed"?b.phase:null,M=lt({vmEntry:c,seeded:E?null:re,key:xe(t,n)}),P=!!t&&!!n&&le.isStopped(t,n),oe=b.status.state==="paused",d=!E||!Ce(E.reason)||A.count>=we,S=ct({mutationError:h.isError&&h.error?tt(h.error.message):null,phase:b.phase,startPending:h.isPending,claimRetryExhausted:d}),_=Ze({previewUrl:M,appPaused:oe,userStopped:P,startError:S}),L=it(_),w=n??"",k=I.current.has(w),g=nt({executionEnabled:e,hasActiveGithubRepo:u,userId:r,branch:n,vmEntry:c,userStopped:P,isPending:h.isPending,attempted:k,sessionRuntime:se});o.useEffect(()=>{if(!g||!t)return;I.current.add(w);const C=z(t,n,y);x(C,{onSuccess:s=>{Z({data:s,virtualMcpId:t,branch:n,setCurrentTaskBranch:p,setSeededPreviewUrl:R})},onError:s=>{console.error("[sandbox-lifecycle] auto-start failed:",s)}})},[g,w,n,t,y,x,p,R]);const m=b.notFound?c?.sandboxHandle??null:null,D=st({executionEnabled:e,notFound:b.notFound,deadVmId:m,lastDeadVmId:T.current,isPending:h.isPending,userStopped:P});o.useEffect(()=>{if(!D||!m||!t)return;T.current=m;const C=z(t,n,y);x(C,{onSuccess:s=>{Z({data:s,virtualMcpId:t,branch:n,setCurrentTaskBranch:p,setSeededPreviewUrl:R})},onError:s=>{console.error("[sandbox-lifecycle] self-heal failed:",s)}})},[D,m,t,n,y,x,p,R]);const j=ot({executionEnabled:e,failedReason:E?.reason??null,attempts:A.count,isPending:h.isPending,userStopped:P,alreadyHandled:A.handled});o.useEffect(()=>{if(!E){v(s=>s.handled?{...s,handled:!1}:s);return}if(!j||!t)return;v(s=>({...s,handled:!0,count:s.count+1}));const C=z(t,n,y);x(C,{onSuccess:s=>{Z({data:s,virtualMcpId:t,branch:n,setCurrentTaskBranch:p,setSeededPreviewUrl:R})},onError:s=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",s)}})},[E,j,t,n,y,x,p,R]);const N=()=>{if(!e||!t)return;const C=z(t,n,y);x(C,{onSuccess:s=>{Z({data:s,virtualMcpId:t,branch:n,setCurrentTaskBranch:p,setSeededPreviewUrl:R})},onError:s=>{console.error("[sandbox-lifecycle] user start failed:",s)}})},q=async()=>{if(!(!e||!t||!n)&&c){le.mark(t,n);try{await X.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}ee(ne)}},J=async()=>{await q(),N()},B=()=>{I.current=new Set,T.current=null,v({branch:n,count:0,handled:!1}),H(),N()},ue={branch:n,previewState:_,status:L,vmEntry:c,previewUrl:M,userStopped:P,start:N,stop:q,restart:J,retry:B,resume:B};return Re.jsx(Ae,{value:ue,children:V})}export{et as S,xt as a,vt as b,Tt as c,Ke as d,qe as e,gt as f,bt as g,At as h,Ct as o,wt as s,de as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ak as a,b2 as t,am as e,a_ as c,b1 as d,a$ as p,c6 as m}from"./index-
|
|
1
|
+
import{ak as a,b2 as t,am as e,a_ as c,b1 as d,a$ as p,c6 as m}from"./index-BodvdIMk.js";const s=500;a({title:e().max(s),url:e().max(s),icon:e().max(s)});a({registries:d(e().max(s),a({enabled:t()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:c(e().max(s)).describe("List of MCP app_name or app_id values to hide from the store.")});const i=a({keyId:e().max(s),modelId:e().max(s),title:e().max(s).optional()}).nullable();p(["fast","smart","thinking","image","web_search","deep_research"]);p(["fast","smart","thinking"]);const _=a({tiers:a({fast:i,smart:i,thinking:i,image:i,web_search:i,deep_research:i})});a({tiers:a({fast:i.optional(),smart:i.optional(),thinking:i.optional()})});a({ids:c(e().max(s)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const y=a({home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated commerce (reports) look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a report import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),cms_auto_fresh_branch:t().optional().describe("When a user opens the CMS on a branch whose last commit is older than the staleness window (2 days), move the session to a freshly minted branch cut from the default branch. The stale branch is left intact on GitHub. Off by default.")}),b=new Set(["reviewer_enabled","cheap_reviewer_model"]);function v(n,r){const h=n?.[r];return b.has(r)?h!==!1:h===!0}function w(n){const r=n?.auto_resolve_conflicts;return typeof r=="boolean"?r:n?.auto_merge===!0}const l=256*1024,u=50,o=500,f=5e3;a({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(f).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:a({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:a({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:c(d(e(),m())).max(u).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:d(e(),m()).nullable().optional().refine(n=>n==null||JSON.stringify(n).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{b as D,y as O,_ as S,w as a,v as o};
|