decocms 4.451.1 → 4.453.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-DDHQi3fm.js → AlertCircle-Bt4fa9oZ.js} +1 -1
- package/dist/client/assets/{AreaChart-xcCkJdeX.js → AreaChart-DWYdyPMO.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CIsJnvjF.js → ArrowLeft-BheW9nUA.js} +1 -1
- package/dist/client/assets/{ArrowUp-CtvQk6Vg.js → ArrowUp-BDvnBzdl.js} +1 -1
- package/dist/client/assets/{Building02-BVSXudo-.js → Building02-CrNedMIl.js} +1 -1
- package/dist/client/assets/{CartesianChart-YXdY8HHd.js → CartesianChart-8kSi455A.js} +1 -1
- package/dist/client/assets/{Check-Cf-cMW3t.js → Check-CBF8eTgr.js} +1 -1
- package/dist/client/assets/{CheckCircle-BemNEpVg.js → CheckCircle-DYG4Bhna.js} +1 -1
- package/dist/client/assets/{ChevronUp-B79uJeZN.js → ChevronUp-MXpj0fOa.js} +1 -1
- package/dist/client/assets/{Copy01-DluK-JtU.js → Copy01-DIV9jah9.js} +1 -1
- package/dist/client/assets/{CreditCard01-BzBUMTax.js → CreditCard01-J7tCMEH-.js} +1 -1
- package/dist/client/assets/{DotsVertical-COzw8ydu.js → DotsVertical-C8Ab5pHT.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-CICGscAV.js → ErrorBarContext-DnMNFKtY.js} +1 -1
- package/dist/client/assets/{Image01-DnRAAkhy.js → Image01-BWtlQPQv.js} +1 -1
- package/dist/client/assets/{Key01-DXvy1NNO.js → Key01-1FHVDeLv.js} +1 -1
- package/dist/client/assets/{Line-DooN19Jn.js → Line-BbDeyom9.js} +1 -1
- package/dist/client/assets/{Link01-iwXPIeVc.js → Link01-LJd6RIv6.js} +1 -1
- package/dist/client/assets/{LinkBroken01-ChSpe7Cq.js → LinkBroken01-Dao_xEQ2.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BVDnNs6j.js → LinkExternal01-CE1iCUGk.js} +1 -1
- package/dist/client/assets/{Monitor01-BLZH5esy.js → Monitor01-CF2sOSMh.js} +1 -1
- package/dist/client/assets/{Palette-CaKXG6S_.js → Palette-Dzi-BJNB.js} +1 -1
- package/dist/client/assets/{Plus-DjsQQqpw.js → Plus-DhmMzSv0.js} +1 -1
- package/dist/client/assets/{SearchMd-oXON6Mge.js → SearchMd-wnWyoFfY.js} +1 -1
- package/dist/client/assets/{Sector-Df4GIa0t.js → Sector-DsH_QAGW.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-DktiI11o.js → ShoppingBag01-lkT9atzh.js} +1 -1
- package/dist/client/assets/{Sun-BWosC3Su.js → Sun-D4-5PMzV.js} +1 -1
- package/dist/client/assets/{Tool01-BchdJG2X.js → Tool01-wjHS3MbM.js} +1 -1
- package/dist/client/assets/{Trash01-BfnCKCGB.js → Trash01-BIa5uuJe.js} +1 -1
- package/dist/client/assets/{Upload01-CNtxqXvb.js → Upload01-BRb6jPtu.js} +1 -1
- package/dist/client/assets/{User01-DXNh3TnB.js → User01-C-57a8l-.js} +1 -1
- package/dist/client/assets/{UserSquare-DZJwwd71.js → UserSquare-DlqsIDkY.js} +1 -1
- package/dist/client/assets/{Users01-DAfCqIN7.js → Users01-DjN8O7F9.js} +1 -1
- package/dist/client/assets/{X-C52mq3mn.js → X-8qFfssY9.js} +1 -1
- package/dist/client/assets/{XAxis-DgLHWAdH.js → XAxis-BpGOrC5z.js} +1 -1
- package/dist/client/assets/{XClose-BqRoe3QG.js → XClose-D0tJKCTL.js} +1 -1
- package/dist/client/assets/{ZoomOut-BlDSjKri.js → ZoomOut-uHj4ZFa9.js} +1 -1
- package/dist/client/assets/{access-gate-DbBQLMiF.js → access-gate-SUsdf2_J.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-Bll7Vib1.js → add-connection-dialog-ClOsCM_8.js} +1 -1
- package/dist/client/assets/{agent-analytics-DRKGLO_x.js → agent-analytics-DndkQu0r.js} +1 -1
- package/dist/client/assets/agent-app-BobjtVyg.js +1 -0
- package/dist/client/assets/{agent-assets-D9BHI5EW.js → agent-assets-RdnNCLJT.js} +1 -1
- package/dist/client/assets/{agent-automation-ClR5yW20.js → agent-automation-e1eAp4aw.js} +1 -1
- package/dist/client/assets/{agent-automations-CCiWhcgf.js → agent-automations-0jHyQA9h.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-DFTkcmVS.js → agent-connect-sources-DooPY1vD.js} +1 -1
- package/dist/client/assets/agent-deck-ELUak6ng.js +1 -0
- package/dist/client/assets/{agent-e2e-pbVC7Vx7.js → agent-e2e-CbRlxRJo.js} +1 -1
- package/dist/client/assets/{agent-experiments-_aODOZpq.js → agent-experiments-KzNzpKEZ.js} +1 -1
- package/dist/client/assets/{agent-file-DtN8kaxY.js → agent-file-D1qNyYKn.js} +1 -1
- package/dist/client/assets/{agent-git-BCddyL27.js → agent-git-BEOu16zF.js} +1 -1
- package/dist/client/assets/{agent-hosting-CgLWSfX9.js → agent-hosting-DHotJLu1.js} +1 -1
- package/dist/client/assets/{agent-icon-DEoEcQYL.js → agent-icon-Cj_JL7Bp.js} +1 -1
- package/dist/client/assets/agent-library-DqvVTGzC.js +1 -0
- package/dist/client/assets/agent-library-file-BDH8lD-Y.js +1 -0
- package/dist/client/assets/{agent-monitor-YUBiIydT.js → agent-monitor-_EyFI2PN.js} +1 -1
- package/dist/client/assets/{agent-overview-HCAO8obL.js → agent-overview-BtsaKKAR.js} +1 -1
- package/dist/client/assets/agent-settings-D_WGofV6.js +1 -0
- package/dist/client/assets/{agent-site-editor-DH5igdCT.js → agent-site-editor-D93MZlyg.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-ChD-d8ab.js +2 -0
- package/dist/client/assets/agent-site-editor-content-DhEurSUX.js +9 -0
- package/dist/client/assets/{agent-site-editor-preview-BBSy8s7P.js → agent-site-editor-preview-BH0RUgYn.js} +3 -3
- package/dist/client/assets/agent-view-Bu6uOJnR.js +1 -0
- package/dist/client/assets/{agent-view-guard-BYimT8Jz.js → agent-view-guard-DZjyKtcC.js} +1 -1
- package/dist/client/assets/{agents-list-C434Mp2b.js → agents-list-LO2a9X_f.js} +1 -1
- package/dist/client/assets/{ai-providers-DINDBcoG.js → ai-providers-yWVt2PDv.js} +1 -1
- package/dist/client/assets/{alert-_Nu0OQ4m.js → alert-DUMEFvk8.js} +1 -1
- package/dist/client/assets/{alert-dialog-D9wz_Poi.js → alert-dialog-C8wYJe4o.js} +1 -1
- package/dist/client/assets/{analytics-sections-_zTIyETq.js → analytics-sections-NWp6rhOY.js} +1 -1
- package/dist/client/assets/api-keys-Bv4N7hit.js +1 -0
- package/dist/client/assets/{api-keys-tqQH4z9A.js → api-keys-DHtUJ4Tp.js} +1 -1
- package/dist/client/assets/app-editor-D3Wd6_iV.js +1 -0
- package/dist/client/assets/{asset-utils-WUpNFBXm.js → asset-utils-9qybAQv4.js} +1 -1
- package/dist/client/assets/{auth-DDdLUET9.js → auth-Brm-gMyA.js} +1 -1
- package/dist/client/assets/{auth-catchall-mR81Birw.js → auth-catchall-UfTYRiKp.js} +1 -1
- package/dist/client/assets/{auth-entry-DCUAgWIX.js → auth-entry-BiE_X924.js} +1 -1
- package/dist/client/assets/{auth-split-layout-FX4F99rm.js → auth-split-layout-BgblilYR.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-Bb2l090x.js → authenticate-and-persist-oauth-CorzXjLa.js} +1 -1
- package/dist/client/assets/{automation-list-row-SxUdqZJz.js → automation-list-row-C8FL4Zg3.js} +1 -1
- package/dist/client/assets/{automation-runs-Cw-2J5pa.js → automation-runs-IqLWZQ8I.js} +1 -1
- package/dist/client/assets/{automations-DXUfchhU.js → automations-CkdOU_UU.js} +1 -1
- package/dist/client/assets/{autosend-CeDtnxlk.js → autosend-Cfg7z5wQ.js} +1 -1
- package/dist/client/assets/{avatar-BeFEVdWT.js → avatar-Dv4UhAF7.js} +1 -1
- package/dist/client/assets/{badge-Dw0XHZAq.js → badge-DkpauCB5.js} +1 -1
- package/dist/client/assets/{block-document-HhERskFc.js → block-document-DFfG6kSs.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-BqdqlnAP.js → blocks-preview-workspace-context-BsY8XMI5.js} +1 -1
- package/dist/client/assets/{blog-schema-Bzw5lTdw.js → blog-schema-BxUZ3wHq.js} +1 -1
- package/dist/client/assets/{buckets-C_vclPuO.js → buckets-CzauewrG.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-DG46Mbz-.js → build-improve-prompt-doc-0V5JNXkX.js} +1 -1
- package/dist/client/assets/{calendar-BGvJ_APz.js → calendar-B6k2OCPY.js} +1 -1
- package/dist/client/assets/{capability-load-error-m8D5eiRW.js → capability-load-error-C7wIGk2k.js} +1 -1
- package/dist/client/assets/{category-editor-BoAaFme1.js → category-editor-Cv9SXYas.js} +1 -1
- package/dist/client/assets/{chart-AQf5J0lZ.js → chart--RpICNYa.js} +1 -1
- package/dist/client/assets/{chat-context-DHGUafJ4.js → chat-context-B0osA6sP.js} +1 -1
- package/dist/client/assets/{chat-draft-Du6X8nKJ.js → chat-draft-CcOLHfwY.js} +1 -1
- package/dist/client/assets/{checkbox-D-g_vU3W.js → checkbox-DIhZR311.js} +1 -1
- package/dist/client/assets/{choose-editor-DJMezn9k.js → choose-editor-DNJQxXY7.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BTrkr4bY.js → claim-phase-copy-DnyF-TXo.js} +1 -1
- package/dist/client/assets/{cli-auth-success-M_9Lwmu5.js → cli-auth-success-DsghK4WZ.js} +1 -1
- package/dist/client/assets/{client-icons-Do1roBGh.js → client-icons-fYzf0xJy.js} +1 -1
- package/dist/client/assets/{collapsible-DUefED3P.js → collapsible-BLETQOpG.js} +1 -1
- package/dist/client/assets/{collection-detail-CuQUNXH_.js → collection-detail-DtsIGQM6.js} +1 -1
- package/dist/client/assets/{collection-display-button-CMHxbURQ.js → collection-display-button-BvJgyQfK.js} +1 -1
- package/dist/client/assets/{collection-search-CKxipBbw.js → collection-search-FGpxBvyM.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CN227TJm.js → collection-table-wrapper-Czauygsq.js} +1 -1
- package/dist/client/assets/{collection-tabs-z-VIWVMA.js → collection-tabs-rowwnfZs.js} +1 -1
- package/dist/client/assets/{column-rules-BOkclOCh.js → column-rules-D3AZPGyq.js} +1 -1
- package/dist/client/assets/{combobox-D_pkyBdU.js → combobox-Ccg5zawX.js} +1 -1
- package/dist/client/assets/{command-B-LkMxT6.js → command-bXSj8Nsv.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BPWHNlmG.js → companion-mcps-section-Ke6nVavz.js} +1 -1
- package/dist/client/assets/{config-F8FEDZHV.js → config-BVetft8h.js} +1 -1
- package/dist/client/assets/{connect-CSAnQalo.js → connect-CN2mju-m.js} +1 -1
- package/dist/client/assets/{connect-layout-CSKeZ95g.js → connect-layout-BKcmDT7t.js} +1 -1
- package/dist/client/assets/{connection-Da57b2wi.js → connection-CgrAKzVV.js} +1 -1
- package/dist/client/assets/{connection-card-UvAhqwBj.js → connection-card-BKpKctgB.js} +1 -1
- package/dist/client/assets/{connection-detail-C-Hcx_Z9.js → connection-detail-C1mdNiqN.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DyaTkO-i.js → connection-form-helpers-B85N_qO1.js} +1 -1
- package/dist/client/assets/{connections-B2s4aP98.js → connections-i4D96g6_.js} +1 -1
- package/dist/client/assets/{context-BPEjFj2c.js → context-C4qJf_Cd.js} +1 -1
- package/dist/client/assets/{context-menu-D65fsibc.js → context-menu-CwfLzEQy.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-rmBJe-TK.js → create-organization-dialog-BSA8XhJu.js} +1 -1
- package/dist/client/assets/{daily-pulse-39bOcAjW.js → daily-pulse-BDooebbD.js} +1 -1
- package/dist/client/assets/{decopilot-CDg-MCtI.js → decopilot-B0A58oJ1.js} +1 -1
- package/dist/client/assets/{device-hint-BckoyQwI.js → device-hint-dMehSmyL.js} +1 -1
- package/dist/client/assets/{dialog-C9YQM7Rb.js → dialog-C-xWJ6aR.js} +1 -1
- package/dist/client/assets/{discover-B4mPS-t0.js → discover-CSXEbeEF.js} +1 -1
- package/dist/client/assets/{domain-settings-C5SxoG2E.js → domain-settings-BP6jDzjw.js} +1 -1
- package/dist/client/assets/{download-app-dialog-D3HwAGf1.js → download-app-dialog-BXy5zLzA.js} +1 -1
- package/dist/client/assets/{drawer-BbtvDSmI.js → drawer-tgIYd8-D.js} +1 -1
- package/dist/client/assets/{editor-DiFPb_7W.js → editor-BIv-wzoI.js} +1 -1
- package/dist/client/assets/{empty-state-ChIdoRAZ.js → empty-state-B0BLTCaP.js} +1 -1
- package/dist/client/assets/{empty-state-Jq3vDmCi.js → empty-state-DqT8bOq1.js} +1 -1
- package/dist/client/assets/{extract-connection-data-0OXYM8zm.js → extract-connection-data-BX994cXq.js} +1 -1
- package/dist/client/assets/{feature-gate-DyX-49Cz.js → feature-gate-dmtOOeE4.js} +1 -1
- package/dist/client/assets/{feature-paywall-CMm2o9Ho.js → feature-paywall-Cq59U-JE.js} +1 -1
- package/dist/client/assets/{file-explorer-BsD7GHt-.js → file-explorer-t1tqywct.js} +1 -1
- package/dist/client/assets/{file-preview-DG7_swxk.js → file-preview-DUK3dWN5.js} +1 -1
- package/dist/client/assets/{file-share-button-d423tG-P.js → file-share-button-sbATXwia.js} +1 -1
- package/dist/client/assets/{file-type-icon-Zo3jfkM-.js → file-type-icon-azNQ7Sbi.js} +1 -1
- package/dist/client/assets/flat-project-CKF7NyLX.js +1 -0
- package/dist/client/assets/{folder-icon-DrGtPSK9.js → folder-icon-Bxi2zO5l.js} +1 -1
- package/dist/client/assets/{form-CYA-1Wz9.js → form-w94NTkmi.js} +1 -1
- package/dist/client/assets/{gateway-client-DE4QITdV.js → gateway-client-CBkpmomK.js} +1 -1
- package/dist/client/assets/{general-C_08074W.js → general-BlgBah6W.js} +1 -1
- package/dist/client/assets/{home-HCpI5IEw.js → home-CHthA9yo.js} +1 -1
- package/dist/client/assets/{icon-button-Cag62vyF.js → icon-button-BzOAFE8V.js} +1 -1
- package/dist/client/assets/{index-D3bKcVsq.js → index-B781YAMw.js} +1 -1
- package/dist/client/assets/{index-C-HKqiI5.js → index-BHk4tn4-.js} +1 -1
- package/dist/client/assets/{index-Dm3Ro6iT.js → index-BWHGqJx9.js} +1 -1
- package/dist/client/assets/{index-LffHYdj2.js → index-CHwtj70i.js} +1 -1
- package/dist/client/assets/{index-DzWyHXO2.js → index-CNvKOPw0.js} +1 -1
- package/dist/client/assets/{index-BGzd8qMa.js → index-CbcEBCnU.js} +1 -1
- package/dist/client/assets/{index-BxwNVsQv.js → index-CwbpsqSy.js} +1 -1
- package/dist/client/assets/{index-UAWA_mBS.js → index-D2T-jtJb.js} +39 -39
- package/dist/client/assets/{index-BiuSAlzd.js → index-DOUQg0zs.js} +7 -7
- package/dist/client/assets/index-DQ1cOjW3.js +64 -0
- package/dist/client/assets/{index-CFxmc0DR.js → index-DWyW7HEG.js} +1 -1
- package/dist/client/assets/{index-C9yvlucI.js → index-D_pCak2Z.js} +1 -1
- package/dist/client/assets/index-Dszga1s3.css +1 -0
- package/dist/client/assets/{index-DX971x0F.js → index-cNLRiAuc.js} +1 -1
- package/dist/client/assets/{index-DBg3Da4o.js → index-gY94M3s5.js} +1 -1
- package/dist/client/assets/{index-cj3FPIlo.js → index-nJb8KXrZ.js} +1 -1
- package/dist/client/assets/{index-redirect-Cms0d9Rf.js → index-redirect-ZbnqdqfD.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-B7-m24Hr.js → infiniteQueryObserver-BswUx1p7.js} +1 -1
- package/dist/client/assets/{infra-billing-BD4W3COQ.js → infra-billing-BWf13ZFY.js} +1 -1
- package/dist/client/assets/{input-B5d33h6X.js → input-D50iAX6q.js} +1 -1
- package/dist/client/assets/{input-CpjWxr53.js → input-DRiV2Ltl.js} +1 -1
- package/dist/client/assets/{input-CYlwvkm5.js → input-eibCtW0T.js} +3 -3
- package/dist/client/assets/{integration-icon-BcFb9WXn.js → integration-icon-CFKk2v6k.js} +1 -1
- package/dist/client/assets/{label-BmSaj4OS.js → label-BUdIq7o0.js} +1 -1
- package/dist/client/assets/{layout-DKTnWTMe.js → layout-CSgwLj2e.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CbFqRQlc.js → legacy-agents-deep-CzYuS6Jr.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-1k1KX6mL.js → legacy-main-redirect-DdHxHd4_.js} +1 -1
- package/dist/client/assets/library-DCWM6ulS.js +1 -0
- package/dist/client/assets/{library-tab-rskkU2DA.js → library-tab-iJvScgsu.js} +1 -1
- package/dist/client/assets/{login-BUVWJTBG.js → login-C0gBmuKB.js} +1 -1
- package/dist/client/assets/{markdown-D5RcIxaz.js → markdown-fiMoFDPr.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-4bTrB0jF.js → mcp-app-renderer-BS7Oo6Wc.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C-EEuNZg.js → mcp-oauth-BH-DbyuT.js} +1 -1
- package/dist/client/assets/{members-CWz-dF_G.js → members-CEMyqY5E.js} +1 -1
- package/dist/client/assets/{memory-BfINHUTl.js → memory-l3aj3leN.js} +1 -1
- package/dist/client/assets/{message-templates-Cq847r4U.js → message-templates-BDrJhWmm.js} +1 -1
- package/dist/client/assets/{mini-report-page-BxFxCQ_x.js → mini-report-page-BZOwbCYW.js} +1 -1
- package/dist/client/assets/{mock-board-BFAIWkA7.js → mock-board-BOWQRJGq.js} +1 -1
- package/dist/client/assets/{monaco-editor-DrtzucP0.js → monaco-editor-D-mRW-h5.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-DWbeH1RS.js → monitoring-stats-row-CdSi1tDW.js} +1 -1
- package/dist/client/assets/{multi-select-BidbKgY6.js → multi-select-CR9dPecK.js} +1 -1
- package/dist/client/assets/{mustache-Dy9IxQRw.js → mustache-QA0lqGO8.js} +1 -1
- package/dist/client/assets/{new-project-dialog-Dj5TFcCk.js → new-project-dialog-CuzcCfvd.js} +1 -1
- package/dist/client/assets/{oauth-callback-Diqg-5tw.js → oauth-callback-CArckPSp.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DdjEQJSy.js → oauth-callback-ai-provider-D6rucreY.js} +1 -1
- package/dist/client/assets/{onboarding-BiJRVogp.js → onboarding-CzWnHDAz.js} +1 -1
- package/dist/client/assets/{openai-conversation-Cssz-znB.js → openai-conversation-Cy_gU01K.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-Bl6nsH4A.js → optimistic-project-sidebar-views-DuGv0cvT.js} +1 -1
- package/dist/client/assets/{org-file-open-context-CTyFwctz.js → org-file-open-context-X82KWGO1.js} +1 -1
- package/dist/client/assets/{organization-choice-BtNQMYzV.js → organization-choice-DEKpIma6.js} +1 -1
- package/dist/client/assets/{orgs-BYnZJx1z.js → orgs-MWtaZU2V.js} +1 -1
- package/dist/client/assets/{page-seo-form-RJHH5jjR.js → page-seo-form-Bm0Yl_pv.js} +1 -1
- package/dist/client/assets/{pair-PmQIQCBI.js → pair-BeuuAyaq.js} +1 -1
- package/dist/client/assets/{plan-ladder-BbGn-NgZ.js → plan-ladder-CrScgxpw.js} +1 -1
- package/dist/client/assets/{popover-DwQhmYZx.js → popover-DBD2mXa7.js} +1 -1
- package/dist/client/assets/{post-calendar-u9yIz1ap.js → post-calendar-CxRz8brF.js} +1 -1
- package/dist/client/assets/{post-editor-zwUoRB_d.js → post-editor-CEzVNpF9.js} +1 -1
- package/dist/client/assets/{preview-content-YklxPrDD.js → preview-content-D0bluQPQ.js} +1 -1
- package/dist/client/assets/{preview-dialog-B6-Ghng-.js → preview-dialog-BAUxGH81.js} +1 -1
- package/dist/client/assets/{profile-DZ3TYytY.js → profile-Um_3tsSW.js} +1 -1
- package/dist/client/assets/{project-app-view-B13_tHdE.js → project-app-view-Cq2s6ZEX.js} +1 -1
- package/dist/client/assets/{project-feed-CuWJElvp.js → project-feed-BArQBhvK.js} +1 -1
- package/dist/client/assets/{project-icon-C1TVO88N.js → project-icon-BB6zDLc7.js} +1 -1
- package/dist/client/assets/project-reports-BGhg79bh.js +1 -0
- package/dist/client/assets/project-tasks-COx0ZGcG.js +1 -0
- package/dist/client/assets/{projects-empty-state-BBcr5xLl.js → projects-empty-state-BixNweey.js} +1 -1
- package/dist/client/assets/{projects-qlg8VwGy.js → projects-ryr4-jwz.js} +1 -1
- package/dist/client/assets/{prompts-IW4xrems.js → prompts-B1e-CCZz.js} +1 -1
- package/dist/client/assets/record-editor-Cz2HaKIm.js +1 -0
- package/dist/client/assets/{redirect-editor-Djr6TkEe.js → redirect-editor-B5RJSx5G.js} +1 -1
- package/dist/client/assets/reports-DqDpdA_l.js +1 -0
- package/dist/client/assets/{reports-DD_aD-uv.js → reports-Zjowhzxc.js} +1 -1
- package/dist/client/assets/{reports-onboarding-Btv0f8sO.js → reports-onboarding-nz1HSBU4.js} +1 -1
- package/dist/client/assets/{reports-tab-DoBMpRJD.js → reports-tab-Do2bUCXp.js} +2 -2
- package/dist/client/assets/{repositories-ZgvcUEvA.js → repositories-C89KYffZ.js} +1 -1
- package/dist/client/assets/{repository-binding-CQsr_3Zk.js → repository-binding-DosYHiTz.js} +1 -1
- package/dist/client/assets/{repository-import-picker-D6vKdpbU.js → repository-import-picker-CMKxpeps.js} +1 -1
- package/dist/client/assets/{repository-picker-DnfKLU2E.js → repository-picker-BFG56pB0.js} +1 -1
- package/dist/client/assets/{require-capability-B1clucXi.js → require-capability-D3ZFNPjS.js} +1 -1
- package/dist/client/assets/{required-auth-layout-5x9XYN7k.js → required-auth-layout-Dw5Q6vUD.js} +1 -1
- package/dist/client/assets/{reset-password-JId6yrpe.js → reset-password-BC9pm3cr.js} +1 -1
- package/dist/client/assets/{resizable-00FuDjCF.js → resizable-D8Z1i50L.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-Bi-w5DjE.js → resolve-tab-icon-BKs1-fnC.js} +1 -1
- package/dist/client/assets/{review-settings-IzuHTtkG.js → review-settings-6X43A69A.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-B3wmUrSm.js → rich-text-link-control-DFjq1r5L.js} +1 -1
- package/dist/client/assets/{roles-6EAMaiCw.js → roles-EXraMN83.js} +1 -1
- package/dist/client/assets/{route-Bp7poLJJ.js → route-B0dJZ3pl.js} +1 -1
- package/dist/client/assets/route-B_fTUEY3.js +1 -0
- package/dist/client/assets/{route-DcKDacvo.js → route-CrJc2x76.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-BPu9lbHb.js → runnable-block-editor-B392Ez37.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-_l6ILxBR.js → sandbox-lifecycle-context-Bb3Zpd8z.js} +1 -1
- package/dist/client/assets/{schema-CepQKFSq.js → schema-DpPC83dn.js} +1 -1
- package/dist/client/assets/{scroll-area-BNMPUKzn.js → scroll-area-DsfPpJuI.js} +1 -1
- package/dist/client/assets/{search-input-DroJjkYC.js → search-input-BdccUqIq.js} +1 -1
- package/dist/client/assets/{search-toggle-Vpxqce5X.js → search-toggle-quHdND_M.js} +1 -1
- package/dist/client/assets/{secret-picker-CIV9Pyxx.js → secret-picker-wkdXdYN6.js} +1 -1
- package/dist/client/assets/{secrets-Ddw-OUj-.js → secrets-CbrL0ayN.js} +1 -1
- package/dist/client/assets/{sections-editor-B6DapFds.js → sections-editor-axDmqRmh.js} +1 -1
- package/dist/client/assets/{select-QknS4jya.js → select-BgR8S5Ol.js} +1 -1
- package/dist/client/assets/{select-model-MWiJU5BO.js → select-model-BdenIwfs.js} +1 -1
- package/dist/client/assets/{seo-editor-BmySIXEZ.js → seo-editor-Bdm7fyAg.js} +1 -1
- package/dist/client/assets/{separator-C5QeX-ze.js → separator-2XGmlj4r.js} +1 -1
- package/dist/client/assets/{settings-tab-pWdRgoZd.js → settings-tab-DXFKO6In.js} +1 -1
- package/dist/client/assets/{sheet-CuQcjl8J.js → sheet-Dw4T_Oj6.js} +1 -1
- package/dist/client/assets/{shell-layout-DgCL-aOA.js → shell-layout-CwEcxoBa.js} +1 -1
- package/dist/client/assets/{skills-C9HRCrz7.js → skills-MZz8dd2w.js} +1 -1
- package/dist/client/assets/{sso-eRxfAwx6.js → sso-BEx85PdG.js} +1 -1
- package/dist/client/assets/{suggestion-CUAhSpKi.js → suggestion-c13g4aGt.js} +1 -1
- package/dist/client/assets/{switch-WI6sluFx.js → switch-BedRbAFv.js} +1 -1
- package/dist/client/assets/{synced-repos-B7M4g-ab.js → synced-repos-C1u8uNeC.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BUy8eStz.js → tab-icon-glyph-C8qNK-3O.js} +1 -1
- package/dist/client/assets/{table-DahiKrUr.js → table-Cy6wqXdI.js} +1 -1
- package/dist/client/assets/{tabs-mZ2AJpie.js → tabs-JL7K3W91.js} +1 -1
- package/dist/client/assets/{task-board-Cg5OuTdd.js → task-board-DXXLrHdX.js} +1 -1
- package/dist/client/assets/{task-route-CcdO9T8s.js → task-route-DvRs3tSX.js} +1 -1
- package/dist/client/assets/{task-status--I5ZFulR.js → task-status-BYvLWAmC.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-CwIKc_CA.js → taskboard-analytics-Co5aEBqv.js} +1 -1
- package/dist/client/assets/tasks-CR_TERQ9.js +1 -0
- package/dist/client/assets/{tasks-Cx199_rB.js → tasks-CTA5iX5O.js} +1 -1
- package/dist/client/assets/{textarea-IAy-ownU.js → textarea-DAcjiPhN.js} +1 -1
- package/dist/client/assets/{thread-analytics-DoucYhij.js → thread-analytics-DWERnRBI.js} +1 -1
- package/dist/client/assets/{thread-button-BS5hFLVf.js → thread-button-nnbp9Thn.js} +1 -1
- package/dist/client/assets/{thread-intent-ags1XWir.js → thread-intent-DC7irtdr.js} +1 -1
- package/dist/client/assets/{thread-route-Cbe9daAp.js → thread-route-CxLbUHC_.js} +1 -1
- package/dist/client/assets/{thread-route-SwwHxRrN.js → thread-route-DFAxA-J4.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BzLo18UG.js → thread-sheet-body-Bk3W4oVp.js} +1 -1
- package/dist/client/assets/{toggle-group-C7J6hm1X.js → toggle-group-1JsQ4ux4.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-MH5hFCTi.js → toolbar-icon-button-zVP3i3M-.js} +1 -1
- package/dist/client/assets/{tooltip-rVl8jzih.js → tooltip-C72eCv1P.js} +1 -1
- package/dist/client/assets/{track-D9Kj7slb.js → track-B68ozIWF.js} +1 -1
- package/dist/client/assets/{types-B77htmoi.js → types-zHVY6Tj3.js} +1 -1
- package/dist/client/assets/{usage-stats-B9NCjY7p.js → usage-stats-C8ortjqB.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BBj3hH0A.js → use-ai-providers-CGavfYZY.js} +1 -1
- package/dist/client/assets/{use-automations-BMeSuYUl.js → use-automations-Cry_qNf4.js} +1 -1
- package/dist/client/assets/{use-autosave-DddhIIlH.js → use-autosave-C6N-9B1i.js} +1 -1
- package/dist/client/assets/{use-chat-layout-state-CcLE4xPO.js → use-chat-layout-state-BGxl2b5e.js} +1 -1
- package/dist/client/assets/{use-clock-tick-WbPH8S5J.js → use-clock-tick-DZAgHMn_.js} +1 -1
- package/dist/client/assets/{use-connect-companion-ooa0I2Ht.js → use-connect-companion-cGnVi5y9.js} +1 -1
- package/dist/client/assets/{use-connection-BJVimXqv.js → use-connection-XeQWn4zm.js} +1 -1
- package/dist/client/assets/{use-copy-XLZP4Fnf.js → use-copy-D3sInWhT.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-P_mw-sB2.js → use-create-virtual-mcp-o8cPA6QL.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-D1z6vY0T.js → use-date-fns-locale-C1PKxs7V.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DM7h6lLt.js → use-debounced-autosave-DPeMCoXS.js} +1 -1
- package/dist/client/assets/{use-debounced-value-PqnB6cMC.js → use-debounced-value-BTFdSSe8.js} +1 -1
- package/dist/client/assets/{use-deco-credits-CWMvx_aN.js → use-deco-credits-B3RmRZk5.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-B_Wj2FDs.js → use-decopilot-events-Cz3bQ8e4.js} +1 -1
- package/dist/client/assets/{use-delete-connection-Ct_NbrFe.js → use-delete-connection-CZ1AGO3S.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BrRZ5JXH.js → use-deployment-admin-ksH2IuGN.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-Ckawo-Vn.js → use-fast-preview-draft-url-D_vM83Sm.js} +1 -1
- package/dist/client/assets/{use-file-configs-BCUJhrSS.js → use-file-configs-Cza42elA.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DOZLICG8.js → use-infinite-scroll-DYwoZ41l.js} +1 -1
- package/dist/client/assets/{use-join-requests-LL4W5sq2.js → use-join-requests-h1IT1C5_.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-CUdUAhvy.js → use-main-panel-tabs-CtSJnbbX.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D_jLHFPt.js → use-mcp-auth-status-D--ELRVB.js} +1 -1
- package/dist/client/assets/{use-mcp-client-5sJCC1_2.js → use-mcp-client-DxHrE3Rr.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-5OccjpiV.js → use-mcp-prompts-DU7C7-5Z.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-cj_8qKci.js → use-mcp-tools-Fmvnhe6I.js} +1 -1
- package/dist/client/assets/{use-members-C5RWM84Q.js → use-members-BM4kPqAt.js} +1 -1
- package/dist/client/assets/{use-mobile-D06E6E9A.js → use-mobile-BMPXLE4o.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-2D1RSJEE.js → use-navigate-to-agent-BE5yz9rb.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-DjNIilkA.js +1 -0
- package/dist/client/assets/{use-open-billing-url-CrzuSkfk.js → use-open-billing-url-BDx40jcR.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CXExidw4.js → use-org-auth-client-DSqDjigp.js} +1 -1
- package/dist/client/assets/{use-org-fs-BI2aRf-g.js → use-org-fs-9ZCJX1Pw.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DhxRO-sX.js → use-org-repo-syncs-xl1h1U_q.js} +1 -1
- package/dist/client/assets/{use-org-sso-C8LeExfy.js → use-org-sso-COQLixR1.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Z4A7wlo_.js → use-organization-roles-DML2NTan.js} +1 -1
- package/dist/client/assets/{use-organization-settings-0Ql08vCb.js → use-organization-settings-BIE-soL2.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DvFfVppm.js → use-panel-navigate-Bel1nQM_.js} +1 -1
- package/dist/client/assets/{use-project-scope-DJC0Rmd2.js → use-project-scope-Bq2SyzJ7.js} +1 -1
- package/dist/client/assets/{use-releases-UqMY8RcZ.js → use-releases-BIP94MZ_.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-zVwryKCp.js → use-reports-diagnostic-DxbYZRW5.js} +1 -1
- package/dist/client/assets/{use-secrets-DGDpC9hp.js → use-secrets-CFDb3oQf.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-DryOEAAN.js → use-section-preview-base-BSe-vK8M.js} +1 -1
- package/dist/client/assets/{use-session-runtime-Cosw4CCW.js → use-session-runtime-C87mS0mi.js} +1 -1
- package/dist/client/assets/{use-tags-BCCzUzPa.js → use-tags-DYq6lR1p.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-CCFQvvsk.js → use-task-board-analytics-DrGgz4ID.js} +1 -1
- package/dist/client/assets/{use-task-board-events-B2orELe0.js → use-task-board-events-CedfI1XO.js} +1 -1
- package/dist/client/assets/{use-task-metadata-8O-Ga8Wr.js → use-task-metadata-Dwwzepbk.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BYmN2LQm.js → use-thread-analytics-DMPJxe6E.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-DqnIgfuG.js → use-thread-outputs-uR6cqbM3.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DjkTQ_ZO.js +1 -0
- package/dist/client/assets/{useQueries-Cdt1TSyJ.js → useQueries-BdHc6JLD.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-C9-3JUor.js +1 -0
- package/dist/client/assets/{users-BLEnjq5F.js → users-q4Oe_h7l.js} +1 -1
- package/dist/client/assets/{utils-BiBoFq--.js → utils-Du6joti1.js} +1 -1
- package/dist/client/assets/{variant-calendar-Csv8MReF.js → variant-calendar-O56gYZ_9.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CdOGya1b.js → variant-matcher-override-CBhIWe9p.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-D3nXTaNQ.js → view-mode-toggle-BcGuF1pp.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DUyYKScq.js → virtual-mcp-DMkc4BYn.js} +1 -1
- package/dist/client/index.html +2 -2
- 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-DI84JCkP.js +0 -1
- package/dist/client/assets/agent-deck-CgsUwnay.js +0 -1
- package/dist/client/assets/agent-library-BMVOMtwg.js +0 -1
- package/dist/client/assets/agent-library-file-Bs_Ov692.js +0 -1
- package/dist/client/assets/agent-settings-JOvgc7kq.js +0 -1
- package/dist/client/assets/agent-site-editor-code-De-iSok_.js +0 -2
- package/dist/client/assets/agent-site-editor-content-Ch2WC4sl.js +0 -9
- package/dist/client/assets/agent-view-BtBtSuEv.js +0 -1
- package/dist/client/assets/api-keys-2hDzDTH9.js +0 -1
- package/dist/client/assets/app-editor-BqD9kpqg.js +0 -1
- package/dist/client/assets/flat-project-DUdVe5OD.js +0 -1
- package/dist/client/assets/index-DoNIk522.css +0 -1
- package/dist/client/assets/index-qFmYqkwW.js +0 -64
- package/dist/client/assets/library-D9RnFFGm.js +0 -1
- package/dist/client/assets/project-reports-hbeMiS7q.js +0 -1
- package/dist/client/assets/project-tasks-DcinQO1a.js +0 -1
- package/dist/client/assets/record-editor-DZiiw2X4.js +0 -1
- package/dist/client/assets/reports-RkncIczX.js +0 -1
- package/dist/client/assets/route-DLd5XMus.js +0 -1
- package/dist/client/assets/tasks-DQZjFSh-.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-DxwEKp1u.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BAMBgsXo.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-B_8hQc1u.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ue,b as pe,j as o,G as ae,p as Ae,ao as Ie,H as Ce,Y as Te,ae as Le,F as be,B as ce,I as De,e_ as Fe,X as ge,a2 as ke,K as fe,m as ye,a as we,o as ve,r as z,d3 as Ee,z as Pe,e as Ge,q as Q,t as he,l as Oe,ad as ze,n as de}from"./index-BiuSAlzd.js";import{b as Me,f as Ue,k as Re}from"./repository-binding-CQsr_3Zk.js";import{i as $e}from"./DotsVertical-COzw8ydu.js";import{a as Ve}from"./Tool01-BchdJG2X.js";import{s as He}from"./Trash01-BfnCKCGB.js";import{A as Be,bz as qe}from"./agent-icon-DEoEcQYL.js";import{u as Ke,f as xe}from"./use-date-fns-locale-D1z6vY0T.js";import{u as Se}from"./use-navigate-to-agent-2D1RSJEE.js";import{m as Qe}from"./use-organization-settings-0Ql08vCb.js";import{E as Ye}from"./empty-state-Jq3vDmCi.js";import{u as Je}from"./use-create-virtual-mcp-P_mw-sB2.js";import{b as Xe,u as We}from"./use-connection-BJVimXqv.js";import{u as je}from"./use-mcp-client-5sJCC1_2.js";import{a as Ze}from"./authenticate-and-persist-oauth-Bb2l090x.js";import{e as et}from"./extract-connection-data-0OXYM8zm.js";import{i as tt,G as ot}from"./repository-picker-DnfKLU2E.js";import{h as st,C as it}from"./thread-intent-ags1XWir.js";import{a as rt}from"./github-repo-scope-ByTYKy_L.js";import{f as nt,a as lt,G as at,p as ct}from"./provision-repo-scoped-github-connection-lckxpDHD.js";import{D as mt,b as dt,c as ut,d as pt,e as gt}from"./dialog-C9YQM7Rb.js";import{i as ft}from"./ArrowLeft-CIsJnvjF.js";import{C as ht}from"./collection-search-CKxipBbw.js";import{A as xt,a as jt,b as Ct,c as bt,g as Dt,d as yt,e as wt,f as vt}from"./alert-dialog-D9wz_Poi.js";import{S as St}from"./search-input-DroJjkYC.js";import{s as Nt}from"./Plus-DjsQQqpw.js";import{R as _t}from"./repository-import-picker-D6vKdpbU.js";import{u as At}from"./use-debounced-value-PqnB6cMC.js";import"./AlertCircle-DDHQi3fm.js";import"./ArrowUp-CtvQk6Vg.js";import"./LinkBroken01-ChSpe7Cq.js";import"./ShoppingBag01-DktiI11o.js";import"./ZoomOut-BlDSjKri.js";import"./Building02-BVSXudo-.js";import"./CheckCircle-BemNEpVg.js";import"./Check-Cf-cMW3t.js";import"./ChevronUp-B79uJeZN.js";import"./UserSquare-DZJwwd71.js";import"./Copy01-DluK-JtU.js";import"./CreditCard01-BzBUMTax.js";import"./Image01-DnRAAkhy.js";import"./Palette-CaKXG6S_.js";import"./XClose-BqRoe3QG.js";import"./Key01-DXvy1NNO.js";import"./Link01-iwXPIeVc.js";import"./LinkExternal01-BVDnNs6j.js";import"./Monitor01-BLZH5esy.js";import"./Sun-BWosC3Su.js";import"./SearchMd-oXON6Mge.js";import"./Upload01-CNtxqXvb.js";import"./User01-DXNh3TnB.js";import"./Users01-DAfCqIN7.js";import"./X-C52mq3mn.js";import"./differenceInSeconds-C3x8sHUj.js";import"./schema-CepQKFSq.js";import"./task-board-Cg5OuTdd.js";import"./auth-DDdLUET9.js";import"./mcp-oauth-C-EEuNZg.js";import"./metadata-D72DunRR.js";import"./connection-Da57b2wi.js";import"./tooltip-rVl8jzih.js";import"./index-BGzd8qMa.js";import"./input-B5d33h6X.js";import"./label-BmSaj4OS.js";import"./useInfiniteQuery-BAMBgsXo.js";import"./infiniteQueryObserver-B7-m24Hr.js";import"./avatar-BeFEVdWT.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";function It(t){const e=ue.c(26),{onCreateFromScratch:s,onImportGitHub:r,onImportDeco:n,isCreating:u,align:p,side:C,showBetaBadge:m,showDecoImport:D}=t,w=p===void 0?"end":p,g=pe();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(Ae,{size:14}),e[0]=f):f=e[0];let h;e[1]!==g?(h=g("common.createAgentDropdown.createFromScratch"),e[1]=g,e[2]=h):h=e[2];let x;e[3]!==u||e[4]!==s||e[5]!==h?(x=o.jsxs(ae,{disabled:u,onClick:s,children:[f,h]}),e[3]=u,e[4]=s,e[5]=h,e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ie,{className:"size-3.5"}),e[7]=b):b=e[7];let l;e[8]!==g?(l=g("common.createAgentDropdown.importFromGitHub"),e[8]=g,e[9]=l):l=e[9];let a;e[10]!==m?(a=m&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=m,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==l||e[14]!==a?(c=o.jsxs(ae,{onClick:r,children:[b,l,a]}),e[12]=r,e[13]=l,e[14]=a,e[15]=c):c=e[15];let d;e[16]!==n||e[17]!==D||e[18]!==g?(d=D&&o.jsxs(ae,{onClick:n,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),g("common.createAgentDropdown.importFromDeco")]}),e[16]=n,e[17]=D,e[18]=g,e[19]=d):d=e[19];let j;return e[20]!==w||e[21]!==C||e[22]!==x||e[23]!==c||e[24]!==d?(j=o.jsxs(Ce,{side:C,align:w,className:"w-48",children:[x,c,d]}),e[20]=w,e[21]=C,e[22]=x,e[23]=c,e[24]=d,e[25]=j):j=e[25],j}function Tt(t){const e=ue.c(51),{project:s,lastUsedAt:r,onDeleteClick:n}=t,u=Se(),p=Te(),C=pe(),m=Ke();let D;e[0]!==s.metadata?.ui?.layout||e[1]!==p?(D=p?void 0:Le(s.metadata?.ui?.layout),e[0]=s.metadata?.ui?.layout,e[1]=p,e[2]=D):D=e[2];const w=D;let g;e[3]!==w||e[4]!==u||e[5]!==s.id?(g=()=>u(s.id,{panel:w}),e[3]=w,e[4]=u,e[5]=s.id,e[6]=g):g=e[6];let f;e[7]!==s.title||e[8]!==g?(f=o.jsx("button",{type:"button",onClick:g,className:"absolute inset-0 z-0","aria-label":s.title}),e[7]=s.title,e[8]=g,e[9]=f):f=e[9];let h;e[10]!==s.icon||e[11]!==s.title?(h=o.jsx(Be,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[10]=s.icon,e[11]=s.title,e[12]=h):h=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(be,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx($e,{size:20})})}),e[13]=x):x=e[13];let b;e[14]!==u||e[15]!==s.id?(b=()=>u(s.id,{panel:"settings"}),e[14]=u,e[15]=s.id,e[16]=b):b=e[16];let l;e[17]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ve,{size:16}),e[17]=l):l=e[17];let a;e[18]!==b?(a=o.jsxs(ae,{onClick:b,children:[l,"Settings"]}),e[18]=b,e[19]=a):a=e[19];let c;e[20]!==n?(c=n&&o.jsxs(ae,{variant:"destructive",onClick:i=>{i.stopPropagation(),n(i)},children:[o.jsx(He,{size:16}),"Delete"]}),e[20]=n,e[21]=c):c=e[21];let d;e[22]!==a||e[23]!==c?(d=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(De,{children:[x,o.jsxs(Ce,{align:"end",children:[a,c]})]})}),e[22]=a,e[23]=c,e[24]=d):d=e[24];let j;e[25]!==d||e[26]!==h?(j=o.jsxs("div",{className:"flex items-start justify-between",children:[h,d]}),e[25]=d,e[26]=h,e[27]=j):j=e[27];let y;e[28]!==s.title?(y=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),e[28]=s.title,e[29]=y):y=e[29];const B=s.description||"No description";let v;e[30]!==B?(v=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:B}),e[30]=B,e[31]=v):v=e[31];let P;e[32]!==y||e[33]!==v?(P=o.jsxs("div",{className:"flex flex-col gap-1",children:[y,v]}),e[32]=y,e[33]=v,e[34]=P):P=e[34];let S;e[35]!==j||e[36]!==P?(S=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,P]}),e[35]=j,e[36]=P,e[37]=S):S=e[37];let A;e[38]!==r||e[39]!==m||e[40]!==s.updated_at||e[41]!==C?(A=r?C("home.projectCard.lastUsed",{time:xe(new Date(r),{addSuffix:!0,locale:m})}):C("home.projectCard.updated",{time:xe(new Date(s.updated_at),{addSuffix:!0,locale:m})}),e[38]=r,e[39]=m,e[40]=s.updated_at,e[41]=C,e[42]=A):A=e[42];let I;e[43]!==A?(I=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:A})})}),e[43]=A,e[44]=I):I=e[44];let G;e[45]!==S||e[46]!==I?(G=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[S,I]}),e[45]=S,e[46]=I,e[47]=G):G=e[47];let E;return e[48]!==G||e[49]!==f?(E=o.jsxs(Fe,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[f,G]}),e[48]=G,e[49]=f,e[50]=E):E=e[50],E}function Lt(t,e){const s=ue.c(10),{org:r}=ge(),n=ke();let u;s[0]!==t||s[1]!==r.id?(u=fe.registryApp(r.id,t),s[0]=t,s[1]=r.id,s[2]=u):u=s[2];let p;s[3]!==t||s[4]!==n?(p=()=>n.call("COLLECTION_REGISTRY_APP_GET",{name:t}),s[3]=t,s[4]=n,s[5]=p):p=s[5];const C=e?.enabled??!0;let m;return s[6]!==u||s[7]!==p||s[8]!==C?(m={queryKey:u,queryFn:p,select:Ft,enabled:C,staleTime:3e5},s[6]=u,s[7]=p,s[8]=C,s[9]=m):m=s[9],ye(m)}function Ft(t){return t.item}const kt="deco/github-mcp";function Et(t){const{org:e}=ge(),{data:s}=we.useSession(),r=Xe(),n=ve(),[u,p]=z.useState("idle"),[C,m]=z.useState(null),[D,w]=z.useState(null),{data:g,isLoading:f}=Lt(kt,{enabled:t.enabled}),h=z.useRef(!1);t.enabled&&g&&!f&&!h.current&&s?.user?.id&&u==="idle"&&(h.current=!0,x());async function x(){if(!(!g||!s?.user?.id||!e))try{p("installing"),m(null);const l=et(g,e.id,s.user.id,{remoteIndex:0});if(!l.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:c}=await r.create.mutateAsync(l);p("authenticating");const d=await Ze({connectionId:c,orgId:e.id,orgSlug:e.slug,persistFallback:j=>r.update.mutateAsync({id:c,data:{connection_token:j}}).then(()=>{})});if(d.ran&&!d.ok){try{await r.delete.mutateAsync(c)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}Ee(n,e.id),w(l),p("ready")}catch(l){m(l instanceof Error?l.message:String(l)),p("error")}}function b(){p("idle"),m(null),w(null),h.current=!1}return t.enabled&&f&&u==="idle"?{status:"installing",error:null,connection:null,retry:b}:{status:u,error:C,connection:D,retry:b}}function Pt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const r=await fetch(t,e),n=await r.json().catch(()=>({}));if(!r.ok)throw new Error(n.error??`${s} (${r.status})`);return n}function Gt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Ot({open:t,onOpenChange:e,onBack:s}){const r=pe(),{org:n}=ge(),u=Se(),p=ve(),{data:C}=we.useSession(),[m,D]=z.useState(null),[w,g]=z.useState(null),[f,h]=z.useState(""),x=je({connectionId:Pe,orgId:n.id,orgSlug:n.slug}),b=We({slug:"mcp-github"}),l=rt(b),a=Et({enabled:t&&l.length===0}),c=l.length===1?l[0]??null:w,d=l.length>1&&!c,j=je({connectionId:c?.id??"",orgId:n.id,orgSlug:n.slug}),y=t&&l.length===0&&(a.status==="installing"||a.status==="authenticating"||a.status==="idle"),{data:B,isLoading:v,error:P}=ye({queryKey:fe.decoSites(C?.user?.email),queryFn:()=>Gt(n.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=B?.sites??[],A=i=>{i||(D(null),g(null),h("")),e(i)},I=S.filter(i=>i.name.toLowerCase().includes(f.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(f.toLowerCase())??!1)),G=!m||I.some(i=>i.name===m),E=Ge({mutationFn:async i=>{if(!c)throw new Error(r("common.importFromDecoDialog.githubNotConnected"));Q("deco_site_import_started",{site_name:i});const{installations:N}=await nt(k=>x.callTool(k),c.id),T=S.find(k=>k.name===i);if(!T)throw new Error(r("common.importFromDecoDialog.siteNoLongerAvailable"));const L=tt(i,T.metadata),F=lt(N,L.owner);if(!F)throw new Error(r("common.importFromDecoDialog.installGithubApp",{owner:L.owner,installUrl:at}));let M=null,q=null;const le=async()=>{q&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:q}}).catch(()=>{}),M&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}}).catch(()=>{})};try{const k=await Ne(`/api/${n.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},r("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:U,reused:H}=await ct({orgSlug:n.slug,sourceConnection:c,installationId:F.installationId,owner:L.owner,repo:L.name,githubCallTool:K=>j.callTool(K),selfCallTool:K=>x.callTool(K)});M=H?null:U;const R=k.icon??null,Y=Pt(i),J=i.toLowerCase(),$=st(i),V=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:R??null,metadata:{instructions:null,siteSlug:J,previewServerUrl:$,productionUrl:$,repository:{owner:L.owner,name:L.name,url:L.url,installationId:F.installationId,connectionId:U},ui:{banner:null,bannerColor:"#22C55E",icon:R,themeColor:"#22C55E",slug:Y,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:U}]}}}),O=V.structuredContent??V;if(!O.item?.id)throw new Error(r("common.importFromDecoDialog.failedToCreateAgent"));return q=O.item.id,{slug:Y,virtualMcpId:O.item.id,item:O.item}}catch(k){throw await le(),k}},onSuccess:({slug:i,virtualMcpId:N,item:T})=>{Q("deco_site_import_succeeded",{site_name:T.title,virtual_mcp_id:N,slug:i}),p.setQueryData(fe.collectionItem(x,n.id,"","VIRTUAL_MCP",N),{item:T}),p.invalidateQueries({predicate:L=>{const F=L.queryKey;return F[1]===n.id&&F[3]==="collection"&&F[4]==="VIRTUAL_MCP"}}),he.success(r("common.importFromDecoDialog.importSuccess",{slug:i})),A(!1),u(N)},onError:i=>{Q("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),he.error(r("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:r("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(mt,{open:t,onOpenChange:A,children:o.jsxs(dt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ut,{className:"sr-only",children:o.jsx(pt,{children:r("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":r("common.goBack"),children:o.jsx(ft,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:r("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ht,{value:f,onChange:h,placeholder:r("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&h("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[a.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:a.error??r("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ce,{variant:"outline",size:"sm",onClick:a.retry,children:r("common.importFromDecoDialog.retryGithubSetup")})]}),y&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.settingUpGithub")}),d&&!y&&a.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.importFromDecoDialog.selectGithubConnection")})}),l.map(i=>o.jsxs("button",{type:"button",onClick:()=>g(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(ot,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),v&&!y&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.loadingSites")}),!v&&!y&&!d&&a.status!=="error"&&!P&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.noSitesFound")}),!v&&!y&&!d&&a.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:[I.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:r("common.importFromDecoDialog.noSitesMatch",{search:f})}),I.map(i=>{const N=it(i.domains),T=m===i.name;return o.jsxs("button",{type:"button",onClick:()=>D(i.name),className:Oe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",T?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),N&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:N})]})]},i.name)})]})]}),o.jsxs(gt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ce,{variant:"outline",onClick:()=>A(!1),disabled:E.isPending,children:r("common.importFromDecoDialog.cancel")}),o.jsx(ce,{disabled:!m||!G||E.isPending||v||y||d||!c||a.status==="error",onClick:()=>m&&E.mutate(m),children:E.isPending?r("common.importFromDecoDialog.importing"):r("common.importFromDecoDialog.import")})]})]})})}function es(){const t=ue.c(80),e=pe(),{org:s}=ge(),[r,n]=z.useState(""),u=At(r,300);let p;t[0]!==u?(p={searchTerm:u},t[0]=u,t[1]=p):p=t[1];const C=Me(p),m=Ue();let D;t[2]===Symbol.for("react.memo_cache_sentinel")?(D={navigateOnCreate:!0},t[2]=D):D=t[2];const{createVirtualMCP:w,isCreating:g}=Je(D),[f,h]=z.useState(null),[x,b]=z.useState(!1),[l,a]=z.useState(!1),{granted:c}=ze("agents:manage"),d=Qe();let j;t[3]!==s?(j=_=>_.id!==s.id,t[3]=s,t[4]=j):j=t[4];const y=C.filter(j),{data:B}=Re(y.map(zt));let v;t[5]!==m||t[6]!==f||t[7]!==e?(v=async()=>{if(!f)return;const{id:_,title:_e}=f;h(null);try{await m.delete.mutateAsync(_),Q("agent_deleted",{agent_id:_,source:"agents_list"}),he.success(e("routes.agentsList.deletedAgent",{title:_e}))}catch{}},t[5]=m,t[6]=f,t[7]=e,t[8]=v):v=t[8];const P=v;let S;t[9]!==c||t[10]!==w||t[11]!==g||t[12]!==d||t[13]!==e?(S=c&&o.jsxs(De,{children:[o.jsx(be,{asChild:!0,children:o.jsxs(ce,{size:"sm",children:[o.jsx(Nt,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(It,{onCreateFromScratch:()=>{Q("agent_create_clicked",{source:"agents_list",method:"scratch"}),w()},onImportGitHub:()=>{Q("agent_create_clicked",{source:"agents_list",method:"github"}),a(!0)},onImportDeco:()=>{Q("agent_create_clicked",{source:"agents_list",method:"deco"}),b(!0)},isCreating:g,align:"end",showDecoImport:d})]}),t[9]=c,t[10]=w,t[11]=g,t[12]=d,t[13]=e,t[14]=S):S=t[14];const A=S,I=de,G=de,E=de;let i;t[15]!==e?(i=e("routes.agentsList.title"),t[15]=e,t[16]=i):i=t[16];let N;t[17]!==A||t[18]!==i?(N=o.jsx(de.Title,{actions:A,children:i}),t[17]=A,t[18]=i,t[19]=N):N=t[19];let T;t[20]!==e?(T=e("routes.agentsList.searchPlaceholder"),t[20]=e,t[21]=T):T=t[21];let L;t[22]===Symbol.for("react.memo_cache_sentinel")?(L=_=>{_.key==="Escape"&&(n(""),_.target.blur())},t[22]=L):L=t[22];let F;t[23]!==r||t[24]!==T?(F=o.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:o.jsx(St,{value:r,onChange:n,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:L})}),t[23]=r,t[24]=T,t[25]=F):F=t[25];let M;t[26]!==F||t[27]!==N?(M=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,F]}),t[26]=F,t[27]=N,t[28]=M):M=t[28];const q=y.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{actions:!1,image:o.jsx(qe,{size:48,className:"text-muted-foreground"}),title:e(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?e("routes.agentsList.noAgentsMatchSearch",{search:r}):e(c?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate")})}),le=y.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:y.map(_=>o.jsx(Tt,{project:_,lastUsedAt:B?.get(_.id)?.last_used_at,onDeleteClick:c?()=>h({id:_.id,title:_.title}):void 0},_.id))})]});let k;t[29]!==M||t[30]!==q||t[31]!==le||t[32]!==E.Container?(k=o.jsxs(E.Container,{children:[M,q,le]}),t[29]=M,t[30]=q,t[31]=le,t[32]=E.Container,t[33]=k):k=t[33];let U;t[34]!==k||t[35]!==G.Content?(U=o.jsx(G.Content,{children:k}),t[34]=k,t[35]=G.Content,t[36]=U):U=t[36];let H;t[37]!==l?(H=o.jsx(_t,{open:l,onOpenChange:a}),t[37]=l,t[38]=H):H=t[38];let R;t[39]!==x?(R=o.jsx(Ot,{open:x,onOpenChange:b}),t[39]=x,t[40]=R):R=t[40];const Y=!!f;let J;t[41]===Symbol.for("react.memo_cache_sentinel")?(J=_=>!_&&h(null),t[41]=J):J=t[41];let $;t[42]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[42]=e,t[43]=$):$=t[43];let V;t[44]!==$?(V=o.jsx(xt,{children:$}),t[44]=$,t[45]=V):V=t[45];let O;t[46]!==e?(O=e("routes.agentsList.deleteAgentDescription"),t[46]=e,t[47]=O):O=t[47];const K=f?.title;let X;t[48]!==K?(X=o.jsx("span",{className:"font-medium text-foreground",children:K}),t[48]=K,t[49]=X):X=t[49];let W;t[50]!==O||t[51]!==X?(W=o.jsxs(jt,{children:[O," ",X,"."]}),t[50]=O,t[51]=X,t[52]=W):W=t[52];let Z;t[53]!==V||t[54]!==W?(Z=o.jsxs(Ct,{children:[V,W]}),t[53]=V,t[54]=W,t[55]=Z):Z=t[55];let ee;t[56]!==e?(ee=e("routes.agentsList.cancelButton"),t[56]=e,t[57]=ee):ee=t[57];let te;t[58]!==ee?(te=o.jsx(bt,{children:ee}),t[58]=ee,t[59]=te):te=t[59];let oe;t[60]!==e?(oe=e("routes.agentsList.deleteButton"),t[60]=e,t[61]=oe):oe=t[61];let se;t[62]!==P||t[63]!==oe?(se=o.jsx(Dt,{onClick:P,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:oe}),t[62]=P,t[63]=oe,t[64]=se):se=t[64];let ie;t[65]!==te||t[66]!==se?(ie=o.jsxs(yt,{children:[te,se]}),t[65]=te,t[66]=se,t[67]=ie):ie=t[67];let re;t[68]!==Z||t[69]!==ie?(re=o.jsxs(wt,{children:[Z,ie]}),t[68]=Z,t[69]=ie,t[70]=re):re=t[70];let ne;t[71]!==Y||t[72]!==re?(ne=o.jsx(vt,{open:Y,onOpenChange:J,children:re}),t[71]=Y,t[72]=re,t[73]=ne):ne=t[73];let me;return t[74]!==I||t[75]!==U||t[76]!==H||t[77]!==R||t[78]!==ne?(me=o.jsxs(I,{children:[U,H,R,ne]}),t[74]=I,t[75]=U,t[76]=H,t[77]=R,t[78]=ne,t[79]=me):me=t[79],me}function zt(t){return t.id}export{es as default};
|
|
1
|
+
import{c as ue,b as pe,j as o,G as ae,p as Ae,ao as Ie,H as Ce,Y as Te,ae as Le,F as be,B as ce,I as De,e_ as Fe,X as ge,a2 as ke,K as fe,m as ye,a as we,o as ve,r as z,d3 as Ee,z as Pe,e as Ge,q as Q,t as he,l as Oe,ad as ze,n as de}from"./index-DOUQg0zs.js";import{b as Me,f as Ue,k as Re}from"./repository-binding-DosYHiTz.js";import{i as $e}from"./DotsVertical-C8Ab5pHT.js";import{a as Ve}from"./Tool01-wjHS3MbM.js";import{s as He}from"./Trash01-BIa5uuJe.js";import{A as Be,bz as qe}from"./agent-icon-Cj_JL7Bp.js";import{u as Ke,f as xe}from"./use-date-fns-locale-C1PKxs7V.js";import{u as Se}from"./use-navigate-to-agent-BE5yz9rb.js";import{m as Qe}from"./use-organization-settings-BIE-soL2.js";import{E as Ye}from"./empty-state-DqT8bOq1.js";import{u as Je}from"./use-create-virtual-mcp-o8cPA6QL.js";import{b as Xe,u as We}from"./use-connection-XeQWn4zm.js";import{u as je}from"./use-mcp-client-DxHrE3Rr.js";import{a as Ze}from"./authenticate-and-persist-oauth-CorzXjLa.js";import{e as et}from"./extract-connection-data-BX994cXq.js";import{i as tt,G as ot}from"./repository-picker-BFG56pB0.js";import{h as st,C as it}from"./thread-intent-DC7irtdr.js";import{a as rt}from"./github-repo-scope-ByTYKy_L.js";import{f as nt,a as lt,G as at,p as ct}from"./provision-repo-scoped-github-connection-lckxpDHD.js";import{D as mt,b as dt,c as ut,d as pt,e as gt}from"./dialog-C-xWJ6aR.js";import{i as ft}from"./ArrowLeft-BheW9nUA.js";import{C as ht}from"./collection-search-FGpxBvyM.js";import{A as xt,a as jt,b as Ct,c as bt,g as Dt,d as yt,e as wt,f as vt}from"./alert-dialog-C8wYJe4o.js";import{S as St}from"./search-input-BdccUqIq.js";import{s as Nt}from"./Plus-DhmMzSv0.js";import{R as _t}from"./repository-import-picker-CMKxpeps.js";import{u as At}from"./use-debounced-value-BTFdSSe8.js";import"./AlertCircle-Bt4fa9oZ.js";import"./ArrowUp-BDvnBzdl.js";import"./LinkBroken01-Dao_xEQ2.js";import"./ShoppingBag01-lkT9atzh.js";import"./ZoomOut-uHj4ZFa9.js";import"./Building02-CrNedMIl.js";import"./CheckCircle-DYG4Bhna.js";import"./Check-CBF8eTgr.js";import"./ChevronUp-MXpj0fOa.js";import"./UserSquare-DlqsIDkY.js";import"./Copy01-DIV9jah9.js";import"./CreditCard01-J7tCMEH-.js";import"./Image01-BWtlQPQv.js";import"./Palette-Dzi-BJNB.js";import"./XClose-D0tJKCTL.js";import"./Key01-1FHVDeLv.js";import"./Link01-LJd6RIv6.js";import"./LinkExternal01-CE1iCUGk.js";import"./Monitor01-CF2sOSMh.js";import"./Sun-D4-5PMzV.js";import"./SearchMd-wnWyoFfY.js";import"./Upload01-BRb6jPtu.js";import"./User01-C-57a8l-.js";import"./Users01-DjN8O7F9.js";import"./X-8qFfssY9.js";import"./differenceInSeconds-C3x8sHUj.js";import"./schema-DpPC83dn.js";import"./task-board-DXXLrHdX.js";import"./auth-Brm-gMyA.js";import"./mcp-oauth-BH-DbyuT.js";import"./metadata-D72DunRR.js";import"./connection-CgrAKzVV.js";import"./tooltip-C72eCv1P.js";import"./index-CbcEBCnU.js";import"./input-D50iAX6q.js";import"./label-BUdIq7o0.js";import"./useInfiniteQuery-DjkTQ_ZO.js";import"./infiniteQueryObserver-BswUx1p7.js";import"./avatar-Dv4UhAF7.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";function It(t){const e=ue.c(26),{onCreateFromScratch:s,onImportGitHub:r,onImportDeco:n,isCreating:u,align:p,side:C,showBetaBadge:m,showDecoImport:D}=t,w=p===void 0?"end":p,g=pe();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=o.jsx(Ae,{size:14}),e[0]=f):f=e[0];let h;e[1]!==g?(h=g("common.createAgentDropdown.createFromScratch"),e[1]=g,e[2]=h):h=e[2];let x;e[3]!==u||e[4]!==s||e[5]!==h?(x=o.jsxs(ae,{disabled:u,onClick:s,children:[f,h]}),e[3]=u,e[4]=s,e[5]=h,e[6]=x):x=e[6];let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b=o.jsx(Ie,{className:"size-3.5"}),e[7]=b):b=e[7];let l;e[8]!==g?(l=g("common.createAgentDropdown.importFromGitHub"),e[8]=g,e[9]=l):l=e[9];let a;e[10]!==m?(a=m&&o.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[10]=m,e[11]=a):a=e[11];let c;e[12]!==r||e[13]!==l||e[14]!==a?(c=o.jsxs(ae,{onClick:r,children:[b,l,a]}),e[12]=r,e[13]=l,e[14]=a,e[15]=c):c=e[15];let d;e[16]!==n||e[17]!==D||e[18]!==g?(d=D&&o.jsxs(ae,{onClick:n,children:[o.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),g("common.createAgentDropdown.importFromDeco")]}),e[16]=n,e[17]=D,e[18]=g,e[19]=d):d=e[19];let j;return e[20]!==w||e[21]!==C||e[22]!==x||e[23]!==c||e[24]!==d?(j=o.jsxs(Ce,{side:C,align:w,className:"w-48",children:[x,c,d]}),e[20]=w,e[21]=C,e[22]=x,e[23]=c,e[24]=d,e[25]=j):j=e[25],j}function Tt(t){const e=ue.c(51),{project:s,lastUsedAt:r,onDeleteClick:n}=t,u=Se(),p=Te(),C=pe(),m=Ke();let D;e[0]!==s.metadata?.ui?.layout||e[1]!==p?(D=p?void 0:Le(s.metadata?.ui?.layout),e[0]=s.metadata?.ui?.layout,e[1]=p,e[2]=D):D=e[2];const w=D;let g;e[3]!==w||e[4]!==u||e[5]!==s.id?(g=()=>u(s.id,{panel:w}),e[3]=w,e[4]=u,e[5]=s.id,e[6]=g):g=e[6];let f;e[7]!==s.title||e[8]!==g?(f=o.jsx("button",{type:"button",onClick:g,className:"absolute inset-0 z-0","aria-label":s.title}),e[7]=s.title,e[8]=g,e[9]=f):f=e[9];let h;e[10]!==s.icon||e[11]!==s.title?(h=o.jsx(Be,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm"}),e[10]=s.icon,e[11]=s.title,e[12]=h):h=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=o.jsx(be,{asChild:!0,children:o.jsx(ce,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:o.jsx($e,{size:20})})}),e[13]=x):x=e[13];let b;e[14]!==u||e[15]!==s.id?(b=()=>u(s.id,{panel:"settings"}),e[14]=u,e[15]=s.id,e[16]=b):b=e[16];let l;e[17]===Symbol.for("react.memo_cache_sentinel")?(l=o.jsx(Ve,{size:16}),e[17]=l):l=e[17];let a;e[18]!==b?(a=o.jsxs(ae,{onClick:b,children:[l,"Settings"]}),e[18]=b,e[19]=a):a=e[19];let c;e[20]!==n?(c=n&&o.jsxs(ae,{variant:"destructive",onClick:i=>{i.stopPropagation(),n(i)},children:[o.jsx(He,{size:16}),"Delete"]}),e[20]=n,e[21]=c):c=e[21];let d;e[22]!==a||e[23]!==c?(d=o.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:o.jsxs(De,{children:[x,o.jsxs(Ce,{align:"end",children:[a,c]})]})}),e[22]=a,e[23]=c,e[24]=d):d=e[24];let j;e[25]!==d||e[26]!==h?(j=o.jsxs("div",{className:"flex items-start justify-between",children:[h,d]}),e[25]=d,e[26]=h,e[27]=j):j=e[27];let y;e[28]!==s.title?(y=o.jsx("div",{className:"flex items-center gap-2 min-w-0",children:o.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:s.title})}),e[28]=s.title,e[29]=y):y=e[29];const B=s.description||"No description";let v;e[30]!==B?(v=o.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:B}),e[30]=B,e[31]=v):v=e[31];let P;e[32]!==y||e[33]!==v?(P=o.jsxs("div",{className:"flex flex-col gap-1",children:[y,v]}),e[32]=y,e[33]=v,e[34]=P):P=e[34];let S;e[35]!==j||e[36]!==P?(S=o.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[j,P]}),e[35]=j,e[36]=P,e[37]=S):S=e[37];let A;e[38]!==r||e[39]!==m||e[40]!==s.updated_at||e[41]!==C?(A=r?C("home.projectCard.lastUsed",{time:xe(new Date(r),{addSuffix:!0,locale:m})}):C("home.projectCard.updated",{time:xe(new Date(s.updated_at),{addSuffix:!0,locale:m})}),e[38]=r,e[39]=m,e[40]=s.updated_at,e[41]=C,e[42]=A):A=e[42];let I;e[43]!==A?(I=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:A})})}),e[43]=A,e[44]=I):I=e[44];let G;e[45]!==S||e[46]!==I?(G=o.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[S,I]}),e[45]=S,e[46]=I,e[47]=G):G=e[47];let E;return e[48]!==G||e[49]!==f?(E=o.jsxs(Fe,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[f,G]}),e[48]=G,e[49]=f,e[50]=E):E=e[50],E}function Lt(t,e){const s=ue.c(10),{org:r}=ge(),n=ke();let u;s[0]!==t||s[1]!==r.id?(u=fe.registryApp(r.id,t),s[0]=t,s[1]=r.id,s[2]=u):u=s[2];let p;s[3]!==t||s[4]!==n?(p=()=>n.call("COLLECTION_REGISTRY_APP_GET",{name:t}),s[3]=t,s[4]=n,s[5]=p):p=s[5];const C=e?.enabled??!0;let m;return s[6]!==u||s[7]!==p||s[8]!==C?(m={queryKey:u,queryFn:p,select:Ft,enabled:C,staleTime:3e5},s[6]=u,s[7]=p,s[8]=C,s[9]=m):m=s[9],ye(m)}function Ft(t){return t.item}const kt="deco/github-mcp";function Et(t){const{org:e}=ge(),{data:s}=we.useSession(),r=Xe(),n=ve(),[u,p]=z.useState("idle"),[C,m]=z.useState(null),[D,w]=z.useState(null),{data:g,isLoading:f}=Lt(kt,{enabled:t.enabled}),h=z.useRef(!1);t.enabled&&g&&!f&&!h.current&&s?.user?.id&&u==="idle"&&(h.current=!0,x());async function x(){if(!(!g||!s?.user?.id||!e))try{p("installing"),m(null);const l=et(g,e.id,s.user.id,{remoteIndex:0});if(!l.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:c}=await r.create.mutateAsync(l);p("authenticating");const d=await Ze({connectionId:c,orgId:e.id,orgSlug:e.slug,persistFallback:j=>r.update.mutateAsync({id:c,data:{connection_token:j}}).then(()=>{})});if(d.ran&&!d.ok){try{await r.delete.mutateAsync(c)}catch{}throw new Error(d.error&&d.error!=="no token received"?d.error:"No token received from GitHub")}Ee(n,e.id),w(l),p("ready")}catch(l){m(l instanceof Error?l.message:String(l)),p("error")}}function b(){p("idle"),m(null),w(null),h.current=!1}return t.enabled&&f&&u==="idle"?{status:"installing",error:null,connection:null,retry:b}:{status:u,error:C,connection:D,retry:b}}function Pt(t){return t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Ne(t,e,s){const r=await fetch(t,e),n=await r.json().catch(()=>({}));if(!r.ok)throw new Error(n.error??`${s} (${r.status})`);return n}function Gt(t){return Ne(`/api/${t}/deco-sites`,void 0,"Failed to load sites")}function Ot({open:t,onOpenChange:e,onBack:s}){const r=pe(),{org:n}=ge(),u=Se(),p=ve(),{data:C}=we.useSession(),[m,D]=z.useState(null),[w,g]=z.useState(null),[f,h]=z.useState(""),x=je({connectionId:Pe,orgId:n.id,orgSlug:n.slug}),b=We({slug:"mcp-github"}),l=rt(b),a=Et({enabled:t&&l.length===0}),c=l.length===1?l[0]??null:w,d=l.length>1&&!c,j=je({connectionId:c?.id??"",orgId:n.id,orgSlug:n.slug}),y=t&&l.length===0&&(a.status==="installing"||a.status==="authenticating"||a.status==="idle"),{data:B,isLoading:v,error:P}=ye({queryKey:fe.decoSites(C?.user?.email),queryFn:()=>Gt(n.slug),enabled:t&&!!C?.user?.email,staleTime:6e4,retry:!1}),S=B?.sites??[],A=i=>{i||(D(null),g(null),h("")),e(i)},I=S.filter(i=>i.name.toLowerCase().includes(f.toLowerCase())||(i.domains?.[0]?.domain?.toLowerCase().includes(f.toLowerCase())??!1)),G=!m||I.some(i=>i.name===m),E=Ge({mutationFn:async i=>{if(!c)throw new Error(r("common.importFromDecoDialog.githubNotConnected"));Q("deco_site_import_started",{site_name:i});const{installations:N}=await nt(k=>x.callTool(k),c.id),T=S.find(k=>k.name===i);if(!T)throw new Error(r("common.importFromDecoDialog.siteNoLongerAvailable"));const L=tt(i,T.metadata),F=lt(N,L.owner);if(!F)throw new Error(r("common.importFromDecoDialog.installGithubApp",{owner:L.owner,installUrl:at}));let M=null,q=null;const le=async()=>{q&&await x.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:q}}).catch(()=>{}),M&&await x.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:M,force:!0}}).catch(()=>{})};try{const k=await Ne(`/api/${n.slug}/deco-sites/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteName:i})},r("common.importFromDecoDialog.failedToPrepareImport")),{childConnectionId:U,reused:H}=await ct({orgSlug:n.slug,sourceConnection:c,installationId:F.installationId,owner:L.owner,repo:L.name,githubCallTool:K=>j.callTool(K),selfCallTool:K=>x.callTool(K)});M=H?null:U;const R=k.icon??null,Y=Pt(i),J=i.toLowerCase(),$=st(i),V=await x.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:i,description:"Imported from deco.cx",pinned:!1,icon:R??null,metadata:{instructions:null,siteSlug:J,previewServerUrl:$,productionUrl:$,repository:{owner:L.owner,name:L.name,url:L.url,installationId:F.installationId,connectionId:U},ui:{banner:null,bannerColor:"#22C55E",icon:R,themeColor:"#22C55E",slug:Y,pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!1}}},connections:[{connection_id:U}]}}}),O=V.structuredContent??V;if(!O.item?.id)throw new Error(r("common.importFromDecoDialog.failedToCreateAgent"));return q=O.item.id,{slug:Y,virtualMcpId:O.item.id,item:O.item}}catch(k){throw await le(),k}},onSuccess:({slug:i,virtualMcpId:N,item:T})=>{Q("deco_site_import_succeeded",{site_name:T.title,virtual_mcp_id:N,slug:i}),p.setQueryData(fe.collectionItem(x,n.id,"","VIRTUAL_MCP",N),{item:T}),p.invalidateQueries({predicate:L=>{const F=L.queryKey;return F[1]===n.id&&F[3]==="collection"&&F[4]==="VIRTUAL_MCP"}}),he.success(r("common.importFromDecoDialog.importSuccess",{slug:i})),A(!1),u(N)},onError:i=>{Q("deco_site_import_failed",{error:i instanceof Error?i.message:"Unknown error"}),he.error(r("common.importFromDecoDialog.importFailed",{error:(i instanceof Error?i.message:r("common.importFromDecoDialog.unknownError"))??""}))}});return o.jsx(mt,{open:t,onOpenChange:A,children:o.jsxs(dt,{className:"sm:max-w-[900px] p-0 gap-0 overflow-hidden",children:[o.jsx(ut,{className:"sr-only",children:o.jsx(pt,{children:r("common.importFromDecoDialog.title")})}),o.jsxs("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3",children:[s&&o.jsx("button",{type:"button",onClick:s,className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors","aria-label":r("common.goBack"),children:o.jsx(ft,{size:18})}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:r("common.importFromDecoDialog.title")})]}),o.jsx("div",{children:o.jsx(ht,{value:f,onChange:h,placeholder:r("common.importFromDecoDialog.searchPlaceholder"),onKeyDown:i=>{i.key==="Escape"&&h("")}})}),o.jsxs("div",{className:"pb-0 min-h-[300px]",children:[a.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:a.error??r("common.importFromDecoDialog.failedToConnectGithub")}),o.jsx(ce,{variant:"outline",size:"sm",onClick:a.retry,children:r("common.importFromDecoDialog.retryGithubSetup")})]}),y&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.settingUpGithub")}),d&&!y&&a.status!=="error"&&o.jsxs("div",{className:"flex flex-col py-2",children:[o.jsx("div",{className:"px-8 py-2",children:o.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:r("common.importFromDecoDialog.selectGithubConnection")})}),l.map(i=>o.jsxs("button",{type:"button",onClick:()=>g(i),className:"flex items-center gap-3 px-8 py-3 hover:bg-accent transition-colors text-left",children:[i.icon?o.jsx("img",{src:i.icon,alt:i.title,className:"size-7 rounded-full shrink-0"}):o.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:o.jsx(ot,{className:"size-3.5 text-muted-foreground"})}),o.jsx("span",{className:"text-sm font-medium",children:i.title})]},i.id))]}),v&&!y&&a.status!=="error"&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.loadingSites")}),!v&&!y&&!d&&a.status!=="error"&&!P&&S.length===0&&o.jsx("div",{className:"flex items-center justify-center h-48 text-sm text-muted-foreground",children:r("common.importFromDecoDialog.noSitesFound")}),!v&&!y&&!d&&a.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:[I.length===0&&o.jsx("p",{className:"col-span-3 text-sm text-muted-foreground text-center py-8",children:r("common.importFromDecoDialog.noSitesMatch",{search:f})}),I.map(i=>{const N=it(i.domains),T=m===i.name;return o.jsxs("button",{type:"button",onClick:()=>D(i.name),className:Oe("flex flex-col rounded-xl border overflow-hidden text-left transition-all cursor-pointer",T?"border-primary ring-1 ring-primary":"border-border hover:border-muted-foreground/40"),children:[o.jsx("div",{className:"w-full aspect-video bg-muted overflow-hidden",children:i.thumb_url?o.jsx("img",{src:i.thumb_url,alt:i.name,className:"w-full h-full object-cover",loading:"lazy"}):o.jsx("div",{className:"w-full h-full bg-muted"})}),o.jsxs("div",{className:"px-4 py-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:i.name}),N&&o.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:N})]})]},i.name)})]})]}),o.jsxs(gt,{className:"px-8 py-5 border-t border-border",children:[o.jsx(ce,{variant:"outline",onClick:()=>A(!1),disabled:E.isPending,children:r("common.importFromDecoDialog.cancel")}),o.jsx(ce,{disabled:!m||!G||E.isPending||v||y||d||!c||a.status==="error",onClick:()=>m&&E.mutate(m),children:E.isPending?r("common.importFromDecoDialog.importing"):r("common.importFromDecoDialog.import")})]})]})})}function es(){const t=ue.c(80),e=pe(),{org:s}=ge(),[r,n]=z.useState(""),u=At(r,300);let p;t[0]!==u?(p={searchTerm:u},t[0]=u,t[1]=p):p=t[1];const C=Me(p),m=Ue();let D;t[2]===Symbol.for("react.memo_cache_sentinel")?(D={navigateOnCreate:!0},t[2]=D):D=t[2];const{createVirtualMCP:w,isCreating:g}=Je(D),[f,h]=z.useState(null),[x,b]=z.useState(!1),[l,a]=z.useState(!1),{granted:c}=ze("agents:manage"),d=Qe();let j;t[3]!==s?(j=_=>_.id!==s.id,t[3]=s,t[4]=j):j=t[4];const y=C.filter(j),{data:B}=Re(y.map(zt));let v;t[5]!==m||t[6]!==f||t[7]!==e?(v=async()=>{if(!f)return;const{id:_,title:_e}=f;h(null);try{await m.delete.mutateAsync(_),Q("agent_deleted",{agent_id:_,source:"agents_list"}),he.success(e("routes.agentsList.deletedAgent",{title:_e}))}catch{}},t[5]=m,t[6]=f,t[7]=e,t[8]=v):v=t[8];const P=v;let S;t[9]!==c||t[10]!==w||t[11]!==g||t[12]!==d||t[13]!==e?(S=c&&o.jsxs(De,{children:[o.jsx(be,{asChild:!0,children:o.jsxs(ce,{size:"sm",children:[o.jsx(Nt,{size:14}),e("routes.agentsList.createAgent")]})}),o.jsx(It,{onCreateFromScratch:()=>{Q("agent_create_clicked",{source:"agents_list",method:"scratch"}),w()},onImportGitHub:()=>{Q("agent_create_clicked",{source:"agents_list",method:"github"}),a(!0)},onImportDeco:()=>{Q("agent_create_clicked",{source:"agents_list",method:"deco"}),b(!0)},isCreating:g,align:"end",showDecoImport:d})]}),t[9]=c,t[10]=w,t[11]=g,t[12]=d,t[13]=e,t[14]=S):S=t[14];const A=S,I=de,G=de,E=de;let i;t[15]!==e?(i=e("routes.agentsList.title"),t[15]=e,t[16]=i):i=t[16];let N;t[17]!==A||t[18]!==i?(N=o.jsx(de.Title,{actions:A,children:i}),t[17]=A,t[18]=i,t[19]=N):N=t[19];let T;t[20]!==e?(T=e("routes.agentsList.searchPlaceholder"),t[20]=e,t[21]=T):T=t[21];let L;t[22]===Symbol.for("react.memo_cache_sentinel")?(L=_=>{_.key==="Escape"&&(n(""),_.target.blur())},t[22]=L):L=t[22];let F;t[23]!==r||t[24]!==T?(F=o.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:o.jsx(St,{value:r,onChange:n,placeholder:T,className:"w-full md:w-[375px]",onKeyDown:L})}),t[23]=r,t[24]=T,t[25]=F):F=t[25];let M;t[26]!==F||t[27]!==N?(M=o.jsxs("div",{className:"flex flex-col gap-6",children:[N,F]}),t[26]=F,t[27]=N,t[28]=M):M=t[28];const q=y.length===0&&o.jsx("div",{className:"flex items-center justify-center py-20",children:o.jsx(Ye,{actions:!1,image:o.jsx(qe,{size:48,className:"text-muted-foreground"}),title:e(r?"routes.agentsList.noAgentsFound":"routes.agentsList.noAgentsYet"),description:r?e("routes.agentsList.noAgentsMatchSearch",{search:r}):e(c?"routes.agentsList.createAgentToGetStarted":"routes.agentsList.askAdminToCreate")})}),le=y.length>0&&o.jsxs("div",{className:"mt-6 @container",children:[o.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:e("routes.agentsList.agentsHeading")}),o.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:y.map(_=>o.jsx(Tt,{project:_,lastUsedAt:B?.get(_.id)?.last_used_at,onDeleteClick:c?()=>h({id:_.id,title:_.title}):void 0},_.id))})]});let k;t[29]!==M||t[30]!==q||t[31]!==le||t[32]!==E.Container?(k=o.jsxs(E.Container,{children:[M,q,le]}),t[29]=M,t[30]=q,t[31]=le,t[32]=E.Container,t[33]=k):k=t[33];let U;t[34]!==k||t[35]!==G.Content?(U=o.jsx(G.Content,{children:k}),t[34]=k,t[35]=G.Content,t[36]=U):U=t[36];let H;t[37]!==l?(H=o.jsx(_t,{open:l,onOpenChange:a}),t[37]=l,t[38]=H):H=t[38];let R;t[39]!==x?(R=o.jsx(Ot,{open:x,onOpenChange:b}),t[39]=x,t[40]=R):R=t[40];const Y=!!f;let J;t[41]===Symbol.for("react.memo_cache_sentinel")?(J=_=>!_&&h(null),t[41]=J):J=t[41];let $;t[42]!==e?($=e("routes.agentsList.deleteAgentTitle"),t[42]=e,t[43]=$):$=t[43];let V;t[44]!==$?(V=o.jsx(xt,{children:$}),t[44]=$,t[45]=V):V=t[45];let O;t[46]!==e?(O=e("routes.agentsList.deleteAgentDescription"),t[46]=e,t[47]=O):O=t[47];const K=f?.title;let X;t[48]!==K?(X=o.jsx("span",{className:"font-medium text-foreground",children:K}),t[48]=K,t[49]=X):X=t[49];let W;t[50]!==O||t[51]!==X?(W=o.jsxs(jt,{children:[O," ",X,"."]}),t[50]=O,t[51]=X,t[52]=W):W=t[52];let Z;t[53]!==V||t[54]!==W?(Z=o.jsxs(Ct,{children:[V,W]}),t[53]=V,t[54]=W,t[55]=Z):Z=t[55];let ee;t[56]!==e?(ee=e("routes.agentsList.cancelButton"),t[56]=e,t[57]=ee):ee=t[57];let te;t[58]!==ee?(te=o.jsx(bt,{children:ee}),t[58]=ee,t[59]=te):te=t[59];let oe;t[60]!==e?(oe=e("routes.agentsList.deleteButton"),t[60]=e,t[61]=oe):oe=t[61];let se;t[62]!==P||t[63]!==oe?(se=o.jsx(Dt,{onClick:P,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:oe}),t[62]=P,t[63]=oe,t[64]=se):se=t[64];let ie;t[65]!==te||t[66]!==se?(ie=o.jsxs(yt,{children:[te,se]}),t[65]=te,t[66]=se,t[67]=ie):ie=t[67];let re;t[68]!==Z||t[69]!==ie?(re=o.jsxs(wt,{children:[Z,ie]}),t[68]=Z,t[69]=ie,t[70]=re):re=t[70];let ne;t[71]!==Y||t[72]!==re?(ne=o.jsx(vt,{open:Y,onOpenChange:J,children:re}),t[71]=Y,t[72]=re,t[73]=ne):ne=t[73];let me;return t[74]!==I||t[75]!==U||t[76]!==H||t[77]!==R||t[78]!==ne?(me=o.jsxs(I,{children:[U,H,R,ne]}),t[74]=I,t[75]=U,t[76]=H,t[77]=R,t[78]=ne,t[79]=me):me=t[79],me}function zt(t){return t.id}export{es as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as G,b as Z,as as tt,at as st,r as X,j as s,aU as vt,ee as it,t as ee,ed as Ne,ec as ae,aJ as lt,X as ne,a2 as le,o as be,e as re,x as Ke,B as W,K as J,m as Pe,aS as Se,l as oe,da as nt,fI as bt,e_ as Ce,ad as jt,ak as yt,L as Nt,q as Ve,h as St,au as Ct,av as Ae,fH as Pt}from"./index-BiuSAlzd.js";import{i as _t}from"./AlertCircle-DDHQi3fm.js";import{u as rt,a as ke,i as It,b as kt,p as wt,f as Ee,g as Dt,d as at}from"./use-ai-providers-BBj3hH0A.js";import{i as At}from"./CheckCircle-BemNEpVg.js";import{c as Kt,j as Et}from"./use-organization-settings-0Ql08vCb.js";import{S as Rt}from"./schema-CepQKFSq.js";import{M as Tt}from"./select-model-MWiJU5BO.js";import{u as Ut}from"./use-debounced-autosave-DM7h6lLt.js";import{I as ye}from"./input-B5d33h6X.js";import{T as Ge,a as Mt}from"./toggle-group-C7J6hm1X.js";import{A as Re,a as Te,b as Ue,c as Me,g as Oe,d as $e,e as Fe,f as Le}from"./alert-dialog-D9wz_Poi.js";import{u as De,e as qe,a as ot,f as Ot}from"./use-decopilot-events-B_Wj2FDs.js";import{u as ct}from"./use-open-billing-url-CrzuSkfk.js";import{u as dt,P as Be,a as $t,i as Ft,f as Lt,F as qt,S as ut}from"./plan-ladder-BbGn-NgZ.js";import{i as Bt}from"./Check-Cf-cMW3t.js";import{d as Ht,b as zt,c as Vt}from"./Tool01-BchdJG2X.js";import{s as Gt}from"./Plus-DjsQQqpw.js";import{s as Qt}from"./Trash01-BfnCKCGB.js";import{A as Yt}from"./avatar-BeFEVdWT.js";import{u as Wt,f as Zt}from"./use-date-fns-locale-D1z6vY0T.js";import{c as mt,P as Xt,C as Qe}from"./decopilot-CDg-MCtI.js";import{P as Jt}from"./ai-providers-logos-DD3qZ33J.js";import{s as es}from"./Image01-DnRAAkhy.js";import{d as ts,c as ss,b as is,D as ls,e as ns}from"./dialog-C9YQM7Rb.js";import{R as rs}from"./require-capability-B1clucXi.js";import"./task-board-Cg5OuTdd.js";import"./drawer-BbtvDSmI.js";import"./use-mobile-D06E6E9A.js";import"./chat-context-DHGUafJ4.js";import"./use-panel-navigate-DvFfVppm.js";import"./thread-route-SwwHxRrN.js";import"./use-project-scope-DJC0Rmd2.js";import"./repository-binding-CQsr_3Zk.js";import"./use-mcp-client-5sJCC1_2.js";import"./auth-DDdLUET9.js";import"./autosend-CeDtnxlk.js";import"./thread-intent-ags1XWir.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-DPIrGNp7.js";import"./index-C9yvlucI.js";import"./User01-DXNh3TnB.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-D-g_vU3W.js";import"./select-QknS4jya.js";import"./index-BGzd8qMa.js";import"./ChevronUp-B79uJeZN.js";import"./ArrowLeft-CIsJnvjF.js";import"./Key01-DXvy1NNO.js";import"./SearchMd-oXON6Mge.js";import"./Monitor01-BLZH5esy.js";import"./download-app-dialog-D3HwAGf1.js";import"./Copy01-DluK-JtU.js";import"./X-C52mq3mn.js";import"./access-gate-DbBQLMiF.js";import"./capability-load-error-m8D5eiRW.js";const as=e=>e.capabilities?.includes("image")===!0,os=e=>It(e),cs=e=>kt(e),ds=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:as},{key:"web_search",filter:os},{key:"deep_research",filter:cs}];function us(e){const t=G.c(27),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:r}=e,c=rt(),l=c.some(b=>b.id===i?.keyId)?i?.keyId:null,[d,f]=X.useState(l??r),[p,a]=X.useState(l);p!==l&&(a(l),l&&f(l));let m;t[0]!==c||t[1]!==r||t[2]!==d?(m=c.some(b=>b.id===d)?d:r,t[0]=c,t[1]=r,t[2]=d,t[3]=m):m=t[3];const u=m;let h;t[4]!==u||t[5]!==c?(h=u?c.find(b=>b.id===u):null,t[4]=u,t[5]=c,t[6]=h):h=t[6];const P=h,{models:S,isLoading:v}=ke(o?u??void 0:void 0),y=o?v||S.some(o):!0;let C;t[7]!==i||t[8]!==P?.providerId||t[9]!==l?(C=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:P?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=P?.providerId,t[9]=l,t[10]=C):C=t[10];const I=C,x=Z();if(o&&!y){let b;t[11]!==x?(b=x("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=x,t[12]=b):b=t[12];let w;return t[13]!==b?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[13]=b,t[14]=w):w=t[14],w}let j;t[15]!==x?(j=x("settings.simpleModeSection.pickModel"),t[15]=x,t[16]=j):j=t[16];let _;t[17]===Symbol.for("react.memo_cache_sentinel")?(_=b=>f(b),t[17]=_):_=t[17];let g;t[18]!==u||t[19]!==n?(g=b=>{const w=b.keyId??u??"";f(w),n({keyId:w,modelId:b.modelId,title:b.title})},t[18]=u,t[19]=n,t[20]=g):g=t[20];let N;return t[21]!==u||t[22]!==o||t[23]!==I||t[24]!==j||t[25]!==g?(N=s.jsx(Tt,{variant:"bordered",placeholder:j,model:I,credentialId:u,filterModels:o,onCredentialChange:_,onModelChange:g}),t[21]=u,t[22]=o,t[23]=I,t[24]=j,t[25]=g,t[26]=N):N=t[26],N}function ms(e){const t=G.c(10),{isPending:i,showSaved:n}=e,o=Z();if(i){let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(lt,{size:12,className:"animate-spin"}),t[0]=r):r=t[0];let c;t[1]!==o?(c=o("settings.simpleModeSection.saving"),t[1]=o,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[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(At,{size:12}),t[5]=r):r=t[5];let c;t[6]!==o?(c=o("settings.simpleModeSection.saved"),t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function fs(){const e=G.c(58),t=Z(),i=rt(),n=Kt(),o=i.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=tt(Rt),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=st(c),{mutate:d,isPending:f,isSuccess:p}=Et(),a=l.formState.isDirty;let m;e[3]!==l||e[4]!==n||e[5]!==t||e[6]!==d?(m={delayMs:250,save:async()=>{const k=l.getValues();d(k,{onSuccess:()=>l.reset(k,{keepValues:!0}),onError:F=>{l.reset(n),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=l,e[4]=n,e[5]=t,e[6]=d,e[7]=m):m=e[7];const{schedule:u}=Ut(m),h=i[0],P=i[1],S=i[2],{models:v}=ke(h?.id),{models:y}=ke(P?.id),{models:C}=ke(S?.id);let I,x;e[8]!==l||e[9]!==o?(I=()=>{o||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},x=[o,l],e[8]=l,e[9]=o,e[10]=I,e[11]=x):(I=e[10],x=e[11]),X.useEffect(I,x);let j;e[12]!==i||e[13]!==l||e[14]!==h||e[15]!==P||e[16]!==S||e[17]!==v||e[18]!==y||e[19]!==C?(j=()=>{const k=l.getValues(),F=new Set(i.map(ps)),B={};h?.id&&(B[h.id]=v),P?.id&&(B[P.id]=y),S?.id&&(B[S.id]=C);const z=se=>se!=null&&!F.has(se.keyId),T={fast:z(k.tiers.fast)?null:k.tiers.fast,smart:z(k.tiers.smart)?null:k.tiers.smart,thinking:z(k.tiers.thinking)?null:k.tiers.thinking,image:z(k.tiers.image)?null:k.tiers.image,web_search:z(k.tiers.web_search)?null:k.tiers.web_search,deep_research:z(k.tiers.deep_research)?null:k.tiers.deep_research},Q=!T.fast||!T.smart||!T.thinking||!T.image||!T.web_search||!T.deep_research,te=T.fast===k.tiers.fast&&T.smart===k.tiers.smart&&T.thinking===k.tiers.thinking&&T.image===k.tiers.image&&T.web_search===k.tiers.web_search&&T.deep_research===k.tiers.deep_research;if(!Q&&te)return;const Y=wt(i,B);l.reset({tiers:{fast:T.fast??Y.chat.fast,smart:T.smart??Y.chat.smart,thinking:T.thinking??Y.chat.thinking,image:T.image??Y.image,web_search:T.web_search??Y.webSearch,deep_research:T.deep_research??Y.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=h,e[15]=P,e[16]=S,e[17]=v,e[18]=y,e[19]=C,e[20]=j):j=e[20];const _=h?.id,g=P?.id,N=S?.id;let b;e[21]!==i||e[22]!==l||e[23]!==v||e[24]!==y||e[25]!==C||e[26]!==_||e[27]!==g||e[28]!==N?(b=[l,i,v,y,C,_,g,N],e[21]=i,e[22]=l,e[23]=v,e[24]=y,e[25]=C,e[26]=_,e[27]=g,e[28]=N,e[29]=b):b=e[29],X.useEffect(j,b);let w;e[30]!==t?(w=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")})[k]||k,e[30]=t,e[31]=w):w=e[31];const R=w;let A;e[32]!==t?(A=k=>({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")})[k]||"",e[32]=t,e[33]=A):A=e[33];const K=A;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let O;e[36]!==t?(O=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=O):O=e[37];let E;e[38]!==O?(E=s.jsx("p",{className:"text-sm text-muted-foreground",children:O}),e[38]=O,e[39]=E):E=e[39];const L=p&&!a;let $;e[40]!==f||e[41]!==L?($=s.jsx(ms,{isPending:f,showSaved:L}),e[40]=f,e[41]=L,e[42]=$):$=e[42];let q;e[43]!==E||e[44]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[E,$]}),e[43]=E,e[44]=$,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==K||e[49]!==R||e[50]!==u?(H=ds.map(k=>s.jsx(vt,{control:l.control,name:`tiers.${k.key}`,render:F=>{const{field:B}=F;return s.jsx(it,{title:R(k.key),description:K(k.key),action:s.jsx(us,{slot:B.value,defaultKeyId:i[0]?.id??null,filterModels:k.filter,onSlotChange:z=>{B.onChange(z),u()}})})}},k.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=K,e[49]=R,e[50]=u,e[51]=H):H=e[51];let D;e[52]!==H?(D=s.jsx(Ne,{children:H}),e[52]=H,e[53]=D):D=e[53];let M;return e[54]!==U||e[55]!==q||e[56]!==D?(M=s.jsxs(ae,{title:U,headerClassName:"pl-0",children:[q,D]}),e[54]=U,e[55]=q,e[56]=D,e[57]=M):M=e[57],M}function ps(e){return e.id}const gs={usd:[10,20,100],brl:[50,100,500]};function ft(){const e=G.c(30),t=Z(),i=le(),[n]=Ke(),[o,r]=X.useState(!1);let c;e[0]!==t?(c=g=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:g.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=re({mutationFn:async g=>{const{url:N}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:g,currency:u});return N},onSuccess:xs,onError:c}),[f,p]=X.useState(""),[a,m]=X.useState(n.language==="pt-BR"?"brl":"usd"),u=a,h=parseFloat(f),P=!isNaN(h)&&h>=1,S=u==="brl"?"R$":"$";let v;e[2]!==m?(v=g=>{g&&m(g)},e[2]=m,e[3]=v):v=e[3];let y,C;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ge,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),C=s.jsx(Ge,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=y,e[5]=C):(y=e[4],C=e[5]);let I;e[6]!==u||e[7]!==v?(I=s.jsxs(Mt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:v,children:[y,C]}),e[6]=u,e[7]=v,e[8]=I):I=e[8];let x;e[9]!==u||e[10]!==S||e[11]!==o||e[12]!==d||e[13]!==t||e[14]!==l?(x=!o&&s.jsxs(s.Fragment,{children:[gs[u].map(g=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(g*100),children:[S,g]},g)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>r(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=S,e[11]=o,e[12]=d,e[13]=t,e[14]=l,e[15]=x):x=e[15];let j;e[16]!==S||e[17]!==f||e[18]!==h||e[19]!==o||e[20]!==P||e[21]!==d||e[22]!==p||e[23]!==t||e[24]!==l?(j=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:S}),s.jsx(ye,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:f,onChange:g=>p(g.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!P||d,onClick:()=>l(Math.round(h*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{r(!1),p("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=S,e[17]=f,e[18]=h,e[19]=o,e[20]=P,e[21]=d,e[22]=p,e[23]=t,e[24]=l,e[25]=j):j=e[25];let _;return e[26]!==I||e[27]!==x||e[28]!==j?(_=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[I,x,j]})}),e[26]=I,e[27]=x,e[28]=j,e[29]=_):_=e[29],_}function xs(e){e&&window.open(e,"_blank","noopener,noreferrer")}function hs(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function vs(e){const t=G.c(38),{enabled:i}=e,n=Z(),{org:o}=ne(),r=le();let c;t[0]!==o.id?(c=J.aiProviderCredits(o.id,"deco"),t[0]=o.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:f,isLoading:p,refetch:a,isFetching:m}=Pe(d);if(!i)return null;const u=f?.balanceCents!=null?f.balanceCents/100:null;let h;t[8]!==u?(h=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=h):h=t[9];const P=h;let S;t[10]!==u||t[11]!==P||t[12]!==m||t[13]!==p?(S=p||m?s.jsx(Se,{className:"h-9 w-24"}):s.jsx("span",{className:oe("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&hs(u)),children:P}),t[10]=u,t[11]=P,t[12]=m,t[13]=p,t[14]=S):S=t[14];let v;t[15]!==a?(v=()=>a(),t[15]=a,t[16]=v):v=t[16];let y;t[17]!==n?(y=n("settings.decoCreditsHero.refreshBalance"),t[17]=n,t[18]=y):y=t[18];const C=m&&"animate-spin";let I;t[19]!==C?(I=oe(C),t[19]=C,t[20]=I):I=t[20];let x;t[21]!==I?(x=s.jsx(lt,{size:14,className:I}),t[21]=I,t[22]=x):x=t[22];let j;t[23]!==m||t[24]!==x||t[25]!==v||t[26]!==y?(j=s.jsx("button",{type:"button",onClick:v,disabled:m,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-lg hover:bg-muted/50","aria-label":y,children:x}),t[23]=m,t[24]=x,t[25]=v,t[26]=y,t[27]=j):j=t[27];let _;t[28]!==j||t[29]!==S?(_=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,j]}),t[28]=j,t[29]=S,t[30]=_):_=t[30];let g;t[31]!==n?(g=n("settings.decoCreditsHero.availableBalance"),t[31]=n,t[32]=g):g=t[32];let N;t[33]!==g?(N=s.jsx("p",{className:"text-xs text-muted-foreground",children:g}),t[33]=g,t[34]=N):N=t[34];let b;return t[35]!==_||t[36]!==N?(b=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[_,N]}),t[35]=_,t[36]=N,t[37]=b):b=t[37],b}function bs(){const e=G.c(74),t=Z(),{org:i}=ne(),n=le(),o=be(),r=Ee();let c;e[0]!==r?(c=r.find(js),e[0]=r,e[1]=c):c=e[1];const l=c,d=De(),f=qe("credits"),[p,a]=X.useState(!1);let m;e[2]!==l||e[3]!==n?(m=async()=>{l&&await n.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=n,e[4]=m):m=e[4];let u;e[5]!==i||e[6]!==o||e[7]!==t?(u=()=>{o.invalidateQueries({queryKey:J.aiProviderKeys(i.id)}),o.invalidateQueries({queryKey:J.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),a(!1)},e[5]=i,e[6]=o,e[7]=t,e[8]=u):u=e[8];let h;e[9]!==t?(h=z=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=h):h=e[10];let P;e[11]!==m||e[12]!==u||e[13]!==h?(P={mutationFn:m,onSuccess:u,onError:h},e[11]=m,e[12]=u,e[13]=h,e[14]=P):P=e[14];const{mutate:S,isPending:v}=re(P);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=e[16];let C;e[17]!==t?(C=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=C):C=e[18];let I;e[19]!==C?(I=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:C,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=C,e[20]=I):I=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>a(!0),e[21]=x):x=e[21];let j;e[22]!==t?(j=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=j):j=e[23];let _;e[24]!==v||e[25]!==j?(_=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:x,disabled:v,children:j}),e[24]=v,e[25]=j,e[26]=_):_=e[26];let g;e[27]!==_||e[28]!==I?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[I,_]}),e[27]=_,e[28]=I,e[29]=g):g=e[29];let N;e[30]!==t?(N=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=N):N=e[31];let b;e[32]!==N?(b=s.jsx(Re,{children:N}),e[32]=N,e[33]=b):b=e[33];let w;e[34]!==t?(w=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=w):w=e[35];let R;e[36]!==w?(R=s.jsx(Te,{children:w}),e[36]=w,e[37]=R):R=e[37];let A;e[38]!==b||e[39]!==R?(A=s.jsxs(Ue,{children:[b,R]}),e[38]=b,e[39]=R,e[40]=A):A=e[40];let K;e[41]!==t?(K=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=K):K=e[42];let U;e[43]!==K?(U=s.jsx(Me,{children:K}),e[43]=K,e[44]=U):U=e[44];let O;e[45]!==S?(O=()=>S(),e[45]=S,e[46]=O):O=e[46];let E;e[47]!==t?(E=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=E):E=e[48];let L;e[49]!==O||e[50]!==E?(L=s.jsx(Oe,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:E}),e[49]=O,e[50]=E,e[51]=L):L=e[51];let $;e[52]!==U||e[53]!==L?($=s.jsxs($e,{children:[U,L]}),e[52]=U,e[53]=L,e[54]=$):$=e[54];let q;e[55]!==A||e[56]!==$?(q=s.jsxs(Fe,{children:[A,$]}),e[55]=A,e[56]=$,e[57]=q):q=e[57];let H;e[58]!==p||e[59]!==q?(H=s.jsx(Le,{open:p,onOpenChange:a,children:q}),e[58]=p,e[59]=q,e[60]=H):H=e[60];const D=!d;let M;e[61]!==D?(M=s.jsx(vs,{enabled:D}),e[61]=D,e[62]=M):M=e[62];let k;e[63]!==f||e[64]!==t?(k=f?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(ft,{})]}):null,e[63]=f,e[64]=t,e[65]=k):k=e[65];let F;e[66]!==g||e[67]!==H||e[68]!==M||e[69]!==k?(F=s.jsx(Ne,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[g,H,M,k]})}),e[66]=g,e[67]=H,e[68]=M,e[69]=k,e[70]=F):F=e[70];let B;return e[71]!==F||e[72]!==y?(B=s.jsx(ae,{title:y,children:F}),e[71]=F,e[72]=y,e[73]=B):B=e[73],B}function js(e){return e.providerId==="deco"}var He="Progress",ze=100,[ys]=bt(He),[Ns,Ss]=ys(He),pt=X.forwardRef((e,t)=>{const{__scopeProgress:i,value:n=null,max:o,getValueLabel:r=Cs,...c}=e;(o||o===0)&&!Ye(o)&&console.error(Ps(`${o}`,"Progress"));const l=Ye(o)?o:ze;n!==null&&!We(n,l)&&console.error(_s(`${n}`,"Progress"));const d=We(n,l)?n:null,f=we(d)?r(d,l):void 0;return s.jsx(Ns,{scope:i,value:d,max:l,children:s.jsx(nt.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":we(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":ht(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});pt.displayName=He;var gt="ProgressIndicator",xt=X.forwardRef((e,t)=>{const{__scopeProgress:i,...n}=e,o=Ss(gt,i);return s.jsx(nt.div,{"data-state":ht(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...n,ref:t})});xt.displayName=gt;function Cs(e,t){return`${Math.round(e/t*100)}%`}function ht(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function we(e){return typeof e=="number"}function Ye(e){return we(e)&&!isNaN(e)&&e>0}function We(e,t){return we(e)&&!isNaN(e)&&e<=t&&e>=0}function Ps(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ze}\`.`}function _s(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
1
|
+
import{c as G,b as Z,as as tt,at as st,r as X,j as s,aU as vt,ee as it,t as ee,ed as Ne,ec as ae,aJ as lt,X as ne,a2 as le,o as be,e as re,x as Ke,B as W,K as J,m as Pe,aS as Se,l as oe,da as nt,fI as bt,e_ as Ce,ad as jt,ak as yt,L as Nt,q as Ve,h as St,au as Ct,av as Ae,fH as Pt}from"./index-DOUQg0zs.js";import{i as _t}from"./AlertCircle-Bt4fa9oZ.js";import{u as rt,a as ke,i as It,b as kt,p as wt,f as Ee,g as Dt,d as at}from"./use-ai-providers-CGavfYZY.js";import{i as At}from"./CheckCircle-DYG4Bhna.js";import{c as Kt,j as Et}from"./use-organization-settings-BIE-soL2.js";import{S as Rt}from"./schema-DpPC83dn.js";import{M as Tt}from"./select-model-BdenIwfs.js";import{u as Ut}from"./use-debounced-autosave-DPeMCoXS.js";import{I as ye}from"./input-D50iAX6q.js";import{T as Ge,a as Mt}from"./toggle-group-1JsQ4ux4.js";import{A as Re,a as Te,b as Ue,c as Me,g as Oe,d as $e,e as Fe,f as Le}from"./alert-dialog-C8wYJe4o.js";import{u as De,e as qe,a as ot,f as Ot}from"./use-decopilot-events-Cz3bQ8e4.js";import{u as ct}from"./use-open-billing-url-BDx40jcR.js";import{u as dt,P as Be,a as $t,i as Ft,f as Lt,F as qt,S as ut}from"./plan-ladder-CrScgxpw.js";import{i as Bt}from"./Check-CBF8eTgr.js";import{d as Ht,b as zt,c as Vt}from"./Tool01-wjHS3MbM.js";import{s as Gt}from"./Plus-DhmMzSv0.js";import{s as Qt}from"./Trash01-BIa5uuJe.js";import{A as Yt}from"./avatar-Dv4UhAF7.js";import{u as Wt,f as Zt}from"./use-date-fns-locale-C1PKxs7V.js";import{c as mt,P as Xt,C as Qe}from"./decopilot-B0A58oJ1.js";import{P as Jt}from"./ai-providers-logos-DD3qZ33J.js";import{s as es}from"./Image01-BWtlQPQv.js";import{d as ts,c as ss,b as is,D as ls,e as ns}from"./dialog-C-xWJ6aR.js";import{R as rs}from"./require-capability-D3ZFNPjS.js";import"./task-board-DXXLrHdX.js";import"./drawer-tgIYd8-D.js";import"./use-mobile-BMPXLE4o.js";import"./chat-context-B0osA6sP.js";import"./use-panel-navigate-Bel1nQM_.js";import"./thread-route-DFAxA-J4.js";import"./use-project-scope-Bq2SyzJ7.js";import"./repository-binding-DosYHiTz.js";import"./use-mcp-client-DxHrE3Rr.js";import"./auth-Brm-gMyA.js";import"./autosend-Cfg7z5wQ.js";import"./thread-intent-DC7irtdr.js";import"./backoff-8mStPHYB.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./location-DPIrGNp7.js";import"./index-D_pCak2Z.js";import"./User01-C-57a8l-.js";import"./differenceInSeconds-C3x8sHUj.js";import"./checkbox-DIhZR311.js";import"./select-BgR8S5Ol.js";import"./index-CbcEBCnU.js";import"./ChevronUp-MXpj0fOa.js";import"./ArrowLeft-BheW9nUA.js";import"./Key01-1FHVDeLv.js";import"./SearchMd-wnWyoFfY.js";import"./Monitor01-CF2sOSMh.js";import"./download-app-dialog-BXy5zLzA.js";import"./Copy01-DIV9jah9.js";import"./X-8qFfssY9.js";import"./access-gate-SUsdf2_J.js";import"./capability-load-error-C7wIGk2k.js";const as=e=>e.capabilities?.includes("image")===!0,os=e=>It(e),cs=e=>kt(e),ds=[{key:"fast",filter:void 0},{key:"smart",filter:void 0},{key:"thinking",filter:void 0},{key:"image",filter:as},{key:"web_search",filter:os},{key:"deep_research",filter:cs}];function us(e){const t=G.c(27),{slot:i,onSlotChange:n,filterModels:o,defaultKeyId:r}=e,c=rt(),l=c.some(b=>b.id===i?.keyId)?i?.keyId:null,[d,f]=X.useState(l??r),[p,a]=X.useState(l);p!==l&&(a(l),l&&f(l));let m;t[0]!==c||t[1]!==r||t[2]!==d?(m=c.some(b=>b.id===d)?d:r,t[0]=c,t[1]=r,t[2]=d,t[3]=m):m=t[3];const u=m;let h;t[4]!==u||t[5]!==c?(h=u?c.find(b=>b.id===u):null,t[4]=u,t[5]=c,t[6]=h):h=t[6];const P=h,{models:S,isLoading:v}=ke(o?u??void 0:void 0),y=o?v||S.some(o):!0;let C;t[7]!==i||t[8]!==P?.providerId||t[9]!==l?(C=i&&l?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:P?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=P?.providerId,t[9]=l,t[10]=C):C=t[10];const I=C,x=Z();if(o&&!y){let b;t[11]!==x?(b=x("settings.simpleModeSection.notAvailableWithCurrentProvider"),t[11]=x,t[12]=b):b=t[12];let w;return t[13]!==b?(w=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:b}),t[13]=b,t[14]=w):w=t[14],w}let j;t[15]!==x?(j=x("settings.simpleModeSection.pickModel"),t[15]=x,t[16]=j):j=t[16];let _;t[17]===Symbol.for("react.memo_cache_sentinel")?(_=b=>f(b),t[17]=_):_=t[17];let g;t[18]!==u||t[19]!==n?(g=b=>{const w=b.keyId??u??"";f(w),n({keyId:w,modelId:b.modelId,title:b.title})},t[18]=u,t[19]=n,t[20]=g):g=t[20];let N;return t[21]!==u||t[22]!==o||t[23]!==I||t[24]!==j||t[25]!==g?(N=s.jsx(Tt,{variant:"bordered",placeholder:j,model:I,credentialId:u,filterModels:o,onCredentialChange:_,onModelChange:g}),t[21]=u,t[22]=o,t[23]=I,t[24]=j,t[25]=g,t[26]=N):N=t[26],N}function ms(e){const t=G.c(10),{isPending:i,showSaved:n}=e,o=Z();if(i){let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(lt,{size:12,className:"animate-spin"}),t[0]=r):r=t[0];let c;t[1]!==o?(c=o("settings.simpleModeSection.saving"),t[1]=o,t[2]=c):c=t[2];let l;return t[3]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[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(At,{size:12}),t[5]=r):r=t[5];let c;t[6]!==o?(c=o("settings.simpleModeSection.saved"),t[6]=o,t[7]=c):c=t[7];let l;return t[8]!==c?(l=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[r,c]}),t[8]=c,t[9]=l):l=t[9],l}return null}function fs(){const e=G.c(58),t=Z(),i=rt(),n=Kt(),o=i.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=tt(Rt),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=st(c),{mutate:d,isPending:f,isSuccess:p}=Et(),a=l.formState.isDirty;let m;e[3]!==l||e[4]!==n||e[5]!==t||e[6]!==d?(m={delayMs:250,save:async()=>{const k=l.getValues();d(k,{onSuccess:()=>l.reset(k,{keepValues:!0}),onError:F=>{l.reset(n),ee.error(t("settings.simpleModeSection.failedToSave",{error:F.message}))}})}},e[3]=l,e[4]=n,e[5]=t,e[6]=d,e[7]=m):m=e[7];const{schedule:u}=Ut(m),h=i[0],P=i[1],S=i[2],{models:v}=ke(h?.id),{models:y}=ke(P?.id),{models:C}=ke(S?.id);let I,x;e[8]!==l||e[9]!==o?(I=()=>{o||l.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},x=[o,l],e[8]=l,e[9]=o,e[10]=I,e[11]=x):(I=e[10],x=e[11]),X.useEffect(I,x);let j;e[12]!==i||e[13]!==l||e[14]!==h||e[15]!==P||e[16]!==S||e[17]!==v||e[18]!==y||e[19]!==C?(j=()=>{const k=l.getValues(),F=new Set(i.map(ps)),B={};h?.id&&(B[h.id]=v),P?.id&&(B[P.id]=y),S?.id&&(B[S.id]=C);const z=se=>se!=null&&!F.has(se.keyId),T={fast:z(k.tiers.fast)?null:k.tiers.fast,smart:z(k.tiers.smart)?null:k.tiers.smart,thinking:z(k.tiers.thinking)?null:k.tiers.thinking,image:z(k.tiers.image)?null:k.tiers.image,web_search:z(k.tiers.web_search)?null:k.tiers.web_search,deep_research:z(k.tiers.deep_research)?null:k.tiers.deep_research},Q=!T.fast||!T.smart||!T.thinking||!T.image||!T.web_search||!T.deep_research,te=T.fast===k.tiers.fast&&T.smart===k.tiers.smart&&T.thinking===k.tiers.thinking&&T.image===k.tiers.image&&T.web_search===k.tiers.web_search&&T.deep_research===k.tiers.deep_research;if(!Q&&te)return;const Y=wt(i,B);l.reset({tiers:{fast:T.fast??Y.chat.fast,smart:T.smart??Y.chat.smart,thinking:T.thinking??Y.chat.thinking,image:T.image??Y.image,web_search:T.web_search??Y.webSearch,deep_research:T.deep_research??Y.deepResearch}},{keepDirty:!0})},e[12]=i,e[13]=l,e[14]=h,e[15]=P,e[16]=S,e[17]=v,e[18]=y,e[19]=C,e[20]=j):j=e[20];const _=h?.id,g=P?.id,N=S?.id;let b;e[21]!==i||e[22]!==l||e[23]!==v||e[24]!==y||e[25]!==C||e[26]!==_||e[27]!==g||e[28]!==N?(b=[l,i,v,y,C,_,g,N],e[21]=i,e[22]=l,e[23]=v,e[24]=y,e[25]=C,e[26]=_,e[27]=g,e[28]=N,e[29]=b):b=e[29],X.useEffect(j,b);let w;e[30]!==t?(w=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")})[k]||k,e[30]=t,e[31]=w):w=e[31];const R=w;let A;e[32]!==t?(A=k=>({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")})[k]||"",e[32]=t,e[33]=A):A=e[33];const K=A;let U;e[34]!==t?(U=t("settings.simpleModeSection.defaultModels"),e[34]=t,e[35]=U):U=e[35];let O;e[36]!==t?(O=t("settings.simpleModeSection.modelsPowerDescription"),e[36]=t,e[37]=O):O=e[37];let E;e[38]!==O?(E=s.jsx("p",{className:"text-sm text-muted-foreground",children:O}),e[38]=O,e[39]=E):E=e[39];const L=p&&!a;let $;e[40]!==f||e[41]!==L?($=s.jsx(ms,{isPending:f,showSaved:L}),e[40]=f,e[41]=L,e[42]=$):$=e[42];let q;e[43]!==E||e[44]!==$?(q=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[E,$]}),e[43]=E,e[44]=$,e[45]=q):q=e[45];let H;e[46]!==i[0]?.id||e[47]!==l.control||e[48]!==K||e[49]!==R||e[50]!==u?(H=ds.map(k=>s.jsx(vt,{control:l.control,name:`tiers.${k.key}`,render:F=>{const{field:B}=F;return s.jsx(it,{title:R(k.key),description:K(k.key),action:s.jsx(us,{slot:B.value,defaultKeyId:i[0]?.id??null,filterModels:k.filter,onSlotChange:z=>{B.onChange(z),u()}})})}},k.key)),e[46]=i[0]?.id,e[47]=l.control,e[48]=K,e[49]=R,e[50]=u,e[51]=H):H=e[51];let D;e[52]!==H?(D=s.jsx(Ne,{children:H}),e[52]=H,e[53]=D):D=e[53];let M;return e[54]!==U||e[55]!==q||e[56]!==D?(M=s.jsxs(ae,{title:U,headerClassName:"pl-0",children:[q,D]}),e[54]=U,e[55]=q,e[56]=D,e[57]=M):M=e[57],M}function ps(e){return e.id}const gs={usd:[10,20,100],brl:[50,100,500]};function ft(){const e=G.c(30),t=Z(),i=le(),[n]=Ke(),[o,r]=X.useState(!1);let c;e[0]!==t?(c=g=>{ee.error(t("settings.decoCreditsHero.topUpFailed",{message:g.message}))},e[0]=t,e[1]=c):c=e[1];const{mutate:l,isPending:d}=re({mutationFn:async g=>{const{url:N}=await i.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:g,currency:u});return N},onSuccess:xs,onError:c}),[f,p]=X.useState(""),[a,m]=X.useState(n.language==="pt-BR"?"brl":"usd"),u=a,h=parseFloat(f),P=!isNaN(h)&&h>=1,S=u==="brl"?"R$":"$";let v;e[2]!==m?(v=g=>{g&&m(g)},e[2]=m,e[3]=v):v=e[3];let y,C;e[4]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(Ge,{value:"usd",className:"h-8 px-3 text-sm",children:"USD"}),C=s.jsx(Ge,{value:"brl",className:"h-8 px-3 text-sm",children:"BRL"}),e[4]=y,e[5]=C):(y=e[4],C=e[5]);let I;e[6]!==u||e[7]!==v?(I=s.jsxs(Mt,{type:"single",variant:"outline",size:"sm",value:u,onValueChange:v,children:[y,C]}),e[6]=u,e[7]=v,e[8]=I):I=e[8];let x;e[9]!==u||e[10]!==S||e[11]!==o||e[12]!==d||e[13]!==t||e[14]!==l?(x=!o&&s.jsxs(s.Fragment,{children:[gs[u].map(g=>s.jsxs(W,{variant:"outline",className:"tabular-nums",disabled:d,onClick:()=>l(g*100),children:[S,g]},g)),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>r(!0),disabled:d,children:t("settings.decoCreditsHero.custom")})]}),e[9]=u,e[10]=S,e[11]=o,e[12]=d,e[13]=t,e[14]=l,e[15]=x):x=e[15];let j;e[16]!==S||e[17]!==f||e[18]!==h||e[19]!==o||e[20]!==P||e[21]!==d||e[22]!==p||e[23]!==t||e[24]!==l?(j=o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:S}),s.jsx(ye,{type:"number",min:"1",step:"1",placeholder:t("settings.decoCreditsHero.amountPlaceholder"),value:f,onChange:g=>p(g.target.value),className:"h-8 text-sm pl-7",autoFocus:!0})]}),s.jsx(W,{disabled:!P||d,onClick:()=>l(Math.round(h*100)),children:d?"...":t("settings.decoCreditsHero.add")}),s.jsx(W,{variant:"ghost",className:"text-muted-foreground",onClick:()=>{r(!1),p("")},children:t("settings.decoCreditsHero.cancel")})]}),e[16]=S,e[17]=f,e[18]=h,e[19]=o,e[20]=P,e[21]=d,e[22]=p,e[23]=t,e[24]=l,e[25]=j):j=e[25];let _;return e[26]!==I||e[27]!==x||e[28]!==j?(_=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[I,x,j]})}),e[26]=I,e[27]=x,e[28]=j,e[29]=_):_=e[29],_}function xs(e){e&&window.open(e,"_blank","noopener,noreferrer")}function hs(e){return e<=0?"text-destructive":e<=1?"text-warning":"text-foreground"}function vs(e){const t=G.c(38),{enabled:i}=e,n=Z(),{org:o}=ne(),r=le();let c;t[0]!==o.id?(c=J.aiProviderCredits(o.id,"deco"),t[0]=o.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:f,isLoading:p,refetch:a,isFetching:m}=Pe(d);if(!i)return null;const u=f?.balanceCents!=null?f.balanceCents/100:null;let h;t[8]!==u?(h=u!=null?`$${u.toFixed(2)}`:"—",t[8]=u,t[9]=h):h=t[9];const P=h;let S;t[10]!==u||t[11]!==P||t[12]!==m||t[13]!==p?(S=p||m?s.jsx(Se,{className:"h-9 w-24"}):s.jsx("span",{className:oe("text-3xl font-semibold tabular-nums tracking-tight",u!=null&&hs(u)),children:P}),t[10]=u,t[11]=P,t[12]=m,t[13]=p,t[14]=S):S=t[14];let v;t[15]!==a?(v=()=>a(),t[15]=a,t[16]=v):v=t[16];let y;t[17]!==n?(y=n("settings.decoCreditsHero.refreshBalance"),t[17]=n,t[18]=y):y=t[18];const C=m&&"animate-spin";let I;t[19]!==C?(I=oe(C),t[19]=C,t[20]=I):I=t[20];let x;t[21]!==I?(x=s.jsx(lt,{size:14,className:I}),t[21]=I,t[22]=x):x=t[22];let j;t[23]!==m||t[24]!==x||t[25]!==v||t[26]!==y?(j=s.jsx("button",{type:"button",onClick:v,disabled:m,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-lg hover:bg-muted/50","aria-label":y,children:x}),t[23]=m,t[24]=x,t[25]=v,t[26]=y,t[27]=j):j=t[27];let _;t[28]!==j||t[29]!==S?(_=s.jsxs("div",{className:"flex items-baseline gap-2",children:[S,j]}),t[28]=j,t[29]=S,t[30]=_):_=t[30];let g;t[31]!==n?(g=n("settings.decoCreditsHero.availableBalance"),t[31]=n,t[32]=g):g=t[32];let N;t[33]!==g?(N=s.jsx("p",{className:"text-xs text-muted-foreground",children:g}),t[33]=g,t[34]=N):N=t[34];let b;return t[35]!==_||t[36]!==N?(b=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[_,N]}),t[35]=_,t[36]=N,t[37]=b):b=t[37],b}function bs(){const e=G.c(74),t=Z(),{org:i}=ne(),n=le(),o=be(),r=Ee();let c;e[0]!==r?(c=r.find(js),e[0]=r,e[1]=c):c=e[1];const l=c,d=De(),f=qe("credits"),[p,a]=X.useState(!1);let m;e[2]!==l||e[3]!==n?(m=async()=>{l&&await n.call("AI_PROVIDER_KEY_DELETE",{keyId:l.id})},e[2]=l,e[3]=n,e[4]=m):m=e[4];let u;e[5]!==i||e[6]!==o||e[7]!==t?(u=()=>{o.invalidateQueries({queryKey:J.aiProviderKeys(i.id)}),o.invalidateQueries({queryKey:J.aiProviders(i.id)}),ee.success(t("settings.decoCreditsHero.disconnectSuccess")),a(!1)},e[5]=i,e[6]=o,e[7]=t,e[8]=u):u=e[8];let h;e[9]!==t?(h=z=>{ee.error(t("settings.decoCreditsHero.disconnectError",{message:z.message}))},e[9]=t,e[10]=h):h=e[10];let P;e[11]!==m||e[12]!==u||e[13]!==h?(P={mutationFn:m,onSuccess:u,onError:h},e[11]=m,e[12]=u,e[13]=h,e[14]=P):P=e[14];const{mutate:S,isPending:v}=re(P);if(!l)return null;let y;e[15]!==t?(y=t("settings.decoCreditsHero.title"),e[15]=t,e[16]=y):y=e[16];let C;e[17]!==t?(C=t("settings.decoCreditsHero.decoAiGatewayAlt"),e[17]=t,e[18]=C):C=e[18];let I;e[19]!==C?(I=s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("img",{src:"/logos/deco%20logo.svg",alt:C,className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"})}),e[19]=C,e[20]=I):I=e[20];let x;e[21]===Symbol.for("react.memo_cache_sentinel")?(x=()=>a(!0),e[21]=x):x=e[21];let j;e[22]!==t?(j=t("settings.decoCreditsHero.disconnect"),e[22]=t,e[23]=j):j=e[23];let _;e[24]!==v||e[25]!==j?(_=s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:x,disabled:v,children:j}),e[24]=v,e[25]=j,e[26]=_):_=e[26];let g;e[27]!==_||e[28]!==I?(g=s.jsxs("div",{className:"flex items-center justify-between",children:[I,_]}),e[27]=_,e[28]=I,e[29]=g):g=e[29];let N;e[30]!==t?(N=t("settings.decoCreditsHero.disconnectTitle"),e[30]=t,e[31]=N):N=e[31];let b;e[32]!==N?(b=s.jsx(Re,{children:N}),e[32]=N,e[33]=b):b=e[33];let w;e[34]!==t?(w=t("settings.decoCreditsHero.disconnectDescription"),e[34]=t,e[35]=w):w=e[35];let R;e[36]!==w?(R=s.jsx(Te,{children:w}),e[36]=w,e[37]=R):R=e[37];let A;e[38]!==b||e[39]!==R?(A=s.jsxs(Ue,{children:[b,R]}),e[38]=b,e[39]=R,e[40]=A):A=e[40];let K;e[41]!==t?(K=t("settings.decoCreditsHero.cancelButton"),e[41]=t,e[42]=K):K=e[42];let U;e[43]!==K?(U=s.jsx(Me,{children:K}),e[43]=K,e[44]=U):U=e[44];let O;e[45]!==S?(O=()=>S(),e[45]=S,e[46]=O):O=e[46];let E;e[47]!==t?(E=t("settings.decoCreditsHero.disconnectButton"),e[47]=t,e[48]=E):E=e[48];let L;e[49]!==O||e[50]!==E?(L=s.jsx(Oe,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:E}),e[49]=O,e[50]=E,e[51]=L):L=e[51];let $;e[52]!==U||e[53]!==L?($=s.jsxs($e,{children:[U,L]}),e[52]=U,e[53]=L,e[54]=$):$=e[54];let q;e[55]!==A||e[56]!==$?(q=s.jsxs(Fe,{children:[A,$]}),e[55]=A,e[56]=$,e[57]=q):q=e[57];let H;e[58]!==p||e[59]!==q?(H=s.jsx(Le,{open:p,onOpenChange:a,children:q}),e[58]=p,e[59]=q,e[60]=H):H=e[60];const D=!d;let M;e[61]!==D?(M=s.jsx(vs,{enabled:D}),e[61]=D,e[62]=M):M=e[62];let k;e[63]!==f||e[64]!==t?(k=f?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(ft,{})]}):null,e[63]=f,e[64]=t,e[65]=k):k=e[65];let F;e[66]!==g||e[67]!==H||e[68]!==M||e[69]!==k?(F=s.jsx(Ne,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[g,H,M,k]})}),e[66]=g,e[67]=H,e[68]=M,e[69]=k,e[70]=F):F=e[70];let B;return e[71]!==F||e[72]!==y?(B=s.jsx(ae,{title:y,children:F}),e[71]=F,e[72]=y,e[73]=B):B=e[73],B}function js(e){return e.providerId==="deco"}var He="Progress",ze=100,[ys]=bt(He),[Ns,Ss]=ys(He),pt=X.forwardRef((e,t)=>{const{__scopeProgress:i,value:n=null,max:o,getValueLabel:r=Cs,...c}=e;(o||o===0)&&!Ye(o)&&console.error(Ps(`${o}`,"Progress"));const l=Ye(o)?o:ze;n!==null&&!We(n,l)&&console.error(_s(`${n}`,"Progress"));const d=We(n,l)?n:null,f=we(d)?r(d,l):void 0;return s.jsx(Ns,{scope:i,value:d,max:l,children:s.jsx(nt.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":we(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":ht(d,l),"data-value":d??void 0,"data-max":l,...c,ref:t})})});pt.displayName=He;var gt="ProgressIndicator",xt=X.forwardRef((e,t)=>{const{__scopeProgress:i,...n}=e,o=Ss(gt,i);return s.jsx(nt.div,{"data-state":ht(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...n,ref:t})});xt.displayName=gt;function Cs(e,t){return`${Math.round(e/t*100)}%`}function ht(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function we(e){return typeof e=="number"}function Ye(e){return we(e)&&!isNaN(e)&&e>0}function We(e,t){return we(e)&&!isNaN(e)&&e<=t&&e>=0}function Ps(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ze}\`.`}function _s(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 ${ze} 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,aH as d}from"./index-
|
|
1
|
+
import{c as n,l as o,j as c,aH as d}from"./index-DOUQg0zs.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,bf as w,r as i,bm as m,di as T,aw as O,bp as M,bg as I,bh as z,bl as A,dj as D,bi as F,dd as L,bF as k,bj as G,bk as H,c as n,l as p,az as v}from"./index-
|
|
1
|
+
import{j as r,bf as w,r as i,bm as m,di as T,aw as O,bp as M,bg as I,bh as z,bl as A,dj as D,bi as F,dd as L,bF as k,bj as G,bk as H,c as n,l as p,az as v}from"./index-DOUQg0zs.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-_zTIyETq.js → analytics-sections-NWp6rhOY.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as L,c as N,j as s,b as E}from"./index-
|
|
1
|
+
import{r as L,c as N,j as s,b as E}from"./index-DOUQg0zs.js";import{b as D,c as M,d as F,C as I,a as A}from"./chart--RpICNYa.js";import{T as B,a as H,b as _,c as K,d as U,e as z}from"./table-Cy6wqXdI.js";import{a0 as P,a1 as V,C as W,Y as X}from"./CartesianChart-8kSi455A.js";import{L as Y}from"./Line-BbDeyom9.js";import{X as G}from"./XAxis-BpGOrC5z.js";var q=["axis"],J=L.forwardRef((r,e)=>L.createElement(P,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:q,tooltipPayloadSearcher:V,categoricalChartProps:r,ref:e}));const v=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"];function R(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 O(r,e){return r===null||Number.isNaN(r)?"—":e==="s"?R(r):e==="%"?`${r}%`:e==="USD"?`$${r.toFixed(2)}`:r.toLocaleString()}function Q(r){const e=N.c(4),{section:t}=r;let o;e[0]!==t.values?(o=t.values.map(Z),e[0]=t.values,e[1]=o):o=e[1];let a;return e[2]!==o?(a=s.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:o}),e[2]=o,e[3]=a):a=e[3],a}function Z(r){return s.jsxs("div",{className:"rounded-lg border border-border p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:r.label}),s.jsx("div",{className:"mt-1 text-2xl font-medium text-foreground tabular-nums",children:O(r.value,r.unit)})]},r.label)}function ee(r){return Array.from(new Set(r.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function te(r){const e=N.c(30),{section:t}=r,o=ee(t.points),a=Object.fromEntries(o.map(ne));let n;e[0]!==t.points?(n=t.points.map(se),e[0]=t.points,e[1]=n):n=e[1];const l=n,c=E();if(l.length===0){let m;e[2]!==c?(m=c("taskBoard.analytics.noDataInRange"),e[2]=c,e[3]=m):m=e[3];let T;return e[4]!==m?(T=s.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:m}),e[4]=m,e[5]=T):T=e[5],T}const d=F,x="img",p=t.title,b="h-64 w-full",g=J;let i,f;e[6]===Symbol.for("react.memo_cache_sentinel")?(i={left:0,right:8,top:8,bottom:8},f=s.jsx(W,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[6]=i,e[7]=f):(i=e[6],f=e[7]);let j;e[8]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(G,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)"},interval:"preserveStartEnd",tickMargin:8}),e[8]=j):j=e[8];let h;e[9]===Symbol.for("react.memo_cache_sentinel")?(h={fontSize:11,fill:"var(--muted-foreground)"},e[9]=h):h=e[9];let u;e[10]!==t.unit?(u=s.jsx(X,{axisLine:!1,tickLine:!1,tick:h,tickFormatter:m=>t.unit==="s"?R(m):String(m),width:48}),e[10]=t.unit,e[11]=u):u=e[11];let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k={stroke:"var(--border)",strokeDasharray:"4 4"},e[12]=k):k=e[12];let S;e[13]!==t.unit?(S=s.jsx(I,{cursor:k,content:s.jsx(A,{formatter:m=>O(Number(m),t.unit??void 0)})}),e[13]=t.unit,e[14]=S):S=e[14];const w=o.length>1&&s.jsx(D,{content:s.jsx(M,{})}),$=o.map(re);let C;e[15]!==g||e[16]!==l||e[17]!==S||e[18]!==w||e[19]!==$||e[20]!==i||e[21]!==f||e[22]!==j||e[23]!==u?(C=s.jsxs(g,{data:l,margin:i,children:[f,j,u,S,w,$]}),e[15]=g,e[16]=l,e[17]=S,e[18]=w,e[19]=$,e[20]=i,e[21]=f,e[22]=j,e[23]=u,e[24]=C):C=e[24];let y;return e[25]!==d||e[26]!==a||e[27]!==t.title||e[28]!==C?(y=s.jsx(d,{role:x,"aria-label":p,className:b,config:a,children:C}),e[25]=d,e[26]=a,e[27]=t.title,e[28]=C,e[29]=y):y=e[29],y}function re(r,e){return s.jsx(Y,{type:"linear",dataKey:r,stroke:v[e%v.length],strokeWidth:2,dot:!1,activeDot:{r:4,stroke:"var(--background)",strokeWidth:2},animationDuration:300},r)}function se(r){return{...r,label:String(r.t??"").slice(0,10)}}function ne(r,e){return[r,{label:r,color:v[e%v.length]}]}function ae(r,e){return`/${encodeURIComponent(r)}/${encodeURIComponent(e)}`}function oe(r){const e=N.c(28),{section:t,threadLinks:o}=r,a=E(),n=t.columns.indexOf("Org");let l;e[0]!==n||e[1]!==t.columns||e[2]!==o?(l=o&&n>=0?t.columns.indexOf("Thread"):-1,e[0]=n,e[1]=t.columns,e[2]=o,e[3]=l):l=e[3];const c=l;if(t.rows.length===0){let i;e[4]!==a?(i=a("taskBoard.analytics.nothingToShow"),e[4]=a,e[5]=i):i=e[5];let f;return e[6]!==i?(f=s.jsx("div",{className:"rounded-lg border border-border p-8 text-center text-sm text-muted-foreground",children:i}),e[6]=i,e[7]=f):f=e[7],f}let d;e[8]!==t.columns?(d=t.columns.map(ie),e[8]=t.columns,e[9]=d):d=e[9];let x;e[10]!==d?(x=s.jsx(H,{children:s.jsx(_,{children:d})}),e[10]=d,e[11]=x):x=e[11];let p;if(e[12]!==n||e[13]!==t.columns||e[14]!==t.rows||e[15]!==t.title||e[16]!==c){let i;e[18]!==n||e[19]!==t.columns||e[20]!==t.title||e[21]!==c?(i=(f,j)=>s.jsx(_,{children:f.map((h,u)=>s.jsx(K,{className:"max-w-md truncate text-sm tabular-nums",children:h===null?"—":u===c?s.jsx("a",{href:ae(String(f[n]),String(h)),target:"_blank",rel:"noreferrer",className:"text-primary underline-offset-2 hover:underline",children:String(h)}):String(h)},t.columns[u]??String(u)))},`${t.title}-${j}`),e[18]=n,e[19]=t.columns,e[20]=t.title,e[21]=c,e[22]=i):i=e[22],p=t.rows.map(i),e[12]=n,e[13]=t.columns,e[14]=t.rows,e[15]=t.title,e[16]=c,e[17]=p}else p=e[17];let b;e[23]!==p?(b=s.jsx(U,{children:p}),e[23]=p,e[24]=b):b=e[24];let g;return e[25]!==x||e[26]!==b?(g=s.jsx("div",{className:"overflow-x-auto rounded-lg border border-border",children:s.jsxs(z,{children:[x,b]})}),e[25]=x,e[26]=b,e[27]=g):g=e[27],g}function ie(r){return s.jsx(B,{className:"whitespace-nowrap",children:r},r)}function he(r){const e=N.c(14),{section:t,threadLinks:o}=r;let a;e[0]!==t.title?(a=s.jsx("h3",{className:"text-sm font-medium text-foreground",children:t.title}),e[0]=t.title,e[1]=a):a=e[1];let n;e[2]!==t?(n=t.kind==="stat"&&s.jsx(Q,{section:t}),e[2]=t,e[3]=n):n=e[3];let l;e[4]!==t?(l=t.kind==="series"&&s.jsx(te,{section:t}),e[4]=t,e[5]=l):l=e[5];let c;e[6]!==t||e[7]!==o?(c=t.kind==="table"&&s.jsx(oe,{section:t,threadLinks:o}),e[6]=t,e[7]=o,e[8]=c):c=e[8];let d;return e[9]!==a||e[10]!==n||e[11]!==l||e[12]!==c?(d=s.jsxs("section",{className:"flex flex-col gap-3",children:[a,n,l,c]}),e[9]=a,e[10]=n,e[11]=l,e[12]=c,e[13]=d):d=e[13],d}export{he as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o,j as r}from"./index-DOUQg0zs.js";import{O as m}from"./api-keys-DHtUJ4Tp.js";import{R as p}from"./require-capability-D3ZFNPjS.js";import"./AlertCircle-Bt4fa9oZ.js";import"./Copy01-DIV9jah9.js";import"./Key01-1FHVDeLv.js";import"./Plus-DhmMzSv0.js";import"./Trash01-BIa5uuJe.js";import"./alert-dialog-C8wYJe4o.js";import"./dialog-C-xWJ6aR.js";import"./X-8qFfssY9.js";import"./input-D50iAX6q.js";import"./label-BUdIq7o0.js";import"./use-mcp-client-DxHrE3Rr.js";import"./auth-Brm-gMyA.js";import"./access-gate-SUsdf2_J.js";import"./capability-load-error-C7wIGk2k.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,X as Q,z as R,K as Y,m as ce,o as J,e as U,j as i,fH as de,b as F,r as O,ec as me,e_ as X,B as v,t as q}from"./index-BiuSAlzd.js";import{i as fe}from"./AlertCircle-DDHQi3fm.js";import{a as ue}from"./Copy01-DluK-JtU.js";import{i as V}from"./Key01-DXvy1NNO.js";import{s as W}from"./Plus-DjsQQqpw.js";import{s as ge}from"./Trash01-BfnCKCGB.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-D9wz_Poi.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-C9YQM7Rb.js";import{I as le}from"./input-B5d33h6X.js";import{L as De}from"./label-BmSaj4OS.js";import{u as H}from"./use-mcp-client-5sJCC1_2.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();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 M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(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(V,{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 _e(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(V,{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(W,{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 we(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 _;e[35]!==s?(_=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=_):_=e[36];let w;e[37]!==o.isPending||e[38]!==m||e[39]!==_?(w=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:_}),e[37]=o.isPending,e[38]=m,e[39]=_,e[40]=w):w=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]!==w||e[51]!==T?(k=i.jsxs(se,{children:[w,T]}),e[50]=w,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(W,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(X,{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(_e,{onCreate:()=>n(!0)}):i.jsx(X,{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(we,{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 Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
1
|
+
import{c as A,X as Q,z as R,K as Y,m as ce,o as J,e as U,j as i,fH as de,b as F,r as O,ec as me,e_ as X,B as v,t as q}from"./index-DOUQg0zs.js";import{i as fe}from"./AlertCircle-Bt4fa9oZ.js";import{a as ue}from"./Copy01-DIV9jah9.js";import{i as V}from"./Key01-1FHVDeLv.js";import{s as W}from"./Plus-DhmMzSv0.js";import{s as ge}from"./Trash01-BIa5uuJe.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-C8wYJe4o.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-C-xWJ6aR.js";import{I as le}from"./input-D50iAX6q.js";import{L as De}from"./label-BUdIq7o0.js";import{u as H}from"./use-mcp-client-DxHrE3Rr.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();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 M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=J();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],U(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(V,{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 _e(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(V,{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(W,{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 we(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 _;e[35]!==s?(_=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=_):_=e[36];let w;e[37]!==o.isPending||e[38]!==m||e[39]!==_?(w=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:_}),e[37]=o.isPending,e[38]=m,e[39]=_,e[40]=w):w=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]!==w||e[51]!==T?(k=i.jsxs(se,{children:[w,T]}),e[50]=w,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(W,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(X,{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(_e,{onCreate:()=>n(!0)}):i.jsx(X,{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(we,{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 Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as jt,b as Bt,r as A,j as o,ak as wt,l as _t,h as At,t as ht}from"./index-DOUQg0zs.js";import{u as Et}from"./chat-context-B0osA6sP.js";import{S as Nt}from"./scroll-area-DsfPpJuI.js";import{u as Rt,A as Tt}from"./use-section-preview-base-BSe-vK8M.js";import{x as Ct}from"./claim-phase-copy-DnyF-TXo.js";import{j as Kt,u as Pt,w as Ft,ap as Ot,x as Ut,d as $t,aq as It}from"./runnable-block-editor-B392Ez37.js";import{n as qt,r as zt}from"./agent-site-editor-content-DhEurSUX.js";import"./use-panel-navigate-Bel1nQM_.js";import"./thread-route-DFAxA-J4.js";import"./use-project-scope-Bq2SyzJ7.js";import"./repository-binding-DosYHiTz.js";import"./use-mcp-client-DxHrE3Rr.js";import"./auth-Brm-gMyA.js";import"./autosend-Cfg7z5wQ.js";import"./thread-intent-DC7irtdr.js";import"./backoff-8mStPHYB.js";import"./task-board-DXXLrHdX.js";import"./schema-DpPC83dn.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-Cz3bQ8e4.js";import"./use-ai-providers-CGavfYZY.js";import"./location-DPIrGNp7.js";import"./use-organization-settings-BIE-soL2.js";import"./select-BgR8S5Ol.js";import"./index-CbcEBCnU.js";import"./Check-CBF8eTgr.js";import"./ChevronUp-MXpj0fOa.js";import"./UserSquare-DlqsIDkY.js";import"./agent-icon-Cj_JL7Bp.js";import"./AlertCircle-Bt4fa9oZ.js";import"./Tool01-wjHS3MbM.js";import"./ArrowUp-BDvnBzdl.js";import"./ArrowLeft-BheW9nUA.js";import"./LinkBroken01-Dao_xEQ2.js";import"./ShoppingBag01-lkT9atzh.js";import"./ZoomOut-uHj4ZFa9.js";import"./Building02-CrNedMIl.js";import"./CheckCircle-DYG4Bhna.js";import"./Copy01-DIV9jah9.js";import"./CreditCard01-J7tCMEH-.js";import"./DotsVertical-C8Ab5pHT.js";import"./Image01-BWtlQPQv.js";import"./Palette-Dzi-BJNB.js";import"./XClose-D0tJKCTL.js";import"./Key01-1FHVDeLv.js";import"./Link01-LJd6RIv6.js";import"./LinkExternal01-CE1iCUGk.js";import"./Monitor01-CF2sOSMh.js";import"./Sun-D4-5PMzV.js";import"./Plus-DhmMzSv0.js";import"./SearchMd-wnWyoFfY.js";import"./Trash01-BIa5uuJe.js";import"./Upload01-BRb6jPtu.js";import"./User01-C-57a8l-.js";import"./Users01-DjN8O7F9.js";import"./X-8qFfssY9.js";import"./dialog-C-xWJ6aR.js";import"./input-D50iAX6q.js";import"./use-new-blocks-editor-DjNIilkA.js";import"./section-preview-url-7zfngvgW.js";import"./use-session-runtime-C87mS0mi.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BeuuAyaq.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-BLETQOpG.js";import"./use-copy-D3sInWhT.js";import"./usage-stats-C8ortjqB.js";import"./markdown-fiMoFDPr.js";import"./org-file-open-context-X82KWGO1.js";import"./use-mobile-BMPXLE4o.js";import"./tooltip-C72eCv1P.js";import"./use-clock-tick-DZAgHMn_.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BS7Oo6Wc.js";import"./types-zHVY6Tj3.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-CBkpmomK.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./shell-layout-CwEcxoBa.js";import"./avatar-Dv4UhAF7.js";import"./download-app-dialog-BXy5zLzA.js";import"./command-bXSj8Nsv.js";import"./index-nJb8KXrZ.js";import"./integration-icon-CFKk2v6k.js";import"./project-icon-BB6zDLc7.js";import"./new-project-dialog-CuzcCfvd.js";import"./label-BUdIq7o0.js";import"./repository-import-picker-CMKxpeps.js";import"./use-navigate-to-agent-BE5yz9rb.js";import"./repository-picker-BFG56pB0.js";import"./useInfiniteQuery-DjkTQ_ZO.js";import"./infiniteQueryObserver-BswUx1p7.js";import"./collection-search-FGpxBvyM.js";import"./use-debounced-value-BTFdSSe8.js";import"./required-auth-layout-Dw5Q6vUD.js";import"./use-org-sso-COQLixR1.js";import"./sheet-Dw4T_Oj6.js";import"./use-connection-XeQWn4zm.js";import"./use-mcp-prompts-DU7C7-5Z.js";import"./index-cNLRiAuc.js";import"./form-w94NTkmi.js";import"./use-thread-outputs-uR6cqbM3.js";import"./file-type-icon-azNQ7Sbi.js";import"./popover-DBD2mXa7.js";import"./utils-Du6joti1.js";import"./monaco-editor-D-mRW-h5.js";import"./editor-BIv-wzoI.js";import"./calendar-B6k2OCPY.js";import"./textarea-DAcjiPhN.js";import"./rich-text-link-control-DFjq1r5L.js";import"./switch-BedRbAFv.js";import"./combobox-Ccg5zawX.js";import"./alert-dialog-C8wYJe4o.js";import"./sandbox-url-D3mC8qhT.js";import"./search-input-BdccUqIq.js";import"./tabs-JL7K3W91.js";import"./use-file-configs-Cza42elA.js";import"./asset-utils-9qybAQv4.js";import"./use-chat-layout-state-BGxl2b5e.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-1JsQ4ux4.js";import"./sandbox-git-api-B1R0585s.js";import"./agent-view-guard-DZjyKtcC.js";import"./use-main-panel-tabs-CtSJnbbX.js";import"./use-mcp-tools-Fmvnhe6I.js";import"./index-B781YAMw.js";import"./drawer-tgIYd8-D.js";import"./input-eibCtW0T.js";import"./chat-draft-CcOLHfwY.js";import"./use-deco-credits-B3RmRZk5.js";import"./use-open-billing-url-BDx40jcR.js";import"./decopilot-B0A58oJ1.js";import"./checkbox-DIhZR311.js";import"./ai-providers-logos-DD3qZ33J.js";import"./index-D_pCak2Z.js";import"./input-DRiV2Ltl.js";import"./suggestion-c13g4aGt.js";import"./use-org-fs-9ZCJX1Pw.js";import"./question-004-sINsf4GQ.js";import"./use-members-BM4kPqAt.js";import"./use-org-auth-client-DSqDjigp.js";import"./feature-paywall-Cq59U-JE.js";import"./plan-ladder-CrScgxpw.js";import"./add-connection-dialog-ClOsCM_8.js";import"./extract-connection-data-BX994cXq.js";import"./metadata-D72DunRR.js";import"./connection-CgrAKzVV.js";import"./connection-card-BKpKctgB.js";import"./connection-slug-CITJ0kGN.js";import"./connection-form-helpers-B85N_qO1.js";import"./authenticate-and-persist-oauth-CorzXjLa.js";import"./mcp-oauth-BH-DbyuT.js";import"./collection-tabs-rowwnfZs.js";import"./badge-DkpauCB5.js";import"./use-infinite-scroll-DYwoZ41l.js";import"./useSuspenseInfiniteQuery-C9-3JUor.js";import"./use-task-board-events-CedfI1XO.js";import"./sandbox-lifecycle-context-Bb3Zpd8z.js";import"./resolve-tab-icon-BKs1-fnC.js";import"./use-task-metadata-Dwwzepbk.js";import"./virtual-mcp-DMkc4BYn.js";import"./feature-gate-dmtOOeE4.js";import"./mustache-QA0lqGO8.js";import"./empty-state-B0BLTCaP.js";import"./empty-state-DqT8bOq1.js";function Lt(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",s=qt(t,i);return{blockKey:s,data:{__resolveType:n.resolveType,name:s}}}function Xr(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:s,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=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]!==Z||t[4]!==a||t[5]!==v?(R=zt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Ct(p,x,a):p);let C;t[9]!==s||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:s},t[9]=s,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Kt(C);let K;t[13]!==s||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:s},t[13]=s,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=Pt(K);let P;t[17]!==S?(P=$t((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(p),[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!==p&&(St(p),ut(null),ft(Mt),xt([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const rt=U;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let $;t[24]!==rt||t[25]!==y?($={...rt,...y},t[24]=rt,t[25]=y,t[26]=$):$=t[26];const it=$;let I;t[27]!==p||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let q;t[31]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{xt(e)},t[31]=q):q=t[31];const E=q;let z;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(z=async(e,r)=>{try{const{blockKey:u,data:f}=Lt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=z):z=t[36];const k=z;let L;t[37]!==d?(L=e=>{O.current=e.append,d(!0)},t[37]=d,t[38]=L):L=t[38];const st=L;let V;t[39]!==k||t[40]!==d?(V=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]=V):V=t[41];const pt=V,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(Vt)},title:f,className:_t("min-w-0 truncate 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]!==W?(j=o.jsx(It,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let w;t[47]!==p||t[48]!==s||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==st||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(w=o.jsx(Nt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(Ut,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:st,sandbox:{orgSlug:m,virtualMcpId:i,branch:s,threadId:G}},`${p}:${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]=p,t[48]=s,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=st,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=w):w=t[67];let _;t[68]!==ot||t[69]!==l||t[70]!==pt||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=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=_):_=t[74];let M;return t[75]!==B||t[76]!==w||t[77]!==_?(M=o.jsxs("div",{className:gt,children:[B,w,_]}),t[75]=B,t[76]=w,t[77]=_,t[78]=M):M=t[78],M}function Vt(n){return n+1}function Mt(n){return n+1}export{Xr as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,X as d,e as g,a2 as m,K as I,o as O}from"./index-
|
|
1
|
+
import{c as u,X as d,e as g,a2 as m,K as I,o as O}from"./index-DOUQg0zs.js";import{u as $}from"./useInfiniteQuery-DjkTQ_ZO.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{aX as $,aY as v,aZ as W,a_ as H,a$ as D,b0 as y,b1 as V,b2 as x,b3 as L,b4 as q,b5 as j,b6 as N,b7 as B,b8 as Z,b9 as F}from"./index-BiuSAlzd.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 X(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 K(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":Q(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 Q(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=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 P(c,{fetchFn:i}),!o)try{o=await T(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 T(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??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(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 P(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 b(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=X(r,h);K(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(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=b(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=b(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
|
|
1
|
+
import{aX as $,aY as v,aZ as W,a_ as H,a$ as D,b0 as y,b1 as V,b2 as x,b3 as L,b4 as q,b5 as j,b6 as N,b7 as B,b8 as Z,b9 as F}from"./index-DOUQg0zs.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 X(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 K(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":Q(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 Q(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=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 P(c,{fetchFn:i}),!o)try{o=await T(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 T(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??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(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 P(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 b(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=X(r,h);K(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(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=b(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=b(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return j.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T 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-DOUQg0zs.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};
|