decocms 3.97.5 → 3.97.6
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-BY01IebW.js → AlertCircle-fJcOtdPg.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-CrNpVXJQ.js → ArrowUpRight-CrqD-eAO.js} +1 -1
- package/dist/client/assets/{CheckCircle-UPyj94ce.js → CheckCircle-MeJbRt1q.js} +1 -1
- package/dist/client/assets/{ChevronDown-DuS1gosF.js → ChevronDown-pn1meT8d.js} +1 -1
- package/dist/client/assets/{ChevronLeft-DNoBDBkQ.js → ChevronLeft-CK9mz_lA.js} +1 -1
- package/dist/client/assets/{ChevronRight-DUYBaJAA.js → ChevronRight-DkLBQXIZ.js} +1 -1
- package/dist/client/assets/{ChevronUp-Bj5wnP8v.js → ChevronUp-D_sqWanb.js} +1 -1
- package/dist/client/assets/{DotsVertical-BoWHOZg-.js → DotsVertical-CFX5mHy_.js} +1 -1
- package/dist/client/assets/{Eye-BN8eZd3q.js → Eye-DSxffwpX.js} +1 -1
- package/dist/client/assets/{FilterLines-BcDA53T2.js → FilterLines-BfGXNoDf.js} +1 -1
- package/dist/client/assets/{Globe01-CtRTi-q3.js → Globe01-BE6-Vhn-.js} +1 -1
- package/dist/client/assets/{Globe04-DcqSH090.js → Globe04-ClAPc8QV.js} +1 -1
- package/dist/client/assets/{HardDrive-LcockCRx.js → HardDrive-C_5bQN2s.js} +1 -1
- package/dist/client/assets/{Key01-BcXniqTr.js → Key01-BEdNDv5D.js} +1 -1
- package/dist/client/assets/{LayoutLeft-DIu4qlvA.js → LayoutLeft-xN92xt-k.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dyt9zIKA.js → LinkExternal01-DtMdLshW.js} +1 -1
- package/dist/client/assets/{Monitor01-BY0WhsQY.js → Monitor01-BxZlH4vE.js} +1 -1
- package/dist/client/assets/{Palette-D0tFYq6o.js → Palette-tvgJAmq5.js} +1 -1
- package/dist/client/assets/{Play-Ds_dyiCJ.js → Play-QNolhpYo.js} +1 -1
- package/dist/client/assets/{Plus-CXJQYPWf.js → Plus-BdYkovF2.js} +1 -1
- package/dist/client/assets/{SearchMd--1Uwo-4h.js → SearchMd-3nngg6Ks.js} +1 -1
- package/dist/client/assets/{Settings02-Qog-9BW9.js → Settings02-O2mlkc2j.js} +1 -1
- package/dist/client/assets/{Shield01-BjGAptDu.js → Shield01-D0p_z1Rh.js} +1 -1
- package/dist/client/assets/{Star01-BNPre7m8.js → Star01-CVDxujLg.js} +1 -1
- package/dist/client/assets/{Stars01-CUSSCI6Q.js → Stars01-NhcGkHTz.js} +1 -1
- package/dist/client/assets/{Stars02--YU8wF8-.js → Stars02-D1Mwhwxh.js} +1 -1
- package/dist/client/assets/{Sun-DF1tmwEc.js → Sun-BzZB8rLL.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-C-d9B1Pc.js → SwitchHorizontal01-CmA6k3Gw.js} +1 -1
- package/dist/client/assets/{Tool01-Cbity1uu.js → Tool01-Ck1tGOLa.js} +1 -1
- package/dist/client/assets/{Trash01-Csom-OmK.js → Trash01-C1jDkITE.js} +1 -1
- package/dist/client/assets/{Upload01-BKLWvYK3.js → Upload01-aLxa_7qU.js} +1 -1
- package/dist/client/assets/{User01-rB66Yp8m.js → User01-l2zA0L_A.js} +1 -1
- package/dist/client/assets/{Users01-CSjiAX-B.js → Users01-CtlXU5tT.js} +1 -1
- package/dist/client/assets/{Users03-CzMI4hYk.js → Users03-BsjGrVdp.js} +1 -1
- package/dist/client/assets/{X-C23kraKx.js → X-8uKw4TRo.js} +1 -1
- package/dist/client/assets/{XCircle-DAQ6sXs1.js → XCircle-BmHlL-Zi.js} +1 -1
- package/dist/client/assets/{XClose-CD3EJbwD.js → XClose-MzbQnLCs.js} +1 -1
- package/dist/client/assets/{Zap-BKA-au81.js → Zap-BTyMjGbn.js} +1 -1
- package/dist/client/assets/{ZapSquare-JpoS_XnR.js → ZapSquare-3iu7JN55.js} +1 -1
- package/dist/client/assets/{ZoomOut-B5vLZpoX.js → ZoomOut-CYXoJJk1.js} +1 -1
- package/dist/client/assets/{access-gate-hq7UmdZv.js → access-gate-bI6nuQ5T.js} +1 -1
- package/dist/client/assets/{add-section-modal-DPGYUmmW.js → add-section-modal-BIzdQ3Jk.js} +1 -1
- package/dist/client/assets/{agent-icon-B_lvSp90.js → agent-icon-DFvaJiDY.js} +1 -1
- package/dist/client/assets/{agents-list-BuiqFvDD.js → agents-list-C3qeGqX8.js} +1 -1
- package/dist/client/assets/{ai-providers-igMP4uEw.js → ai-providers-BkFo9nQy.js} +1 -1
- package/dist/client/assets/{alert-dialog-CsikfeuV.js → alert-dialog-C6EVgeBX.js} +1 -1
- package/dist/client/assets/{alert-B6tz0cqs.js → alert-qtwSyUZJ.js} +1 -1
- package/dist/client/assets/{app-editor-DA7fDqIP.js → app-editor-BEK4yQ_A.js} +1 -1
- package/dist/client/assets/{auth-CdNUf-u6.js → auth-Cal4T12d.js} +1 -1
- package/dist/client/assets/{auth-catchall-DTkC1khj.js → auth-catchall-FB-wZz9s.js} +1 -1
- package/dist/client/assets/{auth-entry-ChKD6XAl.js → auth-entry-BdIkAdSG.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CUgDVzOC.js → auth-split-layout-BsQ4TGuC.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B-HUI4Rh.js → authenticate-and-persist-oauth-BZc7Ted8.js} +1 -1
- package/dist/client/assets/{automation-list-row-DqslLX8-.js → automation-list-row-DG7qfwQf.js} +1 -1
- package/dist/client/assets/{automation-runs-C-ImxLWq.js → automation-runs-DtNrxAp4.js} +1 -1
- package/dist/client/assets/{automations-BIUDKFSY.js → automations-BNj6PofQ.js} +1 -1
- package/dist/client/assets/{avatar-CjYG3-98.js → avatar-CwOaN9pX.js} +1 -1
- package/dist/client/assets/{badge-yqmEwWNw.js → badge-DGKSOBGC.js} +1 -1
- package/dist/client/assets/{block-document-Ddmw8MXB.js → block-document-D3IORjt-.js} +1 -1
- package/dist/client/assets/{brand-context-b43I5gSL.js → brand-context-gr2Kz8zt.js} +1 -1
- package/dist/client/assets/{buckets-dtFdBXmS.js → buckets-B2oo94iU.js} +1 -1
- package/dist/client/assets/{capability-load-error-CFrsagBh.js → capability-load-error-D4a3b5Uc.js} +1 -1
- package/dist/client/assets/{card-CZci2Ked.js → card-BT_nUMTM.js} +1 -1
- package/dist/client/assets/{category-editor-CufMmbEd.js → category-editor-BxcuFYi3.js} +1 -1
- package/dist/client/assets/{chat-context-hue9xev7.js → chat-context-COWNKjf7.js} +1 -1
- package/dist/client/assets/{checkbox-CnyL8XHl.js → checkbox-CHhzhSXJ.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DEWC2vv9.js → cli-auth-success-54eeF86z.js} +1 -1
- package/dist/client/assets/{collection-detail-BmiSLLei.js → collection-detail-CqMXAIhp.js} +1 -1
- package/dist/client/assets/{collection-display-button-DA3BZFv2.js → collection-display-button-wARffpUM.js} +1 -1
- package/dist/client/assets/{collection-search-BaiviTLW.js → collection-search-BFQ4OhXe.js} +1 -1
- package/dist/client/assets/{collection-tabs-gJzAs0-U.js → collection-tabs-BAyt72oR.js} +1 -1
- package/dist/client/assets/{command-BtIUrGW9.js → command-BR9F3g1G.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-B6X46OGL.js → commerce-onboarding-BeqWQISd.js} +1 -1
- package/dist/client/assets/{connect-desktop-dialog-lLRzH9Wf.js → connect-desktop-dialog-07IWkdaH.js} +1 -1
- package/dist/client/assets/{connection-card-BvZozJYf.js → connection-card-Dl--lNJe.js} +1 -1
- package/dist/client/assets/{connection-detail--FRkiCAU.js → connection-detail-AcwFFCQy.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-BXpJ-39p.js → connection-form-helpers-BjNvSNQg.js} +1 -1
- package/dist/client/assets/{connections-B8tGIqm6.js → connections-DjDyltCI.js} +1 -1
- package/dist/client/assets/{context-menu-DdUP1nvw.js → context-menu-NIiceaiM.js} +1 -1
- package/dist/client/assets/{decopilot-D6Us63Iz.js → decopilot-hWRVkXzW.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-Cn1O82-8.js → decopilot-sse-pool-BkD5Vlqs.js} +1 -1
- package/dist/client/assets/{dialog-Djo11OZ8.js → dialog-Cyifv3G9.js} +1 -1
- package/dist/client/assets/{domain-settings-Qv_TUecy.js → domain-settings-CkXzInCJ.js} +1 -1
- package/dist/client/assets/{drawer-CGy7XhOb.js → drawer-JGISYavf.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CuiF-07J.js → dropdown-menu-BJVltTV3.js} +1 -1
- package/dist/client/assets/{empty-state-CFMrMwNK.js → empty-state-DnQZ-XhB.js} +1 -1
- package/dist/client/assets/{extract-connection-data-HZVgcUqH.js → extract-connection-data-Bq3lwCXC.js} +1 -1
- package/dist/client/assets/{file-explorer-d1r4yEtA.js → file-explorer-jRMynDw8.js} +1 -1
- package/dist/client/assets/{file-type-icon-9Eew51_j.js → file-type-icon-Dv84qEA9.js} +1 -1
- package/dist/client/assets/{files-BX2R4Hdg.js → files-r5omO6Th.js} +1 -1
- package/dist/client/assets/{form-Bws9hvDL.js → form-DWQLeODh.js} +1 -1
- package/dist/client/assets/{general-BfDLAR84.js → general-CSTYHVNl.js} +1 -1
- package/dist/client/assets/{github-repo-picker-DgsWIyrn.js → github-repo-picker-H0oT363r.js} +1 -1
- package/dist/client/assets/{hooks-BFhhtb2P.js → hooks-DQcMNMU9.js} +1 -1
- package/dist/client/assets/{import-from-deco-dialog-B_FF9twl.js → import-from-deco-dialog-Djhp-jTF.js} +1 -1
- package/dist/client/assets/{index-CM09tGUK.js → index-5WweUe2_.js} +1 -1
- package/dist/client/assets/{index-BwVMeD3q.js → index-BHn6e0Se.js} +3 -3
- package/dist/client/assets/{index-zLeBpb-e.js → index-BMT2Fr2d.js} +1 -1
- package/dist/client/assets/{index-Cyi-U3f4.js → index-Bjcx3nRG.js} +1 -1
- package/dist/client/assets/{index-CxFZHubh.js → index-BkiBNOb3.js} +25 -25
- package/dist/client/assets/{index-Cb0xFHoO.js → index-Bs46DU41.js} +1 -1
- package/dist/client/assets/{index-Bbr4phoV.js → index-CIxivSGi.js} +1 -1
- package/dist/client/assets/{index-CNHawUWP.js → index-DJINNu9L.js} +1 -1
- package/dist/client/assets/{index-C5p4XFGO.js → index-DN3DrlLQ.js} +1 -1
- package/dist/client/assets/{index-D6bagO5K.js → index-DZvELjVm.js} +1 -1
- package/dist/client/assets/{index-Bfc1Ah6s.js → index-EfvpxM9b.js} +1 -1
- package/dist/client/assets/{index-DgHQzdnZ.js → index-IIHfSSHd.js} +1 -1
- package/dist/client/assets/index-ezx837e_.js +1 -0
- package/dist/client/assets/{index-redirect-CEK3pBZ_.js → index-redirect-CdRbbveI.js} +1 -1
- package/dist/client/assets/{index-BQpSQsx-.js → index-uucvgtdd.js} +1 -1
- package/dist/client/assets/{input-C8pdmexi.js → input-B-Pb-iQx.js} +1 -1
- package/dist/client/assets/{integration-icon-BYt__tsS.js → integration-icon-BYmEZGh5.js} +1 -1
- package/dist/client/assets/{label-6fUzynqC.js → label-Dc1p-WMs.js} +1 -1
- package/dist/client/assets/{login-RzsGUcw2.js → login-hIHZKaLN.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DOYfP2o1.js → mcp-oauth-CQkaDVAB.js} +1 -1
- package/dist/client/assets/{members-C8QsS2ME.js → members-CwGKFfd8.js} +1 -1
- package/dist/client/assets/{monaco-editor-DGlh_VCI.js → monaco-editor-HPIYbtKC.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-tBQqJwnX.js → monitoring-stats-row-Cp0dQQPp.js} +1 -1
- package/dist/client/assets/{oauth-callback-C7HO5sjA.js → oauth-callback-S9pNiita.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-C2ZKRasi.js → oauth-callback-ai-provider-Bn-jrGFP.js} +1 -1
- package/dist/client/assets/{onboarding-Pxz11AYs.js → onboarding-D-XkA1WF.js} +1 -1
- package/dist/client/assets/{org-install-Fk_fo4EG.js → org-install-BlQqrlG1.js} +1 -1
- package/dist/client/assets/{org-layout-BYDLh4Da.js → org-layout-DcKJCuet.js} +1 -1
- package/dist/client/assets/{organization-choice-D91Z6ihZ.js → organization-choice-xM7kJrun.js} +1 -1
- package/dist/client/assets/{page-seo-form-Dw_-ajyz.js → page-seo-form-Co-ts-e9.js} +1 -1
- package/dist/client/assets/page-seo-sheet-DzMEj-6t.js +1 -0
- package/dist/client/assets/{popover-cxXkvARj.js → popover-4qhYIUWo.js} +1 -1
- package/dist/client/assets/{post-editor-CqZVJyys.js → post-editor-m_5Acqks.js} +1 -1
- package/dist/client/assets/{preview-dialog-C1XBzik_.js → preview-dialog-Bz9c-xiV.js} +1 -1
- package/dist/client/assets/{primitives-C8RGsHih.js → primitives-Bb10pQJV.js} +1 -1
- package/dist/client/assets/{profile-RQBuJ0-C.js → profile-BBtrBCC8.js} +1 -1
- package/dist/client/assets/project-app-view-R3dJtbKa.js +1 -0
- package/dist/client/assets/record-editor-B-hdKUxj.js +1 -0
- package/dist/client/assets/registry-B_a2vIE9.js +2 -0
- package/dist/client/assets/{registry-layout-JxXagtmN.js → registry-layout-DET4-b1_.js} +1 -1
- package/dist/client/assets/{require-capability-D8wtdjJA.js → require-capability-_0uXwGU-.js} +1 -1
- package/dist/client/assets/{required-auth-layout-Bni9Lv8T.js → required-auth-layout-Crj-Dp7t.js} +1 -1
- package/dist/client/assets/{reset-password-CDD1X47u.js → reset-password-BUGjtZUo.js} +1 -1
- package/dist/client/assets/{roles-BmFGLWBQ.js → roles-BEf9Yg1v.js} +1 -1
- package/dist/client/assets/{save-status-Ap0tRvUu.js → save-status-DSRENc3i.js} +1 -1
- package/dist/client/assets/{scroll-area-BFIPKXPy.js → scroll-area-eBc0wf7v.js} +1 -1
- package/dist/client/assets/{search-input-DqD8geWF.js → search-input-DT_JKNy3.js} +1 -1
- package/dist/client/assets/{secrets-CUG9brF8.js → secrets-DGtylvlf.js} +1 -1
- package/dist/client/assets/{sections-editor-2XAp7iDT.js → sections-editor-D6yHRgfS.js} +1 -1
- package/dist/client/assets/{select-UKSqIIxL.js → select-BW0GS-sD.js} +1 -1
- package/dist/client/assets/{select-model-Duntt4sG.js → select-model-CB71JKeW.js} +1 -1
- package/dist/client/assets/{seo-editor-sJTA698t.js → seo-editor-C6M00UrO.js} +1 -1
- package/dist/client/assets/{settings-layout-D4PyBfZX.js → settings-layout-sk_Xs5v3.js} +1 -1
- package/dist/client/assets/{settings-section-uysJimh1.js → settings-section-prScMNzK.js} +1 -1
- package/dist/client/assets/{sheet-DaEm5-cm.js → sheet-BeyyimwJ.js} +1 -1
- package/dist/client/assets/{shell-controls-D-FZtlw4.js → shell-controls-Dl-Z1hcG.js} +1 -1
- package/dist/client/assets/{shell-layout-BU2Eo26M.js → shell-layout-DJkQm9ri.js} +1 -1
- package/dist/client/assets/{shell-route-loading-k31lp-sb.js → shell-route-loading-CwMHFQUh.js} +1 -1
- package/dist/client/assets/{sidebar-CDHrQeMJ.js → sidebar-Bs5hYMFZ.js} +1 -1
- package/dist/client/assets/{skeleton-CjN5A6XL.js → skeleton-DpFeLiG8.js} +1 -1
- package/dist/client/assets/{sortable.esm-DWhmpOCs.js → sortable.esm-D36A3isx.js} +1 -1
- package/dist/client/assets/{sso-CWuDaOKP.js → sso-BpeT1mQP.js} +1 -1
- package/dist/client/assets/{store-DMU35qQr.js → store-CaF9Mk93.js} +1 -1
- package/dist/client/assets/store-registry-q-E7flZt.js +2 -0
- package/dist/client/assets/{studio-tools-Cj1fBaXp.js → studio-tools-By-RAUnB.js} +1 -1
- package/dist/client/assets/{switch-BlhCItPG.js → switch-CnAdsV_e.js} +1 -1
- package/dist/client/assets/{table-Bt_fbenL.js → table-DFbId_dZ.js} +1 -1
- package/dist/client/assets/{tabs-DLLYyT_4.js → tabs-BXGI5o2r.js} +1 -1
- package/dist/client/assets/{task-status-DG_3CCeu.js → task-status-ClBLjafq.js} +1 -1
- package/dist/client/assets/{textarea-LTBnL6Dv.js → textarea-C0xG5lgY.js} +1 -1
- package/dist/client/assets/{toggle-group-DLR6cnlJ.js → toggle-group-DMtsh5NF.js} +1 -1
- package/dist/client/assets/{toolbar-BuAJdBWi.js → toolbar-Dz2F7jsm.js} +1 -1
- package/dist/client/assets/{tooltip-_TcC7QSJ.js → tooltip-DbXsqmjo.js} +1 -1
- package/dist/client/assets/{types-C9zbfwjF.js → types-CZk9_Z8c.js} +1 -1
- package/dist/client/assets/{use-ai-providers-Mmhw_1Og.js → use-ai-providers-WiPZJScZ.js} +1 -1
- package/dist/client/assets/{use-automations-Cw5ubZKL.js → use-automations-CyoUprKw.js} +1 -1
- package/dist/client/assets/{use-capability-CP1V4i_3.js → use-capability-DTqJ4XUv.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BbDdy2cM.js → use-clock-tick-B2vJyztT.js} +1 -1
- package/dist/client/assets/{use-collections-DDwKLwWC.js → use-collections-ZFJu8_05.js} +1 -1
- package/dist/client/assets/{use-connection-bj-QmeCF.js → use-connection-BXbi3G-n.js} +1 -1
- package/dist/client/assets/{use-copy-TPlwZ6aA.js → use-copy-BdLLJ_fi.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CoJdf93N.js → use-create-virtual-mcp-BuUXsiAm.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-D_Bc7lE0.js → use-debounced-autosave-HTy2hxZu.js} +1 -1
- package/dist/client/assets/{use-delete-connection-0kzxSS_1.js → use-delete-connection-CpC6odhp.js} +1 -1
- package/dist/client/assets/{use-file-configs-BumxkY1W.js → use-file-configs-B39Wbm4e.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-B0LwAHpI.js → use-infinite-scroll-By_ChSnA.js} +1 -1
- package/dist/client/assets/{use-join-requests-BVChfrSN.js → use-join-requests-Clvetl3Y.js} +1 -1
- package/dist/client/assets/{use-mcp-client-DjnQKDkF.js → use-mcp-client-BbksZMyI.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-7fCwwbYc.js → use-mcp-prompts-Cw3K78_o.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CbjkHt5p.js → use-mcp-tools-DRPCqs25.js} +1 -1
- package/dist/client/assets/{use-members-DPAHG5Sy.js → use-members-CMfXyasv.js} +1 -1
- package/dist/client/assets/{use-mobile-7oYhfh2a.js → use-mobile-D4nRxsIe.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-C1cPyWif.js → use-navigate-to-agent-BTBF1w74.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CywDmsAy.js → use-org-auth-client-BtI7VkGK.js} +1 -1
- package/dist/client/assets/{use-org-sso-BRBxUiX-.js → use-org-sso-CAx_bgC5.js} +1 -1
- package/dist/client/assets/{use-organization-roles-Bk3e4nqx.js → use-organization-roles-Db9bHG-3.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DeAexlNB.js → use-organization-settings-BwYobfuk.js} +1 -1
- package/dist/client/assets/{use-registry-connections-B0D0ZFPH.js → use-registry-connections-BldJ2nwB.js} +1 -1
- package/dist/client/assets/{use-secrets-COBbdB1z.js → use-secrets-CxKHovWg.js} +1 -1
- package/dist/client/assets/{use-status-sounds-CwxWlyu5.js → use-status-sounds-CKvsYwcO.js} +1 -1
- package/dist/client/assets/{use-view-mode-DY00qIDT.js → use-view-mode-BBopJmXj.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Bn261I3R.js → use-virtual-mcp-RUDrgBDG.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-D-zpdPgg.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-CRSha7cG.js +1 -0
- package/dist/client/assets/{useSuspenseQueries-BZYHmjMQ.js → useSuspenseQueries-DKnOs7t9.js} +1 -1
- package/dist/client/assets/{variant-calendar-Ds28F-NA.js → variant-calendar-B3GXjQEb.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-e9BSYjzY.js → view-mode-toggle-5-CmRgcL.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-BolwlNK6.js +0 -1
- package/dist/client/assets/page-seo-sheet-CFP5LBzL.js +0 -1
- package/dist/client/assets/project-app-view-BUDCdtfR.js +0 -1
- package/dist/client/assets/record-editor-x3p3WRWl.js +0 -1
- package/dist/client/assets/registry-DUN-rzpb.js +0 -2
- package/dist/client/assets/store-registry-DE3B_JjR.js +0 -2
- package/dist/client/assets/useInfiniteQuery-CbK39j5Y.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-HNqdvvLG.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as se,j as s,B as Z,D as me,r as Y,w as v,t as de}from"./index-BwVMeD3q.js";import{c as w,b as ne,a as ee,D as te}from"./dropdown-menu-CuiF-07J.js";import{s as pe}from"./Star01-BNPre7m8.js";import{a as fe}from"./Users03-CzMI4hYk.js";import{a as ge,G as ue}from"./github-repo-picker-DgsWIyrn.js";import{S as he,u as xe,H as ie,W as oe,I as je}from"./import-from-deco-dialog-B_FF9twl.js";import{u as _e,b as Ce,c as be}from"./use-virtual-mcp-Bn261I3R.js";import{P as K}from"./index-Cyi-U3f4.js";import{a as ye}from"./DotsVertical-BoWHOZg-.js";import{a as Ne}from"./Settings02-Qog-9BW9.js";import{s as Se}from"./Trash01-Csom-OmK.js";import{A as De,at as ve}from"./agent-icon-B_lvSp90.js";import{m as Ae}from"./use-navigate-to-agent-C1cPyWif.js";import{C as we}from"./card-CZci2Ked.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ke}from"./use-capability-CP1V4i_3.js";import{E as Te}from"./empty-state-CFMrMwNK.js";import{u as ze}from"./use-create-virtual-mcp-CoJdf93N.js";import{c as Ie,b as Pe,d as He,A as Ee,e as Me,g as Oe,a as Be,f as Ge}from"./alert-dialog-CsikfeuV.js";import{S as $e}from"./search-input-DqD8geWF.js";import{s as le}from"./Plus-CXJQYPWf.js";import"./ChevronUp-Bj5wnP8v.js";import"./ChevronRight-DUYBaJAA.js";import"./dialog-Djo11OZ8.js";import"./X-C23kraKx.js";import"./checkbox-CnyL8XHl.js";import"./collection-search-BaiviTLW.js";import"./SearchMd--1Uwo-4h.js";import"./use-connection-bj-QmeCF.js";import"./use-collections-DDwKLwWC.js";import"./use-mcp-client-DjnQKDkF.js";import"./auth-CdNUf-u6.js";import"./authenticate-and-persist-oauth-B-HUI4Rh.js";import"./mcp-oauth-DOYfP2o1.js";import"./use-mcp-tools-CbjkHt5p.js";import"./extract-connection-data-HZVgcUqH.js";import"./sidebar-CDHrQeMJ.js";import"./LayoutLeft-DIu4qlvA.js";import"./use-mobile-7oYhfh2a.js";import"./sheet-DaEm5-cm.js";import"./tooltip-_TcC7QSJ.js";import"./AlertCircle-BY01IebW.js";import"./Tool01-Cbity1uu.js";import"./SwitchHorizontal01-C-d9B1Pc.js";import"./XCircle-DAQ6sXs1.js";import"./ArrowUpRight-CrNpVXJQ.js";import"./ZapSquare-JpoS_XnR.js";import"./CheckCircle-UPyj94ce.js";import"./ChevronDown-DuS1gosF.js";import"./ChevronLeft-DNoBDBkQ.js";import"./Stars02--YU8wF8-.js";import"./Eye-BN8eZd3q.js";import"./ZoomOut-B5vLZpoX.js";import"./Globe01-CtRTi-q3.js";import"./FilterLines-BcDA53T2.js";import"./Globe04-DcqSH090.js";import"./HardDrive-LcockCRx.js";import"./Key01-BcXniqTr.js";import"./LinkExternal01-Dyt9zIKA.js";import"./Monitor01-BY0WhsQY.js";import"./Sun-DF1tmwEc.js";import"./Palette-D0tFYq6o.js";import"./Play-Ds_dyiCJ.js";import"./Shield01-BjGAptDu.js";import"./Stars01-CUSSCI6Q.js";import"./Upload01-BKLWvYK3.js";import"./User01-rB66Yp8m.js";import"./Users01-CSjiAX-B.js";import"./XClose-CD3EJbwD.js";import"./Zap-BKA-au81.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(w,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(w,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:he,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(w,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ge,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(w,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(w,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(w,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(w,{variant:"destructive",onClick:k=>{k.stopPropagation(),l(k)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(we,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function ls(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=xe(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=ke("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=K,A=K,k=K;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(K.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const q=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==k.Body||t[19]!==I||t[20]!==q?(P=s.jsxs(k.Body,{children:[I,q,J]}),t[17]=J,t[18]=k.Body,t[19]=I,t[20]=q,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(ue,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{ls as default};
|
|
1
|
+
import{c as se,j as s,B as Z,D as me,r as Y,w as v,t as de}from"./index-BHn6e0Se.js";import{c as w,b as ne,a as ee,D as te}from"./dropdown-menu-BJVltTV3.js";import{s as pe}from"./Star01-CVDxujLg.js";import{a as fe}from"./Users03-BsjGrVdp.js";import{a as ge,G as ue}from"./github-repo-picker-H0oT363r.js";import{S as he,u as xe,H as ie,W as oe,I as je}from"./import-from-deco-dialog-Djhp-jTF.js";import{u as _e,b as Ce,c as be}from"./use-virtual-mcp-RUDrgBDG.js";import{P as K}from"./index-Bjcx3nRG.js";import{a as ye}from"./DotsVertical-CFX5mHy_.js";import{a as Ne}from"./Settings02-O2mlkc2j.js";import{s as Se}from"./Trash01-C1jDkITE.js";import{A as De,at as ve}from"./agent-icon-DFvaJiDY.js";import{m as Ae}from"./use-navigate-to-agent-BTBF1w74.js";import{C as we}from"./card-BT_nUMTM.js";import{f as re}from"./formatDistanceToNow-Cb2QZZJn.js";import{u as ke}from"./use-capability-DTqJ4XUv.js";import{E as Te}from"./empty-state-DnQZ-XhB.js";import{u as ze}from"./use-create-virtual-mcp-BuUXsiAm.js";import{c as Ie,b as Pe,d as He,A as Ee,e as Me,g as Oe,a as Be,f as Ge}from"./alert-dialog-C6EVgeBX.js";import{S as $e}from"./search-input-DT_JKNy3.js";import{s as le}from"./Plus-BdYkovF2.js";import"./ChevronUp-D_sqWanb.js";import"./ChevronRight-DkLBQXIZ.js";import"./dialog-Cyifv3G9.js";import"./X-8uKw4TRo.js";import"./checkbox-CHhzhSXJ.js";import"./collection-search-BFQ4OhXe.js";import"./SearchMd-3nngg6Ks.js";import"./use-connection-BXbi3G-n.js";import"./use-collections-ZFJu8_05.js";import"./use-mcp-client-BbksZMyI.js";import"./auth-Cal4T12d.js";import"./authenticate-and-persist-oauth-BZc7Ted8.js";import"./mcp-oauth-CQkaDVAB.js";import"./use-mcp-tools-DRPCqs25.js";import"./extract-connection-data-Bq3lwCXC.js";import"./sidebar-Bs5hYMFZ.js";import"./LayoutLeft-xN92xt-k.js";import"./use-mobile-D4nRxsIe.js";import"./sheet-BeyyimwJ.js";import"./tooltip-DbXsqmjo.js";import"./AlertCircle-fJcOtdPg.js";import"./Tool01-Ck1tGOLa.js";import"./SwitchHorizontal01-CmA6k3Gw.js";import"./XCircle-BmHlL-Zi.js";import"./ArrowUpRight-CrqD-eAO.js";import"./ZapSquare-3iu7JN55.js";import"./CheckCircle-MeJbRt1q.js";import"./ChevronDown-pn1meT8d.js";import"./ChevronLeft-CK9mz_lA.js";import"./Stars02-D1Mwhwxh.js";import"./Eye-DSxffwpX.js";import"./ZoomOut-CYXoJJk1.js";import"./Globe01-BE6-Vhn-.js";import"./FilterLines-BfGXNoDf.js";import"./Globe04-ClAPc8QV.js";import"./HardDrive-C_5bQN2s.js";import"./Key01-BEdNDv5D.js";import"./LinkExternal01-DtMdLshW.js";import"./Monitor01-BxZlH4vE.js";import"./Sun-BzZB8rLL.js";import"./Palette-tvgJAmq5.js";import"./Play-QNolhpYo.js";import"./Shield01-D0p_z1Rh.js";import"./Stars01-NhcGkHTz.js";import"./Upload01-aLxa_7qU.js";import"./User01-l2zA0L_A.js";import"./Users01-CtlXU5tT.js";import"./XClose-MzbQnLCs.js";import"./Zap-BTyMjGbn.js";import"./differenceInSeconds-NQ4PDo0z.js";function ae(t){const e=se.c(29),{onCreateFromScratch:i,onCreateWebsite:D,onCreateHydrogenStore:l,onImportGitHub:S,onImportDeco:f,isCreating:o,align:y,side:g,showBetaBadge:u}=t,h=y===void 0?"end":y;let x;e[0]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(fe,{size:14}),e[0]=x):x=e[0];let a;e[1]!==o||e[2]!==i?(a=s.jsxs(w,{disabled:o,onClick:i,children:[x,"Create from scratch"]}),e[1]=o,e[2]=i,e[3]=a):a=e[3];let j;e[4]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(pe,{size:14}),e[4]=j):j=e[4];let n;e[5]!==o||e[6]!==D?(n=s.jsxs(w,{disabled:o,onClick:D,children:[j,"Start Website"]}),e[5]=o,e[6]=D,e[7]=n):n=e[7];let _;e[8]===Symbol.for("react.memo_cache_sentinel")?(_=s.jsx("img",{src:he,alt:"",className:"size-3.5 object-contain"}),e[8]=_):_=e[8];let c;e[9]!==o||e[10]!==l?(c=s.jsxs(w,{disabled:o,onClick:l,children:[_,"Create Shopify Headless Store"]}),e[9]=o,e[10]=l,e[11]=c):c=e[11];let N;e[12]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ge,{className:"size-3.5"}),e[12]=N):N=e[12];let r;e[13]!==u?(r=u&&s.jsx("span",{className:"ml-auto text-[10px] font-medium text-muted-foreground bg-muted rounded px-1 py-0.5",children:"Beta"}),e[13]=u,e[14]=r):r=e[14];let C;e[15]!==S||e[16]!==r?(C=s.jsxs(w,{onClick:S,children:[N,"Import from GitHub",r]}),e[15]=S,e[16]=r,e[17]=C):C=e[17];let p;e[18]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"deco.cx",className:"size-3.5"}),e[18]=p):p=e[18];let m;e[19]!==f?(m=s.jsxs(w,{onClick:f,children:[p,"Import from deco.cx"]}),e[19]=f,e[20]=m):m=e[20];let b;return e[21]!==h||e[22]!==g||e[23]!==C||e[24]!==m||e[25]!==a||e[26]!==n||e[27]!==c?(b=s.jsxs(ne,{side:g,align:h,className:"w-48",children:[a,n,c,C,m]}),e[21]=h,e[22]=g,e[23]=C,e[24]=m,e[25]=a,e[26]=n,e[27]=c,e[28]=b):b=e[28],b}function Fe(t){const e=se.c(45),{project:i,lastUsedAt:D,onDeleteClick:l}=t,S=Ae();let f;e[0]!==S||e[1]!==i.id?(f=()=>S(i.id),e[0]=S,e[1]=i.id,e[2]=f):f=e[2];let o;e[3]!==i.title||e[4]!==f?(o=s.jsx("button",{type:"button",onClick:f,className:"absolute inset-0 z-0","aria-label":i.title}),e[3]=i.title,e[4]=f,e[5]=o):o=e[5];let y;e[6]!==i.icon||e[7]!==i.title?(y=s.jsx(De,{icon:i.icon,name:i.title,size:"sm",className:"shrink-0 shadow-sm"}),e[6]=i.icon,e[7]=i.title,e[8]=y):y=e[8];let g;e[9]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(ee,{asChild:!0,children:s.jsx(Z,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:s.jsx(ye,{size:20})})}),e[9]=g):g=e[9];let u;e[10]!==S||e[11]!==i.id?(u=()=>S(i.id,{search:{main:"settings"}}),e[10]=S,e[11]=i.id,e[12]=u):u=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=s.jsx(Ne,{size:16}),e[13]=h):h=e[13];let x;e[14]!==u?(x=s.jsxs(w,{onClick:u,children:[h,"Settings"]}),e[14]=u,e[15]=x):x=e[15];let a;e[16]!==l?(a=l&&s.jsxs(w,{variant:"destructive",onClick:k=>{k.stopPropagation(),l(k)},children:[s.jsx(Se,{size:16}),"Delete"]}),e[16]=l,e[17]=a):a=e[17];let j;e[18]!==x||e[19]!==a?(j=s.jsx("div",{className:"relative z-10 pointer-events-auto transition-opacity sm:opacity-0 sm:group-hover:opacity-100",children:s.jsxs(te,{children:[g,s.jsxs(ne,{align:"end",children:[x,a]})]})}),e[18]=x,e[19]=a,e[20]=j):j=e[20];let n;e[21]!==y||e[22]!==j?(n=s.jsxs("div",{className:"flex items-start justify-between",children:[y,j]}),e[21]=y,e[22]=j,e[23]=n):n=e[23];let _;e[24]!==i.title?(_=s.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:i.title}),e[24]=i.title,e[25]=_):_=e[25];const c=i.description||"No description";let N;e[26]!==c?(N=s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:c}),e[26]=c,e[27]=N):N=e[27];let r;e[28]!==_||e[29]!==N?(r=s.jsxs("div",{className:"flex flex-col gap-1",children:[_,N]}),e[28]=_,e[29]=N,e[30]=r):r=e[30];let C;e[31]!==n||e[32]!==r?(C=s.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[n,r]}),e[31]=n,e[32]=r,e[33]=C):C=e[33];let p;e[34]!==D||e[35]!==i.updated_at?(p=D?`Last used ${re(new Date(D),{addSuffix:!0})}`:`Updated ${re(new Date(i.updated_at),{addSuffix:!0})}`,e[34]=D,e[35]=i.updated_at,e[36]=p):p=e[36];let m;e[37]!==p?(m=s.jsx("div",{className:"border-t border-border mt-auto",children:s.jsx("div",{className:"h-10 flex items-center px-4.5",children:s.jsx("p",{className:"text-xs text-muted-foreground",children:p})})}),e[37]=p,e[38]=m):m=e[38];let b;e[39]!==C||e[40]!==m?(b=s.jsxs("div",{className:"flex flex-col flex-1 pointer-events-none",children:[C,m]}),e[39]=C,e[40]=m,e[41]=b):b=e[41];let A;return e[42]!==b||e[43]!==o?(A=s.jsxs(we,{className:"relative transition-colors group overflow-hidden flex flex-col h-full hover:bg-muted/50",children:[o,b]}),e[42]=b,e[43]=o,e[44]=A):A=e[44],A}function ls(){const t=se.c(48),{org:e}=me(),i=_e(),D=Ce(),[l,S]=Y.useState("");let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f={navigateOnCreate:!0},t[0]=f):f=t[0];const{createVirtualMCP:o,isCreating:y}=ze(f),{createFromTemplate:g,isCreating:u}=xe(),[h,x]=Y.useState(null),[a,j]=Y.useState(!1),[n,_]=Y.useState(!1),{granted:c}=ke("agents:manage"),N=l.toLowerCase(),r=i.filter(d=>d.id!==e.id&&(d.title.toLowerCase().includes(N)||d.description?.toLowerCase().includes(N))),{data:C}=be(r.map(Le));let p;t[1]!==D||t[2]!==h?(p=async()=>{if(!h)return;const{id:d,title:ce}=h;x(null);try{await D.delete.mutateAsync(d),v("agent_deleted",{agent_id:d,source:"agents_list"}),de.success(`Deleted "${ce}"`)}catch{}},t[1]=D,t[2]=h,t[3]=p):p=t[3];const m=p,b=K,A=K,k=K;let F;t[4]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(K.Title,{children:"Agents"}),t[4]=F):F=t[4];let L;t[5]===Symbol.for("react.memo_cache_sentinel")?(L=d=>{d.key==="Escape"&&(S(""),d.target.blur())},t[5]=L):L=t[5];let T;t[6]!==l?(T=s.jsx($e,{value:l,onChange:S,placeholder:"Search for an agent...",className:"w-full md:w-[375px]",onKeyDown:L}),t[6]=l,t[7]=T):T=t[7];let z;t[8]!==c||t[9]!==g||t[10]!==o||t[11]!==y||t[12]!==u?(z=c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list",method:"deco"}),j(!0)},isCreating:y||u,align:"end"})]}),t[8]=c,t[9]=g,t[10]=o,t[11]=y,t[12]=u,t[13]=z):z=t[13];let I;t[14]!==T||t[15]!==z?(I=s.jsxs("div",{className:"flex flex-col gap-6",children:[F,s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[T,z]})]}),t[14]=T,t[15]=z,t[16]=I):I=t[16];const q=r.length===0&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Te,{image:s.jsx(ve,{size:48,className:"text-muted-foreground"}),title:l?"No agents found":"No agents yet",description:l?`No agents match "${l}"`:c?"Create an agent to get started.":"Ask an organization admin to create one.",actions:!l&&c&&s.jsxs(te,{children:[s.jsx(ee,{asChild:!0,children:s.jsxs(Z,{size:"sm",children:[s.jsx(le,{size:14}),"Create Agent"]})}),s.jsx(ae,{onCreateFromScratch:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"scratch"}),o()},onCreateWebsite:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"website"}),g(oe)},onCreateHydrogenStore:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"hydrogen"}),g(ie)},onImportGitHub:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"github"}),_(!0)},onImportDeco:()=>{v("agent_create_clicked",{source:"agents_list_empty",method:"deco"}),j(!0)},isCreating:y||u,align:"center",showBetaBadge:!0})]})})}),J=r.length>0&&s.jsxs("div",{className:"mt-6 @container",children:[s.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-3",children:"Agents"}),s.jsx("div",{className:"grid grid-cols-1 @lg:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-4",children:r.map(d=>s.jsx(Fe,{project:d,lastUsedAt:C?.get(d.id)?.last_used_at,onDeleteClick:c?()=>x({id:d.id,title:d.title}):void 0},d.id))})]});let P;t[17]!==J||t[18]!==k.Body||t[19]!==I||t[20]!==q?(P=s.jsxs(k.Body,{children:[I,q,J]}),t[17]=J,t[18]=k.Body,t[19]=I,t[20]=q,t[21]=P):P=t[21];let H;t[22]!==P||t[23]!==A.Content?(H=s.jsx(A.Content,{children:P}),t[22]=P,t[23]=A.Content,t[24]=H):H=t[24];let E;t[25]!==n?(E=s.jsx(ue,{open:n,onOpenChange:_}),t[25]=n,t[26]=E):E=t[26];let M;t[27]!==a?(M=s.jsx(je,{open:a,onOpenChange:j}),t[27]=a,t[28]=M):M=t[28];const Q=!!h;let W;t[29]===Symbol.for("react.memo_cache_sentinel")?(W=d=>!d&&x(null),t[29]=W):W=t[29];let R;t[30]===Symbol.for("react.memo_cache_sentinel")?(R=s.jsx(Ie,{children:"Delete Agent?"}),t[30]=R):R=t[30];const X=h?.title;let O;t[31]!==X?(O=s.jsxs(Pe,{children:[R,s.jsxs(He,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:X}),"."]})]}),t[31]=X,t[32]=O):O=t[32];let U;t[33]===Symbol.for("react.memo_cache_sentinel")?(U=s.jsx(Ee,{children:"Cancel"}),t[33]=U):U=t[33];let B;t[34]!==m?(B=s.jsxs(Me,{children:[U,s.jsx(Oe,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[34]=m,t[35]=B):B=t[35];let G;t[36]!==O||t[37]!==B?(G=s.jsxs(Be,{children:[O,B]}),t[36]=O,t[37]=B,t[38]=G):G=t[38];let $;t[39]!==Q||t[40]!==G?($=s.jsx(Ge,{open:Q,onOpenChange:W,children:G}),t[39]=Q,t[40]=G,t[41]=$):$=t[41];let V;return t[42]!==b||t[43]!==H||t[44]!==E||t[45]!==M||t[46]!==$?(V=s.jsxs(b,{children:[H,E,M,$]}),t[42]=b,t[43]=H,t[44]=E,t[45]=M,t[46]=$,t[47]=V):V=t[47],V}function Le(t){return t.id}export{ls as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as B,s as N,aD as ae,aF as le,aG as he,aE as xe,b7 as me,c as U,n as ge,p as be,r as O,j as s,af as Ee,t as Q,ae as ye,D as re,m as oe,d as J,K as G,k as ve,l as ue,B as V,w as je,E as $e}from"./index-BwVMeD3q.js";import{i as Fe}from"./AlertCircle-BY01IebW.js";import{P as te}from"./index-Cyi-U3f4.js";import{S as ne}from"./skeleton-CjN5A6XL.js";import{b as _e,a as ce,S as de,c as Re}from"./settings-section-uysJimh1.js";import{u as X,b as se,c as Se}from"./use-ai-providers-Mmhw_1Og.js";import{i as Oe}from"./CheckCircle-UPyj94ce.js";import{i as Me,j as Te,p as Ue,S as ze}from"./chat-context-hue9xev7.js";import{d as qe,e as Le}from"./use-organization-settings-DeAexlNB.js";import{M as Ve}from"./select-model-Duntt4sG.js";import{u as Be}from"./use-debounced-autosave-D_Bc7lE0.js";import{I as ie}from"./input-C8pdmexi.js";import{a as fe,T as Ge}from"./toggle-group-DLR6cnlJ.js";import{b as ke,c as Ie,d as Ce,A as Ne,a as Pe,e as we,g as De,f as Ae}from"./alert-dialog-CsikfeuV.js";import{u as H}from"./studio-tools-Cj1fBaXp.js";import{s as Qe}from"./Plus-CXJQYPWf.js";import{b as Ye}from"./Tool01-Cbity1uu.js";import{s as We}from"./Trash01-Csom-OmK.js";import{A as He}from"./avatar-CjYG3-98.js";import{O as Ke,P as Je,C as pe}from"./decopilot-D6Us63Iz.js";import{i as Xe}from"./Settings02-Qog-9BW9.js";import{s as Ze}from"./Eye-BN8eZd3q.js";import{D as et,c as tt,d as st,b as it,a as rt}from"./dialog-Djo11OZ8.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-D8wtdjJA.js";import"./sidebar-CDHrQeMJ.js";import"./LayoutLeft-DIu4qlvA.js";import"./use-mobile-7oYhfh2a.js";import"./sheet-DaEm5-cm.js";import"./X-C23kraKx.js";import"./tooltip-_TcC7QSJ.js";import"./card-CZci2Ked.js";import"./ArrowUpRight-CrNpVXJQ.js";import"./hooks-BFhhtb2P.js";import"./use-mcp-client-DjnQKDkF.js";import"./auth-CdNUf-u6.js";import"./decopilot-sse-pool-Cn1O82-8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-Bn261I3R.js";import"./use-collections-DDwKLwWC.js";import"./tab-id-BptcWVWa.js";import"./drawer-CGy7XhOb.js";import"./connect-desktop-dialog-lLRzH9Wf.js";import"./ChevronUp-Bj5wnP8v.js";import"./User01-rB66Yp8m.js";import"./checkbox-CnyL8XHl.js";import"./select-UKSqIIxL.js";import"./ChevronDown-DuS1gosF.js";import"./Key01-BcXniqTr.js";import"./SearchMd--1Uwo-4h.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-BY0WhsQY.js";import"./ChevronRight-DUYBaJAA.js";import"./Stars01-CUSSCI6Q.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-CP1V4i_3.js";import"./access-gate-hq7UmdZv.js";import"./capability-load-error-CFrsagBh.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Me(e),dt=e=>Te(e),mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],O.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=f):f=t[9];const k=f;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const F=y.keyId??m??"";S(F),a({keyId:F,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(p=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function ft(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function pt(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Be(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==f?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),$={};c?.id&&($[c.id]=j),u?.id&&($[u.id]=_),g?.id&&($[g.id]=f);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,$);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,F=g?.id;let M;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==F?(M=[o,t,j,_,f,p,y,F],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=f,e[25]=p,e[26]=y,e[27]=F,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const R=b&&!d;let D;e[30]!==S||e[31]!==R?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(ft,{isPending:S,showSaved:R})]}),e[30]=S,e[31]=R,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:$}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{$.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=O.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:yt,onError:bt}),[o,x]=O.useState(""),[S,b]=O.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(f=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,f,k]})}),e[22]=_,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=O.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const F=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let R;e[23]!==c?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=R):R=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[D,s.jsxs(we,{children:[A,s.jsx(De,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ae,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==p||e[33]!==F||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&&vt(p)),children:F}),e[32]=p,e[33]=F,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const $=h&&"animate-spin";let P;e[39]!==$?(P=ue($),e[39]=$,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==R||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,E,Y,Z]})})}),e[54]=R,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:f}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:G.aiProviders(S.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:j(p=>I(p)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let f;return t[24]!==l||t[25]!==r||t[26]!==_?(f=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=f):f=t[27],f}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=O.useState(!1),[b,d]=O.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:G.aiProviders(r.id)}),o.invalidateQueries({queryKey:G.aiProviderModels(r.id,i.id)}),Q.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:At},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let F;t[18]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ye,{size:14})}),t[18]=F):F=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(!0),T=s.jsx(We,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let R;t[21]!==p?(R=s.jsxs("div",{className:"flex items-center gap-0.5",children:[F,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=R):R=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==R||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:R}),t[23]=_,t[24]=u,t[25]=R,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ne,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[v,s.jsx(De,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let $;t[38]!==E||t[39]!==w?($=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=$):$=t[40];let P;t[41]!==x||t[42]!==$?(P=s.jsx(Ae,{open:x,onOpenChange:S,children:$}),t[41]=x,t[42]=$,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter(Ft).map(S).filter($t);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Qe,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function $t(e){return e.provider!==void 0}function Ft(e){return e.providerId!=="deco"}function Rt(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Fe,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Ot(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Mt),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=O.useState(!1),[x,S]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let f;e[5]!==n?(f=s.jsx(Je,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=F=>{F||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Mt(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Re,{children:[t,s.jsx($e,{fallback:Ut,children:s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Ot,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Rt,{error:t??new Error("Failed to load AI providers")})}function Gs(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Gs as default};
|
|
1
|
+
import{o as B,s as N,aD as ae,aF as le,aG as he,aE as xe,b7 as me,c as U,n as ge,p as be,r as O,j as s,af as Ee,t as Q,ae as ye,D as re,m as oe,d as J,K as G,k as ve,l as ue,B as V,w as je,E as $e}from"./index-BHn6e0Se.js";import{i as Fe}from"./AlertCircle-fJcOtdPg.js";import{P as te}from"./index-Bjcx3nRG.js";import{S as ne}from"./skeleton-DpFeLiG8.js";import{b as _e,a as ce,S as de,c as Re}from"./settings-section-prScMNzK.js";import{u as X,b as se,c as Se}from"./use-ai-providers-WiPZJScZ.js";import{i as Oe}from"./CheckCircle-MeJbRt1q.js";import{i as Me,j as Te,p as Ue,S as ze}from"./chat-context-COWNKjf7.js";import{d as qe,e as Le}from"./use-organization-settings-BwYobfuk.js";import{M as Ve}from"./select-model-CB71JKeW.js";import{u as Be}from"./use-debounced-autosave-HTy2hxZu.js";import{I as ie}from"./input-B-Pb-iQx.js";import{a as fe,T as Ge}from"./toggle-group-DMtsh5NF.js";import{b as ke,c as Ie,d as Ce,A as Ne,a as Pe,e as we,g as De,f as Ae}from"./alert-dialog-C6EVgeBX.js";import{u as H}from"./studio-tools-By-RAUnB.js";import{s as Qe}from"./Plus-BdYkovF2.js";import{b as Ye}from"./Tool01-Ck1tGOLa.js";import{s as We}from"./Trash01-C1jDkITE.js";import{A as He}from"./avatar-CwOaN9pX.js";import{O as Ke,P as Je,C as pe}from"./decopilot-hWRVkXzW.js";import{i as Xe}from"./Settings02-O2mlkc2j.js";import{s as Ze}from"./Eye-DSxffwpX.js";import{D as et,c as tt,d as st,b as it,a as rt}from"./dialog-Cyifv3G9.js";import{f as ot}from"./formatDistanceToNow-Cb2QZZJn.js";import{R as lt}from"./require-capability-_0uXwGU-.js";import"./sidebar-Bs5hYMFZ.js";import"./LayoutLeft-xN92xt-k.js";import"./use-mobile-D4nRxsIe.js";import"./sheet-BeyyimwJ.js";import"./X-8uKw4TRo.js";import"./tooltip-DbXsqmjo.js";import"./card-BT_nUMTM.js";import"./ArrowUpRight-CrqD-eAO.js";import"./hooks-DQcMNMU9.js";import"./use-mcp-client-BbksZMyI.js";import"./auth-Cal4T12d.js";import"./decopilot-sse-pool-BkD5Vlqs.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-RUDrgBDG.js";import"./use-collections-ZFJu8_05.js";import"./tab-id-BptcWVWa.js";import"./drawer-JGISYavf.js";import"./connect-desktop-dialog-07IWkdaH.js";import"./ChevronUp-D_sqWanb.js";import"./User01-l2zA0L_A.js";import"./checkbox-CHhzhSXJ.js";import"./select-BW0GS-sD.js";import"./ChevronDown-pn1meT8d.js";import"./Key01-BEdNDv5D.js";import"./SearchMd-3nngg6Ks.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Monitor01-BxZlH4vE.js";import"./ChevronRight-DkLBQXIZ.js";import"./Stars01-NhcGkHTz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-capability-DTqJ4XUv.js";import"./access-gate-bI6nuQ5T.js";import"./capability-load-error-D4a3b5Uc.js";B({title:N(),url:N(),icon:N()});B({registries:le(N(),B({enabled:he()})).describe("Per-registry enabled/disabled state. Key is connection ID. Absent registries are treated as enabled."),blockedMcps:ae(N()).describe("List of MCP app_name or app_id values to hide from the store.")});const W=B({keyId:N(),modelId:N(),title:N().optional()}).nullable();xe(["fast","smart","thinking","image","web_search","deep_research"]);xe(["fast","smart","thinking"]);const at=B({tiers:B({fast:W,smart:W,thinking:W,image:W,web_search:W,deep_research:W})});B({ids:ae(N()).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});B({id:N().describe("Brand context ID"),name:N().describe("Company name"),domain:N().describe("Company domain (e.g. example.com)"),overview:N().describe("Company overview / description"),logo:N().nullable().optional().describe("Logo URL"),favicon:N().nullable().optional().describe("Favicon URL"),ogImage:N().nullable().optional().describe("OG image URL"),fonts:B({heading:N().optional().describe("Font family for headings"),body:N().optional().describe("Font family for body text"),code:N().optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:B({primary:N().optional().describe("Primary brand color (hex)"),secondary:N().optional().describe("Secondary brand color (hex)"),accent:N().optional().describe("Accent / highlight color (hex)"),background:N().optional().describe("Background color (hex)"),foreground:N().optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:ae(le(N(),me())).nullable().optional().describe("Brand images"),metadata:le(N(),me()).nullable().optional().describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:N().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:he().optional().describe("Whether this is the default brand for the organization")});const nt=e=>e.capabilities?.includes("image")===!0,ct=e=>Me(e),dt=e=>Te(e),mt=[{key:"fast",label:"Fast",description:"Fastest responses, best for quick tasks",filter:void 0},{key:"smart",label:"Smart",description:"Balanced speed and capability",filter:void 0},{key:"thinking",label:"Thinking",description:"Most capable, best for complex tasks",filter:void 0},{key:"image",label:"Image",description:"Image generation",filter:nt},{key:"web_search",label:"Web search",description:"Quick, up-to-date answers from the web",filter:ct},{key:"deep_research",label:"Deep research",description:"In-depth, multi-source research reports",filter:dt}];function ut(e){const t=U.c(20),{slot:i,onSlotChange:a,filterModels:r,defaultKeyId:l}=e,o=X(),[x,S]=O.useState(i?.keyId??l);let b;t[0]!==i?(b=()=>{i?.keyId&&S(i.keyId)},t[0]=i,t[1]=b):b=t[1];const d=i?.keyId;let n;t[2]!==d?(n=[d],t[2]=d,t[3]=n):n=t[3],O.useEffect(b,n);const m=x??l;let c;t[4]!==m||t[5]!==o?(c=m?o.find(y=>y.id===m):null,t[4]=m,t[5]=o,t[6]=c):c=t[6];const u=c,{models:g,isLoading:j}=se(r?m??void 0:void 0),_=r?j||g.some(r):!0;let f;t[7]!==i||t[8]!==u?.providerId?(f=i?{modelId:i.modelId,title:i.title??i.modelId,keyId:i.keyId,providerId:u?.providerId??"deco",description:null,logo:null,capabilities:[],limits:null,costs:null}:null,t[7]=i,t[8]=u?.providerId,t[9]=f):f=t[9];const k=f;if(r&&!_){let y;return t[10]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx("p",{className:"text-xs text-muted-foreground italic",children:"Not available with current provider"}),t[10]=y):y=t[10],y}let I;t[11]===Symbol.for("react.memo_cache_sentinel")?(I=y=>S(y),t[11]=I):I=t[11];let h;t[12]!==m||t[13]!==a?(h=y=>{const F=y.keyId??m??"";S(F),a({keyId:F,modelId:y.modelId,title:y.title})},t[12]=m,t[13]=a,t[14]=h):h=t[14];let p;return t[15]!==m||t[16]!==r||t[17]!==k||t[18]!==h?(p=s.jsx(Ve,{variant:"bordered",placeholder:"Pick model",model:k,credentialId:m,filterModels:r,onCredentialChange:I,onModelChange:h}),t[15]=m,t[16]=r,t[17]=k,t[18]=h,t[19]=p):p=t[19],p}function ft(e){const t=U.c(2),{isPending:i,showSaved:a}=e;if(i){let r;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(ye,{size:12,className:"animate-spin"}),"Saving…"]}),t[0]=r):r=t[0],r}if(a){let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[s.jsx(Oe,{size:12}),"Saved"]}),t[1]=r):r=t[1],r}return null}function pt(){const e=U.c(42),t=X(),i=qe(),a=t.length>0;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=ge(at),e[0]=r):r=e[0];let l;e[1]!==i?(l={resolver:r,values:i,mode:"onChange"},e[1]=i,e[2]=l):l=e[2];const o=be(l),{mutate:x,isPending:S,isSuccess:b}=Le(),d=o.formState.isDirty;let n;e[3]!==o||e[4]!==i||e[5]!==x?(n={delayMs:250,save:async()=>{const v=o.getValues();x(v,{onSuccess:()=>o.reset(v,{keepValues:!0}),onError:w=>{o.reset(i),Q.error(`Failed to save: ${w.message}`)}})}},e[3]=o,e[4]=i,e[5]=x,e[6]=n):n=e[6];const{schedule:m}=Be(n),c=t[0],u=t[1],g=t[2],{models:j}=se(c?.id),{models:_}=se(u?.id),{models:f}=se(g?.id);let k,I;e[7]!==o||e[8]!==a?(k=()=>{a||o.reset({tiers:{fast:null,smart:null,thinking:null,image:null,web_search:null,deep_research:null}})},I=[a,o],e[7]=o,e[8]=a,e[9]=k,e[10]=I):(k=e[9],I=e[10]),O.useEffect(k,I);let h;e[11]!==t||e[12]!==o||e[13]!==c||e[14]!==u||e[15]!==g||e[16]!==j||e[17]!==_||e[18]!==f?(h=()=>{const v=o.getValues(),w=new Set(t.map(ht)),$={};c?.id&&($[c.id]=j),u?.id&&($[u.id]=_),g?.id&&($[g.id]=f);const P=Y=>Y!=null&&!w.has(Y.keyId),C={fast:P(v.tiers.fast)?null:v.tiers.fast,smart:P(v.tiers.smart)?null:v.tiers.smart,thinking:P(v.tiers.thinking)?null:v.tiers.thinking,image:P(v.tiers.image)?null:v.tiers.image,web_search:P(v.tiers.web_search)?null:v.tiers.web_search,deep_research:P(v.tiers.deep_research)?null:v.tiers.deep_research},q=!C.fast||!C.smart||!C.thinking||!C.image||!C.web_search||!C.deep_research,z=C.fast===v.tiers.fast&&C.smart===v.tiers.smart&&C.thinking===v.tiers.thinking&&C.image===v.tiers.image&&C.web_search===v.tiers.web_search&&C.deep_research===v.tiers.deep_research;if(!q&&z)return;const L=Ue(t,$);o.reset({tiers:{fast:C.fast??L.chat.fast,smart:C.smart??L.chat.smart,thinking:C.thinking??L.chat.thinking,image:C.image??L.image,web_search:C.web_search??L.webSearch,deep_research:C.deep_research??L.deepResearch}},{keepDirty:!0})},e[11]=t,e[12]=o,e[13]=c,e[14]=u,e[15]=g,e[16]=j,e[17]=_,e[18]=f,e[19]=h):h=e[19];const p=c?.id,y=u?.id,F=g?.id;let M;e[20]!==t||e[21]!==o||e[22]!==j||e[23]!==_||e[24]!==f||e[25]!==p||e[26]!==y||e[27]!==F?(M=[o,t,j,_,f,p,y,F],e[20]=t,e[21]=o,e[22]=j,e[23]=_,e[24]=f,e[25]=p,e[26]=y,e[27]=F,e[28]=M):M=e[28],O.useEffect(h,M);let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=s.jsx("p",{className:"text-sm text-muted-foreground",children:"These models power chat, automations, and tools across your organization."}),e[29]=T):T=e[29];const R=b&&!d;let D;e[30]!==S||e[31]!==R?(D=s.jsxs("div",{className:"flex items-center justify-between -mt-2 mb-2",children:[T,s.jsx(ft,{isPending:S,showSaved:R})]}),e[30]=S,e[31]=R,e[32]=D):D=e[32];let A;e[33]!==t[0]?.id||e[34]!==o.control||e[35]!==m?(A=mt.map(v=>s.jsx(Ee,{control:o.control,name:`tiers.${v.key}`,render:w=>{const{field:$}=w;return s.jsx(_e,{title:v.label,description:v.description,action:s.jsx(ut,{slot:$.value,defaultKeyId:t[0]?.id??null,filterModels:v.filter,onSlotChange:P=>{$.onChange(P),m()}})})}},v.key)),e[33]=t[0]?.id,e[34]=o.control,e[35]=m,e[36]=A):A=e[36];let K;e[37]!==A?(K=s.jsx(ce,{children:A}),e[37]=A,e[38]=K):K=e[38];let E;return e[39]!==D||e[40]!==K?(E=s.jsxs(de,{title:"Default models",headerClassName:"pl-0",children:[D,K]}),e[39]=D,e[40]=K,e[41]=E):E=e[41],E}function ht(e){return e.id}const xt={usd:[10,20,100],brl:[50,100,500]};function gt(){const e=U.c(26),t=H(),[i,a]=O.useState(!1),{mutate:r,isPending:l}=J({mutationFn:async h=>{const{url:p}=await t.call("AI_PROVIDER_TOPUP_URL",{providerId:"deco",amountCents:h,currency:d});return p},onSuccess:yt,onError:bt}),[o,x]=O.useState(""),[S,b]=O.useState("usd"),d=S,n=parseFloat(o),m=!isNaN(n)&&n>=1,c=d==="brl"?"R$":"$";let u;e[0]!==b?(u=h=>{h&&b(h)},e[0]=b,e[1]=u):u=e[1];let g,j;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(fe,{value:"usd",className:"px-3.5 text-sm",children:"USD"}),j=s.jsx(fe,{value:"brl",className:"px-3.5 text-sm",children:"BRL"}),e[2]=g,e[3]=j):(g=e[2],j=e[3]);let _;e[4]!==d||e[5]!==u?(_=s.jsxs(Ge,{type:"single",variant:"outline",size:"default",value:d,onValueChange:u,children:[g,j]}),e[4]=d,e[5]=u,e[6]=_):_=e[6];let f;e[7]!==d||e[8]!==c||e[9]!==i||e[10]!==l||e[11]!==r?(f=!i&&s.jsxs(s.Fragment,{children:[xt[d].map(h=>s.jsxs(V,{variant:"outline",className:"h-10 px-4 text-sm font-medium tabular-nums",disabled:l,onClick:()=>r(h*100),children:[c,h]},h)),s.jsx(V,{variant:"ghost",className:"h-10 px-4 text-sm text-muted-foreground",onClick:()=>a(!0),disabled:l,children:"Custom"})]}),e[7]=d,e[8]=c,e[9]=i,e[10]=l,e[11]=r,e[12]=f):f=e[12];let k;e[13]!==c||e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==x||e[20]!==r?(k=i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative max-w-[140px]",children:[s.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground select-none",children:c}),s.jsx(ie,{type:"number",min:"1",step:"1",placeholder:"50",value:o,onChange:h=>x(h.target.value),className:"h-10 text-sm pl-7",autoFocus:!0})]}),s.jsx(V,{className:"h-10",disabled:!m||l,onClick:()=>r(Math.round(n*100)),children:l?"...":"Add"}),s.jsx(V,{variant:"ghost",className:"h-10 text-sm text-muted-foreground",onClick:()=>{a(!1),x("")},children:"Cancel"})]}),e[13]=c,e[14]=o,e[15]=n,e[16]=i,e[17]=m,e[18]=l,e[19]=x,e[20]=r,e[21]=k):k=e[21];let I;return e[22]!==_||e[23]!==f||e[24]!==k?(I=s.jsx("div",{className:"flex flex-col gap-2.5",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[_,f,k]})}),e[22]=_,e[23]=f,e[24]=k,e[25]=I):I=e[25],I}function bt(e){Q.error(`Top-up failed: ${e.message}`)}function yt(e){e&&window.open(e,"_blank","noopener,noreferrer")}function vt(e){return e<=0?"text-destructive":e<=1?"text-amber-500 dark:text-amber-400":"text-foreground"}function jt(){const e=U.c(58),{org:t}=re(),i=H(),a=oe(),r=X();let l;e[0]!==r?(l=r.find(St),e[0]=r,e[1]=l):l=e[1];const o=l,[x,S]=O.useState(!1);let b;e[2]!==o||e[3]!==i?(b=async()=>{o&&await i.call("AI_PROVIDER_KEY_DELETE",{keyId:o.id})},e[2]=o,e[3]=i,e[4]=b):b=e[4];let d;e[5]!==t.id||e[6]!==a?(d=()=>{a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway disconnected"),S(!1)},e[5]=t.id,e[6]=a,e[7]=d):d=e[7];let n;e[8]!==b||e[9]!==d?(n={mutationFn:b,onSuccess:d,onError:_t},e[8]=b,e[9]=d,e[10]=n):n=e[10];const{mutate:m,isPending:c}=J(n);let u;e[11]!==t.id?(u=G.aiProviderCredits(t.id,"deco"),e[11]=t.id,e[12]=u):u=e[12];const g=!!o;let j;e[13]!==i?(j=async()=>{try{return await i.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}},e[13]=i,e[14]=j):j=e[14];let _;e[15]!==u||e[16]!==g||e[17]!==j?(_={queryKey:u,enabled:g,staleTime:6e4,queryFn:j},e[15]=u,e[16]=g,e[17]=j,e[18]=_):_=e[18];const{data:f,isLoading:k,refetch:I,isFetching:h}=ve(_);if(!o)return null;const p=f?.balanceCents!=null?f.balanceCents/100:null;let y;e[19]!==p?(y=p!=null?`$${p.toFixed(2)}`:"—",e[19]=p,e[20]=y):y=e[20];const F=y;let M;e[21]===Symbol.for("react.memo_cache_sentinel")?(M=s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-9 rounded-lg object-contain dark:bg-white dark:p-0.5"}),s.jsx("div",{children:s.jsx("p",{className:"text-xs text-muted-foreground",children:"Access to 100+ models"})})]}),e[21]=M):M=e[21];let T;e[22]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!0),e[22]=T):T=e[22];let R;e[23]!==c?(R=s.jsxs("div",{className:"flex items-center justify-between",children:[M,s.jsx(V,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground hover:text-destructive",onClick:T,disabled:c,children:"Disconnect"})]}),e[23]=c,e[24]=R):R=e[24];let D;e[25]===Symbol.for("react.memo_cache_sentinel")?(D=s.jsxs(ke,{children:[s.jsx(Ie,{children:"Disconnect Deco AI Gateway"}),s.jsx(Ce,{children:"This will remove the Deco AI Gateway from this workspace. Your credit balance is preserved and will be available if you reconnect."})]}),e[25]=D):D=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(Ne,{children:"Cancel"}),e[26]=A):A=e[26];let K;e[27]!==m?(K=s.jsxs(Pe,{children:[D,s.jsxs(we,{children:[A,s.jsx(De,{onClick:()=>m(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Disconnect"})]})]}),e[27]=m,e[28]=K):K=e[28];let E;e[29]!==x||e[30]!==K?(E=s.jsx(Ae,{open:x,onOpenChange:S,children:K}),e[29]=x,e[30]=K,e[31]=E):E=e[31];let v;e[32]!==p||e[33]!==F||e[34]!==h||e[35]!==k?(v=k||h?s.jsx(ne,{className:"h-9 w-24"}):s.jsx("span",{className:ue("text-3xl font-semibold tabular-nums tracking-tight",p!=null&&vt(p)),children:F}),e[32]=p,e[33]=F,e[34]=h,e[35]=k,e[36]=v):v=e[36];let w;e[37]!==I?(w=()=>I(),e[37]=I,e[38]=w):w=e[38];const $=h&&"animate-spin";let P;e[39]!==$?(P=ue($),e[39]=$,e[40]=P):P=e[40];let C;e[41]!==P?(C=s.jsx(ye,{size:14,className:P}),e[41]=P,e[42]=C):C=e[42];let q;e[43]!==h||e[44]!==w||e[45]!==C?(q=s.jsx("button",{type:"button",onClick:w,disabled:h,className:"text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors p-1 rounded-md hover:bg-muted/50","aria-label":"Refresh balance",children:C}),e[43]=h,e[44]=w,e[45]=C,e[46]=q):q=e[46];let z;e[47]!==v||e[48]!==q?(z=s.jsxs("div",{className:"flex items-baseline gap-2",children:[v,q]}),e[47]=v,e[48]=q,e[49]=z):z=e[49];let L;e[50]===Symbol.for("react.memo_cache_sentinel")?(L=s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available credit balance"}),e[50]=L):L=e[50];let Y;e[51]!==z?(Y=s.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[z,L]}),e[51]=z,e[52]=Y):Y=e[52];let Z;e[53]===Symbol.for("react.memo_cache_sentinel")?(Z=s.jsxs("div",{className:"pt-4 border-t border-border/60",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-2.5",children:"Add credits"}),s.jsx(gt,{})]}),e[53]=Z):Z=e[53];let ee;return e[54]!==R||e[55]!==E||e[56]!==Y?(ee=s.jsx(de,{title:"Deco AI Gateway",children:s.jsx(ce,{children:s.jsxs("div",{className:"px-5 py-5 flex flex-col gap-5",children:[R,E,Y,Z]})})}),e[54]=R,e[55]=E,e[56]=Y,e[57]=ee):ee=e[57],ee}function _t(e){Q.error(`Failed to disconnect: ${e.message}`)}function St(e){return e.providerId==="deco"}function kt(){const e=U.c(8),{org:t}=re(),i=H(),a=oe();let r;e[0]!==i?(r=async()=>{await i.call("AI_PROVIDER_PROVISION_KEY",{providerId:"deco"})},e[0]=i,e[1]=r):r=e[1];let l;e[2]!==t||e[3]!==a?(l=()=>{je("ai_provider_provision_succeeded",{provider_id:"deco"}),a.invalidateQueries({queryKey:G.aiProviderKeys(t.id)}),a.invalidateQueries({queryKey:G.aiProviders(t.id)}),Q.success("Deco AI Gateway connected successfully")},e[2]=t,e[3]=a,e[4]=l):l=e[4];let o;return e[5]!==r||e[6]!==l?(o={mutationFn:r,onSuccess:l,onError:It},e[5]=r,e[6]=l,e[7]=o):o=e[7],J(o)}function It(e){je("ai_provider_provision_failed",{provider_id:"deco",error:e.message}),Q.error(`Failed to connect Deco AI Gateway: ${e.message}`)}function Ct(){const e=U.c(10),{mutate:t,isPending:i}=kt();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=["radial-gradient(ellipse 50% 150% at -15% 50%, rgba(165,149,255,0.14) 0%, transparent 60%)","radial-gradient(ellipse 50% 150% at 115% 50%, rgba(208,236,26,0.11) 0%, transparent 60%)"],e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{backgroundImage:a.join(", ")}}),e[1]=r):r=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx("img",{src:"/logos/deco%20logo.svg",alt:"Deco AI Gateway",className:"size-12 shrink-0 rounded-xl object-contain dark:bg-white dark:p-1"}),e[2]=l):l=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("p",{className:"text-base font-semibold",children:"Deco AI Gateway"}),s.jsx("span",{className:"rounded-full border border-border/60 bg-background/60 px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Recommended"})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"100+ models, one connection — pay as you go, no API keys to juggle."})]}),e[3]=o):o=e[3];let x;e[4]!==t?(x=()=>t(),e[4]=t,e[5]=x):x=e[5];const S=i?"Connecting…":"Connect Deco";let b;return e[6]!==i||e[7]!==x||e[8]!==S?(b=s.jsxs("div",{className:"relative rounded-xl border border-border overflow-hidden",children:[r,s.jsxs("div",{className:"relative flex items-center gap-5 px-6 py-5",children:[l,o,s.jsx(V,{variant:"outline",disabled:i,onClick:x,children:S})]})]}),e[6]=i,e[7]=x,e[8]=S,e[9]=b):b=e[9],b}const Nt=B({label:N().min(1,"Label is required").max(100),apiKey:N().optional(),baseUrl:N().optional()});function Pt({providerKey:e,provider:t,preset:i,maskedKey:a,currentLabel:r,currentBaseUrl:l,onCancel:o,onSuccess:x}){const{org:S}=re(),b=H(),d=oe(),[n,m]=O.useState(!1),c=t.id==="openai-compatible",u=t.supportedMethods.includes("api-key"),{register:g,handleSubmit:j,watch:_,formState:{errors:f}}=be({resolver:ge(Nt),defaultValues:{label:r,apiKey:"",baseUrl:l??""}}),k=_("apiKey")??"",{mutate:I,isPending:h}=J({mutationFn:async p=>{let y;p.apiKey?c?y=JSON.stringify({baseUrl:p.baseUrl||l||"",apiKey:p.apiKey}):y=p.apiKey:c&&p.baseUrl&&p.baseUrl!==l&&(y=JSON.stringify({baseUrl:p.baseUrl,apiKey:""})),await b.call("AI_PROVIDER_KEY_UPDATE",{keyId:e.id,label:p.label,...y!==void 0?{apiKey:y}:{}})},onSuccess:()=>{d.invalidateQueries({queryKey:G.aiProviderKeys(S.id)}),d.invalidateQueries({queryKey:G.aiProviders(S.id)}),Q.success("Provider updated"),x()},onError:p=>Q.error(`Failed to update: ${p.message}`)});return s.jsxs("form",{onSubmit:j(p=>I(p)),className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Label"}),s.jsx(ie,{placeholder:"e.g. Personal key",...g("label"),className:"h-8 text-sm"}),f.label&&s.jsx("p",{className:"text-xs text-destructive",children:f.label.message})]}),c&&!i?.defaultBaseUrl&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Base URL"}),s.jsx(ie,{type:"url",placeholder:i?.baseUrlPlaceholder??"http://localhost:4000/v1",...g("baseUrl"),className:"h-8 text-sm"})]}),u&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["API key"," ",s.jsx("span",{className:"text-muted-foreground/60",children:"(leave blank to keep current)"})]}),s.jsxs("div",{className:"relative",children:[s.jsx(ie,{type:n&&k?"text":"password",placeholder:a,...g("apiKey"),className:"ph-no-capture h-8 text-sm pr-8"}),k&&s.jsx("button",{type:"button",onClick:()=>m(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?s.jsx(Xe,{size:14}):s.jsx(Ze,{size:14})})]})]}),i?.helpText&&s.jsx("p",{className:"text-xs text-muted-foreground",children:i.helpText}),s.jsxs(et,{children:[s.jsx(V,{type:"button",variant:"ghost",size:"sm",onClick:o,disabled:h,children:"Cancel"}),s.jsx(V,{type:"submit",size:"sm",disabled:h,children:h?"Saving...":"Save"})]})]})}function wt(e){const t=U.c(28),{providerKey:i,provider:a,open:r,onOpenChange:l}=e,o=H();let x;t[0]!==a.id||t[1]!==i.presetId?(x=a.id==="openai-compatible"&&i.presetId?Ke.find(k=>k.id===i.presetId):void 0,t[0]=a.id,t[1]=i.presetId,t[2]=x):x=t[2];const S=x,b=S?.name??a.name;let d;t[3]!==i.id?(d=G.aiProviderKeyPreview(i.id),t[3]=i.id,t[4]=d):d=t[4];let n;t[5]!==i.id||t[6]!==o?(n=()=>o.call("AI_PROVIDER_KEY_PREVIEW",{keyId:i.id}),t[5]=i.id,t[6]=o,t[7]=n):n=t[7];let m;t[8]!==r||t[9]!==d||t[10]!==n?(m={queryKey:d,queryFn:n,enabled:r,staleTime:0},t[8]=r,t[9]=d,t[10]=n,t[11]=m):m=t[11];const{data:c,isLoading:u}=ve(m);let g;t[12]!==b?(g=s.jsx(tt,{children:s.jsxs(st,{children:["Edit ",b]})}),t[12]=b,t[13]=g):g=t[13];let j;t[14]!==u||t[15]!==l||t[16]!==S||t[17]!==c||t[18]!==a||t[19]!==i?(j=u||!c?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(ze,{})}):s.jsx(Pt,{providerKey:i,provider:a,preset:S,maskedKey:c.maskedKey,currentLabel:c.label,currentBaseUrl:c.baseUrl,onCancel:()=>l(!1),onSuccess:()=>l(!1)}),t[14]=u,t[15]=l,t[16]=S,t[17]=c,t[18]=a,t[19]=i,t[20]=j):j=t[20];let _;t[21]!==g||t[22]!==j?(_=s.jsxs(it,{className:"sm:max-w-md",children:[g,j]}),t[21]=g,t[22]=j,t[23]=_):_=t[23];let f;return t[24]!==l||t[25]!==r||t[26]!==_?(f=s.jsx(rt,{open:r,onOpenChange:l,children:_}),t[24]=l,t[25]=r,t[26]=_,t[27]=f):f=t[27],f}function Dt(e){const t=U.c(48),{providerKey:i,provider:a}=e,{org:r}=re(),l=H(),o=oe(),[x,S]=O.useState(!1),[b,d]=O.useState(!1),n=a.id==="openai-compatible";let m;t[0]!==n||t[1]!==i.presetId?(m=n&&i.presetId?Ke.find(q=>q.id===i.presetId):void 0,t[0]=n,t[1]=i.presetId,t[2]=m):m=t[2];const c=m,u=c?c.name:n?"Custom OpenAI-compatible":a.name,g=c?.logo??a.logo;let j;e:{if(n){j=i.label;break e}const q=i.label;let z;t[3]!==i.createdAt?(z=ot(new Date(i.createdAt)),t[3]=i.createdAt,t[4]=z):z=t[4],j=`${q} · added ${z} ago`}const _=j;let f;t[5]!==i.id||t[6]!==l?(f=async()=>{await l.call("AI_PROVIDER_KEY_DELETE",{keyId:i.id})},t[5]=i.id,t[6]=l,t[7]=f):f=t[7];let k;t[8]!==r||t[9]!==i.id||t[10]!==o?(k=()=>{o.invalidateQueries({queryKey:G.aiProviderKeys(r.id)}),o.invalidateQueries({queryKey:G.aiProviders(r.id)}),o.invalidateQueries({queryKey:G.aiProviderModels(r.id,i.id)}),Q.success("Key deleted"),S(!1)},t[8]=r,t[9]=i.id,t[10]=o,t[11]=k):k=t[11];let I;t[12]!==f||t[13]!==k?(I={mutationFn:f,onSuccess:k,onError:At},t[12]=f,t[13]=k,t[14]=I):I=t[14];const{mutate:h,isPending:p}=J(I);let y;t[15]!==u||t[16]!==g?(y=g?s.jsx("img",{src:g,alt:u,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):s.jsx(He,{fallback:u.charAt(0),className:"size-8 bg-primary/10 text-primary"}),t[15]=u,t[16]=g,t[17]=y):y=t[17];let F;t[18]===Symbol.for("react.memo_cache_sentinel")?(F=s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-foreground",onClick:()=>d(!0),children:s.jsx(Ye,{size:14})}),t[18]=F):F=t[18];let M,T;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=()=>S(!0),T=s.jsx(We,{size:14}),t[19]=M,t[20]=T):(M=t[19],T=t[20]);let R;t[21]!==p?(R=s.jsxs("div",{className:"flex items-center gap-0.5",children:[F,s.jsx(V,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",disabled:p,onClick:M,children:T})]}),t[21]=p,t[22]=R):R=t[22];let D;t[23]!==_||t[24]!==u||t[25]!==R||t[26]!==y?(D=s.jsx(_e,{icon:y,title:u,description:_,action:R}),t[23]=_,t[24]=u,t[25]=R,t[26]=y,t[27]=D):D=t[27];let A;t[28]!==b||t[29]!==a||t[30]!==i?(A=s.jsx(wt,{providerKey:i,provider:a,open:b,onOpenChange:d}),t[28]=b,t[29]=a,t[30]=i,t[31]=A):A=t[31];let K;t[32]===Symbol.for("react.memo_cache_sentinel")?(K=s.jsx(Ie,{children:"Delete API key"}),t[32]=K):K=t[32];let E;t[33]!==i.label?(E=s.jsxs(ke,{children:[K,s.jsxs(Ce,{children:["This action cannot be undone. This will permanently delete"," ",s.jsx("span",{className:"font-medium text-foreground",children:i.label}),"."]})]}),t[33]=i.label,t[34]=E):E=t[34];let v;t[35]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(Ne,{children:"Cancel"}),t[35]=v):v=t[35];let w;t[36]!==h?(w=s.jsxs(we,{children:[v,s.jsx(De,{onClick:()=>h(),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),t[36]=h,t[37]=w):w=t[37];let $;t[38]!==E||t[39]!==w?($=s.jsxs(Pe,{children:[E,w]}),t[38]=E,t[39]=w,t[40]=$):$=t[40];let P;t[41]!==x||t[42]!==$?(P=s.jsx(Ae,{open:x,onOpenChange:S,children:$}),t[41]=x,t[42]=$,t[43]=P):P=t[43];let C;return t[44]!==D||t[45]!==A||t[46]!==P?(C=s.jsxs(s.Fragment,{children:[D,A,P]}),t[44]=D,t[45]=A,t[46]=P,t[47]=C):C=t[47],C}function At(e){return Q.error(`Failed to delete key: ${e.message}`)}function Kt(e){const t=U.c(11),{onConnectClick:i}=e,a=X(),r=Se();let l;t[0]!==r?.providers?(l=r?.providers??[],t[0]=r?.providers,t[1]=l):l=t[1];const o=l;let x;if(t[2]!==a||t[3]!==i||t[4]!==o){let S;t[6]!==o?(S=m=>({key:m,provider:o.find(c=>c.id===m.providerId)}),t[6]=o,t[7]=S):S=t[7];const b=a.filter(Ft).map(S).filter($t);let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=s.jsx(Qe,{size:14}),t[8]=d):d=t[8];let n;t[9]!==i?(n=s.jsxs(V,{size:"sm",onClick:i,children:[d,"Connect provider"]}),t[9]=i,t[10]=n):n=t[10],x=s.jsx(de,{title:"Connected providers",headerClassName:"px-0",actions:n,children:b.length===0?s.jsx("p",{className:"text-sm text-muted-foreground px-1",children:"Bring your own keys to use specific models alongside Deco's gateway."}):s.jsx(ce,{children:b.map(Et)})}),t[2]=a,t[3]=i,t[4]=o,t[5]=x}else x=t[5];return x}function Et(e){const{key:t,provider:i}=e;return s.jsx(Dt,{providerKey:t,provider:i},t.id)}function $t(e){return e.provider!==void 0}function Ft(e){return e.providerId!=="deco"}function Rt(e){const t=U.c(3),{error:i}=e;let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(Fe,{size:16}),t[0]=a):a=t[0];let r;return t[1]!==i.message?(r=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[a,s.jsxs("span",{className:"text-sm font-medium",children:["Failed to load AI providers: ",i.message]})]}),t[1]=i.message,t[2]=r):r=t[2],r}function Ot(){const e=U.c(23),t=X();let i;e[0]!==t?(i=t.some(Mt),e[0]=t,e[1]=i):i=e[1];const a=i,r=t.length>0,[l,o]=O.useState(!1),[x,S]=O.useState(null),b=Se();let d;e[2]!==b?.providers?(d=b?.providers??[],e[2]=b?.providers,e[3]=d):d=e[3];const n=d;if(!r){let _;e[4]===Symbol.for("react.memo_cache_sentinel")?(_=()=>o(!0),e[4]=_):_=e[4];let f;e[5]!==n?(f=s.jsx(Je,{providers:n,onSelect:S,onShowAll:_}),e[5]=n,e[6]=f):f=e[6];const k=x!==null||l;let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=F=>{F||(S(null),o(!1))},e[7]=I):I=e[7];const h=x??void 0;let p;e[8]!==k||e[9]!==h?(p=s.jsx(pe,{open:k,onOpenChange:I,initialProvider:h}),e[8]=k,e[9]=h,e[10]=p):p=e[10];let y;return e[11]!==f||e[12]!==p?(y=s.jsxs(s.Fragment,{children:[f,p]}),e[11]=f,e[12]=p,e[13]=y):y=e[13],y}let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-16 w-full"}),children:s.jsx(pt,{})}),e[14]=m):m=e[14];let c;e[15]!==a?(c=a?s.jsx(jt,{}):s.jsx(Ct,{}),e[15]=a,e[16]=c):c=e[16];let u;e[17]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(Kt,{onConnectClick:()=>o(!0)}),e[17]=u):u=e[17];let g;e[18]!==l?(g=s.jsx(pe,{open:l,onOpenChange:o}),e[18]=l,e[19]=g):g=e[19];let j;return e[20]!==c||e[21]!==g?(j=s.jsxs(s.Fragment,{children:[m,c,u,g]}),e[20]=c,e[21]=g,e[22]=j):j=e[22],j}function Mt(e){return e.providerId==="deco"}function Tt(){const e=U.c(2);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(te.Title,{children:"AI Providers"}),e[0]=t):t=e[0];let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(te,{children:s.jsx(te.Content,{children:s.jsx(te.Body,{children:s.jsxs(Re,{children:[t,s.jsx($e,{fallback:Ut,children:s.jsx(O.Suspense,{fallback:s.jsx(ne,{className:"h-64 w-full"}),children:s.jsx(Ot,{})})})]})})})}),e[1]=i):i=e[1],i}function Ut(e){const{error:t}=e;return s.jsx(Rt,{error:t??new Error("Failed to load AI providers")})}function Gs(){const e=U.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=s.jsx(lt,{capability:"ai-providers:manage",area:"AI providers",children:s.jsx(Tt,{})}),e[0]=t):t=e[0],t}export{Gs as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as r,dr as T,ds as w,_ as m,dt as A,dW as O,bT as M,W as I,cC as L,dX as D,cD as z,dy as F,Y as W,du as G,cE as Y,c as n,l as p,bL as v}from"./index-
|
|
1
|
+
import{r as i,j as r,dr as T,ds as w,_ as m,dt as A,dW as O,bT as M,W as I,cC as L,dX as D,cD as z,dy as F,Y as W,du as G,cE as Y,c as n,l as p,bL as v}from"./index-BHn6e0Se.js";var x="AlertDialog",[k]=W(x,[D]),d=D(),N=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(L,{...a,...t,modal:!0})};N.displayName=x;var H="AlertDialogTrigger",V=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(G,{...o,...a,ref:e})});V.displayName=H;var q="AlertDialogPortal",y=l=>{const{__scopeAlertDialog:e,...t}=l,a=d(e);return r.jsx(z,{...a,...t})};y.displayName=q;var B="AlertDialogOverlay",_=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(Y,{...o,...a,ref:e})});_.displayName=B;var f="AlertDialogContent",[X,J]=k(f),K=F("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(O,{contentName:f,titleName:b,docsSlug:"alert-dialog",children:r.jsx(X,{scope:t,cancelRef:u,children:r.jsxs(M,{role:"alertdialog",...s,...o,ref:P,onOpenAutoFocus:I(o.onOpenAutoFocus,g=>{g.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:g=>g.preventDefault(),onInteractOutside:g=>g.preventDefault(),children:[r.jsx(K,{children:a}),r.jsx(U,{contentRef:c})]})})})});j.displayName=f;var b="AlertDialogTitle",h=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(T,{...o,...a,ref:e})});h.displayName=b;var E="AlertDialogDescription",C=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(w,{...o,...a,ref:e})});C.displayName=E;var Q="AlertDialogAction",R=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,o=d(t);return r.jsx(A,{...o,...a,ref:e})});R.displayName=Q;var $="AlertDialogCancel",S=i.forwardRef((l,e)=>{const{__scopeAlertDialog:t,...a}=l,{cancelRef:o}=J($,t),s=d(t),c=m(e,o);return r.jsx(A,{...s,...a,ref:c})});S.displayName=$;var U=({contentRef:l})=>{const e=`\`${f}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${f}\` by passing a \`${E}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,l as o,j as c,bF as d}from"./index-
|
|
1
|
+
import{c as n,l as o,j as c,bF as d}from"./index-BHn6e0Se.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{f as A,x as a,v as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-BwVMeD3q.js";import{i as je}from"./ChevronRight-DUYBaJAA.js";import{S as ke}from"./scroll-area-BFIPKXPy.js";import{A as _e}from"./add-section-modal-DPGYUmmW.js";import{ao as Be,ap as we,aq as Ae,j as Ne,k as Re,ar as Ce,U as Ee,ab as Ke}from"./index-CxFZHubh.js";import{S as Te}from"./save-status-Ap0tRvUu.js";import"./agent-icon-B_lvSp90.js";import"./AlertCircle-BY01IebW.js";import"./Tool01-Cbity1uu.js";import"./SwitchHorizontal01-C-d9B1Pc.js";import"./Settings02-Qog-9BW9.js";import"./XCircle-DAQ6sXs1.js";import"./ArrowUpRight-CrNpVXJQ.js";import"./ZapSquare-JpoS_XnR.js";import"./Users03-CzMI4hYk.js";import"./CheckCircle-UPyj94ce.js";import"./ChevronUp-Bj5wnP8v.js";import"./ChevronDown-DuS1gosF.js";import"./ChevronLeft-DNoBDBkQ.js";import"./DotsVertical-BoWHOZg-.js";import"./Stars02--YU8wF8-.js";import"./Eye-BN8eZd3q.js";import"./ZoomOut-B5vLZpoX.js";import"./Globe01-CtRTi-q3.js";import"./FilterLines-BcDA53T2.js";import"./Star01-BNPre7m8.js";import"./Globe04-DcqSH090.js";import"./HardDrive-LcockCRx.js";import"./Key01-BcXniqTr.js";import"./LayoutLeft-DIu4qlvA.js";import"./LinkExternal01-Dyt9zIKA.js";import"./Monitor01-BY0WhsQY.js";import"./Sun-DF1tmwEc.js";import"./Palette-D0tFYq6o.js";import"./Play-Ds_dyiCJ.js";import"./Plus-CXJQYPWf.js";import"./SearchMd--1Uwo-4h.js";import"./Shield01-BjGAptDu.js";import"./Stars01-CUSSCI6Q.js";import"./Trash01-Csom-OmK.js";import"./Upload01-BKLWvYK3.js";import"./User01-rB66Yp8m.js";import"./Users01-CSjiAX-B.js";import"./XClose-CD3EJbwD.js";import"./X-C23kraKx.js";import"./Zap-BKA-au81.js";import"./use-clock-tick-BbDdy2cM.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-TPlwZ6aA.js";import"./tooltip-_TcC7QSJ.js";import"./file-type-icon-9Eew51_j.js";import"./dialog-Djo11OZ8.js";import"./use-mobile-7oYhfh2a.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-C9zbfwjF.js";import"./use-mcp-client-DjnQKDkF.js";import"./auth-CdNUf-u6.js";import"./chat-context-hue9xev7.js";import"./hooks-BFhhtb2P.js";import"./decopilot-sse-pool-Cn1O82-8.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-Bn261I3R.js";import"./use-collections-DDwKLwWC.js";import"./use-ai-providers-Mmhw_1Og.js";import"./studio-tools-Cj1fBaXp.js";import"./use-organization-settings-DeAexlNB.js";import"./shell-layout-BU2Eo26M.js";import"./avatar-CjYG3-98.js";import"./required-auth-layout-Bni9Lv8T.js";import"./use-org-sso-BRBxUiX-.js";import"./sheet-DaEm5-cm.js";import"./integration-icon-BYt__tsS.js";import"./use-navigate-to-agent-C1cPyWif.js";import"./use-connection-bj-QmeCF.js";import"./use-mcp-prompts-7fCwwbYc.js";import"./form-Bws9hvDL.js";import"./label-6fUzynqC.js";import"./input-C8pdmexi.js";import"./select-UKSqIIxL.js";import"./index-Bbr4phoV.js";import"./drawer-CGy7XhOb.js";import"./collection-search-BaiviTLW.js";import"./tabs-DLLYyT_4.js";import"./toggle-group-DLR6cnlJ.js";import"./sortable.esm-DWhmpOCs.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-BvZozJYf.js";import"./use-registry-connections-B0D0ZFPH.js";import"./useInfiniteQuery-CbK39j5Y.js";import"./use-infinite-scroll-B0LwAHpI.js";import"./extract-connection-data-HZVgcUqH.js";import"./card-CZci2Ked.js";import"./collection-tabs-gJzAs0-U.js";import"./badge-yqmEwWNw.js";import"./textarea-LTBnL6Dv.js";import"./connection-form-helpers-BXpJ-39p.js";import"./authenticate-and-persist-oauth-B-HUI4Rh.js";import"./mcp-oauth-DOYfP2o1.js";import"./useSuspenseInfiniteQuery-HNqdvvLG.js";import"./connect-desktop-dialog-lLRzH9Wf.js";import"./decopilot-D6Us63Iz.js";import"./checkbox-CnyL8XHl.js";import"./skeleton-CjN5A6XL.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-uysJimh1.js";import"./popover-cxXkvARj.js";import"./command-BtIUrGW9.js";import"./index-CNHawUWP.js";import"./dropdown-menu-CuiF-07J.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CwxWlyu5.js";import"./empty-state-CFMrMwNK.js";import"./toolbar-BuAJdBWi.js";import"./preview-dialog-C1XBzik_.js";import"./index-Bfc1Ah6s.js";import"./use-mcp-tools-CbjkHt5p.js";import"./use-capability-CP1V4i_3.js";import"./shell-route-loading-k31lp-sb.js";import"./index-DgHQzdnZ.js";import"./alert-dialog-CsikfeuV.js";import"./switch-BlhCItPG.js";import"./use-debounced-autosave-D_Bc7lE0.js";import"./index-Cyi-U3f4.js";import"./sidebar-CDHrQeMJ.js";import"./search-input-DqD8geWF.js";import"./github-repo-picker-DgsWIyrn.js";import"./use-secrets-COBbdB1z.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-e9BSYjzY.js";import"./automation-runs-C-ImxLWq.js";import"./table-Bt_fbenL.js";import"./use-members-DPAHG5Sy.js";import"./use-org-auth-client-CywDmsAy.js";import"./task-status-DG_3CCeu.js";import"./use-automations-Cw5ubZKL.js";import"./use-file-configs-BumxkY1W.js";import"./monaco-editor-DGlh_VCI.js";import"./select-model-Duntt4sG.js";import"./automation-list-row-DqslLX8-.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function vr(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,G=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const J=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:Q,isPending:W}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const X=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const Y=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let U;e[34]!==c||e[35]!==Q||e[36]!==X?(U=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await X.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=Q,e[36]=X,e[37]=U):U=e[37];const y=U;let V;e[38]===Symbol.for("react.memo_cache_sentinel")?(V=t=>{P.current=t.append,re(!0)},e[38]=V):V=e[38];const ve=V;let I;e[39]!==y?(I=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=I):I=e[40];const le=I;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let j;e[48]!==W?(j=o.jsx(Te,{isPending:W,isError:!1}),e[48]=W,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==J||e[61]!==s||e[62]!==u||e[63]!==Y||e[64]!==h||e[65]!==G?(_=o.jsx(ke,{className:"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(Ke,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=J,e[61]=s,e[62]=u,e[63]=Y,e[64]=h,e[65]=G,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{vr as AppEditor};
|
|
1
|
+
import{c as ge,r as w,j as o,l as ye,t as ue,i as Se}from"./index-BHn6e0Se.js";import{i as je}from"./ChevronRight-DkLBQXIZ.js";import{S as ke}from"./scroll-area-eBc0wf7v.js";import{A as _e}from"./add-section-modal-BIzdQ3Jk.js";import{ao as Be,ap as we,aq as Ae,j as Ne,k as Re,ar as Ce,U as Ee,ab as Ke}from"./index-BkiBNOb3.js";import{S as Te}from"./save-status-DSRENc3i.js";import"./agent-icon-DFvaJiDY.js";import"./AlertCircle-fJcOtdPg.js";import"./Tool01-Ck1tGOLa.js";import"./SwitchHorizontal01-CmA6k3Gw.js";import"./Settings02-O2mlkc2j.js";import"./XCircle-BmHlL-Zi.js";import"./ArrowUpRight-CrqD-eAO.js";import"./ZapSquare-3iu7JN55.js";import"./Users03-BsjGrVdp.js";import"./CheckCircle-MeJbRt1q.js";import"./ChevronUp-D_sqWanb.js";import"./ChevronDown-pn1meT8d.js";import"./ChevronLeft-CK9mz_lA.js";import"./DotsVertical-CFX5mHy_.js";import"./Stars02-D1Mwhwxh.js";import"./Eye-DSxffwpX.js";import"./ZoomOut-CYXoJJk1.js";import"./Globe01-BE6-Vhn-.js";import"./FilterLines-BfGXNoDf.js";import"./Star01-CVDxujLg.js";import"./Globe04-ClAPc8QV.js";import"./HardDrive-C_5bQN2s.js";import"./Key01-BEdNDv5D.js";import"./LayoutLeft-xN92xt-k.js";import"./LinkExternal01-DtMdLshW.js";import"./Monitor01-BxZlH4vE.js";import"./Sun-BzZB8rLL.js";import"./Palette-tvgJAmq5.js";import"./Play-QNolhpYo.js";import"./Plus-BdYkovF2.js";import"./SearchMd-3nngg6Ks.js";import"./Shield01-D0p_z1Rh.js";import"./Stars01-NhcGkHTz.js";import"./Trash01-C1jDkITE.js";import"./Upload01-aLxa_7qU.js";import"./User01-l2zA0L_A.js";import"./Users01-CtlXU5tT.js";import"./XClose-MzbQnLCs.js";import"./X-8uKw4TRo.js";import"./Zap-BTyMjGbn.js";import"./use-clock-tick-B2vJyztT.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BdLLJ_fi.js";import"./tooltip-DbXsqmjo.js";import"./file-type-icon-Dv84qEA9.js";import"./dialog-Cyifv3G9.js";import"./use-mobile-D4nRxsIe.js";import"./tab-id-BptcWVWa.js";import"./content-blocks-o63cs2vh.js";import"./types-CZk9_Z8c.js";import"./use-mcp-client-BbksZMyI.js";import"./auth-Cal4T12d.js";import"./chat-context-COWNKjf7.js";import"./hooks-DQcMNMU9.js";import"./decopilot-sse-pool-BkD5Vlqs.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-virtual-mcp-RUDrgBDG.js";import"./use-collections-ZFJu8_05.js";import"./use-ai-providers-WiPZJScZ.js";import"./studio-tools-By-RAUnB.js";import"./use-organization-settings-BwYobfuk.js";import"./shell-layout-DJkQm9ri.js";import"./avatar-CwOaN9pX.js";import"./required-auth-layout-Crj-Dp7t.js";import"./use-org-sso-CAx_bgC5.js";import"./sheet-BeyyimwJ.js";import"./integration-icon-BYmEZGh5.js";import"./use-navigate-to-agent-BTBF1w74.js";import"./use-connection-BXbi3G-n.js";import"./use-mcp-prompts-Cw3K78_o.js";import"./form-DWQLeODh.js";import"./label-Dc1p-WMs.js";import"./input-B-Pb-iQx.js";import"./select-BW0GS-sD.js";import"./index-CIxivSGi.js";import"./drawer-JGISYavf.js";import"./collection-search-BFQ4OhXe.js";import"./tabs-BXGI5o2r.js";import"./toggle-group-DMtsh5NF.js";import"./sortable.esm-D36A3isx.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-Dl--lNJe.js";import"./use-registry-connections-BldJ2nwB.js";import"./useInfiniteQuery-D-zpdPgg.js";import"./use-infinite-scroll-By_ChSnA.js";import"./extract-connection-data-Bq3lwCXC.js";import"./card-BT_nUMTM.js";import"./collection-tabs-BAyt72oR.js";import"./badge-DGKSOBGC.js";import"./textarea-C0xG5lgY.js";import"./connection-form-helpers-BjNvSNQg.js";import"./authenticate-and-persist-oauth-BZc7Ted8.js";import"./mcp-oauth-CQkaDVAB.js";import"./useSuspenseInfiniteQuery-CRSha7cG.js";import"./connect-desktop-dialog-07IWkdaH.js";import"./decopilot-hWRVkXzW.js";import"./checkbox-CHhzhSXJ.js";import"./skeleton-DpFeLiG8.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-prScMNzK.js";import"./popover-4qhYIUWo.js";import"./command-BR9F3g1G.js";import"./index-DJINNu9L.js";import"./dropdown-menu-BJVltTV3.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CKvsYwcO.js";import"./empty-state-DnQZ-XhB.js";import"./toolbar-Dz2F7jsm.js";import"./preview-dialog-Bz9c-xiV.js";import"./index-EfvpxM9b.js";import"./use-mcp-tools-DRPCqs25.js";import"./use-capability-DTqJ4XUv.js";import"./shell-route-loading-CwMHFQUh.js";import"./index-IIHfSSHd.js";import"./alert-dialog-C6EVgeBX.js";import"./switch-CnAdsV_e.js";import"./use-debounced-autosave-HTy2hxZu.js";import"./index-Bjcx3nRG.js";import"./sidebar-Bs5hYMFZ.js";import"./search-input-DT_JKNy3.js";import"./github-repo-picker-H0oT363r.js";import"./use-secrets-CxKHovWg.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./view-mode-toggle-5-CmRgcL.js";import"./automation-runs-DtNrxAp4.js";import"./table-DFbId_dZ.js";import"./use-members-CMfXyasv.js";import"./use-org-auth-client-BtI7VkGK.js";import"./task-status-ClBLjafq.js";import"./use-automations-CyoUprKw.js";import"./use-file-configs-B39Wbm4e.js";import"./monaco-editor-HPIYbtKC.js";import"./select-model-CB71JKeW.js";import"./automation-list-row-DG7qfwQf.js";function $e(l,e){const m=(l.title||l.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),f=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",a=Be(e,f);return{blockKey:a,data:{__resolveType:l.resolveType,name:a}}}function vr(l){const e=ge.c(77),{orgSlug:m,virtualMcpId:f,branch:a,blockKey:i,block:n,meta:s,decofile:c,title:D,excludeFields:H,schemaPending:ae,previewBaseUrl:ne}=l,G=ae===void 0?!1:ae,u=ne===void 0?null:ne,x=typeof n?.__resolveType=="string"?n.__resolveType:"";let R;e[0]!==H||e[1]!==s||e[2]!==x?(R=we(x,s,H),e[0]=H,e[1]=s,e[2]=x,e[3]=R):R=e[3];const h=R;let C;e[4]!==h?(C=!!h&&Object.keys(h.properties??{}).length>0,e[4]=h,e[5]=C):C=e[5];const J=C;let E;e[6]!==n||e[7]!==i||e[8]!==s||e[9]!==D?(E=D??(n?Ae(i,n,s):i),e[6]=n,e[7]=i,e[8]=s,e[9]=D,e[10]=E):E=e[10];const v=E;let K;e[11]!==a||e[12]!==m||e[13]!==f?(K={orgSlug:m,virtualMcpId:f,branch:a},e[11]=a,e[12]=m,e[13]=f,e[14]=K):K=e[14];const{save:b,flush:Q,isPending:W}=Ne(K);let T;e[15]!==a||e[16]!==m||e[17]!==f?(T={orgSlug:m,virtualMcpId:f,branch:a},e[15]=a,e[16]=m,e[17]=f,e[18]=T):T=e[18];const X=Re(T);let $;e[19]!==b?($=Ee((t,r)=>b(t,r)),e[19]=b,e[20]=$):$=e[20];const Y=$,[he,xe]=w.useState(i),[ee,ce]=w.useState(null),[te,de]=w.useState(0);let F;e[21]===Symbol.for("react.memo_cache_sentinel")?(F=[],e[21]=F):F=e[21];const[p,fe]=w.useState(F),[oe,re]=w.useState(!1),P=w.useRef(null);he!==i&&(xe(i),ce(null),de(Pe),fe([]));let O;e[22]!==n?(O=n??{},e[22]=n,e[23]=O):O=e[23];const ie=O;let g;e[24]!==ee?(g=ee??{},e[24]=ee,e[25]=g):g=e[25];let q;e[26]!==ie||e[27]!==g?(q={...ie,...g},e[26]=ie,e[27]=g,e[28]=q):q=e[28];const se=q;let z;e[29]!==i||e[30]!==x||e[31]!==b?(z=t=>{const r=t;ce(r),b(i,{...r,__resolveType:x})},e[29]=i,e[30]=x,e[31]=b,e[32]=z):z=e[32];const me=z;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=t=>{fe(t)},e[33]=L):L=e[33];const pe=L;let U;e[34]!==c||e[35]!==Q||e[36]!==X?(U=async(t,r)=>{try{const{blockKey:d,data:N}=$e(t,c);await X.mutateAsync({blockKey:d,data:N}),ue.success(`Created section "${d}"`),r({__resolveType:d}),Q()}catch(d){const N=d,be=N instanceof Error?N.message:"Could not add section";throw ue.error(be),N}},e[34]=c,e[35]=Q,e[36]=X,e[37]=U):U=e[37];const y=U;let V;e[38]===Symbol.for("react.memo_cache_sentinel")?(V=t=>{P.current=t.append,re(!0)},e[38]=V):V=e[38];const ve=V;let I;e[39]!==y?(I=async t=>{const r=P.current;if(r)try{await y(t,d=>{r(d),re(!1),P.current=null})}catch{}},e[39]=y,e[40]=I):I=e[40];const le=I;let M;e[41]!==p||e[42]!==v?(M=p.length>0?[v,...p]:[],e[41]=p,e[42]=v,e[43]=M):M=e[43];const A=M;let S;e[44]!==p||e[45]!==A||e[46]!==v?(S=A.length>0?o.jsx("nav",{"aria-label":"Editing breadcrumb",className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:A.map((t,r)=>{const d=r===A.length-1;return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(je,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{pe(r===0?[]:Ce(p,r)),de(Fe)},title:t,className:ye("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",d?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:t})]},`${t}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:v}),e[44]=p,e[45]=A,e[46]=v,e[47]=S):S=e[47];let j;e[48]!==W?(j=o.jsx(Te,{isPending:W,isError:!1}),e[48]=W,e[49]=j):j=e[49];let k;e[50]!==S||e[51]!==j?(k=o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between border-b px-6",children:[S,j]}),e[50]=S,e[51]=j,e[52]=k):k=e[52];let _;e[53]!==i||e[54]!==p||e[55]!==c||e[56]!==se||e[57]!==te||e[58]!==y||e[59]!==me||e[60]!==J||e[61]!==s||e[62]!==u||e[63]!==Y||e[64]!==h||e[65]!==G?(_=o.jsx(ke,{className:"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(Ke,{schema:h,value:se,onChange:me,basePath:"",breadcrumbPath:p,onBreadcrumbChange:pe,decofile:c,meta:s,onSaveReferencedBlock:Y,previewBaseUrl:u,onAddSectionItem:y,onRequestAddSection:ve},`${i}:${te}`):G?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Se,{size:16,className:"animate-spin"}),"Loading app schema…"]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:"No editable schema found for this app."})})})}),e[53]=i,e[54]=p,e[55]=c,e[56]=se,e[57]=te,e[58]=y,e[59]=me,e[60]=J,e[61]=s,e[62]=u,e[63]=Y,e[64]=h,e[65]=G,e[66]=_):_=e[66];let B;e[67]!==oe||e[68]!==c||e[69]!==le||e[70]!==s||e[71]!==u?(B=u&&o.jsx(_e,{open:oe,onOpenChange:t=>{re(t),t||(P.current=null)},meta:s,decofile:c,previewBaseUrl:u,onSelect:t=>{le(t)}}),e[67]=oe,e[68]=c,e[69]=le,e[70]=s,e[71]=u,e[72]=B):B=e[72];let Z;return e[73]!==k||e[74]!==_||e[75]!==B?(Z=o.jsxs("div",{className:"flex h-full flex-col",children:[k,_,B]}),e[73]=k,e[74]=_,e[75]=B,e[76]=Z):Z=e[76],Z}function Fe(l){return l+1}function Pe(l){return l+1}export{vr as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cK as v,cL as $,cM as W,cN as L,cO as H,cP as V,cQ as D,cR as x,cS as q,cT as j,cU as y,cV as N,cW as B,cX as Z,cY as F}from"./index-BwVMeD3q.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof V)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof D)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 q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(b),"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 v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function 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"?$.parse(await o.json()):W.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 F(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
1
|
+
import{cK as v,cL as $,cM as W,cN as L,cO as H,cP as V,cQ as D,cR as x,cS as q,cT as j,cU as y,cV as N,cW as B,cX as Z,cY as F}from"./index-BHn6e0Se.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof V)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof D)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 q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const k=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(k),d=k}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const S=await e.tokens();if(S?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:S.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(b),"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 v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function 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"?$.parse(await o.json()):W.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 F(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return Z.parse(await s.json())}export{pe as U,_e as a,P as b,me as c,T as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as l,e as m,j as t,A as f,S as h,f as x,g as r,h as p,N as u}from"./index-
|
|
1
|
+
import{c as l,e as m,j as t,A as f,S as h,f as x,g as r,h as p,N as u}from"./index-BHn6e0Se.js";function d(){const e=l.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function g(){const e=l.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=m(a);if(n==="accept-invitation"){let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(f,{children:t.jsx(h,{})}),e[1]=c):c=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(x,{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(r,{pathname:"accept-invitation"})})}),e[2]=i):i=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs(t.Fragment,{children:[c,i,t.jsx(p,{children:t.jsx(d,{})})]}),e[3]=o):o=e[3],o}let s;return e[4]!==n?(s=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(r,{pathname:n})}),e[4]=n,e[5]=s):s=e[5],s}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as re,r as h,d as q,w as R,a as P,j as e,l as B,B as te,c as ne,S as ie}from"./index-BwVMeD3q.js";import{I as F}from"./input-C8pdmexi.js";import{e as fe}from"./backoff-CrEUbyZT.js";import{d as he}from"./delay-CnY5UFtP.js";class ae extends Error{constructor(t,m){super(`Retrying exceeded the maxAttempts (${m}).`),this.name="RetryError",this.cause=t}}async function xe(d,t){const{multiplier:m=2,maxTimeout:o=6e4,maxAttempts:l=5,minTimeout:n=1e3,jitter:u=1,isRetriable:S=()=>!0,signal:f}=t??{};if(!Number.isInteger(l)||l<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${l}`);if(!Number.isFinite(m)||m<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${m}`);if(Number.isNaN(o)||o<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${o}`);if(Number.isNaN(n)||n<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${n}`);if(n>o)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${n}', 'maxTimeout=${o}'`);if(Number.isNaN(u)||u<0||u>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${u}`);let w=0;for(;;){f?.throwIfAborted();try{return await d()}catch(i){if(!S(i))throw i;if(w+1>=l)throw new ae(i,l);const j=fe(o,n,w,m,u);await he(j,f?{signal:f}:void 0)}w++}}const pe={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:d=>`Code sent to ${d}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:d=>`Continue with ${d}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function be({redirectUrl:d,callbackUrl:t="/",title:m,subtitle:o,brand:l,copy:n}){const{emailAndPassword:u,resetPassword:S,emailOtp:f,socialProviders:w}=re(),[i,j]=h.useState(""),[A,V]=h.useState(""),[O,W]=h.useState(""),[x,E]=h.useState(""),[c,z]=h.useState(!1),[H,oe]=h.useState(()=>f.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[p,I]=h.useState(""),[J,G]=h.useState(!1),s={...pe,...n},v=H==="signUp",N=H==="forgotPassword",y=H==="emailOtp",_=q({mutationFn:async({email:r,password:a,name:M})=>{try{if(v){const b=await P.signUp.email({email:r,password:a,name:M||""});if(b.error)throw new Error(b.error.message||s.signUpFailed);return b}else{const b=await P.signIn.email({email:r,password:a});if(b.error)throw new Error(b.error.message||s.signInFailed);return b}}catch(b){throw b instanceof Error?b:new Error(s.authenticationFailed)}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=d??t},onError:r=>{R(v?"user_signup_failed":"user_signin_failed",{error:r instanceof Error?r.message:String(r)})}}),U=q({mutationFn:async({email:r})=>{const a=await P.requestPasswordReset({email:r,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||s.resetEmailFailed);return a},onSuccess:()=>{R("password_reset_requested"),G(!0)},onError:r=>{R("password_reset_request_failed",{error:r instanceof Error?r.message:String(r)})}}),k=q({mutationFn:async({email:r})=>{const a=await P.emailOtp.sendVerificationOtp({email:r,type:"sign-in"});if(a.error)throw new Error(a.error.message||s.otpSendFailed);return a},onSuccess:()=>{R("email_otp_sent"),z(!0)},onError:r=>{R("email_otp_send_failed",{error:r instanceof Error?r.message:String(r)})}}),L=q({mutationFn:async({email:r,otp:a})=>{const M=await P.signIn.emailOtp({email:r,otp:a});if(M.error)throw new Error(M.error.message||s.invalidCode);return M},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=d??t},onError:r=>{R("email_otp_verify_failed",{error:r instanceof Error?r.message:String(r)})}}),D=r=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r),Y=()=>{i.trim()&&!D(i)&&I(s.invalidEmail)},le=r=>{if(r.preventDefault(),!D(i)){I(s.invalidEmail);return}_.mutate({email:i,password:A,name:O})},de=r=>{if(r.preventDefault(),!D(i)){I(s.invalidEmail);return}U.mutate({email:i})},ce=r=>{if(r.preventDefault(),!D(i)){I(s.invalidEmail);return}k.mutate({email:i})},me=r=>{r.preventDefault(),L.mutate({email:i,otp:x})},T=r=>a=>{r(a.target.value),K&&_.reset(),Q&&U.reset(),X&&(k.reset(),L.reset()),r===j&&p&&I("")},$=r=>{oe(r),W(""),E(""),z(!1),I(""),G(!1),_.reset(),U.reset(),k.reset(),L.reset()},g=_.isPending||U.isPending||k.isPending||L.isPending,K=_.error,Q=U.error,X=k.error||L.error,C=v?i.trim()&&A.trim()&&O.trim():N?i.trim():y?c?x.trim():i.trim():i.trim()&&A.trim(),ue=r=>{if(!r)return null;const a=r.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?s.invalidEmailOrPassword:a.includes("already exists")||a.includes("409")?s.accountExists:a.includes("network")||a.includes("fetch")?s.networkError:a.includes("rate limit")||a.includes("429")?s.tooManyAttempts:a.includes("invalid")&&a.includes("otp")?s.invalidOrExpiredCode:r.message||s.genericError},Z=K||Q||X,ge=N?s.resetPasswordTitle:y&&c?s.verificationCodeTitle:m??s.welcomeTitle,ee=N?s.resetPasswordSubtitle:y&&c?s.codeSentTo(i):o===void 0?s.defaultSubtitle:o;return e.jsxs("div",{className:"w-full grid gap-10",children:[l??e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:ge}),ee&&e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ee})]}),Z&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ue(Z)}),J&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:s.resetEmailSent}),!N&&!(y&&c)&&w.enabled&&e.jsx("div",{className:"grid gap-2",children:w.providers.map(r=>e.jsxs("button",{type:"button",disabled:g,onClick:()=>{P.signIn.social({provider:r.name,callbackURL:d??t})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[r.icon&&e.jsx("img",{src:r.icon,alt:"",className:B("h-5 w-5",r.name==="github"&&"dark:invert"),"aria-hidden":"true"}),s.continueWith(r.name.charAt(0).toUpperCase()+r.name.slice(1))]},r.name))}),!N&&!(y&&c)&&w.enabled&&(u.enabled||f.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:s.divider}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),y&&f.enabled&&e.jsx(e.Fragment,{children:c?e.jsxs("form",{onSubmit:me,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:s.verificationCodeLabel}),e.jsx(F,{type:"text",placeholder:s.enterCodePlaceholder,value:x,onChange:T(E),required:!0,disabled:g,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:g||!C,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:g?s.verifying:s.verify}),e.jsx("button",{type:"button",onClick:()=>{z(!1),E(""),k.reset(),L.reset()},disabled:g,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:s.useDifferentEmail})]}):e.jsxs("form",{onSubmit:ce,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:s.emailLabel}),e.jsx(F,{type:"email",placeholder:s.emailPlaceholder,value:i,onChange:T(j),onBlur:Y,required:!0,disabled:g,"aria-invalid":!!p,className:"h-11 rounded-lg"}),p&&e.jsx("p",{className:"text-xs text-destructive",children:p})]}),e.jsx("button",{type:"submit",disabled:g||!C,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:g?s.sending:s.sendCode})]})}),N&&u.enabled&&!J&&e.jsxs("form",{onSubmit:de,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.emailLabel}),e.jsx(F,{type:"email",placeholder:"you@example.com",value:i,onChange:T(j),onBlur:Y,required:!0,disabled:g,"aria-invalid":!!p,className:"h-11 rounded-lg"}),p&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:p})]}),e.jsx(te,{type:"submit",disabled:g||!C,className:"w-full font-semibold",size:"xl",children:g?s.sending:s.sendResetLink})]}),!N&&!y&&u.enabled&&e.jsxs("form",{onSubmit:le,className:"grid gap-5",children:[v&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.nameLabel}),e.jsx(F,{type:"text",placeholder:s.namePlaceholder,value:O,onChange:T(W),required:!0,disabled:g,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.emailLabel}),e.jsx(F,{type:"email",placeholder:"you@example.com",value:i,onChange:T(j),onBlur:Y,required:!0,disabled:g,"aria-invalid":!!p,className:"h-11 rounded-lg"}),p&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:p})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:s.passwordLabel}),!v&&S.enabled&&e.jsx("button",{type:"button",onClick:()=>$("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:s.forgotPassword})]}),e.jsx(F,{type:"password",placeholder:"••••••••",value:A,onChange:T(V),required:!0,disabled:g,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",C?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!C&&"pointer-events-none"),children:e.jsx(te,{type:"submit",disabled:g||!C,className:B("w-full font-semibold"),size:"xl","aria-hidden":!C,children:g?v?s.creatingAccount:s.signingIn:s.continue})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:N?e.jsx("button",{type:"button",onClick:()=>$("signIn"),disabled:g,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:s.backToSignIn}):y&&u.enabled?e.jsx("button",{type:"button",onClick:()=>$("signIn"),disabled:g,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:s.signInWithPassword}):!y&&u.enabled?e.jsxs(e.Fragment,{children:[v?s.alreadyHaveAccount:s.dontHaveAccount,e.jsx("button",{type:"button",onClick:()=>$(v?"signIn":"signUp"),disabled:g,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:v?s.signIn:s.signUp}),f.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>$("emailOtp"),disabled:g,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:s.signInWithEmailCode})]})]}):null})]})}class se{constructor(t){this.response=t}response}function we(d){return d.startsWith("/")&&!d.startsWith("//")?d:"/"}function ve({redirectTo:d}){const[t,m]=h.useState(null);return h.useEffect(()=>{let o=!1;return(async()=>{try{let l;try{l=await xe(async()=>{const n=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(n.status>=500)throw new se(n);return n},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(n){if(n instanceof ae&&n.cause instanceof se)l=n.cause.response;else throw n}if(!l.ok){const n=await l.json().catch(()=>({}));throw new Error(n?.error||"Auto-login failed")}o||(window.location.href=we(d))}catch(l){o||m(l instanceof Error?l.message:"Auto-login failed")}})(),()=>{o=!0}},[d]),t?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",t]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(ie,{})}function ye(d){const t=ne.c(5),{callbackURL:m,providerId:o}=d;let l,n;t[0]!==m||t[1]!==o?(l=()=>{(async()=>await P.signIn.sso({providerId:o,callbackURL:m}))()},n=[o,m],t[0]=m,t[1]=o,t[2]=l,t[3]=n):(l=t[2],n=t[3]),h.useEffect(l,n);let u;return t[4]===Symbol.for("react.memo_cache_sentinel")?(u=e.jsx(ie,{}),t[4]=u):u=t[4],u}function Ce(d){const t=ne.c(13),{callbackUrl:m,redirectUrl:o,allowAutoLogin:l,title:n,subtitle:u,brand:S,copy:f}=d,w=l===void 0?!0:l,{sso:i,emailAndPassword:j,magicLink:A,emailOtp:V,socialProviders:O,localMode:W}=re(),x=o||m;if(W&&w){let c;return t[0]!==x?(c=e.jsx(ve,{redirectTo:x}),t[0]=x,t[1]=c):c=t[1],c}if(i.enabled){let c;return t[2]!==x||t[3]!==i.providerId?(c=e.jsx(ye,{callbackURL:x,providerId:i.providerId}),t[2]=x,t[3]=i.providerId,t[4]=c):c=t[4],c}if(j.enabled||A.enabled||V.enabled||O.enabled){let c;return t[5]!==S||t[6]!==m||t[7]!==f||t[8]!==o||t[9]!==u||t[10]!==n?(c=e.jsx(be,{redirectUrl:o,callbackUrl:m,title:n,subtitle:u,brand:S,copy:f}),t[5]=S,t[6]=m,t[7]=f,t[8]=o,t[9]=u,t[10]=n,t[11]=c):c=t[11],c}let E;return t[12]===Symbol.for("react.memo_cache_sentinel")?(E=e.jsx("div",{children:"No login options available"}),t[12]=E):E=t[12],E}export{Ce as A};
|
|
1
|
+
import{z as re,r as h,d as q,w as R,a as P,j as e,l as B,B as te,c as ne,S as ie}from"./index-BHn6e0Se.js";import{I as F}from"./input-B-Pb-iQx.js";import{e as fe}from"./backoff-CrEUbyZT.js";import{d as he}from"./delay-CnY5UFtP.js";class ae extends Error{constructor(t,m){super(`Retrying exceeded the maxAttempts (${m}).`),this.name="RetryError",this.cause=t}}async function xe(d,t){const{multiplier:m=2,maxTimeout:o=6e4,maxAttempts:l=5,minTimeout:n=1e3,jitter:u=1,isRetriable:S=()=>!0,signal:f}=t??{};if(!Number.isInteger(l)||l<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${l}`);if(!Number.isFinite(m)||m<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${m}`);if(Number.isNaN(o)||o<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${o}`);if(Number.isNaN(n)||n<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${n}`);if(n>o)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${n}', 'maxTimeout=${o}'`);if(Number.isNaN(u)||u<0||u>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${u}`);let w=0;for(;;){f?.throwIfAborted();try{return await d()}catch(i){if(!S(i))throw i;if(w+1>=l)throw new ae(i,l);const j=fe(o,n,w,m,u);await he(j,f?{signal:f}:void 0)}w++}}const pe={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:d=>`Code sent to ${d}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:d=>`Continue with ${d}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function be({redirectUrl:d,callbackUrl:t="/",title:m,subtitle:o,brand:l,copy:n}){const{emailAndPassword:u,resetPassword:S,emailOtp:f,socialProviders:w}=re(),[i,j]=h.useState(""),[A,V]=h.useState(""),[O,W]=h.useState(""),[x,E]=h.useState(""),[c,z]=h.useState(!1),[H,oe]=h.useState(()=>f.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[p,I]=h.useState(""),[J,G]=h.useState(!1),s={...pe,...n},v=H==="signUp",N=H==="forgotPassword",y=H==="emailOtp",_=q({mutationFn:async({email:r,password:a,name:M})=>{try{if(v){const b=await P.signUp.email({email:r,password:a,name:M||""});if(b.error)throw new Error(b.error.message||s.signUpFailed);return b}else{const b=await P.signIn.email({email:r,password:a});if(b.error)throw new Error(b.error.message||s.signInFailed);return b}}catch(b){throw b instanceof Error?b:new Error(s.authenticationFailed)}},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=d??t},onError:r=>{R(v?"user_signup_failed":"user_signin_failed",{error:r instanceof Error?r.message:String(r)})}}),U=q({mutationFn:async({email:r})=>{const a=await P.requestPasswordReset({email:r,redirectTo:"/reset-password"});if(a.error)throw new Error(a.error.message||s.resetEmailFailed);return a},onSuccess:()=>{R("password_reset_requested"),G(!0)},onError:r=>{R("password_reset_request_failed",{error:r instanceof Error?r.message:String(r)})}}),k=q({mutationFn:async({email:r})=>{const a=await P.emailOtp.sendVerificationOtp({email:r,type:"sign-in"});if(a.error)throw new Error(a.error.message||s.otpSendFailed);return a},onSuccess:()=>{R("email_otp_sent"),z(!0)},onError:r=>{R("email_otp_send_failed",{error:r instanceof Error?r.message:String(r)})}}),L=q({mutationFn:async({email:r,otp:a})=>{const M=await P.signIn.emailOtp({email:r,otp:a});if(M.error)throw new Error(M.error.message||s.invalidCode);return M},onSuccess:()=>{globalThis.localStorage?.setItem("hasLoggedIn","true"),window.location.href=d??t},onError:r=>{R("email_otp_verify_failed",{error:r instanceof Error?r.message:String(r)})}}),D=r=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r),Y=()=>{i.trim()&&!D(i)&&I(s.invalidEmail)},le=r=>{if(r.preventDefault(),!D(i)){I(s.invalidEmail);return}_.mutate({email:i,password:A,name:O})},de=r=>{if(r.preventDefault(),!D(i)){I(s.invalidEmail);return}U.mutate({email:i})},ce=r=>{if(r.preventDefault(),!D(i)){I(s.invalidEmail);return}k.mutate({email:i})},me=r=>{r.preventDefault(),L.mutate({email:i,otp:x})},T=r=>a=>{r(a.target.value),K&&_.reset(),Q&&U.reset(),X&&(k.reset(),L.reset()),r===j&&p&&I("")},$=r=>{oe(r),W(""),E(""),z(!1),I(""),G(!1),_.reset(),U.reset(),k.reset(),L.reset()},g=_.isPending||U.isPending||k.isPending||L.isPending,K=_.error,Q=U.error,X=k.error||L.error,C=v?i.trim()&&A.trim()&&O.trim():N?i.trim():y?c?x.trim():i.trim():i.trim()&&A.trim(),ue=r=>{if(!r)return null;const a=r.message.toLowerCase();return a.includes("unauthorized")||a.includes("401")?s.invalidEmailOrPassword:a.includes("already exists")||a.includes("409")?s.accountExists:a.includes("network")||a.includes("fetch")?s.networkError:a.includes("rate limit")||a.includes("429")?s.tooManyAttempts:a.includes("invalid")&&a.includes("otp")?s.invalidOrExpiredCode:r.message||s.genericError},Z=K||Q||X,ge=N?s.resetPasswordTitle:y&&c?s.verificationCodeTitle:m??s.welcomeTitle,ee=N?s.resetPasswordSubtitle:y&&c?s.codeSentTo(i):o===void 0?s.defaultSubtitle:o;return e.jsxs("div",{className:"w-full grid gap-10",children:[l??e.jsxs("div",{children:[e.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),e.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-medium leading-8",children:ge}),ee&&e.jsx("p",{className:"text-base text-muted-foreground leading-6",children:ee})]}),Z&&e.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:ue(Z)}),J&&e.jsx("div",{className:"rounded-xl bg-emerald-500/10 p-3 text-sm text-emerald-600 dark:text-emerald-400 text-center",children:s.resetEmailSent}),!N&&!(y&&c)&&w.enabled&&e.jsx("div",{className:"grid gap-2",children:w.providers.map(r=>e.jsxs("button",{type:"button",disabled:g,onClick:()=>{P.signIn.social({provider:r.name,callbackURL:d??t})},className:"flex h-12 w-full items-center justify-center gap-3 rounded-xl bg-background dark:bg-input/30 px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 disabled:opacity-50 disabled:pointer-events-none",children:[r.icon&&e.jsx("img",{src:r.icon,alt:"",className:B("h-5 w-5",r.name==="github"&&"dark:invert"),"aria-hidden":"true"}),s.continueWith(r.name.charAt(0).toUpperCase()+r.name.slice(1))]},r.name))}),!N&&!(y&&c)&&w.enabled&&(u.enabled||f.enabled)&&e.jsxs("div",{className:"flex items-center gap-2.5 -my-4",children:[e.jsx("div",{className:"h-px flex-1 bg-border"}),e.jsx("span",{className:"text-base text-muted-foreground",children:s.divider}),e.jsx("div",{className:"h-px flex-1 bg-border"})]}),y&&f.enabled&&e.jsx(e.Fragment,{children:c?e.jsxs("form",{onSubmit:me,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:s.verificationCodeLabel}),e.jsx(F,{type:"text",placeholder:s.enterCodePlaceholder,value:x,onChange:T(E),required:!0,disabled:g,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),e.jsx("button",{type:"submit",disabled:g||!C,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:g?s.verifying:s.verify}),e.jsx("button",{type:"button",onClick:()=>{z(!1),E(""),k.reset(),L.reset()},disabled:g,className:"mt-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:s.useDifferentEmail})]}):e.jsxs("form",{onSubmit:ce,className:"grid gap-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:s.emailLabel}),e.jsx(F,{type:"email",placeholder:s.emailPlaceholder,value:i,onChange:T(j),onBlur:Y,required:!0,disabled:g,"aria-invalid":!!p,className:"h-11 rounded-lg"}),p&&e.jsx("p",{className:"text-xs text-destructive",children:p})]}),e.jsx("button",{type:"submit",disabled:g||!C,className:"flex h-12 w-full items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:opacity-50 disabled:pointer-events-none",children:g?s.sending:s.sendCode})]})}),N&&u.enabled&&!J&&e.jsxs("form",{onSubmit:de,className:"grid gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.emailLabel}),e.jsx(F,{type:"email",placeholder:"you@example.com",value:i,onChange:T(j),onBlur:Y,required:!0,disabled:g,"aria-invalid":!!p,className:"h-11 rounded-lg"}),p&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:p})]}),e.jsx(te,{type:"submit",disabled:g||!C,className:"w-full font-semibold",size:"xl",children:g?s.sending:s.sendResetLink})]}),!N&&!y&&u.enabled&&e.jsxs("form",{onSubmit:le,className:"grid gap-5",children:[v&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.nameLabel}),e.jsx(F,{type:"text",placeholder:s.namePlaceholder,value:O,onChange:T(W),required:!0,disabled:g,className:"h-11 rounded-lg"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:s.emailLabel}),e.jsx(F,{type:"email",placeholder:"you@example.com",value:i,onChange:T(j),onBlur:Y,required:!0,disabled:g,"aria-invalid":!!p,className:"h-11 rounded-lg"}),p&&e.jsx("p",{className:"text-xs text-destructive mt-1.5",children:p})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("label",{className:"block text-sm font-medium text-foreground",children:s.passwordLabel}),!v&&S.enabled&&e.jsx("button",{type:"button",onClick:()=>$("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:s.forgotPassword})]}),e.jsx(F,{type:"password",placeholder:"••••••••",value:A,onChange:T(V),required:!0,disabled:g,className:"h-11 rounded-lg"})]}),e.jsx("div",{className:B("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",C?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:e.jsx("div",{className:B("p-1",!C&&"pointer-events-none"),children:e.jsx(te,{type:"submit",disabled:g||!C,className:B("w-full font-semibold"),size:"xl","aria-hidden":!C,children:g?v?s.creatingAccount:s.signingIn:s.continue})})})]}),e.jsx("div",{className:"text-sm text-muted-foreground",children:N?e.jsx("button",{type:"button",onClick:()=>$("signIn"),disabled:g,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:s.backToSignIn}):y&&u.enabled?e.jsx("button",{type:"button",onClick:()=>$("signIn"),disabled:g,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:s.signInWithPassword}):!y&&u.enabled?e.jsxs(e.Fragment,{children:[v?s.alreadyHaveAccount:s.dontHaveAccount,e.jsx("button",{type:"button",onClick:()=>$(v?"signIn":"signUp"),disabled:g,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:v?s.signIn:s.signUp}),f.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"·"}),e.jsx("button",{type:"button",onClick:()=>$("emailOtp"),disabled:g,className:"font-medium text-[#8CAA25] hover:underline disabled:opacity-50",children:s.signInWithEmailCode})]})]}):null})]})}class se{constructor(t){this.response=t}response}function we(d){return d.startsWith("/")&&!d.startsWith("//")?d:"/"}function ve({redirectTo:d}){const[t,m]=h.useState(null);return h.useEffect(()=>{let o=!1;return(async()=>{try{let l;try{l=await xe(async()=>{const n=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(n.status>=500)throw new se(n);return n},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(n){if(n instanceof ae&&n.cause instanceof se)l=n.cause.response;else throw n}if(!l.ok){const n=await l.json().catch(()=>({}));throw new Error(n?.error||"Auto-login failed")}o||(window.location.href=we(d))}catch(l){o||m(l instanceof Error?l.message:"Auto-login failed")}})(),()=>{o=!0}},[d]),t?e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-destructive mb-2",children:["Auto-login failed: ",t]}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Try restarting the server."})]})}):e.jsx(ie,{})}function ye(d){const t=ne.c(5),{callbackURL:m,providerId:o}=d;let l,n;t[0]!==m||t[1]!==o?(l=()=>{(async()=>await P.signIn.sso({providerId:o,callbackURL:m}))()},n=[o,m],t[0]=m,t[1]=o,t[2]=l,t[3]=n):(l=t[2],n=t[3]),h.useEffect(l,n);let u;return t[4]===Symbol.for("react.memo_cache_sentinel")?(u=e.jsx(ie,{}),t[4]=u):u=t[4],u}function Ce(d){const t=ne.c(13),{callbackUrl:m,redirectUrl:o,allowAutoLogin:l,title:n,subtitle:u,brand:S,copy:f}=d,w=l===void 0?!0:l,{sso:i,emailAndPassword:j,magicLink:A,emailOtp:V,socialProviders:O,localMode:W}=re(),x=o||m;if(W&&w){let c;return t[0]!==x?(c=e.jsx(ve,{redirectTo:x}),t[0]=x,t[1]=c):c=t[1],c}if(i.enabled){let c;return t[2]!==x||t[3]!==i.providerId?(c=e.jsx(ye,{callbackURL:x,providerId:i.providerId}),t[2]=x,t[3]=i.providerId,t[4]=c):c=t[4],c}if(j.enabled||A.enabled||V.enabled||O.enabled){let c;return t[5]!==S||t[6]!==m||t[7]!==f||t[8]!==o||t[9]!==u||t[10]!==n?(c=e.jsx(be,{redirectUrl:o,callbackUrl:m,title:n,subtitle:u,brand:S,copy:f}),t[5]=S,t[6]=m,t[7]=f,t[8]=o,t[9]=u,t[10]=n,t[11]=c):c=t[11],c}let E;return t[12]===Symbol.for("react.memo_cache_sentinel")?(E=e.jsx("div",{children:"No login options available"}),t[12]=E):E=t[12],E}export{Ce as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,l as p,j as f}from"./index-
|
|
1
|
+
import{c as g,l as p,j as f}from"./index-BHn6e0Se.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-BHn6e0Se.js";import{i as u,a as p}from"./mcp-oauth-CQkaDVAB.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await u({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await p({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
|
package/dist/client/assets/{automation-list-row-DqslLX8-.js → automation-list-row-DG7qfwQf.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as E,r as F,l as $,j as t,B as K}from"./index-
|
|
1
|
+
import{c as E,r as F,l as $,j as t,B as K}from"./index-BHn6e0Se.js";import{b as O,d as B,e as I,g as L,c as H,A as V,a as q,f as G}from"./alert-dialog-C6EVgeBX.js";import{a as J,D as Q,b as U,c as W}from"./dropdown-menu-BJVltTV3.js";import{s as X}from"./Stars02-D1Mwhwxh.js";import{a as Y}from"./DotsVertical-CFX5mHy_.js";import{s as Z}from"./Trash01-C1jDkITE.js";import{i as ee}from"./Zap-BTyMjGbn.js";import{a as te}from"./use-virtual-mcp-RUDrgBDG.js";import{A as se}from"./agent-icon-DFvaJiDY.js";import{u as ne}from"./use-automations-CyoUprKw.js";function he(a){const e=E.c(53),{automation:s,showAgent:n,onClick:r}=a,{remove:i}=ne(),[P,S]=F.useState(!1),o=te(n?s.virtual_mcp_id:void 0);let D;e[0]!==s.id||e[1]!==i?(D=()=>{i.mutate(s.id),S(!1)},e[0]=s.id,e[1]=i,e[2]=D):D=e[2];const z=D;let A;e[3]!==r?(A=l=>{l.target===l.currentTarget&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),r())},e[3]=r,e[4]=A):A=e[4];const T=A,M=s.active&&s.trigger_count>0?"bg-emerald-500":"bg-muted-foreground/40";let c;e[5]!==M?(c=$("inline-block size-2 rounded-full shrink-0",M),e[5]=M,e[6]=c):c=e[6];const R=s.active&&s.trigger_count>0?"Active":s.active?"No triggers configured":"Paused";let m;e[7]!==c||e[8]!==R?(m=t.jsx("span",{className:c,"aria-label":R}),e[7]=c,e[8]=R,e[9]=m):m=e[9];let u;e[10]!==o?.icon||e[11]!==o?.title||e[12]!==s.name||e[13]!==n?(u=n&&t.jsx(se,{icon:o?.icon??null,name:o?.title??s.name,size:"xs",className:"shrink-0"}),e[10]=o?.icon,e[11]=o?.title,e[12]=s.name,e[13]=n,e[14]=u):u=e[14];let d;e[15]!==s.name?(d=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[15]=s.name,e[16]=d):d=e[16];let g;e[17]!==o||e[18]!==n?(g=n&&o&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",o.title]}),e[17]=o,e[18]=n,e[19]=g):g=e[19];let f;e[20]!==d||e[21]!==g?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d,g]}),e[20]=d,e[21]=g,e[22]=f):f=e[22];let x;e[23]!==s.nearest_next_run_at||e[24]!==s.trigger_count?(x=t.jsx(oe,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[23]=s.nearest_next_run_at,e[24]=s.trigger_count,e[25]=x):x=e[25];let p;e[26]!==f||e[27]!==x?(p=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[f,x]}),e[26]=f,e[27]=x,e[28]=p):p=e[28];let N;e[29]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(J,{asChild:!0,children:t.jsx(K,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(Y,{size:16})})}),e[29]=N):N=e[29];let y;e[30]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{onClick:ie,onKeyDown:re,role:"presentation",className:"shrink-0",children:t.jsxs(Q,{children:[N,t.jsx(U,{align:"end",children:t.jsxs(W,{variant:"destructive",onClick:l=>{l.stopPropagation(),S(!0)},children:[t.jsx(Z,{size:16}),"Delete"]})})]})}),e[30]=y):y=e[30];let h;e[31]!==T||e[32]!==r||e[33]!==p||e[34]!==m||e[35]!==u?(h=t.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:T,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[m,u,p,y]}),e[31]=T,e[32]=r,e[33]=p,e[34]=m,e[35]=u,e[36]=h):h=e[36];let w;e[37]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(H,{children:"Delete automation?"}),e[37]=w):w=e[37];let j;e[38]!==s.name?(j=t.jsxs(O,{children:[w,t.jsxs(B,{children:["This removes"," ",t.jsx("span",{className:"font-medium text-foreground",children:s.name})," ","and all of its triggers. This action cannot be undone."]})]}),e[38]=s.name,e[39]=j):j=e[39];let C;e[40]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(V,{children:"Cancel"}),e[40]=C):C=e[40];let _;e[41]!==z||e[42]!==i.isPending?(_=t.jsxs(I,{children:[C,t.jsx(L,{onClick:z,disabled:i.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[41]=z,e[42]=i.isPending,e[43]=_):_=e[43];let v;e[44]!==j||e[45]!==_?(v=t.jsxs(q,{children:[j,_]}),e[44]=j,e[45]=_,e[46]=v):v=e[46];let b;e[47]!==P||e[48]!==v?(b=t.jsx(G,{open:P,onOpenChange:S,children:v}),e[47]=P,e[48]=v,e[49]=b):b=e[49];let k;return e[50]!==h||e[51]!==b?(k=t.jsxs(t.Fragment,{children:[h,b]}),e[50]=h,e[51]=b,e[52]=k):k=e[52],k}function re(a){return a.stopPropagation()}function ie(a){return a.stopPropagation()}function oe(a){const e=E.c(4),{triggerCount:s,nextRunAt:n}=a;if(s===0){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("span",{className:"text-xs text-muted-foreground",children:"No triggers configured"}),e[0]=i):i=e[0],i}let r;return e[1]!==n||e[2]!==s?(r=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:n?t.jsxs(t.Fragment,{children:[t.jsx(X,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:["Next run ",new Date(n).toLocaleString()]})]}):t.jsxs(t.Fragment,{children:[t.jsx(ee,{size:12,className:"shrink-0"}),t.jsxs("span",{className:"truncate",children:[s," trigger",s===1?"":"s"]})]})}),e[1]=n,e[2]=s,e[3]=r):r=e[3],r}export{he as A};
|