decocms 4.397.1 → 4.398.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-DwYUjJBu.js → AlertCircle-BQBmepo1.js} +1 -1
- package/dist/client/assets/{AreaChart-BhT_gWYN.js → AreaChart-Bnl86Bmb.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BrzmATFY.js → ArrowLeft-DHPtMbTg.js} +1 -1
- package/dist/client/assets/{ArrowRight-DYu8UyAE.js → ArrowRight-m94XgZ3O.js} +1 -1
- package/dist/client/assets/{ArrowUp-Bgr2TLsm.js → ArrowUp-DBDp30x0.js} +1 -1
- package/dist/client/assets/{CartesianChart-D3J9yYMj.js → CartesianChart-W8IwLG3F.js} +1 -1
- package/dist/client/assets/{Check-BgzQchyA.js → Check-Bcnv-H55.js} +1 -1
- package/dist/client/assets/{CheckCircle-DxLYuezp.js → CheckCircle-CySwUqst.js} +1 -1
- package/dist/client/assets/{ChevronUp-CEt2-KWf.js → ChevronUp-wyCoS3df.js} +1 -1
- package/dist/client/assets/{Copy01-DY06zeXh.js → Copy01-CMEvgxoC.js} +1 -1
- package/dist/client/assets/{CreditCard01-atzqozkq.js → CreditCard01-Bi7YfG5v.js} +1 -1
- package/dist/client/assets/{DotsVertical-DY1WVLqG.js → DotsVertical-B97QY-fA.js} +1 -1
- package/dist/client/assets/{Download01-BsnTCWqr.js → Download01-DokiLBvz.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-q2DeMR5z.js → ErrorBarContext-CyEUeczg.js} +1 -1
- package/dist/client/assets/{Eye-BCLEOXNL.js → Eye-DlNsmazk.js} +1 -1
- package/dist/client/assets/{Globe04-C9YOUwUx.js → Globe04-CcTw2hMd.js} +1 -1
- package/dist/client/assets/{Image01-Dnl26WcB.js → Image01-CGox3JEN.js} +1 -1
- package/dist/client/assets/{Key01-CwoMWwVQ.js → Key01-MH27mIao.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Bis2ERIL.js → LayoutLeft-CpKRfpdN.js} +1 -1
- package/dist/client/assets/{Line-BkS8r3Hh.js → Line-BldjxoIZ.js} +1 -1
- package/dist/client/assets/{Link01-1Ii-ZBB1.js → Link01-BcMSFUIJ.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CxPBcUve.js → LinkExternal01-3Lsw2Z8I.js} +1 -1
- package/dist/client/assets/{Monitor01-DypnteF9.js → Monitor01-FNWg7-7u.js} +1 -1
- package/dist/client/assets/{Package-DLofDsnv.js → Package-ColnpoOk.js} +1 -1
- package/dist/client/assets/{Palette-DZw1jmn0.js → Palette-Bb9IRvVj.js} +1 -1
- package/dist/client/assets/{Plus-DJAmbMrJ.js → Plus-t4kIBGIE.js} +1 -1
- package/dist/client/assets/{SearchLg-0M2kccVO.js → SearchLg-DrU6iSmg.js} +1 -1
- package/dist/client/assets/{SearchMd-BT8cdzsW.js → SearchMd-Y5wxql57.js} +1 -1
- package/dist/client/assets/{Sector-BJGxTbou.js → Sector-DfoxRE0A.js} +1 -1
- package/dist/client/assets/{Share07-BqFFQNeK.js → Share07-DxxTtQWb.js} +1 -1
- package/dist/client/assets/{Stars01-BFm8fGnC.js → Stars01-Dwmyh59Q.js} +1 -1
- package/dist/client/assets/{Sun-qCW4hQHf.js → Sun-mSxdzNTE.js} +1 -1
- package/dist/client/assets/{Tool01-BNu7BHqQ.js → Tool01-CaOf6Mu4.js} +1 -1
- package/dist/client/assets/{Trash01-CSeT8ZD8.js → Trash01-DHtEq5nA.js} +1 -1
- package/dist/client/assets/{Upload01-GlJ5Ud3s.js → Upload01--yrzZIir.js} +1 -1
- package/dist/client/assets/{User01-D0NPPWmZ.js → User01-Dn00_JAZ.js} +1 -1
- package/dist/client/assets/{UserSquare-B_QuMjVL.js → UserSquare-BfH7tTry.js} +1 -1
- package/dist/client/assets/{Users01-K81i8krS.js → Users01-BBUvRTwh.js} +1 -1
- package/dist/client/assets/{X-ClBxN2Lo.js → X-xX_XXXXt.js} +1 -1
- package/dist/client/assets/{XCircle-Ds0Log1_.js → XCircle-Bdqr7Csd.js} +1 -1
- package/dist/client/assets/{XClose-DjadAVCX.js → XClose-Cx8dSxYY.js} +1 -1
- package/dist/client/assets/{Zap-D3U8XJRb.js → Zap-Da5qzBL9.js} +1 -1
- package/dist/client/assets/{ZoomOut-DsH_k1C4.js → ZoomOut-C8BTMnO9.js} +1 -1
- package/dist/client/assets/{access-gate-CuIthKSm.js → access-gate-wTt0hkiV.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-BKL_hKkk.js → add-connection-dialog-C8n1sIiv.js} +1 -1
- package/dist/client/assets/{agent-analytics-AEMDlU2l.js → agent-analytics-BigiGcC3.js} +1 -1
- package/dist/client/assets/agent-app-BynIiQPm.js +1 -0
- package/dist/client/assets/{agent-assets-BI_o8EXn.js → agent-assets-C0cz7g53.js} +1 -1
- package/dist/client/assets/{agent-automation-DUiD7Tiw.js → agent-automation-NB5zps7C.js} +1 -1
- package/dist/client/assets/{agent-automations-BqRu2Acp.js → agent-automations-Dr2TOtVh.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-wVhW_Voj.js → agent-connect-sources-BP-ePYzm.js} +1 -1
- package/dist/client/assets/agent-deck-B4AuEIZ3.js +1 -0
- package/dist/client/assets/{agent-e2e-B_VPTtsE.js → agent-e2e-7pGygJe1.js} +1 -1
- package/dist/client/assets/{agent-experiments-VNCtI9MN.js → agent-experiments-NFpgU_vW.js} +1 -1
- package/dist/client/assets/agent-file-CtFUY5q3.js +1 -0
- package/dist/client/assets/{agent-git-DvIcC2QG.js → agent-git-Dp2pjcq7.js} +1 -1
- package/dist/client/assets/{agent-hosting-DQWvdG7u.js → agent-hosting-swMJFfI8.js} +1 -1
- package/dist/client/assets/{agent-icon-v-YF8SZ6.js → agent-icon-b_XHjZEZ.js} +1 -1
- package/dist/client/assets/agent-library-file-Cs2o3xUR.js +1 -0
- package/dist/client/assets/{agent-monitor-CEAGevcJ.js → agent-monitor-DXml8cXU.js} +1 -1
- package/dist/client/assets/{agent-overview-B9mWtQrN.js → agent-overview-B-8Q_kMe.js} +1 -1
- package/dist/client/assets/agent-settings-D_j9iMnB.js +1 -0
- package/dist/client/assets/{agent-site-editor-Dn-SwMeX.js → agent-site-editor-C69PUReM.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DSXPZTZD.js +2 -0
- package/dist/client/assets/agent-site-editor-content-B9j94FVC.js +9 -0
- package/dist/client/assets/{agent-site-editor-preview-BGtSWN6k.js → agent-site-editor-preview-CKfhefDr.js} +3 -3
- package/dist/client/assets/agent-view-cJkl5h-x.js +1 -0
- package/dist/client/assets/{agent-view-guard-KuUlGmjg.js → agent-view-guard-DH71qayK.js} +1 -1
- package/dist/client/assets/{agents-list-DUTGAaYB.js → agents-list-DqxafIkw.js} +1 -1
- package/dist/client/assets/{ai-providers-CvP0mu_h.js → ai-providers-DjYgCZLG.js} +1 -1
- package/dist/client/assets/{alert-BGlOaWga.js → alert-DJICfxE6.js} +1 -1
- package/dist/client/assets/{alert-dialog-5zuyoQ54.js → alert-dialog-DehGSRTj.js} +1 -1
- package/dist/client/assets/{analytics-sections-B2FKhhgH.js → analytics-sections-DAtGnCwB.js} +1 -1
- package/dist/client/assets/{api-keys-B85PZWC-.js → api-keys-BRbJWypK.js} +1 -1
- package/dist/client/assets/api-keys-CRlcHMxs.js +1 -0
- package/dist/client/assets/app-editor-BYU_FtWh.js +1 -0
- package/dist/client/assets/{asset-utils-DHE59DFm.js → asset-utils-Dc_dFFTI.js} +1 -1
- package/dist/client/assets/{auth-Bdfh9TTN.js → auth-CxmhwEgd.js} +1 -1
- package/dist/client/assets/{auth-catchall-BoMWkor5.js → auth-catchall-CJK5Vd3r.js} +1 -1
- package/dist/client/assets/{auth-entry-BEwITJEV.js → auth-entry-XnuRce_W.js} +1 -1
- package/dist/client/assets/{auth-split-layout-BdEGeOmG.js → auth-split-layout-CNTa1r8B.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-DKS7LloY.js → authenticate-and-persist-oauth-D88bk5XQ.js} +1 -1
- package/dist/client/assets/{automation-list-row-C8lOzNNS.js → automation-list-row-CQBHFIqU.js} +1 -1
- package/dist/client/assets/{automation-runs-VhaUbL_z.js → automation-runs-BNk_SzYI.js} +1 -1
- package/dist/client/assets/{automations-BxXnVrTy.js → automations-CzHIfHdu.js} +1 -1
- package/dist/client/assets/{autosend-D8pg19Rh.js → autosend-CR9k38nC.js} +1 -1
- package/dist/client/assets/{avatar-CAxICn2w.js → avatar-BOPY-KDj.js} +1 -1
- package/dist/client/assets/{badge-BnOb-zsy.js → badge-CN6KFcHa.js} +1 -1
- package/dist/client/assets/{block-document-Kro-pK9Z.js → block-document-9qy4_FT6.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-DdZhOygI.js → blocks-preview-workspace-context-uDXO7VHT.js} +1 -1
- package/dist/client/assets/{breadcrumb-CkGzv7W5.js → breadcrumb-BxovhK-E.js} +1 -1
- package/dist/client/assets/{buckets-CjuL4oVA.js → buckets-B83w_wIY.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-BUDaGIGD.js → build-improve-prompt-doc-Z251-hmh.js} +1 -1
- package/dist/client/assets/{calendar-Rh3Ayi6D.js → calendar-Dd9w8Cda.js} +1 -1
- package/dist/client/assets/{capability-load-error-Dy5jJdoS.js → capability-load-error-DVSWQq85.js} +1 -1
- package/dist/client/assets/{category-editor-BWM9wIdp.js → category-editor-Bvuph8Uc.js} +1 -1
- package/dist/client/assets/{chart-BXfjoXsa.js → chart-D837siBd.js} +1 -1
- package/dist/client/assets/{chat-context-ZGS-0Lc6.js → chat-context-mOTo9_NI.js} +1 -1
- package/dist/client/assets/{chat-draft-WttJ8tkW.js → chat-draft-D14VCCNF.js} +1 -1
- package/dist/client/assets/{checkbox-8e5Ux6Bp.js → checkbox-I2peiheL.js} +1 -1
- package/dist/client/assets/{choose-editor-C6KpaeEk.js → choose-editor-BF24n3Ts.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-B9MsUskO.js → claim-phase-copy-nu5hupgI.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Li-2eHwe.js → cli-auth-success-BDtPEboS.js} +1 -1
- package/dist/client/assets/{client-icons-xZ20IU_9.js → client-icons-D_GjDPGl.js} +1 -1
- package/dist/client/assets/{collapsible-BSf9Onia.js → collapsible-gVegBMwF.js} +1 -1
- package/dist/client/assets/{collection-detail-fBl2Fztc.js → collection-detail-RDK_8DsU.js} +1 -1
- package/dist/client/assets/{collection-display-button-4NcwJUay.js → collection-display-button-BFbabvmp.js} +1 -1
- package/dist/client/assets/{collection-search-DUPEyodi.js → collection-search-4vCvX0QD.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-zQraMMIZ.js → collection-table-wrapper-DxjlDy-5.js} +1 -1
- package/dist/client/assets/{collection-tabs-DltvKsB7.js → collection-tabs-DS-Im1ic.js} +1 -1
- package/dist/client/assets/{combobox-CFoM-dcS.js → combobox-DrUSoNBs.js} +1 -1
- package/dist/client/assets/{command-0Q71adD5.js → command-gKTxqgCX.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-A0aC2MKi.js → companion-mcps-section-CP9gqcaw.js} +1 -1
- package/dist/client/assets/{connect-jOjDz1xq.js → connect-DRelsvjB.js} +1 -1
- package/dist/client/assets/{connect-layout-BrutlKFN.js → connect-layout-Cqhyb7PV.js} +1 -1
- package/dist/client/assets/{connection-BwlYp_98.js → connection-C15f5bNS.js} +1 -1
- package/dist/client/assets/{connection-card-BwH4OiUh.js → connection-card-BMeKUGng.js} +1 -1
- package/dist/client/assets/{connection-detail-CM-qh20_.js → connection-detail-CcO19QVa.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DukXidKL.js → connection-form-helpers-CmIBkFb3.js} +1 -1
- package/dist/client/assets/{connections-cAoSaU23.js → connections-kJZ9DqVg.js} +1 -1
- package/dist/client/assets/{context-Dqy_Piwx.js → context-waQx2W4V.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-2wNLwwUG.js → create-organization-dialog-DoTSwQvQ.js} +1 -1
- package/dist/client/assets/{decofile-api-Bk6Q_m6Q.js → decofile-api-DwohDDOu.js} +1 -1
- package/dist/client/assets/{decopilot-CjeDftvq.js → decopilot-bLAHPQ8D.js} +1 -1
- package/dist/client/assets/{dialog-aNfvq0Gx.js → dialog-Dcra4McE.js} +1 -1
- package/dist/client/assets/{discover-BhBU7Gzl.js → discover-srrXvfjV.js} +1 -1
- package/dist/client/assets/{domain-settings-Cg5mUYYW.js → domain-settings-CcyamET0.js} +1 -1
- package/dist/client/assets/{download-app-dialog-jqsRuRCN.js → download-app-dialog-Bt9MR0m_.js} +1 -1
- package/dist/client/assets/{drawer-DSLgUl8S.js → drawer-0y_cyI4K.js} +1 -1
- package/dist/client/assets/{editor-PxmQfpfP.js → editor-BCdzptBY.js} +1 -1
- package/dist/client/assets/{empty-state-Bryk1SHf.js → empty-state-BV17J4rU.js} +1 -1
- package/dist/client/assets/{empty-state-BtpZBU4x.js → empty-state-BimfTH5j.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B9DyPVU-.js → extract-connection-data-ByvXZO_i.js} +1 -1
- package/dist/client/assets/{feature-gate-D6zo6xG-.js → feature-gate-CGTKfO9Z.js} +1 -1
- package/dist/client/assets/{feature-paywall-Bh8RRr9y.js → feature-paywall-Bl0cYtHt.js} +1 -1
- package/dist/client/assets/{file-explorer-CN0NFZe1.js → file-explorer-76PPVdlw.js} +1 -1
- package/dist/client/assets/{file-preview-CJ-_1Vqz.js → file-preview-cVqXpH_G.js} +1 -1
- package/dist/client/assets/{file-share-button-f2Yvf1Ye.js → file-share-button-BuMvzP63.js} +1 -1
- package/dist/client/assets/{file-type-icon-BYgiZIDa.js → file-type-icon-DYMR5_m7.js} +1 -1
- package/dist/client/assets/{folder-icon-CNG-f1SD.js → folder-icon-DQB6n2kf.js} +1 -1
- package/dist/client/assets/{form-BvSGycPj.js → form-Bn_VlbjB.js} +1 -1
- package/dist/client/assets/{gateway-client-DEZhRkTS.js → gateway-client-DSN8PosO.js} +1 -1
- package/dist/client/assets/{general-BJZXxBNe.js → general-B-jviDo6.js} +1 -1
- package/dist/client/assets/{github-icon-BP92s-aj.js → github-icon-8fpS8l__.js} +1 -1
- package/dist/client/assets/{home-CdxWRWJt.js → home-CL83ye26.js} +1 -1
- package/dist/client/assets/{hooks-BHo3iW8o.js → hooks-V57yclqv.js} +1 -1
- package/dist/client/assets/{icon-button-rGUjPiBO.js → icon-button-B2Jd-vIw.js} +1 -1
- package/dist/client/assets/{index-CEIxT9-w.js → index-B9RXO-FB.js} +1 -1
- package/dist/client/assets/{index-DfHvWqHg.js → index-BRVGbtHX.js} +1 -1
- package/dist/client/assets/{index-Bv8ovZX7.js → index-CFZrnnmD.js} +5 -5
- package/dist/client/assets/{index-D4jxiDhV.js → index-C_YKA6uy.js} +1 -1
- package/dist/client/assets/{index-CCZIVOTb.js → index-CsvWb_z5.js} +1 -1
- package/dist/client/assets/{index-CW3mvbP-.js → index-Cv3P6Wq4.js} +1 -1
- package/dist/client/assets/{index-CMM8OiJN.js → index-Cw3ZmUL2.js} +1 -1
- package/dist/client/assets/{index-DGESUJrE.js → index-D-R5D9vw.js} +1 -1
- package/dist/client/assets/{index-DB7CW9tW.js → index-DRFd03i9.js} +1 -1
- package/dist/client/assets/{index-B-vo5TqF.js → index-DdGk5PPa.js} +1 -1
- package/dist/client/assets/{index-BmxQhKcc.js → index-Do9AlR8P.js} +1 -1
- package/dist/client/assets/{index-B1YIjoy8.js → index-Dq-IpwkC.js} +1 -1
- package/dist/client/assets/{index-B9Mt2Zue.js → index-DtZHgx57.js} +1 -1
- package/dist/client/assets/{index-BIlCrPH2.js → index-gECsHnHY.js} +1 -1
- package/dist/client/assets/{index-redirect-Cf0qGvvQ.js → index-redirect-CTTvBSR1.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-CLmBPvOC.js → infiniteQueryObserver-Gux7qMEO.js} +1 -1
- package/dist/client/assets/{infra-billing-CgTT7mEA.js → infra-billing-Cvvw03Dm.js} +1 -1
- package/dist/client/assets/{input-D7VKtVHV.js → input-B_-SnRO5.js} +1 -1
- package/dist/client/assets/{input-BrBT4VAu.js → input-Bwe8NZ5T.js} +1 -1
- package/dist/client/assets/{input-CXs-YVYu.js → input-DmvvEyNC.js} +1 -1
- package/dist/client/assets/{integration-icon-_QdW_HEl.js → integration-icon-C9XaIOHe.js} +1 -1
- package/dist/client/assets/{label-BAb2clBH.js → label-DSLU6fFz.js} +1 -1
- package/dist/client/assets/{last-preview-page-BOasaofB.js → last-preview-page-Bq7holaY.js} +1 -1
- package/dist/client/assets/{layout-DKz_gVMk.js → layout-BKGCgfkN.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-DzJV9WdZ.js → legacy-agents-deep-T9NXwWHP.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-DoEPYUQz.js → legacy-main-redirect-CdjJmBj-.js} +1 -1
- package/dist/client/assets/{library-BxKGOYLR.js → library-CDWN3mYj.js} +1 -1
- package/dist/client/assets/{login-B13wBUsH.js → login-Cx2qLFTf.js} +1 -1
- package/dist/client/assets/{markdown-IEb50bp3.js → markdown-oeL4d_tN.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-BVjb1uep.js → mcp-app-renderer-CmLIkf6i.js} +1 -1
- package/dist/client/assets/{mcp-oauth-D7EnzUg3.js → mcp-oauth-D1pDEEn0.js} +1 -1
- package/dist/client/assets/{members-DaYkffyz.js → members-DDvZMbmX.js} +1 -1
- package/dist/client/assets/{message-templates-DIQZvuul.js → message-templates-D-nRIsWk.js} +1 -1
- package/dist/client/assets/{mini-report-page-gPQljQx-.js → mini-report-page-nehi6gd3.js} +1 -1
- package/dist/client/assets/{mock-board-BCEtuogR.js → mock-board-BcrW0eEv.js} +3 -3
- package/dist/client/assets/{monaco-editor-CZ3UOq2C.js → monaco-editor-rG_ojQtN.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BKgG20GP.js → monitoring-stats-row-u_eyyh8S.js} +1 -1
- package/dist/client/assets/{multi-select-B_FsyhJ3.js → multi-select-C1vxoOWR.js} +1 -1
- package/dist/client/assets/{mustache-B64bzbQE.js → mustache-_05g5fSZ.js} +1 -1
- package/dist/client/assets/{oauth-callback-BVa1wqY_.js → oauth-callback-BParqGue.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-B6p3LEub.js → oauth-callback-ai-provider-CFCc4vuY.js} +1 -1
- package/dist/client/assets/{onboarding-CjY9ZaJa.js → onboarding-CefimiY5.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-CIgk0pPq.js → optimistic-project-sidebar-views-Ds7dxAP-.js} +1 -1
- package/dist/client/assets/{org-file-open-context-C3CvG90a.js → org-file-open-context-DI6t8wtB.js} +1 -1
- package/dist/client/assets/{organization-choice-4sTsbqZY.js → organization-choice-DqCYRx3X.js} +1 -1
- package/dist/client/assets/{orgs-DMLLTLY8.js → orgs-B9XC3G_x.js} +1 -1
- package/dist/client/assets/{page-seo-form-BGuhWwqo.js → page-seo-form-Bxx9SwNT.js} +1 -1
- package/dist/client/assets/{pair-DSAE6kBc.js → pair-CVurrPq-.js} +1 -1
- package/dist/client/assets/{plan-ladder-DRDlfnKQ.js → plan-ladder-BfylXdSz.js} +1 -1
- package/dist/client/assets/{popover-n4tdwfg1.js → popover-Baq0imIs.js} +1 -1
- package/dist/client/assets/post-calendar-Deyu5RSY.js +1 -0
- package/dist/client/assets/{post-editor-BOL_jJ5F.js → post-editor-B77-jPfP.js} +1 -1
- package/dist/client/assets/{preview-content-BOr8t_B7.js → preview-content-Cb2RYCeo.js} +1 -1
- package/dist/client/assets/{preview-dialog-CBQATPoA.js → preview-dialog-AWoznOua.js} +1 -1
- package/dist/client/assets/{profile-CP_1bWDP.js → profile-Bno_MC0t.js} +1 -1
- package/dist/client/assets/{project-app-view-XkPj660d.js → project-app-view-BoEEmEk4.js} +1 -1
- package/dist/client/assets/{project-feed-mDfQ-laa.js → project-feed-DT9rU3wJ.js} +1 -1
- package/dist/client/assets/{project-icon-K8IkvwTu.js → project-icon-CzEj0avy.js} +1 -1
- package/dist/client/assets/project-reports-DYAJh_Wl.js +1 -0
- package/dist/client/assets/project-tasks-CE9Re7Tj.js +1 -0
- package/dist/client/assets/{prompts-49OLfQnt.js → prompts-BU3lT5yK.js} +1 -1
- package/dist/client/assets/record-editor-BZi1czEu.js +1 -0
- package/dist/client/assets/{redirect-editor-6KbeprTc.js → redirect-editor-BrsiQdWf.js} +1 -1
- package/dist/client/assets/reports-ARrC7tI6.js +1 -0
- package/dist/client/assets/{reports-C1-T_XI6.js → reports-BWa8EEwC.js} +1 -1
- package/dist/client/assets/{reports-onboarding-BbH4V7A-.js → reports-onboarding-soeZpVO2.js} +1 -1
- package/dist/client/assets/{reports-tab-DyE4mWa3.js → reports-tab-DvvKKs9h.js} +2 -2
- package/dist/client/assets/{repositories-DHwboveY.js → repositories-DxBiP88Q.js} +1 -1
- package/dist/client/assets/{repository-import-picker-CRs10CPh.js → repository-import-picker-DmgbIRex.js} +1 -1
- package/dist/client/assets/{repository-picker-CZ9LQZYf.js → repository-picker-BdbJB8MH.js} +1 -1
- package/dist/client/assets/{require-capability-D9SZxHsZ.js → require-capability-CUtBt1bi.js} +1 -1
- package/dist/client/assets/{required-auth-layout-5gvCMtcO.js → required-auth-layout-BlnGUT2q.js} +1 -1
- package/dist/client/assets/{reset-password-DWdrV3bH.js → reset-password-OMiTHFai.js} +1 -1
- package/dist/client/assets/{resizable-B57Znxf0.js → resizable-Dr5PNlfE.js} +1 -1
- package/dist/client/assets/{review-settings-BQC6b8ZY.js → review-settings-84byzwHU.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-B-NORzEn.js → rich-text-link-control-CFnLXxfY.js} +1 -1
- package/dist/client/assets/{roles-BMRJMNLe.js → roles-AcbVFhCZ.js} +1 -1
- package/dist/client/assets/{route-Bv4TqLdN.js → route-73J6vHiy.js} +1 -1
- package/dist/client/assets/{route-BCJP0MYO.js → route-BA_J22E-.js} +1 -1
- package/dist/client/assets/{route-Bms7Naqu.js → route-BHnu0h_N.js} +1 -1
- package/dist/client/assets/{route-page-header-CsPi4GMO.js → route-page-header-CByDrdCZ.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-DM8wSMV8.js → runnable-block-editor-C-z6sg8d.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-DsRGwORN.js → sandbox-lifecycle-context-244BQJ78.js} +1 -1
- package/dist/client/assets/{schema-CMlylut3.js → schema-Du8_zRy7.js} +1 -1
- package/dist/client/assets/{scroll-area-t3NukeQO.js → scroll-area-DWMWIudU.js} +1 -1
- package/dist/client/assets/{search-input-B3K0cIXk.js → search-input-C7zzo1gV.js} +1 -1
- package/dist/client/assets/{search-toggle-7vfSZ3oM.js → search-toggle-CArb_7uo.js} +1 -1
- package/dist/client/assets/{secret-picker-BvIcwT9-.js → secret-picker-CQN9d587.js} +1 -1
- package/dist/client/assets/{secrets-Vf4pio1e.js → secrets-D1CraqxC.js} +1 -1
- package/dist/client/assets/{sections-editor-Diy2sJ51.js → sections-editor-Wq74SyFR.js} +1 -1
- package/dist/client/assets/{select-B_9gxhnf.js → select-BOM-aKhP.js} +1 -1
- package/dist/client/assets/{select-model-Dc8NFwmy.js → select-model-DpXoMCZH.js} +1 -1
- package/dist/client/assets/{seo-editor-CyA_IHYp.js → seo-editor-D1cw49ws.js} +1 -1
- package/dist/client/assets/{separator-CeYTQgxJ.js → separator-DW6Prz-B.js} +1 -1
- package/dist/client/assets/{settings-tab-CSmq_TZm.js → settings-tab-BlphdJug.js} +1 -1
- package/dist/client/assets/{sheet-ncGbwo3c.js → sheet-Dq13NqY6.js} +1 -1
- package/dist/client/assets/{shell-layout-Cn2XiFfO.js → shell-layout-DMJ3Gw_b.js} +1 -1
- package/dist/client/assets/{sidebar-DMorNI5B.js → sidebar-n3X--4aE.js} +1 -1
- package/dist/client/assets/{skill-preview-Csp1-IaM.js → skill-preview-ht8NWRpt.js} +1 -1
- package/dist/client/assets/{skills-JdOILRst.js → skills-2dbI_ehN.js} +1 -1
- package/dist/client/assets/{sso-D6HM5t6s.js → sso-D4ClPuk5.js} +1 -1
- package/dist/client/assets/{suggestion-5QOsyBWf.js → suggestion-B2gCPjEY.js} +1 -1
- package/dist/client/assets/{switch-B8V9Ox46.js → switch-BpU_dXOg.js} +1 -1
- package/dist/client/assets/{synced-repos-Cq9R4ohv.js → synced-repos-B4WffdFD.js} +1 -1
- package/dist/client/assets/{table-CqSUYS4O.js → table-BK5Bj0BA.js} +1 -1
- package/dist/client/assets/{tabs-god_zfat.js → tabs-DtulKHna.js} +1 -1
- package/dist/client/assets/{task-board-CSfWLhg4.js → task-board-BlCSl7H6.js} +1 -1
- package/dist/client/assets/{task-route-qv7COOYP.js → task-route-Buk2mgML.js} +1 -1
- package/dist/client/assets/{task-status-BAjWghil.js → task-status-BvbYEbq9.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-D-yRn1S6.js → taskboard-analytics-C4h2ZM5g.js} +1 -1
- package/dist/client/assets/{tasks-ChC4tJl9.js → tasks-ClVRdGRp.js} +1 -1
- package/dist/client/assets/tasks-IK2ZoIhQ.js +1 -0
- package/dist/client/assets/{textarea-Bs1krskq.js → textarea-CDG_4h5K.js} +1 -1
- package/dist/client/assets/{thread-analytics-BgyyDuVq.js → thread-analytics-CrrAYz-K.js} +1 -1
- package/dist/client/assets/{thread-button-CU8FEc0x.js → thread-button-Bt2nv3eP.js} +1 -1
- package/dist/client/assets/{thread-intent-Bl6xIfFf.js → thread-intent-DfUdqfo1.js} +1 -1
- package/dist/client/assets/{thread-route-BSeISsE6.js → thread-route-BcHRblub.js} +1 -1
- package/dist/client/assets/{thread-route-CX0quyn9.js → thread-route-CIar6WIg.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-hkS4aUg5.js → thread-sheet-body-BeD4yJxi.js} +1 -1
- package/dist/client/assets/{toggle-group-uWDttGAl.js → toggle-group-CNL0xUW4.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CL9TUqhr.js → toolbar-icon-button-bv_fQ-aj.js} +1 -1
- package/dist/client/assets/{tooltip-452rT2Av.js → tooltip-CPnP6Sjs.js} +1 -1
- package/dist/client/assets/{track-9kgX0QPk.js → track-B9PuaPFx.js} +1 -1
- package/dist/client/assets/{types-CKACT3re.js → types-d1eRFziw.js} +1 -1
- package/dist/client/assets/{usage-stats-DpOdKRPA.js → usage-stats-DJsI8Eqk.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BfBmzjxk.js → use-ai-providers-BV_DvH7o.js} +1 -1
- package/dist/client/assets/{use-automations-BSATGAzs.js → use-automations-BHsMhlO9.js} +1 -1
- package/dist/client/assets/{use-autosave-Cgp9LI2B.js → use-autosave-DgwX0mMm.js} +1 -1
- package/dist/client/assets/{use-connect-companion-C-aC_6H2.js → use-connect-companion-BzIs5X88.js} +1 -1
- package/dist/client/assets/{use-connection-DZHmMxeG.js → use-connection-Bi6HLcH4.js} +1 -1
- package/dist/client/assets/{use-copy-CKbfXSV3.js → use-copy-CDhoRgm3.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DT6S24Ek.js → use-create-virtual-mcp-DIHuJhyr.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-4nMtSnpk.js → use-date-fns-locale-Cy0bIV3c.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-Dabnhryq.js → use-debounced-autosave-D8Sorx0q.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D4IIgvZ6.js → use-debounced-value-Bi1oqAau.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CUhDqFNs.js → use-deco-credits-CRBFL3xa.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-E0BM35TR.js → use-decopilot-events-CVfzaSiv.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CKxZ4wsy.js → use-delete-connection-CX0v-UqP.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CULH8aip.js → use-deployment-admin-C2loCmMs.js} +1 -1
- package/dist/client/assets/{use-entitlements-BTK1TiYJ.js → use-entitlements-qq0onzk3.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CDZ9QnYg.js → use-fast-preview-draft-url-DUGuDJ0B.js} +1 -1
- package/dist/client/assets/{use-file-configs-BX41631Z.js → use-file-configs-DI6Asnep.js} +1 -1
- package/dist/client/assets/{use-in-settings-DMlBXVsJ.js → use-in-settings-2EIzhXwd.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Be1BN8YX.js → use-infinite-scroll-BwJMlu6L.js} +1 -1
- package/dist/client/assets/{use-join-requests-D7k_-rqK.js → use-join-requests-752eIkzS.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-Xzm5JVo2.js → use-main-panel-tabs-DIxFD1x0.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DZc1kZiD.js → use-mcp-auth-status-Cyg7VElH.js} +1 -1
- package/dist/client/assets/{use-mcp-client-8W4pv2iG.js → use-mcp-client-4SfStdvU.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-EP5VAc7p.js → use-mcp-prompts-DNTC-VnG.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CWjm4_qp.js → use-mcp-tools-CmJbGXa2.js} +1 -1
- package/dist/client/assets/{use-members-DdFSpvT6.js → use-members-ChLgHSO3.js} +1 -1
- package/dist/client/assets/{use-mobile-CbgvL5x6.js → use-mobile-DARHzVZh.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CnwjWuW_.js → use-navigate-to-agent-a1v5JNRv.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-DAJYSvuP.js → use-open-billing-url-CSkUOZcG.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-PjV6soYN.js → use-org-auth-client-BcltMH40.js} +1 -1
- package/dist/client/assets/{use-org-fs-DlHKBaPi.js → use-org-fs-PfmH2IwE.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-IAlIRz5z.js → use-org-repo-syncs-BGgD9fX9.js} +1 -1
- package/dist/client/assets/{use-org-sso-Od2nvWUP.js → use-org-sso-BcU16muD.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Cma99AA4.js → use-organization-roles-RhvAN6UI.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BXDoAx1p.js → use-organization-settings-BLvm6CUv.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CeERwAhY.js → use-panel-navigate-Ba3IZxfG.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-0O5UQcYW.js → use-project-native-view-presence-CsPNZgcc.js} +1 -1
- package/dist/client/assets/{use-project-scope-CdX2mBNC.js → use-project-scope-BspeH_sq.js} +1 -1
- package/dist/client/assets/{use-releases-BKjJ4TJe.js → use-releases-CVzN8uNR.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-T8Asd01v.js → use-reports-diagnostic-CrvplLbm.js} +1 -1
- package/dist/client/assets/{use-route-default-main-BW9UadGk.js → use-route-default-main-DSqzyOuP.js} +1 -1
- package/dist/client/assets/{use-secrets-CfE-SREF.js → use-secrets-DgrFX5xg.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-WUaK1Pi8.js → use-section-preview-base-B-Hn9i9b.js} +1 -1
- package/dist/client/assets/{use-session-runtime-Bf6vLaxh.js → use-session-runtime-BVLmSBh6.js} +1 -1
- package/dist/client/assets/{use-tags-BUAJ1eC5.js → use-tags-BOv9arBp.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-BDIpYBbX.js → use-task-board-analytics-DPM83CD7.js} +1 -1
- package/dist/client/assets/{use-task-metadata-DyG3Lo1p.js → use-task-metadata-CJ-QxfGm.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DjnPlB1b.js → use-thread-analytics-C0CiMqbi.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-CSH9qR28.js → use-thread-outputs-CTmmbNmM.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DyTrBBn7.js → use-virtual-mcp-B1-yfeBH.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-CpVWUzdl.js +1 -0
- package/dist/client/assets/{useQueries-BxKAM4Rs.js → useQueries-CrqtqlHM.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CXyd6z14.js +1 -0
- package/dist/client/assets/{users-hKaW80lb.js → users-mYCEW-vA.js} +1 -1
- package/dist/client/assets/{utils-BnjmVFWV.js → utils-D2y8J057.js} +1 -1
- package/dist/client/assets/{variant-calendar-7Gr0v6MN.js → variant-calendar-7H3LNEKh.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-BhXPWsTJ.js → variant-matcher-override-4dV3T02L.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-Blh9kDM6.js → view-mode-toggle-BQub2iHi.js} +1 -1
- package/dist/client/assets/{virtual-mcp-BYf8h9T-.js → virtual-mcp-7pXCbTsW.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Dg3IYcc1.js +0 -1
- package/dist/client/assets/agent-deck-BZGEf92K.js +0 -1
- package/dist/client/assets/agent-file-D1Iq_S8L.js +0 -1
- package/dist/client/assets/agent-library-file-DJ5gCk1X.js +0 -1
- package/dist/client/assets/agent-settings-Bd8_YJSI.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Y4xPIzmS.js +0 -2
- package/dist/client/assets/agent-site-editor-content-Dn2d28FJ.js +0 -9
- package/dist/client/assets/agent-view-BqNl4IOK.js +0 -1
- package/dist/client/assets/api-keys-guA8nw2b.js +0 -1
- package/dist/client/assets/app-editor-B4Z-g5Dd.js +0 -1
- package/dist/client/assets/post-calendar-BAf3rV18.js +0 -1
- package/dist/client/assets/project-reports-8pX-TMsT.js +0 -1
- package/dist/client/assets/project-tasks-C6Kryc4_.js +0 -1
- package/dist/client/assets/record-editor-13ULQgYo.js +0 -1
- package/dist/client/assets/reports-BrFDkh6w.js +0 -1
- package/dist/client/assets/tasks-BR9-q4OQ.js +0 -1
- package/dist/client/assets/useInfiniteQuery-COua6s42.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-6311fHu0.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as fe,b as he,j as o,G as de,p as Fe,ai as Ee,H as we,af as ke,F as ve,B as ue,I as Se,eM as Pe,a0 as xe,a6 as Ge,K as je,m as Ne,a as _e,o as Ae,r as M,dl as Me,z as Oe,e as Re,q as Q,t as Ce,l as Ue,Z as ze,ae as $e,n as ge}from"./index-Bv8ovZX7.js";import{b as Ve,c as He,g as Be}from"./use-virtual-mcp-DyTrBBn7.js";import{i as qe}from"./DotsVertical-DY1WVLqG.js";import{a as Ke}from"./Tool01-BNu7BHqQ.js";import{s as Qe}from"./Trash01-CSeT8ZD8.js";import{A as Ye,bp as Je}from"./agent-icon-v-YF8SZ6.js";import{u as We,f as De}from"./use-date-fns-locale-4nMtSnpk.js";import{u as Ie}from"./use-navigate-to-agent-CnwjWuW_.js";import{l as Ze}from"./use-organization-settings-BXDoAx1p.js";import{E as Xe}from"./empty-state-Bryk1SHf.js";import{u as et}from"./use-create-virtual-mcp-DT6S24Ek.js";import{b as tt,u as ot}from"./use-connection-DZHmMxeG.js";import{u as ye}from"./use-mcp-client-8W4pv2iG.js";import{a as st}from"./authenticate-and-persist-oauth-DKS7LloY.js";import{e as it}from"./extract-connection-data-B9DyPVU-.js";import{f as nt,g as rt}from"./thread-intent-Bl6xIfFf.js";import{a as lt}from"./github-repo-scope-C8GSbvaz.js";import{f as at,a as ct,G as mt,p as dt}from"./provision-repo-scoped-github-connection-B6zdkC6p.js";import{D as ut,b as pt,c as gt,d as ft,e as ht}from"./dialog-aNfvq0Gx.js";import{i as xt}from"./ArrowLeft-BrzmATFY.js";import{C as bt}from"./collection-search-DUPEyodi.js";import{G as jt}from"./github-icon-BP92s-aj.js";import{A as Ct,a as Dt,b as yt,c as wt,g as vt,d as St,e as Nt,f as _t}from"./alert-dialog-5zuyoQ54.js";import{S as At}from"./search-input-B3K0cIXk.js";import{s as It}from"./Plus-DJAmbMrJ.js";import{R as Tt}from"./repository-import-picker-CRs10CPh.js";import{u as Lt}from"./use-debounced-value-D4IIgvZ6.js";import"./AlertCircle-DwYUjJBu.js";import"./ArrowUp-Bgr2TLsm.js";import"./ArrowRight-DYu8UyAE.js";import"./XCircle-Ds0Log1_.js";import"./ZoomOut-DsH_k1C4.js";import"./Globe04-C9YOUwUx.js";import"./CheckCircle-DxLYuezp.js";import"./Check-BgzQchyA.js";import"./ChevronUp-CEt2-KWf.js";import"./UserSquare-B_QuMjVL.js";import"./Copy01-DY06zeXh.js";import"./CreditCard01-atzqozkq.js";import"./Download01-BsnTCWqr.js";import"./Eye-BCLEOXNL.js";import"./Share07-BqFFQNeK.js";import"./XClose-DjadAVCX.js";import"./Image01-Dnl26WcB.js";import"./Key01-CwoMWwVQ.js";import"./LayoutLeft-Bis2ERIL.js";import"./Link01-1Ii-ZBB1.js";import"./LinkExternal01-CxPBcUve.js";import"./Monitor01-DypnteF9.js";import"./Sun-qCW4hQHf.js";import"./Package-DLofDsnv.js";import"./Palette-DZw1jmn0.js";import"./SearchLg-0M2kccVO.js";import"./SearchMd-BT8cdzsW.js";import"./Stars01-BFm8fGnC.js";import"./Upload01-GlJ5Ud3s.js";import"./User01-D0NPPWmZ.js";import"./Users01-K81i8krS.js";import"./X-ClBxN2Lo.js";import"./Zap-D3U8XJRb.js";import"./differenceInSeconds-C3x8sHUj.js";import"./hooks-BHo3iW8o.js";import"./backoff-8mStPHYB.js";import"./task-board-CSfWLhg4.js";import"./schema-CMlylut3.js";import"./github-repo-BknN0SVI.js";import"./auth-Bdfh9TTN.js";import"./mcp-oauth-D7EnzUg3.js";import"./metadata-D72DunRR.js";import"./connection-BwlYp_98.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-CZ9LQZYf.js";import"./tooltip-452rT2Av.js";import"./index-CW3mvbP-.js";import"./input-D7VKtVHV.js";import"./label-BAb2clBH.js";import"./useInfiniteQuery-COua6s42.js";import"./infiniteQueryObserver-CLmBPvOC.js";import"./avatar-CAxICn2w.js";function Ft(e){const t=fe.c(26),{onCreateFromScratch:s,onImportGitHub:i,onImportDeco:r,isCreating:g,align:d,side:b,showBetaBadge:f,showDecoImport:y}=e,w=d===void 0?"end":d,u=he();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Fe,{size:14}),t[0]=x):x=t[0];let m;t[1]!==u?(m=u("common.createAgentDropdown.createFromScratch"),t[1]=u,t[2]=m):m=t[2];let h;t[3]!==g||t[4]!==s||t[5]!==m?(h=o.jsxs(de,{disabled:g,onClick:s,children:[x,m]}),t[3]=g,t[4]=s,t[5]=m,t[6]=h):h=t[6];let j;t[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Ee,{className:"size-3.5"}),t[7]=j):j=t[7];let c;t[8]!==u?(c=u("common.createAgentDropdown.importFromGitHub"),t[8]=u,t[9]=c):c=t[9];let l;t[10]!==f?(l=f&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),t[10]=f,t[11]=l):l=t[11];let p;t[12]!==i||t[13]!==c||t[14]!==l?(p=o.jsxs(de,{onClick:i,children:[j,c,l]}),t[12]=i,t[13]=c,t[14]=l,t[15]=p):p=t[15];let a;t[16]!==r||t[17]!==y||t[18]!==u?(a=y&&o.jsxs(de,{onClick:r,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),u("common.createAgentDropdown.importFromDeco")]}),t[16]=r,t[17]=y,t[18]=u,t[19]=a):a=t[19];let C;return t[20]!==w||t[21]!==b||t[22]!==h||t[23]!==p||t[24]!==a?(C=o.jsxs(we,{side:b,align:w,className:"w-48",children:[h,p,a]}),t[20]=w,t[21]=b,t[22]=h,t[23]=p,t[24]=a,t[25]=C):C=t[25],C}function Et(e){const t=fe.c(50),{project:s,lastUsedAt:i,onDeleteClick:r}=e,g=Ie(),d=he(),b=We(),f=s.metadata?.ui?.layout;let y;t[0]!==f?(y=ke(f),t[0]=f,t[1]=y):y=t[1];const w=y;let u;t[2]!==w||t[3]!==g||t[4]!==s.id?(u=()=>g(s.id,{panel:w}),t[2]=w,t[3]=g,t[4]=s.id,t[5]=u):u=t[5];let x;t[6]!==s.title||t[7]!==u?(x=o.jsx("button",{type:"button",onClick:u,className:"absolute inset-0 z-0","aria-label":s.title}),t[6]=s.title,t[7]=u,t[8]=x):x=t[8];let m;t[9]!==s.icon||t[10]!==s.title?(m=o.jsx(Ye,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),t[9]=s.icon,t[10]=s.title,t[11]=m):m=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ve,{asChild:!0,children:o.jsx(ue,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(qe,{size:20})})}),t[12]=h):h=t[12];let j;t[13]!==g||t[14]!==s.id?(j=()=>g(s.id,{panel:"settings"}),t[13]=g,t[14]=s.id,t[15]=j):j=t[15];let c;t[16]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Ke,{size:16}),t[16]=c):c=t[16];let l;t[17]!==j?(l=o.jsxs(de,{onClick:j,children:[c,"Settings"]}),t[17]=j,t[18]=l):l=t[18];let p;t[19]!==r?(p=r&&o.jsxs(de,{variant:"destructive",onClick:n=>{n.stopPropagation(),r(n)},children:[o.jsx(Qe,{size:16}),"Delete"]}),t[19]=r,t[20]=p):p=t[20];let a;t[21]!==p||t[22]!==l?(a=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(Se,{children:[h,o.jsxs(we,{align:"end",children:[l,p]})]})}),t[21]=p,t[22]=l,t[23]=a):a=t[23];let C;t[24]!==a||t[25]!==m?(C=o.jsxs("div",{className:"flex items-start justify-between",children:[m,a]}),t[24]=a,t[25]=m,t[26]=C):C=t[26];let D;t[27]!==s.title?(D=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})}),t[27]=s.title,t[28]=D):D=t[28];const O=s.description||"No description";let F;t[29]!==O?(F=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:O}),t[29]=O,t[30]=F):F=t[30];let E;t[31]!==D||t[32]!==F?(E=o.jsxs("div",{className:"flex flex-col gap-1",children:[D,F]}),t[31]=D,t[32]=F,t[33]=E):E=t[33];let S;t[34]!==C||t[35]!==E?(S=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[C,E]}),t[34]=C,t[35]=E,t[36]=S):S=t[36];let N;t[37]!==i||t[38]!==b||t[39]!==s.updated_at||t[40]!==d?(N=i?d("home.projectCard.lastUsed",{time:De(new Date(i),{addSuffix:!0,locale:b})}):d("home.projectCard.updated",{time:De(new Date(s.updated_at),{addSuffix:!0,locale:b})}),t[37]=i,t[38]=b,t[39]=s.updated_at,t[40]=d,t[41]=N):N=t[41];let A;t[42]!==N?(A=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:N})})}),t[42]=N,t[43]=A):A=t[43];let P;t[44]!==S||t[45]!==A?(P=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[S,A]}),t[44]=S,t[45]=A,t[46]=P):P=t[46];let k;return t[47]!==P||t[48]!==x?(k=o.jsxs(Pe,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[x,P]}),t[47]=P,t[48]=x,t[49]=k):k=t[49],k}function kt(e,t){const s=fe.c(10),{org:i}=xe(),r=Ge();let g;s[0]!==e||s[1]!==i.id?(g=je.registryApp(i.id,e),s[0]=e,s[1]=i.id,s[2]=g):g=s[2];let d;s[3]!==e||s[4]!==r?(d=()=>r.call("COLLECTION_REGISTRY_APP_GET",{name:e}),s[3]=e,s[4]=r,s[5]=d):d=s[5];const b=t?.enabled??!0;let f;return s[6]!==g||s[7]!==d||s[8]!==b?(f={queryKey:g,queryFn:d,select:Pt,enabled:b,staleTime:3e5},s[6]=g,s[7]=d,s[8]=b,s[9]=f):f=s[9],Ne(f)}function Pt(e){return e.item}const Gt="deco/github-mcp";function Mt(e){const{org:t}=xe(),{data:s}=_e.useSession(),i=tt(),r=Ae(),[g,d]=M.useState("idle"),[b,f]=M.useState(null),[y,w]=M.useState(null),{data:u,isLoading:x}=kt(Gt,{enabled:e.enabled}),m=M.useRef(!1);e.enabled&&u&&!x&&!m.current&&s?.user?.id&&g==="idle"&&(m.current=!0,h());async function h(){if(!(!u||!s?.user?.id||!t))try{d("installing"),f(null);const c=it(u,t.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:p}=await i.create.mutateAsync(c);d("authenticating");const a=await st({connectionId:p,orgId:t.id,orgSlug:t.slug,persistFallback:C=>i.update.mutateAsync({id:p,data:{connection_token:C}}).then(()=>{})});if(a.ran&&!a.ok){try{await i.delete.mutateAsync(p)}catch{}throw new Error(a.error&&a.error!=="no token received"?a.error:"No token received from GitHub")}Me(r,t.id),w(c),d("ready")}catch(c){f(c instanceof Error?c.message:String(c)),d("error")}}function j(){d("idle"),f(null),w(null),m.current=!1}return e.enabled&&x&&g==="idle"?{status:"installing",error:null,connection:null,retry:j}:{status:g,error:b,connection:y,retry:j}}const Ot="deco-sites";function Rt(e){if(!e||typeof e!="object")return null;const t=e.github;if(!t||typeof t!="object")return null;const s=t.owner,i=t.repo;return typeof s!="string"||typeof i!="string"||s.length===0||i.length===0?null:{owner:s,repo:i}}function Ut(e,t){const s=t?Rt(t):null,i=s?.owner??Ot,r=s?.repo??e;return{owner:i,name:r,url:`https://github.com/${i}/${r}`}}function zt(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Te(e,t,s){const i=await fetch(e,t),r=await i.json().catch(()=>({}));if(!i.ok)throw new Error(r.error??`${s} (${i.status})`);return r}function $t(e){return Te(`/api/${e}/deco-sites`,void 0,"Failed to load sites")}function Vt({open:e,onOpenChange:t,onBack:s}){const i=he(),{org:r}=xe(),g=Ie(),d=Ae(),{data:b}=_e.useSession(),[f,y]=M.useState(null),[w,u]=M.useState(null),[x,m]=M.useState(""),h=ye({connectionId:Oe,orgId:r.id,orgSlug:r.slug}),j=ot({slug:"mcp-github"}),c=lt(j),l=Mt({enabled:e&&c.length===0}),p=c.length===1?c[0]??null:w,a=c.length>1&&!p,C=ye({connectionId:p?.id??"",orgId:r.id,orgSlug:r.slug}),D=e&&c.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:F,error:E}=Ne({queryKey:je.decoSites(b?.user?.email),queryFn:()=>$t(r.slug),enabled:e&&!!b?.user?.email,staleTime:6e4,retry:!1}),S=O?.sites??[],N=n=>{n||(y(null),u(null),m("")),t(n)},A=S.filter(n=>n.name.toLowerCase().includes(x.toLowerCase())||(n.domains?.[0]?.domain?.toLowerCase().includes(x.toLowerCase())??!1)),P=!f||A.some(n=>n.name===f),k=Re({mutationFn:async n=>{if(!p)throw new Error(i("common.importFromDecoDialog.githubNotConnected"));Q("deco_site_import_started",{site_name:n});const{installations:G}=await at(L=>h.callTool(L),p.id),I=S.find(L=>L.name===n);if(!I)throw new Error(i("common.importFromDecoDialog.siteNoLongerAvailable"));const v=Ut(n,I.metadata),T=ct(G,v.owner);if(!T)throw new Error(i("common.importFromDecoDialog.installGithubApp",{owner:v.owner,installUrl:mt}));let H=null,R=null;const ce=async()=>{R&&await h.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:R}}).catch(()=>{}),H&&await h.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:H,force:!0}}).catch(()=>{})};try{const L=await Te(`/api/${r.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:n})},i("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:U,reused:me}=await dt({orgSlug:r.slug,sourceConnection:p,installationId:T.installationId,owner:v.owner,repo:v.name,githubCallTool:K=>C.callTool(K),selfCallTool:K=>h.callTool(K)});H=me?null:U;const Y=L.icon??null,z=zt(n),B=n.toLowerCase(),$=nt(n),V=await h.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n,description:"Imported from deco.cx",pinned:!1,icon:Y??null,metadata:{instructions:null,siteSlug:B,previewServerUrl:$,productionUrl:$,githubRepo:{owner:v.owner,name:v.name,url:v.url,installationId:T.installationId,connectionId:U},ui:{banner:null,bannerColor:"#22C55E",icon:Y,themeColor:"#22C55E",slug:z,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:U}]}}}),q=V.structuredContent??V;if(!q.item?.id)throw new Error(i("common.importFromDecoDialog.failedToCreateAgent"));return R=q.item.id,{slug:z,virtualMcpId:q.item.id,item:q.item}}catch(L){throw await ce(),L}},onSuccess:({slug:n,virtualMcpId:G,item:I})=>{Q("deco_site_import_succeeded",{site_name:I.title,virtual_mcp_id:G,slug:n}),d.setQueryData(je.collectionItem(h,r.id,"","VIRTUAL_MCP",G),{item:I}),d.invalidateQueries({predicate:v=>{const T=v.queryKey;return T[1]===r.id&&T[3]==="collection"&&T[4]==="VIRTUAL_MCP"}}),Ce.success(i("common.importFromDecoDialog.importSuccess",{slug:n})),N(!1),g(G)},onError:n=>{Q("deco_site_import_failed",{error:n instanceof Error?n.message:"Unknown error"}),Ce.error(i("common.importFromDecoDialog.importFailed",{error:(n instanceof Error?n.message:i("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(ut,{open:e,onOpenChange:N,children:o.jsxs(pt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(gt,{className:"sr-only",children:o.jsx(ft,{children:i("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":i("common.importFromDecoDialog.goBack"),children:o.jsx(xt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:i("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(bt,{value:x,onChange:m,placeholder:i("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:n=>{n.key==="Escape"&&m("")}})}),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??i("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ue,{variant:"outline",size:"sm",onClick:l.retry,children:i("common.importFromDecoDialog.retryGithubSetup")})]}),D&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.settingUpGithub")}),a&&!D&&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:i("common.importFromDecoDialog.selectGithubConnection")})}),c.map(n=>o.jsxs("button",{type:"button",onClick:()=>u(n),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?o.jsx("img",{src:n.icon,alt:n.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(jt,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}),F&&!D&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.loadingSites")}),!F&&!D&&!a&&l.status!=="error"&&!E&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.noSitesFound")}),!F&&!D&&!a&&l.status!=="error"&&S.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:[A.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:i("common.importFromDecoDialog.noSitesMatch",{search:x})}),A.map(n=>{const G=rt(n.domains),I=f===n.name;return o.jsxs("button",{type:"button",onClick:()=>y(n.name),className:Ue("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",I?"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:n.thumb_url?o.jsx("img",{src:n.thumb_url,alt:n.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:n.name}),G&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},n.name)})]})]}),o.jsxs(ht,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ue,{variant:"outline",onClick:()=>N(!1),disabled:k.isPending,children:i("common.importFromDecoDialog.cancel")}),o.jsx(ue,{disabled:!f||!P||k.isPending||F||D||a||!p||l.status==="error",onClick:()=>f&&k.mutate(f),children:k.isPending?i("common.importFromDecoDialog.importing"):i("common.importFromDecoDialog.import")})]})]})})}function xs(){const e=fe.c(83),t=ze(),s=he(),{org:i}=xe(),[r,g]=M.useState(""),d=Lt(r,300);let b;e[0]!==d?(b={searchTerm:d},e[0]=d,e[1]=b):b=e[1];const f=Ve(b),y=He();let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w={navigateOnCreate:!0},e[2]=w):w=e[2];const{createVirtualMCP:u,isCreating:x}=et(w),[m,h]=M.useState(null),[j,c]=M.useState(!1),[l,p]=M.useState(!1),{granted:a}=$e("agents:manage"),C=Ze();let D;e[3]!==i?(D=_=>_.id!==i.id,e[3]=i,e[4]=D):D=e[4];const O=f.filter(D),{data:F}=Be(O.map(Ht));let E;e[5]!==y||e[6]!==m||e[7]!==s?(E=async()=>{if(!m)return;const{id:_,title:Le}=m;h(null);try{await y.delete.mutateAsync(_),Q("agent_deleted",{agent_id:_,source:"agents_list"}),Ce.success(s("routes.agentsList.deletedAgent",{title:Le}))}catch{}},e[5]=y,e[6]=m,e[7]=s,e[8]=E):E=e[8];const S=E;let N;e[9]!==a||e[10]!==u||e[11]!==x||e[12]!==C||e[13]!==s?(N=a&&o.jsxs(Se,{children:[o.jsx(ve,{asChild:!0,children:o.jsxs(ue,{size:"sm",children:[o.jsx(It,{size:14}),s("routes.agentsList.createAgent")]})}),o.jsx(Ft,{onCreateFromScratch:()=>{Q("agent_create_clicked",{source:"agents_list",method:"scratch"}),u()},onImportGitHub:()=>{Q("agent_create_clicked",{source:"agents_list",method:"github"}),p(!0)},onImportDeco:()=>{Q("agent_create_clicked",{source:"agents_list",method:"deco"}),c(!0)},isCreating:x,align:"end",showDecoImport:C})]}),e[9]=a,e[10]=u,e[11]=x,e[12]=C,e[13]=s,e[14]=N):N=e[14];const A=N,P=ge,k=ge,n=ge,G=t&&A;let I;e[15]!==s?(I=s("routes.agentsList.title"),e[15]=s,e[16]=I):I=e[16];let v;e[17]!==G||e[18]!==I?(v=o.jsx(ge.Title,{actions:G,children:I}),e[17]=G,e[18]=I,e[19]=v):v=e[19];let T;e[20]!==s?(T=s("routes.agentsList.searchPlaceholder"),e[20]=s,e[21]=T):T=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=_=>{_.key==="Escape"&&(g(""),_.target.blur())},e[22]=H):H=e[22];let R;e[23]!==r||e[24]!==T?(R=o.jsx(At,{value:r,onChange:g,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:H}),e[23]=r,e[24]=T,e[25]=R):R=e[25];const ce=!t&&A;let L;e[26]!==R||e[27]!==ce?(L=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[R,ce]}),e[26]=R,e[27]=ce,e[28]=L):L=e[28];let U;e[29]!==L||e[30]!==v?(U=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,L]}),e[29]=L,e[30]=v,e[31]=U):U=e[31];const me=O.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Xe,{actions:!t&&!r&&A,image:o.jsx(Je,{size:48,className:"text-muted-foreground"}),title:s(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?s("routes.agentsList.noAgentsMatchSearch",{search:r}):s(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate")})}),Y=O.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:s("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:O.map(_=>o.jsx(Et,{project:_,lastUsedAt:F?.get(_.id)?.last_used_at,onDeleteClick:a?()=>h({id:_.id,title:_.title}):void 0},_.id))})]});let z;e[32]!==U||e[33]!==me||e[34]!==Y||e[35]!==n.Container?(z=o.jsxs(n.Container,{children:[U,me,Y]}),e[32]=U,e[33]=me,e[34]=Y,e[35]=n.Container,e[36]=z):z=e[36];let B;e[37]!==z||e[38]!==k.Content?(B=o.jsx(k.Content,{children:z}),e[37]=z,e[38]=k.Content,e[39]=B):B=e[39];let $;e[40]!==l?($=o.jsx(Tt,{open:l,onOpenChange:p}),e[40]=l,e[41]=$):$=e[41];let V;e[42]!==j?(V=o.jsx(Vt,{open:j,onOpenChange:c}),e[42]=j,e[43]=V):V=e[43];const q=!!m;let K;e[44]===Symbol.for("react.memo_cache_sentinel")?(K=_=>!_&&h(null),e[44]=K):K=e[44];let J;e[45]!==s?(J=s("routes.agentsList.deleteAgentTitle"),e[45]=s,e[46]=J):J=e[46];let W;e[47]!==J?(W=o.jsx(Ct,{children:J}),e[47]=J,e[48]=W):W=e[48];let Z;e[49]!==s?(Z=s("routes.agentsList.deleteAgentDescription"),e[49]=s,e[50]=Z):Z=e[50];const be=m?.title;let X;e[51]!==be?(X=o.jsx("span",{className:"font-medium text-foreground",children:be}),e[51]=be,e[52]=X):X=e[52];let ee;e[53]!==Z||e[54]!==X?(ee=o.jsxs(Dt,{children:[Z," ",X,"."]}),e[53]=Z,e[54]=X,e[55]=ee):ee=e[55];let te;e[56]!==W||e[57]!==ee?(te=o.jsxs(yt,{children:[W,ee]}),e[56]=W,e[57]=ee,e[58]=te):te=e[58];let oe;e[59]!==s?(oe=s("routes.agentsList.cancelButton"),e[59]=s,e[60]=oe):oe=e[60];let se;e[61]!==oe?(se=o.jsx(wt,{children:oe}),e[61]=oe,e[62]=se):se=e[62];let ie;e[63]!==s?(ie=s("routes.agentsList.deleteButton"),e[63]=s,e[64]=ie):ie=e[64];let ne;e[65]!==S||e[66]!==ie?(ne=o.jsx(vt,{onClick:S,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ie}),e[65]=S,e[66]=ie,e[67]=ne):ne=e[67];let re;e[68]!==se||e[69]!==ne?(re=o.jsxs(St,{children:[se,ne]}),e[68]=se,e[69]=ne,e[70]=re):re=e[70];let le;e[71]!==te||e[72]!==re?(le=o.jsxs(Nt,{children:[te,re]}),e[71]=te,e[72]=re,e[73]=le):le=e[73];let ae;e[74]!==q||e[75]!==le?(ae=o.jsx(_t,{open:q,onOpenChange:K,children:le}),e[74]=q,e[75]=le,e[76]=ae):ae=e[76];let pe;return e[77]!==P||e[78]!==B||e[79]!==$||e[80]!==V||e[81]!==ae?(pe=o.jsxs(P,{children:[B,$,V,ae]}),e[77]=P,e[78]=B,e[79]=$,e[80]=V,e[81]=ae,e[82]=pe):pe=e[82],pe}function Ht(e){return e.id}export{xs as default};
|
|
1
|
+
import{c as fe,b as he,j as o,G as de,p as Fe,ai as Ee,H as we,af as ke,F as ve,B as ue,I as Se,eM as Pe,a0 as xe,a6 as Ge,K as je,m as Ne,a as _e,o as Ae,r as M,dl as Me,z as Oe,e as Re,q as Q,t as Ce,l as Ue,Z as ze,ae as $e,n as ge}from"./index-CFZrnnmD.js";import{b as Ve,c as He,g as Be}from"./use-virtual-mcp-B1-yfeBH.js";import{i as qe}from"./DotsVertical-B97QY-fA.js";import{a as Ke}from"./Tool01-CaOf6Mu4.js";import{s as Qe}from"./Trash01-DHtEq5nA.js";import{A as Ye,bp as Je}from"./agent-icon-b_XHjZEZ.js";import{u as We,f as De}from"./use-date-fns-locale-Cy0bIV3c.js";import{u as Ie}from"./use-navigate-to-agent-a1v5JNRv.js";import{l as Ze}from"./use-organization-settings-BLvm6CUv.js";import{E as Xe}from"./empty-state-BV17J4rU.js";import{u as et}from"./use-create-virtual-mcp-DIHuJhyr.js";import{b as tt,u as ot}from"./use-connection-Bi6HLcH4.js";import{u as ye}from"./use-mcp-client-4SfStdvU.js";import{a as st}from"./authenticate-and-persist-oauth-D88bk5XQ.js";import{e as it}from"./extract-connection-data-ByvXZO_i.js";import{f as nt,g as rt}from"./thread-intent-DfUdqfo1.js";import{a as lt}from"./github-repo-scope-C8GSbvaz.js";import{f as at,a as ct,G as mt,p as dt}from"./provision-repo-scoped-github-connection-B6zdkC6p.js";import{D as ut,b as pt,c as gt,d as ft,e as ht}from"./dialog-Dcra4McE.js";import{i as xt}from"./ArrowLeft-DHPtMbTg.js";import{C as bt}from"./collection-search-4vCvX0QD.js";import{G as jt}from"./github-icon-8fpS8l__.js";import{A as Ct,a as Dt,b as yt,c as wt,g as vt,d as St,e as Nt,f as _t}from"./alert-dialog-DehGSRTj.js";import{S as At}from"./search-input-C7zzo1gV.js";import{s as It}from"./Plus-t4kIBGIE.js";import{R as Tt}from"./repository-import-picker-DmgbIRex.js";import{u as Lt}from"./use-debounced-value-Bi1oqAau.js";import"./AlertCircle-BQBmepo1.js";import"./ArrowUp-DBDp30x0.js";import"./ArrowRight-m94XgZ3O.js";import"./XCircle-Bdqr7Csd.js";import"./ZoomOut-C8BTMnO9.js";import"./Globe04-CcTw2hMd.js";import"./CheckCircle-CySwUqst.js";import"./Check-Bcnv-H55.js";import"./ChevronUp-wyCoS3df.js";import"./UserSquare-BfH7tTry.js";import"./Copy01-CMEvgxoC.js";import"./CreditCard01-Bi7YfG5v.js";import"./Download01-DokiLBvz.js";import"./Eye-DlNsmazk.js";import"./Share07-DxxTtQWb.js";import"./XClose-Cx8dSxYY.js";import"./Image01-CGox3JEN.js";import"./Key01-MH27mIao.js";import"./LayoutLeft-CpKRfpdN.js";import"./Link01-BcMSFUIJ.js";import"./LinkExternal01-3Lsw2Z8I.js";import"./Monitor01-FNWg7-7u.js";import"./Sun-mSxdzNTE.js";import"./Package-ColnpoOk.js";import"./Palette-Bb9IRvVj.js";import"./SearchLg-DrU6iSmg.js";import"./SearchMd-Y5wxql57.js";import"./Stars01-Dwmyh59Q.js";import"./Upload01--yrzZIir.js";import"./User01-Dn00_JAZ.js";import"./Users01-BBUvRTwh.js";import"./X-xX_XXXXt.js";import"./Zap-Da5qzBL9.js";import"./differenceInSeconds-C3x8sHUj.js";import"./hooks-V57yclqv.js";import"./backoff-8mStPHYB.js";import"./task-board-BlCSl7H6.js";import"./schema-Du8_zRy7.js";import"./github-repo-BknN0SVI.js";import"./auth-CxmhwEgd.js";import"./mcp-oauth-D1pDEEn0.js";import"./metadata-D72DunRR.js";import"./connection-C15f5bNS.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-BdbJB8MH.js";import"./tooltip-CPnP6Sjs.js";import"./index-Cv3P6Wq4.js";import"./input-B_-SnRO5.js";import"./label-DSLU6fFz.js";import"./useInfiniteQuery-CpVWUzdl.js";import"./infiniteQueryObserver-Gux7qMEO.js";import"./avatar-BOPY-KDj.js";function Ft(e){const t=fe.c(26),{onCreateFromScratch:s,onImportGitHub:i,onImportDeco:r,isCreating:g,align:d,side:b,showBetaBadge:f,showDecoImport:y}=e,w=d===void 0?"end":d,u=he();let x;t[0]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(Fe,{size:14}),t[0]=x):x=t[0];let m;t[1]!==u?(m=u("common.createAgentDropdown.createFromScratch"),t[1]=u,t[2]=m):m=t[2];let h;t[3]!==g||t[4]!==s||t[5]!==m?(h=o.jsxs(de,{disabled:g,onClick:s,children:[x,m]}),t[3]=g,t[4]=s,t[5]=m,t[6]=h):h=t[6];let j;t[7]===Symbol.for("react.memo_cache_sentinel")?(j=o.jsx(Ee,{className:"size-3.5"}),t[7]=j):j=t[7];let c;t[8]!==u?(c=u("common.createAgentDropdown.importFromGitHub"),t[8]=u,t[9]=c):c=t[9];let l;t[10]!==f?(l=f&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),t[10]=f,t[11]=l):l=t[11];let p;t[12]!==i||t[13]!==c||t[14]!==l?(p=o.jsxs(de,{onClick:i,children:[j,c,l]}),t[12]=i,t[13]=c,t[14]=l,t[15]=p):p=t[15];let a;t[16]!==r||t[17]!==y||t[18]!==u?(a=y&&o.jsxs(de,{onClick:r,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),u("common.createAgentDropdown.importFromDeco")]}),t[16]=r,t[17]=y,t[18]=u,t[19]=a):a=t[19];let C;return t[20]!==w||t[21]!==b||t[22]!==h||t[23]!==p||t[24]!==a?(C=o.jsxs(we,{side:b,align:w,className:"w-48",children:[h,p,a]}),t[20]=w,t[21]=b,t[22]=h,t[23]=p,t[24]=a,t[25]=C):C=t[25],C}function Et(e){const t=fe.c(50),{project:s,lastUsedAt:i,onDeleteClick:r}=e,g=Ie(),d=he(),b=We(),f=s.metadata?.ui?.layout;let y;t[0]!==f?(y=ke(f),t[0]=f,t[1]=y):y=t[1];const w=y;let u;t[2]!==w||t[3]!==g||t[4]!==s.id?(u=()=>g(s.id,{panel:w}),t[2]=w,t[3]=g,t[4]=s.id,t[5]=u):u=t[5];let x;t[6]!==s.title||t[7]!==u?(x=o.jsx("button",{type:"button",onClick:u,className:"absolute inset-0 z-0","aria-label":s.title}),t[6]=s.title,t[7]=u,t[8]=x):x=t[8];let m;t[9]!==s.icon||t[10]!==s.title?(m=o.jsx(Ye,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),t[9]=s.icon,t[10]=s.title,t[11]=m):m=t[11];let h;t[12]===Symbol.for("react.memo_cache_sentinel")?(h=o.jsx(ve,{asChild:!0,children:o.jsx(ue,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx(qe,{size:20})})}),t[12]=h):h=t[12];let j;t[13]!==g||t[14]!==s.id?(j=()=>g(s.id,{panel:"settings"}),t[13]=g,t[14]=s.id,t[15]=j):j=t[15];let c;t[16]===Symbol.for("react.memo_cache_sentinel")?(c=o.jsx(Ke,{size:16}),t[16]=c):c=t[16];let l;t[17]!==j?(l=o.jsxs(de,{onClick:j,children:[c,"Settings"]}),t[17]=j,t[18]=l):l=t[18];let p;t[19]!==r?(p=r&&o.jsxs(de,{variant:"destructive",onClick:n=>{n.stopPropagation(),r(n)},children:[o.jsx(Qe,{size:16}),"Delete"]}),t[19]=r,t[20]=p):p=t[20];let a;t[21]!==p||t[22]!==l?(a=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(Se,{children:[h,o.jsxs(we,{align:"end",children:[l,p]})]})}),t[21]=p,t[22]=l,t[23]=a):a=t[23];let C;t[24]!==a||t[25]!==m?(C=o.jsxs("div",{className:"flex items-start justify-between",children:[m,a]}),t[24]=a,t[25]=m,t[26]=C):C=t[26];let D;t[27]!==s.title?(D=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})}),t[27]=s.title,t[28]=D):D=t[28];const O=s.description||"No description";let F;t[29]!==O?(F=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:O}),t[29]=O,t[30]=F):F=t[30];let E;t[31]!==D||t[32]!==F?(E=o.jsxs("div",{className:"flex flex-col gap-1",children:[D,F]}),t[31]=D,t[32]=F,t[33]=E):E=t[33];let S;t[34]!==C||t[35]!==E?(S=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[C,E]}),t[34]=C,t[35]=E,t[36]=S):S=t[36];let N;t[37]!==i||t[38]!==b||t[39]!==s.updated_at||t[40]!==d?(N=i?d("home.projectCard.lastUsed",{time:De(new Date(i),{addSuffix:!0,locale:b})}):d("home.projectCard.updated",{time:De(new Date(s.updated_at),{addSuffix:!0,locale:b})}),t[37]=i,t[38]=b,t[39]=s.updated_at,t[40]=d,t[41]=N):N=t[41];let A;t[42]!==N?(A=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:N})})}),t[42]=N,t[43]=A):A=t[43];let P;t[44]!==S||t[45]!==A?(P=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[S,A]}),t[44]=S,t[45]=A,t[46]=P):P=t[46];let k;return t[47]!==P||t[48]!==x?(k=o.jsxs(Pe,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[x,P]}),t[47]=P,t[48]=x,t[49]=k):k=t[49],k}function kt(e,t){const s=fe.c(10),{org:i}=xe(),r=Ge();let g;s[0]!==e||s[1]!==i.id?(g=je.registryApp(i.id,e),s[0]=e,s[1]=i.id,s[2]=g):g=s[2];let d;s[3]!==e||s[4]!==r?(d=()=>r.call("COLLECTION_REGISTRY_APP_GET",{name:e}),s[3]=e,s[4]=r,s[5]=d):d=s[5];const b=t?.enabled??!0;let f;return s[6]!==g||s[7]!==d||s[8]!==b?(f={queryKey:g,queryFn:d,select:Pt,enabled:b,staleTime:3e5},s[6]=g,s[7]=d,s[8]=b,s[9]=f):f=s[9],Ne(f)}function Pt(e){return e.item}const Gt="deco/github-mcp";function Mt(e){const{org:t}=xe(),{data:s}=_e.useSession(),i=tt(),r=Ae(),[g,d]=M.useState("idle"),[b,f]=M.useState(null),[y,w]=M.useState(null),{data:u,isLoading:x}=kt(Gt,{enabled:e.enabled}),m=M.useRef(!1);e.enabled&&u&&!x&&!m.current&&s?.user?.id&&g==="idle"&&(m.current=!0,h());async function h(){if(!(!u||!s?.user?.id||!t))try{d("installing"),f(null);const c=it(u,t.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:p}=await i.create.mutateAsync(c);d("authenticating");const a=await st({connectionId:p,orgId:t.id,orgSlug:t.slug,persistFallback:C=>i.update.mutateAsync({id:p,data:{connection_token:C}}).then(()=>{})});if(a.ran&&!a.ok){try{await i.delete.mutateAsync(p)}catch{}throw new Error(a.error&&a.error!=="no token received"?a.error:"No token received from GitHub")}Me(r,t.id),w(c),d("ready")}catch(c){f(c instanceof Error?c.message:String(c)),d("error")}}function j(){d("idle"),f(null),w(null),m.current=!1}return e.enabled&&x&&g==="idle"?{status:"installing",error:null,connection:null,retry:j}:{status:g,error:b,connection:y,retry:j}}const Ot="deco-sites";function Rt(e){if(!e||typeof e!="object")return null;const t=e.github;if(!t||typeof t!="object")return null;const s=t.owner,i=t.repo;return typeof s!="string"||typeof i!="string"||s.length===0||i.length===0?null:{owner:s,repo:i}}function Ut(e,t){const s=t?Rt(t):null,i=s?.owner??Ot,r=s?.repo??e;return{owner:i,name:r,url:`https://github.com/${i}/${r}`}}function zt(e){return e.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Te(e,t,s){const i=await fetch(e,t),r=await i.json().catch(()=>({}));if(!i.ok)throw new Error(r.error??`${s} (${i.status})`);return r}function $t(e){return Te(`/api/${e}/deco-sites`,void 0,"Failed to load sites")}function Vt({open:e,onOpenChange:t,onBack:s}){const i=he(),{org:r}=xe(),g=Ie(),d=Ae(),{data:b}=_e.useSession(),[f,y]=M.useState(null),[w,u]=M.useState(null),[x,m]=M.useState(""),h=ye({connectionId:Oe,orgId:r.id,orgSlug:r.slug}),j=ot({slug:"mcp-github"}),c=lt(j),l=Mt({enabled:e&&c.length===0}),p=c.length===1?c[0]??null:w,a=c.length>1&&!p,C=ye({connectionId:p?.id??"",orgId:r.id,orgSlug:r.slug}),D=e&&c.length===0&&(l.status==="installing"||l.status==="authenticating"||l.status==="idle"),{data:O,isLoading:F,error:E}=Ne({queryKey:je.decoSites(b?.user?.email),queryFn:()=>$t(r.slug),enabled:e&&!!b?.user?.email,staleTime:6e4,retry:!1}),S=O?.sites??[],N=n=>{n||(y(null),u(null),m("")),t(n)},A=S.filter(n=>n.name.toLowerCase().includes(x.toLowerCase())||(n.domains?.[0]?.domain?.toLowerCase().includes(x.toLowerCase())??!1)),P=!f||A.some(n=>n.name===f),k=Re({mutationFn:async n=>{if(!p)throw new Error(i("common.importFromDecoDialog.githubNotConnected"));Q("deco_site_import_started",{site_name:n});const{installations:G}=await at(L=>h.callTool(L),p.id),I=S.find(L=>L.name===n);if(!I)throw new Error(i("common.importFromDecoDialog.siteNoLongerAvailable"));const v=Ut(n,I.metadata),T=ct(G,v.owner);if(!T)throw new Error(i("common.importFromDecoDialog.installGithubApp",{owner:v.owner,installUrl:mt}));let H=null,R=null;const ce=async()=>{R&&await h.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:R}}).catch(()=>{}),H&&await h.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:H,force:!0}}).catch(()=>{})};try{const L=await Te(`/api/${r.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:n})},i("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:U,reused:me}=await dt({orgSlug:r.slug,sourceConnection:p,installationId:T.installationId,owner:v.owner,repo:v.name,githubCallTool:K=>C.callTool(K),selfCallTool:K=>h.callTool(K)});H=me?null:U;const Y=L.icon??null,z=zt(n),B=n.toLowerCase(),$=nt(n),V=await h.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n,description:"Imported from deco.cx",pinned:!1,icon:Y??null,metadata:{instructions:null,siteSlug:B,previewServerUrl:$,productionUrl:$,githubRepo:{owner:v.owner,name:v.name,url:v.url,installationId:T.installationId,connectionId:U},ui:{banner:null,bannerColor:"#22C55E",icon:Y,themeColor:"#22C55E",slug:z,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:U}]}}}),q=V.structuredContent??V;if(!q.item?.id)throw new Error(i("common.importFromDecoDialog.failedToCreateAgent"));return R=q.item.id,{slug:z,virtualMcpId:q.item.id,item:q.item}}catch(L){throw await ce(),L}},onSuccess:({slug:n,virtualMcpId:G,item:I})=>{Q("deco_site_import_succeeded",{site_name:I.title,virtual_mcp_id:G,slug:n}),d.setQueryData(je.collectionItem(h,r.id,"","VIRTUAL_MCP",G),{item:I}),d.invalidateQueries({predicate:v=>{const T=v.queryKey;return T[1]===r.id&&T[3]==="collection"&&T[4]==="VIRTUAL_MCP"}}),Ce.success(i("common.importFromDecoDialog.importSuccess",{slug:n})),N(!1),g(G)},onError:n=>{Q("deco_site_import_failed",{error:n instanceof Error?n.message:"Unknown error"}),Ce.error(i("common.importFromDecoDialog.importFailed",{error:(n instanceof Error?n.message:i("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(ut,{open:e,onOpenChange:N,children:o.jsxs(pt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(gt,{className:"sr-only",children:o.jsx(ft,{children:i("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":i("common.importFromDecoDialog.goBack"),children:o.jsx(xt,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:i("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(bt,{value:x,onChange:m,placeholder:i("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:n=>{n.key==="Escape"&&m("")}})}),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??i("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ue,{variant:"outline",size:"sm",onClick:l.retry,children:i("common.importFromDecoDialog.retryGithubSetup")})]}),D&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.settingUpGithub")}),a&&!D&&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:i("common.importFromDecoDialog.selectGithubConnection")})}),c.map(n=>o.jsxs("button",{type:"button",onClick:()=>u(n),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?o.jsx("img",{src:n.icon,alt:n.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(jt,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}),F&&!D&&l.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.loadingSites")}),!F&&!D&&!a&&l.status!=="error"&&!E&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:i("common.importFromDecoDialog.noSitesFound")}),!F&&!D&&!a&&l.status!=="error"&&S.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:[A.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:i("common.importFromDecoDialog.noSitesMatch",{search:x})}),A.map(n=>{const G=rt(n.domains),I=f===n.name;return o.jsxs("button",{type:"button",onClick:()=>y(n.name),className:Ue("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",I?"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:n.thumb_url?o.jsx("img",{src:n.thumb_url,alt:n.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:n.name}),G&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:G})]})]},n.name)})]})]}),o.jsxs(ht,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ue,{variant:"outline",onClick:()=>N(!1),disabled:k.isPending,children:i("common.importFromDecoDialog.cancel")}),o.jsx(ue,{disabled:!f||!P||k.isPending||F||D||a||!p||l.status==="error",onClick:()=>f&&k.mutate(f),children:k.isPending?i("common.importFromDecoDialog.importing"):i("common.importFromDecoDialog.import")})]})]})})}function xs(){const e=fe.c(83),t=ze(),s=he(),{org:i}=xe(),[r,g]=M.useState(""),d=Lt(r,300);let b;e[0]!==d?(b={searchTerm:d},e[0]=d,e[1]=b):b=e[1];const f=Ve(b),y=He();let w;e[2]===Symbol.for("react.memo_cache_sentinel")?(w={navigateOnCreate:!0},e[2]=w):w=e[2];const{createVirtualMCP:u,isCreating:x}=et(w),[m,h]=M.useState(null),[j,c]=M.useState(!1),[l,p]=M.useState(!1),{granted:a}=$e("agents:manage"),C=Ze();let D;e[3]!==i?(D=_=>_.id!==i.id,e[3]=i,e[4]=D):D=e[4];const O=f.filter(D),{data:F}=Be(O.map(Ht));let E;e[5]!==y||e[6]!==m||e[7]!==s?(E=async()=>{if(!m)return;const{id:_,title:Le}=m;h(null);try{await y.delete.mutateAsync(_),Q("agent_deleted",{agent_id:_,source:"agents_list"}),Ce.success(s("routes.agentsList.deletedAgent",{title:Le}))}catch{}},e[5]=y,e[6]=m,e[7]=s,e[8]=E):E=e[8];const S=E;let N;e[9]!==a||e[10]!==u||e[11]!==x||e[12]!==C||e[13]!==s?(N=a&&o.jsxs(Se,{children:[o.jsx(ve,{asChild:!0,children:o.jsxs(ue,{size:"sm",children:[o.jsx(It,{size:14}),s("routes.agentsList.createAgent")]})}),o.jsx(Ft,{onCreateFromScratch:()=>{Q("agent_create_clicked",{source:"agents_list",method:"scratch"}),u()},onImportGitHub:()=>{Q("agent_create_clicked",{source:"agents_list",method:"github"}),p(!0)},onImportDeco:()=>{Q("agent_create_clicked",{source:"agents_list",method:"deco"}),c(!0)},isCreating:x,align:"end",showDecoImport:C})]}),e[9]=a,e[10]=u,e[11]=x,e[12]=C,e[13]=s,e[14]=N):N=e[14];const A=N,P=ge,k=ge,n=ge,G=t&&A;let I;e[15]!==s?(I=s("routes.agentsList.title"),e[15]=s,e[16]=I):I=e[16];let v;e[17]!==G||e[18]!==I?(v=o.jsx(ge.Title,{actions:G,children:I}),e[17]=G,e[18]=I,e[19]=v):v=e[19];let T;e[20]!==s?(T=s("routes.agentsList.searchPlaceholder"),e[20]=s,e[21]=T):T=e[21];let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=_=>{_.key==="Escape"&&(g(""),_.target.blur())},e[22]=H):H=e[22];let R;e[23]!==r||e[24]!==T?(R=o.jsx(At,{value:r,onChange:g,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:H}),e[23]=r,e[24]=T,e[25]=R):R=e[25];const ce=!t&&A;let L;e[26]!==R||e[27]!==ce?(L=o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[R,ce]}),e[26]=R,e[27]=ce,e[28]=L):L=e[28];let U;e[29]!==L||e[30]!==v?(U=o.jsxs("div",{className:"flex flex-col gap-6",children:[v,L]}),e[29]=L,e[30]=v,e[31]=U):U=e[31];const me=O.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Xe,{actions:!t&&!r&&A,image:o.jsx(Je,{size:48,className:"text-muted-foreground"}),title:s(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?s("routes.agentsList.noAgentsMatchSearch",{search:r}):s(a?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate")})}),Y=O.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:s("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:O.map(_=>o.jsx(Et,{project:_,lastUsedAt:F?.get(_.id)?.last_used_at,onDeleteClick:a?()=>h({id:_.id,title:_.title}):void 0},_.id))})]});let z;e[32]!==U||e[33]!==me||e[34]!==Y||e[35]!==n.Container?(z=o.jsxs(n.Container,{children:[U,me,Y]}),e[32]=U,e[33]=me,e[34]=Y,e[35]=n.Container,e[36]=z):z=e[36];let B;e[37]!==z||e[38]!==k.Content?(B=o.jsx(k.Content,{children:z}),e[37]=z,e[38]=k.Content,e[39]=B):B=e[39];let $;e[40]!==l?($=o.jsx(Tt,{open:l,onOpenChange:p}),e[40]=l,e[41]=$):$=e[41];let V;e[42]!==j?(V=o.jsx(Vt,{open:j,onOpenChange:c}),e[42]=j,e[43]=V):V=e[43];const q=!!m;let K;e[44]===Symbol.for("react.memo_cache_sentinel")?(K=_=>!_&&h(null),e[44]=K):K=e[44];let J;e[45]!==s?(J=s("routes.agentsList.deleteAgentTitle"),e[45]=s,e[46]=J):J=e[46];let W;e[47]!==J?(W=o.jsx(Ct,{children:J}),e[47]=J,e[48]=W):W=e[48];let Z;e[49]!==s?(Z=s("routes.agentsList.deleteAgentDescription"),e[49]=s,e[50]=Z):Z=e[50];const be=m?.title;let X;e[51]!==be?(X=o.jsx("span",{className:"font-medium text-foreground",children:be}),e[51]=be,e[52]=X):X=e[52];let ee;e[53]!==Z||e[54]!==X?(ee=o.jsxs(Dt,{children:[Z," ",X,"."]}),e[53]=Z,e[54]=X,e[55]=ee):ee=e[55];let te;e[56]!==W||e[57]!==ee?(te=o.jsxs(yt,{children:[W,ee]}),e[56]=W,e[57]=ee,e[58]=te):te=e[58];let oe;e[59]!==s?(oe=s("routes.agentsList.cancelButton"),e[59]=s,e[60]=oe):oe=e[60];let se;e[61]!==oe?(se=o.jsx(wt,{children:oe}),e[61]=oe,e[62]=se):se=e[62];let ie;e[63]!==s?(ie=s("routes.agentsList.deleteButton"),e[63]=s,e[64]=ie):ie=e[64];let ne;e[65]!==S||e[66]!==ie?(ne=o.jsx(vt,{onClick:S,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:ie}),e[65]=S,e[66]=ie,e[67]=ne):ne=e[67];let re;e[68]!==se||e[69]!==ne?(re=o.jsxs(St,{children:[se,ne]}),e[68]=se,e[69]=ne,e[70]=re):re=e[70];let le;e[71]!==te||e[72]!==re?(le=o.jsxs(Nt,{children:[te,re]}),e[71]=te,e[72]=re,e[73]=le):le=e[73];let ae;e[74]!==q||e[75]!==le?(ae=o.jsx(_t,{open:q,onOpenChange:K,children:le}),e[74]=q,e[75]=le,e[76]=ae):ae=e[76];let pe;return e[77]!==P||e[78]!==B||e[79]!==$||e[80]!==V||e[81]!==ae?(pe=o.jsxs(P,{children:[B,$,V,ae]}),e[77]=P,e[78]=B,e[79]=$,e[80]=V,e[81]=ae,e[82]=pe):pe=e[82],pe}function Ht(e){return e.id}export{xs as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as V,b as Q,an as Oe,ao as Fe,r as G,j as s,aW as st,d_ as Le,t as Z,dZ as de,dY as ae,aG as qe,a0 as se,a6 as te,o as oe,e as ie,x as he,B as W,K as X,m as pe,aR as ue,l as ne,dc as Be,ft as it,eM as ve,ae as lt,am as nt,L as rt,q as Ke,h as at,ap as ot,aq as xe,fs as ct}from"./index-Bv8ovZX7.js";import{i as dt}from"./AlertCircle-DwYUjJBu.js";import{u as He,a as me,i as ut,b as mt,p as ft,f as be,g as pt,d as ze}from"./use-ai-providers-BfBmzjxk.js";import{i as gt}from"./CheckCircle-DxLYuezp.js";import{c as xt,i as ht}from"./use-organization-settings-BXDoAx1p.js";import{S as vt}from"./schema-CMlylut3.js";import{M as bt}from"./select-model-Dc8NFwmy.js";import{u as yt}from"./use-debounced-autosave-Dabnhryq.js";import{I as ce}from"./input-D7VKtVHV.js";import{T as Ae,a as jt}from"./toggle-group-uWDttGAl.js";import{A as ye,a as je,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-5zuyoQ54.js";import{u as ge,d as we,a as Ve,e as Nt}from"./use-entitlements-BTK1TiYJ.js";import{u as Ge}from"./use-open-billing-url-DAJYSvuP.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-DRDlfnKQ.js";import{i as It}from"./Check-BgzQchyA.js";import{c as wt,e as kt,b as Dt}from"./Tool01-BNu7BHqQ.js";import{s as Kt}from"./Plus-DJAmbMrJ.js";import{s as At}from"./Trash01-CSeT8ZD8.js";import{A as Et}from"./avatar-CAxICn2w.js";import{u as Rt,f as Tt}from"./use-date-fns-locale-4nMtSnpk.js";import{c as We,P as Ut,C as Ee}from"./decopilot-CjeDftvq.js";import{P as Mt}from"./ai-providers-logos-DD3qZ33J.js";import{s as $t}from"./Eye-BCLEOXNL.js";import{d as Ot,c as Ft,b as Lt,D as qt,e as Bt}from"./dialog-aNfvq0Gx.js";import{R as Ht}from"./require-capability-D9SZxHsZ.js";import"./task-board-CSfWLhg4.js";import"./drawer-DSLgUl8S.js";import"./use-mobile-CbgvL5x6.js";import"./chat-context-ZGS-0Lc6.js";import"./use-panel-navigate-CeERwAhY.js";import"./thread-route-CX0quyn9.js";import"./use-project-scope-CdX2mBNC.js";import"./use-virtual-mcp-DyTrBBn7.js";import"./use-mcp-client-8W4pv2iG.js";import"./auth-Bdfh9TTN.js";import"./github-repo-BknN0SVI.js";import"./autosend-D8pg19Rh.js";import"./thread-intent-Bl6xIfFf.js";import"./slugify-CEUa2lfQ.js";import"./hooks-BHo3iW8o.js";import"./backoff-8mStPHYB.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-E0BM35TR.js";import"./index-B1YIjoy8.js";import"./User01-D0NPPWmZ.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-8e5Ux6Bp.js";import"./select-B_9gxhnf.js";import"./index-CW3mvbP-.js";import"./ChevronUp-CEt2-KWf.js";import"./ArrowLeft-BrzmATFY.js";import"./Key01-CwoMWwVQ.js";import"./SearchMd-BT8cdzsW.js";import"./Monitor01-DypnteF9.js";import"./download-app-dialog-jqsRuRCN.js";import"./Copy01-DY06zeXh.js";import"./Download01-BsnTCWqr.js";import"./Image01-Dnl26WcB.js";import"./Stars01-BFm8fGnC.js";import"./X-ClBxN2Lo.js";import"./access-gate-CuIthKSm.js";import"./capability-load-error-Dy5jJdoS.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>ut(e),Gt=e=>mt(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(27),{slot:i,onSlotChange:n,filterModels:a,defaultKeyId:r}=e,c=He(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??r),[f,o]=G.useState(l);f!==l&&(o(l),l&&g(l));let x;t[0]!==c||t[1]!==r||t[2]!==d?(x=c.some(I=>I.id===d)?d:r,t[0]=c,t[1]=r,t[2]=d,t[3]=x):x=t[3];const u=x;let v;t[4]!==u||t[5]!==c?(v=u?c.find(I=>I.id===u):null,t[4]=u,t[5]=c,t[6]=v):v=t[6];const C=v,{models:j,isLoading:h}=me(a?u??void 0:void 0),y=a?h||j.some(a):!0;let N;t[7]!==i||t[8]!==C?.providerId||t[9]!==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[7]=i,t[8]=C?.providerId,t[9]=l,t[10]=N):N=t[10];const w=N,m=Q();if(a&&!y){let I;t[11]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=m,t[12]=I):I=t[12];let k;return t[13]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[13]=I,t[14]=k):k=t[14],k}let b;t[15]!==m?(b=m("settings.simpleModeSection.pickModel"),t[15]=m,t[16]=b):b=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[17]=S):S=t[17];let p;t[18]!==u||t[19]!==n?(p=I=>{const k=I.keyId??u??"";g(k),n({keyId:k,modelId:I.modelId,title:I.title})},t[18]=u,t[19]=n,t[20]=p):p=t[20];let P;return t[21]!==u||t[22]!==a||t[23]!==w||t[24]!==b||t[25]!==p?(P=s.jsx(bt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:a,onCredentialChange:S,onModelChange:p}),t[21]=u,t[22]=a,t[23]=w,t[24]=b,t[25]=p,t[26]=P):P=t[26],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:n}=e,a=Q();if(i){let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(qe,{size:12,className:"animate-spin"}),t[0]=r):r=t[0];let c;t[1]!==a?(c=a("settings.simpleModeSection.saving"),t[1]=a,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:[r,c]}),t[3]=c,t[4]=l):l=t[4],l}if(n){let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(gt,{size:12}),t[5]=r):r=t[5];let c;t[6]!==a?(c=a("settings.simpleModeSection.saved"),t[6]=a,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:[r,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Zt(){const e=V.c(58),t=Q(),i=He(),n=xt(),a=i.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Oe(vt),e[0]=r):r=e[0];let c;e[1]!==n?(c={resolver:r,values:n,mode:"onChange"},e[1]=n,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=ht(),o=l.formState.isDirty;let x;e[3]!==l||e[4]!==n||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(n),Z.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=n,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=yt(x),v=i[0],C=i[1],j=i[2],{models:h}=me(v?.id),{models:y}=me(C?.id),{models:N}=me(j?.id);let w,m;e[8]!==l||e[9]!==a?(w=()=>{a||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[a,l],e[8]=l,e[9]=a,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]!==j||e[17]!==h||e[18]!==y||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Xt)),B={};v?.id&&(B[v.id]=h),C?.id&&(B[C.id]=y),j?.id&&(B[j.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=ft(i,B);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]=j,e[17]=h,e[18]=y,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=j?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==y||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,y,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=y,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 R=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 T;e[36]!==t?(T=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=T):T=e[37];let $;e[38]!==T?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:T}),e[38]=T,e[39]=$):$=e[39];const q=f&&!o;let O;e[40]!==g||e[41]!==q?(O=s.jsx(Wt,{isPending:g,showSaved:q}),e[40]=g,e[41]=q,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]!==R||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:B}=M;return s.jsx(Le,{title:R(_.key),description:U(_.key),action:s.jsx(Yt,{slot:B.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{B.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=R,e[50]=u,e[51]=L):L=e[51];let H;e[52]!==L?(H=s.jsx(de,{children:L}),e[52]=L,e[53]=H):H=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==H?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,H]}),e[54]=E,e[55]=F,e[56]=H,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(),[n]=he(),[a,r]=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(""),[o,x]=G.useState(n.language==="pt-BR"?"brl":"usd"),u=o,v=parseFloat(g),C=!isNaN(v)&&v>=1,j=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let y,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=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]=y,e[5]=N):(y=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:[y,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==j||e[11]!==a||e[12]!==d||e[13]!==t||e[14]!==l?(m=!a&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[j,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>r(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=j,e[11]=a,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==j||e[17]!==g||e[18]!==v||e[19]!==a||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=a&&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:j}),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:()=>{r(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=j,e[17]=g,e[18]=v,e[19]=a,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,n=Q(),{org:a}=se(),r=te();let c;t[0]!==a.id?(c=X.aiProviderCredits(a.id,"deco"),t[0]=a.id,t[1]=c):c=t[1];let l;t[2]!==r?(l=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=r,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:o,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 j;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(j=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:ne("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]=j):j=t[14];let h;t[15]!==o?(h=()=>o(),t[15]=o,t[16]=h):h=t[16];let y;t[17]!==n?(y=n("settings.decoCreditsHero.refreshBalance"),t[17]=n,t[18]=y):y=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=ne(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(qe,{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]!==y?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 classic:rounded-md compact:rounded-lg hover:bg-muted/50","aria-label":y,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=y,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==j?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[j,b]}),t[28]=b,t[29]=j,t[30]=S):S=t[30];let p;t[31]!==n?(p=n("settings.decoCreditsHero.availableBalance"),t[31]=n,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(),n=te(),a=oe(),r=be();let c;e[0]!==r?(c=r.find(ls),e[0]=r,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,o]=G.useState(!1);let x;e[2]!==l||e[3]!==n?(x=async()=>{l&&await n.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=n,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==a||e[7]!==t?(u=()=>{a.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:X.aiProviders(i.id)}),Z.success(t("settings.decoCreditsHero.disconnectSuccess")),o(!1)},e[5]=i,e[6]=a,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:j,isPending:h}=ie(C);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=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=()=>o(!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(ye,{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 R;e[36]!==k?(R=s.jsx(je,{children:k}),e[36]=k,e[37]=R):R=e[37];let A;e[38]!==I||e[39]!==R?(A=s.jsxs(Ne,{children:[I,R]}),e[38]=I,e[39]=R,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 T;e[45]!==j?(T=()=>j(),e[45]=j,e[46]=T):T=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let q;e[49]!==T||e[50]!==$?(q=s.jsx(Ce,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=T,e[50]=$,e[51]=q):q=e[51];let O;e[52]!==E||e[53]!==q?(O=s.jsxs(Pe,{children:[E,q]}),e[52]=E,e[53]=q,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:o,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const H=!d;let D;e[61]!==H?(D=s.jsx(ss,{enabled:H}),e[61]=H,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 B;return e[71]!==M||e[72]!==y?(B=s.jsx(ae,{title:y,children:M}),e[71]=M,e[72]=y,e[73]=B):B=e[73],B}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[ns]=it(ke),[rs,as]=ns(ke),Xe=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:n=null,max:a,getValueLabel:r=os,...c}=e;(a||a===0)&&!Re(a)&&console.error(cs(`${a}`,"Progress"));const l=Re(a)?a:De;n!==null&&!Te(n,l)&&console.error(ds(`${n}`,"Progress"));const d=Te(n,l)?n:null,g=fe(d)?r(d,l):void 0;return s.jsx(rs,{scope:i,value:d,max:l,children:s.jsx(Be.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,...n}=e,a=as(Je,i);return s.jsx(Be.div,{"data-state":tt(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,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 Re(e){return fe(e)&&!isNaN(e)&&e>0}function Te(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,an as Oe,ao as Fe,r as G,j as s,aW as st,d_ as Le,t as Z,dZ as de,dY as ae,aG as qe,a0 as se,a6 as te,o as oe,e as ie,x as he,B as W,K as X,m as pe,aR as ue,l as ne,dc as Be,ft as it,eM as ve,ae as lt,am as nt,L as rt,q as Ke,h as at,ap as ot,aq as xe,fs as ct}from"./index-CFZrnnmD.js";import{i as dt}from"./AlertCircle-BQBmepo1.js";import{u as He,a as me,i as ut,b as mt,p as ft,f as be,g as pt,d as ze}from"./use-ai-providers-BV_DvH7o.js";import{i as gt}from"./CheckCircle-CySwUqst.js";import{c as xt,i as ht}from"./use-organization-settings-BLvm6CUv.js";import{S as vt}from"./schema-Du8_zRy7.js";import{M as bt}from"./select-model-DpXoMCZH.js";import{u as yt}from"./use-debounced-autosave-D8Sorx0q.js";import{I as ce}from"./input-B_-SnRO5.js";import{T as Ae,a as jt}from"./toggle-group-CNL0xUW4.js";import{A as ye,a as je,b as Ne,c as Se,g as Ce,d as Pe,e as _e,f as Ie}from"./alert-dialog-DehGSRTj.js";import{u as ge,d as we,a as Ve,e as Nt}from"./use-entitlements-qq0onzk3.js";import{u as Ge}from"./use-open-billing-url-CSkUOZcG.js";import{u as Qe,P as Ye,a as St,c as Ct,f as Pt,F as _t}from"./plan-ladder-BfylXdSz.js";import{i as It}from"./Check-Bcnv-H55.js";import{c as wt,e as kt,b as Dt}from"./Tool01-CaOf6Mu4.js";import{s as Kt}from"./Plus-t4kIBGIE.js";import{s as At}from"./Trash01-DHtEq5nA.js";import{A as Et}from"./avatar-BOPY-KDj.js";import{u as Rt,f as Tt}from"./use-date-fns-locale-Cy0bIV3c.js";import{c as We,P as Ut,C as Ee}from"./decopilot-bLAHPQ8D.js";import{P as Mt}from"./ai-providers-logos-DD3qZ33J.js";import{s as $t}from"./Eye-DlNsmazk.js";import{d as Ot,c as Ft,b as Lt,D as qt,e as Bt}from"./dialog-Dcra4McE.js";import{R as Ht}from"./require-capability-CUtBt1bi.js";import"./task-board-BlCSl7H6.js";import"./drawer-0y_cyI4K.js";import"./use-mobile-DARHzVZh.js";import"./chat-context-mOTo9_NI.js";import"./use-panel-navigate-Ba3IZxfG.js";import"./thread-route-CIar6WIg.js";import"./use-project-scope-BspeH_sq.js";import"./use-virtual-mcp-B1-yfeBH.js";import"./use-mcp-client-4SfStdvU.js";import"./auth-CxmhwEgd.js";import"./github-repo-BknN0SVI.js";import"./autosend-CR9k38nC.js";import"./thread-intent-DfUdqfo1.js";import"./slugify-CEUa2lfQ.js";import"./hooks-V57yclqv.js";import"./backoff-8mStPHYB.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-CVfzaSiv.js";import"./index-Dq-IpwkC.js";import"./User01-Dn00_JAZ.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-I2peiheL.js";import"./select-BOM-aKhP.js";import"./index-Cv3P6Wq4.js";import"./ChevronUp-wyCoS3df.js";import"./ArrowLeft-DHPtMbTg.js";import"./Key01-MH27mIao.js";import"./SearchMd-Y5wxql57.js";import"./Monitor01-FNWg7-7u.js";import"./download-app-dialog-Bt9MR0m_.js";import"./Copy01-CMEvgxoC.js";import"./Download01-DokiLBvz.js";import"./Image01-CGox3JEN.js";import"./Stars01-Dwmyh59Q.js";import"./X-xX_XXXXt.js";import"./access-gate-wTt0hkiV.js";import"./capability-load-error-DVSWQq85.js";const zt=e=>e.capabilities?.includes("image")===!0,Vt=e=>ut(e),Gt=e=>mt(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(27),{slot:i,onSlotChange:n,filterModels:a,defaultKeyId:r}=e,c=He(),l=c.some(I=>I.id===i?.keyId)?i?.keyId:null,[d,g]=G.useState(l??r),[f,o]=G.useState(l);f!==l&&(o(l),l&&g(l));let x;t[0]!==c||t[1]!==r||t[2]!==d?(x=c.some(I=>I.id===d)?d:r,t[0]=c,t[1]=r,t[2]=d,t[3]=x):x=t[3];const u=x;let v;t[4]!==u||t[5]!==c?(v=u?c.find(I=>I.id===u):null,t[4]=u,t[5]=c,t[6]=v):v=t[6];const C=v,{models:j,isLoading:h}=me(a?u??void 0:void 0),y=a?h||j.some(a):!0;let N;t[7]!==i||t[8]!==C?.providerId||t[9]!==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[7]=i,t[8]=C?.providerId,t[9]=l,t[10]=N):N=t[10];const w=N,m=Q();if(a&&!y){let I;t[11]!==m?(I=m("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=m,t[12]=I):I=t[12];let k;return t[13]!==I?(k=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:I}),t[13]=I,t[14]=k):k=t[14],k}let b;t[15]!==m?(b=m("settings.simpleModeSection.pickModel"),t[15]=m,t[16]=b):b=t[16];let S;t[17]===Symbol.for("react.memo_cache_sentinel")?(S=I=>g(I),t[17]=S):S=t[17];let p;t[18]!==u||t[19]!==n?(p=I=>{const k=I.keyId??u??"";g(k),n({keyId:k,modelId:I.modelId,title:I.title})},t[18]=u,t[19]=n,t[20]=p):p=t[20];let P;return t[21]!==u||t[22]!==a||t[23]!==w||t[24]!==b||t[25]!==p?(P=s.jsx(bt,{variant:"bordered",placeholder:b,model:w,credentialId:u,filterModels:a,onCredentialChange:S,onModelChange:p}),t[21]=u,t[22]=a,t[23]=w,t[24]=b,t[25]=p,t[26]=P):P=t[26],P}function Wt(e){const t=V.c(10),{isPending:i,showSaved:n}=e,a=Q();if(i){let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(qe,{size:12,className:"animate-spin"}),t[0]=r):r=t[0];let c;t[1]!==a?(c=a("settings.simpleModeSection.saving"),t[1]=a,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:[r,c]}),t[3]=c,t[4]=l):l=t[4],l}if(n){let r;t[5]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(gt,{size:12}),t[5]=r):r=t[5];let c;t[6]!==a?(c=a("settings.simpleModeSection.saved"),t[6]=a,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:[r,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function Zt(){const e=V.c(58),t=Q(),i=He(),n=xt(),a=i.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Oe(vt),e[0]=r):r=e[0];let c;e[1]!==n?(c={resolver:r,values:n,mode:"onChange"},e[1]=n,e[2]=c):c=e[2];const l=Fe(c),{mutate:d,isPending:g,isSuccess:f}=ht(),o=l.formState.isDirty;let x;e[3]!==l||e[4]!==n||e[5]!==t||e[6]!==d?(x={delayMs:250,save:async()=>{const _=l.getValues();d(_,{onSuccess:()=>l.reset(_,{keepValues:!0}),onError:M=>{l.reset(n),Z.error(t("settings.simpleModeSection.failedToSave",{error:M.message}))}})}},e[3]=l,e[4]=n,e[5]=t,e[6]=d,e[7]=x):x=e[7];const{schedule:u}=yt(x),v=i[0],C=i[1],j=i[2],{models:h}=me(v?.id),{models:y}=me(C?.id),{models:N}=me(j?.id);let w,m;e[8]!==l||e[9]!==a?(w=()=>{a||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},m=[a,l],e[8]=l,e[9]=a,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]!==j||e[17]!==h||e[18]!==y||e[19]!==N?(b=()=>{const _=l.getValues(),M=new Set(i.map(Xt)),B={};v?.id&&(B[v.id]=h),C?.id&&(B[C.id]=y),j?.id&&(B[j.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=ft(i,B);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]=j,e[17]=h,e[18]=y,e[19]=N,e[20]=b):b=e[20];const S=v?.id,p=C?.id,P=j?.id;let I;e[21]!==i||e[22]!==l||e[23]!==h||e[24]!==y||e[25]!==N||e[26]!==S||e[27]!==p||e[28]!==P?(I=[l,i,h,y,N,S,p,P],e[21]=i,e[22]=l,e[23]=h,e[24]=y,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 R=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 T;e[36]!==t?(T=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=T):T=e[37];let $;e[38]!==T?($=s.jsx("p",{className:"text-sm text-muted-foreground",children:T}),e[38]=T,e[39]=$):$=e[39];const q=f&&!o;let O;e[40]!==g||e[41]!==q?(O=s.jsx(Wt,{isPending:g,showSaved:q}),e[40]=g,e[41]=q,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]!==R||e[50]!==u?(L=Qt.map(_=>s.jsx(st,{control:l.control,name:`tiers.${_.key}`,render:M=>{const{field:B}=M;return s.jsx(Le,{title:R(_.key),description:U(_.key),action:s.jsx(Yt,{slot:B.value,defaultKeyId:i[0]?.id??null,filterModels:_.filter,onSlotChange:z=>{B.onChange(z),u()}})})}},_.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=U,e[49]=R,e[50]=u,e[51]=L):L=e[51];let H;e[52]!==L?(H=s.jsx(de,{children:L}),e[52]=L,e[53]=H):H=e[53];let D;return e[54]!==E||e[55]!==F||e[56]!==H?(D=s.jsxs(ae,{title:E,headerClassName:"pl-0",children:[F,H]}),e[54]=E,e[55]=F,e[56]=H,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(),[n]=he(),[a,r]=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(""),[o,x]=G.useState(n.language==="pt-BR"?"brl":"usd"),u=o,v=parseFloat(g),C=!isNaN(v)&&v>=1,j=u==="brl"?"R$":"$";let h;e[2]!==x?(h=p=>{p&&x(p)},e[2]=x,e[3]=h):h=e[3];let y,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=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]=y,e[5]=N):(y=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:[y,N]}),e[6]=u,e[7]=h,e[8]=w):w=e[8];let m;e[9]!==u||e[10]!==j||e[11]!==a||e[12]!==d||e[13]!==t||e[14]!==l?(m=!a&&s.jsxs(s.Fragment,{children:[Jt[u].map(p=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(p*100),children:[j,p]},p)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>r(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=j,e[11]=a,e[12]=d,e[13]=t,e[14]=l,e[15]=m):m=e[15];let b;e[16]!==j||e[17]!==g||e[18]!==v||e[19]!==a||e[20]!==C||e[21]!==d||e[22]!==f||e[23]!==t||e[24]!==l?(b=a&&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:j}),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:()=>{r(!1),f("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=j,e[17]=g,e[18]=v,e[19]=a,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,n=Q(),{org:a}=se(),r=te();let c;t[0]!==a.id?(c=X.aiProviderCredits(a.id,"deco"),t[0]=a.id,t[1]=c):c=t[1];let l;t[2]!==r?(l=async()=>{try{return await r.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},t[2]=r,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:o,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 j;t[10]!==u||t[11]!==C||t[12]!==x||t[13]!==f?(j=f||x?s.jsx(ue,{className:"h-9 w-24"}):s.jsx("span",{className:ne("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]=j):j=t[14];let h;t[15]!==o?(h=()=>o(),t[15]=o,t[16]=h):h=t[16];let y;t[17]!==n?(y=n("settings.decoCreditsHero.refreshBalance"),t[17]=n,t[18]=y):y=t[18];const N=x&&"animate-spin";let w;t[19]!==N?(w=ne(N),t[19]=N,t[20]=w):w=t[20];let m;t[21]!==w?(m=s.jsx(qe,{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]!==y?(b=s.jsx("button",{type:"button",onClick:h,disabled:x,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 classic:rounded-md compact:rounded-lg hover:bg-muted/50","aria-label":y,children:m}),t[23]=x,t[24]=m,t[25]=h,t[26]=y,t[27]=b):b=t[27];let S;t[28]!==b||t[29]!==j?(S=s.jsxs("div",{className:"flex items-baseline gap-2",children:[j,b]}),t[28]=b,t[29]=j,t[30]=S):S=t[30];let p;t[31]!==n?(p=n("settings.decoCreditsHero.availableBalance"),t[31]=n,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(),n=te(),a=oe(),r=be();let c;e[0]!==r?(c=r.find(ls),e[0]=r,e[1]=c):c=e[1];const l=c,d=ge(),g=we("credits"),[f,o]=G.useState(!1);let x;e[2]!==l||e[3]!==n?(x=async()=>{l&&await n.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=n,e[4]=x):x=e[4];let u;e[5]!==i||e[6]!==a||e[7]!==t?(u=()=>{a.invalidateQueries({queryKey:X.aiProviderKeys(i.id)}),a.invalidateQueries({queryKey:X.aiProviders(i.id)}),Z.success(t("settings.decoCreditsHero.disconnectSuccess")),o(!1)},e[5]=i,e[6]=a,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:j,isPending:h}=ie(C);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=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=()=>o(!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(ye,{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 R;e[36]!==k?(R=s.jsx(je,{children:k}),e[36]=k,e[37]=R):R=e[37];let A;e[38]!==I||e[39]!==R?(A=s.jsxs(Ne,{children:[I,R]}),e[38]=I,e[39]=R,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 T;e[45]!==j?(T=()=>j(),e[45]=j,e[46]=T):T=e[46];let $;e[47]!==t?($=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=$):$=e[48];let q;e[49]!==T||e[50]!==$?(q=s.jsx(Ce,{onClick:T,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:$}),e[49]=T,e[50]=$,e[51]=q):q=e[51];let O;e[52]!==E||e[53]!==q?(O=s.jsxs(Pe,{children:[E,q]}),e[52]=E,e[53]=q,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:o,children:F}),e[58]=f,e[59]=F,e[60]=L):L=e[60];const H=!d;let D;e[61]!==H?(D=s.jsx(ss,{enabled:H}),e[61]=H,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 B;return e[71]!==M||e[72]!==y?(B=s.jsx(ae,{title:y,children:M}),e[71]=M,e[72]=y,e[73]=B):B=e[73],B}function ls(e){return e.providerId==="deco"}var ke="Progress",De=100,[ns]=it(ke),[rs,as]=ns(ke),Xe=G.forwardRef((e,t)=>{const{__scopeProgress:i,value:n=null,max:a,getValueLabel:r=os,...c}=e;(a||a===0)&&!Re(a)&&console.error(cs(`${a}`,"Progress"));const l=Re(a)?a:De;n!==null&&!Te(n,l)&&console.error(ds(`${n}`,"Progress"));const d=Te(n,l)?n:null,g=fe(d)?r(d,l):void 0;return s.jsx(rs,{scope:i,value:d,max:l,children:s.jsx(Be.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,...n}=e,a=as(Je,i);return s.jsx(Be.div,{"data-state":tt(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,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 Re(e){return fe(e)&&!isNaN(e)&&e>0}function Te(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,aE as d}from"./index-
|
|
1
|
+
import{c as n,l as o,j as c,aE as d}from"./index-CFZrnnmD.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,bi as w,r as i,bp as m,de as T,ar as O,bs as M,bj as I,bk as z,bo as A,df as D,bl as F,dg as L,bI as k,bm as G,bn as H,c as n,l as p,au as v}from"./index-
|
|
1
|
+
import{j as r,bi as w,r as i,bp as m,de as T,ar as O,bs as M,bj as I,bk as z,bo as A,df as D,bl as F,dg as L,bI as k,bm as G,bn as H,c as n,l as p,au as v}from"./index-CFZrnnmD.js";var x="AlertDialog",[V]=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 W="AlertDialogTrigger",Y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});Y.displayName=W;var q="AlertDialogPortal",b=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(F,{...a,...t})};b.displayName=q;var B="AlertDialogOverlay",y=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(H,{...o,...a,ref:e})});y.displayName=B;var f="AlertDialogContent",[J,K]=V(f),Q=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:_,docsSlug:"alert-dialog",children:r.jsx(J,{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(Q,{children:a}),r.jsx(X,{contentRef:c})]})})})});j.displayName=f;var _="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(I,{...o,...a,ref:e})});h.displayName=_;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 U="AlertDialogAction",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});C.displayName=U;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=K($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var X=({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
|
|
package/dist/client/assets/{analytics-sections-B2FKhhgH.js → analytics-sections-DAtGnCwB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as v,c as y,j as n}from"./index-
|
|
1
|
+
import{r as v,c as y,j as n}from"./index-CFZrnnmD.js";import{C as w,a as $,c as L,d as E,b as O}from"./chart-D837siBd.js";import{T as R,a as D,b as N,c as M,d as F,e as A}from"./table-BK5Bj0BA.js";import{L as H}from"./Line-BldjxoIZ.js";import{a1 as I,a2 as U,C as z,X as K,Y as P}from"./CartesianChart-W8IwLG3F.js";var V=["axis"],W=v.forwardRef((r,e)=>v.createElement(I,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:V,tooltipPayloadSearcher:U,categoricalChartProps:r,ref:e}));const k=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function T(r){const e=Math.abs(r);return e<60?`${Math.round(r)}s`:e<3600?`${Math.round(r/60)}m`:e<86400?`${(r/3600).toFixed(1)}h`:`${(r/86400).toFixed(1)}d`}function _(r,e){return r===null||Number.isNaN(r)?"—":e==="s"?T(r):e==="%"?`${r}%`:e==="USD"?`$${r.toFixed(2)}`:r.toLocaleString()}function X(r){const e=y.c(4),{section:t}=r;let s;e[0]!==t.values?(s=t.values.map(Y),e[0]=t.values,e[1]=s):s=e[1];let l;return e[2]!==s?(l=n.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:s}),e[2]=s,e[3]=l):l=e[3],l}function Y(r){return n.jsxs("div",{className:"rounded-lg border border-border p-4",children:[n.jsx("div",{className:"text-sm text-muted-foreground",children:r.label}),n.jsx("div",{className:"mt-1 text-2xl font-medium text-foreground tabular-nums",children:_(r.value,r.unit)})]},r.label)}function B(r){const e=y.c(29),{section:t}=r;let s,l;e[0]!==t.points?(s=Array.from(new Set(t.points.flatMap(Z))).filter(Q),l=Object.fromEntries(s.map(J)),e[0]=t.points,e[1]=s,e[2]=l):(s=e[1],l=e[2]);const o=l;let a;e[3]!==t.points?(a=t.points.map(q),e[3]=t.points,e[4]=a):a=e[4];const i=a;if(i.length===0){let b;return e[5]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:"No data in this range"}),e[5]=b):b=e[5],b}const d=t.title;let m,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={left:0,right:8,top:8,bottom:8},f=n.jsx(z,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[6]=m,e[7]=f):(m=e[6],f=e[7]);let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(K,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),e[8]=x):x=e[8];let c;e[9]===Symbol.for("react.memo_cache_sentinel")?(c={fontSize:11,fill:"var(--muted-foreground)"},e[9]=c):c=e[9];let p;e[10]!==t.unit?(p=n.jsx(P,{axisLine:!1,tickLine:!1,tick:c,tickFormatter:b=>t.unit==="s"?T(b):String(b),width:48}),e[10]=t.unit,e[11]=p):p=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g={stroke:"var(--border)",strokeDasharray:"4 4"},e[12]=g):g=e[12];let u;e[13]!==t.unit?(u=n.jsx(L,{cursor:g,content:n.jsx(E,{formatter:b=>_(Number(b),t.unit??void 0)})}),e[13]=t.unit,e[14]=u):u=e[14];let h;e[15]!==s.length?(h=s.length>1&&n.jsx(w,{content:n.jsx($,{})}),e[15]=s.length,e[16]=h):h=e[16];let j;e[17]!==s?(j=s.map(G),e[17]=s,e[18]=j):j=e[18];let S;e[19]!==i||e[20]!==u||e[21]!==h||e[22]!==j||e[23]!==p?(S=n.jsxs(W,{data:i,margin:m,children:[f,x,p,u,h,j]}),e[19]=i,e[20]=u,e[21]=h,e[22]=j,e[23]=p,e[24]=S):S=e[24];let C;return e[25]!==o||e[26]!==t.title||e[27]!==S?(C=n.jsx(O,{role:"img","aria-label":d,className:"h-64 w-full",config:o,children:S}),e[25]=o,e[26]=t.title,e[27]=S,e[28]=C):C=e[28],C}function G(r,e){return n.jsx(H,{type:"linear",dataKey:r,stroke:k[e%k.length],strokeWidth:2,dot:!1,activeDot:{r:4,stroke:"var(--background)",strokeWidth:2},animationDuration:300},r)}function q(r){return{...r,label:String(r.t??"").slice(0,10)}}function J(r,e){return[r,{label:r,color:k[e%k.length]}]}function Q(r){return r!=="t"}function Z(r){return Object.keys(r)}function ee(r,e){return`/${encodeURIComponent(r)}/${encodeURIComponent(e)}`}function te(r){const e=y.c(25),{section:t,threadLinks:s}=r,l=t.columns.indexOf("Org");let o;e[0]!==l||e[1]!==t.columns||e[2]!==s?(o=s&&l>=0?t.columns.indexOf("Thread"):-1,e[0]=l,e[1]=t.columns,e[2]=s,e[3]=o):o=e[3];const a=o;if(t.rows.length===0){let c;return e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:"Nothing to show"}),e[4]=c):c=e[4],c}let i;e[5]!==t.columns?(i=t.columns.map(re),e[5]=t.columns,e[6]=i):i=e[6];let d;e[7]!==i?(d=n.jsx(D,{children:n.jsx(N,{children:i})}),e[7]=i,e[8]=d):d=e[8];let m;if(e[9]!==l||e[10]!==t.columns||e[11]!==t.rows||e[12]!==t.title||e[13]!==a){let c;e[15]!==l||e[16]!==t.columns||e[17]!==t.title||e[18]!==a?(c=(p,g)=>n.jsx(N,{children:p.map((u,h)=>n.jsx(M,{className:"max-w-md truncate text-sm tabular-nums",children:u===null?"—":h===a?n.jsx("a",{href:ee(String(p[l]),String(u)),target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-2 hover:underline",children:String(u)}):String(u)},t.columns[h]??String(h)))},`${t.title}-${g}`),e[15]=l,e[16]=t.columns,e[17]=t.title,e[18]=a,e[19]=c):c=e[19],m=t.rows.map(c),e[9]=l,e[10]=t.columns,e[11]=t.rows,e[12]=t.title,e[13]=a,e[14]=m}else m=e[14];let f;e[20]!==m?(f=n.jsx(F,{children:m}),e[20]=m,e[21]=f):f=e[21];let x;return e[22]!==d||e[23]!==f?(x=n.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:n.jsxs(A,{children:[d,f]})}),e[22]=d,e[23]=f,e[24]=x):x=e[24],x}function re(r){return n.jsx(R,{className:"whitespace-nowrap",children:r},r)}function oe(r){const e=y.c(14),{section:t,threadLinks:s}=r;let l;e[0]!==t.title?(l=n.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.title}),e[0]=t.title,e[1]=l):l=e[1];let o;e[2]!==t?(o=t.kind==="stat"&&n.jsx(X,{section:t}),e[2]=t,e[3]=o):o=e[3];let a;e[4]!==t?(a=t.kind==="series"&&n.jsx(B,{section:t}),e[4]=t,e[5]=a):a=e[5];let i;e[6]!==t||e[7]!==s?(i=t.kind==="table"&&n.jsx(te,{section:t,threadLinks:s}),e[6]=t,e[7]=s,e[8]=i):i=e[8];let d;return e[9]!==l||e[10]!==o||e[11]!==a||e[12]!==i?(d=n.jsxs("section",{className:"flex flex-col gap-3",children:[l,o,a,i]}),e[9]=l,e[10]=o,e[11]=a,e[12]=i,e[13]=d):d=e[13],d}export{oe as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,a0 as Y,z as Q,K as R,m as ce,o as U,e as V,j as i,fs as de,b as F,r as O,dY as me,eM as J,B as v,t as q}from"./index-Bv8ovZX7.js";import{i as fe}from"./AlertCircle-DwYUjJBu.js";import{a as ue}from"./Copy01-DY06zeXh.js";import{i as W}from"./Key01-CwoMWwVQ.js";import{s as X}from"./Plus-DJAmbMrJ.js";import{s as ge}from"./Trash01-CSeT8ZD8.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-5zuyoQ54.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-aNfvq0Gx.js";import{I as le}from"./input-D7VKtVHV.js";import{L as De}from"./label-BAb2clBH.js";import{u as M}from"./use-mcp-client-8W4pv2iG.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}=Y();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:Q,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=R.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}=Y();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Q,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:R.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 ve(){const t=A.c(11),{org:e}=Y();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Q,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:R.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 Ne(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(v,{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(v,{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 y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=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 x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,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(v,{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=L=>{L?r(L):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 y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,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=L=>c(L.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 N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=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(v,{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(v,{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]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let z;e[57]!==I||e[58]!==h?(z=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=z):z=e[59];let $;return e[60]!==a||e[61]!==z||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:z}),e[60]=a,e[61]=z,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[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(v,{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(Ne,{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(ye,{children:[i.jsxs(xe,{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 Re(){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,Re as O,Ae as a,Se as u};
|
|
1
|
+
import{c as A,a0 as Y,z as Q,K as R,m as ce,o as U,e as V,j as i,fs as de,b as F,r as O,dY as me,eM as J,B as v,t as q}from"./index-CFZrnnmD.js";import{i as fe}from"./AlertCircle-BQBmepo1.js";import{a as ue}from"./Copy01-CMEvgxoC.js";import{i as W}from"./Key01-MH27mIao.js";import{s as X}from"./Plus-t4kIBGIE.js";import{s as ge}from"./Trash01-DHtEq5nA.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as be}from"./alert-dialog-DehGSRTj.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-Dcra4McE.js";import{I as le}from"./input-B_-SnRO5.js";import{L as De}from"./label-DSLU6fFz.js";import{u as M}from"./use-mcp-client-4SfStdvU.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}=Y();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:Q,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=R.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}=Y();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Q,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:R.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 ve(){const t=A.c(11),{org:e}=Y();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Q,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:R.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 Ne(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(v,{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(v,{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 y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=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 x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==f?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[f,x]}),e[24]=x,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(v,{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=L=>{L?r(L):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 y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,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=L=>c(L.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 N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=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(v,{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(v,{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]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let z;e[57]!==I||e[58]!==h?(z=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=z):z=e[59];let $;return e[60]!==a||e[61]!==z||e[62]!==f?($=i.jsx(ne,{open:a,onOpenChange:f,children:z}),e[60]=a,e[61]=z,e[62]=f,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[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(v,{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(Ne,{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(ye,{children:[i.jsxs(xe,{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 Re(){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,Re as O,Ae as a,Se as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o,j as r}from"./index-CFZrnnmD.js";import{O as m}from"./api-keys-BRbJWypK.js";import{R as p}from"./require-capability-CUtBt1bi.js";import"./AlertCircle-BQBmepo1.js";import"./Copy01-CMEvgxoC.js";import"./Key01-MH27mIao.js";import"./Plus-t4kIBGIE.js";import"./Trash01-DHtEq5nA.js";import"./alert-dialog-DehGSRTj.js";import"./dialog-Dcra4McE.js";import"./X-xX_XXXXt.js";import"./input-B_-SnRO5.js";import"./label-DSLU6fFz.js";import"./use-mcp-client-4SfStdvU.js";import"./auth-CxmhwEgd.js";import"./access-gate-wTt0hkiV.js";import"./capability-load-error-DVSWQq85.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,am as wt,l as _t,h as At,t as ht}from"./index-CFZrnnmD.js";import{u as Et}from"./chat-context-mOTo9_NI.js";import{S as Nt}from"./scroll-area-DWMWIudU.js";import{u as Rt,A as Tt}from"./use-section-preview-base-B-Hn9i9b.js";import{o as Ct}from"./claim-phase-copy-nu5hupgI.js";import{j as Kt,u as Pt,w as Ft,aY as Ot,x as Ut,d as $t,aZ as It}from"./runnable-block-editor-C-z6sg8d.js";import{n as zt,r as Lt}from"./agent-site-editor-content-B9j94FVC.js";import"./use-panel-navigate-Ba3IZxfG.js";import"./thread-route-CIar6WIg.js";import"./use-project-scope-BspeH_sq.js";import"./use-virtual-mcp-B1-yfeBH.js";import"./use-mcp-client-4SfStdvU.js";import"./auth-CxmhwEgd.js";import"./github-repo-BknN0SVI.js";import"./autosend-CR9k38nC.js";import"./thread-intent-DfUdqfo1.js";import"./slugify-CEUa2lfQ.js";import"./hooks-V57yclqv.js";import"./backoff-8mStPHYB.js";import"./task-board-BlCSl7H6.js";import"./schema-Du8_zRy7.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-entitlements-qq0onzk3.js";import"./use-ai-providers-BV_DvH7o.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-CVfzaSiv.js";import"./use-organization-settings-BLvm6CUv.js";import"./select-BOM-aKhP.js";import"./index-Cv3P6Wq4.js";import"./Check-Bcnv-H55.js";import"./ChevronUp-wyCoS3df.js";import"./UserSquare-BfH7tTry.js";import"./Share07-DxxTtQWb.js";import"./agent-icon-b_XHjZEZ.js";import"./AlertCircle-BQBmepo1.js";import"./Tool01-CaOf6Mu4.js";import"./ArrowUp-DBDp30x0.js";import"./ArrowLeft-DHPtMbTg.js";import"./ArrowRight-m94XgZ3O.js";import"./XCircle-Bdqr7Csd.js";import"./ZoomOut-C8BTMnO9.js";import"./Globe04-CcTw2hMd.js";import"./CheckCircle-CySwUqst.js";import"./Copy01-CMEvgxoC.js";import"./CreditCard01-Bi7YfG5v.js";import"./DotsVertical-B97QY-fA.js";import"./Download01-DokiLBvz.js";import"./Eye-DlNsmazk.js";import"./XClose-Cx8dSxYY.js";import"./Image01-CGox3JEN.js";import"./Key01-MH27mIao.js";import"./LayoutLeft-CpKRfpdN.js";import"./Link01-BcMSFUIJ.js";import"./LinkExternal01-3Lsw2Z8I.js";import"./Monitor01-FNWg7-7u.js";import"./Sun-mSxdzNTE.js";import"./Package-ColnpoOk.js";import"./Palette-Bb9IRvVj.js";import"./Plus-t4kIBGIE.js";import"./SearchLg-DrU6iSmg.js";import"./SearchMd-Y5wxql57.js";import"./Stars01-Dwmyh59Q.js";import"./Trash01-DHtEq5nA.js";import"./Upload01--yrzZIir.js";import"./User01-Dn00_JAZ.js";import"./Users01-BBUvRTwh.js";import"./X-xX_XXXXt.js";import"./Zap-Da5qzBL9.js";import"./dialog-Dcra4McE.js";import"./input-B_-SnRO5.js";import"./section-preview-url-Csj0_ZDg.js";import"./use-session-runtime-BVLmSBh6.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-CVurrPq-.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-gVegBMwF.js";import"./use-copy-CDhoRgm3.js";import"./usage-stats-DJsI8Eqk.js";import"./markdown-oeL4d_tN.js";import"./org-file-open-context-DI6t8wtB.js";import"./use-mobile-DARHzVZh.js";import"./tooltip-CPnP6Sjs.js";import"./shell-layout-DMJ3Gw_b.js";import"./avatar-BOPY-KDj.js";import"./download-app-dialog-Bt9MR0m_.js";import"./command-gKTxqgCX.js";import"./index-Cw3ZmUL2.js";import"./integration-icon-C9XaIOHe.js";import"./project-icon-CzEj0avy.js";import"./required-auth-layout-BlnGUT2q.js";import"./use-org-sso-BcU16muD.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CmLIkf6i.js";import"./types-d1eRFziw.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-DSN8PosO.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./sheet-Dq13NqY6.js";import"./use-connection-Bi6HLcH4.js";import"./use-navigate-to-agent-a1v5JNRv.js";import"./use-mcp-prompts-DNTC-VnG.js";import"./index-B9RXO-FB.js";import"./form-Bn_VlbjB.js";import"./label-DSLU6fFz.js";import"./use-thread-outputs-CTmmbNmM.js";import"./file-type-icon-DYMR5_m7.js";import"./popover-Baq0imIs.js";import"./utils-D2y8J057.js";import"./monaco-editor-rG_ojQtN.js";import"./editor-BCdzptBY.js";import"./calendar-Dd9w8Cda.js";import"./textarea-CDG_4h5K.js";import"./rich-text-link-control-CFnLXxfY.js";import"./switch-BpU_dXOg.js";import"./combobox-DrUSoNBs.js";import"./alert-dialog-DehGSRTj.js";import"./sandbox-url-D3mC8qhT.js";import"./search-input-C7zzo1gV.js";import"./tabs-DtulKHna.js";import"./use-debounced-value-Bi1oqAau.js";import"./use-file-configs-DI6Asnep.js";import"./asset-utils-Dc_dFFTI.js";import"./useInfiniteQuery-CpVWUzdl.js";import"./infiniteQueryObserver-Gux7qMEO.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./toggle-group-CNL0xUW4.js";import"./decofile-api-DwohDDOu.js";import"./sandbox-git-api-B1R0585s.js";import"./agent-view-guard-DH71qayK.js";import"./use-main-panel-tabs-DIxFD1x0.js";import"./use-route-default-main-DSqzyOuP.js";import"./use-mcp-tools-CmJbGXa2.js";import"./index-DtZHgx57.js";import"./drawer-0y_cyI4K.js";import"./collection-search-4vCvX0QD.js";import"./input-Bwe8NZ5T.js";import"./chat-draft-D14VCCNF.js";import"./use-deco-credits-CRBFL3xa.js";import"./use-open-billing-url-CSkUOZcG.js";import"./decopilot-bLAHPQ8D.js";import"./checkbox-I2peiheL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./index-Dq-IpwkC.js";import"./input-DmvvEyNC.js";import"./suggestion-B2gCPjEY.js";import"./use-org-fs-PfmH2IwE.js";import"./question-004-sINsf4GQ.js";import"./use-members-ChLgHSO3.js";import"./use-org-auth-client-BcltMH40.js";import"./feature-paywall-Bl0cYtHt.js";import"./plan-ladder-BfylXdSz.js";import"./add-connection-dialog-C8n1sIiv.js";import"./extract-connection-data-ByvXZO_i.js";import"./metadata-D72DunRR.js";import"./connection-C15f5bNS.js";import"./connection-card-BMeKUGng.js";import"./connection-slug-CITJ0kGN.js";import"./connection-form-helpers-CmIBkFb3.js";import"./authenticate-and-persist-oauth-D88bk5XQ.js";import"./mcp-oauth-D1pDEEn0.js";import"./collection-tabs-DS-Im1ic.js";import"./badge-CN6KFcHa.js";import"./use-infinite-scroll-BwJMlu6L.js";import"./useSuspenseInfiniteQuery-CXyd6z14.js";import"./sandbox-lifecycle-context-244BQJ78.js";import"./use-task-metadata-CJ-QxfGm.js";import"./use-project-native-view-presence-CsPNZgcc.js";import"./site-slug-uya6Wp4-.js";import"./virtual-mcp-7pXCbTsW.js";import"./feature-gate-CGTKfO9Z.js";import"./mustache-_05g5fSZ.js";import"./empty-state-BimfTH5j.js";import"./empty-state-BV17J4rU.js";import"./github-icon-8fpS8l__.js";import"./repository-import-picker-DmgbIRex.js";import"./repository-picker-BdbJB8MH.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 ai(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:p,blockKey:s,block:x,meta:a,decofile:l,title:bt,excludeFields:M,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,Y=Et()?.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]!==M||t[4]!==a||t[5]!==v?(R=Lt(v,a,M),t[3]=M,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 G=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:J,isPending:Q}=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 W=Pt(K);let P;t[17]!==S?(P=$t((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const X=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(Zt),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]!==J||t[34]!==W||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await W.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),J()}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]=J,t[34]=W,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(wt,{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:_t("min-w-0 truncate classic:rounded-md compact:rounded-lg 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]!==Q?(j=o.jsx(It,{isPending:Q,isError:!1}),t[42]=Q,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]!==G||t[58]!==a||t[59]!==m||t[60]!==X||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==Y||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:G?o.jsx(Ut,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:X,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:pt,sandbox:{orgSlug:m,virtualMcpId:i,branch:p,threadId:Y}},`${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(At,{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]=G,t[58]=a,t[59]=m,t[60]=X,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=Y,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 Z;return t[75]!==B||t[76]!==w||t[77]!==_?(Z=o.jsxs("div",{className:gt,children:[B,w,_]}),t[75]=B,t[76]=w,t[77]=_,t[78]=Z):Z=t[78],Z}function qt(n){return n+1}function Zt(n){return n+1}export{ai as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,a0 as d,e as g,a6 as m,K as I,o as O}from"./index-
|
|
1
|
+
import{c as u,a0 as d,e as g,a6 as m,K as I,o as O}from"./index-CFZrnnmD.js";import{u as $}from"./useInfiniteQuery-CpVWUzdl.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 v(e){const t=e.split("/");return t[t.length-1]??e}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,v as b,F as c,S as e,_ as f,w as i,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a_ as $,a$ as v,b0 as W,b1 as H,b2 as D,b3 as y,b4 as V,b5 as x,b6 as b,b7 as q,b8 as j,b9 as N,ba as B,bb as Z,bc as F}from"./index-Bv8ovZX7.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 Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(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 Q(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 L(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[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 $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)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 M(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 H(`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 O=!e.redirectUrl;if(n!==void 0||O){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 D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"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 M(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 q.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??b;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=b}={}){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"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await M(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 N(),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 P(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=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await L(u);return F.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=P(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=P(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 L(s);return j.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,M as d,me as e};
|
|
1
|
+
import{a_ as $,a$ as v,b0 as W,b1 as H,b2 as D,b3 as y,b4 as V,b5 as x,b6 as b,b7 as q,b8 as j,b9 as N,ba as B,bb as Z,bc as F}from"./index-CFZrnnmD.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 Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(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 Q(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 L(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[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 $||n instanceof v)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)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 M(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 H(`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 O=!e.redirectUrl;if(n!==void 0||O){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 D)||l instanceof y))throw l}const C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"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 M(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 q.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??b;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=b}={}){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"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await M(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 N(),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 P(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=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await L(u);return F.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=P(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=P(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 L(s);return j.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,M 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-CFZrnnmD.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};
|