decocms 4.335.0 → 4.335.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-fHFTg01s.js → AlertCircle-CN4E5UK_.js} +1 -1
- package/dist/client/assets/{AreaChart-17cWcHxe.js → AreaChart-CgEBnG-x.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BgG6HRXV.js → ArrowLeft-yolsmMsx.js} +1 -1
- package/dist/client/assets/{ArrowUp-rIelJJbH.js → ArrowUp-C5Att5VF.js} +1 -1
- package/dist/client/assets/{Check-BwHoMXwZ.js → Check-CL33jZC8.js} +1 -1
- package/dist/client/assets/{CheckCircle-CCBIVOzF.js → CheckCircle-VO1W6azv.js} +1 -1
- package/dist/client/assets/{ChevronRight-Cizr_zod.js → ChevronRight-BCRnCNfQ.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-TxkLd29M.js → ChevronSelectorVertical-CKBrXz9H.js} +1 -1
- package/dist/client/assets/{ChevronUp-CJgK3kTc.js → ChevronUp-BSXLuscD.js} +1 -1
- package/dist/client/assets/{Copy01-DGjlqhrO.js → Copy01-Dm-2dpks.js} +1 -1
- package/dist/client/assets/{CreditCard01-nOyoSgdG.js → CreditCard01-CtdoaFek.js} +1 -1
- package/dist/client/assets/{DotsVertical-BnUEL1ci.js → DotsVertical-Dwenm9rZ.js} +1 -1
- package/dist/client/assets/{Download01-DvcuzCDc.js → Download01-B0eQqWq8.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-WkwtE3sY.js → ErrorBarContext-BPFOOFB5.js} +1 -1
- package/dist/client/assets/{Eye-BA8Ew8iR.js → Eye-FpMLL5DN.js} +1 -1
- package/dist/client/assets/{GitBranch01-Bep4Aqfu.js → GitBranch01-YYhgXV79.js} +1 -1
- package/dist/client/assets/{Globe01-q_RpSrYP.js → Globe01-C4xw76Fd.js} +1 -1
- package/dist/client/assets/{HardDrive-BYYGwPFo.js → HardDrive-vE1M6DLv.js} +1 -1
- package/dist/client/assets/{Image01-Bpj7krFQ.js → Image01-BODJFQCA.js} +1 -1
- package/dist/client/assets/{Key01-Cfk-GWeg.js → Key01-CNeH8xph.js} +1 -1
- package/dist/client/assets/{Link01-BmWkm2dW.js → Link01-DzSib8t0.js} +1 -1
- package/dist/client/assets/{LinkExternal01-BYZlGi_o.js → LinkExternal01-CmZOoei5.js} +1 -1
- package/dist/client/assets/{Monitor01-BSzTsjD8.js → Monitor01-D4f8tCvk.js} +1 -1
- package/dist/client/assets/{Package-B0Lu2Y3s.js → Package-DUFyKh-Q.js} +1 -1
- package/dist/client/assets/{Palette-Dh2H7Cv9.js → Palette-0UGvlQ-S.js} +1 -1
- package/dist/client/assets/{Play-Deg6G9TV.js → Play-CYxnro9p.js} +1 -1
- package/dist/client/assets/{Plus-BOwrMWJl.js → Plus-C59gbKYo.js} +1 -1
- package/dist/client/assets/{SearchMd-N0NqYswb.js → SearchMd-hcAgqhXj.js} +1 -1
- package/dist/client/assets/{Sector-BAhLXDbJ.js → Sector-aniWugcN.js} +1 -1
- package/dist/client/assets/{Settings02-BEnP5Y2L.js → Settings02-BEVsxMze.js} +1 -1
- package/dist/client/assets/{Share07-DZL3sM21.js → Share07-D36dGZLq.js} +1 -1
- package/dist/client/assets/{Shield01-C_AET2cl.js → Shield01-Ci-UL19F.js} +1 -1
- package/dist/client/assets/{Stars01-AQRE_WF1.js → Stars01-Unq3kUR5.js} +1 -1
- package/dist/client/assets/{Sun-BGPdcsJS.js → Sun-DHnW-NL8.js} +1 -1
- package/dist/client/assets/{Tool01-C-x8SiEG.js → Tool01-DQ8WTRHw.js} +1 -1
- package/dist/client/assets/{Tool02-CzAbuwli.js → Tool02-HBJj4v_q.js} +1 -1
- package/dist/client/assets/{Trash01-XZLzo_zo.js → Trash01-BCpXNPvG.js} +1 -1
- package/dist/client/assets/{TrendUp01-DTybxDl4.js → TrendUp01-P1GRdKXH.js} +1 -1
- package/dist/client/assets/{Upload01-CT8gV0FG.js → Upload01-DSCNo5nS.js} +1 -1
- package/dist/client/assets/{User01-CSiAkMtU.js → User01-Bd5k9olw.js} +1 -1
- package/dist/client/assets/{UserSquare-Bp2Z6tm8.js → UserSquare-BJE1UpTV.js} +1 -1
- package/dist/client/assets/{Users01-wmLqIjHX.js → Users01-DlnpH0d3.js} +1 -1
- package/dist/client/assets/{Users03-BpRNc6wA.js → Users03-DSF5cd93.js} +1 -1
- package/dist/client/assets/{XCircle-CzDHjeMg.js → XCircle-DY0MvbHm.js} +1 -1
- package/dist/client/assets/{XClose-kfb47ODb.js → XClose-B2E-u6ec.js} +1 -1
- package/dist/client/assets/{Zap-C1XgW0pW.js → Zap-zBZBThMu.js} +1 -1
- package/dist/client/assets/{ZoomOut-VLf6RZjT.js → ZoomOut-CsTXzM4n.js} +1 -1
- package/dist/client/assets/{access-gate-D-6RpBx7.js → access-gate-CaxWKumJ.js} +1 -1
- package/dist/client/assets/{agent-icon-DcHTW1PX.js → agent-icon-Bh3P9fsE.js} +1 -1
- package/dist/client/assets/{agents-list-CbiXNZ5l.js → agents-list-D5mlOSjX.js} +1 -1
- package/dist/client/assets/{ai-providers-CIhG6NMA.js → ai-providers-DRNguKOQ.js} +1 -1
- package/dist/client/assets/{alert-CK2Ggd22.js → alert-JjqAtKiR.js} +1 -1
- package/dist/client/assets/{alert-dialog-CLbDQ5cZ.js → alert-dialog-CKoI9s9h.js} +1 -1
- package/dist/client/assets/{analytics-tab-wCCaYW6n.js → analytics-tab-Bz0qx05s.js} +1 -1
- package/dist/client/assets/api-keys-BV20fk5S.js +1 -0
- package/dist/client/assets/{api-keys-Crt6RvsN.js → api-keys-CH3g668p.js} +1 -1
- package/dist/client/assets/app-editor-C7afTjkf.js +1 -0
- package/dist/client/assets/{auth-D0oKiczS.js → auth-CIgdrpAO.js} +1 -1
- package/dist/client/assets/{auth-catchall-C9PB6A5F.js → auth-catchall-BgT0v5Q8.js} +1 -1
- package/dist/client/assets/{auth-entry-CnoLTMpJ.js → auth-entry-BKMuFC8r.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CryIBwtw.js → auth-split-layout-B6U361HD.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-D6EMzeUi.js → authenticate-and-persist-oauth-BpDGmcTR.js} +1 -1
- package/dist/client/assets/{automation-list-row-VdM7Ghwg.js → automation-list-row-BrdtIcPx.js} +1 -1
- package/dist/client/assets/{automation-runs-CArEa1DR.js → automation-runs-7MF-XoSd.js} +1 -1
- package/dist/client/assets/{automations-1HIBHK9t.js → automations-B1WeoCoh.js} +1 -1
- package/dist/client/assets/{autosend-jCYd845v.js → autosend-QWJaYMcy.js} +1 -1
- package/dist/client/assets/{avatar-DvZJOhDd.js → avatar-DuTj899Y.js} +1 -1
- package/dist/client/assets/{badge-DtLdGNQu.js → badge-D4BnEaXw.js} +1 -1
- package/dist/client/assets/{block-document-DzAc0nOa.js → block-document-CBreUocY.js} +1 -1
- package/dist/client/assets/{breadcrumb-nWBlRUJS.js → breadcrumb-DuQeUV3k.js} +1 -1
- package/dist/client/assets/{buckets-CNyXJmf0.js → buckets-Bd_vWPic.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-5FAJFcYr.js → bulk-category-panel-DzbgkEnK.js} +1 -1
- package/dist/client/assets/{capability-load-error-yCLOyCGk.js → capability-load-error-DyIMk85j.js} +1 -1
- package/dist/client/assets/{cards-e0H3DOEM.js → cards-CuIaM5XP.js} +1 -1
- package/dist/client/assets/{category-editor-DCxTyqaA.js → category-editor-DOMBRhSJ.js} +1 -1
- package/dist/client/assets/{cdn-tab-BQ2tsC--.js → cdn-tab-XT8hAu3I.js} +1 -1
- package/dist/client/assets/{chart-C-dCSWJm.js → chart-BMFcegUy.js} +1 -1
- package/dist/client/assets/{chat-context-Jh76HNfx.js → chat-context-B6Ocrsij.js} +1 -1
- package/dist/client/assets/{checkbox-ZKYDaabG.js → checkbox-Dlf4Fgxe.js} +1 -1
- package/dist/client/assets/{choose-editor-GUvk-GZ4.js → choose-editor-YONvN77n.js} +1 -1
- package/dist/client/assets/{cli-auth-success-b2pSJplT.js → cli-auth-success-DHM_j8vP.js} +1 -1
- package/dist/client/assets/{client-icons-BQrEgNIr.js → client-icons-BQxUyScP.js} +1 -1
- package/dist/client/assets/{collection-detail-1UCEVCIt.js → collection-detail-DSUdrnM8.js} +1 -1
- package/dist/client/assets/{collection-display-button-BsEpIPRL.js → collection-display-button-B-ACW3Ej.js} +1 -1
- package/dist/client/assets/{collection-search-BeW2b3B3.js → collection-search-B2Eb7Zex.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Bsq4uM0M.js → collection-table-wrapper-CWxuIKm7.js} +1 -1
- package/dist/client/assets/{collection-tabs-CYMiFYne.js → collection-tabs-BAulXfrI.js} +1 -1
- package/dist/client/assets/{command-D9gxgqqr.js → command-DrrBPWbf.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-C5JTladn.js → commerce-onboarding-Cb5peTBf.js} +1 -1
- package/dist/client/assets/{connect-DBKwKBmg.js → connect-9CSZjSbX.js} +1 -1
- package/dist/client/assets/{connect-layout-D-mD1f-a.js → connect-layout-D3mBa0Qc.js} +1 -1
- package/dist/client/assets/{connection-BXYuNqWD.js → connection-B1zdjz4E.js} +1 -1
- package/dist/client/assets/{connection-card-HfX4NRQV.js → connection-card-w9K947UP.js} +1 -1
- package/dist/client/assets/{connection-detail-Bwnq4SsN.js → connection-detail-M6nYtTOH.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-e2zGnIAs.js → connection-form-helpers-C-bDbpFG.js} +1 -1
- package/dist/client/assets/{connections-_W3-caOT.js → connections-BpegqNca.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-MmBePqmS.js → create-organization-dialog-C4ZEt-Vc.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-BYsvbTvi.js → decopilot-sse-pool-BNKpiBjT.js} +1 -1
- package/dist/client/assets/{dialog-CuB4HOy7.js → dialog-CqOkeCZk.js} +1 -1
- package/dist/client/assets/{domain-settings-BlogFc7q.js → domain-settings-BFJSN7ln.js} +1 -1
- package/dist/client/assets/{drawer-BccWQMWJ.js → drawer-BdH7SrmG.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BcHU5umv.js → dropdown-menu-0EfzeAT5.js} +1 -1
- package/dist/client/assets/{e2e-tab-D3XerF2t.js → e2e-tab-C4n2szeZ.js} +1 -1
- package/dist/client/assets/{editor-B5362Xmz.js → editor-88JVLRTi.js} +1 -1
- package/dist/client/assets/{empty-state-C_W2LoZU.js → empty-state-CiQT7rEB.js} +1 -1
- package/dist/client/assets/{empty-state-CE98G2fl.js → empty-state-uJSuZB7w.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DC6mexeM.js → extract-connection-data-B8jBQN8M.js} +1 -1
- package/dist/client/assets/{file-explorer-BoUOSdE9.js → file-explorer-B3B1s5Gt.js} +1 -1
- package/dist/client/assets/{file-type-icon-CH-K5LzH.js → file-type-icon-Ds-CkI9w.js} +1 -1
- package/dist/client/assets/{folder-icon-DQy1T07y.js → folder-icon-DnP_iJML.js} +1 -1
- package/dist/client/assets/{form-B9wEprIb.js → form-CilRbjxN.js} +1 -1
- package/dist/client/assets/{general-BE2aSDG4.js → general-CmcDEOt5.js} +1 -1
- package/dist/client/assets/{github-icon--6BU0sXT.js → github-icon-DI6tkMhh.js} +1 -1
- package/dist/client/assets/{github-repo-picker-uvINVPSy.js → github-repo-picker-yH6O8Ls_.js} +1 -1
- package/dist/client/assets/{hooks-vsyzRPl_.js → hooks-BBUjQfDD.js} +1 -1
- package/dist/client/assets/{hosting-tab-CRFritL7.js → hosting-tab-tuDitkF5.js} +1 -1
- package/dist/client/assets/{index-DPOB2lgF.js → index-BPjeFmr9.js} +1 -1
- package/dist/client/assets/{index-mw4sV3Oj.js → index-BYL_tUBE.js} +1 -1
- package/dist/client/assets/{index-wKwsJjKZ.js → index-BbTp0pjg.js} +1 -1
- package/dist/client/assets/{index-DDSNDMaG.js → index-BhEzjLbQ.js} +2 -2
- package/dist/client/assets/{index-DZUHWi4l.js → index-CCw8KuWs.js} +1 -1
- package/dist/client/assets/{index-DW4BCtd5.js → index-C_NDI-Od.js} +1 -1
- package/dist/client/assets/{index-C82AlYJg.js → index-CgWk92-W.js} +57 -57
- package/dist/client/assets/{index-D1pMTaUn.js → index-CwBzqFVS.js} +1 -1
- package/dist/client/assets/{index-ByG0f6LC.js → index-Daau9l-b.js} +1 -1
- package/dist/client/assets/{index-Bh_fTBjt.js → index-LoWuvbs_.js} +1 -1
- package/dist/client/assets/{index-redirect-Bkg5G7p9.js → index-redirect-BP4YsAmZ.js} +1 -1
- package/dist/client/assets/{infra-billing-2WObwcpF.js → infra-billing-glIpjmRO.js} +1 -1
- package/dist/client/assets/{input-C098hEDJ.js → input-BMFOQzCl.js} +1 -1
- package/dist/client/assets/{integration-icon-KIIuk6jT.js → integration-icon-xCS_vpJa.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-CWWLX_QW.js → invite-member-dialog-WAM2AdAf.js} +1 -1
- package/dist/client/assets/{label-CNOl9eqU.js → label-DATBqEie.js} +1 -1
- package/dist/client/assets/{layout-sDvPbDDd.js → layout-Ic5btpJA.js} +1 -1
- package/dist/client/assets/{login-BiC6mywu.js → login-D79qQOFw.js} +1 -1
- package/dist/client/assets/{markdown-hMSA2n8c.js → markdown-DzOXpDIb.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-CTp3H1yx.js → mcp-app-renderer-96IXosuy.js} +1 -1
- package/dist/client/assets/{mcp-oauth-C8sYfKG6.js → mcp-oauth-CbHSAvaq.js} +1 -1
- package/dist/client/assets/{members-CgRI8iL1.js → members-D_bcA2L7.js} +1 -1
- package/dist/client/assets/{monaco-editor-05pMgnZr.js → monaco-editor-DPgnl7Yg.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-BHcJe-RK.js → monitoring-stats-row-YixJyjRo.js} +1 -1
- package/dist/client/assets/{multi-select-l_tCtHX4.js → multi-select-BTOjK7HZ.js} +1 -1
- package/dist/client/assets/{oauth-callback-DpxGPjqH.js → oauth-callback-Cu4eRkIT.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-CFWsWBGJ.js → oauth-callback-ai-provider-foPPZ8Zj.js} +1 -1
- package/dist/client/assets/{onboarding-CIf5stMc.js → onboarding-c8sChhgC.js} +1 -1
- package/dist/client/assets/{org-layout-jam_s3mu.js → org-layout-tQCzZDOY.js} +1 -1
- package/dist/client/assets/{organization-choice-n6FLDtFx.js → organization-choice-DmlXFu2h.js} +1 -1
- package/dist/client/assets/{orgs-DyU5ef-t.js → orgs-d32HYtGY.js} +1 -1
- package/dist/client/assets/{page-seo-form-OgYQAry5.js → page-seo-form-cTUEgvWO.js} +1 -1
- package/dist/client/assets/{popover-B6GdY6eD.js → popover-Wb7Hlrlv.js} +1 -1
- package/dist/client/assets/{post-calendar-D_bg6d5f.js → post-calendar-DLq2CwKM.js} +1 -1
- package/dist/client/assets/{post-editor-Dy05Rtkz.js → post-editor-iE4I7l--.js} +1 -1
- package/dist/client/assets/{primitives-DyMmZwWV.js → primitives-BWLBDsnF.js} +1 -1
- package/dist/client/assets/{profile-Bm3urfZU.js → profile-CkrsWVFT.js} +1 -1
- package/dist/client/assets/{project-app-view-BmIw6pFj.js → project-app-view-aVUGOm22.js} +1 -1
- package/dist/client/assets/{project-icon-8tDP4Plf.js → project-icon-Cs1e7PFo.js} +1 -1
- package/dist/client/assets/{prompts-Dzw2OiHy.js → prompts-BEsPjnOO.js} +1 -1
- package/dist/client/assets/record-editor-CnBfZxev.js +1 -0
- package/dist/client/assets/redirect-editor-DdriSdyo.js +1 -0
- package/dist/client/assets/registry-BMO38OTI.js +2 -0
- package/dist/client/assets/{registry-layout-C_diHkRI.js → registry-layout-RpPScfCz.js} +1 -1
- package/dist/client/assets/{reports--aTGLgV-.js → reports-DcYT0i8V.js} +1 -1
- package/dist/client/assets/{require-capability-Gc6ZxlsX.js → require-capability-H8pqZV1Q.js} +1 -1
- package/dist/client/assets/{required-auth-layout-ChnOs0Q4.js → required-auth-layout-uyUjkr46.js} +1 -1
- package/dist/client/assets/{reset-password-BhVB8jiq.js → reset-password-iDiBUc_N.js} +1 -1
- package/dist/client/assets/{review-settings-D5zTwt63.js → review-settings-BziHnlzx.js} +1 -1
- package/dist/client/assets/{roles-B5R7vsXa.js → roles-DAfri3aY.js} +1 -1
- package/dist/client/assets/{schema-3aUl4uO2.js → schema-CECbfc85.js} +1 -1
- package/dist/client/assets/{scroll-area-Bd2hiVcJ.js → scroll-area-CY7zaK_5.js} +1 -1
- package/dist/client/assets/{search-input-B9KVQKLa.js → search-input-CwYMWV5O.js} +1 -1
- package/dist/client/assets/{secrets-CHQCSF5A.js → secrets-Bpa3a-bK.js} +1 -1
- package/dist/client/assets/{sections-editor-B6OIWur0.js → sections-editor-xWeFZYWz.js} +1 -1
- package/dist/client/assets/{select-95ItPFEM.js → select-CDIZb2kA.js} +1 -1
- package/dist/client/assets/{select-model-CslLlP_T.js → select-model-DAlfCUqb.js} +1 -1
- package/dist/client/assets/{self-tool-result-BJd9UspL.js → self-tool-result-DpJCoiFX.js} +1 -1
- package/dist/client/assets/{seo-editor-BZv_Z3kz.js → seo-editor-BdCOcqnO.js} +1 -1
- package/dist/client/assets/settings-layout-DEXpHiFQ.js +1 -0
- package/dist/client/assets/{settings-sidebar-yQFF9khL.js → settings-sidebar-Bcl2Ut6r.js} +1 -1
- package/dist/client/assets/{shell-controls-BnxC3KqE.js → shell-controls-DlBEV7HP.js} +1 -1
- package/dist/client/assets/{shell-layout-BYqqNk6t.js → shell-layout-BisDI455.js} +1 -1
- package/dist/client/assets/{skill-preview-wYGR0Igf.js → skill-preview-DrTZOS1Y.js} +1 -1
- package/dist/client/assets/{skills-BIPumWKr.js → skills-BZANQMfJ.js} +1 -1
- package/dist/client/assets/{sso-C-SJAbTc.js → sso-DlB4p80i.js} +1 -1
- package/dist/client/assets/{store-DjRwiu92.js → store-Dsj8rGSf.js} +1 -1
- package/dist/client/assets/store-registry-D3HKOBR-.js +2 -0
- package/dist/client/assets/{switch-DEX7sh80.js → switch-BIU4bXkO.js} +1 -1
- package/dist/client/assets/{synced-repos-C9q3yWCX.js → synced-repos-Dyqt0rM9.js} +1 -1
- package/dist/client/assets/{table-D03f9SPD.js → table-CZRA7DOc.js} +1 -1
- package/dist/client/assets/{tabs-DV7a49b8.js → tabs-wqHj4zp1.js} +1 -1
- package/dist/client/assets/{task-board-C--GpfoM.js → task-board-s1xrPKcx.js} +1 -1
- package/dist/client/assets/{task-route-Bzkoi_EU.js → task-route-BUjJ2hkM.js} +1 -1
- package/dist/client/assets/{tasks-BLIcpgoC.js → tasks-Be59sn1w.js} +1 -1
- package/dist/client/assets/{textarea-DogTaKzZ.js → textarea-XHmapi9Z.js} +1 -1
- package/dist/client/assets/{thread-intent-DyqcFZTL.js → thread-intent-rLNQyD1w.js} +1 -1
- package/dist/client/assets/{thread-route-D61bEYFn.js → thread-route-DiK2fKUy.js} +1 -1
- package/dist/client/assets/{toggle-group-mwDB-Cu-.js → toggle-group-0CzzMRgM.js} +1 -1
- package/dist/client/assets/{toolbar-AU4owi7j.js → toolbar-CKRCX9OY.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-Dgieeko1.js → toolbar-icon-button-jD2iMJ4T.js} +1 -1
- package/dist/client/assets/{track-DJJJWUPM.js → track-9EfTrzjc.js} +1 -1
- package/dist/client/assets/{types-Db_TuJx2.js → types-D_hm_Y77.js} +1 -1
- package/dist/client/assets/{use-ai-providers-IR7JMDH6.js → use-ai-providers-CqUExZV7.js} +1 -1
- package/dist/client/assets/{use-automations-skadcC2F.js → use-automations-Dq5ZKLZ2.js} +1 -1
- package/dist/client/assets/{use-autosave-CtgsmuCE.js → use-autosave-CgvwtYCz.js} +1 -1
- package/dist/client/assets/{use-connection-CrVsFWUZ.js → use-connection-C4DWan0X.js} +1 -1
- package/dist/client/assets/{use-copy-D-hmH3Tt.js → use-copy-BMEInZ_e.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D4PsiTk_.js → use-create-virtual-mcp-CP_RaNDX.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BneUAQnz.js → use-debounced-autosave-bSvv8G3l.js} +1 -1
- package/dist/client/assets/{use-debounced-value-CPghpkkl.js → use-debounced-value-DM5HocnO.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-l2QFCdek.js → use-decopilot-events-Ct1QUAEN.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CqIDcyA6.js → use-delete-connection-_ariZ2aD.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-DvseCdia.js → use-deployment-admin-Bt1umqsT.js} +1 -1
- package/dist/client/assets/{use-destination-route-CGiZk4qp.js → use-destination-route-RLx6j5-f.js} +1 -1
- package/dist/client/assets/{use-file-configs-xVvMYqKE.js → use-file-configs-BNY0zB6a.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-sU9udfQz.js → use-infinite-scroll-DM8hGZF3.js} +1 -1
- package/dist/client/assets/{use-join-requests-CoFx2eIU.js → use-join-requests-ByQh8M5w.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-D22_B3_J.js → use-mcp-auth-status-D5vPVz4N.js} +1 -1
- package/dist/client/assets/{use-mcp-client-Cj0bA5NH.js → use-mcp-client-DEFbrf4v.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-COf4WpAC.js → use-mcp-prompts-Kr067ySg.js} +1 -1
- package/dist/client/assets/{use-members-CDzoHBda.js → use-members-Cj0dA6Ur.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-3Qr6s8iN.js → use-navigate-to-agent-CRiX1dCi.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-C509dNPT.js → use-org-auth-client-BH8MZ9Tj.js} +1 -1
- package/dist/client/assets/{use-org-notice-B9aJoKfo.js → use-org-notice-zj3w_M3R.js} +1 -1
- package/dist/client/assets/{use-org-sso-BB-71dxn.js → use-org-sso-Trrsh_IS.js} +1 -1
- package/dist/client/assets/{use-organization-roles-fDWT2-X9.js → use-organization-roles-CKslgH0I.js} +1 -1
- package/dist/client/assets/{use-organization-settings-DkF7x4to.js → use-organization-settings-B9Fjtbef.js} +1 -1
- package/dist/client/assets/use-panel-navigate-c295WEV6.js +1 -0
- package/dist/client/assets/{use-registry-connections-wgULGJcw.js → use-registry-connections-KhQelRT5.js} +1 -1
- package/dist/client/assets/{use-secrets-CPbqa_-4.js → use-secrets-Qp36OQeH.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-I5RHEXY1.js → use-section-preview-base-BxVZTJoM.js} +1 -1
- package/dist/client/assets/{use-status-sounds-Bc0bX_Dp.js → use-status-sounds-CPMwRgvj.js} +1 -1
- package/dist/client/assets/{use-tags-CeIlcfqi.js → use-tags-7E3DfW_a.js} +1 -1
- package/dist/client/assets/{use-view-mode-BwLmjDZE.js → use-view-mode-B9bgmZfy.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-Dq0Oe3A0.js → use-virtual-mcp-DaNcJiae.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-B_QZOTQT.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BtGVh4Bk.js +1 -0
- package/dist/client/assets/{users-BLObnqPE.js → users-CzSp6vjC.js} +1 -1
- package/dist/client/assets/{variant-calendar-lxynrkH3.js → variant-calendar-BtAZ08Ef.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-aUc-rREa.js → view-mode-toggle-CGpcMkLH.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +532 -532
- package/dist/server/server.js +364 -364
- package/package.json +1 -1
- package/dist/client/assets/api-keys-DDHjlOwU.js +0 -1
- package/dist/client/assets/app-editor-Cd16pHzl.js +0 -1
- package/dist/client/assets/record-editor-3U4sPxtv.js +0 -1
- package/dist/client/assets/redirect-editor-DBYkFejL.js +0 -1
- package/dist/client/assets/registry-DCFhNmyM.js +0 -2
- package/dist/client/assets/settings-layout-SY4GFCNU.js +0 -1
- package/dist/client/assets/store-registry-C8DFnpbO.js +0 -2
- package/dist/client/assets/use-panel-navigate-1_mqdEaS.js +0 -1
- package/dist/client/assets/useInfiniteQuery-Cv83pmQm.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Cl-bdUMg.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as se,b as Te,r as d,j as r,h as pe,B as Re,fk as en,bm as tn,bs as ge,fl as nn,fm as rn,fn as on,fo as sn,cL as an,fp as ln,fq as dt,bo as cn,fr as dn,fs as un,ft as fn,fu as pn,fv as mn,fw as xn,fx as hn,fy as gn,fz as bn,l as le,n as yn,t as te,a4 as tt,a1 as nt,a2 as rt,K as ot}from"./index-DDSNDMaG.js";import{aa as vn,bh as Cn,bi as wn}from"./agent-icon-DcHTW1PX.js";import{s as Nn}from"./XClose-kfb47ODb.js";import{S as jn}from"./scroll-area-Bd2hiVcJ.js";import{a as En}from"./chat-context-Jh76HNfx.js";import{F as Sn}from"./editor-B5362Xmz.js";import{u as Dn}from"./shell-layout-BYqqNk6t.js";import{s as je,a as st,f as Mn,b as Rn}from"./index-C82AlYJg.js";import{d as Tn,h as Pn,c as kn,e as Fn,b as An,D as Ln}from"./dialog-CuB4HOy7.js";import{I as it}from"./input-C098hEDJ.js";import{c as On,d as In,b as Kn,f as zn,g as $n,e as _n,a as Gn,A as Bn}from"./alert-dialog-CLbDQ5cZ.js";import{t as Vn}from"./ChevronUp-CJgK3kTc.js";import{i as Un}from"./ChevronRight-Cizr_zod.js";import{i as qn}from"./Share07-DZL3sM21.js";import{i as Hn,E as Wn,e as Oe,h as Qn,j as Xn,k as Yn,l as Jn,t as re,m as Ee,n as Ie,o as Se,g as Ke,p as ze,q as Zn,s as er,v as tr,r as $e,u as De,w as _e,x as nr,y as rr,z as or,A as sr}from"./skill-preview-wYGR0Igf.js";import"./AlertCircle-fHFTg01s.js";import"./Tool01-C-x8SiEG.js";import"./ArrowUp-rIelJJbH.js";import"./ArrowLeft-BgG6HRXV.js";import"./Tool02-CzAbuwli.js";import"./XCircle-CzDHjeMg.js";import"./TrendUp01-DTybxDl4.js";import"./ZoomOut-VLf6RZjT.js";import"./Users03-BpRNc6wA.js";import"./CheckCircle-CCBIVOzF.js";import"./Check-BwHoMXwZ.js";import"./ChevronSelectorVertical-TxkLd29M.js";import"./DotsVertical-BnUEL1ci.js";import"./UserSquare-Bp2Z6tm8.js";import"./Copy01-DGjlqhrO.js";import"./CreditCard01-nOyoSgdG.js";import"./Download01-DvcuzCDc.js";import"./Settings02-BEnP5Y2L.js";import"./Eye-BA8Ew8iR.js";import"./GitBranch01-Bep4Aqfu.js";import"./Globe01-q_RpSrYP.js";import"./HardDrive-BYYGwPFo.js";import"./Image01-Bpj7krFQ.js";import"./Key01-Cfk-GWeg.js";import"./Link01-BmWkm2dW.js";import"./LinkExternal01-BYZlGi_o.js";import"./Monitor01-BSzTsjD8.js";import"./Sun-BGPdcsJS.js";import"./Package-B0Lu2Y3s.js";import"./Palette-Dh2H7Cv9.js";import"./Play-Deg6G9TV.js";import"./Plus-BOwrMWJl.js";import"./SearchMd-N0NqYswb.js";import"./Shield01-C_AET2cl.js";import"./Stars01-AQRE_WF1.js";import"./Trash01-XZLzo_zo.js";import"./Upload01-CT8gV0FG.js";import"./User01-CSiAkMtU.js";import"./Users01-wmLqIjHX.js";import"./Zap-C1XgW0pW.js";import"./select-95ItPFEM.js";import"./use-panel-navigate-1_mqdEaS.js";import"./use-destination-route-CGiZk4qp.js";import"./autosend-jCYd845v.js";import"./thread-intent-DyqcFZTL.js";import"./slugify-CEUa2lfQ.js";import"./hooks-vsyzRPl_.js";import"./use-mcp-client-Cj0bA5NH.js";import"./constants-BRGHAWVM.js";import"./auth-D0oKiczS.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BYsvbTvi.js";import"./task-board-C--GpfoM.js";import"./schema-3aUl4uO2.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-Dq0Oe3A0.js";import"./use-ai-providers-IR7JMDH6.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-l2QFCdek.js";import"./thread-route-D61bEYFn.js";import"./use-organization-settings-DkF7x4to.js";import"./avatar-DvZJOhDd.js";import"./project-icon-8tDP4Plf.js";import"./github-repo-COLY3wWI.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-D9gxgqqr.js";import"./index-Bh_fTBjt.js";import"./required-auth-layout-ChnOs0Q4.js";import"./use-org-sso-BB-71dxn.js";import"./use-org-notice-B9aJoKfo.js";import"./automation-runs-CArEa1DR.js";import"./useInfiniteQuery-Cv83pmQm.js";import"./use-infinite-scroll-sU9udfQz.js";import"./use-connection-CrVsFWUZ.js";import"./table-D03f9SPD.js";import"./empty-state-C_W2LoZU.js";import"./use-members-CDzoHBda.js";import"./use-org-auth-client-C509dNPT.js";import"./use-automations-skadcC2F.js";import"./useSuspenseInfiniteQuery-Cl-bdUMg.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-D-hmH3Tt.js";import"./markdown-hMSA2n8c.js";import"./monaco-editor-05pMgnZr.js";import"./mcp-app-renderer-CTp3H1yx.js";import"./types-Db_TuJx2.js";import"./integration-icon-KIIuk6jT.js";import"./use-navigate-to-agent-3Qr6s8iN.js";import"./use-mcp-prompts-COf4WpAC.js";import"./form-B9wEprIb.js";import"./label-CNOl9eqU.js";import"./file-type-icon-CH-K5LzH.js";import"./drawer-BccWQMWJ.js";import"./collection-search-BeW2b3B3.js";import"./tabs-DV7a49b8.js";import"./toggle-group-mwDB-Cu-.js";import"./task-route-Bzkoi_EU.js";import"./extract-connection-data-DC6mexeM.js";import"./metadata-dUsYcpuu.js";import"./connection-BXYuNqWD.js";import"./connection-card-HfX4NRQV.js";import"./use-registry-connections-wgULGJcw.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-DogTaKzZ.js";import"./connection-form-helpers-e2zGnIAs.js";import"./authenticate-and-persist-oauth-D6EMzeUi.js";import"./mcp-oauth-C8sYfKG6.js";import"./collection-tabs-CYMiFYne.js";import"./badge-DtLdGNQu.js";import"./use-file-configs-xVvMYqKE.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-BcHU5umv.js";import"./popover-B6GdY6eD.js";import"./github-icon--6BU0sXT.js";import"./get-initials-D-f_fDFw.js";import"./select-model-CslLlP_T.js";import"./checkbox-ZKYDaabG.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-DQy1T07y.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-Bc0bX_Dp.js";import"./toolbar-AU4owi7j.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-BneUAQnz.js";import"./search-input-B9KVQKLa.js";import"./use-mcp-auth-status-D22_B3_J.js";import"./switch-DEX7sh80.js";import"./github-repo-picker-uvINVPSy.js";import"./use-debounced-value-CPghpkkl.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./use-secrets-CPbqa_-4.js";import"./client-icons-BQrEgNIr.js";import"./connect-layout-D-mD1f-a.js";import"./self-tool-result-BJd9UspL.js";import"./track-DJJJWUPM.js";import"./use-tags-CeIlcfqi.js";import"./breadcrumb-nWBlRUJS.js";import"./toolbar-icon-button-Dgieeko1.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-VdM7Ghwg.js";import"./site-error--i37Vnuw.js";import"./cards-e0H3DOEM.js";const ir={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function ar(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:y,onSubmit:u,onOpenChange:b}=i,E=l===void 0?"":l,h=y===void 0?!1:y,x=Te(),[f,O]=d.useState(E),[X,I]=d.useState(s),C=ir[a];s!==X&&(I(s),s&&O(E));let g;e[0]!==h||e[1]!==b?(g=Q=>{!Q&&!h&&b(!1)},e[0]=h,e[1]=b,e[2]=g):g=e[2];const R=g;let z;e[3]!==h||e[4]!==f||e[5]!==u?(z=async Q=>{Q.preventDefault();const ne=f.trim();!ne||h||await u(ne)},e[3]=h,e[4]=f,e[5]=u,e[6]=z):z=e[6];const L=z;let T;e[7]!==C.titleKey||e[8]!==x?(T=x(C.titleKey),e[7]=C.titleKey,e[8]=x,e[9]=T):T=e[9];let P;e[10]!==T?(P=r.jsx(Tn,{children:T}),e[10]=T,e[11]=P):P=e[11];let D;e[12]!==C.descriptionKey||e[13]!==x?(D=x(C.descriptionKey),e[12]=C.descriptionKey,e[13]=x,e[14]=D):D=e[14];let S;e[15]!==D?(S=r.jsx(Pn,{children:D}),e[15]=D,e[16]=S):S=e[16];let N;e[17]!==P||e[18]!==S?(N=r.jsxs(kn,{children:[P,S]}),e[17]=P,e[18]=S,e[19]=N):N=e[19];let M;e[20]!==m||e[21]!==x?(M=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(it,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=M):M=e[22];let j;e[23]!==x?(j=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=j):j=e[24];let F;e[25]!==j?(F=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:j}),e[25]=j,e[26]=F):F=e[26];let q;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=Q=>O(Q.target.value),e[27]=q):q=e[27];let $;e[28]!==C.placeholderKey||e[29]!==x?($=x(C.placeholderKey),e[28]=C.placeholderKey,e[29]=x,e[30]=$):$=e[30];let Y;e[31]!==h||e[32]!==f||e[33]!==$?(Y=r.jsx(it,{id:"file-explorer-name",value:f,onChange:q,placeholder:$,autoFocus:!0,disabled:h}),e[31]=h,e[32]=f,e[33]=$,e[34]=Y):Y=e[34];let J;e[35]!==F||e[36]!==Y?(J=r.jsxs("div",{className:"space-y-1.5",children:[F,Y]}),e[35]=F,e[36]=Y,e[37]=J):J=e[37];let ee;e[38]!==M||e[39]!==J?(ee=r.jsxs("div",{className:"space-y-4 py-4",children:[M,J]}),e[38]=M,e[39]=J,e[40]=ee):ee=e[40];let _;e[41]!==b?(_=()=>b(!1),e[41]=b,e[42]=_):_=e[42];let A;e[43]!==x?(A=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=A):A=e[44];let H;e[45]!==h||e[46]!==_||e[47]!==A?(H=r.jsx(Re,{type:"button",variant:"outline",onClick:_,disabled:h,children:A}),e[45]=h,e[46]=_,e[47]=A,e[48]=H):H=e[48];let K;e[49]!==h||e[50]!==f?(K=!f.trim()||h,e[49]=h,e[50]=f,e[51]=K):K=e[51];let W;e[52]!==C.submitKey||e[53]!==h||e[54]!==x?(W=h?r.jsxs(r.Fragment,{children:[r.jsx(pe,{className:"size-3.5"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(C.submitKey),e[52]=C.submitKey,e[53]=h,e[54]=x,e[55]=W):W=e[55];let G;e[56]!==K||e[57]!==W?(G=r.jsx(Re,{type:"submit",disabled:K,children:W}),e[56]=K,e[57]=W,e[58]=G):G=e[58];let k;e[59]!==H||e[60]!==G?(k=r.jsxs(Fn,{children:[H,G]}),e[59]=H,e[60]=G,e[61]=k):k=e[61];let B;e[62]!==L||e[63]!==ee||e[64]!==k||e[65]!==N?(B=r.jsx(An,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:L,children:[N,ee,k]})}),e[62]=L,e[63]=ee,e[64]=k,e[65]=N,e[66]=B):B=e[66];let V;return e[67]!==R||e[68]!==s||e[69]!==B?(V=r.jsx(Ln,{open:s,onOpenChange:R,children:B}),e[67]=R,e[68]=s,e[69]=B,e[70]=V):V=e[70],V}function lr(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:y}=i,u=Te(),b=s?.kind==="directory",E=s!==null,h=b?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==u||e[1]!==h?(x=u(h),e[0]=u,e[1]=h,e[2]=x):x=e[2];let f;e[3]!==x?(f=r.jsx(On,{children:x}),e[3]=x,e[4]=f):f=e[4];let O;e[5]!==u?(O=u("sandbox.fileExplorerDeleteDialog.description"),e[5]=u,e[6]=O):O=e[6];const X=s?.name;let I;e[7]!==X?(I=r.jsx("span",{className:"font-mono",children:X}),e[7]=X,e[8]=I):I=e[8];let C;e[9]!==b||e[10]!==u?(C=b?u("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=b,e[10]=u,e[11]=C):C=e[11];let g;e[12]!==a.length||e[13]!==u?(g=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?u("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):u("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=u,e[14]=g):g=e[14];let R;e[15]!==O||e[16]!==I||e[17]!==C||e[18]!==g?(R=r.jsxs(In,{children:[O," ",I,C,g]}),e[15]=O,e[16]=I,e[17]=C,e[18]=g,e[19]=R):R=e[19];let z;e[20]!==R||e[21]!==f?(z=r.jsxs(Kn,{children:[f,R]}),e[20]=R,e[21]=f,e[22]=z):z=e[22];let L;e[23]!==u?(L=u("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=u,e[24]=L):L=e[24];let T;e[25]!==l||e[26]!==L?(T=r.jsx(zn,{disabled:l,children:L}),e[25]=l,e[26]=L,e[27]=T):T=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==y?(D=q=>{q.preventDefault(),s&&y(s)},e[28]=s,e[29]=y,e[30]=D):D=e[30];let S;e[31]!==u?(S=u("sandbox.fileExplorerDeleteDialog.delete"),e[31]=u,e[32]=S):S=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==S?(N=r.jsx($n,{disabled:P,onClick:D,children:S}),e[33]=P,e[34]=D,e[35]=S,e[36]=N):N=e[36];let M;e[37]!==T||e[38]!==N?(M=r.jsxs(_n,{children:[T,N]}),e[37]=T,e[38]=N,e[39]=M):M=e[39];let j;e[40]!==z||e[41]!==M?(j=r.jsxs(Gn,{children:[z,M]}),e[40]=z,e[41]=M,e[42]=j):j=e[42];let F;return e[43]!==m||e[44]!==E||e[45]!==j?(F=r.jsx(Bn,{open:E,onOpenChange:m,children:j}),e[43]=m,e[44]=E,e[45]=j,e[46]=F):F=e[46],F}var Ge="ContextMenu",[cr]=cn(Ge,[dt]),Z=dt(),[dr,ut]=cr(Ge),ft=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[y,u]=d.useState(!1),b=Z(e),E=an(a),h=d.useCallback(x=>{u(x),E(x)},[E]);return r.jsx(dr,{scope:e,open:y,onOpenChange:h,modal:m,children:r.jsx(ln,{...b,dir:l,open:y,onOpenChange:h,modal:m,children:s})})};ft.displayName=Ge;var pt="ContextMenuTrigger",mt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ut(pt,s),y=Z(s),u=d.useRef({x:0,y:0}),b=d.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),E=d.useRef(0),h=d.useCallback(()=>window.clearTimeout(E.current),[]),x=f=>{u.current={x:f.clientX,y:f.clientY},m.onOpenChange(!0)};return d.useEffect(()=>h,[h]),d.useEffect(()=>{a&&h()},[a,h]),r.jsxs(r.Fragment,{children:[r.jsx(en,{...y,virtualRef:b}),r.jsx(tn.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:ge(i.onContextMenu,f=>{h(),x(f),f.preventDefault()}),onPointerDown:a?i.onPointerDown:ge(i.onPointerDown,Me(f=>{h(),E.current=window.setTimeout(()=>x(f),700)})),onPointerMove:a?i.onPointerMove:ge(i.onPointerMove,Me(h)),onPointerCancel:a?i.onPointerCancel:ge(i.onPointerCancel,Me(h)),onPointerUp:a?i.onPointerUp:ge(i.onPointerUp,Me(h))})]})});mt.displayName=pt;var ur="ContextMenuPortal",xt=i=>{const{__scopeContextMenu:e,...s}=i,a=Z(e);return r.jsx(on,{...a,...s})};xt.displayName=ur;var ht="ContextMenuContent",gt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ut(ht,s),m=Z(s),y=d.useRef(!1);return r.jsx(sn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{i.onCloseAutoFocus?.(u),!u.defaultPrevented&&y.current&&u.preventDefault(),y.current=!1},onInteractOutside:u=>{i.onInteractOutside?.(u),!u.defaultPrevented&&!l.modal&&(y.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gt.displayName=ht;var fr="ContextMenuGroup",pr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(dn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuLabel",xr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(un,{...l,...a,ref:e})});xr.displayName=mr;var hr="ContextMenuItem",bt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(nn,{...l,...a,ref:e})});bt.displayName=hr;var gr="ContextMenuCheckboxItem",br=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(fn,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioGroup",vr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(pn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuRadioItem",wr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(mn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuItemIndicator",jr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(xn,{...l,...a,ref:e})});jr.displayName=Nr;var Er="ContextMenuSeparator",yt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(rn,{...l,...a,ref:e})});yt.displayName=Er;var Sr="ContextMenuArrow",Dr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(hn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubTrigger",Rr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(gn,{...l,...a,ref:e})});Rr.displayName=Mr;var Tr="ContextMenuSubContent",Pr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(bn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pr.displayName=Tr;function Me(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var kr=ft,Fr=mt,Ar=xt,Lr=gt,Or=bt,Ir=yt;function Kr(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(kr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function zr(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Fr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Ar,{children:r.jsx(Lr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function fe(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const y=m===void 0?"default":m;let u;e[5]!==s?(u=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=u):u=e[6];let b;return e[7]!==a||e[8]!==l||e[9]!==u||e[10]!==y?(b=r.jsx(Or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":y,className:u,...l}),e[7]=a,e[8]=l,e[9]=u,e[10]=y,e[11]=b):b=e[11],b}function at(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Ir,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const _r="#d9a441";function Gr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:y,fileVisual:u,onOpen:b,onSelect:E,onNewFile:h,onNewFolder:x,onCopyPath:f,onCopyRelativePath:O,onRename:X,onDelete:I}=i,C=y===void 0?!1:y,g=Te(),R=s.kind==="directory",{Icon:z,color:L}=u,T=m&&"bg-accent";let P;e[0]!==T?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",T),e[0]=T,e[1]=P):P=e[1];const D=`${a*14+8}px`;let S;e[2]!==D?(S={paddingLeft:D},e[2]=D,e[3]=S):S=e[3];let N;e[4]!==b||e[5]!==E?(N=()=>{E(),b()},e[4]=b,e[5]=E,e[6]=N):N=e[6];let M;e[7]!==z||e[8]!==L||e[9]!==R||e[10]!==l||e[11]!==C?(M=R?r.jsxs(r.Fragment,{children:[C?r.jsx(pe,{className:"size-3.5 shrink-0 text-muted-foreground"}):l?r.jsx(Vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(qn,{size:16,className:"shrink-0",style:{color:_r}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(z,{size:16,className:"shrink-0",style:{color:L}})]}),e[7]=z,e[8]=L,e[9]=R,e[10]=l,e[11]=C,e[12]=M):M=e[12];let j;e[13]!==s.name?(j=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=j):j=e[14];let F;e[15]!==P||e[16]!==S||e[17]!==N||e[18]!==M||e[19]!==j?(F=r.jsx(zr,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:S,onClick:N,children:[M,j]})}),e[15]=P,e[16]=S,e[17]=N,e[18]=M,e[19]=j,e[20]=F):F=e[20];let q;e[21]!==g?(q=g("sandbox.fileTreeRow.newFile"),e[21]=g,e[22]=q):q=e[22];let $;e[23]!==h||e[24]!==q?($=r.jsx(fe,{onSelect:h,children:q}),e[23]=h,e[24]=q,e[25]=$):$=e[25];let Y;e[26]!==g?(Y=g("sandbox.fileTreeRow.newFolder"),e[26]=g,e[27]=Y):Y=e[27];let J;e[28]!==x||e[29]!==Y?(J=r.jsx(fe,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=J):J=e[30];let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(at,{}),e[31]=ee):ee=e[31];let _;e[32]!==g?(_=g("sandbox.fileTreeRow.copyPath"),e[32]=g,e[33]=_):_=e[33];let A;e[34]!==f||e[35]!==_?(A=r.jsx(fe,{onSelect:f,children:_}),e[34]=f,e[35]=_,e[36]=A):A=e[36];let H;e[37]!==g?(H=g("sandbox.fileTreeRow.copyRelativePath"),e[37]=g,e[38]=H):H=e[38];let K;e[39]!==O||e[40]!==H?(K=r.jsx(fe,{onSelect:O,children:H}),e[39]=O,e[40]=H,e[41]=K):K=e[41];let W;e[42]===Symbol.for("react.memo_cache_sentinel")?(W=r.jsx(at,{}),e[42]=W):W=e[42];let G;e[43]!==g?(G=g("sandbox.fileTreeRow.rename"),e[43]=g,e[44]=G):G=e[44];let k;e[45]!==X||e[46]!==G?(k=r.jsx(fe,{onSelect:X,children:G}),e[45]=X,e[46]=G,e[47]=k):k=e[47];let B;e[48]!==g?(B=g("sandbox.fileTreeRow.delete"),e[48]=g,e[49]=B):B=e[49];let V;e[50]!==I||e[51]!==B?(V=r.jsx(fe,{variant:"destructive",onSelect:I,children:B}),e[50]=I,e[51]=B,e[52]=V):V=e[52];let Q;e[53]!==$||e[54]!==J||e[55]!==A||e[56]!==K||e[57]!==k||e[58]!==V?(Q=r.jsxs($r,{className:"w-52",children:[$,J,ee,A,K,W,k,V]}),e[53]=$,e[54]=J,e[55]=A,e[56]=K,e[57]=k,e[58]=V,e[59]=Q):Q=e[59];let ne;return e[60]!==Q||e[61]!==F?(ne=r.jsxs(Kr,{children:[F,Q]}),e[60]=Q,e[61]=F,e[62]=ne):ne=e[62],ne}const lt=200,Br=2,Vr=250,ct=200;function Ur(i,e){return Rn(i,e)}function qr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,y;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:b,segments:E}=Zn(s,a);l="truncate font-mono text-muted-foreground",m=b&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),y=E.map(Hr),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=y}else l=e[2],m=e[3],y=e[4];let u;return e[5]!==l||e[6]!==m||e[7]!==y?(u=r.jsxs("span",{className:l,children:[m,y]}),e[5]=l,e[6]=m,e[7]=y,e[8]=u):u=e[8],u}function Hr(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function Hi({orgSlug:i,virtualMcpId:e,branch:s,threadId:a,openPath:l}){const m={orgSlug:i,virtualMcpId:e,branch:s,threadId:a},[y,u]=d.useState({files:[],directories:[],truncated:!1}),{files:b,directories:E}=y,[h,x]=d.useState(new Set),[f,O]=d.useState(null),[X,I]=d.useState(null),[C,g]=d.useState([]),[R,z]=d.useState(""),[L,T]=d.useState(null),[P,D]=d.useState(null),[S,N]=d.useState(!1),[M,j]=d.useState(!1),[F,q]=d.useState(!1),[$,Y]=d.useState(!1),[,J]=d.useState(new Set),[ee,_]=d.useState(new Set),A=d.useRef(0),H=d.useRef(null),K=d.useRef(new Set),W=d.useRef(new Map),G=d.useRef(null),k=d.useRef(0),B=d.useRef(null),V=d.useRef(null),Q=d.useRef(null);function ne(t){J(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[me,de]=d.useState(new Map),Pe=d.useRef(null),[ie,be]=d.useState(null),{sendMessage:vt}=En(),{openSidePanel:Ct}=Dn(),ye=yn(),[U,oe]=d.useState(null),[ke,Fe]=d.useState(null),[ve,Ce]=d.useState(!1);async function ae(t,n){const o=await fetch(Ur(m,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function we(){ye.invalidateQueries({queryKey:st(m)})}function Be(t,n,o){navigator.clipboard.writeText(o).then(()=>te.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>te.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function wt(t){const n=or(t);if(!n)return;const o=`${i}/${e}/${s}`;ye.setQueryData(ot.decofile(o),c=>{if(!c)return c;const{[n]:p,...v}=c;return v}),ye.invalidateQueries({queryKey:ot.liveMeta(i,e,s)})}function Nt(t){const n=t.kind==="file"?[t.path]:b.filter(o=>o.startsWith(".deco/blocks/")).map(o=>Ee(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)wt(o)}function jt(t){const n=Ee(t);return C.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=me.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ve(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),O(n=>n&&t(n)),de(n=>{const o=new Map;for(const[c,p]of n){const v=t(c);v&&o.set(v,p)}return o}),I(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Et(t){const n=Ee(t);I(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ve(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function St(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("write",{path:re(o),content:""}),await xe(),await we(),oe(null),he(o)}async function Dt(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ae("mkdir",{path:c}),u(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await xe(),await we(),oe(null),x(p=>{const v=new Set(p);for(const ce of ze(o))v.add(ce);return v.add(o),v}),I({name:n,path:o,kind:"directory",children:[]})}async function Mt(t,n){if(!U)return;const o=U.node.path,c=Se(o),p=De(c,n);if(p===o){oe(null);return}if(_e(p,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("rename",{from:re(o),to:re(p)}),Ve(v=>v===o?p:v.startsWith(`${o}/`)?De(p,v.slice(o.length+1)):v),await xe(),await we(),oe(null)}async function Rt(t,n){Ce(!0);try{await ae("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Nt(n),Et(n.path),await xe(),await we(),Fe(null),te.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){te.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{Ce(!1)}}async function Tt(t,n){const o=tr(n);if(o){te.error(o);return}Ce(!0);try{U?.mode==="new-file"?(await St(t,n),te.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):U?.mode==="new-folder"?(await Dt(t,n),te.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):U?.mode==="rename"&&(await Mt(t,n),te.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){te.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{Ce(!1)}}const Ue=d.useRef(!1);Ue.current||(Ue.current=!0,H.current=xe());const[Pt,kt]=d.useState(null),w=Te();if(l&&l!==Pt){kt(l);const t=l;queueMicrotask(()=>{Hn(t)&&he(t)})}async function Ae(t){const n=await ae("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function qe(t,n,o){if(o!==A.current)return!1;let c=!1;return u(p=>{const v=n?sr(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!v.truncated,{files:v.files,directories:v.directories,truncated:c}}),c&&te.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Ft(t){const n=W.current.get(t);if(n)return n;const o=A.current,c=(async()=>{const p=await Ae({pattern:"**/*",path:re(t),limit:Oe}),v=qe(p,!0,o);return!v&&o===A.current&&ne(ce=>{const Ne=new Set(ce);return Ne.add(t),Ne}),v})();W.current.set(t,c);try{return await c}finally{W.current.delete(t)}}async function He(t){if(!$e(t,K.current))return!1;_(n=>new Set(n).add(t));try{return await Ft(t)}finally{_(n=>{const o=new Set(n);return o.delete(t),o})}}async function At(t,n){const o=new Set(K.current);for(const c of ze(n)){if(!$e(c,o))continue;if(await He(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function xe(){const t=++A.current;B.current=null,V.current=null,W.current.clear(),q(!0),ne(new Set),x(new Set),_(new Set);try{const n=await Ae({pattern:"**/*",limit:Oe,maxDepth:Wn});qe(n,!1,t),Y(!0)}catch{$&&te.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{q(!1)}}async function We(t){if(!me.get(t)?.loaded){de(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ae("read",{path:re(t),full:!0}),c=er(o.content??"");de(p=>{const v=new Map(p);return v.set(t,{savedContent:c,editorValue:c,loaded:!0}),v})}catch{}}}function Lt(){k.current++,T(null),D(null),N(!1),j(!1)}async function Ot(){const t=A.current,n=B.current;if(n&&n.generation===t)return n.files;const o=V.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await Ae({pattern:"**/*",limit:Oe});return A.current===t&&(B.current={generation:t,files:p.files}),p.files})();V.current={generation:t,promise:c};try{return await c}finally{V.current?.generation===t&&(V.current=null)}}async function It(t,n){try{const o=await Ot();if(n!==k.current)return;T(nr(o,t,ct))}catch{if(n!==k.current)return;T([])}}async function Kt(t,n){N(!0);try{const o=await ae("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:lt});if(n!==k.current)return;D(rr(o.results??"")),j((o.matchCount??0)>=lt)}catch{if(n!==k.current)return;D([]),j(!1)}finally{n===k.current&&N(!1)}}function zt(t){const n=t.trim(),o=++k.current;It(n,o),n.length<Br?(D(null),N(!1),j(!1)):Kt(n,o)}function $t(t){if(z(t),G.current&&clearTimeout(G.current),!t.trim()){Lt();return}G.current=setTimeout(()=>{zt(t)},Vr)}function Qe(t){const n=Q.current;if(!n||n.path!==f)return;Q.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function _t(t){Q.current={path:t.path,line:t.line};const n=f===t.path&&me.get(t.path)?.loaded;he(t.path),n&&Pe.current&&Qe(Pe.current)}async function Gt(t,n){try{await ae("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ye.invalidateQueries({queryKey:st(m)});try{const o=await Mn(m);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}de(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function Bt(t){O(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),be(null),C.includes(t)||g(n=>[...n,t]),We(t)}function Vt(t){g(n=>{const o=n.filter(c=>c!==t);return f===t&&O(o[o.length-1]??null),o}),de(n=>{const o=new Map(n);return o.delete(t),o})}function Xe(t){x(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Ut(t){if($e(t,K.current))try{if(await He(t))return}catch(n){te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}Xe(t)}async function qt(t,n){if(n){Xe(t);return}await Ut(t)}async function Ht(t){await H.current,await At(w,t);const n=ze(t);x(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),Bt(t)}function he(t){Ht(t).catch(n=>{te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Wt(){return X?.kind==="directory"?X.path:X?.kind==="file"?Se(X.path):f?Se(f):"/"}function Ye(t){const n=Wt();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Qt=Qn(b,E),Je=Xn(Qt,h),Le=L?.length??0,Ze=Yn(P??[]),et=P?.length??0,ue=f?me.get(f):null,Xt=ue?.loaded&&ue.editorValue!==ue.savedContent,Yt=ke?jt(ke.path):[],Jt=(t,n)=>{Pe.current=t,Qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!f)return;const o=t.getValue();await Gt(f,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!f)return;const p=c.getValueInRange(o);be({filePath:f,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Zt(t){if(!ie)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ie.filePath}\``,`**Lines:** ${ie.lineStart}–${ie.lineEnd}`];if(ie.selectedCode){const o=Ke(ie.filePath),c=ie.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),Ct(),vt({parts:[{type:"text",text:n.join(`
|
|
1
|
+
import{c as se,b as Te,r as d,j as r,h as pe,B as Re,fk as en,bm as tn,bs as ge,fl as nn,fm as rn,fn as on,fo as sn,cL as an,fp as ln,fq as dt,bo as cn,fr as dn,fs as un,ft as fn,fu as pn,fv as mn,fw as xn,fx as hn,fy as gn,fz as bn,l as le,n as yn,t as te,a4 as tt,a1 as nt,a2 as rt,K as ot}from"./index-BhEzjLbQ.js";import{aa as vn,bh as Cn,bi as wn}from"./agent-icon-Bh3P9fsE.js";import{s as Nn}from"./XClose-B2E-u6ec.js";import{S as jn}from"./scroll-area-CY7zaK_5.js";import{a as En}from"./chat-context-B6Ocrsij.js";import{F as Sn}from"./editor-88JVLRTi.js";import{u as Dn}from"./shell-layout-BisDI455.js";import{s as je,a as st,f as Mn,b as Rn}from"./index-CgWk92-W.js";import{d as Tn,h as Pn,c as kn,e as Fn,b as An,D as Ln}from"./dialog-CqOkeCZk.js";import{I as it}from"./input-BMFOQzCl.js";import{c as On,d as In,b as Kn,f as zn,g as $n,e as _n,a as Gn,A as Bn}from"./alert-dialog-CKoI9s9h.js";import{t as Vn}from"./ChevronUp-BSXLuscD.js";import{i as Un}from"./ChevronRight-BCRnCNfQ.js";import{i as qn}from"./Share07-D36dGZLq.js";import{i as Hn,E as Wn,e as Oe,h as Qn,j as Xn,k as Yn,l as Jn,t as re,m as Ee,n as Ie,o as Se,g as Ke,p as ze,q as Zn,s as er,v as tr,r as $e,u as De,w as _e,x as nr,y as rr,z as or,A as sr}from"./skill-preview-DrTZOS1Y.js";import"./AlertCircle-CN4E5UK_.js";import"./Tool01-DQ8WTRHw.js";import"./ArrowUp-C5Att5VF.js";import"./ArrowLeft-yolsmMsx.js";import"./Tool02-HBJj4v_q.js";import"./XCircle-DY0MvbHm.js";import"./TrendUp01-P1GRdKXH.js";import"./ZoomOut-CsTXzM4n.js";import"./Users03-DSF5cd93.js";import"./CheckCircle-VO1W6azv.js";import"./Check-CL33jZC8.js";import"./ChevronSelectorVertical-CKBrXz9H.js";import"./DotsVertical-Dwenm9rZ.js";import"./UserSquare-BJE1UpTV.js";import"./Copy01-Dm-2dpks.js";import"./CreditCard01-CtdoaFek.js";import"./Download01-B0eQqWq8.js";import"./Settings02-BEVsxMze.js";import"./Eye-FpMLL5DN.js";import"./GitBranch01-YYhgXV79.js";import"./Globe01-C4xw76Fd.js";import"./HardDrive-vE1M6DLv.js";import"./Image01-BODJFQCA.js";import"./Key01-CNeH8xph.js";import"./Link01-DzSib8t0.js";import"./LinkExternal01-CmZOoei5.js";import"./Monitor01-D4f8tCvk.js";import"./Sun-DHnW-NL8.js";import"./Package-DUFyKh-Q.js";import"./Palette-0UGvlQ-S.js";import"./Play-CYxnro9p.js";import"./Plus-C59gbKYo.js";import"./SearchMd-hcAgqhXj.js";import"./Shield01-Ci-UL19F.js";import"./Stars01-Unq3kUR5.js";import"./Trash01-BCpXNPvG.js";import"./Upload01-DSCNo5nS.js";import"./User01-Bd5k9olw.js";import"./Users01-DlnpH0d3.js";import"./Zap-zBZBThMu.js";import"./select-CDIZb2kA.js";import"./use-panel-navigate-c295WEV6.js";import"./use-destination-route-RLx6j5-f.js";import"./autosend-QWJaYMcy.js";import"./thread-intent-rLNQyD1w.js";import"./slugify-CEUa2lfQ.js";import"./hooks-BBUjQfDD.js";import"./use-mcp-client-DEFbrf4v.js";import"./constants-BRGHAWVM.js";import"./auth-CIgdrpAO.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./decopilot-sse-pool-BNKpiBjT.js";import"./task-board-s1xrPKcx.js";import"./schema-CECbfc85.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DaNcJiae.js";import"./use-ai-providers-CqUExZV7.js";import"./location-oTTXFrSF.js";import"./use-decopilot-events-Ct1QUAEN.js";import"./thread-route-DiK2fKUy.js";import"./use-organization-settings-B9Fjtbef.js";import"./avatar-DuTj899Y.js";import"./project-icon-Cs1e7PFo.js";import"./github-repo-COLY3wWI.js";import"./source-system-tabs-CnEGUb4r.js";import"./command-DrrBPWbf.js";import"./index-LoWuvbs_.js";import"./required-auth-layout-uyUjkr46.js";import"./use-org-sso-Trrsh_IS.js";import"./use-org-notice-zj3w_M3R.js";import"./automation-runs-7MF-XoSd.js";import"./useInfiniteQuery-B_QZOTQT.js";import"./use-infinite-scroll-DM8hGZF3.js";import"./use-connection-C4DWan0X.js";import"./table-CZRA7DOc.js";import"./empty-state-CiQT7rEB.js";import"./use-members-Cj0dA6Ur.js";import"./use-org-auth-client-BH8MZ9Tj.js";import"./use-automations-Dq5ZKLZ2.js";import"./useSuspenseInfiniteQuery-BtGVh4Bk.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-copy-BMEInZ_e.js";import"./markdown-DzOXpDIb.js";import"./monaco-editor-DPgnl7Yg.js";import"./mcp-app-renderer-96IXosuy.js";import"./types-D_hm_Y77.js";import"./integration-icon-xCS_vpJa.js";import"./use-navigate-to-agent-CRiX1dCi.js";import"./use-mcp-prompts-Kr067ySg.js";import"./form-CilRbjxN.js";import"./label-DATBqEie.js";import"./file-type-icon-Ds-CkI9w.js";import"./drawer-BdH7SrmG.js";import"./collection-search-B2Eb7Zex.js";import"./tabs-wqHj4zp1.js";import"./toggle-group-0CzzMRgM.js";import"./task-route-BUjJ2hkM.js";import"./extract-connection-data-B8jBQN8M.js";import"./metadata-dUsYcpuu.js";import"./connection-B1zdjz4E.js";import"./connection-card-w9K947UP.js";import"./use-registry-connections-KhQelRT5.js";import"./retry-CErkP7V6.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-XHmapi9Z.js";import"./connection-form-helpers-C-bDbpFG.js";import"./authenticate-and-persist-oauth-BpDGmcTR.js";import"./mcp-oauth-CbHSAvaq.js";import"./collection-tabs-BAulXfrI.js";import"./badge-D4BnEaXw.js";import"./use-file-configs-BNY0zB6a.js";import"./site-slug-uya6Wp4-.js";import"./dropdown-menu-0EfzeAT5.js";import"./popover-Wb7Hlrlv.js";import"./github-icon-DI6tkMhh.js";import"./get-initials-D-f_fDFw.js";import"./select-model-DAlfCUqb.js";import"./checkbox-Dlf4Fgxe.js";import"./ai-providers-logos-DD3qZ33J.js";import"./folder-icon-DnP_iJML.js";import"./question-004-sINsf4GQ.js";import"./use-status-sounds-CPMwRgvj.js";import"./toolbar-CKRCX9OY.js";import"./pt-BR-CLy76QW2.js";import"./use-debounced-autosave-bSvv8G3l.js";import"./search-input-CwYMWV5O.js";import"./use-mcp-auth-status-D5vPVz4N.js";import"./switch-BIU4bXkO.js";import"./github-repo-picker-yH6O8Ls_.js";import"./use-debounced-value-DM5HocnO.js";import"./provision-repo-scoped-github-connection-WQFARyHG.js";import"./use-secrets-Qp36OQeH.js";import"./client-icons-BQxUyScP.js";import"./connect-layout-D3mBa0Qc.js";import"./self-tool-result-DpJCoiFX.js";import"./track-9EfTrzjc.js";import"./use-tags-7E3DfW_a.js";import"./breadcrumb-DuQeUV3k.js";import"./toolbar-icon-button-jD2iMJ4T.js";import"./safe-image-url-D5z803Ot.js";import"./automation-list-row-BrdtIcPx.js";import"./site-error--i37Vnuw.js";import"./cards-CuIaM5XP.js";const ir={"new-file":{titleKey:"sandbox.fileExplorerNameDialog.newFileTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFileDescription",submitKey:"sandbox.fileExplorerNameDialog.newFileSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFilePlaceholder"},"new-folder":{titleKey:"sandbox.fileExplorerNameDialog.newFolderTitle",descriptionKey:"sandbox.fileExplorerNameDialog.newFolderDescription",submitKey:"sandbox.fileExplorerNameDialog.newFolderSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.newFolderPlaceholder"},rename:{titleKey:"sandbox.fileExplorerNameDialog.renameTitle",descriptionKey:"sandbox.fileExplorerNameDialog.renameDescription",submitKey:"sandbox.fileExplorerNameDialog.renameSubmit",placeholderKey:"sandbox.fileExplorerNameDialog.renamePlaceholder"}};function ar(i){const e=se.c(71),{open:s,mode:a,initialName:l,parentLabel:m,isPending:y,onSubmit:u,onOpenChange:b}=i,E=l===void 0?"":l,h=y===void 0?!1:y,x=Te(),[f,O]=d.useState(E),[X,I]=d.useState(s),C=ir[a];s!==X&&(I(s),s&&O(E));let g;e[0]!==h||e[1]!==b?(g=Q=>{!Q&&!h&&b(!1)},e[0]=h,e[1]=b,e[2]=g):g=e[2];const R=g;let z;e[3]!==h||e[4]!==f||e[5]!==u?(z=async Q=>{Q.preventDefault();const ne=f.trim();!ne||h||await u(ne)},e[3]=h,e[4]=f,e[5]=u,e[6]=z):z=e[6];const L=z;let T;e[7]!==C.titleKey||e[8]!==x?(T=x(C.titleKey),e[7]=C.titleKey,e[8]=x,e[9]=T):T=e[9];let P;e[10]!==T?(P=r.jsx(Tn,{children:T}),e[10]=T,e[11]=P):P=e[11];let D;e[12]!==C.descriptionKey||e[13]!==x?(D=x(C.descriptionKey),e[12]=C.descriptionKey,e[13]=x,e[14]=D):D=e[14];let S;e[15]!==D?(S=r.jsx(Pn,{children:D}),e[15]=D,e[16]=S):S=e[16];let N;e[17]!==P||e[18]!==S?(N=r.jsxs(kn,{children:[P,S]}),e[17]=P,e[18]=S,e[19]=N):N=e[19];let M;e[20]!==m||e[21]!==x?(M=m&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:x("sandbox.fileExplorerNameDialog.location")}),r.jsx(it,{value:m,readOnly:!0,disabled:!0,className:"font-mono text-xs"})]}),e[20]=m,e[21]=x,e[22]=M):M=e[22];let j;e[23]!==x?(j=x("sandbox.fileExplorerNameDialog.name"),e[23]=x,e[24]=j):j=e[24];let F;e[25]!==j?(F=r.jsx("label",{htmlFor:"file-explorer-name",className:"text-xs font-medium text-muted-foreground",children:j}),e[25]=j,e[26]=F):F=e[26];let q;e[27]===Symbol.for("react.memo_cache_sentinel")?(q=Q=>O(Q.target.value),e[27]=q):q=e[27];let $;e[28]!==C.placeholderKey||e[29]!==x?($=x(C.placeholderKey),e[28]=C.placeholderKey,e[29]=x,e[30]=$):$=e[30];let Y;e[31]!==h||e[32]!==f||e[33]!==$?(Y=r.jsx(it,{id:"file-explorer-name",value:f,onChange:q,placeholder:$,autoFocus:!0,disabled:h}),e[31]=h,e[32]=f,e[33]=$,e[34]=Y):Y=e[34];let J;e[35]!==F||e[36]!==Y?(J=r.jsxs("div",{className:"space-y-1.5",children:[F,Y]}),e[35]=F,e[36]=Y,e[37]=J):J=e[37];let ee;e[38]!==M||e[39]!==J?(ee=r.jsxs("div",{className:"space-y-4 py-4",children:[M,J]}),e[38]=M,e[39]=J,e[40]=ee):ee=e[40];let _;e[41]!==b?(_=()=>b(!1),e[41]=b,e[42]=_):_=e[42];let A;e[43]!==x?(A=x("sandbox.fileExplorerNameDialog.cancel"),e[43]=x,e[44]=A):A=e[44];let H;e[45]!==h||e[46]!==_||e[47]!==A?(H=r.jsx(Re,{type:"button",variant:"outline",onClick:_,disabled:h,children:A}),e[45]=h,e[46]=_,e[47]=A,e[48]=H):H=e[48];let K;e[49]!==h||e[50]!==f?(K=!f.trim()||h,e[49]=h,e[50]=f,e[51]=K):K=e[51];let W;e[52]!==C.submitKey||e[53]!==h||e[54]!==x?(W=h?r.jsxs(r.Fragment,{children:[r.jsx(pe,{className:"size-3.5"}),x("sandbox.fileExplorerNameDialog.saving")]}):x(C.submitKey),e[52]=C.submitKey,e[53]=h,e[54]=x,e[55]=W):W=e[55];let G;e[56]!==K||e[57]!==W?(G=r.jsx(Re,{type:"submit",disabled:K,children:W}),e[56]=K,e[57]=W,e[58]=G):G=e[58];let k;e[59]!==H||e[60]!==G?(k=r.jsxs(Fn,{children:[H,G]}),e[59]=H,e[60]=G,e[61]=k):k=e[61];let B;e[62]!==L||e[63]!==ee||e[64]!==k||e[65]!==N?(B=r.jsx(An,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:L,children:[N,ee,k]})}),e[62]=L,e[63]=ee,e[64]=k,e[65]=N,e[66]=B):B=e[66];let V;return e[67]!==R||e[68]!==s||e[69]!==B?(V=r.jsx(Ln,{open:s,onOpenChange:R,children:B}),e[67]=R,e[68]=s,e[69]=B,e[70]=V):V=e[70],V}function lr(i){const e=se.c(47),{deleteTarget:s,deleteDirtyPaths:a,fsActionPending:l,onOpenChange:m,onConfirm:y}=i,u=Te(),b=s?.kind==="directory",E=s!==null,h=b?"sandbox.fileExplorerDeleteDialog.titleFolder":"sandbox.fileExplorerDeleteDialog.titleFile";let x;e[0]!==u||e[1]!==h?(x=u(h),e[0]=u,e[1]=h,e[2]=x):x=e[2];let f;e[3]!==x?(f=r.jsx(On,{children:x}),e[3]=x,e[4]=f):f=e[4];let O;e[5]!==u?(O=u("sandbox.fileExplorerDeleteDialog.description"),e[5]=u,e[6]=O):O=e[6];const X=s?.name;let I;e[7]!==X?(I=r.jsx("span",{className:"font-mono",children:X}),e[7]=X,e[8]=I):I=e[8];let C;e[9]!==b||e[10]!==u?(C=b?u("sandbox.fileExplorerDeleteDialog.folderSuffix"):".",e[9]=b,e[10]=u,e[11]=C):C=e[11];let g;e[12]!==a.length||e[13]!==u?(g=a.length>0&&r.jsxs(r.Fragment,{children:[" ",a.length===1?u("sandbox.fileExplorerDeleteDialog.unsavedChangesOne"):u("sandbox.fileExplorerDeleteDialog.unsavedChangesMany",{count:a.length})]}),e[12]=a.length,e[13]=u,e[14]=g):g=e[14];let R;e[15]!==O||e[16]!==I||e[17]!==C||e[18]!==g?(R=r.jsxs(In,{children:[O," ",I,C,g]}),e[15]=O,e[16]=I,e[17]=C,e[18]=g,e[19]=R):R=e[19];let z;e[20]!==R||e[21]!==f?(z=r.jsxs(Kn,{children:[f,R]}),e[20]=R,e[21]=f,e[22]=z):z=e[22];let L;e[23]!==u?(L=u("sandbox.fileExplorerDeleteDialog.cancel"),e[23]=u,e[24]=L):L=e[24];let T;e[25]!==l||e[26]!==L?(T=r.jsx(zn,{disabled:l,children:L}),e[25]=l,e[26]=L,e[27]=T):T=e[27];const P=l||!s;let D;e[28]!==s||e[29]!==y?(D=q=>{q.preventDefault(),s&&y(s)},e[28]=s,e[29]=y,e[30]=D):D=e[30];let S;e[31]!==u?(S=u("sandbox.fileExplorerDeleteDialog.delete"),e[31]=u,e[32]=S):S=e[32];let N;e[33]!==P||e[34]!==D||e[35]!==S?(N=r.jsx($n,{disabled:P,onClick:D,children:S}),e[33]=P,e[34]=D,e[35]=S,e[36]=N):N=e[36];let M;e[37]!==T||e[38]!==N?(M=r.jsxs(_n,{children:[T,N]}),e[37]=T,e[38]=N,e[39]=M):M=e[39];let j;e[40]!==z||e[41]!==M?(j=r.jsxs(Gn,{children:[z,M]}),e[40]=z,e[41]=M,e[42]=j):j=e[42];let F;return e[43]!==m||e[44]!==E||e[45]!==j?(F=r.jsx(Bn,{open:E,onOpenChange:m,children:j}),e[43]=m,e[44]=E,e[45]=j,e[46]=F):F=e[46],F}var Ge="ContextMenu",[cr]=cn(Ge,[dt]),Z=dt(),[dr,ut]=cr(Ge),ft=i=>{const{__scopeContextMenu:e,children:s,onOpenChange:a,dir:l,modal:m=!0}=i,[y,u]=d.useState(!1),b=Z(e),E=an(a),h=d.useCallback(x=>{u(x),E(x)},[E]);return r.jsx(dr,{scope:e,open:y,onOpenChange:h,modal:m,children:r.jsx(ln,{...b,dir:l,open:y,onOpenChange:h,modal:m,children:s})})};ft.displayName=Ge;var pt="ContextMenuTrigger",mt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,disabled:a=!1,...l}=i,m=ut(pt,s),y=Z(s),u=d.useRef({x:0,y:0}),b=d.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),E=d.useRef(0),h=d.useCallback(()=>window.clearTimeout(E.current),[]),x=f=>{u.current={x:f.clientX,y:f.clientY},m.onOpenChange(!0)};return d.useEffect(()=>h,[h]),d.useEffect(()=>{a&&h()},[a,h]),r.jsxs(r.Fragment,{children:[r.jsx(en,{...y,virtualRef:b}),r.jsx(tn.span,{"data-state":m.open?"open":"closed","data-disabled":a?"":void 0,...l,ref:e,style:{WebkitTouchCallout:"none",...i.style},onContextMenu:a?i.onContextMenu:ge(i.onContextMenu,f=>{h(),x(f),f.preventDefault()}),onPointerDown:a?i.onPointerDown:ge(i.onPointerDown,Me(f=>{h(),E.current=window.setTimeout(()=>x(f),700)})),onPointerMove:a?i.onPointerMove:ge(i.onPointerMove,Me(h)),onPointerCancel:a?i.onPointerCancel:ge(i.onPointerCancel,Me(h)),onPointerUp:a?i.onPointerUp:ge(i.onPointerUp,Me(h))})]})});mt.displayName=pt;var ur="ContextMenuPortal",xt=i=>{const{__scopeContextMenu:e,...s}=i,a=Z(e);return r.jsx(on,{...a,...s})};xt.displayName=ur;var ht="ContextMenuContent",gt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=ut(ht,s),m=Z(s),y=d.useRef(!1);return r.jsx(sn,{...m,...a,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{i.onCloseAutoFocus?.(u),!u.defaultPrevented&&y.current&&u.preventDefault(),y.current=!1},onInteractOutside:u=>{i.onInteractOutside?.(u),!u.defaultPrevented&&!l.modal&&(y.current=!0)},style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gt.displayName=ht;var fr="ContextMenuGroup",pr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(dn,{...l,...a,ref:e})});pr.displayName=fr;var mr="ContextMenuLabel",xr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(un,{...l,...a,ref:e})});xr.displayName=mr;var hr="ContextMenuItem",bt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(nn,{...l,...a,ref:e})});bt.displayName=hr;var gr="ContextMenuCheckboxItem",br=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(fn,{...l,...a,ref:e})});br.displayName=gr;var yr="ContextMenuRadioGroup",vr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(pn,{...l,...a,ref:e})});vr.displayName=yr;var Cr="ContextMenuRadioItem",wr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(mn,{...l,...a,ref:e})});wr.displayName=Cr;var Nr="ContextMenuItemIndicator",jr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(xn,{...l,...a,ref:e})});jr.displayName=Nr;var Er="ContextMenuSeparator",yt=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(rn,{...l,...a,ref:e})});yt.displayName=Er;var Sr="ContextMenuArrow",Dr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(hn,{...l,...a,ref:e})});Dr.displayName=Sr;var Mr="ContextMenuSubTrigger",Rr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(gn,{...l,...a,ref:e})});Rr.displayName=Mr;var Tr="ContextMenuSubContent",Pr=d.forwardRef((i,e)=>{const{__scopeContextMenu:s,...a}=i,l=Z(s);return r.jsx(bn,{...l,...a,ref:e,style:{...i.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Pr.displayName=Tr;function Me(i){return e=>e.pointerType!=="mouse"?i(e):void 0}var kr=ft,Fr=mt,Ar=xt,Lr=gt,Or=bt,Ir=yt;function Kr(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(kr,{"data-slot":"context-menu",...s}),e[2]=s,e[3]=a):a=e[3],a}function zr(i){const e=se.c(4);let s;e[0]!==i?({...s}=i,e[0]=i,e[1]=s):s=e[1];let a;return e[2]!==s?(a=r.jsx(Fr,{"data-slot":"context-menu-trigger",...s}),e[2]=s,e[3]=a):a=e[3],a}function $r(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Ar,{children:r.jsx(Lr,{"data-slot":"context-menu-content",translate:"no",className:l,...a})}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}function fe(i){const e=se.c(12);let s,a,l,m;e[0]!==i?({className:s,inset:a,variant:m,...l}=i,e[0]=i,e[1]=s,e[2]=a,e[3]=l,e[4]=m):(s=e[1],a=e[2],l=e[3],m=e[4]);const y=m===void 0?"default":m;let u;e[5]!==s?(u=le("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),e[5]=s,e[6]=u):u=e[6];let b;return e[7]!==a||e[8]!==l||e[9]!==u||e[10]!==y?(b=r.jsx(Or,{"data-slot":"context-menu-item","data-inset":a,"data-variant":y,className:u,...l}),e[7]=a,e[8]=l,e[9]=u,e[10]=y,e[11]=b):b=e[11],b}function at(i){const e=se.c(8);let s,a;e[0]!==i?({className:s,...a}=i,e[0]=i,e[1]=s,e[2]=a):(s=e[1],a=e[2]);let l;e[3]!==s?(l=le("bg-border -mx-1 my-1 h-px",s),e[3]=s,e[4]=l):l=e[4];let m;return e[5]!==a||e[6]!==l?(m=r.jsx(Ir,{"data-slot":"context-menu-separator",className:l,...a}),e[5]=a,e[6]=l,e[7]=m):m=e[7],m}const _r="#d9a441";function Gr(i){const e=se.c(63),{node:s,depth:a,isExpanded:l,isSelected:m,isLoading:y,fileVisual:u,onOpen:b,onSelect:E,onNewFile:h,onNewFolder:x,onCopyPath:f,onCopyRelativePath:O,onRename:X,onDelete:I}=i,C=y===void 0?!1:y,g=Te(),R=s.kind==="directory",{Icon:z,color:L}=u,T=m&&"bg-accent";let P;e[0]!==T?(P=le("flex w-full items-center gap-1.5 px-2 py-1.5 text-left text-[13px] hover:bg-accent transition-colors",T),e[0]=T,e[1]=P):P=e[1];const D=`${a*14+8}px`;let S;e[2]!==D?(S={paddingLeft:D},e[2]=D,e[3]=S):S=e[3];let N;e[4]!==b||e[5]!==E?(N=()=>{E(),b()},e[4]=b,e[5]=E,e[6]=N):N=e[6];let M;e[7]!==z||e[8]!==L||e[9]!==R||e[10]!==l||e[11]!==C?(M=R?r.jsxs(r.Fragment,{children:[C?r.jsx(pe,{className:"size-3.5 shrink-0 text-muted-foreground"}):l?r.jsx(Vn,{size:14,className:"shrink-0 text-muted-foreground"}):r.jsx(Un,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx(qn,{size:16,className:"shrink-0",style:{color:_r}})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"w-3.5 shrink-0"}),r.jsx(z,{size:16,className:"shrink-0",style:{color:L}})]}),e[7]=z,e[8]=L,e[9]=R,e[10]=l,e[11]=C,e[12]=M):M=e[12];let j;e[13]!==s.name?(j=r.jsx("span",{className:"truncate",children:s.name}),e[13]=s.name,e[14]=j):j=e[14];let F;e[15]!==P||e[16]!==S||e[17]!==N||e[18]!==M||e[19]!==j?(F=r.jsx(zr,{asChild:!0,children:r.jsxs("button",{type:"button",className:P,style:S,onClick:N,children:[M,j]})}),e[15]=P,e[16]=S,e[17]=N,e[18]=M,e[19]=j,e[20]=F):F=e[20];let q;e[21]!==g?(q=g("sandbox.fileTreeRow.newFile"),e[21]=g,e[22]=q):q=e[22];let $;e[23]!==h||e[24]!==q?($=r.jsx(fe,{onSelect:h,children:q}),e[23]=h,e[24]=q,e[25]=$):$=e[25];let Y;e[26]!==g?(Y=g("sandbox.fileTreeRow.newFolder"),e[26]=g,e[27]=Y):Y=e[27];let J;e[28]!==x||e[29]!==Y?(J=r.jsx(fe,{onSelect:x,children:Y}),e[28]=x,e[29]=Y,e[30]=J):J=e[30];let ee;e[31]===Symbol.for("react.memo_cache_sentinel")?(ee=r.jsx(at,{}),e[31]=ee):ee=e[31];let _;e[32]!==g?(_=g("sandbox.fileTreeRow.copyPath"),e[32]=g,e[33]=_):_=e[33];let A;e[34]!==f||e[35]!==_?(A=r.jsx(fe,{onSelect:f,children:_}),e[34]=f,e[35]=_,e[36]=A):A=e[36];let H;e[37]!==g?(H=g("sandbox.fileTreeRow.copyRelativePath"),e[37]=g,e[38]=H):H=e[38];let K;e[39]!==O||e[40]!==H?(K=r.jsx(fe,{onSelect:O,children:H}),e[39]=O,e[40]=H,e[41]=K):K=e[41];let W;e[42]===Symbol.for("react.memo_cache_sentinel")?(W=r.jsx(at,{}),e[42]=W):W=e[42];let G;e[43]!==g?(G=g("sandbox.fileTreeRow.rename"),e[43]=g,e[44]=G):G=e[44];let k;e[45]!==X||e[46]!==G?(k=r.jsx(fe,{onSelect:X,children:G}),e[45]=X,e[46]=G,e[47]=k):k=e[47];let B;e[48]!==g?(B=g("sandbox.fileTreeRow.delete"),e[48]=g,e[49]=B):B=e[49];let V;e[50]!==I||e[51]!==B?(V=r.jsx(fe,{variant:"destructive",onSelect:I,children:B}),e[50]=I,e[51]=B,e[52]=V):V=e[52];let Q;e[53]!==$||e[54]!==J||e[55]!==A||e[56]!==K||e[57]!==k||e[58]!==V?(Q=r.jsxs($r,{className:"w-52",children:[$,J,ee,A,K,W,k,V]}),e[53]=$,e[54]=J,e[55]=A,e[56]=K,e[57]=k,e[58]=V,e[59]=Q):Q=e[59];let ne;return e[60]!==Q||e[61]!==F?(ne=r.jsxs(Kr,{children:[F,Q]}),e[60]=Q,e[61]=F,e[62]=ne):ne=e[62],ne}const lt=200,Br=2,Vr=250,ct=200;function Ur(i,e){return Rn(i,e)}function qr(i){const e=se.c(9),{text:s,query:a}=i;let l,m,y;if(e[0]!==a||e[1]!==s){const{leadingEllipsis:b,segments:E}=Zn(s,a);l="truncate font-mono text-muted-foreground",m=b&&r.jsx("span",{className:"text-muted-foreground/50",children:"…"}),y=E.map(Hr),e[0]=a,e[1]=s,e[2]=l,e[3]=m,e[4]=y}else l=e[2],m=e[3],y=e[4];let u;return e[5]!==l||e[6]!==m||e[7]!==y?(u=r.jsxs("span",{className:l,children:[m,y]}),e[5]=l,e[6]=m,e[7]=y,e[8]=u):u=e[8],u}function Hr(i,e){return i.match?r.jsx("span",{className:"rounded-[2px] bg-primary/20 text-foreground",children:i.text},e):r.jsx("span",{children:i.text},e)}function Hi({orgSlug:i,virtualMcpId:e,branch:s,threadId:a,openPath:l}){const m={orgSlug:i,virtualMcpId:e,branch:s,threadId:a},[y,u]=d.useState({files:[],directories:[],truncated:!1}),{files:b,directories:E}=y,[h,x]=d.useState(new Set),[f,O]=d.useState(null),[X,I]=d.useState(null),[C,g]=d.useState([]),[R,z]=d.useState(""),[L,T]=d.useState(null),[P,D]=d.useState(null),[S,N]=d.useState(!1),[M,j]=d.useState(!1),[F,q]=d.useState(!1),[$,Y]=d.useState(!1),[,J]=d.useState(new Set),[ee,_]=d.useState(new Set),A=d.useRef(0),H=d.useRef(null),K=d.useRef(new Set),W=d.useRef(new Map),G=d.useRef(null),k=d.useRef(0),B=d.useRef(null),V=d.useRef(null),Q=d.useRef(null);function ne(t){J(n=>{const o=typeof t=="function"?t(n):t;return K.current=o,o})}const[me,de]=d.useState(new Map),Pe=d.useRef(null),[ie,be]=d.useState(null),{sendMessage:vt}=En(),{openSidePanel:Ct}=Dn(),ye=yn(),[U,oe]=d.useState(null),[ke,Fe]=d.useState(null),[ve,Ce]=d.useState(!1);async function ae(t,n){const o=await fetch(Ur(m,t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n)});if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error??`Request failed (${o.status})`)}return o.json()}async function we(){ye.invalidateQueries({queryKey:st(m)})}function Be(t,n,o){navigator.clipboard.writeText(o).then(()=>te.success(t("sandbox.fileExplorer.textCopied",{label:n})),()=>te.error(t("sandbox.fileExplorer.failedToCopyText",{label:n.toLowerCase()})))}function wt(t){const n=or(t);if(!n)return;const o=`${i}/${e}/${s}`;ye.setQueryData(ot.decofile(o),c=>{if(!c)return c;const{[n]:p,...v}=c;return v}),ye.invalidateQueries({queryKey:ot.liveMeta(i,e,s)})}function Nt(t){const n=t.kind==="file"?[t.path]:b.filter(o=>o.startsWith(".deco/blocks/")).map(o=>Ee(o)).filter(o=>o===t.path||o.startsWith(`${t.path}/`));for(const o of n)wt(o)}function jt(t){const n=Ee(t);return C.filter(o=>{if(o!==n&&!o.startsWith(`${n}/`))return!1;const c=me.get(o);return!!(c?.loaded&&c.editorValue!==c.savedContent)})}function Ve(t){g(n=>n.map(o=>t(o)).filter(o=>o!==null)),O(n=>n&&t(n)),de(n=>{const o=new Map;for(const[c,p]of n){const v=t(c);v&&o.set(v,p)}return o}),I(n=>{if(!n)return n;const o=t(n.path);return o?o===n.path?n:{...n,path:o,name:o.split("/").pop()??o}:null})}function Et(t){const n=Ee(t);I(o=>o&&(o.path===n||o.path.startsWith(`${n}/`)?null:o)),Ve(o=>o===n||o.startsWith(`${n}/`)?null:o)}async function St(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("write",{path:re(o),content:""}),await xe(),await we(),oe(null),he(o)}async function Dt(t,n){if(!U)return;const o=De(U.parentDir,n);if(_e(o,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));const c=re(o);await ae("mkdir",{path:c}),u(p=>({...p,directories:p.directories.includes(c)?p.directories:[...p.directories,c]})),await xe(),await we(),oe(null),x(p=>{const v=new Set(p);for(const ce of ze(o))v.add(ce);return v.add(o),v}),I({name:n,path:o,kind:"directory",children:[]})}async function Mt(t,n){if(!U)return;const o=U.node.path,c=Se(o),p=De(c,n);if(p===o){oe(null);return}if(_e(p,b,E))throw new Error(t("sandbox.fileExplorer.fileAlreadyExists",{name:n}));await ae("rename",{from:re(o),to:re(p)}),Ve(v=>v===o?p:v.startsWith(`${o}/`)?De(p,v.slice(o.length+1)):v),await xe(),await we(),oe(null)}async function Rt(t,n){Ce(!0);try{await ae("unlink",{path:re(n.path),recursive:n.kind==="directory"}),Nt(n),Et(n.path),await xe(),await we(),Fe(null),te.success(t("sandbox.fileExplorer.fileDeleted",{name:n.name}))}catch(o){te.error(o instanceof Error?o.message:t("sandbox.fileExplorer.deleteFailed"))}finally{Ce(!1)}}async function Tt(t,n){const o=tr(n);if(o){te.error(o);return}Ce(!0);try{U?.mode==="new-file"?(await St(t,n),te.success(t("sandbox.fileExplorer.fileCreated",{name:n}))):U?.mode==="new-folder"?(await Dt(t,n),te.success(t("sandbox.fileExplorer.folderCreated",{name:n}))):U?.mode==="rename"&&(await Mt(t,n),te.success(t("sandbox.fileExplorer.renamedTo",{name:n})))}catch(c){te.error(c instanceof Error?c.message:t("sandbox.fileExplorer.operationFailed"))}finally{Ce(!1)}}const Ue=d.useRef(!1);Ue.current||(Ue.current=!0,H.current=xe());const[Pt,kt]=d.useState(null),w=Te();if(l&&l!==Pt){kt(l);const t=l;queueMicrotask(()=>{Hn(t)&&he(t)})}async function Ae(t){const n=await ae("glob",t);return{files:n.files??[],directories:n.directories??[],truncated:n.truncated}}function qe(t,n,o){if(o!==A.current)return!1;let c=!1;return u(p=>{const v=n?sr(p.files,p.directories,t,p.truncated):{files:t.files,directories:t.directories??[],truncated:!!t.truncated};return c=!!v.truncated,{files:v.files,directories:v.directories,truncated:c}}),c&&te.warning(w("sandbox.fileExplorer.fileListTruncated")),c}async function Ft(t){const n=W.current.get(t);if(n)return n;const o=A.current,c=(async()=>{const p=await Ae({pattern:"**/*",path:re(t),limit:Oe}),v=qe(p,!0,o);return!v&&o===A.current&&ne(ce=>{const Ne=new Set(ce);return Ne.add(t),Ne}),v})();W.current.set(t,c);try{return await c}finally{W.current.delete(t)}}async function He(t){if(!$e(t,K.current))return!1;_(n=>new Set(n).add(t));try{return await Ft(t)}finally{_(n=>{const o=new Set(n);return o.delete(t),o})}}async function At(t,n){const o=new Set(K.current);for(const c of ze(n)){if(!$e(c,o))continue;if(await He(c))throw new Error(t("sandbox.fileExplorer.folderListingTruncated"));o.add(c)}}async function xe(){const t=++A.current;B.current=null,V.current=null,W.current.clear(),q(!0),ne(new Set),x(new Set),_(new Set);try{const n=await Ae({pattern:"**/*",limit:Oe,maxDepth:Wn});qe(n,!1,t),Y(!0)}catch{$&&te.error(w("sandbox.fileExplorer.failedToRefreshFileTree"))}finally{q(!1)}}async function We(t){if(!me.get(t)?.loaded){de(o=>{const c=new Map(o);return c.set(t,{savedContent:"",editorValue:"",loaded:!1}),c});try{const o=await ae("read",{path:re(t),full:!0}),c=er(o.content??"");de(p=>{const v=new Map(p);return v.set(t,{savedContent:c,editorValue:c,loaded:!0}),v})}catch{}}}function Lt(){k.current++,T(null),D(null),N(!1),j(!1)}async function Ot(){const t=A.current,n=B.current;if(n&&n.generation===t)return n.files;const o=V.current;if(o&&o.generation===t)return o.promise;const c=(async()=>{const p=await Ae({pattern:"**/*",limit:Oe});return A.current===t&&(B.current={generation:t,files:p.files}),p.files})();V.current={generation:t,promise:c};try{return await c}finally{V.current?.generation===t&&(V.current=null)}}async function It(t,n){try{const o=await Ot();if(n!==k.current)return;T(nr(o,t,ct))}catch{if(n!==k.current)return;T([])}}async function Kt(t,n){N(!0);try{const o=await ae("grep",{pattern:t,output_mode:"content",ignore_case:!0,fixed_strings:!0,limit:lt});if(n!==k.current)return;D(rr(o.results??"")),j((o.matchCount??0)>=lt)}catch{if(n!==k.current)return;D([]),j(!1)}finally{n===k.current&&N(!1)}}function zt(t){const n=t.trim(),o=++k.current;It(n,o),n.length<Br?(D(null),N(!1),j(!1)):Kt(n,o)}function $t(t){if(z(t),G.current&&clearTimeout(G.current),!t.trim()){Lt();return}G.current=setTimeout(()=>{zt(t)},Vr)}function Qe(t){const n=Q.current;if(!n||n.path!==f)return;Q.current=null;const o=Math.max(1,n.line);t.revealLineInCenter(o),t.setPosition({lineNumber:o,column:1}),t.focus()}function _t(t){Q.current={path:t.path,line:t.line};const n=f===t.path&&me.get(t.path)?.loaded;he(t.path),n&&Pe.current&&Qe(Pe.current)}async function Gt(t,n){try{await ae("write",{path:re(t),content:n}),je("file saved via sandbox /write",{path:t}),ye.invalidateQueries({queryKey:st(m)});try{const o=await Mn(m);je("git status after save",o)}catch(o){je("git status after save failed",{path:t,error:o instanceof Error?o.message:String(o)})}de(o=>{const c=new Map(o),p=c.get(t);return p&&c.set(t,{...p,savedContent:n}),c})}catch(o){je("file save failed",{path:t,error:o instanceof Error?o.message:String(o)})}}function Bt(t){O(t),I({name:t.split("/").pop()??t,path:t,kind:"file",children:[]}),be(null),C.includes(t)||g(n=>[...n,t]),We(t)}function Vt(t){g(n=>{const o=n.filter(c=>c!==t);return f===t&&O(o[o.length-1]??null),o}),de(n=>{const o=new Map(n);return o.delete(t),o})}function Xe(t){x(n=>{const o=new Set(n);return o.has(t)?o.delete(t):o.add(t),o})}async function Ut(t){if($e(t,K.current))try{if(await He(t))return}catch(n){te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToLoadFolder"));return}Xe(t)}async function qt(t,n){if(n){Xe(t);return}await Ut(t)}async function Ht(t){await H.current,await At(w,t);const n=ze(t);x(o=>{const c=new Set(o);for(const p of n)c.add(p);return c}),Bt(t)}function he(t){Ht(t).catch(n=>{te.error(n instanceof Error?n.message:w("sandbox.fileExplorer.failedToOpenFile"))})}function Wt(){return X?.kind==="directory"?X.path:X?.kind==="file"?Se(X.path):f?Se(f):"/"}function Ye(t){const n=Wt();oe({mode:t,parentDir:n,node:{name:"",path:n,kind:"directory",children:[]}})}const Qt=Qn(b,E),Je=Xn(Qt,h),Le=L?.length??0,Ze=Yn(P??[]),et=P?.length??0,ue=f?me.get(f):null,Xt=ue?.loaded&&ue.editorValue!==ue.savedContent,Yt=ke?jt(ke.path):[],Jt=(t,n)=>{Pe.current=t,Qe(t),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyS,async()=>{if(!f)return;const o=t.getValue();await Gt(f,o)}),t.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.KeyK,()=>{const o=t.getSelection(),c=t.getModel();if(!o||!c||!f)return;const p=c.getValueInRange(o);be({filePath:f,lineStart:o.startLineNumber,lineEnd:o.endLineNumber,selectedCode:p})})};function Zt(t){if(!ie)return;const n=[`The user selected code in the file explorer and asked: **"${t.trim()}"**`,"",`**File:** \`${ie.filePath}\``,`**Lines:** ${ie.lineStart}–${ie.lineEnd}`];if(ie.selectedCode){const o=Ke(ie.filePath),c=ie.selectedCode.replace(/```/g,"`` `");n.push("","**Selected code:**","```"+o,c,"```")}n.push("","Please read the source file, locate the code, and apply the requested change."),Ct(),vt({parts:[{type:"text",text:n.join(`
|
|
2
2
|
`)}]}),be(null)}return F&&!$?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{className:"size-5 text-muted-foreground"})}):r.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[r.jsxs("div",{className:"w-64 shrink-0 border-r flex flex-col overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-1 p-2 border-b",children:[r.jsxs("div",{className:"relative min-w-0 flex-1",children:[r.jsx(vn,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground"}),r.jsx("input",{type:"text",value:R,onChange:t=>$t(t.target.value),placeholder:w("sandbox.fileExplorer.searchFilesPlaceholder"),"aria-label":w("sandbox.fileExplorer.searchFilesLabel"),className:"w-full rounded-md border border-input bg-transparent pl-7 pr-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground focus:ring-1 focus:ring-ring"})]}),r.jsxs(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFileLabel"),onClick:()=>Ye("new-file"),children:r.jsx(Cn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFile")})]}),r.jsxs(tt,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(Re,{type:"button",variant:"ghost",size:"icon",className:"size-7 shrink-0","aria-label":w("sandbox.fileExplorer.newFolderLabel"),onClick:()=>Ye("new-folder"),children:r.jsx(wn,{size:14})})}),r.jsx(rt,{side:"bottom",children:w("sandbox.fileExplorer.newFolder")})]})]}),r.jsx(jn,{className:"flex-1",children:r.jsxs("div",{className:"py-1",children:[!R&&Je.map(t=>{const{node:n,depth:o}=t,c=n.kind==="directory",p=h.has(n.path),v=X?.path===n.path,ce=Jn(n.path,n.kind),Ne=c&&ee.has(n.path);return r.jsx(Gr,{node:n,depth:o,isExpanded:p,isSelected:v,isLoading:Ne,fileVisual:Ie(n.name),onSelect:()=>I(n),onOpen:()=>{c?qt(n.path,p):he(n.path)},onNewFile:()=>oe({mode:"new-file",node:n,parentDir:ce}),onNewFolder:()=>oe({mode:"new-folder",node:n,parentDir:ce}),onCopyPath:()=>Be(w,"Path",Ee(n.path)),onCopyRelativePath:()=>Be(w,"Relative path",re(n.path)),onRename:()=>oe({mode:"rename",node:n,parentDir:ce}),onDelete:()=>Fe(n)},n.path)}),!R&&$&&Je.length===0&&r.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFilesFound")}),R&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.files")}),Le>0&&r.jsxs("span",{className:"normal-case tracking-normal text-muted-foreground/70",children:[Le,Le>=ct?"+":""]})]}),L!==null&&L.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noFileNamesMatch")}),L?.map(t=>{const n=t.split("/").pop()??t,o=Se(t),{Icon:c,color:p}=Ie(n),v=f===t;return r.jsxs("button",{type:"button",onClick:()=>he(t),title:t,className:le("flex w-full items-center gap-1.5 px-3 py-1 text-left text-xs hover:bg-accent",v&&"bg-accent"),children:[r.jsx(c,{size:14,className:le("shrink-0",p)}),r.jsx("span",{className:"max-w-40 shrink-0 truncate",children:n}),o!=="/"&&r.jsx("span",{className:"truncate text-muted-foreground/60",children:o})]},t)})]}),R&&r.jsxs("div",{className:"mt-1 border-t pt-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 pb-0.5 pt-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:[r.jsx("span",{children:w("sandbox.fileExplorer.inFiles")}),et>0&&r.jsxs("span",{className:"text-muted-foreground/70 normal-case tracking-normal",children:[et,M?"+":""]}),S&&r.jsx(pe,{className:"size-[10px]"})]}),!S&&P!==null&&Ze.length===0&&r.jsx("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:w("sandbox.fileExplorer.noMatchesInFileContents")}),Ze.map(t=>{const n=t.path.split("/").pop()??t.path,{Icon:o,color:c}=Ie(n);return r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1 text-xs text-muted-foreground",children:[r.jsx(o,{size:14,className:le("shrink-0",c)}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"text-muted-foreground/60",children:t.matches.length})]}),t.matches.map(p=>r.jsxs("button",{type:"button",onClick:()=>_t(p),title:`${t.path}:${p.line}`,className:"flex w-full items-baseline gap-2 pl-8 pr-3 py-0.5 text-left text-xs hover:bg-accent",children:[r.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:p.line}),r.jsx(qr,{text:p.text,query:R})]},`${t.path}:${p.line}`))]},t.path)})]})]})})]}),r.jsxs("div",{className:"relative flex-1 flex flex-col overflow-hidden",children:[C.length>0&&r.jsx("div",{className:"flex items-center border-b overflow-x-auto shrink-0",children:C.map(t=>{const n=me.get(t),o=n?.loaded&&n.editorValue!==n.savedContent,c=f===t,p=t.split("/").pop()??t;return r.jsxs("div",{className:le("flex items-center gap-1 px-3 py-1.5 text-xs border-r cursor-pointer transition-colors",c?"bg-background text-foreground":"bg-muted/50 text-muted-foreground hover:bg-accent"),onClick:()=>{O(t),We(t)},onKeyDown:()=>{},role:"tab",tabIndex:0,"aria-selected":c,children:[r.jsx("span",{className:"truncate max-w-32",children:p}),o&&r.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-foreground/60 shrink-0"}),r.jsx("button",{type:"button",className:"ml-1 rounded p-0.5 hover:bg-accent-foreground/10",onClick:v=>{v.stopPropagation(),Vt(t)},children:r.jsx(Nn,{size:12})})]},t)})}),ie&&r.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 z-20 mt-2",style:{width:"360px"},children:r.jsxs("form",{className:"flex w-full items-center gap-1.5 rounded-xl border border-border bg-background/95 px-3 py-1.5 shadow-lg backdrop-blur",onSubmit:t=>{t.preventDefault();const o=t.currentTarget.elements.namedItem("askAiInput");o.value.trim()&&Zt(o.value)},children:[r.jsx("input",{name:"askAiInput",autoFocus:!0,type:"text",placeholder:w("sandbox.fileExplorer.askTheAiPlaceholder"),className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onKeyDown:t=>{t.stopPropagation(),t.key==="Escape"&&be(null)}}),r.jsx("button",{type:"submit",className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition-opacity",title:w("sandbox.fileExplorer.send"),children:r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[r.jsx("title",{children:w("sandbox.fileExplorer.send")}),r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),r.jsx("div",{className:"flex-1 overflow-hidden",children:f&&ue?.loaded?r.jsx(Sn,{language:Ke(f),theme:document.documentElement.classList.contains("dark")?"vs-dark":"light",value:ue.editorValue,path:f,onChange:t=>{const n=f;n&&de(o=>{const c=new Map(o),p=c.get(n);return p&&c.set(n,{...p,editorValue:t??""}),c})},onMount:Jt,loading:r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{className:"size-5 text-muted-foreground"})}),options:{fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0,lineNumbersMinChars:2,wordWrap:"on",minimap:{enabled:!1},padding:{top:12,bottom:12},scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:8,horizontalScrollbarSize:8}}},f):f&&!ue?.loaded?r.jsx("div",{className:"flex items-center justify-center h-full w-full",children:r.jsx(pe,{className:"size-5 text-muted-foreground"})}):r.jsx("div",{className:"flex items-center justify-center h-full w-full text-sm text-muted-foreground",children:w("sandbox.fileExplorer.selectFileToEdit")})}),f&&r.jsxs("div",{className:"flex items-center justify-between px-3 py-1 border-t text-[11px] text-muted-foreground shrink-0",children:[r.jsx("span",{className:"truncate",children:f}),r.jsxs("span",{children:[w(Xt?"sandbox.fileExplorer.modified":"sandbox.fileExplorer.saved")," ","· ",Ke(f)]})]})]}),r.jsx(ar,{open:U!==null,mode:U?.mode??"new-file",initialName:U?.mode==="rename"?U.node.name:"",parentLabel:U&&U.mode!=="rename"?U.parentDir==="/"?"/":re(U.parentDir):void 0,isPending:ve,onSubmit:t=>Tt(w,t),onOpenChange:t=>{!t&&!ve&&oe(null)}}),r.jsx(lr,{deleteTarget:ke,deleteDirtyPaths:Yt,fsActionPending:ve,onOpenChange:t=>{!t&&!ve&&Fe(null)},onConfirm:t=>{Rt(w,t)}})]})}export{Hi as FileExplorer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g,j as o}from"./index-
|
|
1
|
+
import{c as g,j as o}from"./index-BhEzjLbQ.js";const h={pdf:"#D92D20",doc:"#155EEF",docx:"#155EEF",txt:"#475467",md:"#475467",xls:"#099250",xlsx:"#099250",csv:"#099250",tsv:"#099250",json:"#475467",xml:"#475467",yaml:"#475467",yml:"#475467",ppt:"#DC6803",pptx:"#DC6803",key:"#DC6803",png:"#7F56D9",jpg:"#7F56D9",jpeg:"#7F56D9",gif:"#7F56D9",webp:"#7F56D9",svg:"#7F56D9",avif:"#7F56D9",mp3:"#DD2590",wav:"#DD2590",mp4:"#DD2590",mov:"#DD2590",webm:"#DD2590",zip:"#475467",tar:"#475467",gz:"#475467",rar:"#475467",html:"#DC6803",htm:"#DC6803",css:"#155EEF",js:"#155EEF",jsx:"#155EEF",ts:"#155EEF",tsx:"#155EEF",py:"#155EEF",sql:"#155EEF",sh:"#475467"},F="#475467",D={pdf:"PDF",doc:"Word document",docx:"Word document",txt:"Text file",md:"Markdown",xls:"Excel file",xlsx:"Excel file",csv:"CSV file",tsv:"TSV file",json:"JSON file",xml:"XML file",yaml:"YAML file",yml:"YAML file",ppt:"Presentation",pptx:"Presentation",key:"Presentation",png:"Image",jpg:"Image",jpeg:"Image",gif:"Image",webp:"Image",svg:"Image",avif:"Image",mp3:"Audio",wav:"Audio",mp4:"Video",mov:"Video",webm:"Video",zip:"Archive",tar:"Archive",gz:"Archive",rar:"Archive",html:"HTML file",htm:"HTML file"};function v(l){const e=f(l);return e?D[e]??`${e.toUpperCase()} file`:"File"}function f(l){const e=l.lastIndexOf(".");if(e<=0||e===l.length-1)return null;const t=l.slice(e+1).toLowerCase();return t.length>4||!/^[a-z0-9]+$/.test(t)?null:t}function u(l){const e=g.c(17);let t,n;e[0]!==l?({filename:t,...n}=l,e[0]=l,e[1]=t,e[2]=n):(t=e[1],n=e[2]);let s,i,a;e[3]!==t?(i=f(t),s=i?h[i]??F:null,a=i?.toUpperCase()??"",e[3]=t,e[4]=s,e[5]=i,e[6]=a):(s=e[4],i=e[5],a=e[6]);const c=a,m=Math.min(8+c.length*4.6,28);let p,x;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=o.jsx("path",{d:"M19.5 1H8a4 4 0 0 0-4 4v30a4 4 0 0 0 4 4h16a4 4 0 0 0 4-4V9.5L19.5 1Z",className:"fill-background stroke-border",strokeWidth:"1.5"}),x=o.jsx("path",{d:"M19.5 1v4.5a4 4 0 0 0 4 4H28",className:"stroke-border",strokeWidth:"1.5"}),e[7]=p,e[8]=x):(p=e[7],x=e[8]);let r;e[9]!==m||e[10]!==s||e[11]!==i||e[12]!==c?(r=i&&s&&o.jsxs(o.Fragment,{children:[o.jsx("rect",{x:"1",y:"20",width:m,height:"12",rx:"3",fill:s}),o.jsx("text",{x:1+m/2,y:"29",textAnchor:"middle",fontSize:"7",fontWeight:"700",letterSpacing:"0.2",fill:"#FFFFFF",style:{fontFamily:"inherit"},children:c})]}),e[9]=m,e[10]=s,e[11]=i,e[12]=c,e[13]=r):r=e[13];let d;return e[14]!==n||e[15]!==r?(d=o.jsxs("svg",{viewBox:"0 0 32 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[p,x,r]}),e[14]=n,e[15]=r,e[16]=d):d=e[16],d}export{u as F,v as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as m,G as x,K as y,m as I,n as R,e as P,r as A,j as g}from"./index-
|
|
1
|
+
import{c as m,G as x,K as y,m as I,n as R,e as P,r as A,j as g}from"./index-BhEzjLbQ.js";import{s as D}from"./Eye-FpMLL5DN.js";function nt(s){return s.contentHash??`${s.size}-${s.updatedAt}`}function S(s,t,e,n){const r=new URLSearchParams(n).toString();return`/api/${encodeURIComponent(s)}/fs/${encodeURIComponent(t)}/${e}${r?`?${r}`:""}`}async function F(s,t,e){const n=await fetch(s,t);if(n.ok||e?.allow404&&n.status===404)return n;let r="";try{r=(await n.json()).error??""}catch{}throw new Error(r||`HTTP ${n.status}`)}function rt(s,t){const e=m.c(15),{org:n}=x();let r;e[0]!==n.id||e[1]!==t||e[2]!==s?(r=y.orgFsList(n.id,s,t),e[0]=n.id,e[1]=t,e[2]=s,e[3]=r):r=e[3];let i;e[4]!==n.id||e[5]!==s?(i=(c,l)=>l?.queryKey[1]===n.id&&l.queryKey[2]===s?c:void 0,e[4]=n.id,e[5]=s,e[6]=i):i=e[6];let a;e[7]!==n.slug||e[8]!==t||e[9]!==s?(a=async()=>(await(await F(S(n.slug,s,"list",{path:t}))).json()).entries.toSorted(M),e[7]=n.slug,e[8]=t,e[9]=s,e[10]=a):a=e[10];let o;return e[11]!==r||e[12]!==i||e[13]!==a?(o={queryKey:r,placeholderData:i,queryFn:a},e[11]=r,e[12]=i,e[13]=a,e[14]=o):o=e[14],I(o)}function M(s,t){return s.kind!==t.kind?s.kind==="dir"?-1:1:s.path.localeCompare(t.path)}async function B(s,t,e){const n=await F(S(s,t,"stat",{path:e}),void 0,{allow404:!0});return n.status===404?null:(await n.json()).entry}function it(s,t,e){const n=m.c(15),{org:r}=x();let i;n[0]!==r.id||n[1]!==t||n[2]!==s?(i=y.orgFsStat(r.id,s??"",t),n[0]=r.id,n[1]=t,n[2]=s,n[3]=i):i=n[3];const a=s!==null;let o;n[4]!==e?(o=e?.refetchIntervalWhenAbsent?d=>d.state.data?!1:e.refetchIntervalWhenAbsent??!1:void 0,n[4]=e,n[5]=o):o=n[5];let c;n[6]!==r.slug||n[7]!==t||n[8]!==s?(c=()=>B(r.slug,s??"",t),n[6]=r.slug,n[7]=t,n[8]=s,n[9]=c):c=n[9];let l;return n[10]!==i||n[11]!==a||n[12]!==o||n[13]!==c?(l={queryKey:i,enabled:a,refetchInterval:o,queryFn:c},n[10]=i,n[11]=a,n[12]=o,n[13]=c,n[14]=l):l=n[14],I(l)}function ot(s){const t=m.c(9),{org:e}=x();let n;t[0]!==e.id||t[1]!==s?(n=y.orgFsUsage(e.id,s),t[0]=e.id,t[1]=s,t[2]=n):n=t[2];let r;t[3]!==e.slug||t[4]!==s?(r=async()=>await(await F(S(e.slug,s,"usage"))).json(),t[3]=e.slug,t[4]=s,t[5]=r):r=t[5];let i;return t[6]!==n||t[7]!==r?(i={queryKey:n,queryFn:r},t[6]=n,t[7]=r,t[8]=i):i=t[8],I(i)}function at(s,t){const e=m.c(9),n=s===void 0?60:s,{org:r}=x();let i;e[0]!==r.id?(i=y.orgFsRecent(r.id),e[0]=r.id,e[1]=i):i=e[1];const a=t?.enabled;let o;e[2]!==n||e[3]!==r.slug?(o=async()=>(await(await F(`/api/${encodeURIComponent(r.slug)}/fs/recent?limit=${n}`)).json()).entries,e[2]=n,e[3]=r.slug,e[4]=o):o=e[4];let c;return e[5]!==i||e[6]!==a||e[7]!==o?(c={queryKey:i,enabled:a,queryFn:o},e[5]=i,e[6]=a,e[7]=o,e[8]=c):c=e[8],I(c)}const Q=50;function lt(s,t){const e=m.c(16),{org:n}=x();let r;e[0]!==n.id||e[1]!==s||e[2]!==t?.prefix||e[3]!==t?.volume?(r=y.orgFsSearch(n.id,s,t?.volume??"",t?.prefix??""),e[0]=n.id,e[1]=s,e[2]=t?.prefix,e[3]=t?.volume,e[4]=r):r=e[4];const i=s.length>0;let a;e[5]!==n.id?(a=(l,d)=>d?.queryKey[1]===n.id?l:void 0,e[5]=n.id,e[6]=a):a=e[6];let o;e[7]!==n.slug||e[8]!==s||e[9]!==t?(o=async()=>{const l=new URLSearchParams({q:s,limit:String(Q)});return t&&(l.set("volume",t.volume),t.prefix&&l.set("prefix",t.prefix)),(await(await F(`/api/${encodeURIComponent(n.slug)}/fs/search?${l}`)).json()).entries},e[7]=n.slug,e[8]=s,e[9]=t,e[10]=o):o=e[10];let c;return e[11]!==r||e[12]!==i||e[13]!==a||e[14]!==o?(c={queryKey:r,enabled:i,placeholderData:a,queryFn:o},e[11]=r,e[12]=i,e[13]=a,e[14]=o,e[15]=c):c=e[15],I(c)}function ct(s){const t=m.c(8),{org:e}=x();let n;t[0]!==e.id?(n=y.orgFsSkills(e.id),t[0]=e.id,t[1]=n):n=t[1];const r=s?.enabled;let i;t[2]!==e.slug?(i=async()=>{const o=await F(`/api/${encodeURIComponent(e.slug)}/fs/skills`),{skills:c}=await o.json();return c.map(N)},t[2]=e.slug,t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r||t[6]!==i?(a={queryKey:n,enabled:r,queryFn:i},t[4]=n,t[5]=r,t[6]=i,t[7]=a):a=t[7],I(a)}function N(s){return{volume:s.volume,path:s.path}}async function W(s){const t=await F(`/api/${encodeURIComponent(s)}/fs/skills`),{skills:e}=await t.json();return e}function ft(){const s=m.c(7),{org:t}=x();let e;s[0]!==t.id?(e=y.slashSkills(t.id),s[0]=t.id,s[1]=e):e=s[1];let n;s[2]!==t.slug?(n=()=>W(t.slug),s[2]=t.slug,s[3]=n):n=s[3];let r;return s[4]!==e||s[5]!==n?(r={queryKey:e,queryFn:n,staleTime:6e4},s[4]=e,s[5]=n,s[6]=r):r=s[6],I(r)}async function H(s,t,e){return(await F(S(s,t,"read",{path:e}))).text()}function dt(s,t){const e=m.c(8);let n;e[0]!==s?(n=y.fileText(s),e[0]=s,e[1]=n):n=e[1];const r=t?.enabled!==!1&&s!=="";let i;e[2]!==s?(i=async()=>{const o=await fetch(s,{credentials:"include"});return o.ok?await o.text():null},e[2]=s,e[3]=i):i=e[3];let a;return e[4]!==n||e[5]!==r||e[6]!==i?(a={queryKey:n,enabled:r,staleTime:6e4,retry:!1,queryFn:i},e[4]=n,e[5]=r,e[6]=i,e[7]=a):a=e[7],I(a)}const X=new Set(["md","mdx","markdown","txt","text"]),G=25,V=64*1024,z=256*1024,Y=4;function J(s){const t=s.lastIndexOf(".");return t===-1?!1:X.has(s.slice(t+1).toLowerCase())}async function ut(s,t,e){const n=e?`${e}/`:"",r=f=>f.startsWith(n)?f.slice(n.length):f,i=[],a=[],o=[{path:e,depth:0}];for(;o.length>0;){const f=o.shift();if(!f)break;let h;try{h=(await(await F(S(s,t,"list",{path:f.path}))).json()).entries}catch{continue}for(const u of[...h].sort((b,w)=>b.path.localeCompare(w.path))){if(u.kind==="dir"){f.depth<Y&&o.push({path:u.path,depth:f.depth+1});continue}J(u.path)&&u.size<=V&&i.length<G?i.push(u.path):a.push(r(u.path))}}const c=await Promise.all(i.map(f=>H(s,t,f).catch(()=>null))),l=[];let d=0;return i.forEach((f,h)=>{const u=c[h];if(u==null||d+u.length>z){a.push(r(f));return}d+=u.length,l.push({relPath:r(f),content:u})}),l.sort((f,h)=>f.relPath==="SKILL.md"?-1:h.relPath==="SKILL.md"?1:f.relPath.localeCompare(h.relPath)),a.sort(),{files:l,omittedPaths:a}}function ht(){const s=m.c(7),{org:t}=x();let e;s[0]!==t.id?(e=y.orgFsPublicSets(t.id),s[0]=t.id,s[1]=e):e=s[1];let n;s[2]!==t.slug?(n=async()=>(await(await F(`/api/${encodeURIComponent(t.slug)}/fs/public-sets`)).json()).sets,s[2]=t.slug,s[3]=n):n=s[3];let r;return s[4]!==e||s[5]!==n?(r={queryKey:e,staleTime:3e5,queryFn:n},s[4]=e,s[5]=n,s[6]=r):r=s[6],I(r)}function gt(s){const t=m.c(3),{org:e}=x();let n;return t[0]!==e.slug||t[1]!==s?(n=r=>S(e.slug,s,"read",{path:r}),t[0]=e.slug,t[1]=s,t[2]=n):n=t[2],n}function yt(){const s=m.c(2),{org:t}=x();let e;return s[0]!==t.slug?(e=(n,r)=>S(t.slug,n,"read",{path:r}),s[0]=t.slug,s[1]=e):e=s[1],e}function pt(s){const t=m.c(3),{org:e}=x();let n;return t[0]!==e||t[1]!==s?(n={mutationFn:async r=>(await(await F(S(e.slug,s,"file",{path:r.path}),{method:"PUT",headers:{"content-type":r.contentType??"text/html; charset=utf-8"},body:r.body})).json()).entry},t[0]=e,t[1]=s,t[2]=n):n=t[2],P(n)}function Ft(s){const t=m.c(18),{org:e}=x(),n=R();let r;t[0]!==e||t[1]!==s?(r=async l=>(await(await F(S(e.slug,s,"public",{path:l.path}),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({mode:l.mode,password:l.password})})).json()).entry,t[0]=e,t[1]=s,t[2]=r):r=t[2];let i;t[3]!==e||t[4]!==n||t[5]!==s?(i=async l=>{const d=y.orgFsStat(e.id,s,l.path);await n.cancelQueries({queryKey:d});const f=n.getQueryData(d),h=l.mode!=="private";return n.setQueryData(d,u=>u&&{...u,readPublic:h,effectivePublic:h,shareMode:l.mode}),{key:d,previous:f}},t[3]=e,t[4]=n,t[5]=s,t[6]=i):i=t[6];let a;t[7]!==n?(a=(l,d,f)=>{f&&n.setQueryData(f.key,f.previous)},t[7]=n,t[8]=a):a=t[8];let o;t[9]!==e||t[10]!==n||t[11]!==s?(o=(l,d,f)=>{n.invalidateQueries({queryKey:y.orgFsStat(e.id,s,f.path)}),n.invalidateQueries({queryKey:y.orgFsVolume(e.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(e.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e.id)})},t[9]=e,t[10]=n,t[11]=s,t[12]=o):o=t[12];let c;return t[13]!==r||t[14]!==i||t[15]!==a||t[16]!==o?(c={mutationFn:r,onMutate:i,onError:a,onSettled:o},t[13]=r,t[14]=i,t[15]=a,t[16]=o,t[17]=c):c=t[17],P(c)}function mt(s){const t=m.c(33),{org:e}=x(),n=R();let r;t[0]!==e||t[1]!==n||t[2]!==s?(r=()=>{n.invalidateQueries({queryKey:y.orgFsVolume(e.id,s)}),n.invalidateQueries({queryKey:y.orgFsRecent(e.id)}),n.invalidateQueries({queryKey:y.orgFsSearchRoot(e.id)})},t[0]=e,t[1]=n,t[2]=s,t[3]=r):r=t[3];const i=r;let a;t[4]!==e||t[5]!==s?(a=async p=>{const C=(await Promise.allSettled(p.files.map(j=>{const q=p.dir?`${p.dir}/${j.name}`:j.name;return F(S(e.slug,s,"file",{path:q}),{method:"PUT",headers:{"content-type":j.type||"application/octet-stream"},body:j})}))).find(Z);if(C)throw C.reason},t[4]=e,t[5]=s,t[6]=a):a=t[6];let o;t[7]!==i||t[8]!==a?(o={mutationFn:a,onSettled:i},t[7]=i,t[8]=a,t[9]=o):o=t[9];const c=P(o);let l;t[10]!==e||t[11]!==s?(l=async p=>{await F(S(e.slug,s,"dir",{path:p}),{method:"POST"})},t[10]=e,t[11]=s,t[12]=l):l=t[12];let d;t[13]!==i||t[14]!==l?(d={mutationFn:l,onSuccess:i},t[13]=i,t[14]=l,t[15]=d):d=t[15];const f=P(d);let h;t[16]!==e||t[17]!==s?(h=async p=>{await F(S(e.slug,s,"file",{path:p}),{method:"DELETE"})},t[16]=e,t[17]=s,t[18]=h):h=t[18];let u;t[19]!==i||t[20]!==h?(u={mutationFn:h,onSuccess:i},t[19]=i,t[20]=h,t[21]=u):u=t[21];const b=P(u);let w;t[22]!==e||t[23]!==s?(w=async p=>{await F(S(e.slug,s,"move"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(p)})},t[22]=e,t[23]=s,t[24]=w):w=t[24];let k;t[25]!==i||t[26]!==w?(k={mutationFn:w,onSuccess:i},t[25]=i,t[26]=w,t[27]=k):k=t[27];const T=P(k);let $;return t[28]!==f||t[29]!==T||t[30]!==b||t[31]!==c?($={upload:c,mkdir:f,remove:b,move:T},t[28]=f,t[29]=T,t[30]=b,t[31]=c,t[32]=$):$=t[32],$}function Z(s){return s.status==="rejected"}function v(s){const t={};for(const e of s.split(`
|
|
2
2
|
`)){const n=e.match(/^([A-Za-z][\w-]*):\s*(.*)$/);n?.[1]&&n[2]!==void 0&&(t[n[1].toLowerCase()]=n[2].trim())}return t}function U(s){for(const t of s.split(/\n\s*\n/)){const e=t.trim();if(!(!e||e.startsWith("#")))return e.replace(/\n/g," ")}return null}function wt(s){const t=s.match(/^---\n([\s\S]*?)\n---\n?/);if(!t||t[1]===void 0)return{name:null,description:U(s),body:s};const e=v(t[1]),n=s.slice(t[0].length);return{name:e.name||null,description:e.description||U(n),body:n}}const tt={default:{backFrom:"#4D87DF",backTo:"#296FE8",frontFrom:"#72B6FA",frontTo:"#5BB1EF",stripe:"#84CDFB",glyph:"#014AC9"},system:{backFrom:"#8A94A6",backTo:"#6B7687",frontFrom:"#B6BEC9",frontTo:"#A3ADBA",stripe:"#D5DBE3",glyph:"#3D4757"}};function St(s){const t=m.c(46);let e,n,r,i;t[0]!==s?({glyph:e,readOnly:r,tone:i,...n}=s,t[0]=s,t[1]=e,t[2]=n,t[3]=r,t[4]=i):(e=t[1],n=t[2],r=t[3],i=t[4]);const o=tt[i===void 0?"default":i],c=A.useId(),l=`${c}-back`,d=`${c}-front`,f=`url(#${l})`;let h;t[5]!==f?(h=g.jsx("path",{d:"M2.53738 2.55C1.13602 2.55 0 3.68602 0 5.08738V11.535H31.931V7.65326C31.931 6.23616 30.7822 5.08738 29.3651 5.08738H14.7681L13.8775 5.02542C13.3886 4.99141 12.9197 4.81809 12.5261 4.52596L10.7726 3.22419C10.1828 2.78638 9.46784 2.55 8.73334 2.55H2.53738Z",fill:f}),t[5]=f,t[6]=h):h=t[6];const u=`url(#${d})`;let b;t[7]!==u?(b=g.jsx("rect",{y:"8.72",width:"32",height:"21",rx:"2.566",fill:u}),t[7]=u,t[8]=b):b=t[8];let w;t[9]===Symbol.for("react.memo_cache_sentinel")?(w=g.jsx("rect",{x:"0.3",y:"8.86",width:"31.4",height:"0.55",rx:"0.275",fill:"#FFFFFF",opacity:"0.25"}),t[9]=w):w=t[9];let k,T;t[10]!==o.stripe?(k=g.jsx("rect",{y:"25.81",width:"32",height:"0.552",fill:o.stripe}),T=g.jsx("rect",{y:"27.05",width:"32",height:"0.552",fill:o.stripe}),t[10]=o.stripe,t[11]=k,t[12]=T):(k=t[11],T=t[12]);let $;t[13]!==e||t[14]!==o.glyph?($=e&&g.jsx(e,{x:10.5,y:13.2,width:11,height:11,strokeWidth:2.2,style:{color:o.glyph,opacity:.55}}),t[13]=e,t[14]=o.glyph,t[15]=$):$=t[15];let p;t[16]!==r?(p=r&&g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:"25.5",cy:"25.5",r:"6.2",strokeWidth:"1",className:"fill-background stroke-border"}),g.jsx(D,{x:22.1,y:22.1,width:6.8,height:6.8,strokeWidth:2.2,className:"text-muted-foreground"})]}),t[16]=r,t[17]=p):p=t[17];let K;t[18]!==o.backFrom?(K=g.jsx("stop",{offset:"0.3",stopColor:o.backFrom}),t[18]=o.backFrom,t[19]=K):K=t[19];let C;t[20]!==o.backTo?(C=g.jsx("stop",{offset:"1",stopColor:o.backTo}),t[20]=o.backTo,t[21]=C):C=t[21];let j;t[22]!==l||t[23]!==K||t[24]!==C?(j=g.jsxs("linearGradient",{id:l,x1:"15.97",y1:"2.55",x2:"15.97",y2:"9.53",gradientUnits:"userSpaceOnUse",children:[K,C]}),t[22]=l,t[23]=K,t[24]=C,t[25]=j):j=t[25];let q;t[26]!==o.frontFrom?(q=g.jsx("stop",{stopColor:o.frontFrom}),t[26]=o.frontFrom,t[27]=q):q=t[27];let O;t[28]!==o.frontTo?(O=g.jsx("stop",{offset:"1",stopColor:o.frontTo}),t[28]=o.frontTo,t[29]=O):O=t[29];let L;t[30]!==d||t[31]!==q||t[32]!==O?(L=g.jsxs("radialGradient",{id:d,cx:"0",cy:"0",r:"10",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(1.6 0 0 2.1538 16 19.22)",children:[q,O]}),t[30]=d,t[31]=q,t[32]=O,t[33]=L):L=t[33];let E;t[34]!==j||t[35]!==L?(E=g.jsxs("defs",{children:[j,L]}),t[34]=j,t[35]=L,t[36]=E):E=t[36];let _;return t[37]!==n||t[38]!==p||t[39]!==E||t[40]!==h||t[41]!==b||t[42]!==k||t[43]!==T||t[44]!==$?(_=g.jsxs("svg",{viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",...n,children:[h,b,w,k,T,$,p,E]}),t[37]=n,t[38]=p,t[39]=E,t[40]=h,t[41]=b,t[42]=k,t[43]=T,t[44]=$,t[45]=_):_=t[45],_}export{St as F,W as a,yt as b,at as c,ct as d,gt as e,ut as f,pt as g,nt as h,Ft as i,it as j,dt as k,rt as l,lt as m,ht as n,ot as o,wt as p,ft as q,B as r,mt as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f9 as C,c as f,j as c,as as j,r as d,l as p,ca as b,fa as v,fb as h}from"./index-
|
|
1
|
+
import{f9 as C,c as f,j as c,as as j,r as d,l as p,ca as b,fa as v,fb as h}from"./index-BhEzjLbQ.js";import{L as N}from"./label-DATBqEie.js";const E=C,g=d.createContext({}),M=t=>{const e=f.c(9);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];let o;e[2]!==s.name?(o={name:s.name},e[2]=s.name,e[3]=o):o=e[3];let n;e[4]!==s?(n=c.jsx(j,{...s}),e[4]=s,e[5]=n):n=e[5];let r;return e[6]!==o||e[7]!==n?(r=c.jsx(g.Provider,{value:o,children:n}),e[6]=o,e[7]=n,e[8]=r):r=e[8],r},x=()=>{const t=f.c(13),e=d.useContext(g),s=d.useContext($),{getFieldState:o}=v();let n;t[0]!==e.name?(n={name:e.name},t[0]=e.name,t[1]=n):n=t[1];const r=h(n);let a;t[2]!==e.name||t[3]!==r||t[4]!==o?(a=o(e.name,r),t[2]=e.name,t[3]=r,t[4]=o,t[5]=a):a=t[5];const l=a;if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=s,m=`${i}-form-item`,F=`${i}-form-item-description`,I=`${i}-form-item-message`;let u;return t[6]!==e.name||t[7]!==l||t[8]!==i||t[9]!==m||t[10]!==F||t[11]!==I?(u={id:i,name:e.name,formItemId:m,formDescriptionId:F,formMessageId:I,...l},t[6]=e.name,t[7]=l,t[8]=i,t[9]=m,t[10]=F,t[11]=I,t[12]=u):u=t[12],u},$=d.createContext({});function w(t){const e=f.c(13);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const n=d.useId();let r;e[3]!==n?(r={id:n},e[3]=n,e[4]=r):r=e[4];let a;e[5]!==s?(a=p("grid gap-2",s),e[5]=s,e[6]=a):a=e[6];let l;e[7]!==o||e[8]!==a?(l=c.jsx("div",{"data-slot":"form-item",className:a,...o}),e[7]=o,e[8]=a,e[9]=l):l=e[9];let i;return e[10]!==r||e[11]!==l?(i=c.jsx($.Provider,{value:r,children:l}),e[10]=r,e[11]=l,e[12]=i):i=e[12],i}function L(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formItemId:r}=x(),a=!!n;let l;e[3]!==s?(l=p("text-foreground data-[error=true]:text-destructive",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==r||e[6]!==o||e[7]!==a||e[8]!==l?(i=c.jsx(N,{"data-slot":"form-label","data-error":a,className:l,htmlFor:r,...o}),e[5]=r,e[6]=o,e[7]=a,e[8]=l,e[9]=i):i=e[9],i}function P(t){const e=f.c(7);let s;e[0]!==t?({...s}=t,e[0]=t,e[1]=s):s=e[1];const{error:o,formItemId:n,formDescriptionId:r,formMessageId:a}=x(),l=o?`${r} ${a}`:`${r}`,i=!!o;let m;return e[2]!==n||e[3]!==s||e[4]!==l||e[5]!==i?(m=c.jsx(b,{"data-slot":"form-control",id:n,"aria-describedby":l,"aria-invalid":i,...s}),e[2]=n,e[3]=s,e[4]=l,e[5]=i,e[6]=m):m=e[6],m}function y(t){const e=f.c(9);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{formDescriptionId:n}=x();let r;e[3]!==s?(r=p("text-muted-foreground text-sm",s),e[3]=s,e[4]=r):r=e[4];let a;return e[5]!==n||e[6]!==o||e[7]!==r?(a=c.jsx("p",{"data-slot":"form-description",id:n,className:r,...o}),e[5]=n,e[6]=o,e[7]=r,e[8]=a):a=e[8],a}function R(t){const e=f.c(10);let s,o;e[0]!==t?({className:s,...o}=t,e[0]=t,e[1]=s,e[2]=o):(s=e[1],o=e[2]);const{error:n,formMessageId:r}=x(),a=n?String(n?.message??""):o.children;if(!a)return null;let l;e[3]!==s?(l=p("text-destructive text-sm",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==a||e[6]!==r||e[7]!==o||e[8]!==l?(i=c.jsx("p",{"data-slot":"form-message",id:r,className:l,...o,children:a}),e[5]=a,e[6]=r,e[7]=o,e[8]=l,e[9]=i):i=e[9],i}export{E as F,w as a,P as b,R as c,M as d,L as e,y as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ae as re,ag as X,b as U,G as ie,n as le,aq as ce,ar as ge,e as ne,o as W,t as G,K as ee,j as i,dp as se,dq as oe,dr as M,as as de,c as Y,r as J,a7 as me,M as te,cP as ue,cQ as fe,w as pe,B as he,P as $,ds as xe}from"./index-
|
|
1
|
+
import{ae as re,ag as X,b as U,G as ie,n as le,aq as ce,ar as ge,e as ne,o as W,t as G,K as ee,j as i,dp as se,dq as oe,dr as M,as as de,c as Y,r as J,a7 as me,M as te,cP as ue,cQ as fe,w as pe,B as he,P as $,ds as xe}from"./index-BhEzjLbQ.js";import{u as je}from"./use-org-auth-client-BH8MZ9Tj.js";import{u as ze}from"./use-debounced-autosave-bSvv8G3l.js";import{A as Se}from"./avatar-DuTj899Y.js";import{I as ae}from"./input-BMFOQzCl.js";import{C as ve}from"./review-settings-BziHnlzx.js";import{D as Oe}from"./domain-settings-BFJSN7ln.js";import{c as be,d as ye,b as Ce,f as _e,g as Ae,e as De,a as Fe,A as we}from"./alert-dialog-CKoI9s9h.js";import{R as Ne}from"./require-capability-H8pqZV1Q.js";import"./User01-Bd5k9olw.js";import"./switch-BIU4bXkO.js";import"./UserSquare-BJE1UpTV.js";import"./GitBranch01-YYhgXV79.js";import"./use-organization-settings-B9Fjtbef.js";import"./constants-BRGHAWVM.js";import"./schema-CECbfc85.js";import"./task-board-s1xrPKcx.js";import"./badge-D4BnEaXw.js";import"./select-CDIZb2kA.js";import"./Check-CL33jZC8.js";import"./ChevronUp-BSXLuscD.js";import"./access-gate-CaxWKumJ.js";import"./capability-load-error-DyIMk85j.js";const Te=re({name:X().min(1,"Name is required").max(255,"Name is too long"),logo:X().optional()});function Ee(e){const t=Y.c(17),{value:n,onChange:g,name:r,disabled:l}=e,d=U(),m=J.useRef(null);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>m.current?.click(),t[0]=a):a=t[0];const h=a;let s;t[1]!==g||t[2]!==d?(s=Z=>{const z=Z.target.files?.[0];if(!z)return;if(z.size>2097152){G.error(d("settings.organizationForm.imageTooLarge"));return}const p=new FileReader;p.onerror=()=>G.error(d("settings.organizationForm.failedToReadImage")),p.onloadend=()=>{p.result&&g(p.result),m.current&&(m.current.value="")},p.readAsDataURL(z)},t[1]=g,t[2]=d,t[3]=s):s=t[3];const c=s;let o;t[4]!==d?(o=d("settings.organizationForm.uploadLogoLabel"),t[4]=d,t[5]=o):o=t[5];let u;t[6]!==l||t[7]!==c?(u=i.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:c,className:"hidden",disabled:l}),t[6]=l,t[7]=c,t[8]=u):u=t[8];const x=n||void 0,j=r??"?";let f;t[9]!==x||t[10]!==j?(f=i.jsx(Se,{url:x,fallback:j,shape:"square",size:"base"}),t[9]=x,t[10]=j,t[11]=f):f=t[11];let S;return t[12]!==l||t[13]!==o||t[14]!==u||t[15]!==f?(S=i.jsxs("button",{type:"button",onClick:h,disabled:l,className:"rounded-lg overflow-hidden hover:ring-2 hover:ring-border transition-all disabled:opacity-50","aria-label":o,children:[u,f]}),t[12]=l,t[13]=o,t[14]=u,t[15]=f,t[16]=S):S=t[16],S}function Pe(){const e=U(),{org:t}=ie(),n=je(),g=le(),r=ce({resolver:ge(Te),values:{name:t.name??"",logo:t.logo??""}}),l=ne({mutationFn:async s=>{const c={name:s.name};s.logo&&(c.logo=s.logo);const o=await n.organization.update({data:c});if(o?.error)throw new Error(o.error.message||e("settings.organizationForm.failedToUpdateOrg"));return o},onSuccess:(s,c)=>{W("organization_settings_updated",{organization_id:t.id,fields:Object.keys(c)}),g.invalidateQueries({queryKey:ee.organizations()}),g.invalidateQueries({queryKey:ee.activeOrganization(t.slug)}),G.success(e("settings.organizationForm.updateSuccess"))},onError:(s,c)=>{W("organization_settings_update_failed",{organization_id:t.id,fields:Object.keys(c),error:s instanceof Error?s.message:String(s)}),G.error(s instanceof Error?s.message:e("settings.organizationForm.failedToUpdateOrg"))}}),{schedule:d,flush:m}=ze({save:async()=>{const s=r.control._formState.dirtyFields;if(Object.keys(s).length===0||!await r.trigger())return;const o=r.getValues(),u=r.control._defaultValues;r.reset(o,{keepValues:!0});try{await l.mutateAsync(o)}catch{r.reset(u,{keepValues:!0})}}}),a=r.formState.errors,h=typeof window<"u"?`${window.location.host}/`:"";return i.jsx(se,{children:i.jsxs(oe,{children:[i.jsx(M,{title:e("settings.organizationForm.logoTitle"),description:e("settings.organizationForm.logoDescription"),action:i.jsx(Ee,{value:r.watch("logo"),onChange:s=>{r.setValue("logo",s??"",{shouldDirty:!0}),m()},name:r.watch("name")})}),i.jsx(M,{title:e("settings.organizationForm.nameTitle"),action:i.jsx(de,{control:r.control,name:"name",render:({field:s})=>i.jsx(ae,{id:"org-name",...s,onChange:c=>{s.onChange(c),d()},onBlur:()=>{s.onBlur(),m()},placeholder:e("settings.organizationForm.namePlaceholder"),className:"w-[280px]"})})}),i.jsx(M,{title:e("settings.organizationForm.urlTitle"),description:e("settings.organizationForm.urlDescription"),action:i.jsxs("div",{className:"flex items-center w-[280px] rounded-md border border-input bg-muted/40 overflow-hidden",children:[h&&i.jsx("span",{className:"pl-3 text-sm text-muted-foreground select-none",children:h}),i.jsx("span",{className:"flex-1 min-w-0 px-2 py-1.5 text-sm text-foreground truncate",children:t.slug})]})}),(a.name||a.logo)&&i.jsxs("div",{className:"px-5 pb-3 flex flex-col gap-1",children:[a.name&&i.jsx("p",{className:"text-xs text-destructive",children:a.name.message}),a.logo&&i.jsx("p",{className:"text-xs text-destructive",children:a.logo.message})]})]})})}function Le(){const e=Y.c(86),t=U(),{org:n}=ie(),[g,r]=J.useState(!1),[l,d]=J.useState(""),m=me();let a;e[0]!==n.id||e[1]!==m?(a=async()=>{await m.call("ORGANIZATION_DELETE",{id:n.id})},e[0]=n.id,e[1]=m,e[2]=a):a=e[2];let h;e[3]!==n.id||e[4]!==n.slug||e[5]!==t?(h=()=>{W("organization_deleted",{organization_id:n.id}),localStorage.getItem(te.lastOrgSlug())===n.slug&&localStorage.removeItem(te.lastOrgSlug()),ue()?.org===n.slug&&fe(),pe(),G.success(t("settings.deleteOrganizationSection.organizationDeleted")),window.location.href="/"},e[3]=n.id,e[4]=n.slug,e[5]=t,e[6]=h):h=e[6];let s;e[7]!==t?(s=v=>{G.error(v instanceof Error?v.message:t("settings.deleteOrganizationSection.failedToDeleteOrganization"))},e[7]=t,e[8]=s):s=e[8];let c;e[9]!==a||e[10]!==h||e[11]!==s?(c={mutationFn:a,onSuccess:h,onError:s},e[9]=a,e[10]=h,e[11]=s,e[12]=c):c=e[12];const o=ne(c);let u;e[13]!==t?(u=t("settings.deleteOrganizationSection.dangerZone"),e[13]=t,e[14]=u):u=e[14];let x;e[15]!==t?(x=t("settings.deleteOrganizationSection.irreversibleActionsDescription"),e[15]=t,e[16]=x):x=e[16];let j;e[17]!==t?(j=t("settings.deleteOrganizationSection.deleteOrganizationTitle"),e[17]=t,e[18]=j):j=e[18];let f;e[19]!==t?(f=t("settings.deleteOrganizationSection.deleteOrganizationDescription"),e[19]=t,e[20]=f):f=e[20];let S;e[21]===Symbol.for("react.memo_cache_sentinel")?(S=()=>r(!0),e[21]=S):S=e[21];const Z=o.isPending;let z;e[22]!==t?(z=t("settings.deleteOrganizationSection.deleteButton"),e[22]=t,e[23]=z):z=e[23];let p;e[24]!==o.isPending||e[25]!==z?(p=i.jsx(he,{variant:"destructive",size:"sm",onClick:S,disabled:Z,children:z}),e[24]=o.isPending,e[25]=z,e[26]=p):p=e[26];let O;e[27]!==p||e[28]!==j||e[29]!==f?(O=i.jsx(oe,{className:"border-destructive/40",children:i.jsx(M,{title:j,description:f,action:p})}),e[27]=p,e[28]=j,e[29]=f,e[30]=O):O=e[30];let b;e[31]!==O||e[32]!==u||e[33]!==x?(b=i.jsx(se,{title:u,description:x,children:O}),e[31]=O,e[32]=u,e[33]=x,e[34]=b):b=e[34];let K;e[35]===Symbol.for("react.memo_cache_sentinel")?(K=v=>{r(v),v||d("")},e[35]=K):K=e[35];let y;e[36]!==t?(y=t("settings.deleteOrganizationSection.deleteOrganizationQuestion"),e[36]=t,e[37]=y):y=e[37];let C;e[38]!==y?(C=i.jsx(be,{children:y}),e[38]=y,e[39]=C):C=e[39];let _;e[40]!==n.name||e[41]!==t?(_=t("settings.deleteOrganizationSection.deleteWarning",{organizationName:n.name}),e[40]=n.name,e[41]=t,e[42]=_):_=e[42];let A;e[43]!==_?(A=i.jsx("p",{children:_}),e[43]=_,e[44]=A):A=e[44];let D;e[45]!==n.name||e[46]!==t?(D=t("settings.deleteOrganizationSection.typeToConfirm",{organizationName:n.name}),e[45]=n.name,e[46]=t,e[47]=D):D=e[47];let F;e[48]!==D?(F=i.jsx("p",{className:"mt-3 mb-1.5",children:D}),e[48]=D,e[49]=F):F=e[49];let Q;e[50]===Symbol.for("react.memo_cache_sentinel")?(Q=v=>d(v.target.value),e[50]=Q):Q=e[50];let w;e[51]!==l||e[52]!==n.name?(w=i.jsx(ae,{value:l,onChange:Q,placeholder:n.name,autoFocus:!0}),e[51]=l,e[52]=n.name,e[53]=w):w=e[53];let N;e[54]!==A||e[55]!==F||e[56]!==w?(N=i.jsx(ye,{asChild:!0,children:i.jsxs("div",{children:[A,F,w]})}),e[54]=A,e[55]=F,e[56]=w,e[57]=N):N=e[57];let T;e[58]!==C||e[59]!==N?(T=i.jsxs(Ce,{children:[C,N]}),e[58]=C,e[59]=N,e[60]=T):T=e[60];let E;e[61]!==t?(E=t("settings.deleteOrganizationSection.cancel"),e[61]=t,e[62]=E):E=e[62];let P;e[63]!==E?(P=i.jsx(_e,{children:E}),e[63]=E,e[64]=P):P=e[64];let L;e[65]!==o?(L=()=>o.mutate(),e[65]=o,e[66]=L):L=e[66];const H=l!==n.name||o.isPending;let k;e[67]!==o.isPending||e[68]!==t?(k=o.isPending?t("settings.deleteOrganizationSection.deleting"):t("settings.deleteOrganizationSection.deleteOrganizationAction"),e[67]=o.isPending,e[68]=t,e[69]=k):k=e[69];let R;e[70]!==L||e[71]!==H||e[72]!==k?(R=i.jsx(Ae,{onClick:L,disabled:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50",children:k}),e[70]=L,e[71]=H,e[72]=k,e[73]=R):R=e[73];let q;e[74]!==P||e[75]!==R?(q=i.jsxs(De,{children:[P,R]}),e[74]=P,e[75]=R,e[76]=q):q=e[76];let I;e[77]!==T||e[78]!==q?(I=i.jsxs(Fe,{children:[T,q]}),e[77]=T,e[78]=q,e[79]=I):I=e[79];let B;e[80]!==g||e[81]!==I?(B=i.jsx(we,{open:g,onOpenChange:K,children:I}),e[80]=g,e[81]=I,e[82]=B):B=e[82];let V;return e[83]!==b||e[84]!==B?(V=i.jsxs(i.Fragment,{children:[b,B]}),e[83]=b,e[84]=B,e[85]=V):V=e[85],V}function ke(){const e=Y.c(10),t=U();let n;e[0]!==t?(n=t("settings.orgGeneral.organization"),e[0]=t,e[1]=n):n=e[1];let g;e[2]!==n?(g=i.jsx($.Title,{children:n}),e[2]=n,e[3]=g):g=e[3];let r,l,d,m;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(Pe,{}),l=i.jsx(ve,{}),d=i.jsx(Oe,{}),m=i.jsx(Le,{}),e[4]=r,e[5]=l,e[6]=d,e[7]=m):(r=e[4],l=e[5],d=e[6],m=e[7]);let a;return e[8]!==g?(a=i.jsx($,{children:i.jsx($.Content,{children:i.jsx($.Body,{children:i.jsxs(xe,{children:[g,r,l,d,m]})})})}),e[8]=g,e[9]=a):a=e[9],a}function at(){const e=Y.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsx(Ne,{capability:"org:manage",area:"general settings",children:i.jsx(ke,{})}),e[0]=t):t=e[0],t}export{at as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as o}from"./index-
|
|
1
|
+
import{c as n,j as o}from"./index-BhEzjLbQ.js";function a(r){const e=n.c(4),{size:t,className:c}=r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=o.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0016 8c0-4.42-3.58-8-8-8z"}),e[0]=s):s=e[0];let i;return e[1]!==c||e[2]!==t?(i=o.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",className:c,children:s}),e[1]=c,e[2]=t,e[3]=i):i=e[3],i}export{a as G};
|
package/dist/client/assets/{github-repo-picker-uvINVPSy.js → github-repo-picker-yH6O8Ls_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as Z,G as de,a as ye,n as me,r as D,aR as le,b as ee,j as t,h as X,e as ge,t as te,ff as Ne,K as se,m as ke,l as ae,B as re,x as ve,z as Ce}from"./index-DDSNDMaG.js";import{c as Re,d as we,b as Pe,D as Se}from"./dialog-CuB4HOy7.js";import{C as Ie}from"./collection-search-BeW2b3B3.js";import{u as Te}from"./use-debounced-value-CPghpkkl.js";import{b as he,u as _e}from"./use-connection-CrVsFWUZ.js";import{u as ne}from"./use-mcp-client-Cj0bA5NH.js";import{W as Ee,S as pe}from"./constants-BRGHAWVM.js";import{a as be}from"./authenticate-and-persist-oauth-D6EMzeUi.js";import{i as ue}from"./ArrowLeft-BgG6HRXV.js";import{n as Ae}from"./LinkExternal01-BYZlGi_o.js";import{n as ze}from"./Share07-DZL3sM21.js";import{t as Le,u as Ge}from"./use-navigate-to-agent-3Qr6s8iN.js";import{e as Fe}from"./extract-connection-data-DC6mexeM.js";import{G as M}from"./github-icon--6BU0sXT.js";import{b as Oe,p as fe,f as Ue,G as xe}from"./provision-repo-scoped-github-connection-WQFARyHG.js";function De(C,e){const i=Z.c(12),{org:a}=de();let y;i[0]!==a.id?(y=Ee.REGISTRY(a.id),i[0]=a.id,i[1]=y):y=i[1];const r=y;let c;i[2]!==a.id||i[3]!==a.slug||i[4]!==r?(c={connectionId:r,orgId:a.id,orgSlug:a.slug},i[2]=a.id,i[3]=a.slug,i[4]=r,i[5]=c):c=i[5];const o=ne(c);let s;i[6]!==C?(s={name:C},i[6]=C,i[7]=s):s=i[7];const u=e?.enabled??!0;let k;return i[8]!==o||i[9]!==s||i[10]!==u?(k={client:o,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:He},i[8]=o,i[9]=s,i[10]=u,i[11]=k):k=i[11],Le(k)}function He(C){return C.structuredContent?.item??null}const Me="deco/mcp-github";function $e(C){const{org:e}=de(),{data:i}=ye.useSession(),a=he(),y=me(),[r,c]=D.useState("idle"),[o,s]=D.useState(null),[u,k]=D.useState(null),{data:v,isLoading:P}=De(Me,{enabled:C.enabled}),f=D.useRef(!1);C.enabled&&v&&!P&&!f.current&&i?.user?.id&&r==="idle"&&(f.current=!0,d());async function d(){if(!(!v||!i?.user?.id||!e))try{c("installing"),s(null);const l=Fe(v,e.id,i.user.id,{remoteIndex:0});if(!l.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:g}=await a.create.mutateAsync(l);c("authenticating");const j=await be({connectionId:g,orgId:e.id,orgSlug:e.slug,persistFallback:x=>a.update.mutateAsync({id:g,data:{connection_token:x}}).then(()=>{})});if(j.ran&&!j.ok){try{await a.delete.mutateAsync(g)}catch{}throw new Error(j.error&&j.error!=="no token received"?j.error:"No token received from GitHub")}le(y,e.id),k(l),c("ready")}catch(l){s(l instanceof Error?l.message:String(l)),c("error")}}function m(){c("idle"),s(null),k(null),f.current=!1}return C.enabled&&P&&r==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:r,error:o,connection:u,retry:m}}function dt(C){const e=Z.c(27),{open:i,onOpenChange:a,title:y,onImportComplete:r,mode:c}=C,o=c===void 0?"agent":c,s=ee();let u;e[0]!==o||e[1]!==s||e[2]!==y?(u=y??s(o==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=o,e[1]=s,e[2]=y,e[3]=u):u=e[3];const k=u,[v,P]=D.useState(null);let f;e[4]!==k?(f=t.jsx(Re,{className:"sr-only",children:t.jsx(we,{children:k})}),e[4]=k,e[5]=f):f=e[5];let d;e[6]!==k||e[7]!==v||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:v?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>P(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(ue,{size:16})}),t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:k})]})}),e[6]=k,e[7]=v,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(X,{className:"size-4.5 text-muted-foreground"})}),e[10]=m):m=e[10];let l;e[11]!==a?(l=()=>a(!1),e[11]=a,e[12]=l):l=e[12];let p;e[13]!==o||e[14]!==r||e[15]!==i||e[16]!==v||e[17]!==l?(p=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(D.Suspense,{fallback:m,children:t.jsx(qe,{open:i,onComplete:l,selectedInstallation:v,onSelectInstallation:P,onImportComplete:r,mode:o})})}),e[13]=o,e[14]=r,e[15]=i,e[16]=v,e[17]=l,e[18]=p):p=e[18];let g;e[19]!==f||e[20]!==d||e[21]!==p?(g=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,p]}),e[19]=f,e[20]=d,e[21]=p,e[22]=g):g=e[22];let j;return e[23]!==a||e[24]!==i||e[25]!==g?(j=t.jsx(Se,{open:i,onOpenChange:a,children:g}),e[23]=a,e[24]=i,e[25]=g,e[26]=j):j=e[26],j}function qe({open:C,onComplete:e,selectedInstallation:i,onSelectInstallation:a,onImportComplete:y,mode:r="agent"}){const c=ee(),{org:o}=de(),s=me(),u=Ge(),[k,v]=D.useState(null),P=_e({slug:"mcp-github"}),f=Oe(P),d=$e({enabled:C&&f.length===0}),m=f.length===1?f[0]??null:k,l=ne({connectionId:m?.id??"",orgId:o.id,orgSlug:o.slug}),p=ne({connectionId:pe,orgId:o.id,orgSlug:o.slug}),g=async(n,b)=>{try{const I=await l.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:b}});if(I.isError)return null;const R=I.content?.find(w=>w.type==="resource")?.resource?.text;if(!R)return null;try{const w=JSON.parse(R);return typeof w=="string"?w:JSON.stringify(w)}catch{return R}}catch{return null}},j=(n,b)=>{Promise.all([g(b,"AGENTS.md"),g(b,"CLAUDE.md")]).then(async([N,I])=>{const T=N??I??null;T&&(await p.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:T}}}}),le(s,o.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},x=ge({mutationFn:async n=>{if(!m||!i)throw new Error("No GitHub connection or installation");const b=i.installationId;if(r==="connection"){const{childConnectionId:R}=await fe({orgSlug:o.slug,sourceConnection:m,installationId:b,owner:n.owner,repo:n.name,githubCallTool:w=>l.callTool(w),selfCallTool:w=>p.callTool(w),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:R,item:null}}const{childConnectionId:N,reused:I}=await fe({orgSlug:o.slug,sourceConnection:m,installationId:b,owner:n.owner,repo:n.name,githubCallTool:R=>l.callTool(R),selfCallTool:R=>p.callTool(R)});let T=null;try{const R=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:b,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),w=R.structuredContent??R,_=w.item?.id;if(!w.item||!_)throw new Error("Failed to create the imported agent");return T=_,{virtualMcpId:_,repo:n,connectionId:N,item:w.item}}catch(R){throw T&&await p.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:T}}).catch(()=>{}),I||await p.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:n,repo:b,connectionId:N,item:I})=>{if(r==="connection"||!n||!I){if(le(s,o.id),Ne(s,o.id),y){y({virtualMcpId:null,repo:b,connectionId:N});return}te.success(c("common.githubRepoPicker.addedRepo",{name:b.name})),e();return}if(s.setQueryData(se.collectionItem(p,o.id,"","VIRTUAL_MCP",n),{item:I}),le(s,o.id),j(n,b),y){y({virtualMcpId:n,repo:b,connectionId:N});return}te.success(c("common.githubRepoPicker.importedRepo",{name:b.name})),e(),u(n)},onError:(n,b)=>{console.error("GitHub import failed:",n);const N=n instanceof Error?n.message:c("common.githubRepoPicker.unknownError");if(b.fork&&N.toLowerCase().includes("mint")){te.error(c("common.githubRepoPicker.failedImportFork",{name:b.name}));return}te.error(c("common.githubRepoPicker.failedImport",{error:N}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ce,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ce,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ce,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:c("common.githubRepoPicker.selectConnection")})}),f.map(n=>t.jsxs("button",{type:"button",onClick:()=>v(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(M,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):m?i?t.jsx(Ve,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,installation:i,onSelectRepo:n=>x.mutate(n),isSaving:x.isPending}):t.jsx(Be,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,onSelect:a,showBackButton:f.length>1,onBack:()=>v(null)}):null}function Be(C){const e=Z.c(124),{connectionId:i,orgId:a,orgSlug:y,onSelect:r,showBackButton:c,onBack:o}=C,s=ee();let u;e[0]!==a||e[1]!==y?(u={connectionId:pe,orgId:a,orgSlug:y},e[0]=a,e[1]=y,e[2]=u):u=e[2];const k=ne(u),v=me(),P=he();let f;e[3]!==i||e[4]!==a?(f=se.githubUserOrgs(a,i),e[3]=i,e[4]=a,e[5]=f):f=e[5];let d;e[6]!==i||e[7]!==k?(d=()=>Ue(h=>k.callTool(h),i),e[6]=i,e[7]=k,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const l=ke(m);let p;e[12]!==P||e[13]!==i||e[14]!==l||e[15]!==a||e[16]!==y||e[17]!==v?(p=async()=>{const h=await be({connectionId:i,orgId:a,orgSlug:y,persistFallback:E=>P.update.mutateAsync({id:i,data:{connection_token:E}}).then(Qe)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const S=new URL(`/api/${y}/mcp/${i}`,window.location.origin);await v.invalidateQueries({queryKey:se.isMCPAuthenticated(S.href,null)}),await v.invalidateQueries({queryKey:se.mcpClientPrefix()}),await l.refetch()},e[12]=P,e[13]=i,e[14]=l,e[15]=a,e[16]=y,e[17]=v,e[18]=p):p=e[18];let g;e[19]!==s?(g=h=>{te.error(s("common.githubRepoPicker.failedReconnect",{error:h instanceof Error?h.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=g):g=e[20];let j;e[21]!==p||e[22]!==g?(j={mutationFn:p,onError:g},e[21]=p,e[22]=g,e[23]=j):j=e[23];const x=ge(j);if(l.isLoading){let h;return e[24]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(X,{className:"size-4.5 text-muted-foreground"})}),e[24]=h):h=e[24],h}if(l.isError){let h;e[25]!==s?(h=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=h):h=e[26];let S;e[27]!==h?(S=t.jsx("p",{className:"text-sm text-destructive",children:h}),e[27]=h,e[28]=S):S=e[28];let E;e[29]!==s?(E=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=E):E=e[30];let A;e[31]!==E?(A=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:E}),e[31]=E,e[32]=A):A=e[32];let z;e[33]!==x?(z=()=>x.mutate(),e[33]=x,e[34]=z):z=e[34];const H=x.isPending;let L;e[35]!==x.isPending?(L=x.isPending?t.jsx(X,{className:"size-3.5"}):t.jsx(M,{className:"size-3.5"}),e[35]=x.isPending,e[36]=L):L=e[36];let G;e[37]!==s?(G=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=G):G=e[38];let F;e[39]!==x.isPending||e[40]!==z||e[41]!==L||e[42]!==G?(F=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:H,children:[L,G]}),e[39]=x.isPending,e[40]=z,e[41]=L,e[42]=G,e[43]=F):F=e[43];let U;return e[44]!==A||e[45]!==F||e[46]!==S?(U=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[S,A,F]}),e[44]=A,e[45]=F,e[46]=S,e[47]=U):U=e[47],U}const n=l.data;if(!n)return null;if(n.installations.length===0){let h;e[48]!==o||e[49]!==c||e[50]!==s?(h=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=o,e[49]=c,e[50]=s,e[51]=h):h=e[51];let S;e[52]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-8 text-foreground"})}),e[52]=S):S=e[52];let E;e[53]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=E):E=e[53];let A;e[54]!==s?(A=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=A):A=e[55];let z;e[56]!==A?(z=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[E,A]}),e[56]=A,e[57]=z):z=e[57];let H;e[58]!==s?(H=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=H):H=e[59];let L;e[60]!==H?(L=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:H}),e[60]=H,e[61]=L):L=e[61];let G;e[62]!==s?(G=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=G):G=e[63];let F;e[64]!==G?(F=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:G}),e[64]=G,e[65]=F):F=e[65];let U;e[66]!==s?(U=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=U):U=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Ae,{size:14}),e[68]=ie):ie=e[68];let $;e[69]!==U?($=t.jsx(re,{asChild:!0,size:"sm",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",children:[U,ie]})}),e[69]=U,e[70]=$):$=e[70];let q;e[71]!==l?(q=()=>{l.refetch()},e[71]=l,e[72]=q):q=e[72];const je=l.isFetching;let B;e[73]!==l.isFetching?(B=l.isFetching&&t.jsx(X,{className:"size-3.5"}),e[73]=l.isFetching,e[74]=B):B=e[74];let Q;e[75]!==s?(Q=s("common.githubRepoPicker.checkAgain"),e[75]=s,e[76]=Q):Q=e[76];let V;e[77]!==l.isFetching||e[78]!==q||e[79]!==B||e[80]!==Q?(V=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:q,disabled:je,children:[B,Q]}),e[77]=l.isFetching,e[78]=q,e[79]=B,e[80]=Q,e[81]=V):V=e[81];let K;e[82]!==$||e[83]!==V?(K=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[$,V]}),e[82]=$,e[83]=V,e[84]=K):K=e[84];let W;e[85]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[85]=s,e[86]=W):W=e[86];let J;e[87]!==W?(J=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[87]=W,e[88]=J):J=e[88];let Y;e[89]!==z||e[90]!==L||e[91]!==F||e[92]!==K||e[93]!==J?(Y=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[S,z,L,F,K,J]}),e[89]=z,e[90]=L,e[91]=F,e[92]=K,e[93]=J,e[94]=Y):Y=e[94];let oe;return e[95]!==Y||e[96]!==h?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h,Y]}),e[95]=Y,e[96]=h,e[97]=oe):oe=e[97],oe}let b;e[98]!==o||e[99]!==c||e[100]!==s?(b=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[98]=o,e[99]=c,e[100]=s,e[101]=b):b=e[101];let N;if(e[102]!==n.installations||e[103]!==r||e[104]!==s){let h;e[106]!==r||e[107]!==s?(h=S=>t.jsxs("button",{type:"button",onClick:()=>r(S),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:S.avatarUrl,alt:S.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:S.login}),S.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},S.installationId),e[106]=r,e[107]=s,e[108]=h):h=e[108],N=n.installations.map(h),e[102]=n.installations,e[103]=r,e[104]=s,e[105]=N}else N=e[105];let I;e[109]!==N?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:N}),e[109]=N,e[110]=I):I=e[110];let T;e[111]!==s?(T=s("common.githubRepoPicker.accountNotListed"),e[111]=s,e[112]=T):T=e[112];let R;e[113]!==s?(R=s("common.githubRepoPicker.installGitHubApp"),e[113]=s,e[114]=R):R=e[114];let w;e[115]!==R?(w=t.jsx("span",{className:"underline underline-offset-2",children:R}),e[115]=R,e[116]=w):w=e[116];let _;e[117]!==T||e[118]!==w?(_=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[T," ",w]})}),e[117]=T,e[118]=w,e[119]=_):_=e[119];let O;return e[120]!==I||e[121]!==_||e[122]!==b?(O=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,I,_]}),e[120]=I,e[121]=_,e[122]=b,e[123]=O):O=e[123],O}function Qe(){}function Ve(C){const e=Z.c(23),{connectionId:i,orgId:a,orgSlug:y,installation:r,onSelectRepo:c,isSaving:o}=C,s=ee(),[u,k]=D.useState(""),v=Te(u,300),P=D.useDeferredValue(v),f=u!==P;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(Ie,{placeholder:d,value:u,onChange:k,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const l=f?"opacity-40":"opacity-100";let p;e[6]!==l?(p=ae("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",l),e[6]=l,e[7]=p):p=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(X,{className:"size-4.5 text-muted-foreground"})}),e[8]=g):g=e[8];let j;e[9]!==i||e[10]!==P||e[11]!==r||e[12]!==o||e[13]!==c||e[14]!==a||e[15]!==y?(j=t.jsx(D.Suspense,{fallback:g,children:t.jsx(Ke,{connectionId:i,orgId:a,orgSlug:y,installation:r,query:P,onSelectRepo:c,isSaving:o})}),e[9]=i,e[10]=P,e[11]=r,e[12]=o,e[13]=c,e[14]=a,e[15]=y,e[16]=j):j=e[16];let x;e[17]!==p||e[18]!==j?(x=t.jsx("div",{className:p,children:j}),e[17]=p,e[18]=j,e[19]=x):x=e[19];let n;return e[20]!==m||e[21]!==x?(n=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,x]}),e[20]=m,e[21]=x,e[22]=n):n=e[22],n}function Ke(C){const e=Z.c(36),{connectionId:i,orgId:a,orgSlug:y,installation:r,query:c,onSelectRepo:o,isSaving:s}=C,u=ee();let k;e[0]!==i||e[1]!==a||e[2]!==y?(k={connectionId:i,orgId:a,orgSlug:y},e[0]=i,e[1]=a,e[2]=y,e[3]=k):k=e[3];const v=ne(k),P=r.type==="User"?"user":"org",f=c?`${P}:${r.login} ${c} in:name fork:true`:`${P}:${r.login} fork:true`;let d;e[4]!==i||e[5]!==r.login||e[6]!==a||e[7]!==c?(d=se.githubOrgRepos(a,i,r.login,c),e[4]=i,e[5]=r.login,e[6]=a,e[7]=c,e[8]=d):d=e[8];let m;e[9]!==v||e[10]!==f?(m=async x=>{const{signal:n}=x,N=(await v.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(We)},e[9]=v,e[10]=f,e[11]=m):m=e[11];let l;e[12]!==d||e[13]!==m?(l={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=l):l=e[14];const{data:p}=ve(l);if(p.length===0){let x;e[15]!==u?(x=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=x):x=e[16];let n;e[17]!==x?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:x}),e[17]=x,e[18]=n):n=e[18];let b;e[19]!==c||e[20]!==u?(b=c&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=c,e[20]=u,e[21]=b):b=e[21];let N;return e[22]!==n||e[23]!==b?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[n,b]}),e[22]=n,e[23]=b,e[24]=N):N=e[24],N}let g;if(e[25]!==s||e[26]!==o||e[27]!==p||e[28]!==u){let x;e[30]!==s||e[31]!==o||e[32]!==u?(x=n=>t.jsxs("button",{type:"button",onClick:()=>o(n),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(M,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate",children:n.name}),n.fork&&t.jsx("span",{className:"text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:u("common.githubRepoPicker.forkBadge")})]}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[n.private?t.jsx(Ce,{size:10}):t.jsx(ze,{size:10}),n.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},n.fullName),e[30]=s,e[31]=o,e[32]=u,e[33]=x):x=e[33],g=p.map(x),e[25]=s,e[26]=o,e[27]=p,e[28]=u,e[29]=g}else g=e[29];let j;return e[34]!==g?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[34]=g,e[35]=j):j=e[35],j}function We(C){return{name:C.name,fullName:C.full_name,owner:C.full_name.split("/")[0]??"",url:C.html_url,private:C.private,description:C.description,updatedAt:C.updated_at,fork:C.fork??!1}}function ce(C){const e=Z.c(51),{status:i,error:a,retry:y}=C,r=ee();if(i==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let I;e[1]!==r?(I=r("common.githubRepoPicker.connectionFailed"),e[1]=r,e[2]=I):I=e[2];let T;e[3]!==I?(T=t.jsx("p",{className:"text-sm font-medium",children:I}),e[3]=I,e[4]=T):T=e[4];let R;e[5]!==a||e[6]!==r?(R=a??r("common.githubRepoPicker.somethingWentWrong"),e[5]=a,e[6]=r,e[7]=R):R=e[7];let w;e[8]!==R?(w=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R}),e[8]=R,e[9]=w):w=e[9];let _;e[10]!==T||e[11]!==w?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[T,w]}),e[10]=T,e[11]=w,e[12]=_):_=e[12];let O;e[13]!==r?(O=r("common.githubRepoPicker.tryAgain"),e[13]=r,e[14]=O):O=e[14];let h;e[15]!==y||e[16]!==O?(h=t.jsx("button",{type:"button",onClick:y,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:O}),e[15]=y,e[16]=O,e[17]=h):h=e[17];let S;return e[18]!==_||e[19]!==h?(S=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,h]}),e[18]=_,e[19]=h,e[20]=S):S=e[20],S}const c=i==="authenticating";let o;e[21]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-foreground"})}),e[21]=o):o=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(X,{className:"size-3 text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==c||e[24]!==r?(u=r(c?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=c,e[24]=r,e[25]=u):u=e[25];let k;e[26]!==u?(k=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=k):k=e[27];let v;e[28]!==c||e[29]!==r?(v=r(c?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=c,e[29]=r,e[30]=v):v=e[30];let P;e[31]!==v?(P=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[31]=v,e[32]=P):P=e[32];let f;e[33]!==k||e[34]!==P?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,P]}),e[33]=k,e[34]=P,e[35]=f):f=e[35];const d=c?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ae("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let l;e[38]!==m?(l=t.jsx("span",{className:m}),e[38]=m,e[39]=l):l=e[39];const p=c?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[40]!==p?(g=ae("size-1.5 rounded-full",p),e[40]=p,e[41]=g):g=e[41];let j;e[42]!==g?(j=t.jsx("span",{className:g}),e[42]=g,e[43]=j):j=e[43];let x;e[44]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=x):x=e[44];let n;e[45]!==l||e[46]!==j?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[l,j,x]}),e[45]=l,e[46]=j,e[47]=n):n=e[47];let b;return e[48]!==n||e[49]!==f?(b=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,n]}),e[48]=n,e[49]=f,e[50]=b):b=e[50],b}export{dt as G,$e as a,De as u};
|
|
1
|
+
import{c as Z,G as de,a as ye,n as me,r as D,aR as le,b as ee,j as t,h as X,e as ge,t as te,ff as Ne,K as se,m as ke,l as ae,B as re,x as ve,z as Ce}from"./index-BhEzjLbQ.js";import{c as Re,d as we,b as Pe,D as Se}from"./dialog-CqOkeCZk.js";import{C as Ie}from"./collection-search-B2Eb7Zex.js";import{u as Te}from"./use-debounced-value-DM5HocnO.js";import{b as he,u as _e}from"./use-connection-C4DWan0X.js";import{u as ne}from"./use-mcp-client-DEFbrf4v.js";import{W as Ee,S as pe}from"./constants-BRGHAWVM.js";import{a as be}from"./authenticate-and-persist-oauth-BpDGmcTR.js";import{i as ue}from"./ArrowLeft-yolsmMsx.js";import{n as Ae}from"./LinkExternal01-CmZOoei5.js";import{n as ze}from"./Share07-D36dGZLq.js";import{t as Le,u as Ge}from"./use-navigate-to-agent-CRiX1dCi.js";import{e as Fe}from"./extract-connection-data-B8jBQN8M.js";import{G as M}from"./github-icon-DI6tkMhh.js";import{b as Oe,p as fe,f as Ue,G as xe}from"./provision-repo-scoped-github-connection-WQFARyHG.js";function De(C,e){const i=Z.c(12),{org:a}=de();let y;i[0]!==a.id?(y=Ee.REGISTRY(a.id),i[0]=a.id,i[1]=y):y=i[1];const r=y;let c;i[2]!==a.id||i[3]!==a.slug||i[4]!==r?(c={connectionId:r,orgId:a.id,orgSlug:a.slug},i[2]=a.id,i[3]=a.slug,i[4]=r,i[5]=c):c=i[5];const o=ne(c);let s;i[6]!==C?(s={name:C},i[6]=C,i[7]=s):s=i[7];const u=e?.enabled??!0;let k;return i[8]!==o||i[9]!==s||i[10]!==u?(k={client:o,toolName:"COLLECTION_REGISTRY_APP_GET",toolArguments:s,enabled:u,staleTime:3e5,select:He},i[8]=o,i[9]=s,i[10]=u,i[11]=k):k=i[11],Le(k)}function He(C){return C.structuredContent?.item??null}const Me="deco/mcp-github";function $e(C){const{org:e}=de(),{data:i}=ye.useSession(),a=he(),y=me(),[r,c]=D.useState("idle"),[o,s]=D.useState(null),[u,k]=D.useState(null),{data:v,isLoading:P}=De(Me,{enabled:C.enabled}),f=D.useRef(!1);C.enabled&&v&&!P&&!f.current&&i?.user?.id&&r==="idle"&&(f.current=!0,d());async function d(){if(!(!v||!i?.user?.id||!e))try{c("installing"),s(null);const l=Fe(v,e.id,i.user.id,{remoteIndex:0});if(!l.connection_url)throw new Error("Registry item is missing a remote URL for mcp-github");const{id:g}=await a.create.mutateAsync(l);c("authenticating");const j=await be({connectionId:g,orgId:e.id,orgSlug:e.slug,persistFallback:x=>a.update.mutateAsync({id:g,data:{connection_token:x}}).then(()=>{})});if(j.ran&&!j.ok){try{await a.delete.mutateAsync(g)}catch{}throw new Error(j.error&&j.error!=="no token received"?j.error:"No token received from GitHub")}le(y,e.id),k(l),c("ready")}catch(l){s(l instanceof Error?l.message:String(l)),c("error")}}function m(){c("idle"),s(null),k(null),f.current=!1}return C.enabled&&P&&r==="idle"?{status:"installing",error:null,connection:null,retry:m}:{status:r,error:o,connection:u,retry:m}}function dt(C){const e=Z.c(27),{open:i,onOpenChange:a,title:y,onImportComplete:r,mode:c}=C,o=c===void 0?"agent":c,s=ee();let u;e[0]!==o||e[1]!==s||e[2]!==y?(u=y??s(o==="connection"?"common.githubRepoPicker.addRepo":"common.githubRepoPicker.importFromGitHub"),e[0]=o,e[1]=s,e[2]=y,e[3]=u):u=e[3];const k=u,[v,P]=D.useState(null);let f;e[4]!==k?(f=t.jsx(Re,{className:"sr-only",children:t.jsx(we,{children:k})}),e[4]=k,e[5]=f):f=e[5];let d;e[6]!==k||e[7]!==v||e[8]!==s?(d=t.jsx("div",{className:"flex items-center h-12 border-b border-border px-4 gap-3 shrink-0",children:v?t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>P(null),className:"flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":s("common.githubRepoPicker.backToAccounts"),children:t.jsx(ue,{size:16})}),t.jsx("img",{src:v.avatarUrl,alt:v.login,className:"size-5 rounded-full ring-1 ring-border shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:v.login})]}):t.jsxs(t.Fragment,{children:[t.jsx(M,{className:"size-4 text-foreground shrink-0"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:k})]})}),e[6]=k,e[7]=v,e[8]=s,e[9]=d):d=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(X,{className:"size-4.5 text-muted-foreground"})}),e[10]=m):m=e[10];let l;e[11]!==a?(l=()=>a(!1),e[11]=a,e[12]=l):l=e[12];let p;e[13]!==o||e[14]!==r||e[15]!==i||e[16]!==v||e[17]!==l?(p=t.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:t.jsx(D.Suspense,{fallback:m,children:t.jsx(qe,{open:i,onComplete:l,selectedInstallation:v,onSelectInstallation:P,onImportComplete:r,mode:o})})}),e[13]=o,e[14]=r,e[15]=i,e[16]=v,e[17]=l,e[18]=p):p=e[18];let g;e[19]!==f||e[20]!==d||e[21]!==p?(g=t.jsxs(Pe,{className:"sm:max-w-[560px] h-[85svh] sm:h-[520px] p-0 gap-0 overflow-hidden flex flex-col",children:[f,d,p]}),e[19]=f,e[20]=d,e[21]=p,e[22]=g):g=e[22];let j;return e[23]!==a||e[24]!==i||e[25]!==g?(j=t.jsx(Se,{open:i,onOpenChange:a,children:g}),e[23]=a,e[24]=i,e[25]=g,e[26]=j):j=e[26],j}function qe({open:C,onComplete:e,selectedInstallation:i,onSelectInstallation:a,onImportComplete:y,mode:r="agent"}){const c=ee(),{org:o}=de(),s=me(),u=Ge(),[k,v]=D.useState(null),P=_e({slug:"mcp-github"}),f=Oe(P),d=$e({enabled:C&&f.length===0}),m=f.length===1?f[0]??null:k,l=ne({connectionId:m?.id??"",orgId:o.id,orgSlug:o.slug}),p=ne({connectionId:pe,orgId:o.id,orgSlug:o.slug}),g=async(n,b)=>{try{const I=await l.callTool({name:"get_file_contents",arguments:{owner:n.owner,repo:n.name,path:b}});if(I.isError)return null;const R=I.content?.find(w=>w.type==="resource")?.resource?.text;if(!R)return null;try{const w=JSON.parse(R);return typeof w=="string"?w:JSON.stringify(w)}catch{return R}}catch{return null}},j=(n,b)=>{Promise.all([g(b,"AGENTS.md"),g(b,"CLAUDE.md")]).then(async([N,I])=>{const T=N??I??null;T&&(await p.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:n,data:{metadata:{instructions:T}}}}),le(s,o.id))}).catch(N=>{console.error("GitHub instructions fetch failed:",N)})},x=ge({mutationFn:async n=>{if(!m||!i)throw new Error("No GitHub connection or installation");const b=i.installationId;if(r==="connection"){const{childConnectionId:R}=await fe({orgSlug:o.slug,sourceConnection:m,installationId:b,owner:n.owner,repo:n.name,githubCallTool:w=>l.callTool(w),selfCallTool:w=>p.callTool(w),orgShared:!0});return{virtualMcpId:null,repo:n,connectionId:R,item:null}}const{childConnectionId:N,reused:I}=await fe({orgSlug:o.slug,sourceConnection:m,installationId:b,owner:n.owner,repo:n.name,githubCallTool:R=>l.callTool(R),selfCallTool:R=>p.callTool(R)});let T=null;try{const R=await p.callTool({name:"COLLECTION_VIRTUAL_MCP_CREATE",arguments:{data:{title:n.name,description:n.description||"Imported from GitHub",pinned:!1,icon:null,metadata:{githubRepo:{owner:n.owner,name:n.name,url:n.url,installationId:b,connectionId:N},instructions:null,ui:{pinnedViews:null,layout:{defaultMainView:{type:"site-editor"},chatDefaultOpen:!0}}},connections:[{connection_id:N}]}}}),w=R.structuredContent??R,_=w.item?.id;if(!w.item||!_)throw new Error("Failed to create the imported agent");return T=_,{virtualMcpId:_,repo:n,connectionId:N,item:w.item}}catch(R){throw T&&await p.callTool({name:"COLLECTION_VIRTUAL_MCP_DELETE",arguments:{id:T}}).catch(()=>{}),I||await p.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:N,force:!0}}).catch(()=>{}),R}},onSuccess:({virtualMcpId:n,repo:b,connectionId:N,item:I})=>{if(r==="connection"||!n||!I){if(le(s,o.id),Ne(s,o.id),y){y({virtualMcpId:null,repo:b,connectionId:N});return}te.success(c("common.githubRepoPicker.addedRepo",{name:b.name})),e();return}if(s.setQueryData(se.collectionItem(p,o.id,"","VIRTUAL_MCP",n),{item:I}),le(s,o.id),j(n,b),y){y({virtualMcpId:n,repo:b,connectionId:N});return}te.success(c("common.githubRepoPicker.importedRepo",{name:b.name})),e(),u(n)},onError:(n,b)=>{console.error("GitHub import failed:",n);const N=n instanceof Error?n.message:c("common.githubRepoPicker.unknownError");if(b.fork&&N.toLowerCase().includes("mint")){te.error(c("common.githubRepoPicker.failedImportFork",{name:b.name}));return}te.error(c("common.githubRepoPicker.failedImport",{error:N}))}});return d.status==="installing"||d.status==="authenticating"?t.jsx(ce,{status:d.status,error:null,retry:d.retry}):d.status==="error"?t.jsx(ce,{status:"error",error:d.error,retry:d.retry}):f.length===0&&d.status==="idle"?t.jsx(ce,{status:"installing",error:null,retry:d.retry}):f.length>1&&!m?t.jsxs("div",{className:"flex flex-col py-2",children:[t.jsx("div",{className:"px-4 py-2",children:t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:c("common.githubRepoPicker.selectConnection")})}),f.map(n=>t.jsxs("button",{type:"button",onClick:()=>v(n),className:"flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left",children:[n.icon?t.jsx("img",{src:n.icon,alt:n.title,className:"size-7 rounded-full shrink-0"}):t.jsx("div",{className:"size-7 rounded-full bg-muted flex items-center justify-center shrink-0",children:t.jsx(M,{className:"size-3.5 text-muted-foreground"})}),t.jsx("span",{className:"text-sm font-medium",children:n.title})]},n.id))]}):m?i?t.jsx(Ve,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,installation:i,onSelectRepo:n=>x.mutate(n),isSaving:x.isPending}):t.jsx(Be,{connectionId:m.id,orgId:o.id,orgSlug:o.slug,onSelect:a,showBackButton:f.length>1,onBack:()=>v(null)}):null}function Be(C){const e=Z.c(124),{connectionId:i,orgId:a,orgSlug:y,onSelect:r,showBackButton:c,onBack:o}=C,s=ee();let u;e[0]!==a||e[1]!==y?(u={connectionId:pe,orgId:a,orgSlug:y},e[0]=a,e[1]=y,e[2]=u):u=e[2];const k=ne(u),v=me(),P=he();let f;e[3]!==i||e[4]!==a?(f=se.githubUserOrgs(a,i),e[3]=i,e[4]=a,e[5]=f):f=e[5];let d;e[6]!==i||e[7]!==k?(d=()=>Ue(h=>k.callTool(h),i),e[6]=i,e[7]=k,e[8]=d):d=e[8];let m;e[9]!==f||e[10]!==d?(m={queryKey:f,queryFn:d},e[9]=f,e[10]=d,e[11]=m):m=e[11];const l=ke(m);let p;e[12]!==P||e[13]!==i||e[14]!==l||e[15]!==a||e[16]!==y||e[17]!==v?(p=async()=>{const h=await be({connectionId:i,orgId:a,orgSlug:y,persistFallback:E=>P.update.mutateAsync({id:i,data:{connection_token:E}}).then(Qe)});if(h.ran&&!h.ok)throw new Error(h.error??"no token received");const S=new URL(`/api/${y}/mcp/${i}`,window.location.origin);await v.invalidateQueries({queryKey:se.isMCPAuthenticated(S.href,null)}),await v.invalidateQueries({queryKey:se.mcpClientPrefix()}),await l.refetch()},e[12]=P,e[13]=i,e[14]=l,e[15]=a,e[16]=y,e[17]=v,e[18]=p):p=e[18];let g;e[19]!==s?(g=h=>{te.error(s("common.githubRepoPicker.failedReconnect",{error:h instanceof Error?h.message:s("common.githubRepoPicker.unknownError")}))},e[19]=s,e[20]=g):g=e[20];let j;e[21]!==p||e[22]!==g?(j={mutationFn:p,onError:g},e[21]=p,e[22]=g,e[23]=j):j=e[23];const x=ge(j);if(l.isLoading){let h;return e[24]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(X,{className:"size-4.5 text-muted-foreground"})}),e[24]=h):h=e[24],h}if(l.isError){let h;e[25]!==s?(h=s("common.githubRepoPicker.failedLoadAccounts"),e[25]=s,e[26]=h):h=e[26];let S;e[27]!==h?(S=t.jsx("p",{className:"text-sm text-destructive",children:h}),e[27]=h,e[28]=S):S=e[28];let E;e[29]!==s?(E=s("common.githubRepoPicker.connectionExpiredMessage"),e[29]=s,e[30]=E):E=e[30];let A;e[31]!==E?(A=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[280px] leading-relaxed",children:E}),e[31]=E,e[32]=A):A=e[32];let z;e[33]!==x?(z=()=>x.mutate(),e[33]=x,e[34]=z):z=e[34];const H=x.isPending;let L;e[35]!==x.isPending?(L=x.isPending?t.jsx(X,{className:"size-3.5"}):t.jsx(M,{className:"size-3.5"}),e[35]=x.isPending,e[36]=L):L=e[36];let G;e[37]!==s?(G=s("common.githubRepoPicker.reconnectGitHub"),e[37]=s,e[38]=G):G=e[38];let F;e[39]!==x.isPending||e[40]!==z||e[41]!==L||e[42]!==G?(F=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:z,disabled:H,children:[L,G]}),e[39]=x.isPending,e[40]=z,e[41]=L,e[42]=G,e[43]=F):F=e[43];let U;return e[44]!==A||e[45]!==F||e[46]!==S?(U=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-6 text-center",children:[S,A,F]}),e[44]=A,e[45]=F,e[46]=S,e[47]=U):U=e[47],U}const n=l.data;if(!n)return null;if(n.installations.length===0){let h;e[48]!==o||e[49]!==c||e[50]!==s?(h=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[48]=o,e[49]=c,e[50]=s,e[51]=h):h=e[51];let S;e[52]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx("div",{className:"size-16 rounded-2xl bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-8 text-foreground"})}),e[52]=S):S=e[52];let E;e[53]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx("span",{className:"size-1.5 rounded-full bg-success"}),e[53]=E):E=e[53];let A;e[54]!==s?(A=s("common.githubRepoPicker.githubConnected"),e[54]=s,e[55]=A):A=e[55];let z;e[56]!==A?(z=t.jsxs("div",{className:"mt-4 flex items-center gap-1.5 text-xs font-medium text-success",children:[E,A]}),e[56]=A,e[57]=z):z=e[57];let H;e[58]!==s?(H=s("common.githubRepoPicker.setupRepositoriesTitle"),e[58]=s,e[59]=H):H=e[59];let L;e[60]!==H?(L=t.jsx("h2",{className:"mt-2 text-base font-semibold text-foreground",children:H}),e[60]=H,e[61]=L):L=e[61];let G;e[62]!==s?(G=s("common.githubRepoPicker.noRepositoriesShared"),e[62]=s,e[63]=G):G=e[63];let F;e[64]!==G?(F=t.jsx("p",{className:"mt-1.5 max-w-[360px] text-xs leading-relaxed text-muted-foreground",children:G}),e[64]=G,e[65]=F):F=e[65];let U;e[66]!==s?(U=s("common.githubRepoPicker.chooseRepositories"),e[66]=s,e[67]=U):U=e[67];let ie;e[68]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx(Ae,{size:14}),e[68]=ie):ie=e[68];let $;e[69]!==U?($=t.jsx(re,{asChild:!0,size:"sm",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",children:[U,ie]})}),e[69]=U,e[70]=$):$=e[70];let q;e[71]!==l?(q=()=>{l.refetch()},e[71]=l,e[72]=q):q=e[72];const je=l.isFetching;let B;e[73]!==l.isFetching?(B=l.isFetching&&t.jsx(X,{className:"size-3.5"}),e[73]=l.isFetching,e[74]=B):B=e[74];let Q;e[75]!==s?(Q=s("common.githubRepoPicker.checkAgain"),e[75]=s,e[76]=Q):Q=e[76];let V;e[77]!==l.isFetching||e[78]!==q||e[79]!==B||e[80]!==Q?(V=t.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:q,disabled:je,children:[B,Q]}),e[77]=l.isFetching,e[78]=q,e[79]=B,e[80]=Q,e[81]=V):V=e[81];let K;e[82]!==$||e[83]!==V?(K=t.jsxs("div",{className:"mt-5 flex items-center gap-2",children:[$,V]}),e[82]=$,e[83]=V,e[84]=K):K=e[84];let W;e[85]!==s?(W=s("common.githubRepoPicker.repositoryAccessNote"),e[85]=s,e[86]=W):W=e[86];let J;e[87]!==W?(J=t.jsx("p",{className:"mt-4 max-w-[360px] rounded-lg bg-muted/50 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:W}),e[87]=W,e[88]=J):J=e[88];let Y;e[89]!==z||e[90]!==L||e[91]!==F||e[92]!==K||e[93]!==J?(Y=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center px-8 py-6 text-center",children:[S,z,L,F,K,J]}),e[89]=z,e[90]=L,e[91]=F,e[92]=K,e[93]=J,e[94]=Y):Y=e[94];let oe;return e[95]!==Y||e[96]!==h?(oe=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h,Y]}),e[95]=Y,e[96]=h,e[97]=oe):oe=e[97],oe}let b;e[98]!==o||e[99]!==c||e[100]!==s?(b=c&&t.jsx("div",{className:"flex items-center gap-1 px-4 pt-3 pb-1 shrink-0",children:t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[t.jsx(ue,{size:12}),s("common.githubRepoPicker.changeConnection")]})}),e[98]=o,e[99]=c,e[100]=s,e[101]=b):b=e[101];let N;if(e[102]!==n.installations||e[103]!==r||e[104]!==s){let h;e[106]!==r||e[107]!==s?(h=S=>t.jsxs("button",{type:"button",onClick:()=>r(S),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-accent transition-colors text-left group",children:[t.jsx("img",{src:S.avatarUrl,alt:S.login,className:"size-7 rounded-full shrink-0 ring-1 ring-border"}),t.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium leading-none",children:S.login}),S.type==="User"&&t.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:s("common.githubRepoPicker.personalAccount")})]}),t.jsxs("span",{className:"text-xs text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0",children:[s("common.githubRepoPicker.select")," →"]})]},S.installationId),e[106]=r,e[107]=s,e[108]=h):h=e[108],N=n.installations.map(h),e[102]=n.installations,e[103]=r,e[104]=s,e[105]=N}else N=e[105];let I;e[109]!==N?(I=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden [scrollbar-gutter:stable]",children:N}),e[109]=N,e[110]=I):I=e[110];let T;e[111]!==s?(T=s("common.githubRepoPicker.accountNotListed"),e[111]=s,e[112]=T):T=e[112];let R;e[113]!==s?(R=s("common.githubRepoPicker.installGitHubApp"),e[113]=s,e[114]=R):R=e[114];let w;e[115]!==R?(w=t.jsx("span",{className:"underline underline-offset-2",children:R}),e[115]=R,e[116]=w):w=e[116];let _;e[117]!==T||e[118]!==w?(_=t.jsx("div",{className:"px-4 py-3 border-t border-border shrink-0",children:t.jsxs("a",{href:xe,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:[T," ",w]})}),e[117]=T,e[118]=w,e[119]=_):_=e[119];let O;return e[120]!==I||e[121]!==_||e[122]!==b?(O=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[b,I,_]}),e[120]=I,e[121]=_,e[122]=b,e[123]=O):O=e[123],O}function Qe(){}function Ve(C){const e=Z.c(23),{connectionId:i,orgId:a,orgSlug:y,installation:r,onSelectRepo:c,isSaving:o}=C,s=ee(),[u,k]=D.useState(""),v=Te(u,300),P=D.useDeferredValue(v),f=u!==P;let d;e[0]!==s?(d=s("common.githubRepoPicker.searchRepositories"),e[0]=s,e[1]=d):d=e[1];let m;e[2]!==f||e[3]!==u||e[4]!==d?(m=t.jsx(Ie,{placeholder:d,value:u,onChange:k,isSearching:f}),e[2]=f,e[3]=u,e[4]=d,e[5]=m):m=e[5];const l=f?"opacity-40":"opacity-100";let p;e[6]!==l?(p=ae("flex-1 overflow-hidden flex flex-col transition-opacity duration-150",l),e[6]=l,e[7]=p):p=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx(X,{className:"size-4.5 text-muted-foreground"})}),e[8]=g):g=e[8];let j;e[9]!==i||e[10]!==P||e[11]!==r||e[12]!==o||e[13]!==c||e[14]!==a||e[15]!==y?(j=t.jsx(D.Suspense,{fallback:g,children:t.jsx(Ke,{connectionId:i,orgId:a,orgSlug:y,installation:r,query:P,onSelectRepo:c,isSaving:o})}),e[9]=i,e[10]=P,e[11]=r,e[12]=o,e[13]=c,e[14]=a,e[15]=y,e[16]=j):j=e[16];let x;e[17]!==p||e[18]!==j?(x=t.jsx("div",{className:p,children:j}),e[17]=p,e[18]=j,e[19]=x):x=e[19];let n;return e[20]!==m||e[21]!==x?(n=t.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[m,x]}),e[20]=m,e[21]=x,e[22]=n):n=e[22],n}function Ke(C){const e=Z.c(36),{connectionId:i,orgId:a,orgSlug:y,installation:r,query:c,onSelectRepo:o,isSaving:s}=C,u=ee();let k;e[0]!==i||e[1]!==a||e[2]!==y?(k={connectionId:i,orgId:a,orgSlug:y},e[0]=i,e[1]=a,e[2]=y,e[3]=k):k=e[3];const v=ne(k),P=r.type==="User"?"user":"org",f=c?`${P}:${r.login} ${c} in:name fork:true`:`${P}:${r.login} fork:true`;let d;e[4]!==i||e[5]!==r.login||e[6]!==a||e[7]!==c?(d=se.githubOrgRepos(a,i,r.login,c),e[4]=i,e[5]=r.login,e[6]=a,e[7]=c,e[8]=d):d=e[8];let m;e[9]!==v||e[10]!==f?(m=async x=>{const{signal:n}=x,N=(await v.callTool({name:"search_repositories",arguments:{query:f,page:1,perPage:30}},void 0,{signal:n})).content?.[0]?.text;if(!N)throw new Error("No response from search_repositories");return(JSON.parse(N).items??[]).map(We)},e[9]=v,e[10]=f,e[11]=m):m=e[11];let l;e[12]!==d||e[13]!==m?(l={queryKey:d,queryFn:m},e[12]=d,e[13]=m,e[14]=l):l=e[14];const{data:p}=ve(l);if(p.length===0){let x;e[15]!==u?(x=u("common.githubRepoPicker.noRepositoriesFound"),e[15]=u,e[16]=x):x=e[16];let n;e[17]!==x?(n=t.jsx("p",{className:"text-sm text-muted-foreground",children:x}),e[17]=x,e[18]=n):n=e[18];let b;e[19]!==c||e[20]!==u?(b=c&&t.jsx("p",{className:"text-xs text-muted-foreground/60",children:u("common.githubRepoPicker.tryDifferentSearchTerm")}),e[19]=c,e[20]=u,e[21]=b):b=e[21];let N;return e[22]!==n||e[23]!==b?(N=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-1",children:[n,b]}),e[22]=n,e[23]=b,e[24]=N):N=e[24],N}let g;if(e[25]!==s||e[26]!==o||e[27]!==p||e[28]!==u){let x;e[30]!==s||e[31]!==o||e[32]!==u?(x=n=>t.jsxs("button",{type:"button",onClick:()=>o(n),disabled:s,className:"flex items-start gap-3 px-4 py-3 hover:bg-accent transition-colors text-left disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx(M,{className:"size-4 text-muted-foreground mt-0.5 shrink-0"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[t.jsx("span",{className:"text-sm font-medium truncate",children:n.name}),n.fork&&t.jsx("span",{className:"text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:u("common.githubRepoPicker.forkBadge")})]}),t.jsxs("span",{className:"flex items-center gap-1 text-xs font-medium text-muted-foreground border border-border rounded px-1.5 py-0.5 shrink-0 leading-none",children:[n.private?t.jsx(Ce,{size:10}):t.jsx(ze,{size:10}),n.private?u("common.githubRepoPicker.private"):u("common.githubRepoPicker.public")]})]},n.fullName),e[30]=s,e[31]=o,e[32]=u,e[33]=x):x=e[33],g=p.map(x),e[25]=s,e[26]=o,e[27]=p,e[28]=u,e[29]=g}else g=e[29];let j;return e[34]!==g?(j=t.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col [scrollbar-gutter:stable]",children:g}),e[34]=g,e[35]=j):j=e[35],j}function We(C){return{name:C.name,fullName:C.full_name,owner:C.full_name.split("/")[0]??"",url:C.html_url,private:C.private,description:C.description,updatedAt:C.updated_at,fork:C.fork??!1}}function ce(C){const e=Z.c(51),{status:i,error:a,retry:y}=C,r=ee();if(i==="error"){let N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx("div",{className:"size-10 rounded-full bg-destructive/10 flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-destructive"})}),e[0]=N):N=e[0];let I;e[1]!==r?(I=r("common.githubRepoPicker.connectionFailed"),e[1]=r,e[2]=I):I=e[2];let T;e[3]!==I?(T=t.jsx("p",{className:"text-sm font-medium",children:I}),e[3]=I,e[4]=T):T=e[4];let R;e[5]!==a||e[6]!==r?(R=a??r("common.githubRepoPicker.somethingWentWrong"),e[5]=a,e[6]=r,e[7]=R):R=e[7];let w;e[8]!==R?(w=t.jsx("p",{className:"text-xs text-muted-foreground max-w-[260px] leading-relaxed",children:R}),e[8]=R,e[9]=w):w=e[9];let _;e[10]!==T||e[11]!==w?(_=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[T,w]}),e[10]=T,e[11]=w,e[12]=_):_=e[12];let O;e[13]!==r?(O=r("common.githubRepoPicker.tryAgain"),e[13]=r,e[14]=O):O=e[14];let h;e[15]!==y||e[16]!==O?(h=t.jsx("button",{type:"button",onClick:y,className:"text-xs font-medium text-foreground border border-border rounded-md px-3 py-1.5 hover:bg-accent transition-colors",children:O}),e[15]=y,e[16]=O,e[17]=h):h=e[17];let S;return e[18]!==_||e[19]!==h?(S=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[N,_,h]}),e[18]=_,e[19]=h,e[20]=S):S=e[20],S}const c=i==="authenticating";let o;e[21]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"size-10 rounded-full bg-muted flex items-center justify-center",children:t.jsx(M,{className:"size-5 text-foreground"})}),e[21]=o):o=e[21];let s;e[22]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"relative size-10",children:[o,t.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 size-4 rounded-full bg-background flex items-center justify-center",children:t.jsx(X,{className:"size-3 text-muted-foreground"})})]}),e[22]=s):s=e[22];let u;e[23]!==c||e[24]!==r?(u=r(c?"common.githubRepoPicker.authenticatingGitHub":"common.githubRepoPicker.settingUpGitHub"),e[23]=c,e[24]=r,e[25]=u):u=e[25];let k;e[26]!==u?(k=t.jsx("p",{className:"text-sm font-medium",children:u}),e[26]=u,e[27]=k):k=e[27];let v;e[28]!==c||e[29]!==r?(v=r(c?"common.githubRepoPicker.completeOAuthFlow":"common.githubRepoPicker.installingGitHubConnection"),e[28]=c,e[29]=r,e[30]=v):v=e[30];let P;e[31]!==v?(P=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[31]=v,e[32]=P):P=e[32];let f;e[33]!==k||e[34]!==P?(f=t.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[k,P]}),e[33]=k,e[34]=P,e[35]=f):f=e[35];const d=c?"bg-muted-foreground/30":"bg-foreground animate-pulse";let m;e[36]!==d?(m=ae("size-1.5 rounded-full",d),e[36]=d,e[37]=m):m=e[37];let l;e[38]!==m?(l=t.jsx("span",{className:m}),e[38]=m,e[39]=l):l=e[39];const p=c?"bg-foreground animate-pulse":"bg-muted-foreground/30";let g;e[40]!==p?(g=ae("size-1.5 rounded-full",p),e[40]=p,e[41]=g):g=e[41];let j;e[42]!==g?(j=t.jsx("span",{className:g}),e[42]=g,e[43]=j):j=e[43];let x;e[44]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}),e[44]=x):x=e[44];let n;e[45]!==l||e[46]!==j?(n=t.jsxs("div",{className:"flex items-center gap-1.5",children:[l,j,x]}),e[45]=l,e[46]=j,e[47]=n):n=e[47];let b;return e[48]!==n||e[49]!==f?(b=t.jsxs("div",{className:"flex flex-col items-center gap-4 px-6 py-10",children:[s,f,n]}),e[48]=n,e[49]=f,e[50]=b):b=e[50],b}export{dt as G,$e as a,De as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{eH as It,eI as Et,ce as R,ag as c,eJ as de,cj as Je,eK as Tt,cd as wt,am as Mt,ah as O,ak as W,af as oe,ae as S,aj as m,ao as U,an as At,eL as I,ai as Ot,t as ge,r as J,c as Ee,G as Ct,j as Rt}from"./index-
|
|
1
|
+
import{eH as It,eI as Et,ce as R,ag as c,eJ as de,cj as Je,eK as Tt,cd as wt,am as Mt,ah as O,ak as W,af as oe,ae as S,aj as m,ao as U,an as At,eL as I,ai as Ot,t as ge,r as J,c as Ee,G as Ct,j as Rt}from"./index-BhEzjLbQ.js";import{u as Nt}from"./use-mcp-client-DEFbrf4v.js";import{S as xt}from"./constants-BRGHAWVM.js";import{d as Pt}from"./delay-CnY5UFtP.js";import{e as Dt}from"./backoff-CrEUbyZT.js";import{d as Lt,D as kt}from"./decopilot-sse-pool-BNKpiBjT.js";var re;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function a(s){throw new Error}t.assertNever=a,t.arrayToEnum=s=>{const n={};for(const i of s)n[i]=i;return n},t.getValidEnumValues=s=>{const n=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of n)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const n=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&n.push(i);return n},t.find=(s,n)=>{for(const i of s)if(n(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,n=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(n)}t.joinValues=r,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(re||(re={}));var Ae;(function(t){t.mergeShapes=(e,a)=>({...e,...a})})(Ae||(Ae={}));re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ce extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=e}format(e){const a=e||function(n){return n.message},r={_errors:[]},s=n=>{for(const i of n.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(a(i));else{let o=r,p=0;for(;p<i.path.length;){const u=i.path[p];p===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(a(i))):o[u]=o[u]||{_errors:[]},o=o[u],p++}}};return s(this),r}static assert(e){if(!(e instanceof ce))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=a=>a.message){const a=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const n=s.path[0];a[n]=a[n]||[],a[n].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:a}}get formErrors(){return this.flatten()}}ce.create=t=>new ce(t);var Oe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Oe||(Oe={}));var h;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(h||(h={}));class L{constructor(e){this.value=e}value;subs=new Set;get=()=>this.value;set=e=>{Object.is(e,this.value)||(this.value=e,this.subs.forEach(a=>a()))};update=e=>{this.set(e(this.value))};subscribe=e=>(this.subs.add(e),()=>{this.subs.delete(e)})}var We="vercel.ai.error",jt=Symbol.for(We),Ce,Re,Z=class Ge extends(Re=Error,Ce=jt,Re){constructor({name:e,message:a,cause:r}){super(a),this[Ce]=!0,this.name=e,this.cause=r}static isInstance(e){return Ge.hasMarker(e,We)}static hasMarker(e,a){const r=Symbol.for(a);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function Ye(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var He="AI_InvalidArgumentError",qe=`vercel.ai.error.${He}`,Zt=Symbol.for(qe),Ne,xe,$t=class extends(xe=Z,Ne=Zt,xe){constructor({message:t,cause:e,argument:a}){super({name:He,message:t,cause:e}),this[Ne]=!0,this.argument=a}static isInstance(t){return Z.hasMarker(t,qe)}},Xe="AI_JSONParseError",Qe=`vercel.ai.error.${Xe}`,Ut=Symbol.for(Qe),Pe,De,Le=class extends(De=Z,Pe=Ut,De){constructor({text:t,cause:e}){super({name:Xe,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${Ye(e)}`,cause:e}),this[Pe]=!0,this.text=t}static isInstance(t){return Z.hasMarker(t,Qe)}},Ke="AI_TypeValidationError",et=`vercel.ai.error.${Ke}`,Ft=Symbol.for(et),ke,je,q=class ve extends(je=Z,ke=Ft,je){constructor({value:e,cause:a,context:r}){let s="Type validation failed";if(r?.field&&(s+=` for ${r.field}`),r?.entityName||r?.entityId){s+=" (";const n=[];r.entityName&&n.push(r.entityName),r.entityId&&n.push(`id: "${r.entityId}"`),s+=n.join(", "),s+=")"}super({name:Ke,message:`${s}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${Ye(a)}`,cause:a}),this[ke]=!0,this.value=e,this.context=r}static isInstance(e){return Z.hasMarker(e,et)}static wrap({value:e,cause:a,context:r}){var s,n,i;return ve.isInstance(a)&&a.value===e&&((s=a.context)==null?void 0:s.field)===r?.field&&((n=a.context)==null?void 0:n.entityName)===r?.entityName&&((i=a.context)==null?void 0:i.entityId)===r?.entityId?a:new ve({value:e,cause:a,context:r})}},ie=({prefix:t,size:e=16,alphabet:a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const n=a.length,i=new Array(e);for(let o=0;o<e;o++)i[o]=a[Math.random()*n|0];return i.join("")};if(t==null)return s;if(a.includes(r))throw new $t({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${a}".`});return()=>`${t}${r}${s()}`};ie();var Bt=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Vt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Ze(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Bt.test(t)===!1&&Vt.test(t)===!1?e:zt(e)}function zt(t){let e=[t];for(;e.length;){const a=e;e=[];for(const r of a){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const n=r[s];n&&typeof n=="object"&&e.push(n)}}}return t}function Jt(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ze(t)}try{return Ze(t)}finally{Error.stackTraceLimit=e}}function Te(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:a}=t;if(a!=null)for(const r of Object.keys(a))a[r]=V(a[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(V):V(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(V)),t.allOf!=null&&(t.allOf=t.allOf.map(V)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(V));const{definitions:e}=t;if(e!=null)for(const a of Object.keys(e))e[a]=V(e[a]);return t}function V(t){return typeof t=="boolean"?t:Te(t)}var Wt=Symbol("Let zodToJsonSchema decide on which parser to use"),$e={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Gt=t=>typeof t=="string"?{...$e,name:t}:{...$e,...t};function N(){return{}}function Yt(t,e){var a,r,s;const n={type:"array"};return(a=t.type)!=null&&a._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==h.ZodAny&&(n.items=b(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(n.minItems=t.minLength.value),t.maxLength&&(n.maxItems=t.maxLength.value),t.exactLength&&(n.minItems=t.exactLength.value,n.maxItems=t.exactLength.value),n}function Ht(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const a of t.checks)switch(a.kind){case"min":a.inclusive?e.minimum=a.value:e.exclusiveMinimum=a.value;break;case"max":a.inclusive?e.maximum=a.value:e.exclusiveMaximum=a.value;break;case"multipleOf":e.multipleOf=a.value;break}return e}function qt(){return{type:"boolean"}}function tt(t,e){return b(t.type._def,e)}var Xt=(t,e)=>b(t.innerType._def,e);function at(t,e,a){const r=a??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,n)=>at(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Qt(t)}}var Qt=t=>{const e={type:"integer",format:"unix-time"};for(const a of t.checks)switch(a.kind){case"min":e.minimum=a.value;break;case"max":e.maximum=a.value;break}return e};function Kt(t,e){return{...b(t.innerType._def,e),default:t.defaultValue()}}function ea(t,e){return e.effectStrategy==="input"?b(t.schema._def,e):N()}function ta(t){return{type:"string",enum:Array.from(t.values)}}var aa=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function ra(t,e){const a=[b(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),b(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return a.forEach(s=>{if(aa(s))r.push(...s.allOf);else{let n=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:i,...o}=s;n=o}r.push(n)}}),r.length?{allOf:r}:void 0}function sa(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var me=void 0,P={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(me===void 0&&(me=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),me),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function rt(t,e){const a={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value;break;case"max":a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":D(a,"email",r.message,e);break;case"format:idn-email":D(a,"idn-email",r.message,e);break;case"pattern:zod":A(a,P.email,r.message,e);break}break;case"url":D(a,"uri",r.message,e);break;case"uuid":D(a,"uuid",r.message,e);break;case"regex":A(a,r.regex,r.message,e);break;case"cuid":A(a,P.cuid,r.message,e);break;case"cuid2":A(a,P.cuid2,r.message,e);break;case"startsWith":A(a,RegExp(`^${he(r.value,e)}`),r.message,e);break;case"endsWith":A(a,RegExp(`${he(r.value,e)}$`),r.message,e);break;case"datetime":D(a,"date-time",r.message,e);break;case"date":D(a,"date",r.message,e);break;case"time":D(a,"time",r.message,e);break;case"duration":D(a,"duration",r.message,e);break;case"length":a.minLength=typeof a.minLength=="number"?Math.max(a.minLength,r.value):r.value,a.maxLength=typeof a.maxLength=="number"?Math.min(a.maxLength,r.value):r.value;break;case"includes":{A(a,RegExp(he(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&D(a,"ipv4",r.message,e),r.version!=="v4"&&D(a,"ipv6",r.message,e);break}case"base64url":A(a,P.base64url,r.message,e);break;case"jwt":A(a,P.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&A(a,P.ipv4Cidr,r.message,e),r.version!=="v4"&&A(a,P.ipv6Cidr,r.message,e);break}case"emoji":A(a,P.emoji(),r.message,e);break;case"ulid":{A(a,P.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(a,"binary",r.message,e);break}case"contentEncoding:base64":{a.contentEncoding="base64";break}case"pattern:zod":{A(a,P.base64,r.message,e);break}}break}case"nanoid":A(a,P.nanoid,r.message,e)}return a}function he(t,e){return e.patternStrategy==="escape"?oa(t):t}var na=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function oa(t){let e="";for(let a=0;a<t.length;a++)na.has(t[a])||(e+="\\"),e+=t[a];return e}function D(t,e,a,r){var s;t.format||(s=t.anyOf)!=null&&s.some(n=>n.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...a&&r.errorMessages&&{errorMessage:{format:a}}})):t.format=e}function A(t,e,a,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(n=>n.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ue(e,r),...a&&r.errorMessages&&{errorMessage:{pattern:a}}})):t.pattern=Ue(e,r)}function Ue(t,e){var a;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let n="",i=!1,o=!1,p=!1;for(let u=0;u<s.length;u++){if(i){n+=s[u],i=!1;continue}if(r.i){if(o){if(s[u].match(/[a-z]/)){p?(n+=s[u],n+=`${s[u-2]}-${s[u]}`.toUpperCase(),p=!1):s[u+1]==="-"&&((a=s[u+2])!=null&&a.match(/[a-z]/))?(n+=s[u],p=!0):n+=`${s[u]}${s[u].toUpperCase()}`;continue}}else if(s[u].match(/[a-z]/)){n+=`[${s[u]}${s[u].toUpperCase()}]`;continue}}if(r.m){if(s[u]==="^"){n+=`(^|(?<=[\r
|
|
4
4
|
]))`;continue}else if(s[u]==="$"){n+=`($|(?=[\r
|