decocms 4.372.0 → 4.372.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-Ddrj7VUD.js → AlertCircle-DbwtWnTP.js} +1 -1
- package/dist/client/assets/{AreaChart-0mAtLd45.js → AreaChart-tdrxZdfF.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BKbGYh2B.js → ArrowLeft-CyH6aWpS.js} +1 -1
- package/dist/client/assets/{ArrowRight-6hYTENh_.js → ArrowRight-Bv0iX4wy.js} +1 -1
- package/dist/client/assets/{ArrowUp-Dhew3Evs.js → ArrowUp-Scf6R8DX.js} +1 -1
- package/dist/client/assets/{CartesianChart-u2Ri6JFS.js → CartesianChart-D1MxLL7k.js} +1 -1
- package/dist/client/assets/{Check-Dnz3uW0f.js → Check-BZE0WrNL.js} +1 -1
- package/dist/client/assets/{CheckCircle-DQbrJHsr.js → CheckCircle-BKb1RVrA.js} +1 -1
- package/dist/client/assets/{ChevronRight-DK_MoZ-7.js → ChevronRight-DNrwFBnC.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-B64gqtde.js → ChevronSelectorVertical-oXn0cTzk.js} +1 -1
- package/dist/client/assets/{ChevronUp-XOZg-HiO.js → ChevronUp-D5_IWEtB.js} +1 -1
- package/dist/client/assets/{Copy01-l6PfB431.js → Copy01-DTHuBaTA.js} +1 -1
- package/dist/client/assets/{CreditCard01-DQsLDZWx.js → CreditCard01-CwX6pA0M.js} +1 -1
- package/dist/client/assets/{Database01-vUZciuwF.js → Database01-RGlwXHSd.js} +1 -1
- package/dist/client/assets/{DotsVertical-Dyzdr42E.js → DotsVertical-DE9eZKrJ.js} +1 -1
- package/dist/client/assets/{Download01-_eUxcgg1.js → Download01-qX3hmvr5.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DFc19StE.js → ErrorBarContext-9sp0Dc4M.js} +1 -1
- package/dist/client/assets/{Eye-B7hZLXRZ.js → Eye-DXUjft5i.js} +1 -1
- package/dist/client/assets/{File02-D1W0NjQG.js → File02-g-xJPix_.js} +1 -1
- package/dist/client/assets/{GitBranch01-CRUhFeKk.js → GitBranch01-ddoPQdPH.js} +1 -1
- package/dist/client/assets/{Globe01-D9zr3JIX.js → Globe01-DIy8wXF6.js} +1 -1
- package/dist/client/assets/{HardDrive-7_ZjnLMv.js → HardDrive-DU_z1AQw.js} +1 -1
- package/dist/client/assets/{Image01-7_HSDHV3.js → Image01-DfaxHjlV.js} +1 -1
- package/dist/client/assets/{Key01-ti2CpCiW.js → Key01-mqjfsZRe.js} +1 -1
- package/dist/client/assets/{Line-D9piFifo.js → Line-D02_6GXf.js} +1 -1
- package/dist/client/assets/{Link01-DYWtgbsz.js → Link01-C656VtHx.js} +1 -1
- package/dist/client/assets/{LinkExternal01--55N_6ts.js → LinkExternal01-BkRUjBAn.js} +1 -1
- package/dist/client/assets/{MessageCircle01-DELRsE6A.js → MessageCircle01-CgotMmLL.js} +1 -1
- package/dist/client/assets/{Monitor01-BoIweS2p.js → Monitor01-CQ6Zk1oP.js} +1 -1
- package/dist/client/assets/{Package-CSgBbMFc.js → Package-t6euxYcP.js} +1 -1
- package/dist/client/assets/{Palette-CaHW8y9T.js → Palette-oECS8j3l.js} +1 -1
- package/dist/client/assets/{Play-BolLrTAn.js → Play-DQgzDnaW.js} +1 -1
- package/dist/client/assets/{Plus-C5azC59K.js → Plus-D2HOi_DD.js} +1 -1
- package/dist/client/assets/{Printer-Dn2De3ak.js → Printer-BpZBiqyG.js} +1 -1
- package/dist/client/assets/{SearchLg-BZUR3n9c.js → SearchLg-DbX4T5E-.js} +1 -1
- package/dist/client/assets/{SearchMd-Ms_xvSfF.js → SearchMd-FDCJM3CR.js} +1 -1
- package/dist/client/assets/{Sector-DHu8bCK4.js → Sector-BW9tyobX.js} +1 -1
- package/dist/client/assets/{Settings02-BLcAotUO.js → Settings02-CFcKewXh.js} +1 -1
- package/dist/client/assets/{Share07-BypmcbEF.js → Share07-CxuHcmnM.js} +1 -1
- package/dist/client/assets/{Shield01-C_5dC1mR.js → Shield01-HrKG6yUn.js} +1 -1
- package/dist/client/assets/{Stars01-DTStBsXP.js → Stars01-B_nM3FYf.js} +1 -1
- package/dist/client/assets/{Sun-CEaGM44s.js → Sun-SBoG-e9B.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-l3o5r_PJ.js → SwitchHorizontal01-hHr6GOmU.js} +1 -1
- package/dist/client/assets/{Tool01-C0-Xqkxp.js → Tool01-DHi_Z7zo.js} +1 -1
- package/dist/client/assets/{Tool02-CE2Fqpba.js → Tool02-JY0gm8cg.js} +1 -1
- package/dist/client/assets/{Trash01-DPQmLNZV.js → Trash01-C6bziN5X.js} +1 -1
- package/dist/client/assets/{TrendUp01-uTlAwt0S.js → TrendUp01-Bkdgpfn7.js} +1 -1
- package/dist/client/assets/{Upload01-D-20AdeD.js → Upload01-DC2spim9.js} +1 -1
- package/dist/client/assets/{User01-BA1LEBvQ.js → User01-BbOpA84p.js} +1 -1
- package/dist/client/assets/{UserSquare-D-v_LgOa.js → UserSquare-qgzToKNd.js} +1 -1
- package/dist/client/assets/{Users01-BpRvBK8_.js → Users01-BOsDT0Jv.js} +1 -1
- package/dist/client/assets/{Users03-BaYGM99c.js → Users03-BP-0DNhp.js} +1 -1
- package/dist/client/assets/{X-Dh_K-VDi.js → X-Bzh3NI3m.js} +1 -1
- package/dist/client/assets/{XCircle-BhDUy79p.js → XCircle-CuK2q_XU.js} +1 -1
- package/dist/client/assets/{XClose-Bw0VS-dj.js → XClose-Cvyz3reC.js} +1 -1
- package/dist/client/assets/{Zap-TxetSnv7.js → Zap-DXNovEva.js} +1 -1
- package/dist/client/assets/{ZoomOut-CJKT31Kx.js → ZoomOut-BRjMa-04.js} +1 -1
- package/dist/client/assets/{access-gate-Dt6vr2zi.js → access-gate-NMf18NsK.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Bwzbw2rJ.js → add-connection-dialog-GfufFuLz.js} +1 -1
- package/dist/client/assets/{agent-analytics-OtUj5VAg.js → agent-analytics-DKvARLL3.js} +1 -1
- package/dist/client/assets/agent-app-CQgi_fkJ.js +1 -0
- package/dist/client/assets/{agent-assets-Ds2YrU5Y.js → agent-assets-DePuap3v.js} +1 -1
- package/dist/client/assets/{agent-automation-BzHNBuT4.js → agent-automation-NvLs9ax2.js} +1 -1
- package/dist/client/assets/{agent-automations-BvUPSQUr.js → agent-automations-BV3f-ekl.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-B2VHxv-N.js → agent-connect-sources-DtqgR_Ib.js} +1 -1
- package/dist/client/assets/agent-deck-Dx12NQ18.js +1 -0
- package/dist/client/assets/{agent-e2e-CCN3csfU.js → agent-e2e-CHL03ziT.js} +1 -1
- package/dist/client/assets/{agent-experiments-C1xtDG8f.js → agent-experiments-CWfra8gc.js} +1 -1
- package/dist/client/assets/agent-file-B5qivcOi.js +1 -0
- package/dist/client/assets/{agent-git-O5fnLyKj.js → agent-git-CU-dqFim.js} +1 -1
- package/dist/client/assets/{agent-hosting-ClZ4R70M.js → agent-hosting-x-9xTx9o.js} +1 -1
- package/dist/client/assets/{agent-icon-Cyx7Smko.js → agent-icon-BD4DM2Lv.js} +1 -1
- package/dist/client/assets/agent-library-file-OKK2mnnF.js +1 -0
- package/dist/client/assets/{agent-monitor-B2s_I09z.js → agent-monitor-CpVDwlgY.js} +1 -1
- package/dist/client/assets/{agent-overview-CLGjxUwU.js → agent-overview-SQDEg6Zv.js} +1 -1
- package/dist/client/assets/agent-settings-BraxsXkL.js +1 -0
- package/dist/client/assets/{agent-site-editor-DElX-Rtx.js → agent-site-editor-BXrb3i4T.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-03I9o24S.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-D8Swy0HF.js → agent-site-editor-content-C3uy2bqp.js} +2 -2
- package/dist/client/assets/{agent-site-editor-preview-BEkJn_qI.js → agent-site-editor-preview-BB-KqzfI.js} +3 -3
- package/dist/client/assets/agent-view-74_Cuyp8.js +1 -0
- package/dist/client/assets/{agent-view-guard-Cc93o9kZ.js → agent-view-guard-q_9RifUL.js} +1 -1
- package/dist/client/assets/{agents-list-D23HRLNK.js → agents-list-BCgsEzHh.js} +1 -1
- package/dist/client/assets/{ai-providers-AQKJLPCp.js → ai-providers-DGgtE9F7.js} +1 -1
- package/dist/client/assets/{alert-Bb5psHaZ.js → alert-Cnsh1M35.js} +1 -1
- package/dist/client/assets/{alert-dialog-DfGZ77rh.js → alert-dialog-Bi9Cy1y8.js} +1 -1
- package/dist/client/assets/{api-keys-7xk7B181.js → api-keys-BlYGdiam.js} +1 -1
- package/dist/client/assets/api-keys-ClN6LoeU.js +1 -0
- package/dist/client/assets/app-editor-CaCDGdiz.js +1 -0
- package/dist/client/assets/{asset-utils-Dl8tpNxx.js → asset-utils-syVIRo9d.js} +1 -1
- package/dist/client/assets/{auth-5BCk_I76.js → auth-D-2jYpOE.js} +1 -1
- package/dist/client/assets/{auth-catchall-BXX_QHt4.js → auth-catchall-C3GEml6h.js} +1 -1
- package/dist/client/assets/{auth-entry-BYY2pacz.js → auth-entry-CJhH7CHs.js} +1 -1
- package/dist/client/assets/{auth-split-layout-Bh_B_vjZ.js → auth-split-layout-B3xBkE6i.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bj_Y1vgm.js → authenticate-and-persist-oauth-2yRhuiER.js} +1 -1
- package/dist/client/assets/{automation-list-row-TgtbvSc5.js → automation-list-row-DVPV4sOa.js} +1 -1
- package/dist/client/assets/{automation-runs-CVEQI8qU.js → automation-runs-DnDgp3GT.js} +1 -1
- package/dist/client/assets/automations-XsBsFuGM.js +1 -0
- package/dist/client/assets/{autosend-ClVEnX_S.js → autosend-D-BN-cv5.js} +1 -1
- package/dist/client/assets/{avatar-CR9KEb-s.js → avatar-Duu5Gg02.js} +1 -1
- package/dist/client/assets/{badge-DOT8HE5Z.js → badge-BNBGXxmC.js} +1 -1
- package/dist/client/assets/{block-document-Boj9yYni.js → block-document-BT-7XjFG.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Dh0KsAvE.js → blocks-preview-workspace-context-BvM2Da4n.js} +1 -1
- package/dist/client/assets/{breadcrumb-CVSmj3i3.js → breadcrumb-sWWxibcS.js} +1 -1
- package/dist/client/assets/{buckets-B0FCB4zB.js → buckets-Biauz5yB.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-C9jBTscU.js → build-improve-prompt-doc-RalyChXZ.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-QprmcNHA.js → bulk-category-panel-CODUgRdO.js} +1 -1
- package/dist/client/assets/{calendar-SAWOBJxF.js → calendar-Dyov14Y_.js} +1 -1
- package/dist/client/assets/{capability-load-error-D1mxtMyB.js → capability-load-error-L3ivCxmO.js} +1 -1
- package/dist/client/assets/{cards-DQPi8IW_.js → cards-ojW-Mo-n.js} +1 -1
- package/dist/client/assets/category-editor-CFCxetoB.js +1 -0
- package/dist/client/assets/{chart-BGm-AILS.js → chart-Con9xnVz.js} +1 -1
- package/dist/client/assets/{chat-context-H28jTcB6.js → chat-context-BBVkwd3p.js} +1 -1
- package/dist/client/assets/{chat-draft-BTIUwp87.js → chat-draft-bAtYgASI.js} +1 -1
- package/dist/client/assets/{checkbox-D_GODf3h.js → checkbox-Dkejdmst.js} +1 -1
- package/dist/client/assets/{choose-editor-CqXPKhwg.js → choose-editor-BKF6XAA7.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Nkuy_2dv.js → cli-auth-success-BUl2RZMr.js} +1 -1
- package/dist/client/assets/{client-icons-D55uOktL.js → client-icons-DLMNndDc.js} +1 -1
- package/dist/client/assets/{collapsible-CkoFdRnK.js → collapsible-n44mVpiB.js} +1 -1
- package/dist/client/assets/{collection-detail-7A7zRYv2.js → collection-detail-B7MXGdLU.js} +1 -1
- package/dist/client/assets/{collection-display-button-B730w9Ah.js → collection-display-button-C3iXY6zC.js} +1 -1
- package/dist/client/assets/{collection-search-B2t2IaOK.js → collection-search-CeA9TK20.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-87GtYm7N.js → collection-table-wrapper-SWoJua5h.js} +1 -1
- package/dist/client/assets/{collection-tabs-DAqaNYVU.js → collection-tabs-3kW0qDG6.js} +1 -1
- package/dist/client/assets/{combobox-CA5nnv9O.js → combobox-Px3Uvt7K.js} +1 -1
- package/dist/client/assets/{command-CtFXOSiX.js → command-D2fiEFer.js} +1 -1
- package/dist/client/assets/{command-palette-store-BL5hnWnv.js → command-palette-store-LVCQ6fRv.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DVYB246Y.js → companion-mcps-section-BcoKVpmX.js} +1 -1
- package/dist/client/assets/{connect-F12K-hsA.js → connect-DlipH902.js} +1 -1
- package/dist/client/assets/{connect-layout-DCgHt0wb.js → connect-layout-BQblJmFQ.js} +1 -1
- package/dist/client/assets/{connection-DhRpG43c.js → connection-BfiO32wM.js} +1 -1
- package/dist/client/assets/{connection-card-BCofIpgI.js → connection-card-83VJQMov.js} +1 -1
- package/dist/client/assets/{connection-detail-CkBpJk50.js → connection-detail-j_CvFKhd.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-C7Pc9F54.js → connection-form-helpers-Ms_1nBbP.js} +1 -1
- package/dist/client/assets/{connections-BsBFmd4I.js → connections-CERSp27f.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CYwIBo_O.js → create-organization-dialog-D0myNU26.js} +1 -1
- package/dist/client/assets/{decofile-api-Cdto5FQ3.js → decofile-api-BVqR93jw.js} +1 -1
- package/dist/client/assets/{decopilot-BecreIFq.js → decopilot-72HlEf1U.js} +1 -1
- package/dist/client/assets/{dialog-SKkzdrcZ.js → dialog-DbzCN1O8.js} +1 -1
- package/dist/client/assets/{discover-BWfGXdtB.js → discover-D5kdY2vL.js} +1 -1
- package/dist/client/assets/{domain-settings-ClqqVAOw.js → domain-settings-uVxQd7aQ.js} +1 -1
- package/dist/client/assets/{download-app-dialog-DQE0snIy.js → download-app-dialog-Bsig7tOs.js} +1 -1
- package/dist/client/assets/{drawer-BleKwXKQ.js → drawer-CBdcJytm.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DRuEZVW9.js → dropdown-menu-Dd8nakK9.js} +1 -1
- package/dist/client/assets/{editor-oZAad1yU.js → editor-CpBx0ZCm.js} +1 -1
- package/dist/client/assets/{empty-state-Bi9IU32F.js → empty-state-BIcQyeij.js} +1 -1
- package/dist/client/assets/{empty-state-CaG0BWIR.js → empty-state-ClEXvr10.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C8zB3-0T.js → extract-connection-data-CM8c_Wvw.js} +1 -1
- package/dist/client/assets/{feature-gate-UfjS24Ou.js → feature-gate-BURkiaEd.js} +1 -1
- package/dist/client/assets/{feature-paywall-pQTqQ94T.js → feature-paywall-BOwjYKin.js} +1 -1
- package/dist/client/assets/{file-explorer-s0AeRobY.js → file-explorer-BgbzlNyO.js} +1 -1
- package/dist/client/assets/{file-preview-Dzjub9Lu.js → file-preview-BOFvyeTK.js} +1 -1
- package/dist/client/assets/{file-share-button-BqqM0Upa.js → file-share-button-Doj91OJi.js} +1 -1
- package/dist/client/assets/{file-type-icon-CMiynV8b.js → file-type-icon-C37FwvPU.js} +1 -1
- package/dist/client/assets/{folder-icon-3FCd-eRP.js → folder-icon-Dox5xEXV.js} +1 -1
- package/dist/client/assets/{form-H9AoFazU.js → form-B7dtslOD.js} +1 -1
- package/dist/client/assets/{gateway-client-BQS5H6XZ.js → gateway-client-CFIpVRaR.js} +1 -1
- package/dist/client/assets/{general-st9zEmU7.js → general-BcnikUr3.js} +1 -1
- package/dist/client/assets/{github-icon-TtZ8EUXE.js → github-icon-BcrkxW36.js} +1 -1
- package/dist/client/assets/{home-DMdfBPme.js → home-MrzklFP0.js} +1 -1
- package/dist/client/assets/{hooks-D5z7CgCt.js → hooks-CkL4R3Tj.js} +1 -1
- package/dist/client/assets/{hooks-abtcLONn.js → hooks-D09Ti1PG.js} +1 -1
- package/dist/client/assets/{index-C-9h82SA.js → index-B46P4HkV.js} +1 -1
- package/dist/client/assets/{index-BC68yJ9a.js → index-BFjKFLU3.js} +1 -1
- package/dist/client/assets/{index-DAUnTbKR.js → index-BwuwoN1w.js} +1 -1
- package/dist/client/assets/{index-C1pofvkl.js → index-C9w15wdL.js} +1 -1
- package/dist/client/assets/{index-BQgXOHRB.js → index-CULK6hDm.js} +1 -1
- package/dist/client/assets/{index-Cm__CFgO.js → index-CuiP-22D.js} +1 -1
- package/dist/client/assets/{index-CdCU_XIc.js → index-Cyoz5tz5.js} +1 -1
- package/dist/client/assets/{index-Os5Hiv1r.js → index-D-XXgZ8p.js} +1 -1
- package/dist/client/assets/{index-tw-L0pq4.js → index-D68Q2TT2.js} +1 -1
- package/dist/client/assets/{index-CHIEfkY6.js → index-DLxUQ-f9.js} +1 -1
- package/dist/client/assets/{index-C4m-Xj9t.js → index-DZOe0ODJ.js} +1 -1
- package/dist/client/assets/{index-CZFOUXi8.js → index-G9Ugx8pT.js} +1 -1
- package/dist/client/assets/{index-soiZgi77.js → index-KOGfrBZR.js} +1 -1
- package/dist/client/assets/{index-CoJzC8_g.js → index-NrvdR10n.js} +1 -1
- package/dist/client/assets/{index-redirect-BGMUaELH.js → index-redirect-AuU1lkcv.js} +1 -1
- package/dist/client/assets/{index-Cjhl57C5.js → index-z4bKt11m.js} +2 -2
- package/dist/client/assets/{infiniteQueryObserver-CTAqrRzL.js → infiniteQueryObserver-BjcfJE2O.js} +1 -1
- package/dist/client/assets/{infra-billing-D-R9Zdx8.js → infra-billing-Blv1R6xm.js} +1 -1
- package/dist/client/assets/{input-CImpk8th.js → input-C7XH8Uj_.js} +1 -1
- package/dist/client/assets/{input-DkPDVfFk.js → input-CSQboV8k.js} +1 -1
- package/dist/client/assets/{input-DNp0K9zv.js → input-I71U33T1.js} +1 -1
- package/dist/client/assets/{integration-icon-Dq1cJDX8.js → integration-icon-DOHTaQ6D.js} +1 -1
- package/dist/client/assets/{label-Bk7iLZH7.js → label-8juC5J-g.js} +1 -1
- package/dist/client/assets/{last-preview-page-BmfL1c7N.js → last-preview-page-C8M_ayBL.js} +1 -1
- package/dist/client/assets/{layout-Ci3akdxf.js → layout-fdXIUmGR.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CqdHGYTA.js → legacy-agents-deep-CIQ2cOBs.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BqiddEXn.js → legacy-main-redirect-DdrzU7Xj.js} +1 -1
- package/dist/client/assets/{library-BUfXzmmk.js → library-DyrbEVfm.js} +1 -1
- package/dist/client/assets/{login-BUL2HRoD.js → login-BhC3su0G.js} +1 -1
- package/dist/client/assets/{markdown-Cqyyk371.js → markdown-BhLIBmBv.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-zIU2-SQD.js → mcp-app-renderer-DjwQ0S-h.js} +1 -1
- package/dist/client/assets/{mcp-oauth-qvcFIOHE.js → mcp-oauth-DiqQlKOx.js} +1 -1
- package/dist/client/assets/{members-B2ASFRpM.js → members-PF8wxsqA.js} +1 -1
- package/dist/client/assets/{message-templates-BvJNSKe2.js → message-templates-BvR8vQvs.js} +1 -1
- package/dist/client/assets/{mini-report-page-GL8Uh_Lo.js → mini-report-page-D2etEugE.js} +1 -1
- package/dist/client/assets/{mock-board-D2--sNwu.js → mock-board-jCiKK3gA.js} +3 -3
- package/dist/client/assets/{monaco-editor-Bg8UPXit.js → monaco-editor-BHu8MLvz.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-C9igDEpY.js → monitoring-stats-row-2QEp_Jld.js} +1 -1
- package/dist/client/assets/{multi-select-B0yDI0nj.js → multi-select-DcF09HV8.js} +1 -1
- package/dist/client/assets/{mustache-CDAsLK2v.js → mustache-DtVu96DY.js} +1 -1
- package/dist/client/assets/{oauth-callback-D8Lk8lTx.js → oauth-callback-CwSlt3mo.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-P1E8_NRm.js → oauth-callback-ai-provider-Co0a0HMU.js} +1 -1
- package/dist/client/assets/{onboarding-Df5HIECJ.js → onboarding-D-ej0NPt.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-IR0sppyV.js → optimistic-project-sidebar-views-yjPJnhEG.js} +1 -1
- package/dist/client/assets/{org-file-open-context-Dd47NmeH.js → org-file-open-context-BgiBbqKQ.js} +1 -1
- package/dist/client/assets/{organization-choice-B_XEkc76.js → organization-choice-loyQwhEZ.js} +1 -1
- package/dist/client/assets/{orgs-BAOnfPU8.js → orgs-DkENMfud.js} +1 -1
- package/dist/client/assets/{page-seo-form-DbL4-FYa.js → page-seo-form-BBCLz5m0.js} +1 -1
- package/dist/client/assets/{pair-BHYz9F-Z.js → pair-B2TMNGEX.js} +1 -1
- package/dist/client/assets/{plan-ladder-Cqfgwdfc.js → plan-ladder-C80Qcxkm.js} +1 -1
- package/dist/client/assets/{popover-Bn0xXLy8.js → popover-CsEsUqbZ.js} +1 -1
- package/dist/client/assets/{post-calendar-6AuB-9GD.js → post-calendar-gswoVxcp.js} +1 -1
- package/dist/client/assets/{post-editor-D6gFXTiI.js → post-editor-5tYPjO0c.js} +1 -1
- package/dist/client/assets/{preview-content-BJK2rc2w.js → preview-content-D5E6-qEP.js} +1 -1
- package/dist/client/assets/{preview-dialog-CdfWw2XK.js → preview-dialog-D1qWdONG.js} +1 -1
- package/dist/client/assets/{primitives-CSJauIt5.js → primitives-Dy5hA1_y.js} +1 -1
- package/dist/client/assets/{profile-BUYSJtW_.js → profile-9GEyG1R7.js} +1 -1
- package/dist/client/assets/{project-app-view-BAHsn_eP.js → project-app-view-CsjjG0iu.js} +1 -1
- package/dist/client/assets/{project-feed-La6-iUzD.js → project-feed-CEhr0jA4.js} +1 -1
- package/dist/client/assets/{project-icon-CiuTzDLi.js → project-icon-Cw3la58q.js} +1 -1
- package/dist/client/assets/project-reports-D83XbTn5.js +1 -0
- package/dist/client/assets/project-tasks-IrwgrDaD.js +1 -0
- package/dist/client/assets/{prompts-BAZWbRxz.js → prompts-DQaXCBzS.js} +1 -1
- package/dist/client/assets/record-editor-C02fIlfV.js +1 -0
- package/dist/client/assets/{redirect-editor-9oPfVcJw.js → redirect-editor-B2uGI7FY.js} +1 -1
- package/dist/client/assets/registry-CORfkc_Z.js +2 -0
- package/dist/client/assets/{registry-layout-CrG4EYUR.js → registry-layout-tJiz4Tt0.js} +1 -1
- package/dist/client/assets/{reports-DHS4fi6t.js → reports-DvgXBdzM.js} +1 -1
- package/dist/client/assets/reports-X2I2m9Nu.js +1 -0
- package/dist/client/assets/{reports-onboarding-BtdzeKZT.js → reports-onboarding-BLUSVbkd.js} +1 -1
- package/dist/client/assets/{reports-tab-B5bMQgk-.js → reports-tab-DSknxHUH.js} +2 -2
- package/dist/client/assets/{repositories-DbRCe9LF.js → repositories-cOMgIGPf.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Bo_Cabzz.js → repository-import-picker-C0YugeGx.js} +1 -1
- package/dist/client/assets/{repository-picker-CRqY_3jm.js → repository-picker-BaqWNwxf.js} +1 -1
- package/dist/client/assets/{require-capability-CLz-loNQ.js → require-capability-CjU7EXPP.js} +1 -1
- package/dist/client/assets/{required-auth-layout-t1gcmOkS.js → required-auth-layout-WkX8CtfT.js} +1 -1
- package/dist/client/assets/{reset-password-C_PBrpSa.js → reset-password-FnA2kczZ.js} +1 -1
- package/dist/client/assets/{resizable-CTEnH3yu.js → resizable-7umHaFcH.js} +1 -1
- package/dist/client/assets/{review-settings-CIZvhdQE.js → review-settings-BHAkNdHq.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-DdZo0zBm.js → rich-text-link-control-DgGIjR0I.js} +1 -1
- package/dist/client/assets/{roles-D7Yxadr5.js → roles-iNTzpIoS.js} +1 -1
- package/dist/client/assets/{route-DMLSQe3Y.js → route-BdFq2Icl.js} +1 -1
- package/dist/client/assets/{route-aV7nBxG9.js → route-D2mgsDfh.js} +1 -1
- package/dist/client/assets/{route-BhbKY_6m.js → route-DQ3O_pQ7.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-CNau3nKH.js → runnable-block-editor-CCXhy-vO.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-Dhs5hLj1.js → sandbox-lifecycle-context-DL9kkwoa.js} +1 -1
- package/dist/client/assets/{schema-BTHH8GSh.js → schema-D0xfowSf.js} +1 -1
- package/dist/client/assets/{scroll-area-YQLTU6PQ.js → scroll-area-BqCCUXvj.js} +1 -1
- package/dist/client/assets/{search-input-Cx2Izgwg.js → search-input-DpLbMQRj.js} +1 -1
- package/dist/client/assets/{secrets-B1YWh_ht.js → secrets-B9E8fieV.js} +1 -1
- package/dist/client/assets/{sections-editor-C4NhZuXp.js → sections-editor-D24EQfD8.js} +1 -1
- package/dist/client/assets/{select-C5Qbx8Kw.js → select-cIekAVlM.js} +1 -1
- package/dist/client/assets/{select-model-CIR4DebA.js → select-model-DcwphIdD.js} +1 -1
- package/dist/client/assets/{seo-editor-b4BYh3S0.js → seo-editor-BRYLT6tF.js} +1 -1
- package/dist/client/assets/{settings-tab-wJidOo3Q.js → settings-tab-DKZf7OJg.js} +1 -1
- package/dist/client/assets/{sheet-DvqFDAlT.js → sheet-DhNzwMUj.js} +1 -1
- package/dist/client/assets/{shell-layout-knqcStSb.js → shell-layout-DMJSwXH6.js} +1 -1
- package/dist/client/assets/{sidebar-CPIvGktg.js → sidebar-BCim0GYP.js} +1 -1
- package/dist/client/assets/{skill-preview-Dr3uDA0q.js → skill-preview-eH_MzYft.js} +1 -1
- package/dist/client/assets/{skills-B7mrIhFJ.js → skills-BtiwGp2Q.js} +1 -1
- package/dist/client/assets/{sso-JfSG6sY-.js → sso-BOpSC7cb.js} +1 -1
- package/dist/client/assets/{store-CRU_7Bvk.js → store-DmrioYP8.js} +1 -1
- package/dist/client/assets/store-registry-B398fyC0.js +2 -0
- package/dist/client/assets/{switch-Cf30aXkY.js → switch-9PLadaw_.js} +1 -1
- package/dist/client/assets/{synced-repos-C5RH3GVW.js → synced-repos-gfJnKqre.js} +1 -1
- package/dist/client/assets/{table-D6IMkB4T.js → table-B6mPp07a.js} +1 -1
- package/dist/client/assets/{tabs-DSOAK--9.js → tabs-Co2GUrNY.js} +1 -1
- package/dist/client/assets/{task-board-DpuhnKzF.js → task-board-lQZGfEfb.js} +1 -1
- package/dist/client/assets/{task-route-CPm3yGLT.js → task-route-Btltx00G.js} +1 -1
- package/dist/client/assets/{task-status-CesK2f9G.js → task-status-CLlOhQGx.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-DWWMZZdU.js → taskboard-analytics-CCRKXVH2.js} +1 -1
- package/dist/client/assets/tasks-BqLnbtfB.js +1 -0
- package/dist/client/assets/{tasks-BGbHPX0w.js → tasks-D_kcQmbi.js} +1 -1
- package/dist/client/assets/{textarea-DXDx4Cy0.js → textarea-BEOceSll.js} +1 -1
- package/dist/client/assets/{thread-intent-Cdmdi4Qs.js → thread-intent-9fI0jPLV.js} +1 -1
- package/dist/client/assets/{thread-route-CnHTxNkK.js → thread-route-B1EuqJlg.js} +1 -1
- package/dist/client/assets/{thread-route-BMICHdvv.js → thread-route-DG6kj-ho.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BGNoSu7i.js → thread-sheet-body-CbIiPC8V.js} +1 -1
- package/dist/client/assets/{toggle-group-Cj0z3PRY.js → toggle-group-Ck5f9XVv.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BehOLAeE.js → toolbar-icon-button-8ctMGgIP.js} +1 -1
- package/dist/client/assets/{tooltip-BDUrOxgN.js → tooltip-BuKeolDX.js} +1 -1
- package/dist/client/assets/{track-BJHbd99y.js → track-B7aLvyYR.js} +1 -1
- package/dist/client/assets/{types-DlfDRNRB.js → types-Bh4jNqv3.js} +1 -1
- package/dist/client/assets/{usage-stats-nuoZXpxw.js → usage-stats-waRf4dtg.js} +1 -1
- package/dist/client/assets/{use-ai-providers-QvFz5SFX.js → use-ai-providers-B0bxSHYG.js} +1 -1
- package/dist/client/assets/{use-automations-jwtTHLHf.js → use-automations-BdS9yl-d.js} +1 -1
- package/dist/client/assets/{use-autosave-D5Khb0ju.js → use-autosave-CfERN5UF.js} +1 -1
- package/dist/client/assets/{use-connect-companion-DDWKSdwn.js → use-connect-companion-_GDNSGRN.js} +1 -1
- package/dist/client/assets/{use-connection-CpOBycNm.js → use-connection-CPQUKm0a.js} +1 -1
- package/dist/client/assets/{use-copy-M0GDas2Q.js → use-copy-DUiBegp6.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BFxHh87r.js → use-create-virtual-mcp-BRT9hKZ3.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BAJylOmL.js → use-date-fns-locale-PFUAQIxr.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CAXyZd0j.js → use-debounced-autosave-CyDohN_c.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CVkWNti9.js → use-debounced-value-DeY1TNRX.js} +1 -1
- package/dist/client/assets/{use-deco-credits-D4THYOkS.js → use-deco-credits-Du6WCMYS.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DlUI-60k.js → use-decopilot-events-_O_0AHeH.js} +1 -1
- package/dist/client/assets/{use-delete-connection-BznnJgfw.js → use-delete-connection-kqt66yqS.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Buoxj9IO.js → use-deployment-admin-MznxNIiy.js} +1 -1
- package/dist/client/assets/{use-entitlements-BP7WwVM_.js → use-entitlements-BWaaNeuI.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Cu15Ye_n.js → use-fast-preview-draft-url-BrZtKg6o.js} +1 -1
- package/dist/client/assets/{use-file-configs-CyU7Mcil.js → use-file-configs-sqbLS09v.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-AtjP0SZW.js → use-infinite-scroll-RrOnf-fI.js} +1 -1
- package/dist/client/assets/{use-join-requests-aG0T3ECI.js → use-join-requests-BZzsbvb0.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-IIO818_j.js → use-main-panel-tabs-CyT7yQAB.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-bcJwzpw7.js → use-mcp-auth-status-DvQCYJw0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Bf0VpOBw.js → use-mcp-client-B1u2B39v.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-DxcgJEJ7.js → use-mcp-prompts-DxT8Kz-M.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DhZM9sTC.js → use-mcp-tools-Ch_j97A3.js} +1 -1
- package/dist/client/assets/{use-members-CsAzsmBA.js → use-members-H3oi0qPu.js} +1 -1
- package/dist/client/assets/{use-mobile-C5SrWG9H.js → use-mobile-CV7f0Wqe.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-DOYg6fyU.js → use-navigate-to-agent-BMSyO1iB.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-Cjz--xRu.js → use-open-billing-url-BGn9Wkis.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C16MEGGe.js → use-org-auth-client-ZxEGrzhh.js} +1 -1
- package/dist/client/assets/{use-org-fs-BSDHmLev.js → use-org-fs-D6lKuMAi.js} +1 -1
- package/dist/client/assets/{use-org-notice-BALWnbFe.js → use-org-notice-C5thI8aD.js} +1 -1
- package/dist/client/assets/{use-org-sso-Dpa7KwXX.js → use-org-sso-vHIufIoJ.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cog-K9KN.js → use-organization-roles-DmWmnvDm.js} +1 -1
- package/dist/client/assets/{use-organization-settings-pqtCEzuj.js → use-organization-settings-C-XY0Wze.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-bhAOxlzp.js → use-panel-navigate-BG4d0Vrr.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DnirX6kM.js → use-project-native-view-presence-0NQTfFQT.js} +1 -1
- package/dist/client/assets/{use-project-scope-BfeOcOX-.js → use-project-scope-DRope0ob.js} +1 -1
- package/dist/client/assets/{use-registry-connections-BJotyFay.js → use-registry-connections-D_a0MIjQ.js} +1 -1
- package/dist/client/assets/{use-releases-CjPEhpWE.js → use-releases-BPrtCiPS.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-R9_oa5XU.js → use-reports-diagnostic-BtS3SpeX.js} +1 -1
- package/dist/client/assets/{use-route-default-main-DO9nAIOF.js → use-route-default-main-DBXt2fvS.js} +1 -1
- package/dist/client/assets/{use-secrets-Do9S2OuA.js → use-secrets-C5iKdreo.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DTsnvRL8.js → use-section-preview-base-Dwn5dF7B.js} +1 -1
- package/dist/client/assets/{use-session-runtime--RMOkDN5.js → use-session-runtime-DU2zS-3V.js} +1 -1
- package/dist/client/assets/{use-tags-C-xYWG0d.js → use-tags-BvskEBAC.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DqKWhXe3.js → use-task-board-analytics-DjIJHPkR.js} +1 -1
- package/dist/client/assets/{use-task-metadata-Bm567Cyu.js → use-task-metadata-9gheSHac.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DA9fNv-d.js → use-thread-outputs-DAcljy5D.js} +1 -1
- package/dist/client/assets/{use-view-mode-mEqX4oRI.js → use-view-mode-CTt0Tykp.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-BvrPyGzX.js → use-virtual-mcp-Bq1RMGPF.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-C6OBOha-.js +1 -0
- package/dist/client/assets/{useQueries-DqQ6INqi.js → useQueries-DMqJmHGu.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-XFcbI_PD.js +1 -0
- package/dist/client/assets/{users-BS3mOvNq.js → users-B0Y-7Aab.js} +1 -1
- package/dist/client/assets/{utils-DAYUNxCI.js → utils-CU3t1jst.js} +1 -1
- package/dist/client/assets/{variant-calendar-D_T3c3MC.js → variant-calendar-Bp201sXA.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BSFlzIhP.js → variant-matcher-override-DUPu0vkW.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CzqFE_Lp.js → view-mode-toggle-DaZN0qXY.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CG3JbZx8.js → virtual-mcp-BYPZngzy.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +118 -118
- package/dist/server/server.js +114 -114
- package/package.json +1 -1
- package/dist/client/assets/agent-app-huXdhJP6.js +0 -1
- package/dist/client/assets/agent-deck-DGboeeyf.js +0 -1
- package/dist/client/assets/agent-file-B8pH22Ku.js +0 -1
- package/dist/client/assets/agent-library-file-D-88nLF8.js +0 -1
- package/dist/client/assets/agent-settings-BzADpWtq.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CGdhTJXE.js +0 -2
- package/dist/client/assets/agent-view-BZUeqD_l.js +0 -1
- package/dist/client/assets/api-keys-DfV1qFa5.js +0 -1
- package/dist/client/assets/app-editor-CK2-PFMD.js +0 -1
- package/dist/client/assets/automations-CfjjbeEx.js +0 -1
- package/dist/client/assets/category-editor-CG20ku6V.js +0 -1
- package/dist/client/assets/project-reports-jZGDkYDU.js +0 -1
- package/dist/client/assets/project-tasks-BDg0EJtT.js +0 -1
- package/dist/client/assets/record-editor-C96ND1CU.js +0 -1
- package/dist/client/assets/registry-rXZoWB8a.js +0 -2
- package/dist/client/assets/reports-C9YET_Fq.js +0 -1
- package/dist/client/assets/store-registry-Q0TOzx2-.js +0 -2
- package/dist/client/assets/tasks-DTqkQgJb.js +0 -1
- package/dist/client/assets/useInfiniteQuery-C-lwb5Ji.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CjJ_vWiS.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ue,b as pe,j as o,a5 as Ae,B as le,eC as Te,M as ge,W as Le,a as we,n as Se,r as O,d8 as Ee,m as Fe,K as je,e as ke,o as U,t as fe,l as Pe,x as Ge,ao as Me,P as de}from"./index-Cjhl57C5.js";import{a as ce,b as _e,D as he,c as xe}from"./dropdown-menu-DRuEZVW9.js";import{i as Oe}from"./GitBranch01-CRUhFeKk.js";import{b as Re}from"./Users03-BaYGM99c.js";import{b as ze,c as Ue,g as $e}from"./use-virtual-mcp-BvrPyGzX.js";import{i as Be}from"./DotsVertical-Dyzdr42E.js";import{a as Ve}from"./Settings02-BLcAotUO.js";import{s as He}from"./Trash01-DPQmLNZV.js";import{A as Ke,bd as Qe}from"./agent-icon-Cyx7Smko.js";import{u as qe,f as Ce}from"./use-date-fns-locale-BAJylOmL.js";import{u as ve}from"./use-navigate-to-agent-DOYg6fyU.js";import{n as Ye}from"./use-organization-settings-pqtCEzuj.js";import{E as We}from"./empty-state-Bi9IU32F.js";import{u as Je}from"./use-create-virtual-mcp-BFxHh87r.js";import{b as Xe,u as Ze}from"./use-connection-CpOBycNm.js";import{u as be}from"./use-mcp-client-Bf0VpOBw.js";import{a as et}from"./authenticate-and-persist-oauth-Bj_Y1vgm.js";import{c as tt}from"./use-mcp-tools-DhZM9sTC.js";import{e as ot}from"./extract-connection-data-C8zB3-0T.js";import{f as st,g as rt}from"./thread-intent-Cdmdi4Qs.js";import{a as it}from"./github-repo-scope-C8GSbvaz.js";import{f as nt,a as lt,G as at,p as ct}from"./provision-repo-scoped-github-connection-B6zdkC6p.js";import{D as mt,b as dt,c as ut,d as pt,e as gt}from"./dialog-SKkzdrcZ.js";import{i as ft}from"./ArrowLeft-BKbGYh2B.js";import{C as ht}from"./collection-search-B2t2IaOK.js";import{G as xt}from"./github-icon-TtZ8EUXE.js";import{A as bt,a as jt,b as Ct,c as Dt,g as yt,d as wt,e as St,f as _t}from"./alert-dialog-DfGZ77rh.js";import{S as vt}from"./search-input-Cx2Izgwg.js";import{s as De}from"./Plus-C5azC59K.js";import{R as Nt}from"./repository-import-picker-Bo_Cabzz.js";import{u as It}from"./use-debounced-value-CVkWNti9.js";import"./Check-Dnz3uW0f.js";import"./ChevronRight-DK_MoZ-7.js";import"./AlertCircle-Ddrj7VUD.js";import"./Tool01-C0-Xqkxp.js";import"./ArrowUp-Dhew3Evs.js";import"./Tool02-CE2Fqpba.js";import"./ArrowRight-6hYTENh_.js";import"./TrendUp01-uTlAwt0S.js";import"./ZoomOut-CJKT31Kx.js";import"./CheckCircle-DQbrJHsr.js";import"./ChevronUp-XOZg-HiO.js";import"./ChevronSelectorVertical-B64gqtde.js";import"./UserSquare-D-v_LgOa.js";import"./Copy01-l6PfB431.js";import"./CreditCard01-DQsLDZWx.js";import"./Database01-vUZciuwF.js";import"./MessageCircle01-DELRsE6A.js";import"./Download01-_eUxcgg1.js";import"./Printer-Dn2De3ak.js";import"./Eye-B7hZLXRZ.js";import"./File02-D1W0NjQG.js";import"./Share07-BypmcbEF.js";import"./Globe01-D9zr3JIX.js";import"./SwitchHorizontal01-l3o5r_PJ.js";import"./HardDrive-7_ZjnLMv.js";import"./Image01-7_HSDHV3.js";import"./Key01-ti2CpCiW.js";import"./Link01-DYWtgbsz.js";import"./LinkExternal01--55N_6ts.js";import"./Monitor01-BoIweS2p.js";import"./Sun-CEaGM44s.js";import"./Package-CSgBbMFc.js";import"./Palette-CaHW8y9T.js";import"./Play-BolLrTAn.js";import"./SearchLg-BZUR3n9c.js";import"./SearchMd-Ms_xvSfF.js";import"./Shield01-C_5dC1mR.js";import"./Stars01-DTStBsXP.js";import"./Upload01-D-20AdeD.js";import"./User01-BA1LEBvQ.js";import"./Users01-BpRvBK8_.js";import"./XCircle-BhDUy79p.js";import"./XClose-Bw0VS-dj.js";import"./X-Dh_K-VDi.js";import"./Zap-TxetSnv7.js";import"./differenceInSeconds-C3x8sHUj.js";import"./hooks-D5z7CgCt.js";import"./backoff-8mStPHYB.js";import"./task-board-DpuhnKzF.js";import"./schema-BTHH8GSh.js";import"./github-repo-BknN0SVI.js";import"./auth-5BCk_I76.js";import"./mcp-oauth-qvcFIOHE.js";import"./metadata-dUsYcpuu.js";import"./github-D4UJ99TO.js";import"./connection-DhRpG43c.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-CRqY_3jm.js";import"./tooltip-BDUrOxgN.js";import"./index-C-9h82SA.js";import"./input-CImpk8th.js";import"./label-Bk7iLZH7.js";import"./useInfiniteQuery-C-lwb5Ji.js";import"./infiniteQueryObserver-CTAqrRzL.js";import"./avatar-CR9KEb-s.js";function ye(t){const e=ue.c(26),{onCreateFromScratch:s,onImportGitHub:r,onImportDeco:n,isCreating:h,align:p,side:y,showBetaBadge:m,showDecoImport:b}=t,j=p===void 0?"end":p,u=pe();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Re,{size:14}),e[0]=g):g=e[0];let f;e[1]!==u?(f=u("common.createAgentDropdown.createFromScratch"),e[1]=u,e[2]=f):f=e[2];let x;e[3]!==h||e[4]!==s||e[5]!==f?(x=o.jsxs(ce,{disabled:h,onClick:s,children:[g,f]}),e[3]=h,e[4]=s,e[5]=f,e[6]=x):x=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Oe,{className:"size-3.5"}),e[7]=C):C=e[7];let c;e[8]!==u?(c=u("common.createAgentDropdown.importFromGitHub"),e[8]=u,e[9]=c):c=e[9];let l;e[10]!==m?(l=m&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=m,e[11]=l):l=e[11];let a;e[12]!==r||e[13]!==c||e[14]!==l?(a=o.jsxs(ce,{onClick:r,children:[C,c,l]}),e[12]=r,e[13]=c,e[14]=l,e[15]=a):a=e[15];let d;e[16]!==n||e[17]!==b||e[18]!==u?(d=b&&o.jsxs(ce,{onClick:n,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),u("common.createAgentDropdown.importFromDeco")]}),e[16]=n,e[17]=b,e[18]=u,e[19]=d):d=e[19];let D;return e[20]!==j||e[21]!==y||e[22]!==x||e[23]!==a||e[24]!==d?(D=o.jsxs(_e,{side:y,align:j,className:"w-48",children:[x,a,d]}),e[20]=j,e[21]=y,e[22]=x,e[23]=a,e[24]=d,e[25]=D):D=e[25],D}function At(t){const e=ue.c(50),{project:s,lastUsedAt:r,onDeleteClick:n}=t,h=ve(),p=pe(),y=qe(),m=s.metadata?.ui?.layout;let b;e[0]!==m?(b=Ae(m),e[0]=m,e[1]=b):b=e[1];const j=b;let u;e[2]!==j||e[3]!==h||e[4]!==s.id?(u=()=>h(s.id,{panel:j}),e[2]=j,e[3]=h,e[4]=s.id,e[5]=u):u=e[5];let g;e[6]!==s.title||e[7]!==u?(g=o.jsx("button",{type:"button",onClick:u,className:"absolute inset-0 z-0","aria-label":s.title}),e[6]=s.title,e[7]=u,e[8]=g):g=e[8];let f;e[9]!==s.icon||e[10]!==s.title?(f=o.jsx(Ke,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[9]=s.icon,e[10]=s.title,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(he,{asChild:!0,children:o.jsx(le,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Be,{size:20})})}),e[12]=x):x=e[12];let C;e[13]!==h||e[14]!==s.id?(C=()=>h(s.id,{panel:"settings"}),e[13]=h,e[14]=s.id,e[15]=C):C=e[15];let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Ve,{size:16}),e[16]=c):c=e[16];let l;e[17]!==C?(l=o.jsxs(ce,{onClick:C,children:[c,"Settings"]}),e[17]=C,e[18]=l):l=e[18];let a;e[19]!==n?(a=n&&o.jsxs(ce,{variant:"destructive",onClick:i=>{i.stopPropagation(),n(i)},children:[o.jsx(He,{size:16}),"Delete"]}),e[19]=n,e[20]=a):a=e[20];let d;e[21]!==a||e[22]!==l?(d=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(xe,{children:[x,o.jsxs(_e,{align:"end",children:[l,a]})]})}),e[21]=a,e[22]=l,e[23]=d):d=e[23];let D;e[24]!==d||e[25]!==f?(D=o.jsxs("div",{className:"flex items-start justify-between",children:[f,d]}),e[24]=d,e[25]=f,e[26]=D):D=e[26];let w;e[27]!==s.title?(w=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),e[27]=s.title,e[28]=w):w=e[28];const K=s.description||"No description";let S;e[29]!==K?(S=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:K}),e[29]=K,e[30]=S):S=e[30];let G;e[31]!==w||e[32]!==S?(G=o.jsxs("div",{className:"flex flex-col gap-1",children:[w,S]}),e[31]=w,e[32]=S,e[33]=G):G=e[33];let N;e[34]!==D||e[35]!==G?(N=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[D,G]}),e[34]=D,e[35]=G,e[36]=N):N=e[36];let T;e[37]!==r||e[38]!==y||e[39]!==s.updated_at||e[40]!==p?(T=r?p("home.projectCard.lastUsed",{time:Ce(new Date(r),{addSuffix:!0,locale:y})}):p("home.projectCard.updated",{time:Ce(new Date(s.updated_at),{addSuffix:!0,locale:y})}),e[37]=r,e[38]=y,e[39]=s.updated_at,e[40]=p,e[41]=T):T=e[41];let L;e[42]!==T?(L=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[42]=T,e[43]=L):L=e[43];let I;e[44]!==N||e[45]!==L?(I=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[N,L]}),e[44]=N,e[45]=L,e[46]=I):I=e[46];let _;return e[47]!==I||e[48]!==g?(_=o.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[g,I]}),e[47]=I,e[48]=g,e[49]=_):_=e[49],_}function Tt(t,e){const s=ue.c(12),{org:r}=ge();let n;s[0]!==r.id?(n=Le.REGISTRY(r.id),s[0]=r.id,s[1]=n):n=s[1];const h=n;let p;s[2]!==r.id||s[3]!==r.slug||s[4]!==h?(p={connectionId:h,orgId:r.id,orgSlug:r.slug},s[2]=r.id,s[3]=r.slug,s[4]=h,s[5]=p):p=s[5];const y=be(p);let m;s[6]!==t?(m={name:t},s[6]=t,s[7]=m):m=s[7];const b=e?.enabled??!0;let j;return s[8]!==y||s[9]!==m||s[10]!==b?(j={client:y,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:m,enabled:b,staleTime:3e5,select:Lt},s[8]=y,s[9]=m,s[10]=b,s[11]=j):j=s[11],tt(j)}function Lt(t){return t.structuredContent?.item??null}const Et="deco/mcp-github";function Ft(t){const{org:e}=ge(),{data:s}=we.useSession(),r=Xe(),n=Se(),[h,p]=O.useState("idle"),[y,m]=O.useState(null),[b,j]=O.useState(null),{data:u,isLoading:g}=Tt(Et,{enabled:t.enabled}),f=O.useRef(!1);t.enabled&&u&&!g&&!f.current&&s?.user?.id&&h==="idle"&&(f.current=!0,x());async function x(){if(!(!u||!s?.user?.id||!e))try{p("installing"),m(null);const c=ot(u,e.id,s.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:a}=await r.create.mutateAsync(c);p("authenticating");const d=await et({connectionId:a,orgId:e.id,orgSlug:e.slug,persistFallback:D=>r.update.mutateAsync({id:a,data:{connection_token:D}}).then(()=>{})});if(d.ran&&!d.ok){try{await r.delete.mutateAsync(a)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}Ee(n,e.id),j(c),p("ready")}catch(c){m(c instanceof Error?c.message:String(c)),p("error")}}function C(){p("idle"),m(null),j(null),f.current=!1}return t.enabled&&g&&h==="idle"?{status:"installing",error:null,connection:null,retry:C}:{status:h,error:y,connection:b,retry:C}}const kt="deco-sites";function Pt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const s=e.owner,r=e.repo;return typeof s!="string"||typeof r!="string"||s.length===0||r.length===0?null:{owner:s,repo:r}}function Gt(t,e){const s=e?Pt(e):null,r=s?.owner??kt,n=s?.repo??t;return{owner:r,name:n,url:`https://github.com/${r}/${n}`}}function Mt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const r=await fetch(t,e),n=await r.json().catch(()=>({}));if(!r.ok)throw new Error(n.error??`${s} (${r.status})`);return n}function Ot(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Rt({open:t,onOpenChange:e,onBack:s}){const r=pe(),{org:n}=ge(),h=ve(),p=Se(),{data:y}=we.useSession(),[m,b]=O.useState(null),[j,u]=O.useState(null),[g,f]=O.useState(""),x=be({connectionId:Ge,orgId:n.id,orgSlug:n.slug}),C=Ze({slug:"mcp-github"}),c=it(C),l=Ft({enabled:t&&c.length===0}),a=c.length===1?c[0]??null:j,d=c.length>1&&!a,D=be({connectionId:a?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:K,isLoading:S,error:G}=Fe({queryKey:je.decoSites(y?.user?.email),queryFn:()=>Ot(n.slug),enabled:t&&!!y?.user?.email,staleTime:6e4,retry:!1}),N=K?.sites??[],T=i=>{i||(b(null),u(null),f("")),e(i)},L=N.filter(i=>i.name.toLowerCase().includes(g.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(g.toLowerCase())??!1)),I=!m||L.some(i=>i.name===m),_=ke({mutationFn:async i=>{if(!a)throw new Error(r("common.importFromDecoDialog.githubNotConnected"));U("deco_site_import_started",{site_name:i});const{installations:P}=await nt(k=>x.callTool(k),a.id),E=N.find(k=>k.name===i);if(!E)throw new Error(r("common.importFromDecoDialog.siteNoLongerAvailable"));const v=Gt(i,E.metadata),F=lt(P,v.owner);if(!F)throw new Error(r("common.importFromDecoDialog.installGithubApp",{owner:v.owner,installUrl:at}));let R=null,Q=null;const ae=async()=>{Q&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:Q}}).catch(()=>{}),R&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:R,force:!0}}).catch(()=>{})};try{const k=await Ne(`/api/${n.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},r("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:z,reused:H}=await ct({orgSlug:n.slug,sourceConnection:a,installationId:F.installationId,owner:v.owner,repo:v.name,githubCallTool:q=>D.callTool(q),selfCallTool:q=>x.callTool(q)});R=H?null:z;const $=k.icon??null,Y=Mt(i),W=i.toLowerCase(),B=st(i),V=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:$??null,metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:B,productionUrl:B,githubRepo:{owner:v.owner,name:v.name,url:v.url,installationId:F.installationId,connectionId:z},ui:{banner:null,bannerColor:"#22C55E",icon:$,themeColor:"#22C55E",slug:Y,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:z}]}}}),M=V.structuredContent??V;if(!M.item?.id)throw new Error(r("common.importFromDecoDialog.failedToCreateAgent"));return Q=M.item.id,{slug:Y,virtualMcpId:M.item.id,item:M.item}}catch(k){throw await ae(),k}},onSuccess:({slug:i,virtualMcpId:P,item:E})=>{U("deco_site_import_succeeded",{site_name:E.title,virtual_mcp_id:P,slug:i}),p.setQueryData(je.collectionItem(x,n.id,"","VIRTUAL_MCP",P),{item:E}),p.invalidateQueries({predicate:v=>{const F=v.queryKey;return F[1]===n.id&&F[3]==="collection"&&F[4]==="VIRTUAL_MCP"}}),fe.success(r("common.importFromDecoDialog.importSuccess",{slug:i})),T(!1),h(P)},onError:i=>{U("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),fe.error(r("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:r("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(mt,{open:t,onOpenChange:T,children:o.jsxs(dt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ut,{className:"sr-only",children:o.jsx(pt,{children:r("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":r("common.importFromDecoDialog.goBack"),children:o.jsx(ft,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:r("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ht,{value:g,onChange:f,placeholder:r("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&f("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??r("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(le,{variant:"outline",size:"sm",onClick:l.retry,children:r("common.importFromDecoDialog.retryGithubSetup")})]}),w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.settingUpGithub")}),d&&!w&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.importFromDecoDialog.selectGithubConnection")})}),c.map(i=>o.jsxs("button",{type:"button",onClick:()=>u(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(xt,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),S&&!w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.loadingSites")}),!S&&!w&&!d&&l.status!=="error"&&!G&&N.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.noSitesFound")}),!S&&!w&&!d&&l.status!=="error"&&N.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[L.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:r("common.importFromDecoDialog.noSitesMatch",{search:g})}),L.map(i=>{const P=rt(i.domains),E=m===i.name;return o.jsxs("button",{type:"button",onClick:()=>b(i.name),className:Pe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",E?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),P&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:P})]})]},i.name)})]})]}),o.jsxs(gt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(le,{variant:"outline",onClick:()=>T(!1),disabled:_.isPending,children:r("common.importFromDecoDialog.cancel")}),o.jsx(le,{disabled:!m||!I||_.isPending||S||w||d||!a||l.status==="error",onClick:()=>m&&_.mutate(m),children:_.isPending?r("common.importFromDecoDialog.importing"):r("common.importFromDecoDialog.import")})]})]})})}function Ts(){const t=ue.c(82),e=pe(),{org:s}=ge(),[r,n]=O.useState(""),h=It(r,300);let p;t[0]!==h?(p={searchTerm:h},t[0]=h,t[1]=p):p=t[1];const y=ze(p),m=Ue();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={navigateOnCreate:!0},t[2]=b):b=t[2];const{createVirtualMCP:j,isCreating:u}=Je(b),[g,f]=O.useState(null),[x,C]=O.useState(!1),[c,l]=O.useState(!1),{granted:a}=Me("agents:manage"),d=Ye();let D;t[3]!==s?(D=A=>A.id!==s.id,t[3]=s,t[4]=D):D=t[4];const w=y.filter(D),{data:K}=$e(w.map(zt));let S;t[5]!==m||t[6]!==g||t[7]!==e?(S=async()=>{if(!g)return;const{id:A,title:Ie}=g;f(null);try{await m.delete.mutateAsync(A),U("agent_deleted",{agent_id:A,source:"agents_list"}),fe.success(e("routes.agentsList.deletedAgent",{title:Ie}))}catch{}},t[5]=m,t[6]=g,t[7]=e,t[8]=S):S=t[8];const G=S,N=de,T=de,L=de;let I;t[9]!==e?(I=e("routes.agentsList.title"),t[9]=e,t[10]=I):I=t[10];let _;t[11]!==I?(_=o.jsx(de.Title,{children:I}),t[11]=I,t[12]=_):_=t[12];let i;t[13]!==e?(i=e("routes.agentsList.searchPlaceholder"),t[13]=e,t[14]=i):i=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P=A=>{A.key==="Escape"&&(n(""),A.target.blur())},t[15]=P):P=t[15];let E;t[16]!==r||t[17]!==i?(E=o.jsx(vt,{value:r,onChange:n,placeholder:i,className:"w-full md:w-[375px]",onKeyDown:P}),t[16]=r,t[17]=i,t[18]=E):E=t[18];let v;t[19]!==a||t[20]!==j||t[21]!==u||t[22]!==d||t[23]!==e?(v=a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list",method:"deco"}),C(!0)},isCreating:u,align:"end",showDecoImport:d})]}),t[19]=a,t[20]=j,t[21]=u,t[22]=d,t[23]=e,t[24]=v):v=t[24];let F;t[25]!==E||t[26]!==v?(F=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,v]}),t[25]=E,t[26]=v,t[27]=F):F=t[27];let R;t[28]!==F||t[29]!==_?(R=o.jsxs("div",{className:"flex flex-col gap-6",children:[_,F]}),t[28]=F,t[29]=_,t[30]=R):R=t[30];const Q=w.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(We,{image:o.jsx(Qe,{size:48,className:"text-muted-foreground"}),title:e(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?e("routes.agentsList.noAgentsMatchSearch",{search:r}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!r&&a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),C(!0)},isCreating:u,align:"center",showBetaBadge:!0,showDecoImport:d})]})})}),ae=w.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:w.map(A=>o.jsx(At,{project:A,lastUsedAt:K?.get(A.id)?.last_used_at,onDeleteClick:a?()=>f({id:A.id,title:A.title}):void 0},A.id))})]});let k;t[31]!==R||t[32]!==Q||t[33]!==ae||t[34]!==L.Container?(k=o.jsxs(L.Container,{children:[R,Q,ae]}),t[31]=R,t[32]=Q,t[33]=ae,t[34]=L.Container,t[35]=k):k=t[35];let z;t[36]!==k||t[37]!==T.Content?(z=o.jsx(T.Content,{children:k}),t[36]=k,t[37]=T.Content,t[38]=z):z=t[38];let H;t[39]!==c?(H=o.jsx(Nt,{open:c,onOpenChange:l}),t[39]=c,t[40]=H):H=t[40];let $;t[41]!==x?($=o.jsx(Rt,{open:x,onOpenChange:C}),t[41]=x,t[42]=$):$=t[42];const Y=!!g;let W;t[43]===Symbol.for("react.memo_cache_sentinel")?(W=A=>!A&&f(null),t[43]=W):W=t[43];let B;t[44]!==e?(B=e("routes.agentsList.deleteAgentTitle"),t[44]=e,t[45]=B):B=t[45];let V;t[46]!==B?(V=o.jsx(bt,{children:B}),t[46]=B,t[47]=V):V=t[47];let M;t[48]!==e?(M=e("routes.agentsList.deleteAgentDescription"),t[48]=e,t[49]=M):M=t[49];const q=g?.title;let J;t[50]!==q?(J=o.jsx("span",{className:"font-medium text-foreground",children:q}),t[50]=q,t[51]=J):J=t[51];let X;t[52]!==M||t[53]!==J?(X=o.jsxs(jt,{children:[M," ",J,"."]}),t[52]=M,t[53]=J,t[54]=X):X=t[54];let Z;t[55]!==V||t[56]!==X?(Z=o.jsxs(Ct,{children:[V,X]}),t[55]=V,t[56]=X,t[57]=Z):Z=t[57];let ee;t[58]!==e?(ee=e("routes.agentsList.cancelButton"),t[58]=e,t[59]=ee):ee=t[59];let te;t[60]!==ee?(te=o.jsx(Dt,{children:ee}),t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==e?(oe=e("routes.agentsList.deleteButton"),t[62]=e,t[63]=oe):oe=t[63];let se;t[64]!==G||t[65]!==oe?(se=o.jsx(yt,{onClick:G,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:oe}),t[64]=G,t[65]=oe,t[66]=se):se=t[66];let re;t[67]!==te||t[68]!==se?(re=o.jsxs(wt,{children:[te,se]}),t[67]=te,t[68]=se,t[69]=re):re=t[69];let ie;t[70]!==Z||t[71]!==re?(ie=o.jsxs(St,{children:[Z,re]}),t[70]=Z,t[71]=re,t[72]=ie):ie=t[72];let ne;t[73]!==Y||t[74]!==ie?(ne=o.jsx(_t,{open:Y,onOpenChange:W,children:ie}),t[73]=Y,t[74]=ie,t[75]=ne):ne=t[75];let me;return t[76]!==N||t[77]!==z||t[78]!==H||t[79]!==$||t[80]!==ne?(me=o.jsxs(N,{children:[z,H,$,ne]}),t[76]=N,t[77]=z,t[78]=H,t[79]=$,t[80]=ne,t[81]=me):me=t[81],me}function zt(t){return t.id}export{Ts as default};
|
|
1
|
+
import{c as ue,b as pe,j as o,a5 as Ae,B as le,eC as Te,M as ge,W as Le,a as we,n as Se,r as O,d8 as Ee,m as Fe,K as je,e as ke,o as U,t as fe,l as Pe,x as Ge,ao as Me,P as de}from"./index-z4bKt11m.js";import{a as ce,b as _e,D as he,c as xe}from"./dropdown-menu-Dd8nakK9.js";import{i as Oe}from"./GitBranch01-ddoPQdPH.js";import{b as Re}from"./Users03-BP-0DNhp.js";import{b as ze,c as Ue,g as $e}from"./use-virtual-mcp-Bq1RMGPF.js";import{i as Be}from"./DotsVertical-DE9eZKrJ.js";import{a as Ve}from"./Settings02-CFcKewXh.js";import{s as He}from"./Trash01-C6bziN5X.js";import{A as Ke,bd as Qe}from"./agent-icon-BD4DM2Lv.js";import{u as qe,f as Ce}from"./use-date-fns-locale-PFUAQIxr.js";import{u as ve}from"./use-navigate-to-agent-BMSyO1iB.js";import{n as Ye}from"./use-organization-settings-C-XY0Wze.js";import{E as We}from"./empty-state-BIcQyeij.js";import{u as Je}from"./use-create-virtual-mcp-BRT9hKZ3.js";import{b as Xe,u as Ze}from"./use-connection-CPQUKm0a.js";import{u as be}from"./use-mcp-client-B1u2B39v.js";import{a as et}from"./authenticate-and-persist-oauth-2yRhuiER.js";import{c as tt}from"./use-mcp-tools-Ch_j97A3.js";import{e as ot}from"./extract-connection-data-CM8c_Wvw.js";import{f as st,g as rt}from"./thread-intent-9fI0jPLV.js";import{a as it}from"./github-repo-scope-C8GSbvaz.js";import{f as nt,a as lt,G as at,p as ct}from"./provision-repo-scoped-github-connection-B6zdkC6p.js";import{D as mt,b as dt,c as ut,d as pt,e as gt}from"./dialog-DbzCN1O8.js";import{i as ft}from"./ArrowLeft-CyH6aWpS.js";import{C as ht}from"./collection-search-CeA9TK20.js";import{G as xt}from"./github-icon-BcrkxW36.js";import{A as bt,a as jt,b as Ct,c as Dt,g as yt,d as wt,e as St,f as _t}from"./alert-dialog-Bi9Cy1y8.js";import{S as vt}from"./search-input-DpLbMQRj.js";import{s as De}from"./Plus-D2HOi_DD.js";import{R as Nt}from"./repository-import-picker-C0YugeGx.js";import{u as It}from"./use-debounced-value-DeY1TNRX.js";import"./Check-BZE0WrNL.js";import"./ChevronRight-DNrwFBnC.js";import"./AlertCircle-DbwtWnTP.js";import"./Tool01-DHi_Z7zo.js";import"./ArrowUp-Scf6R8DX.js";import"./Tool02-JY0gm8cg.js";import"./ArrowRight-Bv0iX4wy.js";import"./TrendUp01-Bkdgpfn7.js";import"./ZoomOut-BRjMa-04.js";import"./CheckCircle-BKb1RVrA.js";import"./ChevronUp-D5_IWEtB.js";import"./ChevronSelectorVertical-oXn0cTzk.js";import"./UserSquare-qgzToKNd.js";import"./Copy01-DTHuBaTA.js";import"./CreditCard01-CwX6pA0M.js";import"./Database01-RGlwXHSd.js";import"./MessageCircle01-CgotMmLL.js";import"./Download01-qX3hmvr5.js";import"./Printer-BpZBiqyG.js";import"./Eye-DXUjft5i.js";import"./File02-g-xJPix_.js";import"./Share07-CxuHcmnM.js";import"./Globe01-DIy8wXF6.js";import"./SwitchHorizontal01-hHr6GOmU.js";import"./HardDrive-DU_z1AQw.js";import"./Image01-DfaxHjlV.js";import"./Key01-mqjfsZRe.js";import"./Link01-C656VtHx.js";import"./LinkExternal01-BkRUjBAn.js";import"./Monitor01-CQ6Zk1oP.js";import"./Sun-SBoG-e9B.js";import"./Package-t6euxYcP.js";import"./Palette-oECS8j3l.js";import"./Play-DQgzDnaW.js";import"./SearchLg-DbX4T5E-.js";import"./SearchMd-FDCJM3CR.js";import"./Shield01-HrKG6yUn.js";import"./Stars01-B_nM3FYf.js";import"./Upload01-DC2spim9.js";import"./User01-BbOpA84p.js";import"./Users01-BOsDT0Jv.js";import"./XCircle-CuK2q_XU.js";import"./XClose-Cvyz3reC.js";import"./X-Bzh3NI3m.js";import"./Zap-DXNovEva.js";import"./differenceInSeconds-C3x8sHUj.js";import"./hooks-CkL4R3Tj.js";import"./backoff-8mStPHYB.js";import"./task-board-lQZGfEfb.js";import"./schema-D0xfowSf.js";import"./github-repo-BknN0SVI.js";import"./auth-D-2jYpOE.js";import"./mcp-oauth-DiqQlKOx.js";import"./metadata-dUsYcpuu.js";import"./github-D4UJ99TO.js";import"./connection-BfiO32wM.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-BaqWNwxf.js";import"./tooltip-BuKeolDX.js";import"./index-B46P4HkV.js";import"./input-C7XH8Uj_.js";import"./label-8juC5J-g.js";import"./useInfiniteQuery-C6OBOha-.js";import"./infiniteQueryObserver-BjcfJE2O.js";import"./avatar-Duu5Gg02.js";function ye(t){const e=ue.c(26),{onCreateFromScratch:s,onImportGitHub:r,onImportDeco:n,isCreating:h,align:p,side:y,showBetaBadge:m,showDecoImport:b}=t,j=p===void 0?"end":p,u=pe();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=o.jsx(Re,{size:14}),e[0]=g):g=e[0];let f;e[1]!==u?(f=u("common.createAgentDropdown.createFromScratch"),e[1]=u,e[2]=f):f=e[2];let x;e[3]!==h||e[4]!==s||e[5]!==f?(x=o.jsxs(ce,{disabled:h,onClick:s,children:[g,f]}),e[3]=h,e[4]=s,e[5]=f,e[6]=x):x=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=o.jsx(Oe,{className:"size-3.5"}),e[7]=C):C=e[7];let c;e[8]!==u?(c=u("common.createAgentDropdown.importFromGitHub"),e[8]=u,e[9]=c):c=e[9];let l;e[10]!==m?(l=m&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=m,e[11]=l):l=e[11];let a;e[12]!==r||e[13]!==c||e[14]!==l?(a=o.jsxs(ce,{onClick:r,children:[C,c,l]}),e[12]=r,e[13]=c,e[14]=l,e[15]=a):a=e[15];let d;e[16]!==n||e[17]!==b||e[18]!==u?(d=b&&o.jsxs(ce,{onClick:n,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),u("common.createAgentDropdown.importFromDeco")]}),e[16]=n,e[17]=b,e[18]=u,e[19]=d):d=e[19];let D;return e[20]!==j||e[21]!==y||e[22]!==x||e[23]!==a||e[24]!==d?(D=o.jsxs(_e,{side:y,align:j,className:"w-48",children:[x,a,d]}),e[20]=j,e[21]=y,e[22]=x,e[23]=a,e[24]=d,e[25]=D):D=e[25],D}function At(t){const e=ue.c(50),{project:s,lastUsedAt:r,onDeleteClick:n}=t,h=ve(),p=pe(),y=qe(),m=s.metadata?.ui?.layout;let b;e[0]!==m?(b=Ae(m),e[0]=m,e[1]=b):b=e[1];const j=b;let u;e[2]!==j||e[3]!==h||e[4]!==s.id?(u=()=>h(s.id,{panel:j}),e[2]=j,e[3]=h,e[4]=s.id,e[5]=u):u=e[5];let g;e[6]!==s.title||e[7]!==u?(g=o.jsx("button",{type:"button",onClick:u,className:"absolute inset-0 z-0","aria-label":s.title}),e[6]=s.title,e[7]=u,e[8]=g):g=e[8];let f;e[9]!==s.icon||e[10]!==s.title?(f=o.jsx(Ke,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[9]=s.icon,e[10]=s.title,e[11]=f):f=e[11];let x;e[12]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(he,{asChild:!0,children:o.jsx(le,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(Be,{size:20})})}),e[12]=x):x=e[12];let C;e[13]!==h||e[14]!==s.id?(C=()=>h(s.id,{panel:"settings"}),e[13]=h,e[14]=s.id,e[15]=C):C=e[15];let c;e[16]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Ve,{size:16}),e[16]=c):c=e[16];let l;e[17]!==C?(l=o.jsxs(ce,{onClick:C,children:[c,"Settings"]}),e[17]=C,e[18]=l):l=e[18];let a;e[19]!==n?(a=n&&o.jsxs(ce,{variant:"destructive",onClick:i=>{i.stopPropagation(),n(i)},children:[o.jsx(He,{size:16}),"Delete"]}),e[19]=n,e[20]=a):a=e[20];let d;e[21]!==a||e[22]!==l?(d=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(xe,{children:[x,o.jsxs(_e,{align:"end",children:[l,a]})]})}),e[21]=a,e[22]=l,e[23]=d):d=e[23];let D;e[24]!==d||e[25]!==f?(D=o.jsxs("div",{className:"flex items-start justify-between",children:[f,d]}),e[24]=d,e[25]=f,e[26]=D):D=e[26];let w;e[27]!==s.title?(w=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),e[27]=s.title,e[28]=w):w=e[28];const K=s.description||"No description";let S;e[29]!==K?(S=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:K}),e[29]=K,e[30]=S):S=e[30];let G;e[31]!==w||e[32]!==S?(G=o.jsxs("div",{className:"flex flex-col gap-1",children:[w,S]}),e[31]=w,e[32]=S,e[33]=G):G=e[33];let N;e[34]!==D||e[35]!==G?(N=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[D,G]}),e[34]=D,e[35]=G,e[36]=N):N=e[36];let T;e[37]!==r||e[38]!==y||e[39]!==s.updated_at||e[40]!==p?(T=r?p("home.projectCard.lastUsed",{time:Ce(new Date(r),{addSuffix:!0,locale:y})}):p("home.projectCard.updated",{time:Ce(new Date(s.updated_at),{addSuffix:!0,locale:y})}),e[37]=r,e[38]=y,e[39]=s.updated_at,e[40]=p,e[41]=T):T=e[41];let L;e[42]!==T?(L=o.jsx("div",{className:"border-t border-border mt-auto",children:o.jsx("div",{className:"h-10 flex items-center px-4.5",children:o.jsx("p",{className:"text-xs text-muted-foreground",children:T})})}),e[42]=T,e[43]=L):L=e[43];let I;e[44]!==N||e[45]!==L?(I=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[N,L]}),e[44]=N,e[45]=L,e[46]=I):I=e[46];let _;return e[47]!==I||e[48]!==g?(_=o.jsxs(Te,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[g,I]}),e[47]=I,e[48]=g,e[49]=_):_=e[49],_}function Tt(t,e){const s=ue.c(12),{org:r}=ge();let n;s[0]!==r.id?(n=Le.REGISTRY(r.id),s[0]=r.id,s[1]=n):n=s[1];const h=n;let p;s[2]!==r.id||s[3]!==r.slug||s[4]!==h?(p={connectionId:h,orgId:r.id,orgSlug:r.slug},s[2]=r.id,s[3]=r.slug,s[4]=h,s[5]=p):p=s[5];const y=be(p);let m;s[6]!==t?(m={name:t},s[6]=t,s[7]=m):m=s[7];const b=e?.enabled??!0;let j;return s[8]!==y||s[9]!==m||s[10]!==b?(j={client:y,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:m,enabled:b,staleTime:3e5,select:Lt},s[8]=y,s[9]=m,s[10]=b,s[11]=j):j=s[11],tt(j)}function Lt(t){return t.structuredContent?.item??null}const Et="deco/mcp-github";function Ft(t){const{org:e}=ge(),{data:s}=we.useSession(),r=Xe(),n=Se(),[h,p]=O.useState("idle"),[y,m]=O.useState(null),[b,j]=O.useState(null),{data:u,isLoading:g}=Tt(Et,{enabled:t.enabled}),f=O.useRef(!1);t.enabled&&u&&!g&&!f.current&&s?.user?.id&&h==="idle"&&(f.current=!0,x());async function x(){if(!(!u||!s?.user?.id||!e))try{p("installing"),m(null);const c=ot(u,e.id,s.user.id,{remoteIndex:0});if(!c.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:a}=await r.create.mutateAsync(c);p("authenticating");const d=await et({connectionId:a,orgId:e.id,orgSlug:e.slug,persistFallback:D=>r.update.mutateAsync({id:a,data:{connection_token:D}}).then(()=>{})});if(d.ran&&!d.ok){try{await r.delete.mutateAsync(a)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}Ee(n,e.id),j(c),p("ready")}catch(c){m(c instanceof Error?c.message:String(c)),p("error")}}function C(){p("idle"),m(null),j(null),f.current=!1}return t.enabled&&g&&h==="idle"?{status:"installing",error:null,connection:null,retry:C}:{status:h,error:y,connection:b,retry:C}}const kt="deco-sites";function Pt(t){if(!t||typeof t!="object")return null;const e=t.github;if(!e||typeof e!="object")return null;const s=e.owner,r=e.repo;return typeof s!="string"||typeof r!="string"||s.length===0||r.length===0?null:{owner:s,repo:r}}function Gt(t,e){const s=e?Pt(e):null,r=s?.owner??kt,n=s?.repo??t;return{owner:r,name:n,url:`https://github.com/${r}/${n}`}}function Mt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const r=await fetch(t,e),n=await r.json().catch(()=>({}));if(!r.ok)throw new Error(n.error??`${s} (${r.status})`);return n}function Ot(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Rt({open:t,onOpenChange:e,onBack:s}){const r=pe(),{org:n}=ge(),h=ve(),p=Se(),{data:y}=we.useSession(),[m,b]=O.useState(null),[j,u]=O.useState(null),[g,f]=O.useState(""),x=be({connectionId:Ge,orgId:n.id,orgSlug:n.slug}),C=Ze({slug:"mcp-github"}),c=it(C),l=Ft({enabled:t&&c.length===0}),a=c.length===1?c[0]??null:j,d=c.length>1&&!a,D=be({connectionId:a?.id??"",orgId:n.id,orgSlug:n.slug}),w=t&&c.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:K,isLoading:S,error:G}=Fe({queryKey:je.decoSites(y?.user?.email),queryFn:()=>Ot(n.slug),enabled:t&&!!y?.user?.email,staleTime:6e4,retry:!1}),N=K?.sites??[],T=i=>{i||(b(null),u(null),f("")),e(i)},L=N.filter(i=>i.name.toLowerCase().includes(g.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(g.toLowerCase())??!1)),I=!m||L.some(i=>i.name===m),_=ke({mutationFn:async i=>{if(!a)throw new Error(r("common.importFromDecoDialog.githubNotConnected"));U("deco_site_import_started",{site_name:i});const{installations:P}=await nt(k=>x.callTool(k),a.id),E=N.find(k=>k.name===i);if(!E)throw new Error(r("common.importFromDecoDialog.siteNoLongerAvailable"));const v=Gt(i,E.metadata),F=lt(P,v.owner);if(!F)throw new Error(r("common.importFromDecoDialog.installGithubApp",{owner:v.owner,installUrl:at}));let R=null,Q=null;const ae=async()=>{Q&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:Q}}).catch(()=>{}),R&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:R,force:!0}}).catch(()=>{})};try{const k=await Ne(`/api/${n.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},r("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:z,reused:H}=await ct({orgSlug:n.slug,sourceConnection:a,installationId:F.installationId,owner:v.owner,repo:v.name,githubCallTool:q=>D.callTool(q),selfCallTool:q=>x.callTool(q)});R=H?null:z;const $=k.icon??null,Y=Mt(i),W=i.toLowerCase(),B=st(i),V=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:$??null,metadata:{instructions:null,enabled_plugins:[],siteSlug:W,previewServerUrl:B,productionUrl:B,githubRepo:{owner:v.owner,name:v.name,url:v.url,installationId:F.installationId,connectionId:z},ui:{banner:null,bannerColor:"#22C55E",icon:$,themeColor:"#22C55E",slug:Y,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:z}]}}}),M=V.structuredContent??V;if(!M.item?.id)throw new Error(r("common.importFromDecoDialog.failedToCreateAgent"));return Q=M.item.id,{slug:Y,virtualMcpId:M.item.id,item:M.item}}catch(k){throw await ae(),k}},onSuccess:({slug:i,virtualMcpId:P,item:E})=>{U("deco_site_import_succeeded",{site_name:E.title,virtual_mcp_id:P,slug:i}),p.setQueryData(je.collectionItem(x,n.id,"","VIRTUAL_MCP",P),{item:E}),p.invalidateQueries({predicate:v=>{const F=v.queryKey;return F[1]===n.id&&F[3]==="collection"&&F[4]==="VIRTUAL_MCP"}}),fe.success(r("common.importFromDecoDialog.importSuccess",{slug:i})),T(!1),h(P)},onError:i=>{U("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),fe.error(r("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:r("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(mt,{open:t,onOpenChange:T,children:o.jsxs(dt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ut,{className:"sr-only",children:o.jsx(pt,{children:r("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":r("common.importFromDecoDialog.goBack"),children:o.jsx(ft,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:r("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ht,{value:g,onChange:f,placeholder:r("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&f("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[l.status==="error"&&o.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 h-48 px-8 text-center",children:[o.jsx("p",{className:"text-sm text-destructive",children:l.error??r("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(le,{variant:"outline",size:"sm",onClick:l.retry,children:r("common.importFromDecoDialog.retryGithubSetup")})]}),w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.settingUpGithub")}),d&&!w&&l.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.importFromDecoDialog.selectGithubConnection")})}),c.map(i=>o.jsxs("button",{type:"button",onClick:()=>u(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(xt,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),S&&!w&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.loadingSites")}),!S&&!w&&!d&&l.status!=="error"&&!G&&N.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.noSitesFound")}),!S&&!w&&!d&&l.status!=="error"&&N.length>0&&o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 max-h-[420px] overflow-y-auto py-4 px-8 [scrollbar-gutter:stable]",children:[L.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:r("common.importFromDecoDialog.noSitesMatch",{search:g})}),L.map(i=>{const P=rt(i.domains),E=m===i.name;return o.jsxs("button",{type:"button",onClick:()=>b(i.name),className:Pe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",E?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),P&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:P})]})]},i.name)})]})]}),o.jsxs(gt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(le,{variant:"outline",onClick:()=>T(!1),disabled:_.isPending,children:r("common.importFromDecoDialog.cancel")}),o.jsx(le,{disabled:!m||!I||_.isPending||S||w||d||!a||l.status==="error",onClick:()=>m&&_.mutate(m),children:_.isPending?r("common.importFromDecoDialog.importing"):r("common.importFromDecoDialog.import")})]})]})})}function Ts(){const t=ue.c(82),e=pe(),{org:s}=ge(),[r,n]=O.useState(""),h=It(r,300);let p;t[0]!==h?(p={searchTerm:h},t[0]=h,t[1]=p):p=t[1];const y=ze(p),m=Ue();let b;t[2]===Symbol.for("react.memo_cache_sentinel")?(b={navigateOnCreate:!0},t[2]=b):b=t[2];const{createVirtualMCP:j,isCreating:u}=Je(b),[g,f]=O.useState(null),[x,C]=O.useState(!1),[c,l]=O.useState(!1),{granted:a}=Me("agents:manage"),d=Ye();let D;t[3]!==s?(D=A=>A.id!==s.id,t[3]=s,t[4]=D):D=t[4];const w=y.filter(D),{data:K}=$e(w.map(zt));let S;t[5]!==m||t[6]!==g||t[7]!==e?(S=async()=>{if(!g)return;const{id:A,title:Ie}=g;f(null);try{await m.delete.mutateAsync(A),U("agent_deleted",{agent_id:A,source:"agents_list"}),fe.success(e("routes.agentsList.deletedAgent",{title:Ie}))}catch{}},t[5]=m,t[6]=g,t[7]=e,t[8]=S):S=t[8];const G=S,N=de,T=de,L=de;let I;t[9]!==e?(I=e("routes.agentsList.title"),t[9]=e,t[10]=I):I=t[10];let _;t[11]!==I?(_=o.jsx(de.Title,{children:I}),t[11]=I,t[12]=_):_=t[12];let i;t[13]!==e?(i=e("routes.agentsList.searchPlaceholder"),t[13]=e,t[14]=i):i=t[14];let P;t[15]===Symbol.for("react.memo_cache_sentinel")?(P=A=>{A.key==="Escape"&&(n(""),A.target.blur())},t[15]=P):P=t[15];let E;t[16]!==r||t[17]!==i?(E=o.jsx(vt,{value:r,onChange:n,placeholder:i,className:"w-full md:w-[375px]",onKeyDown:P}),t[16]=r,t[17]=i,t[18]=E):E=t[18];let v;t[19]!==a||t[20]!==j||t[21]!==u||t[22]!==d||t[23]!==e?(v=a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list",method:"deco"}),C(!0)},isCreating:u,align:"end",showDecoImport:d})]}),t[19]=a,t[20]=j,t[21]=u,t[22]=d,t[23]=e,t[24]=v):v=t[24];let F;t[25]!==E||t[26]!==v?(F=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[E,v]}),t[25]=E,t[26]=v,t[27]=F):F=t[27];let R;t[28]!==F||t[29]!==_?(R=o.jsxs("div",{className:"flex flex-col gap-6",children:[_,F]}),t[28]=F,t[29]=_,t[30]=R):R=t[30];const Q=w.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(We,{image:o.jsx(Qe,{size:48,className:"text-muted-foreground"}),title:e(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?e("routes.agentsList.noAgentsMatchSearch",{search:r}):e(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate"),actions:!r&&a&&o.jsxs(xe,{children:[o.jsx(he,{asChild:!0,children:o.jsxs(le,{size:"sm",children:[o.jsx(De,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(ye,{onCreateFromScratch:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),j()},onImportGitHub:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"github"}),l(!0)},onImportDeco:()=>{U("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),C(!0)},isCreating:u,align:"center",showBetaBadge:!0,showDecoImport:d})]})})}),ae=w.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:w.map(A=>o.jsx(At,{project:A,lastUsedAt:K?.get(A.id)?.last_used_at,onDeleteClick:a?()=>f({id:A.id,title:A.title}):void 0},A.id))})]});let k;t[31]!==R||t[32]!==Q||t[33]!==ae||t[34]!==L.Container?(k=o.jsxs(L.Container,{children:[R,Q,ae]}),t[31]=R,t[32]=Q,t[33]=ae,t[34]=L.Container,t[35]=k):k=t[35];let z;t[36]!==k||t[37]!==T.Content?(z=o.jsx(T.Content,{children:k}),t[36]=k,t[37]=T.Content,t[38]=z):z=t[38];let H;t[39]!==c?(H=o.jsx(Nt,{open:c,onOpenChange:l}),t[39]=c,t[40]=H):H=t[40];let $;t[41]!==x?($=o.jsx(Rt,{open:x,onOpenChange:C}),t[41]=x,t[42]=$):$=t[42];const Y=!!g;let W;t[43]===Symbol.for("react.memo_cache_sentinel")?(W=A=>!A&&f(null),t[43]=W):W=t[43];let B;t[44]!==e?(B=e("routes.agentsList.deleteAgentTitle"),t[44]=e,t[45]=B):B=t[45];let V;t[46]!==B?(V=o.jsx(bt,{children:B}),t[46]=B,t[47]=V):V=t[47];let M;t[48]!==e?(M=e("routes.agentsList.deleteAgentDescription"),t[48]=e,t[49]=M):M=t[49];const q=g?.title;let J;t[50]!==q?(J=o.jsx("span",{className:"font-medium text-foreground",children:q}),t[50]=q,t[51]=J):J=t[51];let X;t[52]!==M||t[53]!==J?(X=o.jsxs(jt,{children:[M," ",J,"."]}),t[52]=M,t[53]=J,t[54]=X):X=t[54];let Z;t[55]!==V||t[56]!==X?(Z=o.jsxs(Ct,{children:[V,X]}),t[55]=V,t[56]=X,t[57]=Z):Z=t[57];let ee;t[58]!==e?(ee=e("routes.agentsList.cancelButton"),t[58]=e,t[59]=ee):ee=t[59];let te;t[60]!==ee?(te=o.jsx(Dt,{children:ee}),t[60]=ee,t[61]=te):te=t[61];let oe;t[62]!==e?(oe=e("routes.agentsList.deleteButton"),t[62]=e,t[63]=oe):oe=t[63];let se;t[64]!==G||t[65]!==oe?(se=o.jsx(yt,{onClick:G,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:oe}),t[64]=G,t[65]=oe,t[66]=se):se=t[66];let re;t[67]!==te||t[68]!==se?(re=o.jsxs(wt,{children:[te,se]}),t[67]=te,t[68]=se,t[69]=re):re=t[69];let ie;t[70]!==Z||t[71]!==re?(ie=o.jsxs(St,{children:[Z,re]}),t[70]=Z,t[71]=re,t[72]=ie):ie=t[72];let ne;t[73]!==Y||t[74]!==ie?(ne=o.jsx(_t,{open:Y,onOpenChange:W,children:ie}),t[73]=Y,t[74]=ie,t[75]=ne):ne=t[75];let me;return t[76]!==N||t[77]!==z||t[78]!==H||t[79]!==$||t[80]!==ne?(me=o.jsxs(N,{children:[z,H,$,ne]}),t[76]=N,t[77]=z,t[78]=H,t[79]=$,t[80]=ne,t[81]=me):me=t[81],me}function zt(t){return t.id}export{Ts as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as V,b as Q,ac as Oe,ad as Fe,r as G,j as s,az as st,dP as Le,t as Z,dO as de,dN as ae,as as Be,M as se,_ as te,n as oe,e as ie,v as he,B as W,K as X,m as pe,ax as ue,l as re,cN as He,fj as it,eC as ve,ao as lt,L as rt,o as Ke,h as nt,aa as at,ab as xe,fi as ot}from"./index-Cjhl57C5.js";import{i as ct}from"./AlertCircle-Ddrj7VUD.js";import{u as qe,a as me,i as dt,b as ut,p as mt,e as be,f as ft,d as ze}from"./use-ai-providers-QvFz5SFX.js";import{i as pt}from"./CheckCircle-DQbrJHsr.js";import{d as gt,l as xt}from"./use-organization-settings-pqtCEzuj.js";import{S as ht}from"./schema-BTHH8GSh.js";import{M as vt}from"./select-model-CIR4DebA.js";import{u as bt}from"./use-debounced-autosave-CAXyZd0j.js";import{I as ce}from"./input-CImpk8th.js";import{T as Ae,a as jt}from"./toggle-group-Cj0z3PRY.js";import{A as je,a as ye,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-DfGZ77rh.js";import{u as ge,d as we,a as Ve,e as yt}from"./use-entitlements-BP7WwVM_.js";import{i as Nt}from"./ChevronRight-DK_MoZ-7.js";import{u as Ge}from"./use-open-billing-url-Cjz--xRu.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-Cqfgwdfc.js";import{i as It}from"./Check-Dnz3uW0f.js";import{a as wt,i as kt}from"./Tool01-C0-Xqkxp.js";import{s as Dt}from"./Plus-C5azC59K.js";import{s as Kt}from"./Trash01-DPQmLNZV.js";import{A as At}from"./avatar-CR9KEb-s.js";import{u as Et,f as Tt}from"./use-date-fns-locale-BAJylOmL.js";import{c as We,P as Rt,C as Ee}from"./decopilot-BecreIFq.js";import{P as Ut}from"./ai-providers-logos-DD3qZ33J.js";import{i as Mt}from"./Settings02-BLcAotUO.js";import{s as $t}from"./Eye-B7hZLXRZ.js";import{d as Ot,c as Ft,b as Lt,D as Bt,e as Ht}from"./dialog-SKkzdrcZ.js";import{R as qt}from"./require-capability-CLz-loNQ.js";import"./task-board-DpuhnKzF.js";import"./drawer-BleKwXKQ.js";import"./use-mobile-C5SrWG9H.js";import"./chat-context-H28jTcB6.js";import"./use-panel-navigate-bhAOxlzp.js";import"./thread-route-CnHTxNkK.js";import"./use-project-scope-BfeOcOX-.js";import"./use-virtual-mcp-BvrPyGzX.js";import"./use-mcp-client-Bf0VpOBw.js";import"./auth-5BCk_I76.js";import"./github-repo-BknN0SVI.js";import"./autosend-ClVEnX_S.js";import"./thread-intent-Cdmdi4Qs.js";import"./slugify-CEUa2lfQ.js";import"./hooks-D5z7CgCt.js";import"./backoff-8mStPHYB.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-DlUI-60k.js";import"./index-BQgXOHRB.js";import"./User01-BA1LEBvQ.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-D_GODf3h.js";import"./select-C5Qbx8Kw.js";import"./index-C-9h82SA.js";import"./ChevronUp-XOZg-HiO.js";import"./ArrowLeft-BKbGYh2B.js";import"./ChevronSelectorVertical-B64gqtde.js";import"./Key01-ti2CpCiW.js";import"./SearchMd-Ms_xvSfF.js";import"./Monitor01-BoIweS2p.js";import"./download-app-dialog-DQE0snIy.js";import"./Copy01-l6PfB431.js";import"./Download01-_eUxcgg1.js";import"./Image01-7_HSDHV3.js";import"./Stars01-DTStBsXP.js";import"./X-Dh_K-VDi.js";import"./access-gate-Dt6vr2zi.js";import"./capability-load-error-D1mxtMyB.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>dt(e),Gt=e=>ut(e),Qt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:zt},{key:"web_search",filter:Vt},{key:"deep_research",filter:Gt}];function Yt(e){const t=V.c(30),{slot:i,onSlotChange:r,filterModels:o,defaultKeyId:n}=e,c=qe(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??n);let f,a;t[0]!==l?(f=()=>{l&&g(l)},a=[l],t[0]=l,t[1]=f,t[2]=a):(f=t[1],a=t[2]),G.useEffect(f,a);let x;t[3]!==c||t[4]!==n||t[5]!==d?(x=c.some(I=>I.id===d)?d:n,t[3]=c,t[4]=n,t[5]=d,t[6]=x):x=t[6];const u=x;let v;t[7]!==u||t[8]!==c?(v=u?c.find(I=>I.id===u):null,t[7]=u,t[8]=c,t[9]=v):v=t[9];const C=v,{models:y,isLoading:h}=me(o?u??void 0:void 0),j=o?h||y.some(o):!0;let N;t[10]!==i||t[11]!==C?.providerId||t[12]!==l?(N=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=C?.providerId,t[12]=l,t[13]=N):N=t[13];const w=N,m=Q();if(o&&!j){let I;t[14]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=m,t[15]=I):I=t[15];let k;return t[16]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[16]=I,t[17]=k):k=t[17],k}let b;t[18]!==m?(b=m("settings.simpleModeSection.pickModel"),t[18]=m,t[19]=b):b=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[20]=S):S=t[20];let p;t[21]!==u||t[22]!==r?(p=I=>{const k=I.keyId??u??"";g(k),r({keyId:k,modelId:I.modelId,title:I.title})},t[21]=u,t[22]=r,t[23]=p):p=t[23];let P;return t[24]!==u||t[25]!==o||t[26]!==w||t[27]!==b||t[28]!==p?(P=s.jsx(vt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:o,onCredentialChange:S,onModelChange:p}),t[24]=u,t[25]=o,t[26]=w,t[27]=b,t[28]=p,t[29]=P):P=t[29],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:r}=e,o=Q();if(i){let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=n):n=t[0];let c;t[1]!==o?(c=o("settings.simpleModeSection.saving"),t[1]=o,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(pt,{size:12}),t[5]=n):n=t[5];let c;t[6]!==o?(c=o("settings.simpleModeSection.saved"),t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Zt(){const e=V.c(58),t=Q(),i=qe(),r=gt(),o=i.length>0;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Oe(ht),e[0]=n):n=e[0];let c;e[1]!==r?(c={resolver:n,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=xt(),a=l.formState.isDirty;let x;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(r),Z.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=bt(x),v=i[0],C=i[1],y=i[2],{models:h}=me(v?.id),{models:j}=me(C?.id),{models:N}=me(y?.id);let w,m;e[8]!==l||e[9]!==o?(w=()=>{o||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[o,l],e[8]=l,e[9]=o,e[10]=w,e[11]=m):(w=e[10],m=e[11]),G.useEffect(w,m);let b;e[12]!==i||e[13]!==l||e[14]!==v||e[15]!==C||e[16]!==y||e[17]!==h||e[18]!==j||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Xt)),H={};v?.id&&(H[v.id]=h),C?.id&&(H[C.id]=j),y?.id&&(H[y.id]=N);const z=le=>le!=null&&!M.has(le.keyId),K={fast:z(_.tiers.fast)?null:_.tiers.fast,smart:z(_.tiers.smart)?null:_.tiers.smart,thinking:z(_.tiers.thinking)?null:_.tiers.thinking,image:z(_.tiers.image)?null:_.tiers.image,web_search:z(_.tiers.web_search)?null:_.tiers.web_search,deep_research:z(_.tiers.deep_research)?null:_.tiers.deep_research},Y=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,J=K.fast===_.tiers.fast&&K.smart===_.tiers.smart&&K.thinking===_.tiers.thinking&&K.image===_.tiers.image&&K.web_search===_.tiers.web_search&&K.deep_research===_.tiers.deep_research;if(!Y&&J)return;const ee=mt(i,H);l.reset({tiers:{fast:K.fast??ee.chat.fast,smart:K.smart??ee.chat.smart,thinking:K.thinking??ee.chat.thinking,image:K.image??ee.image,web_search:K.web_search??ee.webSearch,deep_research:K.deep_research??ee.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=v,e[15]=C,e[16]=y,e[17]=h,e[18]=j,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=y?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==j||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,j,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=j,e[25]=N,e[26]=S,e[27]=p,e[28]=P,e[29]=I):I=e[29],G.useEffect(b,I);let k;e[30]!==t?(k=_=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[_]||_,e[30]=t,e[31]=k):k=e[31];const T=k;let A;e[32]!==t?(A=_=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[_]||"",e[32]=t,e[33]=A):A=e[33];const U=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let R;e[36]!==t?(R=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=R):R=e[37];let $;e[38]!==R?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:R}),e[38]=R,e[39]=$):$=e[39];const B=f&&!a;let O;e[40]!==g||e[41]!==B?(O=s.jsx(Wt,{isPending:g,showSaved:B}),e[40]=g,e[41]=B,e[42]=O):O=e[42];let F;e[43]!==$||e[44]!==O?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[$,O]}),e[43]=$,e[44]=O,e[45]=F):F=e[45];let L;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==U||e[49]!==T||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:H}=M;return s.jsx(Le,{title:T(_.key),description:U(_.key),action:s.jsx(Yt,{slot:H.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{H.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=T,e[50]=u,e[51]=L):L=e[51];let q;e[52]!==L?(q=s.jsx(de,{children:L}),e[52]=L,e[53]=q):q=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==q?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,q]}),e[54]=E,e[55]=F,e[56]=q,e[57]=D):D=e[57],D}function Xt(e){return e.id}const Jt={usd:[10,20,100],brl:[50,100,500]};function Ze(){const e=V.c(30),t=Q(),i=te(),[r]=he(),[o,n]=G.useState(!1);let c;e[0]!==t?(c=p=>{Z.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=ie({mutationFn:async p=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:u});return P},onSuccess:es,onError:c}),[g,f]=G.useState(""),[a,x]=G.useState(r.language==="pt-BR"?"brl":"usd"),u=a,v=parseFloat(g),C=!isNaN(v)&&v>=1,y=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let j,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ae,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),N=s.jsx(Ae,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=j,e[5]=N):(j=e[4],N=e[5]);let w;e[6]!==u||e[7]!==h?(w=s.jsxs(jt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:h,children:[j,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==y||e[11]!==o||e[12]!==d||e[13]!==t||e[14]!==l?(m=!o&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[y,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>n(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=y,e[11]=o,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==y||e[17]!==g||e[18]!==v||e[19]!==o||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:y}),s.jsx(ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:g,onChange:p=>f(p.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!C||d,onClick:()=>l(Math.round(v*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{n(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=y,e[17]=g,e[18]=v,e[19]=o,e[20]=C,e[21]=d,e[22]=f,e[23]=t,e[24]=l,e[25]=b):b=e[25];let S;return e[26]!==w||e[27]!==m||e[28]!==b?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w,m,b]})}),e[26]=w,e[27]=m,e[28]=b,e[29]=S):S=e[29],S}function es(e){e&&window.open(e,"_blank","noopener,noreferrer")}function ts(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function ss(e){const t=V.c(38),{enabled:i}=e,r=Q(),{org:o}=se(),n=te();let c;t[0]!==o.id?(c=X.aiProviderCredits(o.id,"deco"),t[0]=o.id,t[1]=c):c=t[1];let l;t[2]!==n?(l=async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=n,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:g,isLoading:f,refetch:a,isFetching:x}=pe(d);if(!i)return null;const u=g?.balanceCents!=null?g.balanceCents/100:null;let v;t[8]!==u?(v=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=v):v=t[9];const C=v;let y;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(y=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:re("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&ts(u)),children:C}),t[10]=u,t[11]=C,t[12]=x,t[13]=f,t[14]=y):y=t[14];let h;t[15]!==a?(h=()=>a(),t[15]=a,t[16]=h):h=t[16];let j;t[17]!==r?(j=r("settings.decoCreditsHero.refreshBalance"),t[17]=r,t[18]=j):j=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=re(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(Be,{size:14,className:w}),t[21]=w,t[22]=m):m=t[22];let b;t[23]!==x||t[24]!==m||t[25]!==h||t[26]!==j?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":j,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=j,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==y?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[y,b]}),t[28]=b,t[29]=y,t[30]=S):S=t[30];let p;t[31]!==r?(p=r("settings.decoCreditsHero.availableBalance"),t[31]=r,t[32]=p):p=t[32];let P;t[33]!==p?(P=s.jsx("p",{className:"text-xs text-muted-foreground",children:p}),t[33]=p,t[34]=P):P=t[34];let I;return t[35]!==S||t[36]!==P?(I=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[S,P]}),t[35]=S,t[36]=P,t[37]=I):I=t[37],I}function is(){const e=V.c(74),t=Q(),{org:i}=se(),r=te(),o=oe(),n=be();let c;e[0]!==n?(c=n.find(ls),e[0]=n,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,a]=G.useState(!1);let x;e[2]!==l||e[3]!==r?(x=async()=>{l&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=r,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==o||e[7]!==t?(u=()=>{o.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),o.invalidateQueries({queryKey:X.aiProviders(i.id)}),Z.success(t("settings.decoCreditsHero.disconnectSuccess")),a(!1)},e[5]=i,e[6]=o,e[7]=t,e[8]=u):u=e[8];let v;e[9]!==t?(v=z=>{Z.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==u||e[13]!==v?(C={mutationFn:x,onSuccess:u,onError:v},e[11]=x,e[12]=u,e[13]=v,e[14]=C):C=e[14];const{mutate:y,isPending:h}=ie(C);if(!l)return null;let j;e[15]!==t?(j=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=j):j=e[16];let N;e[17]!==t?(N=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=N):N=e[18];let w;e[19]!==N?(w=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:N,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=N,e[20]=w):w=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[21]=m):m=e[21];let b;e[22]!==t?(b=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=b):b=e[23];let S;e[24]!==h||e[25]!==b?(S=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:m,disabled:h,children:b}),e[24]=h,e[25]=b,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==w?(p=s.jsxs("div",{className:"flex items-center justify-between",children:[w,S]}),e[27]=S,e[28]=w,e[29]=p):p=e[29];let P;e[30]!==t?(P=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=P):P=e[31];let I;e[32]!==P?(I=s.jsx(je,{children:P}),e[32]=P,e[33]=I):I=e[33];let k;e[34]!==t?(k=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=k):k=e[35];let T;e[36]!==k?(T=s.jsx(ye,{children:k}),e[36]=k,e[37]=T):T=e[37];let A;e[38]!==I||e[39]!==T?(A=s.jsxs(Ne,{children:[I,T]}),e[38]=I,e[39]=T,e[40]=A):A=e[40];let U;e[41]!==t?(U=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=U):U=e[42];let E;e[43]!==U?(E=s.jsx(Se,{children:U}),e[43]=U,e[44]=E):E=e[44];let R;e[45]!==y?(R=()=>y(),e[45]=y,e[46]=R):R=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let B;e[49]!==R||e[50]!==$?(B=s.jsx(Ce,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=R,e[50]=$,e[51]=B):B=e[51];let O;e[52]!==E||e[53]!==B?(O=s.jsxs(Pe,{children:[E,B]}),e[52]=E,e[53]=B,e[54]=O):O=e[54];let F;e[55]!==A||e[56]!==O?(F=s.jsxs(_e,{children:[A,O]}),e[55]=A,e[56]=O,e[57]=F):F=e[57];let L;e[58]!==f||e[59]!==F?(L=s.jsx(Ie,{open:f,onOpenChange:a,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const q=!d;let D;e[61]!==q?(D=s.jsx(ss,{enabled:q}),e[61]=q,e[62]=D):D=e[62];let _;e[63]!==g||e[64]!==t?(_=g?s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:t("settings.decoCreditsHero.addCredits")}),s.jsx(Ze,{})]}):null,e[63]=g,e[64]=t,e[65]=_):_=e[65];let M;e[66]!==p||e[67]!==L||e[68]!==D||e[69]!==_?(M=s.jsx(de,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[p,L,D,_]})}),e[66]=p,e[67]=L,e[68]=D,e[69]=_,e[70]=M):M=e[70];let H;return e[71]!==M||e[72]!==j?(H=s.jsx(ae,{title:j,children:M}),e[71]=M,e[72]=j,e[73]=H):H=e[73],H}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[rs]=it(ke),[ns,as]=rs(ke),Xe=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:o,getValueLabel:n=os,...c}=e;(o||o===0)&&!Te(o)&&console.error(cs(`${o}`,"Progress"));const l=Te(o)?o:De;r!==null&&!Re(r,l)&&console.error(ds(`${r}`,"Progress"));const d=Re(r,l)?r:null,g=fe(d)?n(d,l):void 0;return s.jsx(ns,{scope:i,value:d,max:l,children:s.jsx(He.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":fe(d)?d:void 0,"aria-valuetext":g,role:"progressbar","data-state":tt(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});Xe.displayName=ke;var Je="ProgressIndicator",et=G.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,o=as(Je,i);return s.jsx(He.div,{"data-state":tt(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});et.displayName=Je;function os(e,t){return`${Math.round(e/t*100)}%`}function tt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function fe(e){return typeof e=="number"}function Te(e){return fe(e)&&!isNaN(e)&&e>0}function Re(e,t){return fe(e)&&!isNaN(e)&&e<=t&&e>=0}function cs(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${De}\`.`}function ds(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
1
|
+
import{c as V,b as Q,ac as Oe,ad as Fe,r as G,j as s,az as st,dP as Le,t as Z,dO as de,dN as ae,as as Be,M as se,_ as te,n as oe,e as ie,v as he,B as W,K as X,m as pe,ax as ue,l as re,cN as He,fj as it,eC as ve,ao as lt,L as rt,o as Ke,h as nt,aa as at,ab as xe,fi as ot}from"./index-z4bKt11m.js";import{i as ct}from"./AlertCircle-DbwtWnTP.js";import{u as qe,a as me,i as dt,b as ut,p as mt,e as be,f as ft,d as ze}from"./use-ai-providers-B0bxSHYG.js";import{i as pt}from"./CheckCircle-BKb1RVrA.js";import{d as gt,l as xt}from"./use-organization-settings-C-XY0Wze.js";import{S as ht}from"./schema-D0xfowSf.js";import{M as vt}from"./select-model-DcwphIdD.js";import{u as bt}from"./use-debounced-autosave-CyDohN_c.js";import{I as ce}from"./input-C7XH8Uj_.js";import{T as Ae,a as jt}from"./toggle-group-Ck5f9XVv.js";import{A as je,a as ye,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-Bi9Cy1y8.js";import{u as ge,d as we,a as Ve,e as yt}from"./use-entitlements-BWaaNeuI.js";import{i as Nt}from"./ChevronRight-DNrwFBnC.js";import{u as Ge}from"./use-open-billing-url-BGn9Wkis.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-C80Qcxkm.js";import{i as It}from"./Check-BZE0WrNL.js";import{a as wt,i as kt}from"./Tool01-DHi_Z7zo.js";import{s as Dt}from"./Plus-D2HOi_DD.js";import{s as Kt}from"./Trash01-C6bziN5X.js";import{A as At}from"./avatar-Duu5Gg02.js";import{u as Et,f as Tt}from"./use-date-fns-locale-PFUAQIxr.js";import{c as We,P as Rt,C as Ee}from"./decopilot-72HlEf1U.js";import{P as Ut}from"./ai-providers-logos-DD3qZ33J.js";import{i as Mt}from"./Settings02-CFcKewXh.js";import{s as $t}from"./Eye-DXUjft5i.js";import{d as Ot,c as Ft,b as Lt,D as Bt,e as Ht}from"./dialog-DbzCN1O8.js";import{R as qt}from"./require-capability-CjU7EXPP.js";import"./task-board-lQZGfEfb.js";import"./drawer-CBdcJytm.js";import"./use-mobile-CV7f0Wqe.js";import"./chat-context-BBVkwd3p.js";import"./use-panel-navigate-BG4d0Vrr.js";import"./thread-route-B1EuqJlg.js";import"./use-project-scope-DRope0ob.js";import"./use-virtual-mcp-Bq1RMGPF.js";import"./use-mcp-client-B1u2B39v.js";import"./auth-D-2jYpOE.js";import"./github-repo-BknN0SVI.js";import"./autosend-D-BN-cv5.js";import"./thread-intent-9fI0jPLV.js";import"./slugify-CEUa2lfQ.js";import"./hooks-CkL4R3Tj.js";import"./backoff-8mStPHYB.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-_O_0AHeH.js";import"./index-CULK6hDm.js";import"./User01-BbOpA84p.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-Dkejdmst.js";import"./select-cIekAVlM.js";import"./index-B46P4HkV.js";import"./ChevronUp-D5_IWEtB.js";import"./ArrowLeft-CyH6aWpS.js";import"./ChevronSelectorVertical-oXn0cTzk.js";import"./Key01-mqjfsZRe.js";import"./SearchMd-FDCJM3CR.js";import"./Monitor01-CQ6Zk1oP.js";import"./download-app-dialog-Bsig7tOs.js";import"./Copy01-DTHuBaTA.js";import"./Download01-qX3hmvr5.js";import"./Image01-DfaxHjlV.js";import"./Stars01-B_nM3FYf.js";import"./X-Bzh3NI3m.js";import"./access-gate-NMf18NsK.js";import"./capability-load-error-L3ivCxmO.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>dt(e),Gt=e=>ut(e),Qt=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:zt},{key:"web_search",filter:Vt},{key:"deep_research",filter:Gt}];function Yt(e){const t=V.c(30),{slot:i,onSlotChange:r,filterModels:o,defaultKeyId:n}=e,c=qe(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??n);let f,a;t[0]!==l?(f=()=>{l&&g(l)},a=[l],t[0]=l,t[1]=f,t[2]=a):(f=t[1],a=t[2]),G.useEffect(f,a);let x;t[3]!==c||t[4]!==n||t[5]!==d?(x=c.some(I=>I.id===d)?d:n,t[3]=c,t[4]=n,t[5]=d,t[6]=x):x=t[6];const u=x;let v;t[7]!==u||t[8]!==c?(v=u?c.find(I=>I.id===u):null,t[7]=u,t[8]=c,t[9]=v):v=t[9];const C=v,{models:y,isLoading:h}=me(o?u??void 0:void 0),j=o?h||y.some(o):!0;let N;t[10]!==i||t[11]!==C?.providerId||t[12]!==l?(N=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:C?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[10]=i,t[11]=C?.providerId,t[12]=l,t[13]=N):N=t[13];const w=N,m=Q();if(o&&!j){let I;t[14]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[14]=m,t[15]=I):I=t[15];let k;return t[16]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[16]=I,t[17]=k):k=t[17],k}let b;t[18]!==m?(b=m("settings.simpleModeSection.pickModel"),t[18]=m,t[19]=b):b=t[19];let S;t[20]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[20]=S):S=t[20];let p;t[21]!==u||t[22]!==r?(p=I=>{const k=I.keyId??u??"";g(k),r({keyId:k,modelId:I.modelId,title:I.title})},t[21]=u,t[22]=r,t[23]=p):p=t[23];let P;return t[24]!==u||t[25]!==o||t[26]!==w||t[27]!==b||t[28]!==p?(P=s.jsx(vt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:o,onCredentialChange:S,onModelChange:p}),t[24]=u,t[25]=o,t[26]=w,t[27]=b,t[28]=p,t[29]=P):P=t[29],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:r}=e,o=Q();if(i){let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(Be,{size:12,className:"animate-spin"}),t[0]=n):n=t[0];let c;t[1]!==o?(c=o("settings.simpleModeSection.saving"),t[1]=o,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[3]=c,t[4]=l):l=t[4],l}if(r){let n;t[5]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsx(pt,{size:12}),t[5]=n):n=t[5];let c;t[6]!==o?(c=o("settings.simpleModeSection.saved"),t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[n,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Zt(){const e=V.c(58),t=Q(),i=qe(),r=gt(),o=i.length>0;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=Oe(ht),e[0]=n):n=e[0];let c;e[1]!==r?(c={resolver:n,values:r,mode:"onChange"},e[1]=r,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=xt(),a=l.formState.isDirty;let x;e[3]!==l||e[4]!==r||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(r),Z.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=r,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=bt(x),v=i[0],C=i[1],y=i[2],{models:h}=me(v?.id),{models:j}=me(C?.id),{models:N}=me(y?.id);let w,m;e[8]!==l||e[9]!==o?(w=()=>{o||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[o,l],e[8]=l,e[9]=o,e[10]=w,e[11]=m):(w=e[10],m=e[11]),G.useEffect(w,m);let b;e[12]!==i||e[13]!==l||e[14]!==v||e[15]!==C||e[16]!==y||e[17]!==h||e[18]!==j||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Xt)),H={};v?.id&&(H[v.id]=h),C?.id&&(H[C.id]=j),y?.id&&(H[y.id]=N);const z=le=>le!=null&&!M.has(le.keyId),K={fast:z(_.tiers.fast)?null:_.tiers.fast,smart:z(_.tiers.smart)?null:_.tiers.smart,thinking:z(_.tiers.thinking)?null:_.tiers.thinking,image:z(_.tiers.image)?null:_.tiers.image,web_search:z(_.tiers.web_search)?null:_.tiers.web_search,deep_research:z(_.tiers.deep_research)?null:_.tiers.deep_research},Y=!K.fast||!K.smart||!K.thinking||!K.image||!K.web_search||!K.deep_research,J=K.fast===_.tiers.fast&&K.smart===_.tiers.smart&&K.thinking===_.tiers.thinking&&K.image===_.tiers.image&&K.web_search===_.tiers.web_search&&K.deep_research===_.tiers.deep_research;if(!Y&&J)return;const ee=mt(i,H);l.reset({tiers:{fast:K.fast??ee.chat.fast,smart:K.smart??ee.chat.smart,thinking:K.thinking??ee.chat.thinking,image:K.image??ee.image,web_search:K.web_search??ee.webSearch,deep_research:K.deep_research??ee.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=v,e[15]=C,e[16]=y,e[17]=h,e[18]=j,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=y?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==j||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,j,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=j,e[25]=N,e[26]=S,e[27]=p,e[28]=P,e[29]=I):I=e[29],G.useEffect(b,I);let k;e[30]!==t?(k=_=>({fast:t("settings.simpleModeSection.tierFast"),smart:t("settings.simpleModeSection.tierSmart"),thinking:t("settings.simpleModeSection.tierThinking"),image:t("settings.simpleModeSection.tierImage"),web_search:t("settings.simpleModeSection.tierWebSearch"),deep_research:t("settings.simpleModeSection.tierDeepResearch")})[_]||_,e[30]=t,e[31]=k):k=e[31];const T=k;let A;e[32]!==t?(A=_=>({fast:t("settings.simpleModeSection.tierFastDesc"),smart:t("settings.simpleModeSection.tierSmartDesc"),thinking:t("settings.simpleModeSection.tierThinkingDesc"),image:t("settings.simpleModeSection.tierImageDesc"),web_search:t("settings.simpleModeSection.tierWebSearchDesc"),deep_research:t("settings.simpleModeSection.tierDeepResearchDesc")})[_]||"",e[32]=t,e[33]=A):A=e[33];const U=A;let E;e[34]!==t?(E=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=E):E=e[35];let R;e[36]!==t?(R=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=R):R=e[37];let $;e[38]!==R?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:R}),e[38]=R,e[39]=$):$=e[39];const B=f&&!a;let O;e[40]!==g||e[41]!==B?(O=s.jsx(Wt,{isPending:g,showSaved:B}),e[40]=g,e[41]=B,e[42]=O):O=e[42];let F;e[43]!==$||e[44]!==O?(F=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[$,O]}),e[43]=$,e[44]=O,e[45]=F):F=e[45];let L;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==U||e[49]!==T||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:H}=M;return s.jsx(Le,{title:T(_.key),description:U(_.key),action:s.jsx(Yt,{slot:H.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{H.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=T,e[50]=u,e[51]=L):L=e[51];let q;e[52]!==L?(q=s.jsx(de,{children:L}),e[52]=L,e[53]=q):q=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==q?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,q]}),e[54]=E,e[55]=F,e[56]=q,e[57]=D):D=e[57],D}function Xt(e){return e.id}const Jt={usd:[10,20,100],brl:[50,100,500]};function Ze(){const e=V.c(30),t=Q(),i=te(),[r]=he(),[o,n]=G.useState(!1);let c;e[0]!==t?(c=p=>{Z.error(t("settings.decoCreditsHero.topUpFailed",{message:p.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=ie({mutationFn:async p=>{const{url:P}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:p,currency:u});return P},onSuccess:es,onError:c}),[g,f]=G.useState(""),[a,x]=G.useState(r.language==="pt-BR"?"brl":"usd"),u=a,v=parseFloat(g),C=!isNaN(v)&&v>=1,y=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let j,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(Ae,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),N=s.jsx(Ae,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=j,e[5]=N):(j=e[4],N=e[5]);let w;e[6]!==u||e[7]!==h?(w=s.jsxs(jt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:h,children:[j,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==y||e[11]!==o||e[12]!==d||e[13]!==t||e[14]!==l?(m=!o&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[y,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>n(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=y,e[11]=o,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==y||e[17]!==g||e[18]!==v||e[19]!==o||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:y}),s.jsx(ce,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:g,onChange:p=>f(p.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!C||d,onClick:()=>l(Math.round(v*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{n(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=y,e[17]=g,e[18]=v,e[19]=o,e[20]=C,e[21]=d,e[22]=f,e[23]=t,e[24]=l,e[25]=b):b=e[25];let S;return e[26]!==w||e[27]!==m||e[28]!==b?(S=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[w,m,b]})}),e[26]=w,e[27]=m,e[28]=b,e[29]=S):S=e[29],S}function es(e){e&&window.open(e,"_blank","noopener,noreferrer")}function ts(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function ss(e){const t=V.c(38),{enabled:i}=e,r=Q(),{org:o}=se(),n=te();let c;t[0]!==o.id?(c=X.aiProviderCredits(o.id,"deco"),t[0]=o.id,t[1]=c):c=t[1];let l;t[2]!==n?(l=async()=>{try{return await n.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=n,t[3]=l):l=t[3];let d;t[4]!==i||t[5]!==c||t[6]!==l?(d={queryKey:c,enabled:i,staleTime:6e4,queryFn:l},t[4]=i,t[5]=c,t[6]=l,t[7]=d):d=t[7];const{data:g,isLoading:f,refetch:a,isFetching:x}=pe(d);if(!i)return null;const u=g?.balanceCents!=null?g.balanceCents/100:null;let v;t[8]!==u?(v=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=v):v=t[9];const C=v;let y;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(y=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:re("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&ts(u)),children:C}),t[10]=u,t[11]=C,t[12]=x,t[13]=f,t[14]=y):y=t[14];let h;t[15]!==a?(h=()=>a(),t[15]=a,t[16]=h):h=t[16];let j;t[17]!==r?(j=r("settings.decoCreditsHero.refreshBalance"),t[17]=r,t[18]=j):j=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=re(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(Be,{size:14,className:w}),t[21]=w,t[22]=m):m=t[22];let b;t[23]!==x||t[24]!==m||t[25]!==h||t[26]!==j?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":j,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=j,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==y?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[y,b]}),t[28]=b,t[29]=y,t[30]=S):S=t[30];let p;t[31]!==r?(p=r("settings.decoCreditsHero.availableBalance"),t[31]=r,t[32]=p):p=t[32];let P;t[33]!==p?(P=s.jsx("p",{className:"text-xs text-muted-foreground",children:p}),t[33]=p,t[34]=P):P=t[34];let I;return t[35]!==S||t[36]!==P?(I=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[S,P]}),t[35]=S,t[36]=P,t[37]=I):I=t[37],I}function is(){const e=V.c(74),t=Q(),{org:i}=se(),r=te(),o=oe(),n=be();let c;e[0]!==n?(c=n.find(ls),e[0]=n,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,a]=G.useState(!1);let x;e[2]!==l||e[3]!==r?(x=async()=>{l&&await r.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=r,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==o||e[7]!==t?(u=()=>{o.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),o.invalidateQueries({queryKey:X.aiProviders(i.id)}),Z.success(t("settings.decoCreditsHero.disconnectSuccess")),a(!1)},e[5]=i,e[6]=o,e[7]=t,e[8]=u):u=e[8];let v;e[9]!==t?(v=z=>{Z.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=v):v=e[10];let C;e[11]!==x||e[12]!==u||e[13]!==v?(C={mutationFn:x,onSuccess:u,onError:v},e[11]=x,e[12]=u,e[13]=v,e[14]=C):C=e[14];const{mutate:y,isPending:h}=ie(C);if(!l)return null;let j;e[15]!==t?(j=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=j):j=e[16];let N;e[17]!==t?(N=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=N):N=e[18];let w;e[19]!==N?(w=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:N,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=N,e[20]=w):w=e[20];let m;e[21]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),e[21]=m):m=e[21];let b;e[22]!==t?(b=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=b):b=e[23];let S;e[24]!==h||e[25]!==b?(S=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:m,disabled:h,children:b}),e[24]=h,e[25]=b,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==w?(p=s.jsxs("div",{className:"flex items-center justify-between",children:[w,S]}),e[27]=S,e[28]=w,e[29]=p):p=e[29];let P;e[30]!==t?(P=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=P):P=e[31];let I;e[32]!==P?(I=s.jsx(je,{children:P}),e[32]=P,e[33]=I):I=e[33];let k;e[34]!==t?(k=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=k):k=e[35];let T;e[36]!==k?(T=s.jsx(ye,{children:k}),e[36]=k,e[37]=T):T=e[37];let A;e[38]!==I||e[39]!==T?(A=s.jsxs(Ne,{children:[I,T]}),e[38]=I,e[39]=T,e[40]=A):A=e[40];let U;e[41]!==t?(U=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=U):U=e[42];let E;e[43]!==U?(E=s.jsx(Se,{children:U}),e[43]=U,e[44]=E):E=e[44];let R;e[45]!==y?(R=()=>y(),e[45]=y,e[46]=R):R=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let B;e[49]!==R||e[50]!==$?(B=s.jsx(Ce,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=R,e[50]=$,e[51]=B):B=e[51];let O;e[52]!==E||e[53]!==B?(O=s.jsxs(Pe,{children:[E,B]}),e[52]=E,e[53]=B,e[54]=O):O=e[54];let F;e[55]!==A||e[56]!==O?(F=s.jsxs(_e,{children:[A,O]}),e[55]=A,e[56]=O,e[57]=F):F=e[57];let L;e[58]!==f||e[59]!==F?(L=s.jsx(Ie,{open:f,onOpenChange:a,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const q=!d;let D;e[61]!==q?(D=s.jsx(ss,{enabled:q}),e[61]=q,e[62]=D):D=e[62];let _;e[63]!==g||e[64]!==t?(_=g?s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:t("settings.decoCreditsHero.addCredits")}),s.jsx(Ze,{})]}):null,e[63]=g,e[64]=t,e[65]=_):_=e[65];let M;e[66]!==p||e[67]!==L||e[68]!==D||e[69]!==_?(M=s.jsx(de,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[p,L,D,_]})}),e[66]=p,e[67]=L,e[68]=D,e[69]=_,e[70]=M):M=e[70];let H;return e[71]!==M||e[72]!==j?(H=s.jsx(ae,{title:j,children:M}),e[71]=M,e[72]=j,e[73]=H):H=e[73],H}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[rs]=it(ke),[ns,as]=rs(ke),Xe=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:r=null,max:o,getValueLabel:n=os,...c}=e;(o||o===0)&&!Te(o)&&console.error(cs(`${o}`,"Progress"));const l=Te(o)?o:De;r!==null&&!Re(r,l)&&console.error(ds(`${r}`,"Progress"));const d=Re(r,l)?r:null,g=fe(d)?n(d,l):void 0;return s.jsx(ns,{scope:i,value:d,max:l,children:s.jsx(He.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":fe(d)?d:void 0,"aria-valuetext":g,role:"progressbar","data-state":tt(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});Xe.displayName=ke;var Je="ProgressIndicator",et=G.forwardRef((e,t)=>{const{__scopeProgress:i,...r}=e,o=as(Je,i);return s.jsx(He.div,{"data-state":tt(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});et.displayName=Je;function os(e,t){return`${Math.round(e/t*100)}%`}function tt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function fe(e){return typeof e=="number"}function Te(e){return fe(e)&&!isNaN(e)&&e>0}function Re(e,t){return fe(e)&&!isNaN(e)&&e<=t&&e>=0}function cs(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${De}\`.`}function ds(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2
2
|
- a positive number
|
|
3
3
|
- less than the value passed to \`max\` (or ${De} if no \`max\` prop is set)
|
|
4
4
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as o,j as c,aq as d}from"./index-
|
|
1
|
+
import{c as n,l as o,j as c,aq as d}from"./index-z4bKt11m.js";const u=d("relative w-full rounded-lg border px-4 py-3 text-sm flex items-start gap-3 [&>svg]:size-4 [&>svg]:flex-shrink-0 [&>svg]:mt-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-destructive/5 text-destructive border-destructive/25 [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90",warning:"bg-warning/10 text-warning-foreground border-warning [&>svg]:text-current *:data-[slot=alert-description]:text-warning-foreground/90",success:"bg-success/10 text-success-foreground border-success [&>svg]:text-current *:data-[slot=alert-description]:text-success-foreground/90",info:"bg-card text-card-foreground border-border [&>svg]:text-current *:data-[slot=alert-description]:text-muted-foreground/90"}},defaultVariants:{variant:"default"}});function f(l){const e=n.c(10);let t,r,s;e[0]!==l?({className:t,variant:s,...r}=l,e[0]=l,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);let a;e[4]!==t||e[5]!==s?(a=o(u({variant:s}),t),e[4]=t,e[5]=s,e[6]=a):a=e[6];let i;return e[7]!==r||e[8]!==a?(i=c.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=i):i=e[9],i}function x(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("line-clamp-1 min-h-4 font-medium tracking-tight",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-title",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}function v(l){const e=n.c(8);let t,r;e[0]!==l?({className:t,...r}=l,e[0]=l,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=o("text-muted-foreground leading-relaxed",t),e[3]=t,e[4]=s):s=e[4];let a;return e[5]!==r||e[6]!==s?(a=c.jsx("div",{"data-slot":"alert-description",className:s,...r}),e[5]=r,e[6]=s,e[7]=a):a=e[7],a}export{v as A,f as a,x as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r,aW as w,r as i,b1 as m,d1 as T,ae as O,b4 as M,aX as I,aY as z,b0 as A,d2 as D,aZ as F,d3 as L,bk as k,a$ as G,a_ as W,c as n,l as p,ah as v}from"./index-
|
|
1
|
+
import{j as r,aW as w,r as i,b1 as m,d1 as T,ae as O,b4 as M,aX as I,aY as z,b0 as A,d2 as D,aZ as F,d3 as L,bk as k,a$ as G,a_ as W,c as n,l as p,ah as v}from"./index-z4bKt11m.js";var x="AlertDialog",[Y]=k(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(w,{...a,...t,modal:!0})};N.displayName=x;var H="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});V.displayName=H;var q="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};y.displayName=q;var B="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(W,{...o,...a,ref:e})});_.displayName=B;var f="AlertDialogContent",[X,Z]=Y(f),J=L("AlertDialogContent"),j=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,children:a,...o}=l,s=d(t),c=i.useRef(null),P=m(e,c),u=i.useRef(null);return r.jsx(T,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(X,{scope:t,cancelRef:u,children:r.jsxs(O,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:M(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(J,{children:a}),r.jsx(Q,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(z,{...o,...a,ref:e})});R.displayName=E;var K="AlertDialogAction",$=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});$.displayName=K;var C="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=Z(C,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=C;var Q=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,M as Q,x as R,K as Y,m as ce,n as U,e as V,j as i,fi as de,b as F,r as O,dN as me,eC as J,B as N,t as q}from"./index-Cjhl57C5.js";import{i as fe}from"./AlertCircle-Ddrj7VUD.js";import{a as ue}from"./Copy01-l6PfB431.js";import{i as W}from"./Key01-ti2CpCiW.js";import{s as X}from"./Plus-C5azC59K.js";import{s as ge}from"./Trash01-DPQmLNZV.js";import{f as pe,e as xe,b as ye,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-DfGZ77rh.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-SKkzdrcZ.js";import{I as le}from"./input-CImpk8th.js";import{L as De}from"./label-Bk7iLZH7.js";import{u as M}from"./use-mcp-client-Bf0VpOBw.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=M(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return H(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return H(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function Ne(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function ve(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(W,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(W,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(N,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let x;e[18]!==l?(x=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=x):x=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let y;e[21]!==p||e[22]!==x?(y=i.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":x,children:C}),e[21]=p,e[22]=x,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,y]}),e[24]=y,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(N,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==p?(x=i.jsx(Z,{children:p}),e[13]=p,e[14]=x):x=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let y;e[17]!==C?(y=i.jsx(ee,{children:C}),e[17]=C,e[18]=y):y=e[18];let h;e[19]!==x||e[20]!==y?(h=i.jsxs(te,{children:[x,y]}),e[19]=x,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=z=>c(z.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let v;e[32]!==K||e[33]!==S?(v=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=v):v=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(N,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(N,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==v||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[v,k]}),e[53]=g,e[54]=v,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:L}),e[60]=a,e[61]=L,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=Ne(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(N,{onClick:()=>n(!0),size:"sm",children:[i.jsx(X,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(ve,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(xe,{children:[i.jsxs(ye,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
1
|
+
import{c as A,M as Q,x as R,K as Y,m as ce,n as U,e as V,j as i,fi as de,b as F,r as O,dN as me,eC as J,B as N,t as q}from"./index-z4bKt11m.js";import{i as fe}from"./AlertCircle-DbwtWnTP.js";import{a as ue}from"./Copy01-DTHuBaTA.js";import{i as W}from"./Key01-mqjfsZRe.js";import{s as X}from"./Plus-D2HOi_DD.js";import{s as ge}from"./Trash01-C6bziN5X.js";import{f as pe,e as xe,b as ye,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-Bi9Cy1y8.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-DbzCN1O8.js";import{I as le}from"./input-C7XH8Uj_.js";import{L as De}from"./label-8juC5J-g.js";import{u as M}from"./use-mcp-client-B1u2B39v.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=M(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return H(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return H(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function Ne(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(fe,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function ve(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(W,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let u;e[13]===Symbol.for("react.memo_cache_sentinel")?(u=i.jsx(ge,{size:14}),e[13]=u):u=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(N,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:u}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let f;return e[17]!==d||e[18]!==g?(f=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=f):f=e[19],f}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(W,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[12]=m):m=e[12];let u;e[13]!==r?(u=r("settings.apiKeys.newKey"),e[13]=r,e[14]=u):u=e[14];let g;e[15]!==a||e[16]!==u?(g=i.jsxs(N,{onClick:a,size:"sm",className:"mt-2",children:[m,u]}),e[15]=a,e[16]=u,e[17]=g):g=e[17];let f;return e[18]!==d||e[19]!==g?(f=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=f):f=e[20],f}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let u;e[10]!==o||e[11]!==m?(u=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=u):u=e[12];const g=a?.key??"";let f;e[13]!==g?(f=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=f):f=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let x;e[18]!==l?(x=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=x):x=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(ue,{size:14}),e[20]=C):C=e[20];let y;e[21]!==p||e[22]!==x?(y=i.jsx(N,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":x,children:C}),e[21]=p,e[22]=x,e[23]=y):y=e[23];let h;e[24]!==y||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,y]}),e[24]=y,e[25]=f,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(N,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==u?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[u,h,K]}),e[32]=h,e[33]=K,e[34]=u,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let u;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(u=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=u):u=e[7];const g=u;let f;e[8]!==m||e[9]!==r?(f=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=f):f=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let x;e[13]!==p?(x=i.jsx(Z,{children:p}),e[13]=p,e[14]=x):x=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let y;e[17]!==C?(y=i.jsx(ee,{children:C}),e[17]=C,e[18]=y):y=e[18];let h;e[19]!==x||e[20]!==y?(h=i.jsxs(te,{children:[x,y]}),e[19]=x,e[20]=y,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=z=>c(z.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let v;e[32]!==K||e[33]!==S?(v=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=v):v=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(N,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(N,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==v||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[v,k]}),e[53]=g,e[54]=v,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:L}),e[60]=a,e[61]=L,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=Ne(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),u=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(f){q.error(f instanceof Error?f.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:u.length>0?i.jsxs(N,{onClick:()=>n(!0),size:"sm",children:[i.jsx(X,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&u.length===0?i.jsx(ae,{error:r}):u.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:u.map(f=>i.jsx(ve,{apiKey:f,onDelete:()=>m(f)},f.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:f=>{f||m(null)},children:i.jsxs(xe,{children:[i.jsxs(ye,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o,j as r}from"./index-z4bKt11m.js";import{O as m}from"./api-keys-BlYGdiam.js";import{R as p}from"./require-capability-CjU7EXPP.js";import"./AlertCircle-DbwtWnTP.js";import"./Copy01-DTHuBaTA.js";import"./Key01-mqjfsZRe.js";import"./Plus-D2HOi_DD.js";import"./Trash01-C6bziN5X.js";import"./alert-dialog-Bi9Cy1y8.js";import"./dialog-DbzCN1O8.js";import"./X-Bzh3NI3m.js";import"./input-C7XH8Uj_.js";import"./label-8juC5J-g.js";import"./use-mcp-client-B1u2B39v.js";import"./auth-D-2jYpOE.js";import"./access-gate-NMf18NsK.js";import"./capability-load-error-L3ivCxmO.js";function A(){const t=o.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(p,{capability:"api-keys:manage",area:"api-keys",children:r.jsx(m,{})}),t[0]=i):i=t[0],i}export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as jt,b as Bt,r as A,j as o,l as wt,h as _t,t as ht}from"./index-z4bKt11m.js";import{u as At}from"./chat-context-BBVkwd3p.js";import{i as Et}from"./ChevronRight-DNrwFBnC.js";import{S as Nt}from"./scroll-area-BqCCUXvj.js";import{u as Rt,A as Tt}from"./use-section-preview-base-Dwn5dF7B.js";import{o as Ct}from"./claim-phase-copy-0btUuJoC.js";import{h as Kt,u as Pt,w as Ft,aM as Ot,x as Ut,d as $t,aN as It}from"./runnable-block-editor-CCXhy-vO.js";import{n as zt,r as Lt}from"./agent-site-editor-content-C3uy2bqp.js";import"./use-panel-navigate-BG4d0Vrr.js";import"./thread-route-B1EuqJlg.js";import"./use-project-scope-DRope0ob.js";import"./use-virtual-mcp-Bq1RMGPF.js";import"./use-mcp-client-B1u2B39v.js";import"./auth-D-2jYpOE.js";import"./github-repo-BknN0SVI.js";import"./autosend-D-BN-cv5.js";import"./thread-intent-9fI0jPLV.js";import"./slugify-CEUa2lfQ.js";import"./hooks-CkL4R3Tj.js";import"./backoff-8mStPHYB.js";import"./task-board-lQZGfEfb.js";import"./schema-D0xfowSf.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-BWaaNeuI.js";import"./use-ai-providers-B0bxSHYG.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-_O_0AHeH.js";import"./use-organization-settings-C-XY0Wze.js";import"./select-cIekAVlM.js";import"./index-B46P4HkV.js";import"./Check-BZE0WrNL.js";import"./ChevronUp-D5_IWEtB.js";import"./agent-icon-BD4DM2Lv.js";import"./AlertCircle-DbwtWnTP.js";import"./Tool01-DHi_Z7zo.js";import"./ArrowUp-Scf6R8DX.js";import"./ArrowLeft-CyH6aWpS.js";import"./Tool02-JY0gm8cg.js";import"./ArrowRight-Bv0iX4wy.js";import"./TrendUp01-Bkdgpfn7.js";import"./ZoomOut-BRjMa-04.js";import"./Users03-BP-0DNhp.js";import"./CheckCircle-BKb1RVrA.js";import"./ChevronSelectorVertical-oXn0cTzk.js";import"./DotsVertical-DE9eZKrJ.js";import"./UserSquare-qgzToKNd.js";import"./Copy01-DTHuBaTA.js";import"./CreditCard01-CwX6pA0M.js";import"./Database01-RGlwXHSd.js";import"./MessageCircle01-CgotMmLL.js";import"./Download01-qX3hmvr5.js";import"./Printer-BpZBiqyG.js";import"./Settings02-CFcKewXh.js";import"./Eye-DXUjft5i.js";import"./File02-g-xJPix_.js";import"./Share07-CxuHcmnM.js";import"./GitBranch01-ddoPQdPH.js";import"./Globe01-DIy8wXF6.js";import"./SwitchHorizontal01-hHr6GOmU.js";import"./HardDrive-DU_z1AQw.js";import"./Image01-DfaxHjlV.js";import"./Key01-mqjfsZRe.js";import"./Link01-C656VtHx.js";import"./LinkExternal01-BkRUjBAn.js";import"./Monitor01-CQ6Zk1oP.js";import"./Sun-SBoG-e9B.js";import"./Package-t6euxYcP.js";import"./Palette-oECS8j3l.js";import"./Play-DQgzDnaW.js";import"./Plus-D2HOi_DD.js";import"./SearchLg-DbX4T5E-.js";import"./SearchMd-FDCJM3CR.js";import"./Shield01-HrKG6yUn.js";import"./Stars01-B_nM3FYf.js";import"./Trash01-C6bziN5X.js";import"./Upload01-DC2spim9.js";import"./User01-BbOpA84p.js";import"./Users01-BOsDT0Jv.js";import"./XCircle-CuK2q_XU.js";import"./XClose-Cvyz3reC.js";import"./X-Bzh3NI3m.js";import"./Zap-DXNovEva.js";import"./dialog-DbzCN1O8.js";import"./input-C7XH8Uj_.js";import"./section-preview-url-Csj0_ZDg.js";import"./use-session-runtime-DU2zS-3V.js";import"./decofile-api-BVqR93jw.js";import"./utils-CU3t1jst.js";import"./sandbox-url-D3mC8qhT.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-B2TMNGEX.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-n44mVpiB.js";import"./use-copy-DUiBegp6.js";import"./usage-stats-waRf4dtg.js";import"./markdown-BhLIBmBv.js";import"./org-file-open-context-BgiBbqKQ.js";import"./use-mobile-CV7f0Wqe.js";import"./tooltip-BuKeolDX.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DjwQ0S-h.js";import"./types-Bh4jNqv3.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-CFIpVRaR.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./shell-layout-DMJSwXH6.js";import"./avatar-Duu5Gg02.js";import"./download-app-dialog-Bsig7tOs.js";import"./anchors-yqDzZN4K.js";import"./use-org-notice-C5thI8aD.js";import"./command-palette-store-LVCQ6fRv.js";import"./command-D2fiEFer.js";import"./index-Cyoz5tz5.js";import"./integration-icon-DOHTaQ6D.js";import"./project-icon-Cw3la58q.js";import"./required-auth-layout-WkX8CtfT.js";import"./use-org-sso-vHIufIoJ.js";import"./sheet-DhNzwMUj.js";import"./use-connection-CPQUKm0a.js";import"./use-navigate-to-agent-BMSyO1iB.js";import"./use-mcp-prompts-DxT8Kz-M.js";import"./index-CuiP-22D.js";import"./form-B7dtslOD.js";import"./label-8juC5J-g.js";import"./use-thread-outputs-DAcljy5D.js";import"./file-type-icon-C37FwvPU.js";import"./popover-CsEsUqbZ.js";import"./monaco-editor-BHu8MLvz.js";import"./editor-CpBx0ZCm.js";import"./calendar-Dyov14Y_.js";import"./textarea-BEOceSll.js";import"./rich-text-link-control-DgGIjR0I.js";import"./switch-9PLadaw_.js";import"./safe-image-url-D5z803Ot.js";import"./dropdown-menu-Dd8nakK9.js";import"./search-input-DpLbMQRj.js";import"./tabs-Co2GUrNY.js";import"./use-debounced-value-DeY1TNRX.js";import"./use-file-configs-sqbLS09v.js";import"./asset-utils-syVIRo9d.js";import"./useInfiniteQuery-C6OBOha-.js";import"./infiniteQueryObserver-BjcfJE2O.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-Ck5f9XVv.js";import"./alert-dialog-Bi9Cy1y8.js";import"./sandbox-git-api-CMdpE2TE.js";import"./agent-view-guard-q_9RifUL.js";import"./use-main-panel-tabs-CyT7yQAB.js";import"./use-route-default-main-DBXt2fvS.js";import"./use-mcp-tools-Ch_j97A3.js";import"./index-BFjKFLU3.js";import"./drawer-CBdcJytm.js";import"./collection-search-CeA9TK20.js";import"./input-I71U33T1.js";import"./chat-draft-bAtYgASI.js";import"./use-deco-credits-Du6WCMYS.js";import"./use-open-billing-url-BGn9Wkis.js";import"./decopilot-72HlEf1U.js";import"./checkbox-Dkejdmst.js";import"./ai-providers-logos-DD3qZ33J.js";import"./index-CULK6hDm.js";import"./input-CSQboV8k.js";import"./hooks-D09Ti1PG.js";import"./use-org-fs-D6lKuMAi.js";import"./question-004-sINsf4GQ.js";import"./use-members-H3oi0qPu.js";import"./use-org-auth-client-ZxEGrzhh.js";import"./feature-paywall-BOwjYKin.js";import"./plan-ladder-C80Qcxkm.js";import"./add-connection-dialog-GfufFuLz.js";import"./extract-connection-data-CM8c_Wvw.js";import"./metadata-dUsYcpuu.js";import"./github-D4UJ99TO.js";import"./connection-BfiO32wM.js";import"./connection-card-83VJQMov.js";import"./use-registry-connections-D_a0MIjQ.js";import"./retry-i8LvYSZg.js";import"./connection-slug-CITJ0kGN.js";import"./connection-form-helpers-Ms_1nBbP.js";import"./authenticate-and-persist-oauth-2yRhuiER.js";import"./mcp-oauth-DiqQlKOx.js";import"./collection-tabs-3kW0qDG6.js";import"./badge-BNBGXxmC.js";import"./use-infinite-scroll-RrOnf-fI.js";import"./useSuspenseInfiniteQuery-XFcbI_PD.js";import"./sandbox-lifecycle-context-DL9kkwoa.js";import"./use-task-metadata-9gheSHac.js";import"./use-project-native-view-presence-0NQTfFQT.js";import"./site-slug-uya6Wp4-.js";import"./virtual-mcp-BYPZngzy.js";import"./feature-gate-BURkiaEd.js";import"./mustache-DtVu96DY.js";import"./empty-state-BIcQyeij.js";import"./github-icon-BcrkxW36.js";import"./repository-import-picker-C0YugeGx.js";import"./repository-picker-BaqWNwxf.js";function Vt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",p=zt(t,i);return{blockKey:p,data:{__resolveType:n.resolveType,name:p}}}function Ei(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:p,blockKey:s,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=At()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==Z||t[4]!==a||t[5]!==v?(R=Lt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Ct(s,x,a):s);let C;t[9]!==p||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:p},t[9]=p,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Kt(C);let K;t[13]!==p||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:p},t[13]=p,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=Pt(K);let P;t[17]!==S?(P=$t((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(s),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),O=A.useRef(null);vt!==s&&(St(s),ut(null),ft(Mt),xt([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const rt=U;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let $;t[24]!==rt||t[25]!==y?($={...rt,...y},t[24]=rt,t[25]=y,t[26]=$):$=t[26];const it=$;let I;t[27]!==s||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(s,{...r,__resolveType:v})},t[27]=s,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{O.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const pt=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=O.current;if(r)try{await k(e,u=>{r(u),d(!1),O.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const st=q,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=Ft(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:Ot(g,r)),ft(qt)},title:f,className:wt("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let j;t[42]!==W?(j=o.jsx(It,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let w;t[47]!==s||t[48]!==p||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==pt||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(w=o.jsx(Nt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ut,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:pt,sandbox:{orgSlug:m,virtualMcpId:i,branch:p,threadId:G}},`${s}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(_t,{className:"size-4"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=s,t[48]=p,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=pt,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=w):w=t[67];let _;t[68]!==ot||t[69]!==l||t[70]!==st||t[71]!==a||t[72]!==h||t[73]!==d?(_=h&&o.jsx(Tt,{open:ot,onOpenChange:e=>{d(e),e||(O.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{st(e)}}),t[68]=ot,t[69]=l,t[70]=st,t[71]=a,t[72]=h,t[73]=d,t[74]=_):_=t[74];let M;return t[75]!==B||t[76]!==w||t[77]!==_?(M=o.jsxs("div",{className:gt,children:[B,w,_]}),t[75]=B,t[76]=w,t[77]=_,t[78]=M):M=t[78],M}function qt(n){return n+1}function Mt(n){return n+1}export{Ei as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,M as d,e as g,_ as m,K as I,n as O}from"./index-
|
|
1
|
+
import{c as u,M as d,e as g,_ as m,K as I,n as O}from"./index-z4bKt11m.js";import{u as $}from"./useInfiniteQuery-C6OBOha-.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function _(e){const t=e.split("/");return t[t.length-1]??e}function v(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,_ as b,F as c,S as e,v as f,w as i,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aC as v,aD as $,aE as W,aF as L,aG as H,aH as D,aI as V,aJ as x,aK as q,aL as j,aM as y,aN as N,aO as B,aP as F,aQ as Z}from"./index-Cjhl57C5.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
|
|
1
|
+
import{aC as v,aD as $,aE as W,aF as L,aG as H,aH as D,aI as V,aJ as x,aK as q,aL as j,aM as y,aN as N,aO as B,aP as F,aQ as Z}from"./index-z4bKt11m.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,P as d,me as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-
|
|
1
|
+
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-z4bKt11m.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
|