decocms 4.355.1 → 4.355.2
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-BnJSjvRr.js → AlertCircle-C2I0CPt8.js} +1 -1
- package/dist/client/assets/{AreaChart-CZfx3tNT.js → AreaChart-DvG2Chn9.js} +1 -1
- package/dist/client/assets/{ArrowLeft-CFd_URtJ.js → ArrowLeft-DiFtyxtp.js} +1 -1
- package/dist/client/assets/{ArrowRight-CIjsALWT.js → ArrowRight-Cr3akrFT.js} +1 -1
- package/dist/client/assets/{ArrowUp-BL_Z3gaA.js → ArrowUp-DF6vzMhN.js} +1 -1
- package/dist/client/assets/{Check-PVF6vrar.js → Check-sicxXYN7.js} +1 -1
- package/dist/client/assets/{CheckCircle-DWGenYVe.js → CheckCircle-Cbkf0Hrm.js} +1 -1
- package/dist/client/assets/{ChevronRight-DZ_A_9gi.js → ChevronRight-r0gLJbn2.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DM1bCZ5U.js → ChevronSelectorVertical-CejccrOe.js} +1 -1
- package/dist/client/assets/{ChevronUp-DCxC4nqn.js → ChevronUp-CBLrm_OT.js} +1 -1
- package/dist/client/assets/{Copy01-DCWIjDLi.js → Copy01-BzbXBjHv.js} +1 -1
- package/dist/client/assets/{CreditCard01-C5_XNJti.js → CreditCard01-C8AQ6_dn.js} +1 -1
- package/dist/client/assets/{DotsVertical-DpjgNoh-.js → DotsVertical-Cyt1EoXA.js} +1 -1
- package/dist/client/assets/{Download01-Du8Vadan.js → Download01-Db1D2BD0.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-DzIqoDvw.js → ErrorBarContext-BdZSwiSN.js} +1 -1
- package/dist/client/assets/{Eye-BByX4xau.js → Eye-QPQVcqGb.js} +1 -1
- package/dist/client/assets/{GitBranch01-BH6dGtWi.js → GitBranch01-D3Ep4J5o.js} +1 -1
- package/dist/client/assets/{Globe01-DlaG-NnI.js → Globe01-dlVOEKaQ.js} +1 -1
- package/dist/client/assets/{HardDrive-CUdLIQ85.js → HardDrive-W8kLhAmw.js} +1 -1
- package/dist/client/assets/{Image01-7KOsFSn6.js → Image01-B1m-gUl3.js} +1 -1
- package/dist/client/assets/{Key01-Cgpr5iVq.js → Key01-DquPZpqN.js} +1 -1
- package/dist/client/assets/{Link01-BwBpqz0z.js → Link01-ClTL5UTN.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DEZgimKD.js → LinkExternal01-BepJT7Oz.js} +1 -1
- package/dist/client/assets/{Monitor01-BrWUHiMt.js → Monitor01-Bndg-M3Y.js} +1 -1
- package/dist/client/assets/{Package-Cz6cuFXC.js → Package-B2Up-gTH.js} +1 -1
- package/dist/client/assets/{Palette-C62-AS5d.js → Palette-BsEqDIgy.js} +1 -1
- package/dist/client/assets/{Play-y6LHuyl1.js → Play-DZtU_bVy.js} +1 -1
- package/dist/client/assets/{Plus-C4BLg9rY.js → Plus-5jblmb5M.js} +1 -1
- package/dist/client/assets/{SearchLg-5JXlPePj.js → SearchLg-DFeP1_X8.js} +1 -1
- package/dist/client/assets/{SearchMd-iLxrs9MR.js → SearchMd-CnBFXj_Z.js} +1 -1
- package/dist/client/assets/{Sector-DHEwtC7f.js → Sector-DnHG75nj.js} +1 -1
- package/dist/client/assets/{Settings02-HilGA_l8.js → Settings02-5WiTDc8b.js} +1 -1
- package/dist/client/assets/{Share07-C5fLDjhG.js → Share07-DzTdSg05.js} +1 -1
- package/dist/client/assets/{Shield01-CM8p_GEF.js → Shield01-qqcKLTxE.js} +1 -1
- package/dist/client/assets/{Stars01-B27dL-gW.js → Stars01-CFR1c-1g.js} +1 -1
- package/dist/client/assets/{Sun-C6IH4klW.js → Sun-Bxqb4eKN.js} +1 -1
- package/dist/client/assets/{Tool01-q_jLTCKZ.js → Tool01-DCz0PgHD.js} +1 -1
- package/dist/client/assets/{Tool02-DKVecUxz.js → Tool02-Dx9QVS5U.js} +1 -1
- package/dist/client/assets/{Trash01-DTRwSnwl.js → Trash01-D5ciFh4O.js} +1 -1
- package/dist/client/assets/{TrendUp01-Dc0HNJry.js → TrendUp01-DjG8w8m_.js} +1 -1
- package/dist/client/assets/{Upload01-D7EURws9.js → Upload01-Dbydv0Li.js} +1 -1
- package/dist/client/assets/{User01-CIoTN2qr.js → User01-Dq0QszR-.js} +1 -1
- package/dist/client/assets/{UserSquare-BoLQORca.js → UserSquare-Bi0Jy-6E.js} +1 -1
- package/dist/client/assets/{Users01-DMZvF9yz.js → Users01-C_RVSWfd.js} +1 -1
- package/dist/client/assets/{Users03-C-hy1klX.js → Users03-DPq3XXBm.js} +1 -1
- package/dist/client/assets/{XCircle-B2HwIa6n.js → XCircle-CiIZAkGm.js} +1 -1
- package/dist/client/assets/{XClose-DljE5x9b.js → XClose-hM3AAAai.js} +1 -1
- package/dist/client/assets/{Zap-DL_o7-ob.js → Zap-Bb7Qo7M3.js} +1 -1
- package/dist/client/assets/{ZoomOut-RWKUY6hj.js → ZoomOut-B_xPvOLH.js} +1 -1
- package/dist/client/assets/{access-gate-D30eITwH.js → access-gate-B2eHW19E.js} +1 -1
- package/dist/client/assets/{agent-icon-BA5Q75L0.js → agent-icon-BMTcgZga.js} +1 -1
- package/dist/client/assets/{agents-list-NrabdqUD.js → agents-list-C54ZadWw.js} +1 -1
- package/dist/client/assets/{ai-providers-ClqQNrqt.js → ai-providers-BzDqK8qy.js} +1 -1
- package/dist/client/assets/{alert-pUX7_vwd.js → alert-BrLgpHg1.js} +1 -1
- package/dist/client/assets/{alert-dialog-B9Cqya-5.js → alert-dialog-BikX6FFY.js} +1 -1
- package/dist/client/assets/analytics-tab-CsPoqNEM.js +2 -0
- package/dist/client/assets/api-keys-Cdmmw61O.js +1 -0
- package/dist/client/assets/{api-keys-p8sqiCGM.js → api-keys-Cq2DDoKg.js} +1 -1
- package/dist/client/assets/app-editor-BNKwsB0C.js +1 -0
- package/dist/client/assets/{auth-SROEnleF.js → auth-CNVXmSkG.js} +1 -1
- package/dist/client/assets/{auth-catchall-B3FaofbX.js → auth-catchall-5CZsMp3G.js} +1 -1
- package/dist/client/assets/{auth-entry-D8OvofyR.js → auth-entry-CamvS-yK.js} +1 -1
- package/dist/client/assets/{auth-split-layout-C1ukWJzE.js → auth-split-layout-BOtLd_pv.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-B94cTWsZ.js → authenticate-and-persist-oauth-DZYDyEg2.js} +1 -1
- package/dist/client/assets/{automation-list-row-Cq-8ml_t.js → automation-list-row-Dj0Hlwog.js} +1 -1
- package/dist/client/assets/{automation-runs-D1o8Ui_t.js → automation-runs-2af22T9w.js} +8 -8
- package/dist/client/assets/{automations-5Xtw4sgu.js → automations-B2SV0OTy.js} +1 -1
- package/dist/client/assets/{autosend-BYDxYeyM.js → autosend-D9JhT_oZ.js} +1 -1
- package/dist/client/assets/{avatar-DCRnkiqQ.js → avatar-CPkw3h7t.js} +1 -1
- package/dist/client/assets/{badge-DTaRDPAR.js → badge-C_ARXG3i.js} +1 -1
- package/dist/client/assets/{block-document-CzuOrMeM.js → block-document-B8RakH2B.js} +1 -1
- package/dist/client/assets/{breadcrumb-DF8Vvl2V.js → breadcrumb-CsyYyKv7.js} +1 -1
- package/dist/client/assets/{buckets-OS788J9T.js → buckets-C3rsO-J0.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DemyqjzI.js → bulk-category-panel-8YfIcV58.js} +1 -1
- package/dist/client/assets/{capability-load-error-RhsCsNaD.js → capability-load-error-_DjYgnoI.js} +1 -1
- package/dist/client/assets/{cards-CJz74Frj.js → cards-C17dmtwv.js} +1 -1
- package/dist/client/assets/{category-editor-BPDkqZ1X.js → category-editor-DRxFVwt9.js} +1 -1
- package/dist/client/assets/{cdn-tab-Ce_KteSc.js → cdn-tab-xbZtzilg.js} +1 -1
- package/dist/client/assets/{chart-FV76nfQo.js → chart-HqfMLVT_.js} +1 -1
- package/dist/client/assets/{chat-context-BYX6I5Fd.js → chat-context-CvoU8WQ4.js} +1 -1
- package/dist/client/assets/{checkbox-BimlBJuz.js → checkbox-Cgrb5XJJ.js} +1 -1
- package/dist/client/assets/{choose-editor-vZzAVuzE.js → choose-editor-DWeJjqnG.js} +1 -1
- package/dist/client/assets/{cli-auth-success-BazJY0CD.js → cli-auth-success-BdI--VSg.js} +1 -1
- package/dist/client/assets/{client-icons-CshWnPu5.js → client-icons-B-EXG49U.js} +1 -1
- package/dist/client/assets/{collection-detail-BIN49Vpt.js → collection-detail-swCyhtIz.js} +1 -1
- package/dist/client/assets/{collection-display-button-DY2hUVUs.js → collection-display-button-BbFCPrTl.js} +1 -1
- package/dist/client/assets/{collection-search-D7Cj6HfC.js → collection-search-CJb7f2bn.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-B71xPUgB.js → collection-table-wrapper-DC-4y8I-.js} +1 -1
- package/dist/client/assets/{collection-tabs-DJy9997W.js → collection-tabs-BxnrIEJp.js} +1 -1
- package/dist/client/assets/{command-oMq_pqOr.js → command-CqNTTNRi.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-Y7LU1MOI.js → commerce-onboarding-DFX26jT9.js} +1 -1
- package/dist/client/assets/{connect-fh0xumf2.js → connect-DtII47Uj.js} +1 -1
- package/dist/client/assets/{connect-layout-Bnimxjt0.js → connect-layout-TQ2j2S05.js} +1 -1
- package/dist/client/assets/{connection-BKgK4EEG.js → connection-DtCer1Uy.js} +1 -1
- package/dist/client/assets/{connection-card-CzNHvctS.js → connection-card-BzEzwA5b.js} +1 -1
- package/dist/client/assets/{connection-detail-CRdmgjvx.js → connection-detail-BqVCcP--.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DJji_Jb6.js → connection-form-helpers-swpd49hK.js} +1 -1
- package/dist/client/assets/{connections-C6KImWhr.js → connections-BtJpCjSi.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-rvg59v3U.js → create-organization-dialog-_A_tQwgl.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-ByRDScf2.js → decopilot-sse-pool-pjl5bOdE.js} +1 -1
- package/dist/client/assets/{dialog-B04kc62g.js → dialog-B0OdXcqs.js} +1 -1
- package/dist/client/assets/{domain-settings-oaLI5FB-.js → domain-settings-D9jM3qAJ.js} +1 -1
- package/dist/client/assets/{drawer-Bw_O4REy.js → drawer-C2s6Up5H.js} +1 -1
- package/dist/client/assets/{dropdown-menu-EWXYU2mk.js → dropdown-menu-CoV3z2Yq.js} +1 -1
- package/dist/client/assets/{e2e-tab-CF2p5Tm4.js → e2e-tab-H0hc-BZ9.js} +1 -1
- package/dist/client/assets/{editor-ChkB79mK.js → editor-DDZRpuBY.js} +1 -1
- package/dist/client/assets/{empty-state-8xdT9fUB.js → empty-state-CZg3u6TE.js} +1 -1
- package/dist/client/assets/{empty-state-CRzdgRHh.js → empty-state-UGFooPJ_.js} +1 -1
- package/dist/client/assets/{extract-connection-data-C-oki4yl.js → extract-connection-data-BPXLZ9J6.js} +1 -1
- package/dist/client/assets/{file-explorer-Duxdjlta.js → file-explorer-CDJlhfne.js} +1 -1
- package/dist/client/assets/{file-type-icon-BTszDjtn.js → file-type-icon-DnRMRlEa.js} +1 -1
- package/dist/client/assets/{folder-icon-zfr8GEIh.js → folder-icon-D1UH1rlz.js} +1 -1
- package/dist/client/assets/{form-NAnvNKNh.js → form-TWkufiDd.js} +1 -1
- package/dist/client/assets/{general-EYNf96uo.js → general-Dm-xRItO.js} +1 -1
- package/dist/client/assets/{github-icon-D2iLhKKS.js → github-icon-DMu-fvNj.js} +1 -1
- package/dist/client/assets/{hooks-5upKNaET.js → hooks-BJUiYjpq.js} +1 -1
- package/dist/client/assets/{index-BlPslUSo.js → index-B5IAGVkM.js} +6 -6
- package/dist/client/assets/{index-BLXX2F1Z.js → index-BI90bdn8.js} +1 -1
- package/dist/client/assets/{index-DbGHY7ae.js → index-BPwgxBBZ.js} +1 -1
- package/dist/client/assets/index-Bf3UYpNv.js +1 -0
- package/dist/client/assets/{index-U0llG_rw.js → index-CNT4COX0.js} +1 -1
- package/dist/client/assets/{index-Duje61Xv.js → index-D6kz3ebr.js} +4 -4
- package/dist/client/assets/index-DBDSE4L5.css +1 -0
- package/dist/client/assets/{index-CsMaAxoQ.js → index-DIovfAvf.js} +1 -1
- package/dist/client/assets/{index-BVkcOayd.js → index-DeOJD6d8.js} +1 -1
- package/dist/client/assets/{index-HsBszKk6.js → index-Dfke77qN.js} +1 -1
- package/dist/client/assets/{index-BICosFUY.js → index-DucBuZzH.js} +1 -1
- package/dist/client/assets/{index-CRkq3miP.js → index-KPDf_vWx.js} +1 -1
- package/dist/client/assets/{index-CHCyce6s.js → index-ObR7HuX3.js} +1 -1
- package/dist/client/assets/{index-redirect-lymg6hAq.js → index-redirect-n5VV5WB_.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-BtQxTAMd.js → infiniteQueryObserver-Dld3rVqh.js} +1 -1
- package/dist/client/assets/{infra-billing-jf3Yd95B.js → infra-billing-D04CQzUh.js} +1 -1
- package/dist/client/assets/{input-CnXtEqVa.js → input-SHpohkkd.js} +1 -1
- package/dist/client/assets/{integration-icon-vlzFlFo_.js → integration-icon-BQARLIol.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-BRD-sISH.js → invite-member-dialog-DGV9h8p7.js} +1 -1
- package/dist/client/assets/{label-Cde57soC.js → label-rD90jMRy.js} +1 -1
- package/dist/client/assets/{layout-d2-6fCTF.js → layout-DneON2K-.js} +1 -1
- package/dist/client/assets/{login-P60d9M35.js → login-KMTs7jKS.js} +1 -1
- package/dist/client/assets/{markdown-DazdNUyR.js → markdown-DOFXhXXc.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-Cfgwv9Wj.js → mcp-app-renderer-DzI0XDOX.js} +1 -1
- package/dist/client/assets/{mcp-oauth-86AEuQu1.js → mcp-oauth-DHIeN6FN.js} +1 -1
- package/dist/client/assets/{members-BHfkyhcb.js → members-AHwwCvg3.js} +1 -1
- package/dist/client/assets/{monaco-editor-IBD3LTXE.js → monaco-editor-BncUqSbn.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BaKMUKiS.js → monitoring-stats-row-CEzHQPkU.js} +1 -1
- package/dist/client/assets/{multi-select-DSik8jKk.js → multi-select-BuWqwtfL.js} +1 -1
- package/dist/client/assets/{oauth-callback-Kh-wXxBV.js → oauth-callback-BC7x9Uxy.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Ji2YoCih.js → oauth-callback-ai-provider-Difk9x6B.js} +1 -1
- package/dist/client/assets/{onboarding-DI36rduC.js → onboarding-EhIUSeAF.js} +1 -1
- package/dist/client/assets/{org-layout-xq5l_bu4.js → org-layout-CSFqN6iA.js} +1 -1
- package/dist/client/assets/{organization-choice-DPa54bzi.js → organization-choice-NrSjC7-6.js} +1 -1
- package/dist/client/assets/{orgs-mzc4Kx78.js → orgs-02MvW8eo.js} +1 -1
- package/dist/client/assets/{page-seo-form-Dq9tYJrQ.js → page-seo-form-F8gftHfe.js} +1 -1
- package/dist/client/assets/{popover-BjSCyJZK.js → popover-DClv4J5a.js} +1 -1
- package/dist/client/assets/{post-calendar-BStgFHMo.js → post-calendar-BqjLapsw.js} +1 -1
- package/dist/client/assets/{post-editor-BfBnFBgl.js → post-editor-CKi-qWNG.js} +1 -1
- package/dist/client/assets/{primitives-B2Acr6Dc.js → primitives-DpTtwzO3.js} +1 -1
- package/dist/client/assets/{profile-DCWeRvLG.js → profile-DDFJC2Vv.js} +1 -1
- package/dist/client/assets/{project-app-view-Di4BAidr.js → project-app-view-BxEzaMDJ.js} +1 -1
- package/dist/client/assets/{project-icon-BVyI4baU.js → project-icon-DB0uWZzs.js} +1 -1
- package/dist/client/assets/{prompts-B3fp8Esg.js → prompts-Dwzm6Z4Z.js} +1 -1
- package/dist/client/assets/record-editor-DLoE_u56.js +1 -0
- package/dist/client/assets/redirect-editor-B9a7bR4b.js +1 -0
- package/dist/client/assets/registry-DJi9P9E9.js +2 -0
- package/dist/client/assets/{registry-layout-8a-v4D4w.js → registry-layout-DY-ilKoy.js} +1 -1
- package/dist/client/assets/{reports-s9Svwh5t.js → reports-dy7OW4nR.js} +1 -1
- package/dist/client/assets/{repositories-DmXLABm9.js → repositories-B3EUtLfQ.js} +1 -1
- package/dist/client/assets/{repository-import-picker-_l8ASYjL.js → repository-import-picker-Ds-7ia8x.js} +1 -1
- package/dist/client/assets/{repository-picker-BccrsPEM.js → repository-picker-zcqpFECf.js} +1 -1
- package/dist/client/assets/{require-capability-Bkv89TrS.js → require-capability-BkcUyh1H.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DJNMkIXV.js → required-auth-layout-BkCbiYhR.js} +1 -1
- package/dist/client/assets/{reset-password-BIeLWYRD.js → reset-password-B5BEqtw9.js} +1 -1
- package/dist/client/assets/{review-settings-2purjtcb.js → review-settings-V3J_suZO.js} +1 -1
- package/dist/client/assets/{roles-B7gOar-B.js → roles-CFXICquL.js} +1 -1
- package/dist/client/assets/{schema-CAcwVKmY.js → schema-DQTSPDPc.js} +1 -1
- package/dist/client/assets/{scroll-area-DkGYPmJq.js → scroll-area-Bk3bop_C.js} +1 -1
- package/dist/client/assets/{search-input-BiMlIRHS.js → search-input-Cr1xDzOR.js} +1 -1
- package/dist/client/assets/{secrets-CyoBUMAP.js → secrets-D4THHRB2.js} +1 -1
- package/dist/client/assets/{sections-editor-C9s3lw32.js → sections-editor-of2aPbXF.js} +1 -1
- package/dist/client/assets/{select-B8LB9lO7.js → select-VruWLBER.js} +1 -1
- package/dist/client/assets/{select-model-Baf2kyO0.js → select-model-R6GRqP4o.js} +1 -1
- package/dist/client/assets/{self-tool-result-Slq8ovsm.js → self-tool-result-B6OwqL4s.js} +1 -1
- package/dist/client/assets/{seo-editor-C45phfWQ.js → seo-editor-BdFo1CDL.js} +1 -1
- package/dist/client/assets/settings-layout-BoOxkANz.js +1 -0
- package/dist/client/assets/{settings-sidebar-BiJXC2C-.js → settings-sidebar-fJ4N2ofG.js} +1 -1
- package/dist/client/assets/{shell-controls-6IQR3cDd.js → shell-controls-Di6eVhxs.js} +1 -1
- package/dist/client/assets/{shell-layout-CO1dT5ds.js → shell-layout-DtX3xYLo.js} +1 -1
- package/dist/client/assets/{skill-preview-UZAbAgBZ.js → skill-preview-Cn_VmuJU.js} +1 -1
- package/dist/client/assets/{skills-D2qDiu5k.js → skills-BYyTg_dQ.js} +1 -1
- package/dist/client/assets/{sso-CEWJ6VLR.js → sso-B4-17OvU.js} +1 -1
- package/dist/client/assets/{store-CyL9NuEO.js → store-duvEEQay.js} +1 -1
- package/dist/client/assets/store-registry-BQF4DMVv.js +2 -0
- package/dist/client/assets/{switch-BZ58mkBX.js → switch-D5mDYZzD.js} +1 -1
- package/dist/client/assets/{synced-repos-ChDFGnqn.js → synced-repos-BcFubVX4.js} +1 -1
- package/dist/client/assets/{table-CmlmtKb5.js → table-Co1Yo9Ou.js} +1 -1
- package/dist/client/assets/{tabs-d7ElgGKc.js → tabs-CzhgwOMh.js} +1 -1
- package/dist/client/assets/{task-board-Cnr1TJQ1.js → task-board-F9nWsjW0.js} +1 -1
- package/dist/client/assets/{task-route-B574jwlk.js → task-route-C50QtiSH.js} +1 -1
- package/dist/client/assets/{tasks-B0RW0MCw.js → tasks-PqS_Dc-u.js} +1 -1
- package/dist/client/assets/{textarea-BhDs4BBF.js → textarea-D5yUmTuo.js} +1 -1
- package/dist/client/assets/{thread-intent-CHazkyv1.js → thread-intent-CqM5vUU9.js} +1 -1
- package/dist/client/assets/{thread-route-BQtBayab.js → thread-route-B_3hJRNO.js} +1 -1
- package/dist/client/assets/{toggle-group-Bq2mpWXX.js → toggle-group-C6RmEYNw.js} +1 -1
- package/dist/client/assets/{toolbar-CegxR6KC.js → toolbar-DalvtXvG.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Bb7pbVII.js → toolbar-icon-button-aV5MA64L.js} +1 -1
- package/dist/client/assets/{track-Cplx0Mu9.js → track-IbgYjppW.js} +1 -1
- package/dist/client/assets/{types-C3giwja2.js → types-CaQxQn--.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CwXo7Cny.js → use-ai-providers-CBAbpFCs.js} +1 -1
- package/dist/client/assets/{use-automations-BElfIooR.js → use-automations-HZOOTOR3.js} +1 -1
- package/dist/client/assets/{use-autosave-Cph-jhEM.js → use-autosave-Cd2yn2WA.js} +1 -1
- package/dist/client/assets/{use-connection-FIA-Lf_9.js → use-connection-Cxk618DD.js} +1 -1
- package/dist/client/assets/{use-copy-Bdm0S55W.js → use-copy-JToNQsYl.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DWkmjuGw.js → use-create-virtual-mcp-BDVK9Nnk.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-BjUZEcSO.js → use-date-fns-locale-BC9XewCs.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BzRg2UAO.js → use-debounced-autosave-ChhxmJyP.js} +1 -1
- package/dist/client/assets/{use-debounced-value-BuXRpR3Q.js → use-debounced-value-B2sataBb.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BRvv0b78.js → use-decopilot-events-w-PNw0gQ.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DfegaiO4.js → use-delete-connection-C0Ue1RpB.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CrJxsiox.js → use-deployment-admin-FdJOF92N.js} +1 -1
- package/dist/client/assets/{use-destination-route-CTsCUJVB.js → use-destination-route-DaFWrAHj.js} +1 -1
- package/dist/client/assets/{use-file-configs-lycL_AWx.js → use-file-configs-BszfQ6Ii.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DChOO1cg.js → use-infinite-scroll-UlP3mdDG.js} +1 -1
- package/dist/client/assets/{use-join-requests-Dt0o50jr.js → use-join-requests-DbLnXh7p.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-CBOBI4HE.js → use-mcp-auth-status-Dm4k96-0.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CuZUnG6t.js → use-mcp-client-BS1HAuw9.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-HyDOtegX.js → use-mcp-prompts-Bqus7nV6.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CgIxaS-u.js → use-mcp-tools-CcPY1kUa.js} +1 -1
- package/dist/client/assets/{use-members-f6D1bcBl.js → use-members-BPrB4_B6.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-i21QRbbT.js → use-navigate-to-agent-yGdOMWOW.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-9XX1c-po.js → use-org-auth-client-BfcHu9OA.js} +1 -1
- package/dist/client/assets/{use-org-notice-D5-v8g1h.js → use-org-notice-CGWZZ-Tj.js} +1 -1
- package/dist/client/assets/{use-org-sso-CMIztxNP.js → use-org-sso-BD6r6b1F.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BupS39pr.js → use-organization-roles-CSUyN-QR.js} +1 -1
- package/dist/client/assets/{use-organization-settings-CKyr56Kd.js → use-organization-settings-zsIQ5yKP.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DlAzxK8S.js → use-panel-navigate-Bnu_Y_WK.js} +1 -1
- package/dist/client/assets/{use-registry-connections-DhQHrKbp.js → use-registry-connections-D6NYr_lo.js} +1 -1
- package/dist/client/assets/{use-secrets-DNJM3_Iq.js → use-secrets-CEAwJE8l.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-nhx9elgv.js → use-section-preview-base-CPX3fQrj.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Da9LCTcB.js → use-status-sounds-BSHc34AF.js} +1 -1
- package/dist/client/assets/{use-tags-clLk5v1W.js → use-tags-u-doSjgu.js} +1 -1
- package/dist/client/assets/{use-view-mode-jaWbiw3O.js → use-view-mode-DIiapwc1.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DFQ-_cXE.js → use-virtual-mcp-Ck5PGc0k.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-ctaGuyQM.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-IjFUp4RN.js +1 -0
- package/dist/client/assets/{users-CLqg0p6h.js → users-BitUrleX.js} +1 -1
- package/dist/client/assets/{variant-calendar-DN--0tLd.js → variant-calendar-52K0113C.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CRobbFgX.js → view-mode-toggle-tmEIJIQR.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/analytics-tab-CZWO9-z3.js +0 -2
- package/dist/client/assets/api-keys-BC4QXn71.js +0 -1
- package/dist/client/assets/app-editor-zB_RgTfi.js +0 -1
- package/dist/client/assets/hosting-tab-BhNndoGk.js +0 -1
- package/dist/client/assets/index-7CIwuxYk.css +0 -1
- package/dist/client/assets/record-editor-W0g2bYOc.js +0 -1
- package/dist/client/assets/redirect-editor-D7U0akLq.js +0 -1
- package/dist/client/assets/registry-BQLcUCof.js +0 -2
- package/dist/client/assets/settings-layout-6xaNrNLJ.js +0 -1
- package/dist/client/assets/store-registry-Ba8_Y8s8.js +0 -2
- package/dist/client/assets/useInfiniteQuery-BWFATqB4.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BiSsymj1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,G as Q,K as R,m as ce,n as U,e as V,j as i,ds as de,b as F,r as O,b1 as me,b6 as J,B as v,t as q}from"./index-Duje61Xv.js";import{i as ue}from"./AlertCircle-BnJSjvRr.js";import{a as fe}from"./Copy01-DCWIjDLi.js";import{i as W}from"./Key01-Cgpr5iVq.js";import{s as X}from"./Plus-C4BLg9rY.js";import{s as ge}from"./Trash01-DTRwSnwl.js";import{A as pe,a as ye,b as xe,c as he,d as je,e as Ke,f as Ce,g as be}from"./alert-dialog-B9Cqya-5.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-B04kc62g.js";import{I as le}from"./input-CnXtEqVa.js";import{L as De}from"./label-Cde57soC.js";import{S as Y,u as G}from"./use-mcp-client-CuZUnG6t.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:Y,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=G(r);let s;e[3]!==a.id?(s=R.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return H(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Y,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=G(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return H(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:R.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Y,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=G(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:R.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(ue,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(W,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(ge,{size:14}),e[13]=f):f=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:f}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let u;return e[17]!==d||e[18]!==g?(u=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=u):u=e[19],u}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(W,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[12]=m):m=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let g;e[15]!==a||e[16]!==f?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,f]}),e[15]=a,e[16]=f,e[17]=g):g=e[17];let u;return e[18]!==d||e[19]!==g?(u=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=u):u=e[20],u}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let f;e[10]!==o||e[11]!==m?(f=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=f):f=e[12];const g=a?.key??"";let u;e[13]!==g?(u=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=u):u=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(fe,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==u?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[u,x]}),e[24]=x,e[25]=u,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==f?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let f;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(f=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const M=B;q.error(M instanceof Error?M.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=f):f=e[7];const g=f;let u;e[8]!==m||e[9]!==r?(u=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=u):u=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=z=>c(z.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==u?($=i.jsx(ne,{open:a,onOpenChange:u,children:L}),e[60]=a,e[61]=L,e[62]=u,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),f=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(u){q.error(u instanceof Error?u.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:f.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(X,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&f.length===0?i.jsx(ae,{error:r}):f.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:f.map(u=>i.jsx(Ne,{apiKey:u,onDelete:()=>m(u)},u.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:u=>{u||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
1
|
+
import{c as A,G as Q,K as R,m as ce,n as U,e as V,j as i,ds as de,b as F,r as O,b1 as me,b6 as J,B as v,t as q}from"./index-D6kz3ebr.js";import{i as ue}from"./AlertCircle-C2I0CPt8.js";import{a as fe}from"./Copy01-BzbXBjHv.js";import{i as W}from"./Key01-DquPZpqN.js";import{s as X}from"./Plus-5jblmb5M.js";import{s as ge}from"./Trash01-D5ciFh4O.js";import{A as pe,a as ye,b as xe,c as he,d as je,e as Ke,f as Ce,g as be}from"./alert-dialog-BikX6FFY.js";import{d as Z,h as ee,c as te,e as se,b as ie,D as ne}from"./dialog-B0OdXcqs.js";import{I as le}from"./input-SHpohkkd.js";import{L as De}from"./label-rD90jMRy.js";import{S as Y,u as G}from"./use-mcp-client-BS1HAuw9.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:Y,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=G(r);let s;e[3]!==a.id?(s=R.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return H(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Y,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=G(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return H(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:R.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Y,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=G(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:R.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(ue,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(W,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(ge,{size:14}),e[13]=f):f=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive shrink-0",onClick:r,"aria-label":m,children:f}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let u;return e[17]!==d||e[18]!==g?(u=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=u):u=e[19],u}function we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(W,{size:20,className:"text-muted-foreground"})}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(X,{size:14}),e[12]=m):m=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let g;e[15]!==a||e[16]!==f?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,f]}),e[15]=a,e[16]=f,e[17]=g):g=e[17];let u;return e[18]!==d||e[19]!==g?(u=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=u):u=e[20],u}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(Z,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(ee,{children:d}),e[8]=d,e[9]=m):m=e[9];let f;e[10]!==o||e[11]!==m?(f=i.jsxs(te,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=f):f=e[12];const g=a?.key??"";let u;e[13]!==g?(u=i.jsx(le,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=u):u=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(fe,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==u?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[u,x]}),e[24]=x,e[25]=u,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(se,{children:i.jsx(v,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let b;e[32]!==h||e[33]!==K||e[34]!==f?(b=i.jsxs(ie,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=b):b=e[35];let D;return e[36]!==s||e[37]!==b||e[38]!==n?(D=i.jsx(ne,{open:s,onOpenChange:n,children:b}),e[36]=s,e[37]=b,e[38]=n,e[39]=D):D=e[39],D}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let f;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(f=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const M=B;q.error(M instanceof Error?M.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=f):f=e[7];const g=f;let u;e[8]!==m||e[9]!==r?(u=z=>{z?r(z):m()},e[8]=m,e[9]=r,e[10]=u):u=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(Z,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(ee,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(te,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(De,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let b;e[26]===Symbol.for("react.memo_cache_sentinel")?(b=z=>c(z.target.value),e[26]=b):b=e[26];let D;e[27]!==s?(D=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=D):D=e[28];let S;e[29]!==n||e[30]!==D?(S=i.jsx(le,{id:"api-key-name",value:n,onChange:b,placeholder:D,autoComplete:"off",required:!0}),e[29]=n,e[30]=D,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(se,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(ie,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let $;return e[60]!==a||e[61]!==L||e[62]!==u?($=i.jsx(ne,{open:a,onOpenChange:u,children:L}),e[60]=a,e[61]=L,e[62]=u,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.useState(null),f=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(u){q.error(u instanceof Error?u.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:f.length>0?i.jsxs(v,{onClick:()=>n(!0),size:"sm",children:[i.jsx(X,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&f.length===0?i.jsx(ae,{error:r}):f.length===0?i.jsx(we,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:f.map(u=>i.jsx(Ne,{apiKey:u,onDelete:()=>m(u)},u.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:u=>{u||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(be,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Ye as O,Ae as a,Se as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as jt,b as Bt,r as A,j as o,l as _t,h as wt,t as ht}from"./index-D6kz3ebr.js";import{b as At}from"./chat-context-CvoU8WQ4.js";import{i as Et}from"./ChevronRight-r0gLJbn2.js";import{S as Nt}from"./scroll-area-Bk3bop_C.js";import{u as Rt,A as Tt}from"./use-section-preview-base-CPX3fQrj.js";import{n as Ct,r as Kt,c as Pt,d as Ft,e as Ot,g as Ut,h as $t,S as It,i as zt,j as Lt}from"./index-B5IAGVkM.js";import"./use-panel-navigate-Bnu_Y_WK.js";import"./use-destination-route-DaFWrAHj.js";import"./autosend-D9JhT_oZ.js";import"./thread-intent-CqM5vUU9.js";import"./slugify-CEUa2lfQ.js";import"./hooks-BJUiYjpq.js";import"./use-mcp-client-BS1HAuw9.js";import"./auth-CNVXmSkG.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-pjl5bOdE.js";import"./task-board-F9nWsjW0.js";import"./schema-DQTSPDPc.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Ck5PGc0k.js";import"./use-ai-providers-CBAbpFCs.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-w-PNw0gQ.js";import"./thread-route-B_3hJRNO.js";import"./dialog-B0OdXcqs.js";import"./Check-sicxXYN7.js";import"./Copy01-BzbXBjHv.js";import"./Download01-Db1D2BD0.js";import"./use-organization-settings-zsIQ5yKP.js";import"./select-VruWLBER.js";import"./ChevronUp-CBLrm_OT.js";import"./agent-icon-BMTcgZga.js";import"./AlertCircle-C2I0CPt8.js";import"./Tool01-DCz0PgHD.js";import"./ArrowUp-DF6vzMhN.js";import"./ArrowLeft-DiFtyxtp.js";import"./Tool02-Dx9QVS5U.js";import"./ArrowRight-Cr3akrFT.js";import"./TrendUp01-DjG8w8m_.js";import"./ZoomOut-B_xPvOLH.js";import"./Users03-DPq3XXBm.js";import"./CheckCircle-Cbkf0Hrm.js";import"./ChevronSelectorVertical-CejccrOe.js";import"./DotsVertical-Cyt1EoXA.js";import"./UserSquare-Bi0Jy-6E.js";import"./CreditCard01-C8AQ6_dn.js";import"./Settings02-5WiTDc8b.js";import"./Eye-QPQVcqGb.js";import"./Share07-DzTdSg05.js";import"./GitBranch01-D3Ep4J5o.js";import"./Globe01-dlVOEKaQ.js";import"./XClose-hM3AAAai.js";import"./HardDrive-W8kLhAmw.js";import"./Image01-B1m-gUl3.js";import"./Key01-DquPZpqN.js";import"./Link01-ClTL5UTN.js";import"./LinkExternal01-BepJT7Oz.js";import"./Monitor01-Bndg-M3Y.js";import"./Sun-Bxqb4eKN.js";import"./Package-B2Up-gTH.js";import"./Palette-BsEqDIgy.js";import"./Play-DZtU_bVy.js";import"./Plus-5jblmb5M.js";import"./SearchLg-DFeP1_X8.js";import"./SearchMd-CnBFXj_Z.js";import"./Shield01-qqcKLTxE.js";import"./Stars01-CFR1c-1g.js";import"./Trash01-D5ciFh4O.js";import"./Upload01-Dbydv0Li.js";import"./User01-Dq0QszR-.js";import"./Users01-C_RVSWfd.js";import"./XCircle-CiIZAkGm.js";import"./Zap-Bb7Qo7M3.js";import"./input-SHpohkkd.js";import"./automation-runs-2af22T9w.js";import"./useInfiniteQuery-ctaGuyQM.js";import"./infiniteQueryObserver-Dld3rVqh.js";import"./use-connection-Cxk618DD.js";import"./table-Co1Yo9Ou.js";import"./empty-state-UGFooPJ_.js";import"./use-infinite-scroll-UlP3mdDG.js";import"./use-members-BPrB4_B6.js";import"./use-org-auth-client-BfcHu9OA.js";import"./use-automations-HZOOTOR3.js";import"./useSuspenseInfiniteQuery-IjFUp4RN.js";import"./avatar-CPkw3h7t.js";import"./format-time-BtXRrtv4.js";import"./differenceInSeconds-C3x8sHUj.js";import"./use-copy-JToNQsYl.js";import"./markdown-DOFXhXXc.js";import"./monaco-editor-BncUqSbn.js";import"./editor-DDZRpuBY.js";import"./mcp-app-renderer-DzI0XDOX.js";import"./types-CaQxQn--.js";import"./shell-layout-DtX3xYLo.js";import"./project-icon-DB0uWZzs.js";import"./github-repo-CTPv5ZM2.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-CqNTTNRi.js";import"./index-ObR7HuX3.js";import"./integration-icon-BQARLIol.js";import"./required-auth-layout-BkCbiYhR.js";import"./use-org-sso-BD6r6b1F.js";import"./use-org-notice-CGWZZ-Tj.js";import"./use-navigate-to-agent-yGdOMWOW.js";import"./use-mcp-prompts-Bqus7nV6.js";import"./form-TWkufiDd.js";import"./label-rD90jMRy.js";import"./file-type-icon-DnRMRlEa.js";import"./drawer-C2s6Up5H.js";import"./collection-search-CJb7f2bn.js";import"./tabs-CzhgwOMh.js";import"./toggle-group-C6RmEYNw.js";import"./task-route-C50QtiSH.js";import"./extract-connection-data-BPXLZ9J6.js";import"./metadata-dUsYcpuu.js";import"./connection-DtCer1Uy.js";import"./connection-card-BzEzwA5b.js";import"./use-registry-connections-D6NYr_lo.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-D5yUmTuo.js";import"./connection-form-helpers-swpd49hK.js";import"./authenticate-and-persist-oauth-DZYDyEg2.js";import"./mcp-oauth-DHIeN6FN.js";import"./collection-tabs-BxnrIEJp.js";import"./badge-C_ARXG3i.js";import"./use-file-configs-BszfQ6Ii.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-CoV3z2Yq.js";import"./popover-DClv4J5a.js";import"./github-icon-DMu-fvNj.js";import"./get-initials-D-f_fDFw.js";import"./select-model-R6GRqP4o.js";import"./checkbox-Cgrb5XJJ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-D1UH1rlz.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-BSHc34AF.js";import"./toolbar-DalvtXvG.js";import"./use-mcp-tools-CcPY1kUa.js";import"./skill-preview-Cn_VmuJU.js";import"./use-date-fns-locale-BC9XewCs.js";import"./alert-dialog-BikX6FFY.js";import"./use-debounced-autosave-ChhxmJyP.js";import"./search-input-Cr1xDzOR.js";import"./use-mcp-auth-status-Dm4k96-0.js";import"./switch-D5mDYZzD.js";import"./breadcrumb-CsyYyKv7.js";import"./repository-import-picker-Ds-7ia8x.js";import"./repository-picker-zcqpFECf.js";import"./use-debounced-value-B2sataBb.js";import"./use-secrets-CEAwJE8l.js";import"./client-icons-B-EXG49U.js";import"./connect-layout-TQ2j2S05.js";import"./self-tool-result-B6OwqL4s.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./track-IbgYjppW.js";import"./use-tags-u-doSjgu.js";import"./toolbar-icon-button-aV5MA64L.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-Dj0Hlwog.js";import"./site-error--i37Vnuw.js";import"./cards-C17dmtwv.js";function Vt(n,t){const m=(n.title||n.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),i=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",s=Ct(t,i);return{blockKey:s,data:{__resolveType:n.resolveType,name:s}}}function Jr(n){const t=jt.c(79),{orgSlug:m,virtualMcpId:i,branch:s,blockKey:p,block:x,meta:a,decofile:l,title:bt,excludeFields:Z,schemaPending:lt,previewBaseUrl:ct}=n,D=lt===void 0?!1:lt,H=ct===void 0?null:ct,G=At()?.taskId??null,c=Bt();let N;t[0]!==H||t[1]!==i?(N={virtualMcpId:i,sandboxUrl:H},t[0]=H,t[1]=i,t[2]=N):N=t[2];const h=Rt(N),v=typeof x?.__resolveType=="string"?x.__resolveType:"";let R;t[3]!==Z||t[4]!==a||t[5]!==v?(R=Kt(v,a,Z),t[3]=Z,t[4]=a,t[5]=v,t[6]=R):R=t[6];const b=R;let T;t[7]!==b?(T=!!b&&Object.keys(b.properties??{}).length>0,t[7]=b,t[8]=T):T=t[8];const J=T,dt=bt??(x?Pt(p,x,a):p);let C;t[9]!==s||t[10]!==m||t[11]!==i?(C={orgSlug:m,virtualMcpId:i,branch:s},t[9]=s,t[10]=m,t[11]=i,t[12]=C):C=t[12];const{save:S,flush:Q,isPending:W}=Ft(C);let K;t[13]!==s||t[14]!==m||t[15]!==i?(K={orgSlug:m,virtualMcpId:i,branch:s},t[13]=s,t[14]=m,t[15]=i,t[16]=K):K=t[16];const X=Ot(K);let P;t[17]!==S?(P=zt((e,r)=>S(e,r)),t[17]=S,t[18]=P):P=t[18];const Y=P,[vt,St]=A.useState(p),[tt,ut]=A.useState(null),[et,ft]=A.useState(0);let F;t[19]===Symbol.for("react.memo_cache_sentinel")?(F=[],t[19]=F):F=t[19];const[g,xt]=A.useState(F),[ot,d]=A.useState(!1),O=A.useRef(null);vt!==p&&(St(p),ut(null),ft(Mt),xt([]));let U;t[20]!==x?(U=x??{},t[20]=x,t[21]=U):U=t[21];const rt=U;let y;t[22]!==tt?(y=tt??{},t[22]=tt,t[23]=y):y=t[23];let $;t[24]!==rt||t[25]!==y?($={...rt,...y},t[24]=rt,t[25]=y,t[26]=$):$=t[26];const it=$;let I;t[27]!==p||t[28]!==v||t[29]!==S?(I=e=>{const r=e;ut(r),S(p,{...r,__resolveType:v})},t[27]=p,t[28]=v,t[29]=S,t[30]=I):I=t[30];const mt=I;let z;t[31]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{xt(e)},t[31]=z):z=t[31];const E=z;let L;t[32]!==l||t[33]!==Q||t[34]!==X||t[35]!==c?(L=async(e,r)=>{try{const{blockKey:u,data:f}=Vt(e,l);await X.mutateAsync({blockKey:u,data:f}),ht.success(c("sandbox.appEditor.createdSection",{name:u})),r({__resolveType:u}),Q()}catch(u){const f=u,kt=f instanceof Error?f.message:c("sandbox.appEditor.failedAddSection");throw ht.error(kt),f}},t[32]=l,t[33]=Q,t[34]=X,t[35]=c,t[36]=L):L=t[36];const k=L;let V;t[37]!==d?(V=e=>{O.current=e.append,d(!0)},t[37]=d,t[38]=V):V=t[38];const st=V;let q;t[39]!==k||t[40]!==d?(q=async e=>{const r=O.current;if(r)try{await k(e,u=>{r(u),d(!1),O.current=null})}catch{}},t[39]=k,t[40]=d,t[41]=q):q=t[41];const pt=q,at=g.length>0?[dt,...g]:[],gt="flex h-full flex-col",yt="flex h-12 shrink-0 items-center justify-between border-b px-6",nt=at.length>0?o.jsx("nav",{"aria-label":c("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:at.map((e,r)=>{const u=r===at.length-1,f=Ut(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[r>0&&o.jsx(Et,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{E(r===0?[]:$t(g,r)),ft(qt)},title:f,className:_t("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",u?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:f})]},`${f}-${r}`)})}):o.jsx("span",{className:"text-sm font-medium",children:dt});let j;t[42]!==W?(j=o.jsx(Lt,{isPending:W,isError:!1}),t[42]=W,t[43]=j):j=t[43];let B;t[44]!==nt||t[45]!==j?(B=o.jsxs("div",{className:yt,children:[nt,j]}),t[44]=nt,t[45]=j,t[46]=B):B=t[46];let _;t[47]!==p||t[48]!==s||t[49]!==g||t[50]!==l||t[51]!==it||t[52]!==et||t[53]!==k||t[54]!==E||t[55]!==mt||t[56]!==st||t[57]!==J||t[58]!==a||t[59]!==m||t[60]!==Y||t[61]!==b||t[62]!==D||t[63]!==h||t[64]!==c||t[65]!==G||t[66]!==i?(_=o.jsx(Nt,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsx("div",{className:"mx-auto max-w-xl",children:J?o.jsx(It,{schema:b,value:it,onChange:mt,basePath:"",breadcrumbPath:g,onBreadcrumbChange:E,decofile:l,meta:a,onSaveReferencedBlock:Y,previewBaseUrl:h,onAddSectionItem:k,onRequestAddSection:st,sandbox:{orgSlug:m,virtualMcpId:i,branch:s,threadId:G}},`${p}:${et}`):D?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(wt,{className:"size-4"}),c("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:c("sandbox.appEditor.noEditableSchema")})})})}),t[47]=p,t[48]=s,t[49]=g,t[50]=l,t[51]=it,t[52]=et,t[53]=k,t[54]=E,t[55]=mt,t[56]=st,t[57]=J,t[58]=a,t[59]=m,t[60]=Y,t[61]=b,t[62]=D,t[63]=h,t[64]=c,t[65]=G,t[66]=i,t[67]=_):_=t[67];let w;t[68]!==ot||t[69]!==l||t[70]!==pt||t[71]!==a||t[72]!==h||t[73]!==d?(w=h&&o.jsx(Tt,{open:ot,onOpenChange:e=>{d(e),e||(O.current=null)},meta:a,decofile:l,previewBaseUrl:h,onSelect:e=>{pt(e)}}),t[68]=ot,t[69]=l,t[70]=pt,t[71]=a,t[72]=h,t[73]=d,t[74]=w):w=t[74];let M;return t[75]!==B||t[76]!==_||t[77]!==w?(M=o.jsxs("div",{className:gt,children:[B,_,w]}),t[75]=B,t[76]=_,t[77]=w,t[78]=M):M=t[78],M}function qt(n){return n+1}function Mt(n){return n+1}export{Jr as AppEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dD as v,dE as $,dF as W,dG as L,dH as H,dI as D,dJ as V,dK as x,dL as q,dM as j,dN as y,dO as N,dP as B,dQ as F,dR as Z}from"./index-Duje61Xv.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
|
|
1
|
+
import{dD as v,dE as $,dF as W,dG as L,dH as H,dI as D,dJ as V,dK as x,dL as q,dM as j,dN as y,dO as N,dP as B,dQ as F,dR as Z}from"./index-D6kz3ebr.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function K(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function Q(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&K(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Y(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=N.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=B[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof H||n instanceof D)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof V)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await T(c,{fetchFn:i}),!o)try{o=await P(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new q(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof j)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:I,codeVerifier:b}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(b),await e.redirectToAuthorization(I),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function P(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return v.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function T(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?$.parse(await o.json()):W.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await P(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await T(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await Z(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=Q(r,h);Y(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return x.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return F.parse(await s.json())}export{pe as U,_e as a,T as b,me as c,P as d,Ue as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-
|
|
1
|
+
import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-D6kz3ebr.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,F as Fe,r as v,e as me,o as z,j as t,l as N,B as xe,n as Be,m as Ve,K as ue,c as oe,b as be,h as _e}from"./index-Duje61Xv.js";import{I as ee}from"./input-CnXtEqVa.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as Qe,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:n,email:e,password:m,name:f})=>n==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={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:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,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 Ye({redirectUrl:n,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,le=C.enabled&&(g||!y.enabled&&!se),de=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!le?S.providers:te,h=S.enabled&&de.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,Q]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[W,q]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Te,he]=v.useState(null),i={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=W==="signUp",U=W==="forgotPassword",T=W==="emailOtp",ie=me({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?i.signUpFailed:i.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(i.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),z(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=me({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||i.resetEmailFailed);return l},onSuccess:()=>{z("password_reset_requested"),ve(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||i.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||i.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&H(i.invalidEmail)},Re=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:$})},De=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail);return}re.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{q(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,B=I?b.trim()&&L.trim()&&$.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?i.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?i.accountExists:l.includes("network")||l.includes("fetch")?i.networkError:l.includes("rate limit")||l.includes("429")?i.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?i.invalidOrExpiredCode:s.message||i.genericError},Pe=je||Ne||Ae||Te,Ue=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:n??e});if(l.error)throw new Error(l.error.message||i.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},$e=U?i.resetPasswordTitle:T&&x?i.verificationCodeTitle:m??i.welcomeTitle,Ce=U?i.resetPasswordSubtitle:T&&x?i.codeSentTo(b):f===void 0?i.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:$e}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:i.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{Ue(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),i.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:i.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:i.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.verifying:i.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:i.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:i.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.sending:i.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:De,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!B,className:"w-full font-semibold",size:"xl",children:E?i.sending:i.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Re,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:i.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:i.namePlaceholder,value:$,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:i.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:i.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!B,className:N("w-full font-semibold"),size:"xl","aria-hidden":!B,children:E?I?i.creatingAccount:i.signingIn:i.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?i.alreadyHaveAccount:i.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ge,children:I?i.signIn:i.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ge,children:i.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const n=Be(),e=ze(),m=Ve({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await fe()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,n]);async function C(){p(!0),r(null);try{const o=await fe();await o.performAuthLogin();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await fe();await o.performAuthLogout();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await fe()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function Xe(){return oe.c(10),Ge(),null}function Ze(n){const e=oe.c(25),{onContinue:m,isPending:f,error:p}=n,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(n){const e=oe.c(8),{label:m,error:f}=n;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(_e,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function tt({redirectTo:n,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await Qe(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(n))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[n]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(Oe,{})}function Oe(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function st({callbackURL:n,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:n});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,n]),t.jsx(Oe,{})}function ot(n){const e=oe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=n,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let Q;e[2]!==_||e[3]!==L?(Q={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const $=Q;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(de&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=$.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:le,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||le.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const W=M;if(!a)return W;let q;e[42]!==a?(q=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=q):q=e[43];let j;return e[44]!==W||e[45]!==q?(j=t.jsxs("div",{className:"grid gap-4",children:[q,W]}),e[44]=W,e[45]=q,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{Oe as A,ot as a,Ge as u};
|
|
1
|
+
import{a as V,F as Fe,r as v,e as me,o as z,j as t,l as N,B as xe,n as Be,m as Ve,K as ue,c as oe,b as be,h as _e}from"./index-D6kz3ebr.js";import{I as ee}from"./input-SHpohkkd.js";import{i as ze}from"./use-is-desktop-app-BNujXJc_.js";import{r as Qe,R as He}from"./retry-CErkP7V6.js";const Le={submitEmailPassword:({mode:n,email:e,password:m,name:f})=>n==="sign_up"?V.signUp.email({email:e,password:m,name:f||""}):V.signIn.email({email:e,password:m}),requestPasswordReset:({email:n,redirectTo:e})=>V.requestPasswordReset({email:n,redirectTo:e}),sendOtp:({email:n})=>V.emailOtp.sendVerificationOtp({email:n,type:"sign-in"}),submitOtp:({email:n,otp:e})=>V.signIn.emailOtp({email:n,otp:e}),socialSignIn:({provider:n,callbackURL:e})=>V.signIn.social({provider:n,callbackURL:e}),ssoSignIn:({providerId:n,callbackURL:e})=>V.signIn.sso({providerId:n,callbackURL:e}),onAuthenticated:n=>{window.location.href=n}},ge="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Ke={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:n=>`Code sent to ${n}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:n=>`Continue with ${n}`,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 Ye({redirectUrl:n,callbackUrl:e="/",title:m,subtitle:f,brand:p,copy:u,variant:r="default",allowedSocialProviders:d,allowPassword:g=!0,onAuthEvent:k,actions:A}){const{emailAndPassword:C,resetPassword:w,emailOtp:y,socialProviders:S}=Fe(),o={...Le,...A},c=s=>{try{k?.(s)}catch{}},P=r==="compact",te=d?S.providers.filter(s=>d.includes(s.name)):S.providers,se=S.enabled&&te.length>0,le=C.enabled&&(g||!y.enabled&&!se),de=S.enabled&&S.providers.length>0&&!se&&!y.enabled&&!le?S.providers:te,h=S.enabled&&de.length>0,F=C.enabled&&(g||!y.enabled&&!h),[b,_]=v.useState(""),[L,Q]=v.useState(""),[$,O]=v.useState(""),[D,a]=v.useState(""),[x,M]=v.useState(!1),[W,q]=v.useState(()=>y.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[j,H]=v.useState(""),[ye,ve]=v.useState(!1),[Te,he]=v.useState(null),i={...Ke,...u},ne=v.useId(),K=`${ne}-email`,Y=`${ne}-email-error`,we=`${ne}-name`,Ee=`${ne}-password`,Se=`${ne}-otp`,I=W==="signUp",U=W==="forgotPassword",T=W==="emailOtp",ie=me({mutationFn:async({email:s,password:l,name:R})=>{try{const Z=await o.submitEmailPassword({mode:I?"sign_up":"sign_in",email:s,password:l,name:R});if(Z.error)throw new Error(Z.error.message||(I?i.signUpFailed:i.signInFailed));return Z}catch(Z){throw Z instanceof Error?Z:new Error(i.authenticationFailed)}},onMutate:()=>{c({type:"started",method:"email_password",mode:I?"sign_up":"sign_in"})},onSuccess:()=>{c({type:"succeeded",method:"email_password",mode:I?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),z(I?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),re=me({mutationFn:async({email:s})=>{const l=await o.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(l.error)throw new Error(l.error.message||i.resetEmailFailed);return l},onSuccess:()=>{z("password_reset_requested"),ve(!0)},onError:s=>{z("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),G=me({mutationFn:async({email:s})=>{const l=await o.sendOtp({email:s});if(l.error)throw new Error(l.error.message||i.otpSendFailed);return l},onMutate:()=>{c({type:"started",method:"email_otp"})},onSuccess:()=>{c({type:"otp_sent",method:"email_otp"}),z("email_otp_sent"),M(!0)},onError:s=>{c({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),J=me({mutationFn:async({email:s,otp:l})=>{const R=await o.submitOtp({email:s,otp:l});if(R.error)throw new Error(R.error.message||i.invalidCode);return R},onMutate:()=>{c({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{c({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),o.onAuthenticated(n??e)},onError:s=>{c({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),z("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),ce=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),pe=()=>{b.trim()&&!ce(b)&&H(i.invalidEmail)},Re=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_password",mode:I?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}ie.mutate({email:b,password:L,name:$})},De=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail);return}re.mutate({email:b})},Me=s=>{if(s.preventDefault(),!ce(b)){H(i.invalidEmail),c({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}G.mutate({email:b})},We=s=>{s.preventDefault(),J.mutate({email:b,otp:D})},X=s=>l=>{s(l.target.value),je&&ie.reset(),Ne&&re.reset(),Ae&&(G.reset(),J.reset()),s===_&&j&&H("")},ae=s=>{q(s),O(""),a(""),M(!1),H(""),ve(!1),he(null),ie.reset(),re.reset(),G.reset(),J.reset()},E=ie.isPending||re.isPending||G.isPending||J.isPending,je=ie.error,Ne=re.error,Ae=G.error||J.error,B=I?b.trim()&&L.trim()&&$.trim():U?b.trim():T?x?D.trim():b.trim():b.trim()&&L.trim(),qe=s=>{if(!s)return null;const l=s.message.toLowerCase();return l.includes("unauthorized")||l.includes("401")?i.invalidEmailOrPassword:l.includes("already exists")||l.includes("409")?i.accountExists:l.includes("network")||l.includes("fetch")?i.networkError:l.includes("rate limit")||l.includes("429")?i.tooManyAttempts:l.includes("invalid")&&l.includes("otp")?i.invalidOrExpiredCode:s.message||i.genericError},Pe=je||Ne||Ae||Te,Ue=async s=>{c({type:"started",method:"social",provider:s}),he(null);try{const l=await o.socialSignIn({provider:s,callbackURL:n??e});if(l.error)throw new Error(l.error.message||i.authenticationFailed)}catch(l){const R=l instanceof Error?l.message:String(l);c({type:"failed",method:"social",provider:s,stage:"redirect",error:R}),z("social_signin_failed",{provider:s,error:R}),he(l instanceof Error?l:new Error(R))}},$e=U?i.resetPasswordTitle:T&&x?i.verificationCodeTitle:m??i.welcomeTitle,Ce=U?i.resetPasswordSubtitle:T&&x?i.codeSentTo(b):f===void 0?i.defaultSubtitle:f;return t.jsxs("div",{className:N("grid w-full",P?"gap-5":"gap-10"),children:[p??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:N("font-medium",P?"text-xl leading-7":"text-2xl leading-8"),children:$e}),Ce&&t.jsx("p",{className:N("text-muted-foreground",P?"text-sm leading-5":"text-base leading-6"),children:Ce})]}),Pe&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:qe(Pe)}),ye&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:i.resetEmailSent}),!U&&!(T&&x)&&h&&t.jsx("div",{className:"grid gap-2",children:de.map(s=>t.jsxs("button",{type:"button",disabled:E,onClick:()=>{Ue(s.name)},className:N("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",P?"h-11 rounded-lg":"h-12 rounded-xl"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:N("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),i.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!U&&!(T&&x)&&h&&(F||y.enabled)&&t.jsxs("div",{className:N("flex items-center gap-2.5",P?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:N("text-muted-foreground",P?"text-sm":"text-base"),children:i.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),T&&y.enabled&&t.jsx(t.Fragment,{children:x?t.jsxs("form",{onSubmit:We,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:Se,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.verificationCodeLabel}),t.jsx(ee,{id:Se,type:"text",placeholder:i.enterCodePlaceholder,value:D,onChange:X(a),required:!0,disabled:E,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11 rounded-lg"})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.verifying:i.verify}),t.jsx("button",{type:"button",onClick:()=>{M(!1),a(""),G.reset(),J.reset()},disabled:E,className:N("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",P&&"sm:col-span-2"),children:i.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Me,className:N("grid gap-2",P&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:K,className:N("text-sm font-medium text-foreground",P&&"sr-only"),children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:i.emailPlaceholder,value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive",children:j})]}),t.jsx("button",{type:"submit",disabled:E||!B,className:N("flex items-center justify-center rounded-lg bg-primary px-4 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/80 disabled:pointer-events-none disabled:opacity-50",P?"h-11 sm:w-auto":"h-12 w-full"),children:E?i.sending:i.sendCode})]})}),U&&F&&!ye&&t.jsxs("form",{onSubmit:De,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsx(xe,{type:"submit",disabled:E||!B,className:"w-full font-semibold",size:"xl",children:E?i.sending:i.sendResetLink})]}),!U&&!T&&F&&t.jsxs("form",{onSubmit:Re,className:"grid gap-5",children:[I&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:we,className:"block text-sm font-medium text-foreground mb-2",children:i.nameLabel}),t.jsx(ee,{id:we,type:"text",placeholder:i.namePlaceholder,value:$,onChange:X(O),required:!0,disabled:E,autoComplete:"name",className:"h-11 rounded-lg"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:K,className:"block text-sm font-medium text-foreground mb-2",children:i.emailLabel}),t.jsx(ee,{id:K,type:"email",placeholder:"you@example.com",value:b,onChange:X(_),onBlur:pe,required:!0,disabled:E,autoComplete:"email","aria-invalid":!!j,"aria-describedby":j?Y:void 0,className:"h-11 rounded-lg"}),j&&t.jsx("p",{id:Y,role:"alert",className:"text-xs text-destructive mt-1.5",children:j})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:Ee,className:"block text-sm font-medium text-foreground",children:i.passwordLabel}),!I&&w.enabled&&t.jsx("button",{type:"button",onClick:()=>ae("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:i.forgotPassword})]}),t.jsx(ee,{id:Ee,type:"password",placeholder:"••••••••",value:L,onChange:X(Q),required:!0,disabled:E,autoComplete:I?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:N("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",B?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:N("p-1",!B&&"pointer-events-none"),children:t.jsx(xe,{type:"submit",disabled:E||!B,className:N("w-full font-semibold"),size:"xl","aria-hidden":!B,children:E?I?i.creatingAccount:i.signingIn:i.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:U?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.backToSignIn}):T&&F?t.jsx("button",{type:"button",onClick:()=>ae("signIn"),disabled:E,className:ge,children:i.signInWithPassword}):!T&&F?t.jsxs(t.Fragment,{children:[I?i.alreadyHaveAccount:i.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>ae(I?"signIn":"signUp"),disabled:E,className:ge,children:I?i.signIn:i.signUp}),y.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>ae("emailOtp"),disabled:E,className:ge,children:i.signInWithEmailCode})]})]}):null})]})}async function fe(){throw new Error("Tauri bridge is unavailable outside the desktop build")}function Ge(){const n=Be(),e=ze(),m=Ve({queryKey:ue.desktopAuthStatus(),queryFn:async()=>(await fe()).fetchAuthStatus(),enabled:e,staleTime:3e4,refetchOnWindowFocus:!0}),[f,p]=v.useState(!1),[u,r]=v.useState(null),[d,g]=v.useState(!1),[k,A]=v.useState(null);v.useEffect(()=>{},[e,n]);async function C(){p(!0),r(null);try{const o=await fe();await o.performAuthLogin();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}catch(o){r(o instanceof Error?o.message:"Sign-in failed")}finally{p(!1)}}async function w(){p(!0);try{const o=await fe();await o.performAuthLogout();const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{p(!1)}}async function y(){g(!0),A(null);let o;try{o=await fe()}catch(c){A(c instanceof Error?c.message:"Sign-in failed"),g(!1);return}try{await o.performAuthCompleteSession()}catch(c){A(c instanceof Error?c.message:"Sign-in failed")}finally{try{const c=await o.fetchAuthStatus();n.setQueryData(ue.desktopAuthStatus(),c)}finally{g(!1)}}}async function S(){await m.refetch()}return{status:m.data,isChecking:m.isLoading,isRetryingStatus:m.isFetching,isPending:f,loginError:u,login:C,logout:w,isCompletingSession:d,completeSessionError:k,completeSession:y,retryStatus:S}}function Je(n){return!(n.emailAndPassword.enabled||n.emailOtp.enabled||n.socialProviders.enabled)&&!n.sso.enabled&&n.magicLink.enabled}function Xe(){return oe.c(10),Ge(),null}function Ze(n){const e=oe.c(25),{onContinue:m,isPending:f,error:p}=n,u=be();let r;e[0]!==u?(r=u("common.authEntry.browserOnlyTitle"),e[0]=u,e[1]=r):r=e[1];let d;e[2]!==r?(d=t.jsx("h1",{className:"text-lg font-medium text-foreground",children:r}),e[2]=r,e[3]=d):d=e[3];let g;e[4]!==u?(g=u("common.authEntry.browserOnlyDescription"),e[4]=u,e[5]=g):g=e[5];let k;e[6]!==g?(k=t.jsx("p",{className:"max-w-sm text-sm text-muted-foreground",children:g}),e[6]=g,e[7]=k):k=e[7];let A;e[8]!==d||e[9]!==k?(A=t.jsxs("div",{className:"flex flex-col gap-1",children:[d,k]}),e[8]=d,e[9]=k,e[10]=A):A=e[10];let C;e[11]!==m?(C=()=>{m()},e[11]=m,e[12]=C):C=e[12];let w;e[13]!==u?(w=u("common.authEntry.browserOnlyCta"),e[13]=u,e[14]=w):w=e[14];let y;e[15]!==f||e[16]!==C||e[17]!==w?(y=t.jsx(xe,{onClick:C,disabled:f,children:w}),e[15]=f,e[16]=C,e[17]=w,e[18]=y):y=e[18];let S;e[19]!==p?(S=p&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:p}),e[19]=p,e[20]=S):S=e[20];let o;return e[21]!==A||e[22]!==y||e[23]!==S?(o=t.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[A,y,S]}),e[21]=A,e[22]=y,e[23]=S,e[24]=o):o=e[24],o}function Ie(n){const e=oe.c(8),{label:m,error:f}=n;let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(_e,{size:"lg"}),e[0]=p):p=e[0];let u;e[1]!==m?(u=m&&t.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[1]=m,e[2]=u):u=e[2];let r;e[3]!==f?(r=f&&t.jsx("p",{className:"max-w-sm text-xs text-destructive",children:f}),e[3]=f,e[4]=r):r=e[4];let d;return e[5]!==u||e[6]!==r?(d=t.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[p,u,r]}),e[5]=u,e[6]=r,e[7]=d):d=e[7],d}class ke{constructor(e){this.response=e}response}function et(n){return n.startsWith("/")&&!n.startsWith("//")?n:"/"}function tt({redirectTo:n,onAuthEvent:e}){const m=be(),[f,p]=v.useState(null),u=v.useEffectEvent(r=>{try{e?.(r)}catch{}});return v.useEffect(()=>{let r=!1;return(async()=>{u({type:"started",method:"local"});try{let d;try{d=await Qe(async()=>{const g=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(g.status>=500)throw new ke(g);return g},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(g){if(g instanceof He&&g.cause instanceof ke)d=g.cause.response;else throw g}if(!d.ok){const g=await d.json().catch(()=>({}));throw new Error(g?.error||m("common.authEntry.autoLoginFailed"))}r||(u({type:"succeeded",method:"local"}),window.location.href=et(n))}catch(d){r||(u({type:"failed",method:"local",stage:"authenticate",error:d instanceof Error?d.message:String(d)}),p(d instanceof Error?d.message:m("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[n]),f?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:m("common.authEntry.autoLoginFailedWithError",{error:f})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:m("common.authEntry.tryRestartingServer")})]})}):t.jsx(Oe,{})}function Oe(){const n=oe.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(_e,{size:"lg",label:"Signing in"})}),n[0]=e):e=n[0],e}function st({callbackURL:n,providerId:e,ssoSignIn:m,onAuthEvent:f}){const p=v.useEffectEvent(r=>{try{f?.(r)}catch{}}),u=v.useEffectEvent(m);return v.useEffect(()=>{(async()=>{p({type:"started",method:"sso",provider:e});try{const r=await u({providerId:e,callbackURL:n});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){p({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,n]),t.jsx(Oe,{})}function ot(n){const e=oe.c(51),{callbackUrl:m,redirectUrl:f,allowAutoLogin:p,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,onAuthenticated:y}=n,S=p===void 0?!0:p,o=be(),{sso:c,emailAndPassword:P,magicLink:te,emailOtp:se,socialProviders:le,localMode:de}=Fe(),h=Xe(),F=f||m;let b;e[0]!==y?(b=y?{onAuthenticated:y}:void 0,e[0]=y,e[1]=b):b=e[1];const _=b,L=h?.actions;let Q;e[2]!==_||e[3]!==L?(Q={...Le,..._,...L},e[2]=_,e[3]=L,e[4]=Q):Q=e[4];const $=Q;if(h?.isPending){let a;e[5]!==o?(a=o("common.authEntry.finishSignInInBrowser"),e[5]=o,e[6]=a):a=e[6];let x;return e[7]!==h.loginError||e[8]!==a?(x=t.jsx(Ie,{label:a,error:h.loginError}),e[7]=h.loginError,e[8]=a,e[9]=x):x=e[9],x}if(h?.isCompletingSession){let a;e[10]!==o?(a=o("common.authEntry.finishingSignIn"),e[10]=o,e[11]=a):a=e[11];let x;return e[12]!==h.completeSessionError||e[13]!==a?(x=t.jsx(Ie,{label:a,error:h.completeSessionError}),e[12]=h.completeSessionError,e[13]=a,e[14]=x):x=e[14],x}if(de&&S){let a;return e[15]!==w||e[16]!==F?(a=t.jsx(tt,{redirectTo:F,onAuthEvent:w}),e[15]=w,e[16]=F,e[17]=a):a=e[17],a}if(c.enabled){let a;return e[18]!==w||e[19]!==F||e[20]!==$.ssoSignIn||e[21]!==c.providerId?(a=t.jsx(st,{callbackURL:F,providerId:c.providerId,ssoSignIn:$.ssoSignIn,onAuthEvent:w}),e[18]=w,e[19]=F,e[20]=$.ssoSignIn,e[21]=c.providerId,e[22]=a):a=e[22],a}if(h&&Je({emailAndPassword:P,emailOtp:se,socialProviders:le,magicLink:te,sso:c})){let a;return e[23]!==h.isPending||e[24]!==h.login||e[25]!==h.loginError?(a=t.jsx(Ze,{onContinue:h.login,isPending:h.isPending,error:h.loginError}),e[23]=h.isPending,e[24]=h.login,e[25]=h.loginError,e[26]=a):a=e[26],a}if(P.enabled||te.enabled||se.enabled||le.enabled){const a=h?.loginError??h?.completeSessionError??null;let x;e[27]!==_||e[28]!==L?(x={..._,...L},e[27]=_,e[28]=L,e[29]=x):x=e[29];let M;e[30]!==C||e[31]!==A||e[32]!==d||e[33]!==m||e[34]!==g||e[35]!==w||e[36]!==f||e[37]!==r||e[38]!==x||e[39]!==u||e[40]!==k?(M=t.jsx(Ye,{redirectUrl:f,callbackUrl:m,title:u,subtitle:r,brand:d,copy:g,variant:k,allowedSocialProviders:A,allowPassword:C,onAuthEvent:w,actions:x}),e[30]=C,e[31]=A,e[32]=d,e[33]=m,e[34]=g,e[35]=w,e[36]=f,e[37]=r,e[38]=x,e[39]=u,e[40]=k,e[41]=M):M=e[41];const W=M;if(!a)return W;let q;e[42]!==a?(q=t.jsx("div",{className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:a}),e[42]=a,e[43]=q):q=e[43];let j;return e[44]!==W||e[45]!==q?(j=t.jsxs("div",{className:"grid gap-4",children:[q,W]}),e[44]=W,e[45]=q,e[46]=j):j=e[46],j}let O;e[47]!==o?(O=o("common.authEntry.noLoginOptions"),e[47]=o,e[48]=O):O=e[48];let D;return e[49]!==O?(D=t.jsx("div",{children:O}),e[49]=O,e[50]=D):D=e[50],D}export{Oe as A,ot as a,Ge as u};
|
|
@@ -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-D6kz3ebr.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-D6kz3ebr.js";import{i as u,a as p}from"./mcp-oauth-DHIeN6FN.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-Cq-8ml_t.js → automation-list-row-Dj0Hlwog.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as G,b as J,r as U,l as W,j as t,B as X}from"./index-
|
|
1
|
+
import{c as G,b as J,r as U,l as W,j as t,B as X}from"./index-D6kz3ebr.js";import{c as Y,d as Z,b as ee,f as te,g as se,e as ie,a as ne,A as oe}from"./alert-dialog-BikX6FFY.js";import{D as ae,c as re,b as le,a as ce}from"./dropdown-menu-CoV3z2Yq.js";import{A as me,aD as ue}from"./agent-icon-BMTcgZga.js";import{i as de}from"./DotsVertical-Cyt1EoXA.js";import{s as fe}from"./Trash01-D5ciFh4O.js";import{i as ge}from"./Zap-Bb7Qo7M3.js";import{u as xe}from"./use-virtual-mcp-Ck5PGc0k.js";import{u as pe}from"./use-automations-HZOOTOR3.js";function Le(c){const e=G.c(80),{automation:s,showAgent:a,onClick:n}=c,i=J(),{remove:o}=pe(),[l,O]=U.useState(!1),r=xe(a?s.virtual_mcp_id:void 0);let S;e[0]!==s.id||e[1]!==o?(S=()=>{o.mutate(s.id),O(!1)},e[0]=s.id,e[1]=o,e[2]=S):S=e[2];const I=S;let E;e[3]!==n?(E=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=E):E=e[4];const H=E,V=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==V?(u=W("inline-block size-2 rounded-full shrink-0",V),e[5]=V,e[6]=u):u=e[6];const q=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==q?(d=i(q),e[7]=i,e[8]=q,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(me,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==r||e[21]!==a?(p=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[20]=r,e[21]=a,e[22]=p):p=e[22];let h;e[23]!==p||e[24]!==x?(h=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p]}),e[23]=p,e[24]=x,e[25]=h):h=e[25];let j;e[26]!==s.nearest_next_run_at||e[27]!==s.trigger_count?(j=t.jsx(we,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[26]=s.nearest_next_run_at,e[27]=s.trigger_count,e[28]=j):j=e[28];let w;e[29]!==h||e[30]!==j?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[h,j]}),e[29]=h,e[30]=j,e[31]=w):w=e[31];let F;e[32]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(ae,{asChild:!0,children:t.jsx(X,{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(de,{size:16})})}),e[32]=F):F=e[32];let $,B;e[33]===Symbol.for("react.memo_cache_sentinel")?($=m=>{m.stopPropagation(),O(!0)},B=t.jsx(fe,{size:16}),e[33]=$,e[34]=B):($=e[33],B=e[34]);let v;e[35]!==i?(v=i("automations.automationListRow.delete"),e[35]=i,e[36]=v):v=e[36];let D;e[37]!==v?(D=t.jsx("div",{onClick:je,onKeyDown:he,role:"presentation",className:"shrink-0",children:t.jsxs(re,{children:[F,t.jsx(le,{align:"end",children:t.jsxs(ce,{variant:"destructive",onClick:$,children:[B,v]})})]})}),e[37]=v,e[38]=D):D=e[38];let _;e[39]!==H||e[40]!==n||e[41]!==w||e[42]!==D||e[43]!==f||e[44]!==g?(_=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:H,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:[f,g,w,D]}),e[39]=H,e[40]=n,e[41]=w,e[42]=D,e[43]=f,e[44]=g,e[45]=_):_=e[45];let b;e[46]!==i?(b=i("automations.automationListRow.deleteTitle"),e[46]=i,e[47]=b):b=e[47];let A;e[48]!==b?(A=t.jsx(Y,{children:b}),e[48]=b,e[49]=A):A=e[49];let N;e[50]!==s.name||e[51]!==i?(N=i("automations.automationListRow.deleteDescription",{name:s.name}),e[50]=s.name,e[51]=i,e[52]=N):N=e[52];let R;e[53]!==N?(R=t.jsx(Z,{children:N}),e[53]=N,e[54]=R):R=e[54];let y;e[55]!==A||e[56]!==R?(y=t.jsxs(ee,{children:[A,R]}),e[55]=A,e[56]=R,e[57]=y):y=e[57];let C;e[58]!==i?(C=i("automations.automationListRow.cancel"),e[58]=i,e[59]=C):C=e[59];let L;e[60]!==C?(L=t.jsx(te,{children:C}),e[60]=C,e[61]=L):L=e[61];const Q=o.isPending;let k;e[62]!==i?(k=i("automations.automationListRow.deleteButton"),e[62]=i,e[63]=k):k=e[63];let P;e[64]!==I||e[65]!==o.isPending||e[66]!==k?(P=t.jsx(se,{onClick:I,disabled:Q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:k}),e[64]=I,e[65]=o.isPending,e[66]=k,e[67]=P):P=e[67];let T;e[68]!==L||e[69]!==P?(T=t.jsxs(ie,{children:[L,P]}),e[68]=L,e[69]=P,e[70]=T):T=e[70];let z;e[71]!==y||e[72]!==T?(z=t.jsxs(ne,{children:[y,T]}),e[71]=y,e[72]=T,e[73]=z):z=e[73];let M;e[74]!==l||e[75]!==z?(M=t.jsx(oe,{open:l,onOpenChange:O,children:z}),e[74]=l,e[75]=z,e[76]=M):M=e[76];let K;return e[77]!==_||e[78]!==M?(K=t.jsxs(t.Fragment,{children:[_,M]}),e[77]=_,e[78]=M,e[79]=K):K=e[79],K}function he(c){return c.stopPropagation()}function je(c){return c.stopPropagation()}function we(c){const e=G.c(8),{triggerCount:s,nextRunAt:a}=c,n=J();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:a?t.jsxs(t.Fragment,{children:[t.jsx(ue,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ge,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Le as A};
|